-
1. Re: Any specific instructions for running EJB 2.1 on AS7?
mikemil Jul 10, 2012 3:53 PM (in response to mikemil)It's been a month and no responses... I decided to go ahead and try just deploying our large application on AS 7.1.1. I have moved a lot of our jars into the EAR/lib folder and removed the deployment descriptors for our MDBs and applications looks very close to being deployed but that doesn't necessarily mean that it will run!
I read in another forum posting that I would have to replace my jboss.xml with jboss-ejb3.xml - but is that just for running EJB3.1? Currently the ejb jars within my ear deploy successfully and each of my EJB2.1 stateless session beans spits out the info message about all the names that the bean has been bound to:
13:35:23,235 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named ApplicationService in deployment unit subdeployment "infrastructureserver.jar" of deployment "pposstoreserver.ear" are as follows:
java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService
java:app/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService
java:module/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService
java:jboss/exported/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService
java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceHome
java:app/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceHome
java:module/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceHome
java:jboss/exported/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceHome
java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocalHome
java:app/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocalHome
java:module/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocalHome
java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocal
java:app/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocal
java:module/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationServiceLocal
Attempting to load the bean above using the java:app format string returns NameNotFoundException. Attempting to load using java:global format string gets the following ClassCastException:
13:35:50,592 INFO [stdout] (MSC service thread 1-2) Lookup for java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService
13:35:54,053 INFO [org.jboss.ejb.client] (MSC service thread 1-2) JBoss EJB Client version 1.0.5.Final
13:35:56,740 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "pposstoreserver.ear" was rolled back with failure message Operation cancelled
13:35:56,743 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
13:36:13,761 ERROR [] (MSC service thread 1-2) problem with startup classes : java.lang.RuntimeException: problem connecting to EJB container
at com.jda.portfolio.infrastructure.base.service.ServiceLoader.getService(ServiceLoader.java:112)
at com.jda.portfolio.infrastructure.server.startup.StartupServlet.init(StartupServlet.java:95)
at javax.servlet.GenericServlet.init(GenericServlet.java:242)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873)
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
13:36:13,832 ERROR [] (MSC service thread 1-2) Caused by: null: java.lang.ClassCastException
at org.jboss.com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:246) [jboss-rmi-api_1.0_spec-1.0.4.Final.jar:1.0.4.Final]
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:158) [jboss-rmi-api_1.0_spec-1.0.4.Final.jar:1.0.4.Final]
at com.jda.portfolio.infrastructure.base.service.ServiceLoader.getService(ServiceLoader.java:97) [infrastructurebase.jar:]
at com.jda.portfolio.infrastructure.server.startup.StartupServlet.init(StartupServlet.java:95) [infrastructureserver.jar:]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]
Caused by: java.lang.ClassCastException: $Proxy33 cannot be cast to org.omg.CORBA.Object
at org.jboss.com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:225) [jboss-rmi-api_1.0_spec-1.0.4.Final.jar:1.0.4.Final]
... 14 more
13:36:13,903 ERROR [] (MSC service thread 1-2) Root cause: $Proxy33 cannot be cast to org.omg.CORBA.Object: java.lang.ClassCastException: $Proxy33 cannot be cast to org.omg.CORBA.Object
at org.jboss.com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:225) [jboss-rmi-api_1.0_spec-1.0.4.Final.jar:1.0.4.Final]
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:158) [jboss-rmi-api_1.0_spec-1.0.4.Final.jar:1.0.4.Final]
at com.jda.portfolio.infrastructure.base.service.ServiceLoader.getService(ServiceLoader.java:97) [infrastructurebase.jar:]
at com.jda.portfolio.infrastructure.server.startup.StartupServlet.init(StartupServlet.java:95) [infrastructureserver.jar:]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]
I am struggling to understand if I have to things differently to run our EJB 2.1 session beans vs what AS7 would do for an EJB 3.1 session bean?
Should I be able to modify my server-side code to do a context lookup for all 4 of the lookup strings below? I haven't tried the last version, but the first gets the exception above, and the middle two both return NameNotFoundException. Seems like the 1st entry successfully returns from the context.lookup(jdniName) but then fails on the PortableRemoteObject.narrow(ref, service.getHomeClass(); call that follows the lookup.
java:global/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService java:app/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService java:module/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService java:jboss/exported/pposstoreserver/infrastructureserver/ApplicationService!com.jda.portfolio.infrastructure.server.service.application.ApplicationService