• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Misterious Problem invoking remote EJB3 on WAS 7

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i apology about my english.

I am trying with EJB 3 technology. I have two ears applications, one of them is a web application and the other one is an application with remote EJBs, using EJB 3.0. I deploy them in the same server, Websphere 7, and they start succesfully. My test is invoking EJBs through @EJB annotation and through "lookup", then, the web application has a Servlet with a reference at EJB through @EJB annotation, and other reference at remote interface, i.e.



I have the following problem: When i start the applications all works fine, i get the EJB annoted and through jndi lookup, but when i restart or republish the ear containing web application, i get the EJB annonted and it works fine, but when i try to get the EJB through JNDI lookup i get the following error:

"org.icabanas.pruebaconcepto.facade._ProductoSessionFacade_Stub incompatible with org.icabanas.pruebaconcepto.facade.ProductoSessionFacade"

Any idea about what happen?

Thanks in advanced!
 
Greenhorn
Posts: 24
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I correctly undertood the EJB is in a ear different from the JSP so You should Try this

java:global[/<app-name>]/<modulename>/<bean-name>[!<fullyqualified-interface-name>]

where app_name is the ear name, modulename is the EJB-JAR name, bean-name is the name of the bean, fully qualified name is the fully qualified name of your bean/interface. In this case the remote interface

for example
java:global/testEAR/testEJB/beanName!com.test.SessionRemote

I hope this can help
 
ismael cabanas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Massimiliano, you understand me perfectly.

I tried lookup with "java:global/prueba-concepto-ejbs-ear/prueba-concepto-ejbs/ProductoSessionFacadeEjb!org.icabanas.pruebaconcepto.facade.ProductoSessionFacade"

but i get the following exception:

[4/01/12 12:56:51:961 CET] 0000001b SystemErr R javax.naming.NameNotFoundException: Name global not found in context "java:".
 
ismael cabanas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I continue with my problem....

With the following jndi name "ejb/prueba-concepto-ejbs-ear/prueba-concepto-ejbs.jar/ProductoSessionFacadeEjb#org.icabanas.pruebaconcepto.facade.ProductoSessionFacade" i get the EJB, but if i restart the EAR containing the web application (the client application of the EJBs, they are in other EAR deploy on the same server), when i try get the EJB by lookup, i get the following exception

[4/01/12 13:22:05:616 CET] 0000001b SystemErr R java.lang.ClassCastException: org.icabanas.pruebaconcepto.facade._ProductoSessionFacade_Stub incompatible with org.icabanas.pruebaconcepto.facade.ProductoSessionFacade
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at org.icabanas.pruebaconcepto.web.servlet.ProductoServlet.doPost(ProductoServlet.java:55)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3933)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:275)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[4/01/12 13:22:05:616 CET] 0000001b SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
 
massimiliano cattaneo
Greenhorn
Posts: 24
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Sorry WAS 7 is J2EE 5 compiant not 6 this is why global doesn't work.

 
ismael cabanas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please, i need some help. I am going to expose my problem in other way:

Hi, i have two ears deployed in the same server, Websphere 7. One EAR contain my EJBs3 and the other EAR contain a web application, and i want to try to call remote EJBs through annontation and JNDI lookup.

In the web application EAR, i have the following Servlet:



And, in the EAR containing EJBs i have the following Session Stateless bean and his remote interface:



Ok, if i deploy the two ears in the server and execute the servlet, it works well, i get the EJBs by the two ways (annontation and JNDI lookup), and i get the expected trace (a simple text in the console):



But now, if i restart the EAR containing de web application, it doesn't work fine, i get the EJB annotated but i can't get the EJB through JNDI lookup and get the following trace:



What's wrong?, any idea?

Thanks in advanced!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, Ismael. I am now experiencing similar problem. I periodically get ClassCastException while doing remote lookup between two different EAR's on the same jvm. Have you found a solution?
 
reply
    Bookmark Topic Watch Topic
  • New Topic