2 Replies Latest reply on Aug 1, 2013 5:39 AM by Tomaz Cerar

    java.lang.ClassNotFoundException: javax.sql.Datasource

    Arun Varadharajan Newbie

      I'm trying to load an EJB Jar in Jboss7. But i'm getting ClassNotFoundException for javax.sql.Datasource as below:

       

      03:57:05,687 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."gem.ear"."ejb-jar-tl1-tl1layer.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."gem.ear"."ejb-jar-tl1-tl1layer.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "ejb-jar-tl1-tl1layer.jar" of deployment "gem.ear"

      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_25]

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

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

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011033: Could not load javax.sql.Datasource referenced in env-entry

      at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:159)

      at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.processDescriptorEntries(ResourceReferenceProcessor.java:73)

      at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:105)

      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: javax.sql.Datasource from [Module "deployment.gem.ear.ejb-jar-tl1-tl1layer.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.performLoadClass(ConcurrentClassLoader.java:398)

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

      at org.jboss.as.ee.component.deployers.ResourceReferenceProcessor.getResourceRefEntries(ResourceReferenceProcessor.java:157)

      ... 8 more

       

       

       

      Below is my application.xml, jboss-deployment-structure.xml and MANIFEST.MF contents.:

       

       

      <application  xmlns="http://java.sun.com/xml/ns/j2ee"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                            http://java.sun.com/xml/ns/javaee/application_6.xsd">

      ......

       

      <module>

          <ejb>ejb-jar-tl1-tl1layer.jar</ejb>

        </module>

      .....

       

      </application>

       

       

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

      <jboss-deployment-structure>

                <!-- Make sub deployments isolated by default, so they cannot see each others

                          classes without a Class-Path entry -->

                <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

                <deployment>

                          <dependencies>

                                    <module name="deployment.gem.ear.ssuintrf-adapter.rar" />

                                    <module name="deployment.gem.ear.nequeue_services.sar" />

                                    <module name="javax.api"/>

                          </dependencies>

                </deployment>

      <sub-deployment name="ejb-jar-tl1-tl1layer.jar">

                          <dependencies>

                                    <module name="javax.api" />

                          </dependencies>

                </sub-deployment>

      </jboss-deployment-structure>

       

       

      Manifest-Version: 1.0

      Ant-Version: Apache Ant 1.8.2

      Import-Package: javax.sql

       

      Am I missing something.. please help...