I would scream, but that would be impolite. So I wont :-)

I've used Ant for some time now (the crowd cheers), hwoever I am now
attempting to use it to build generic EJB's, via the ejbjar task. Easy.
Well, it should be. I get the following error when I run ant (BTW: If I
remove the DOCTYPE from the descriptor, it works, builds the JAR etc, but
then Weblogic complains for the same reason):

N:\devel\java\gss\build.xml:42: SAXException while parsing
'com\woe\ejb\test\Tes
t-ejb-jar.xml'. This probably indicates badly-formed XML.  Details: External
par
ameter entity "%[dtd];" has characters after markup.
--- Nested Exception ---
org.xml.sax.SAXParseException: External parameter entity "%[dtd];" has
character
s after markup.
        at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
        at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3029)
        at
org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.jav



The ejb-jar.xml is defined like this:
<?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>
...
</ejb-jar>

I've also tried the other DOCTYPE definition, for EJB1.1 compliant beans.
Results are the same.





And the task definition is as follows:

  <target name="jars" depends="compile">
        <ejbjar srcdir="${build.classes}" descriptordir="${build.source}"
      destdir="${deploymentjars.dir}" flatdestdir="true">

        <classpath>
          <path refid="lib-jars" />
          <path location="${weblogic.classes}" />
        </classpath>
        <weblogic destdir="${deploymentjars.dir}"
                 keepgeneric="true"
                 suffix=".jar"
                 rebuild="false">

          <classpath refid="lib-jars"/>
          <wlclasspath>
            <pathelement path="${weblogic.classes}"/>
          </wlclasspath>
        </weblogic>

        <include name="**/*-ejb-jar.xml"/>
        <exclude name="**/*-weblogic-ejb-jar.xml"/>

        <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
1.1//EN"

location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/ejb-jar.dtd"/
>
        <dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN"

location="${weblogic.home}/classes/weblogic/ejb/deployment/xml/weblogic-ejb-
jar.dtd"/>
    </ejbjar>
  </target>

I've tried with and without the <dtd> elements, however I don't think these
are the problem at all (at least, at this stage anyway).

I've tried changing the URL for the SYSTEM Part (that I understand is the
second attribute of the external DOCTYPE declatation) to a file URL. That
URL does not exist, and of course Ant comes back with a 'Cant find it' type
message, which is fine - at least it appears to parse the DOCTYPE OK.

So in short, I'm running out of ideas! I've scanned deja.com, the ant-* mail
archives and performed searches via google. I'm beginning to feel that I am
the only one on the 'net that's ever come across this problem (read:
frustrated).

So, if anyone can point me in the right dircetion, or offer some help - that
would be greatly appreciated!

Regards,
Neil Clayton

Reply via email to