1 2 Previous Next 16 Replies Latest reply on May 31, 2004 3:59 AM by didi

    Possible JBoss Bug. Please suggest.

    newbeeuser

      Hi,
      I am using jboss 3.2.3. I am trying to deploy a simple ejb on it however it gives me the deployment errors. The same bean however deploys successfully on the jboss version 2.4.4.

      Given below is the deployment descriptor of the bean.

      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar
      PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd"
      >
      <ejb-jar>
      HelloBean
      <display-name>HelloBean</display-name>
      <enterprise-beans>

      <ejb-name>HelloBean</ejb-name>
      com.ws.HelloHome
      com.ws.HelloRemote
      <ejb-class>com.ws.HelloBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <ejb-ref>
      <ejb-ref-name>HelloBean</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      com.ws.HelloHome
      com.ws.HelloRemote
      </ejb-ref>


      </enterprise-beans>
      </ejb-jar>
      ------------------------------------------------------------------------------
      the error being thrown is given below.
      ------------------------------------------------------------------------------

      12:16:44,906 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
      2.3/server/default/deploy/hello.jar
      org.jboss.deployment.DeploymentException: ejb-jar.xml must define a valid DOCTYP
      E!
      at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMet
      aData.java:206)
      at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:141)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:436)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)


        • 1. Re: Possible JBoss Bug. Please suggest.
          newbeeuser

          I am now very sure that this is a bug in jboss. I tried deploying the application on jboss 2.4.10. It worked fine. I wonder why the guys from jboss are quiet. Just so that interested people can try this out. I am attaching the code too.

          Remote interface

          package com.ws;
          import javax.ejb.*;
          import java.rmi.*;
          public interface HelloRemote extends EJBObject
          {
          
           public abstract String performTransaction(java.lang.String uri) throws RemoteException ;
          
          
          }


          Home Interface

          package com.ws;
          
          import javax.ejb.*;
          import java.rmi.*;
          
          public interface HelloHome extends EJBHome {
          
           /** Creates a new instance of HelloHome */
          
           public HelloRemote create() throws CreateException, RemoteException ;
          }


          Session Bean
          package com.ws;
          
          import javax.ejb.*;
          import java.rmi.*;
          public class HelloBean implements SessionBean
          {
           public String performTransaction(java.lang.String uri) throws RemoteException
           {
           return "Hello World";
           }
          
           public void ejbCreate()
           {
          
           }
          
           public void ejbRemove()
           {
           }
          
           public void ejbPassivate()
           {
           }
          
           public void ejbActivate()
           {
           }
          
           public void setSessionContext(SessionContext sessioncontext)
           {
           ctx = sessioncontext;
           }
          
           SessionContext ctx;
          
          }




          • 2. Re: Possible JBoss Bug. Please suggest.
            darranl

            What happens if you replace


            <?xml version="1.0"?>


            with

            <?xml version="1.0" encoding="UTF-8"?>


            ?

            That is the main diference that I can see between mine and yours.

            • 3. Re: Possible JBoss Bug. Please suggest.
              jonlee

              JBoss 3.2.x is more strict about the XML checking for deployment descriptors than the 2.4.x series. Most likely, the XML parser is getting upset with the lack of encoding attribute. The DOCTYPE might also be wrong and this can also cause problems but your DOCTYPE example looks OK to me.

              • 4. Re: Possible JBoss Bug. Please suggest.
                sesques

                I use JBoss 3.2.3 and I can say that:
                - JBoss don't care about encoding as much as you do not use UNICODE characters.
                - I copy and paste your file header (xml processing instruction and DOCTYPE declaration) in my ejb-jar.xml and I have no problem in deployment.

                It can be practical to blame JBoss and its team but useless to solve that problem. I suggest you to avoid theses comments if you want we help you.

                Back to the problem, your ejb-jar seems OK. Perhaps the ejb-jar you deploy is not the same you post in this forum (already seen).
                Also, you can enable more traces:
                Add

                <category name="org.jboss.ejb.plugins">
                 <priority value="DEBUG" class="org.jboss.logging.XLevel"/>
                </category>
                

                in the log4j.xml file and look at the server log file.

                Keep cool, newbeeuser



                • 5. Re: Possible JBoss Bug. Please suggest.
                  newbeeuser

                  Thanks for all the replies. Just want to say one thing. My intentions were to malign Jboss. I just want to get the problem solved. Which is still the same. My deployment descriptors are exactly what I have posted here.
                  I am not denying the fact the I could be possibly missing on some initial configuration the software needs. So, any pointers in that direction will be appreciated.





                  • 6. Re: Possible JBoss Bug. Please suggest.
                    mikefinn

                    Are we all looking at the same XML?

                    The one posted at the start of this thread won't even validate against the DTD. Text where it can't be, no , classnames outside of home and remote tags, etc. I don't know how it could have deployed anywhere.

                    Something like this might work better:

                    <?xml version="1.0"?>
                    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
                    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
                    <ejb-jar>
                    <enterprise-beans>

                    <![CDATA[Hello Bean]]>
                    <ejb-name>HelloBean</ejb-name>
                    com.ws.HelloHome
                    com.ws.HelloRemote
                    <ejb-class>com.ws.HelloBean</ejb-class>
                    <session-type>Stateless</session-type>
                    <transaction-type>Bean</transaction-type>
                    <ejb-ref>
                    <ejb-ref-name>HelloBean</ejb-ref-name>
                    <ejb-ref-type>Entity</ejb-ref-type>
                    com.ws.HelloHome
                    com.ws.HelloRemote
                    </ejb-ref>

                    </enterprise-beans>
                    </ejb-jar>

                    mike

                    • 7. Re: Possible JBoss Bug. Please suggest.
                      newbeeuser

                      Hi,
                      I think the forum's GUI parses the home and remote interface to display this. If you compare, both our home and remote interfaces appear the same way.
                      Newbee

                      • 8. Re: Possible JBoss Bug. Please suggest.
                        mikefinn

                        Hehehe. Sorry - it looks like nukes is stripping out *some* of the XML - weird - so what I thought was bad XML maybe was OK? Imagine my surprise when my 'good' xml was the same as the 'bad' xml....

                        Even the jboss-user-mirrored version I got was hammered.

                        Sorry for the confusion....

                        mike

                        • 9. Re: Possible JBoss Bug. Please suggest.
                          newbeeuser

                          But hey, thanks a lot. I think I will have to struggle more on this.

                          • 10. Re: Possible JBoss Bug. Please suggest.
                            jonlee

                            You might try XDoclet to help you generate the deployment descriptors. We know that works and the XML generated is 100% acceptable by JBoss. I'm suspecting that there is perhaps some (hidden) characters the parser does not like or something to that effect.

                            • 11. Re: Possible JBoss Bug. Please suggest.
                              sesques

                              In fact, it can be usefull you describe your environment.
                              You says that the application works fine on JBoss 2.4.10.
                              With the same hello.jar ?
                              Or do you re-package it ?

                              If any "bad character" was in the file, I don't think that the deployment was OK on any version of JBoss. But why not ?

                              Try activate more traces like I tell you before. Perhaps we got more infos.

                              Pascal

                              • 12. Re: Possible JBoss Bug. Please suggest.
                                newbeeuser

                                Hi,
                                Thanks for the pointers and the replies. Yes, the application gets deployed successfully on the 2.4.10. . I drop the same file in the jboss3.2.3. it gives deployment errors.

                                As far the jboss installation goes. I downloaded the jboss application and i didnt do any configuration on it.

                                given is the structure of the jar file
                                com
                                META-INF

                                com package contains the java files and META-INF contains the ejb-jar.xml

                                I am using the

                                jar cvf hello.jar com META-INF
                                command to create the jar file.

                                I there any way I can upload the file or it will be great if you guys can email me the sample of the jar file that works fine( a simple hello world jar).
                                Thanks
                                newbee





                                • 13. Re: Possible JBoss Bug. Please suggest.
                                  sesques

                                   

                                  "newbeeuser" wrote:

                                  Hi,
                                  I am using jboss 3.2.3. I am trying to deploy a simple ejb on it however it gives me the deployment errors. The same bean however deploys successfully on the jboss version 2.4.4.

                                  Given below is the deployment descriptor of the bean.

                                  <?xml version="1.0"?>
                                  <!DOCTYPE ejb-jar
                                  PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
                                  "http://java.sun.com/dtd/ejb-jar_2_0.dtd"
                                  >
                                  <ejb-jar>
                                  <description>HelloBean</description>
                                  <display-name>HelloBean</display-name>
                                  <enterprise-beans>
                                  <session>
                                  <ejb-name>HelloBean</ejb-name>
                                  <home>com.ws.HelloHome</home>
                                  <remote>com.ws.HelloRemote</remote>
                                  <ejb-class>com.ws.HelloBean</ejb-class>
                                  <session-type>Stateless</session-type>
                                  <transaction-type>Bean</transaction-type>
                                  <ejb-ref>
                                  <ejb-ref-name>HelloBean</ejb-ref-name>
                                  <ejb-ref-type>Entity</ejb-ref-type>
                                  <home>com.ws.HelloHome</home>
                                  <remote>com.ws.HelloRemote</remote>
                                  </ejb-ref>


                                  </session>
                                  </enterprise-beans>
                                  </ejb-jar>


                                  Looking more precisely at your descriptor and your code (because I want to help you), someting surprises me:
                                  Your says that its a simple EJB and this EJB is a stateless session bean. What is this reference to an entity bean with the same name ?
                                  without an ejb-link.
                                  How is your jboss.xml ?
                                  Why this reference ?


                                  • 14. Re: Possible JBoss Bug. Please suggest.
                                    newbeeuser

                                    My jboss reference looks like

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
                                    
                                    <jboss>
                                     <secure>false</secure>
                                     <enterprise-beans>
                                     <session>
                                     <ejb-name>HelloBean</ejb-name>
                                     <jndi-name>HelloBean</jndi-name>
                                     <ejb-ref>
                                     <ejb-ref-name>HelloBean</ejb-ref-name>
                                     <jndi-name>HelloBean</jndi-name>
                                     </ejb-ref>
                                     </session>
                                     </enterprise-beans>
                                    </jboss>
                                    


                                    The exceptions are being thrown around the DOCTYPE element. So, I am assuming that there is some thing wrong around that tag only.


                                    1 2 Previous Next