3 Replies Latest reply on Jan 29, 2004 2:25 PM by John Casey

    Jboss 3.2.3 giving [apparently wrong] syntax error

    John Casey Newbie

       

      "jdcasey" wrote:
      I'm sorry for the gigantic post, but I imagine that any help will need to see this in order to understand what I'm facing...thanks for your patience.

      I have used XDoclet/Ant to generate the homes/business interfaces for my beans, of which there are 4: 3 entity and 1 session. When I deploy them to the container as part of a greater EAR file, I get the following error:

      09:26:14,746 ERROR [XmlFileLoader] failed to load jboss.xml. There could be a syntax error.
      org.jboss.deployment.DeploymentException: Error in jboss.xml for Bean SubscriptionList: found in jboss.xml but not in ejb-jar.xml


      I've double- and triple-checked these [generated] files, and I can't spot the error. I'm at a loss for what else to do but post this. Can someone please tell me I'm stupid and point out the problem? I'm including the relevant contents of the ejb-jar.xml and the jboss.xml inline below...

      ejb-jar.xml:
      --------------------------------------------
      <entity >
      <description>[CDATA[Entity Bean to manage subscription lists.]]</description>
      <display-name>SubscriptionList</display-name>

      <ejb-name>SubscriptionList</ejb-name>

      <local-home>com.gru.apps.subscriberList.ejb.data.LocalSubscriptionListHome</local-home>
      < local >com.gru.apps.subscriberList.ejb.data.LocalSubscriptionList< /local > (spaces added in local element declarations to show element name.)

      <ejb-class>com.gru.apps.subscriberList.ejb.data.SubscriptionListBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.Integer</prim-key-class>
      <reentrant>False</reentrant>

      </entity>


      jboss.xml:
      -----------------------------------------
      <entity>
      <ejb-name>SubscriptionList</ejb-name>
      <local-jndi-name>local/SubscriptionList</local-jndi-name>

      <method-attributes>
      </method-attributes>

      </entity>



      Thanks in advance for any advice you all can offer.

      -john



        • 1. Re: Jboss 3.2.3 giving [apparently wrong] syntax error
          Darran Lofthouse Master

           

          "darranl" wrote:
          Do you have remote interfaces at all?

          I think I vagualy remember someone having a problem when they only had local interfaces, if that is the case then I think that it is likely that it is a fault but I would have to double check the specifications.


          • 2. Re: Jboss 3.2.3 giving [apparently wrong] syntax error
            John Casey Newbie

             

            "jdcasey" wrote:
            I do not have remote interfaces for these beans at all, which is an appropriate pattern for entity EJB's...

            Since posting the original question, I have diddled a bit with the jboss source for 3.2.3, and come up with the following debug info:

            13:39:30,837 INFO [STDOUT] URL for ejb-jar.xml: 'jar:file:/C:/j2ee-containers/jboss/jboss-3.2.3/server/default/tmp/deploy/tmp60071GreenEnergy-1.1.ear
            -contents/GreenEnergy-1.1.jar!/META-INF/ejb-jar.xml'
            Classloader: java.net.URLClassLoader@ea3cdf
            13:39:30,958 INFO [STDOUT] Got EJB named: 'GreenEnergyRequest' from ejb-jar.xml
            13:39:30,968 INFO [STDOUT] Got EJB named: 'GreenEnergyCBISAccountInfoView' from ejb-jar.xml
            13:39:30,968 INFO [STDOUT] Got EJB named: 'SnailMailFacade' from ejb-jar.xml
            13:39:30,988 INFO [STDOUT] Got EJB named: 'GreenEnergyRequestFacade' from ejb-jar.xml
            13:39:30,988 INFO [STDOUT] Got EJB named: 'GreenEnergyToSubscriptionsBridge' from ejb-jar.xml
            13:39:31,088 INFO [STDOUT] URL for jboss.xml: 'jar:file:/C:/j2ee-containers/jboss/jboss-3.2.3/server/default/tmp/deploy/tmp60071GreenEnergy-1.1.ear-c
            ontents/SubscriberEngine-1.1.jar!/META-INF/jboss.xml'
            Classloader: java.net.URLClassLoader@ea3cdf

            If you look carefully, you'll see that these two files (ejb-jar.xml and jboss.xml) are loaded from the same instance of URLClassLoader, but are in fact loaded from different jar files within that classloader. This would be the case if (a) EJB's shared a single classloader, and (b) the GreenEnergy EJB-jar didn't have a jboss.xml file...which is know is not the case.

            I'm still debugging to try to figure out why these two EJB's are apparently crossed up w.r.t. classloading, but if anyone has any pointers on where the classpath for this classloader is set (what classes), I'd sure appreciate it.

            < grumbling >
            This is why public member variables are a _bad_ idea...
            < /grumbling >


            • 3. Re: Jboss 3.2.3 giving [apparently wrong] syntax error
              John Casey Newbie

               

              "jdcasey" wrote:
              Alright, so I am at least *partially* stupid...

              I looked at the GreenEnergy jar file (the last to be deployed, and the real problem child), and found that it didn't include a jboss.xml. Therefore, the search for this file must have been taking the classloader hierarchy beyond that jar...I'm not at all sure how the SubscriberBean got into that classpath, however. This still smelly a little buggy, but I really don't have the time now to fully flesh this out.

              What I can say is that they both appeared to be loading (ejb-jar.xml and jboss.xml) from the same classloader, which only had a single URL in it (the GreenEnergy ejb-jar). This jar did NOT contain a jboss.xml file, as I mentioned above, and the parent of this classloader was something from com.sun.misc...which tells me it probably was the system CL...following the code calls is daunting to say the least, since most configuration takes place through direct variable assignment, not getters/setters.

              Anyway, onward and upward, I suppose. :)