i***@epam.com
2008-02-20 14:16:15 UTC
Hi,<br />
<br />
I have 2 applications (EAR with ejb3 module and WAR with ejb3-client module) which located on different application servers. Every AS have ejb3 feature pack installed. I want to lookup/inject ejb remote interface to jsf managed bean/servlet but I can't do it :( <br />
<br />
1) When I try manually lookup ejb via initial context in my JSF managed bean I get<br /> <br /> <code>java.lang.ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with <RemoteInterfaceName></code> <br />
<br />
excepttion error. <br />
<br />
I have ejb-ref element declared in the application's web.xml and use it's ejb-ref-name in lookup method (<code>initialContext.lookup("java:comp/env/<ejb-ref-name>")</code>). This ejb-ref during deployment phase I bind to the actual ejb, which deployed on another app server. Since AS with WAR application has ejb3 feature pack installed I don't create any stubs for my ejb-client. Is it right? Or in spite of ejb3fp I must create stubs via createEJBStubs bat?<br />
<br />
2) In case of servlet I have an <code>"exception while injecting resource"</code> error message. <br />
<br />
Because of injection support in servlets I use @EJB annotation with name attribute. This name corresponds to the ejb-ref-name attribute of ejb-ref element in my web.xml descriptor. Naming URL and provider I specified in <code>jndi.properties</code> file which located in the classpath of application.<br />
<p />
Thus, in every case I can't lookup my remote ejb on different app server. Anybody can help me in these problems?<br />
Thanks in advance.
<br />
I have 2 applications (EAR with ejb3 module and WAR with ejb3-client module) which located on different application servers. Every AS have ejb3 feature pack installed. I want to lookup/inject ejb remote interface to jsf managed bean/servlet but I can't do it :( <br />
<br />
1) When I try manually lookup ejb via initial context in my JSF managed bean I get<br /> <br /> <code>java.lang.ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with <RemoteInterfaceName></code> <br />
<br />
excepttion error. <br />
<br />
I have ejb-ref element declared in the application's web.xml and use it's ejb-ref-name in lookup method (<code>initialContext.lookup("java:comp/env/<ejb-ref-name>")</code>). This ejb-ref during deployment phase I bind to the actual ejb, which deployed on another app server. Since AS with WAR application has ejb3 feature pack installed I don't create any stubs for my ejb-client. Is it right? Or in spite of ejb3fp I must create stubs via createEJBStubs bat?<br />
<br />
2) In case of servlet I have an <code>"exception while injecting resource"</code> error message. <br />
<br />
Because of injection support in servlets I use @EJB annotation with name attribute. This name corresponds to the ejb-ref-name attribute of ejb-ref element in my web.xml descriptor. Naming URL and provider I specified in <code>jndi.properties</code> file which located in the classpath of application.<br />
<p />
Thus, in every case I can't lookup my remote ejb on different app server. Anybody can help me in these problems?<br />
Thanks in advance.