1 Reply Latest reply on Mar 18, 2003 12:01 PM by ertdredge

    URLComparator ClassNotFoundException

    hounce

      Hi all,

      after writing my own deployment sorter (derived from org.jboss.deployment.DeploymentSorter) named:
      test.deploy.MyDeploymentSorter
      I put it in the JAR file my-deploy.jar and copied it into my servers lib directory.

      During reboot of JBoss I got:

      16:06:45,934 INFO [MainDeployer] Starting deployment of package: file:/usr/jboss-3.0.2/server/default/lib/my-deploy.jar
      16:06:46,000 INFO [MainDeployer] Deployed package: file:/usr/jboss-3.0.2/server/default/lib/my-deploy.jar

      therefore I know that this JAR file is deployed.

      The content of the JAR file is:
      [225] jar tf /usr/jboss-3.0.2/server/default/lib/my-deploy.jar
      META-INF/
      META-INF/MANIFEST.MF
      test/
      test/deploy/
      test/deploy/MyDeploymentSorter.class

      therefore I know that the class file is really contained.

      But a few lines later comes the following output:

      16:06:54,860 WARN [URLDeploymentScanner] Unable to create URLComparator.
      java.lang.ClassNotFoundException: test.deploy.MyDeploymentSorter
      at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:140)
      at org.jboss.deployment.scanner.URLDeploymentScanner.setURLComparator(URLDeploymentScanner.java:103)
      ...

      Why is the class not found ?
      Am I missing something ? What ?

      Thanx in advance
      Hounce

        • 1. Re: URLComparator ClassNotFoundException
          ertdredge

          I just ran into this exact same problem.

          I tried to work around by explicitly putting the jar with my own Comparator in the run.sh classpath, but I get the following error:

          11:44:28,526 INFO [ServiceConfigurator] Problem configuring service jboss.deployment:type=DeploymentScanner,flavor=URL
          org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@433aa8 on mbean jboss.deployment:type=DeploymentScanner,flavor=URL; - nested throwable: (java.lang.NoClassDefFoundError: org/jboss/deployment/DeploymentSorter)

          Which just seems crazy to me, because I can set the configuration back to the regular DeploymentSorter and it finds that class fine.

          At this point I think I'm just going to explode jboss-system.jar where the default DeploymentSorter and PrefixDeploymentSorter live and put my own class in there, but that *can't* be the right way to do it. Anyone know where you're supposed to put this?

          - Ert