4 Replies Latest reply on Apr 4, 2013 10:08 AM by inv3r53 d

    deploying ejb.jar fails due to class not found exception

    inv3r53 d Novice

      Hi,

       

      I try to deploy a ejb jar module into jboss and it fails with below error, i have the exception class present in the same jar.

       

      INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found ejbeartest.jar in deployment directory. To trigger deployment create a file called ejbeartest.jar.dodeploy

      INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "ejbeartest.jar"

      INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named TestBean in deployment unit deployment "ejbeartest.jar" are as follows:

       

          java:global/ejbeartest/TestBean!ejbeartest.TestBean

          java:app/ejbeartest/TestBean!ejbeartest.TestBean

          java:module/TestBean!ejbeartest.TestBean

          java:global/ejbeartest/TestBean

          java:app/ejbeartest/TestBean

          java:module/TestBean

       

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."ejbeartest.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ejbeartest.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "ejbeartest.jar"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014409: Could not load application exception class ejbeartest.TestException

                   in ejb-jar.xml

          at org.jboss.as.ejb3.deployment.processors.merging.ApplicationExceptionMergingProcessor.deploy(ApplicationExceptionMergingProcessor.java:95)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

      Caused by: java.lang.ClassNotFoundException: ejbeartest.TestException

                   from [Module "deployment.ejbeartest.jar:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_30]

          at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_30]

          at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.ejb3.deployment.processors.merging.ApplicationExceptionMergingProcessor.deploy(ApplicationExceptionMergingProcessor.java:88)

          ... 6 more

       

       

      and my ejb-jar.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1">

          <display-name>ejbeartest</display-name>

          <assembly-descriptor>

              <application-exception>

                  <exception-class>ejbeartest.TestException</exception-class>

              </application-exception>

          </assembly-descriptor>

      </ejb-jar>

       

       

      and if remove the application exception from the ejb-jar.xml , then deploy succeeds.