1 Reply Latest reply on Sep 14, 2015 11:41 PM by Mahesh Kumar

    java.lang.ClassNotFoundException in Jboss 7.2

    Mahesh Kumar Newbie

      Hi All ,

      how to set the multiple jar files in  Jboss 7.2 classpath.

      I have changed the MANIFEST.MF, jboss-deployment-structure.xml and module.xml also made some changes on domain.xml file but  still getting exception: java.lang.ClassNotFoundException error can you please help me.

      Jar file location is <$Jboss_Home/modules/com/<projectname>/mymodule/main

       

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

      <module xmlns="urn:jboss:module:1.1" name="com.<projectname>.mymodule">

      <resources>
      <resource-root path="."/>
      </resources>
      <dependencies>
      <module name="javax.api"/>
      <module name="javaee.api" />
      </dependencies>
      </module>

       

      --> cat MANIFEST.MF

      Manifest-Version: 1.0

      Ant-Version: Apache Ant 1.8.4

      Created-By: 1.6.0_24-b07 (Sun Microsystems Inc.)

      Dependencies: com.<projectname>.mymodule

       

       

      --> cat jboss\-deployment\-structure.xml

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

      <jboss-deployment-structure>

      <deployment>

      <dependencies>

      <module name="com.<projectname>..mymodule" />

         </dependencies>

        </deployment>

      </jboss-deployment-structure>


      and deleted the below entery on domain.xml file.

      <extension module="org.jboss.as.jaxrs"/>

      <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>

      below the error

      abc --> application name and abc.war is war fiel name

      -----------------------------------------------------------------------------------

      [Server:abc] 02:09:24,174 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry lib/eclipselink-2.3.2.jar in /content/abc.war/WEB-INF/lib/xyzHibernatePersist.jar  does not point to a valid jar for a Class-Path reference.
      [Server:abc] 02:09:24,174 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry lib/javax.persistence-2.0.3.jar in /content/abc.war/WEB-INF/lib/xyzHibernatePersist.jar  does not point to a valid jar for a Class-Path reference.
      [Server:abc] 02:09:24,175 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960: Class Path entry lib/org.eclipse.persistence.jpa.jpql_1.0.1.jar in /content/abc.war/WEB-INF/lib/xyzHibernatePersist.jar  does not point to a valid jar for a Class-Path reference.
      .
      .

      [[Server:abc] 02:09:26,254 WARN  [org.jboss.as.ee] (MSC service thread 1-2) JBAS011006: Not installing optional component com.pinetree.dep.tags.PrintCurrencyTag due to exception: java.lang.ClassNotFoundException: com.pinetree.dep.tags.PrintCurrencyTag from [Module "deployment.abc.war:main" from Service Module Loader]
      [Server:abc]    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_101]
      [Server:abc]    at java.lang.Class.forName(Unknown Source) [rt.jar:1.6.0_101]
      [Server:abc]    at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)
      [Server:abc]    at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:78) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
      [Server:abc]    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
      [Server:abc]    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
      [Server:abc]    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
      [Server:abc]    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_101]
      [Server:abc]    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_101]
      [Server:abc]    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_101]
      [Server:abc]
      .
      .
      .
      Server:abc] 02:09:27,345 INFO  [org.jboss.web] (ServerService Thread Pool -- 62) JBAS018210: Register web context: /abc
      [Server:abc] 02:09:27,552 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/abc]] (ServerService Thread Pool -- 62) JBWEB000289: Servlet init threw load() exception: java.lang.ClassNotFoundException: org.dom4j.DocumentException from [Module "deployment.abc.war:main" from Service Module Loader]
      [Server:abc]    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]
      [Server:abc]    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]

       

      Note:- this all jar file are there in  /content/abc.war/WEB-INF/lib path and and othere jar are there in <$Jboss_Home/modules/com/<projectname>/mymodule/main path .

      can you please help

       

      Thanks

      Mahesh