3 Replies Latest reply on Dec 29, 2005 5:32 PM by newbeeuser

    Problem with ejb deployment!

    newbeeuser Newbie

      Hi,
      I am trying to deploy a simple hello bean ejb. I am getting following exception

      17:26:30,281 ERROR [MainDeployer] Could not create deployment: file:/C:/software
      s/jboss-4.0.3SP1/server/default/deploy/hellobean.jar
      org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right
      xml schema or define a valid DOCTYPE!

      ---------------------------------------------------------------------
      The ejb-jar.xml is given below
      <?xml version="1.0" encoding="UTF-8"?>
      <!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>

      <ejb-name>HelloBean</ejb-name>
      HelloHome
      Hello
      <ejb-class>HelloBean</ejb-class>
      <session-type> Stateless</session-type>
      <transaction-type>Bean</transaction-type>

      </enterprise-beans>
      </ejb-jar>
      ===========================================
      Please suggest how can the error be removed.

      Any help will be highly appreciated.
      Thanks a lot
      newbeeuser

        • 1. Re: Problem with ejb deployment!
          newbeeuser Newbie

          hi, is there any body out there who knows what is wrong?

          • 2. Re: Problem with ejb deployment!
            Sam Nasr Newbie

            Hello.
            issue is with your:
            HelloHome
            Hello
            inside your ejb-jar deployment descriptor. They are not delcared properly. THey need to be enclosed in appropriate tags (depending on local vs remote EJB bean deployment).

            When in doubt, check the Data type definition (dtd) referenced at the top of your document against your deployment descriptor to avoid these xml-validation errors.

            Thanks.

            • 3. Re: Problem with ejb deployment!
              newbeeuser Newbie

              Hi,
              Thanks for your reply. I tried the following deployment descriptor. I checked it again the xml validators and it is fine. I dont know what is wrong. Please suggest. It seems that the jboss site was ignoring the home and remote tags.

              <!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>
               <session>
               <ejb-name>Hello</ejb-name>
               <home>HelloHome</home>
               <remote>Hello</remote>
               <ejb-class>HelloBean</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Bean</transaction-type>
               </session>
              </enterprise-beans>
              </ejb-jar>