0 Replies Latest reply on Jul 21, 2005 3:44 AM by Justin

    ClassNotFoundException when service depends on jar

    Justin Newbie

      JBoss 3.2.7

      I have a service, configured by the following xml file, that depends on the classes in a jar file. The jar file (simple.jar) is present in the deploy directory of the server.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
       <mbean code="com.test.Simple"
       name="com.test.simple:service=SimpleService">
      
       <classpath codebase="deploy" archives="simple.jar"/>
       </mbean>
      </server>
      

      I get the following error on startup:
      18:34:09,956 ERROR [MainDeployer] could not create deployment: file:/C:/dev/se
      ers/jboss/jboss-3.2.7/server/default/deploy/simple-service.xml
      org.jboss.deployment.DeploymentException: create operation failed for package
      le:/C:/dev/servers/jboss/jboss-3.2.7/server/default/deploy/simple-service.xml;
       nested throwable: (org.jboss.deployment.DeploymentException: No ClassLoaders
      und for: com.test.Simple; - nested throwable: (java.lang.ClassNotFoundException
       No ClassLoaders found for: com.test.Simple))
       at org.jboss.deployment.SARDeployer.create(SARDeployer.java:227)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:783)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
       at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)


      Is there any way to specify that a service depends on a jar file? The only workaround I see is by putting the jar file in the lib directory of the default server.

      Thanks