Discussion:
[jboss-user] [Beginner's Corner] - Re: invoking an EJB over iiop
giu fus
2012-12-24 09:55:13 UTC
Permalink
giu fus [https://community.jboss.org/people/giufus] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/784834#784834

--------------------------------------------------------------
Hi,

do you really make it work? What is your ejb version?
I followed the tips above but I'm not able to use ejb3 over IIOP and I found that the following issue is fixed in AS 7.

https://issues.jboss.org/browse/JBAS-7782?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel https://issues.jboss.org/browse/JBAS-7782?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel


Other useful info I found are here:

http://thetechtips.wordpress.com/2009/09/02/problems-with-ejb3-over-iiop-on-jboss/ http://thetechtips.wordpress.com/2009/09/02/problems-with-ejb3-over-iiop-on-jboss/

Many thanks.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/784834#784834]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
giu fus
2013-01-03 15:39:18 UTC
Permalink
giu fus [https://community.jboss.org/people/giufus] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/787363#787363

--------------------------------------------------------------
EJB3 invocations from other AS to EAP 5 is supported via IIOP theoretically because it requires use ***@RemoteHome annotations and EJB 2.1 business interfaces XD
To use IIOP, the EJB remote interface must extend EJBObject, a remote home that extends EJBHome just like in EJB 2.x. The bean must specify @RemoteHome(RemoteHome.class), ***@IIOP(interfaceRepositorySupported=false).

Ask me more about it if you need.

Cheers.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787363#787363]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Yves Martin
2013-02-05 16:52:05 UTC
Permalink
Yves Martin [https://community.jboss.org/people/ymartin] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796186#796186

--------------------------------------------------------------
So if I understand well, to use an EJB3 over IIOP in JBoss 6.x or EAP 5, it must be an EJB 2.x !

According to documentation JBoss 7.1 jboss-ejb3.xml deployment descriptor does the job: https://docs.jboss.org/author/display/AS71/EJB+IIOP+Guide https://docs.jboss.org/author/display/AS71/EJB+IIOP+Guide
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796186#796186]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
giu fus
2013-02-05 17:16:57 UTC
Permalink
giu fus [https://community.jboss.org/people/giufus] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796192#796192

--------------------------------------------------------------
This is what i saw with eap 5 / org 5 and EJB3. I think this solution comes from the above issue: https://issues.jboss.org/browse/JBAS-7782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel https://issues.jboss.org/browse/JBAS-7782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

At any rate you can leave your EJB3 as is, but you need to add those annotations.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796192#796192]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Yves Martin
2013-02-06 07:17:29 UTC
Permalink
Yves Martin [https://community.jboss.org/people/ymartin] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796270#796270

--------------------------------------------------------------
Thank you for your answer.

As I guess my customer will not agree seing JBoss specific annotations on its EJB3, I wonder if it may be possible to add annotations at deployment thanks to an "AOP domain" as described here: http://docs.jboss.org/ejb3/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html http://docs.jboss.org/ejb3/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html

By the way, I will give a try to JBoss 7 too.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796270#796270]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Yves Martin
2013-02-06 15:45:56 UTC
Permalink
Yves Martin [https://community.jboss.org/people/ymartin] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796378#796378

--------------------------------------------------------------
Hello,
I need some help to get my EJB3 published over IIOP.

My interface Service extends EJBObject.
I have added ServiceHome which extends EJBHome
My bean ServiceBean  now have to implement 5 methods I do not know how to write them:
- EJBHome getEJBHome()
- Handle getHandle()
- Object getPrimaryKey()
- boolean isIdentical(EJBObject arg0)
- void remove()

Am I on the right path ? How to implement these five methods ?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796378#796378]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
giu fus
2013-02-06 16:02:10 UTC
Permalink
giu fus [https://community.jboss.org/people/giufus] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796381#796381

--------------------------------------------------------------
To expose bean v3 over iiop in jboss 5 you need the right profile (look @ slimming jboss to know how to enable corba/iiop naming service etc...i remember "all" profile has corba enabled by default)
and ejb/interfaces like these:


1)
public interface MyRemote extends EJBObject {
String hello(String name) throws RemoteException;
}

2)
public interface MyRemoteHome extends javax.ejb.EJBHome {
MyRemote create() throws javax.ejb.CreateException, java.rmi.RemoteException
}

3)
@Stateless
@RemoteHome(MyRemoteHome.class)
@IIOP(interfaceRepositorySupported=false)
public class MySessionBean {

public String hello(String name) {
System.out.println("hello called for name: " + name);
return "Hello " + name;
}
}


then in jmx-console -> corbaNamingservice you should find the right name to use


Hoper this help,

bye
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796381#796381]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Yves Martin
2013-02-07 12:23:32 UTC
Permalink
Yves Martin [https://community.jboss.org/people/ymartin] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796506#796506

--------------------------------------------------------------
With @Stateless, @RemoteHome, @Remote and @IIOP annotations, my EJB3 no longer deploys in JBoss 6.1:

12:30:01,495 WARN  [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean ServiceBean, will create some
12:30:01,584 ERROR [RedirectingBeanInstantiatorDeployer] Error during undeploy: SNAPSHOT.jar/: java.lang.IllegalStateException: Not installed: org.jboss.ejb.bean.instantiator/EAR/SNAPSHOT/ServiceBean
Caused by: java.lang.ClassNotFoundException: Null class name
    at org.jboss.classloader.plugins.ClassLoaderUtils.checkClassName(ClassLoaderUtils.java:53) [jboss-classloader.jar:2.2.1.GA]
    at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:425) [jboss-classloader.jar:2.2.1.GA]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_39]
    at org.jboss.ejb3.effigy.common.JBossEnterpriseBeanEffigy.<init>(JBossEnterpriseBeanEffigy.java:52) [:0.2.0]
    at org.jboss.ejb3.effigy.common.JBossSessionBeanEffigy.<init>(JBossSessionBeanEffigy.java:40) [:0.2.0]
    at org.jboss.ejb3.effigy.int2.JBossBeanEffigyFactory.create(JBossBeanEffigyFactory.java:52) [:0.2.0]
    at org.jboss.ejb3.effigy.int2.JBossBeanEffigyFactory.create(JBossBeanEffigyFactory.java:37) [:0.2.0]
    at org.jboss.ejb3.EJBContainer.effigy(EJBContainer.java:466) [:1.7.21]

Have you got any idea about the mistake I did ? Do you recommend me to remove ejb-jar.xml and jboss.xml ?

My ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
         version="3.0">
  <enterprise-beans>
    <session>
      <ejb-name>ServiceBean</ejb-name>
      <business-remote>my.Service</business-remote>
      <ejb-class>my.ServiceBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
    </session>
  </enterprise-beans>
  <interceptors>
    <interceptor>
      <interceptor-class>org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor</interceptor-class>
    </interceptor>
    <interceptor>
      <interceptor-class>my.RollbackExceptionInterceptor</interceptor-class>
    </interceptor>
  </interceptors>
  <assembly-descriptor>
    <interceptor-binding>
      <ejb-name>*</ejb-name>
      <interceptor-class>org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor</interceptor-class>
      <interceptor-class>my.RollbackExceptionInterceptor</interceptor-class>
    </interceptor-binding>
  </assembly-descriptor>
</ejb-jar>

My jboss.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss xmlns=" http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation=" http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_1.xsd http://www.jboss.org/j2ee/schema/jboss_5_1.xsd" version="5.1">
  <enterprise-beans>
    <session>
      <ejb-name>ServiceBean</ejb-name>
      <jndi-name>my.service</jndi-name>
    </session>
</jboss>

Many thanks for your help
Yves
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796506#796506]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
giu fus
2013-02-07 15:14:14 UTC
Permalink
giu fus [https://community.jboss.org/people/giufus] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796549#796549

--------------------------------------------------------------
If you are talking about JBoss EAP 6 I think you should have a subscription, in that case you can ask to RH Support.
As I already mentioned, I tried it in AS 5 (with EJB and interfaces into an EAR archive).

I think you don't need descriptors..
At any rate my ejb-jar.xml was:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" xmlns=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee" xmlns:ejb=" http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
  <display-name>MySampleSession</display-name>
  <ejb-client-jar>MySessionClient.jar</ejb-client-jar>
</ejb-jar>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796549#796549]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Yves Martin
2013-02-07 16:18:03 UTC
Permalink
Yves Martin [https://community.jboss.org/people/ymartin] created the discussion

"Re: invoking an EJB over iiop"

To view the discussion, visit: https://community.jboss.org/message/796583#796583

--------------------------------------------------------------
OK. I am using JBoss AS 6.1. "EAP 6" is build over JBoss AS 7...
There were errors in my Remote interface JBoss 6.1 does not report properly where JBoss AS 7.1 did.
So now my EJB3 deploys in JBoss AS 7.1

But I still completely obscure "error due to the following reason(s): java.lang.ClassNotFoundException: Null class name" in JBoss AS 6.1
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/796583#796583]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
Loading...