5 Replies Latest reply on Feb 3, 2003 2:05 PM by famousactress

    Dependency problems

    jhudsy

      Hi...

      I've got my application spread across a number of jar files. When I try to deploy the app, jboss complains that it cannot resolve certain classes. This is because it tries to deploy the jar files containing those classes after the jars that use the classes. Does anyone have any idea how I can (easily) get around this problem? At the moment, I am manually copying the files in the correct order, pausing to let jboss deploy them.

      I thought a .ear file would solve my problems, but I can't seem to get the file generated correctly.

      Nir

        • 1. Re: Dependency problems

          An ear is the simplest solution.

          You can use a in jboss.xml
          to force loading of the dependent bean or jar
          first.
          jboss.j2ee:service=EJB,jndiName=whatver
          jboss.j2ee:service=EJBModule,url=whatever
          use http://localhost:8080/jmx-console for the full names

          If you don't plan to hot-deploy, you can number the
          deployments
          10-loadmefirst.jar
          20-mesecond.jar
          see jboss-service.xml for the config changes
          to enable the prefix scanner.

          Regards,
          Adrian

          • 2. Re: Dependency problems
            chriswinters

            > An ear is the simplest solution.
            >
            > You can use a in jboss.xml
            > to force loading of the dependent bean or jar
            > first.
            > ...

            Does this go at the top level of the jboss.xml file, e.g.:


            foo

            Or do you need to put it in the bean declaration:


            <enterprise-beans>

            foo</depends

            I looked in the DTD for jboss.xml but didn't find anything about it.

            > If you don't plan to hot-deploy, you can number the
            > deployments
            > 10-loadmefirst.jar
            > 20-mesecond.jar
            > see jboss-service.xml for the config changes
            > to enable the prefix scanner.

            Also, why does hot deploy come into this? As I understand it, if you started up the server with 10-... and 20-... and then redeployed 20-..., everything would still be consistent. And if you redeployed 10-... then there would be a problem for beans in 20-... while it was redeploying, but after it would be ok.

            Of course, I could be wrong :-)

            Thanks much,

            Chris

            • 3. Re: Dependency problems

              It is per bean

              <enterprise-beans>

              <ejb-name>HelloWorld</ejb-name>
              <jndi-name>helloworld/Hello</jndi-name>
              jmx-object-name


              You can use any jmx ObjectName and have multiple .
              You can also specify dependencies against
              <container-configuration>

              If you redeploy
              10-loadmefirst.jar

              20-mesecond.jar is not redeployed so it may
              hold references to old classes from 10-loadmefirst.jar
              you will get ClassCastExceptions

              The prefix stuff only works during the initial boot.

              Regards,
              Adrian

              • 4. Re: Dependency problems
                tang_2001

                I've tried both:
                jboss.j2ee:service=EJB,jndiName=whatver
                jboss.j2ee:service=EJBModule,url=whatever

                And I still get the following error at startup:
                Depends On Me: org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@49eb9f on mbean jboss:service=Scheduler; - nested throwable: (java.security.InvalidParameterException: Given class Whatever is not valid or not found)]

                However everything is ok if I re-deploy my xxx-service.xml after.

                Do I miss something?
                Thanks.

                • 5. Re: Dependency problems
                  famousactress

                  Since we're on the subject of .. I've been trying to find out whether or not it's going to be documented in the dtd for JBoss.xml

                  Currently, it doesn't seem to be and I'm trying to get an XDoclet patch that supports generation of the attribute committed. The lack of dtd documentation is holding it up.

                  thanks,
                  phill