3 Replies Latest reply on Feb 4, 2004 9:17 AM by shieroii

    dependent classes

    shieroii

      Hello all,

      is it not possible to mention some where other than classpath that a particular bean has its depending classes in some resources.jar?

      I have some session beans wrapped in different jar files and all of them depend on classes that are wrapped in resources.jar. resources.jar is included in jboss-classpath and everything executes fine. now, if I make some changes in the these depending classes, I have to restart the jboss server to bring those changes in effect where as if there some changes done in the bean its just enough to re-deploy the bean.

      With further trials, I noticed that if I dont include resources.jar in classpath and if I simply put the resources.jar in deploy folder alonwith the beans it still executes. And further changes in the resources.jar comes into affect once I save the changed resources.jar in deploy folder and re-deploy the beans. This is fine too, but the problem is during the start of the jboss server, I get classnot found exception as the beans are deployed first and resouces.jar is considered later. I know naming it alphabatically will solve the problem but I am looking for better solution..

      is it not possible to mention some where other than classpath that a particular bean has its depending classes in some resources.jar?

      thanks in advance!

        • 1. Re: dependent classes
          nagulapati

          Hello Shieroii,

          I am having few problems deploying EJB beans which are dependent on other classes. You seem to have everything working with respect to dependent classes. Hopefully you can answer my question :)

          One of EJB beans accesses a dependent class to perform the business logic. I packed my EJB artifacts, deployment descriptors and the dependent classes into a jar file and tried deploying on the Jboss server. While deploying it gives me a "NoClassDefFoundError" for the dependent class. Somehow it is not loading the class ...... do you know why?

          I tried the following options,

          1. Packed the dependent classes into a separate jar file and placed it in the "deploy" directory but when the server was restarted it is not loading the jar file because it is expecting a EJB jar file with all the interfaces. Can we deploy a jar file into the deploy directory with only utility classes and how?

          2. Tried setting the classpath by pointing it to the dependent classes but in vain

          You have said that,
          >>"I have some session beans wrapped in different jar files and all of them depend on classes that are wrapped in resources.jar. resources.jar is included in jboss-classpath and everything executes fine. "

          How different is "jboss-classpath" from "classpath". Can we set the jboss's classpath explicitly while launching the server? Could you please clarify me further on "jboss-classpath"?

          Here is the code snippet of my bean class "HelloWorldBean.java"
          ------------------------

          //Make a service using ServiceLocator
          AdminWebService admin = new AdminWebServiceLocator();

          //Get the stub using the Service
          AdminWebServiceSoap adminStub = admin.getAdminWebServiceSoap();

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

          Here the AdminWebService is an external interface which the bean is accessing.

          When I am deploying the bean with the dependent classes packed into a jar file, I am getting the following error
          -------------------------------------
          18:07:25,343 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
          Cause: Incomplete Deployment listing:
          Packages waiting for a deployer:

          Incompletely deployed packages:

          MBeans waiting for classes:

          MBeans waiting for other MBeans:
          [ObjectName: jboss.j2ee:jndiName=HelloWorld,service=EJB
          state: FAILED
          I Depend On:
          Depends On Me: java.lang.NoClassDefFoundError: AdminClient/AdminWebService]

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

          Do we have to change the "ejb-jar.xml" file and how can we use the <resource-ref> to point to dependent classes instead of dependent EJB's?

          I have been struggling with this since long time and would really appreciate any pointers or help!

          Thanks a lot in advance,
          Vivek

          • 2. Re: dependent classes
            shieroii

            Hello Vivek,

            the path (of jar file containing dependent classes) should be appended to the jboss-classpath (see run.bat in <jboss-home>/bin folder). this will solve your problem.

            here a snippet from run.bat...
            ...................
            set MYLIB_PATH=%MYLIB_PATH%F:\Java\lib\resources.jar;

            set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%MYLIB_PATH%
            ...................

            good luck!

            • 3. Re: dependent classes
              shieroii

              Ok, but the main question still remains the same!!