1 Reply Latest reply on Oct 15, 2010 4:05 PM by tachoknight

    Setting dependencies in my SAR?

    tachoknight

      Hi all-

       

      I've written a SAR that uses JAXB to parse an XML file. In server.log I can see:

       

      2010-10-15 10:37:52,999 ERROR [com.mycompany.mysar.db.GetDBInfo] When unmarshalling, got: null
      javax.xml.bind.JAXBException
      - with linked exception:
      [java.lang.ClassNotFoundException: No ClassLoaders found for: com.sun.xml.bind.v2.ContextFactory]

       

      When I named the file zzzDBInfo.sar, it deploys and works perfectly, because it's the last file deployed, based on the filename. If I take out the "zzz", I get the error above.

       

      Okay, well, I would like to solve this properly. I believe it's because another service hasn't been deployed yet that provides this functionality. I believe I have tracked it down to "jboss:service=WebServer", so I added it to my jboss-service.xml file:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
          <mbean code="com.mycompany.mysar.db.GetDBInfo" name="com.mycompany.mysar.db:service=GetDBInfo">
              <depends>jboss:service=WebServer</depends>       
          </mbean>
      </server>

       

      However, this doesn't seem to help, as I still get the error when JBoss starts, and at the end of the JBoss boot sequence I get:

       

      --- MBeans waiting for other MBeans ---
      ObjectName: com.mycompany.mysar.db:service=GetDBInfo
        State: CONFIGURED
        I Depend On:
          jboss:service=WebServer

       

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss:service=WebServer
        State: NOTYETINSTALLED
        Depends On Me:
          com.mycompany.mysar.db:service=GetDBInfo

       

      My question is: Does the fact that I have the <depends> tag in jboss-service.xml make JBoss "wait" on the deployment of my sar, as I would think it does, and I just have the wrong dependency, or am I completely off the rails on how to do this, in general?

       

      Thanks for any hints or info!

       

      Ron

        • 1. Re: Setting dependencies in my SAR?
          tachoknight

          Okay, what I realize I didn't mention was that I was using JBoss 4.2.3, which, while it works, as I said, when the file is prefixed with "zzz", when the zzz was not there, it doesn't. I've been pouring through the logs and it seems that it is more of a classpath issue, which I still think is weird because it, theoretically, shouldn't work at all, no matter what I name the file.

           

          I switched to JBoss 5.1 and it loads fine without error. I guess I'm running into some weird 1.5 vs 1.6 issue. I'll see if I can find any more information to post here in case it helps anyone else.