James,

We had the same problem beginning November 8th, and using the dtd element
(as suggested by Andy below) was also the approach we took.  I imagine
java.sun.com must have changed something on their website.  I could view the
DTD from java.sun.com in a web browser, but could no longer access it from a
Java program (using URL and URLConnection, and ultimately any XML parser or
Ant).  I emailed java.sun.com's web staff, but they directed me elsewhere.

Well, the local DTD solution works, and presumably it's more reliable and
faster than getting it over the net anyway.

An alternative solution: sticking weblogic.jar in Ant's own classpath.
weblogic.jar contains the DTDs, too.  I wanted to keep weblogic.jar out of
Ant's classpath, though.

Jim

> -----Original Message-----
> From: Beacock Andrew (NMP/Boston) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 15, 2001 9:02 AM
> To: 'Ant Users List'
> Subject: RE: creating ejb-jar problem - resolving dtd
> 
> 
> James,
> 
> > I am currently having a problem creating an ejb-jar file.
> <snip/>
> > Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD 
> > Enterprise JavaBeans 2.0//EN, systemId: 
> > http://java.sun.com/dtd/ejb-jar_2_0.dtd) to a local entity
> 
> The problem is that Ant can't see the java.sun.com website (due to a
> firewall problem) or the dtd file itself and so is giving you this
> error.  To solve this you have to use the <dtd> nested element of the
> ejbjar task.
> 
> Here is a snippet from my Ant script for building ejbs:
> 
>     <!-- ejb -->
>     <target name="ejb" description="create the EJB JARs">
>         <mkdir dir="${dist}"/>
>         <ejbjar srcdir="${classes}"
>                 descriptordir="${descriptors}/ejb"
>                 destdir="${dist}"
>                 naming="directory"
>                 flatdestdir="true"
>                 genericjarsuffix="EJB.jar">
>             <dtd publicId=
>                  "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
> 2.0//EN"
>                  location="${descriptors}/dtd/ejb-jar_2_0.dtd"/>
>             <classpath refid="path.classpath"/>
>             <include name="**/ejb-jar.xml"/>
>             <exclude name="**/weblogic-*.xml"/>
>         </ejbjar>
>     </target>
> 
> As you can see the <dtd> element refers to the dtd that I saved from
> Sun's site and placed in my local file system.
> 
> For more info, see
> http://jakarta.apache.org/ant/manual/OptionalTasks/ejb.html#ejbjar and
> look for in the 'Nested Elements' section for 'dtd'.
> 
> Hope this helps, good luck! ;)
> 
> Andy.
> 
> --
> Andrew Beacock
> Senior Software Engineer/Project Lead
> Nokia Mobile Phones
> NMP/MSW/SSP/AG
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to