2 Replies Latest reply on Nov 20, 2007 7:00 AM by Amar Dhole

    Namespace error while deploying EJB3 ear

    Amar Dhole Newbie

      HI we are in the process of Migrating to EJB3 from 1.1

      in 1.1 descriptor we have following value in ejb-jar.xml

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd"> now in EJB3 we have changed it to
      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="ejb-jar">
      but JBOSS421 fails to deploy this schema. Any idea why this is happening?

      jboss throws following exception when we are trying to deploy ==>
      org.jboss.deployment.DeploymentException: ejb-jar.xml must either obey the right
      xml schema or define a valid DOCTYPE!
      at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMet
      aData.java:339)

      Thanks
      Amar

        • 1. Re: Namespace error while deploying EJB3 ear
          Wolfgang Knauf Master

          Hi Amar !

          your ejb-jar.xml should include a "version" and a "schemaLocation" attribute. Maybe that's the error.

          <ejb-jar id="ejb-jar_ID" version="3.0"
           xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">


          Hope this helps

          Wolfgang

          • 2. Re: Namespace error while deploying EJB3 ear
            Amar Dhole Newbie

            Thanks Wolfgang, now namespace problem is solved..
            but I am having one more problem that my entities are not binding

            Can we use the 3.0 namspace with 1.1 entities? my ejb-jar.xml look like this

            <?xml version='1.0' encoding='UTF-8'?>
            <!--ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="ejb-jar"-->
            <ejb-jar id="ejb-jar_ID" version="1.1"
             xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
             <enterprise-beans>
             <entity>
             <ejb-name>AssociationEnt</ejb-name>
             <home>com.martquest.entity.association.AssociationEntHome</home>
             <remote>com.martquest.entity.association.AssociationEntRemote</remote >
             <ejb-class>com.martquest.entity.association.AssociationEntBean</ejb-class>
             <persistence-type>Container</persistence-type>
             <prim-key-class>com.martquest.entity.association.AssociationEntPKey</prim-key-class>
             <reentrant>false</reentrant>
             <cmp-version>1.x</cmp-version>
             <cmp-field id="CMPAttribute_2">
             <field-name>enterpriseid</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_3">
             <field-name>name</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_4">
             <field-name>description</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_5">
             <field-name>type</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_6">
             <field-name>parentid</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_7">
             <field-name>childid</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_8">
             <field-name>modMemberID</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_9">
             <field-name>modDateTime</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_10">
             <field-name>modVersion</field-name>
             </cmp-field>
             <cmp-field id="CMPAttribute_1">
             <field-name>id</field-name>
             </cmp-field>
             </entity>
             </enterprise-beans>
             <assembly-descriptor id="AssemblyDescriptor_ID">
             <container-transaction id="MethodTransaction_1">
             <method id="MethodElement_1">
             <ejb-name>AssociationEnt</ejb-name>
             <method-intf>Remote</method-intf>
             <method-name>*</method-name>
             </method>
             <trans-attribute>Required</trans-attribute>
             </container-transaction>
             </assembly-descriptor>
            </ejb-jar>


            Thanks,
            Amar