2 Replies Latest reply on Jan 6, 2006 2:35 AM by Alistair Israel

    On upgrade to JBoss 4.0, javax.ejb.SessionBean class not fou

    Alistair Israel Newbie

      Bear with me with my longwinded explanation. I'm using:
      - JBoss AS 4.0.3 SP1 ("default" install)
      - JDK 1.5.0_05
      - Mac OS X 10.4.3, ppc

      I have some EJBs (packaged as simple JARs) which used to run fine on JBoss 3.2.7 (JDK 1.4.2). Now I'm required to move to Java 5.0, as well as JBoss 4.0.

      After installing JBoss 4.0 and copying the JARs over to the deploy directory, first I started getting the following error

      18:24:49,947 WARN [verifier] EJB spec violation:
      Bean : ActivitySSB
      Section: 22.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
      Info : Class not found on 'com.enterworks.server.ejb.stateless.ActivitySSB': Unexpected error during load of: com.enterworks.server.ejb.stateless.ActivitySSB, msg=javax/ejb/SessionBean
      
      18:24:49,955 ERROR [MainDeployer] Could not create deployment: file:/Users/aisrael/Applications/Enterworks/EPX/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
      

      To me that seemed like javax.ejb.SessionBean wasn't being seen by the classloader. http://wiki.jboss.org/wiki/Wiki.jsp?page=EnableClassloaderLogging confirmed my guess when I saw:
      [38536,RepositoryClassLoader,main] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@82af41{ url=file:/Users/aisrael/Applications/Enterworks/EPX/jboss-4.0.3SP1/server/default/tmp/deploy/tmp28804ActivityJB.jar ,addedOrder=35} name=com.enterworks.server.ejb.BaseStatelessBean not found
      [38543,LoadMgr3,main] End beginLoadTask, LinkageError for task: org.jboss.mx.loading.ClassLoadingTask@c85932{classname: com.enterworks.server.ejb.BaseStatelessBean, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@82af41{ url=file:/Users/aisrael/Applications/Enterworks/EPX/jboss-4.0.3SP1/server/default/tmp/deploy/tmp28804ActivityJB.jar ,addedOrder=35}, loadedClass: nullnull, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0, #CCE: 0}
      java.lang.NoClassDefFoundError: javax/ejb/SessionBean
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
       .
       .
       .
      
      (ActivitySSB is a concrete subclass of BaseStatelessBean)

      Ok, so javax.ejb.SessionBean can be found under "$JBOSS_HOME/client/jboss-j2ee.jar". Now if I add that to the JBOSS_CLASSPATH, I get a different class not found:
      18:40:51,082 INFO [EjbModule] Deploying ActivitySSB
      18:40:51,840 WARN [EjbModule] Could not load the org.jboss.webservice.server.ServiceEndpointInterceptor interceptor
      18:40:52,281 WARN [ServiceController] Problem creating service jboss.j2ee:jndiName=es/ActivitySSB,service=EJB
      java.lang.NoClassDefFoundError: org/jboss/util/id/SerialVersion
       at javax.security.jacc.EJBMethodPermission.<clinit>(EJBMethodPermission.java:45)
       at org.jboss.ejb.EjbModule.addMissingMethodPermissions(EjbModule.java:1073)
       at org.jboss.ejb.EjbModule.createMissingPermissions(EjbModule.java:1021)
       at org.jboss.ejb.Container.createService(Container.java:724)
       .
       .
       .
      


      I found that org.jboss.util.id.SerialVersion can be found in "$JBOSS_HOME/lib/jboss-common.jar". After adding that, another class is not found:
      Failed to boot JBoss:
      org.jboss.deployment.DeploymentException: Could not initialise deployment: file:/Users/aisrael/Applications/Enterworks/EPX/jboss-4.0.3SP1/server/default/conf/jboss-service.xml; - nested throwable: (java.lang.NoClassDefFoundError: EDU/oswego/cs/dl/util/concurrent/ConcurrentReaderHashMap)
       at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:39)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:785)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)


      ConcurrentReaderHashMap is in "$JBOSS_HOME/lib/concurrent.jar". Added that, and now it seems JBoss runs - at least, I can see an active Java process running. If I press "Ctrl+C", I get the typical "Shutting down, Shutdown complete, Halting VM".

      My problem now is I can't see any other logging/console output! Nothing in the console. Nothing in "server/default/log". My client application (which used to work) doesn't work - which leads me to believe JBoss didn't boot up or load my beans properly.

      I have a sneaky suspicion I'm barking up the wrong tree or going about this in totally the wrong way, but as a relative newbie to JBoss (we were just tasked to do the upgrade) I'm at a loss at what I'm doing wrong.

      Thanks in advance![/url]

        • 1. Re: On upgrade to JBoss 4.0, javax.ejb.SessionBean class not
          Scott Stark Master

          Nothing should be added to the jvm classpath. Show the full exception trace and log context.

          • 2. Re: On upgrade to JBoss 4.0, javax.ejb.SessionBean class not
            Alistair Israel Newbie

            Thanks. I guessed as much. Here's the relevant part of the console log if I don't set JBOSS_CLASSPATH before calling "run.sh":

            2006-01-06 14:32:16,318 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,318 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,319 DEBUG [org.jboss.deployment.MainDeployer] Copying file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar -> /Users/aisrael/Applications/jboss-4.0.3SP1/server/default/tmp/deploy/tmp15196ActivityJB.jar
            2006-01-06 14:32:16,329 DEBUG [org.jboss.deployment.MainDeployer] using deployer MBeanProxyExt[jboss.ejb:service=EJBDeployer]
            2006-01-06 14:32:16,330 DEBUG [org.jboss.ejb.EJBDeployer] init, ActivityJB.jar
            2006-01-06 14:32:16,339 DEBUG [org.jboss.ejb.EJBDeployer] looking for nested deployments in : file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,342 DEBUG [org.jboss.webservice.ServiceDeployer] handleNotification: org.jboss.deployment.SubDeployer.init,ActivityJB.jar
            2006-01-06 14:32:16,343 DEBUG [org.jboss.deployment.DeploymentInfo] createLoaderRepository from config: LoaderRepositoryConfig(repositoryName: JMImplementation:service=LoaderRepository,name=Default, repositoryClassName: null, configParserClassName: null, repositoryConfig: null)
            2006-01-06 14:32:16,343 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/tmp/deploy/tmp15196ActivityJB.jar
            2006-01-06 14:32:16,343 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@3a3e1b, cl=org.jboss.mx.loading.UnifiedClassLoader3@597892{ url=file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/tmp/deploy/tmp15196ActivityJB.jar ,addedOrder=0}
            2006-01-06 14:32:16,343 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.UnifiedLoaderRepository3@3a3e1b, cl=org.jboss.mx.loading.UnifiedClassLoader3@597892{ url=file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/tmp/deploy/tmp15196ActivityJB.jar ,addedOrder=0}
            2006-01-06 14:32:16,344 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader3@597892{ url=file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/tmp/deploy/tmp15196ActivityJB.jar ,addedOrder=0}
            2006-01-06 14:32:16,354 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,354 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,355 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,355 DEBUG [org.jboss.ejb.EJBDeployer] create, ActivityJB.jar
            2006-01-06 14:32:16,664 DEBUG [org.jboss.ejb.EJBDeployer] Verifying file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            2006-01-06 14:32:16,810 WARN [org.jboss.ejb.EJBDeployer.verifier] EJB spec violation:
            Bean : ActivitySSB
            Section: 22.2
            Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
            Info : Class not found on 'com.enterworks.server.ejb.stateless.ActivitySSB': Unexpected error during load of: com.enterworks.server.ejb.stateless.ActivitySSB, msg=com/enterworks/server/ejb/BaseStatelessBean
            
            2006-01-06 14:32:16,924 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
            2006-01-06 14:32:16,926 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
            2006-01-06 14:32:16,955 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
            2006-01-06 14:32:16,875 ERROR [org.jboss.deployment.MainDeployer] Could not create deployment: file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
             at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:575)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
             at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
             at $Proxy29.create(Unknown Source)
             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
             at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
             at $Proxy6.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
            2006-01-06 14:32:16,985 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@22deff35{ url=file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar, deployedLastModified=0 }
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
             at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:575)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
             at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
             at $Proxy29.create(Unknown Source)
             at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
             at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
             at $Proxy6.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
            2006-01-06 14:32:16,990 DEBUG [org.jboss.deployment.scanner.URLDeploymentScanner] Watch URL for: file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar -> file:/Users/aisrael/Applications/jboss-4.0.3SP1/server/default/deploy/ActivityJB.jar
            
            Obviously, "ActivitySSB" depends upon (extends) "BaseStatelessBean" which can be found in a separate JAR (our own "eserver.jar". BaseStatelessBean implements javax.ejb.SessionBean which is why I thought of putting both "eserver.jar" and "jboss-j2ee.jar" in the classpath which is what led to much stress and hair-pulling.

            What I did was place that "eserver.jar" into "server/default/lib", and deployment succeeded. After running the client, a couple of other required classes/JARs weren't being found (another one of our jars, and the JDBC driver JAR). I put those in the JBOSS_CLASSPATH environment variable and they didn't seem to cause any problems.

            Excuse the newbie-ness, but a couple of questions:
            1. Is placing them in "server/default/lib" the preferred or only way of adding JAR depenencies? What if that JAR I need is used by other apps and I want to keep only one copy of it in one place during distribution?

            2. Or, how come adding the other JARs to JBOSS_CLASSPATH didn't seem to cause any problems?