hi all,
i am trying call an ejb from another ejb. the two ejbs are in different servers. So I
am calling a method from AEJB to BEJB. JBoss 3.0.4 is used. Here at AEJB, i have given
like this.
Properties props = new Properties();
props.setProperty( "java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory" );
props.setProperty( "java.naming.provider.url", "Remote Machine IP:1099" );
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
Context context = new InitialContext(props);
BHome
bHome=(BHome)javax.rmi.PortableRemoteObject.narrow(context.lookup("ejb/RemoteBean1"),BHome.class);
BInterface bInterface = bHome.create();
bInterface.method1 ();
Here ejb/RemoteBean1 is the jndi name of the remote ejb and BHome is the the
home and BInterface is the remote interface.
At BeanA side, ejb-jar.xml-
<ejb-name>AEJB</ejb-name>
package.AHome
package.AInterface
<ejb-class>package.AEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/RemoteBean1</ejb-ref-name>
<ejb-ref-type>Stateless</ejb-ref-type>
package.BHome
package.BInterface
</ejb-ref>
At Bean A side jboss.xml -
<ejb-name>AEJB</ejb-name>
<ejb-ref>
<ejb-ref-name>ejb/RemoteBean1</ejb-ref-name>
<jndi-name>jnp://Remote Server IP:1099/ejb/RemoteBean1</jndi-name>
</ejb-ref>
At Bean B side ejb-jar.xml
<ejb-name>ejb/RemoteBean1</ejb-name>
package.BHome
package.BInterface
<ejb-class>package.BEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
Now I am getting remote exception. Pls help me. Both of in same port
1099. Home object is creating. But when remote interface is created by home.create(),
it is showing remote eception. At both the servers, EJBs are bound and identifying it
as remote EJB. Expecting a reply as early as possible. Thanks
anamika
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3823024#3823024
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3823024
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user