Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection on EJB3  RSS feed

 
Jose Alberto Guastavino
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I use reflection on EJB 3.0I
I need to do a project that calls an EJB that is known only at runtime. How can I do that. When I make the lookup to the EJB3 component, I receive an Exception


[#|2006-11-09T06:23:32.687-0300|SEVERE|sun-appserver-pe9.0|javax.naming.NamingException|_ThreadID=11;_ThreadName=httpWorkerThread-8080-0;_RequestID=74a4b9e1-ea6e-4a1e-9439-dae2270e4778;|exception caught
javax.naming.NamingException: ejb ref resolution error for remote business interfaceejb.NewsEntityFacadeRemote [Root exception is java.lang.ClassNotFoundException: ejb.NewsEntityFacadeRemote]
at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:313)
at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:61)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
at prueba.PruebaServlet.getRemoteObject(PruebaServlet.java:223)
at prueba.PruebaServlet.processRequest(PruebaServlet.java:60)
at prueba.PruebaServlet.doGet(PruebaServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.lang.ClassNotFoundException: ejb.NewsEntityFacadeRemote
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1494)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275)
at com.sun.ejb.EJBUtils.getBusinessIntfClassLoader(EJBUtils.java:531)
at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:283)
... 32 more
 
Jose Alberto Guastavino
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Session Bean defined by the following annotation

@Stateless(mappedName="ejb/SampleApplicationData3Bean")

Depending on the calling instruction (lookup) I recieve different Exceptions

This is the list of argumens to the lookup method and Exceptions.
The addresses are extracted from the result of the list method of the InitialContext()



ejb/SampleApplicationData3Bean

javax.naming.NamingException: ejb ref resolution error for remote business interfacear.com.gPanels.persistence.sample.SampleApplicationData3Remote [Root exception is java.lang.ClassNotFoundException: ar.com.gPanels.persistence.sample.SampleApplicationData3Remote]

-------------------------------------------------------------------------
ejb/SampleApplicationData3Bean__3_x_Internal_RemoteBusinessHome__

java.rmi.AccessException: CORBA NO_PERMISSION 9998 Maybe; nested exception is: org.omg.CORBA.NO_PERMISSION: vmcid: 0x2000 minor code: 1806 completed: Maybe
---------------------------------------------------------------------------

ejb/SampleApplicationData3Bean#ar.com.gPanels.persistence.sample.SampleApplicationData3Remote

javax.naming.NamingException: ejb ref resolution error for remote business interfacear.com.gPanels.persistence.sample.SampleApplicationData3Remote [Root exception is java.lang.ClassNotFoundException: ar.com.gPanels.persistence.sample.SampleApplicationData3Remote]

------------------------------------------------------------------------------
ejb/SampleApplicationData3Bean#ar.com.gPanels.persistence.sample.SampleApplicationData3Remote/remote

javax.naming.NameAlreadyBoundException: SampleApplicationData3Bean#ar.com.gPanels.persistence.sample.SampleApplicationData3Remote

---------------------------------------------------------------------------
ejb/SampleApplicationData3Bean/remote

javax.naming.NameAlreadyBoundException: SampleApplicationData3Bean

------------------------------------------------------------------------------
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!