4 Replies Latest reply on Oct 1, 2001 7:05 AM by p_d_austin

    Building Jbos ejb with Ant

    tsip

      Hello

      I am testing for the first time Jboss and ant 1.4. I am building ejb files with ant and i am getting the following error:
      [ejbjar] 1 deployment descriptors located.
      [ejbjar] Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD Enterprise Java
      Beans 1.1//EN, systemId: http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd) to a local entity

      I have use an example of javaworld website(http://www.javaworld.com/javaworld/jw-09-2000/ejbframe/jw-0929-ejbframe.zip
      ). So i supposse that those file are correct. I have changed the setting as it use to be. But i have no clue what this error means.

      Can anyone help me. please respons it to tsip168@hotmail.com

      Thanks

      Ip Ting Shing

        • 1. Re: Building Jbos ejb with Ant
          p_d_austin

          1. Did you change the weblogic task to the jboss task?

          2. If youare not connected to the internet when you use a xml parser it will try to look up the dtd via the url if it has not been told where to find a local copy of the dtd. The jboss/weblogic task supports a nested dtd tag that allows you to specifiy the local location of that file.









          You will need to download the dtd and in this case put it in c:\jboss\lib\dtd.

          Paul

          • 2. Re: Building Jbos ejb with Ant
            tsip

            i have actually internet connection. and i can visualize/access the dtd file itself.

            I am actually building the ejb with the option jbossejb, so it will look at the following task:








            As you can see i have add the option that you have proposal and putting the dtd file in the right directory. After running: ant jbossejb. I still get the same error ( [ejbjar] Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN, systemId: http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd) to a local entity)
            It seems that the ant doesn't look this option of this file. It will loop a the other .xml file with the parameter of deployment:

            <?xml version="1.0"?>

            <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems,Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>

            <ejb-jar>
            <enterprise-beans>

            <ejb-name>frameworkTester</ejb-name>
            framework.test.ejb.FrameworkTesterHome
            framework.test.ejb.FrameworkTester
            .....
            <ejb-</ejb-jar>

            I have changed the second line into the follwing: <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems,Inc.//DTD Enterprise JavaBeans 1.1//EN' 'c:\dtd\ejb-jar_1_1.dtd'>


            Then i get the following error:
            D:\java\test\build.xml:73: SAXException while parsing 'framework\test\ejb\FrameworkTester-ejb-jar.xml'. This probably indicates badly-formed XML. Details: Relative URI "c:\dtd\ejb-jar_1_1.dtd"; can not be resolved without a document URI.
            It seems only to accept http protocol

            I have also try with a webserver locally install in my machine(hostname:etsswpc05)
            'http://etsswpc05:8083/ejb-jar.dtd'

            Then i get the same error:
            ( [ejbjar] Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN, systemId: http://etsswpc05:8083/ejb-jar.dtd) to a local entity)

            Have yoou any further idea what could cause the problem?

            • 3. Re: Building Jbos ejb with Ant
              tsip

              Hi again

              what doe you meean with:Did you change the weblogic task to the jboss task?

              Thanks

              • 4. Re: Building Jbos ejb with Ant
                p_d_austin

                Sorry the line



                should be




                This will then add the jboss.xml files and jaws.xml files to the generated jar.

                Paul