ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravendranath S (Adyar)" <sr...@rsi.ramco.com>
Subject I fixed a bug a small bug, how do I contribute this to ant projec t
Date Wed, 28 May 2003 04:22:52 GMT
Hi All,

I am using the ejbjar task with Iplanet(1.5.3). I was not able to make it
look for the localdtd and I found a bug in this files 
"org.apache.tools.ant.taskdefs.optional.ejb.IPlanetDeploymentTool.java"

Extract
protected Hashtable parseEjbFiles(String descriptorFileName,
                         SAXParser saxParser) throws IOException,
SAXException {
        Hashtable files;
        /* Build and populate an instance of the ejbc utility */
        IPlanetEjbc ejbc = new IPlanetEjbc(
                                    new File(getConfig().descriptorDir,
                                                descriptorFileName),
                                    new File(getConfig().descriptorDir,
                                                getIasDescriptorName()),
                                    getConfig().srcDir,
                                    getCombinedClasspath().toString(),
                                    saxParser);
-------------- Added this code ---------------------------------------------
           DTDLocation dtd = null;
           for(int i=0; i < getConfig().dtdLocations.size(); i++ )
		{
               dtd = (DTDLocation)getConfig().dtdLocations.get(i);
		   ejbc.registerDTD( dtd.getPublicId(), dtd.getLocation() );
		}
----------------------------------------------------------------------------
-
  
Thanks
Ravi

-----Original Message-----
From: Wax, Michael (NBC) [mailto:Michael.Wax@nbc.com]
Sent: Wednesday, April 23, 2003 8:23 PM
To: 'Ant Users List'
Subject: RE: problem with EjbJar Task and Iplanet not able to look for
the loc al DTD


Using iPlanet 6.5, I found that I needed to have the doctype in the
ejb-jar.xml file point to a local dtd:

	<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.1//EN'
'file://localhost/C:/iplanet/ias6/ias/dtd/ejb-jar_1_1.dtd'>

However, it still took a lot of playing to make things work.  I ending up
using the jar and iplanet-ejbc tasks as follows:

	<target name="my_stubs">
	<iplanet-ejbc
	
ejbdescriptor="${assemble.dir}/${xyz.module}/ejb/meta-inf/ejb-jar.xml"
	
iasdescriptor="${assemble.dir}/${xyz.module}/ejb/meta-inf/ias-ejb-jar.xml"
		dest="${assemble.dir}/${xyz.module}/ejb"
		debug="no"
		keepgenerated="no">
		<classpath>
			<fileset dir="${j2ee.dir}">
				<include name="j2ee.jar"/>
			</fileset>
			<fileset dir="${iplanet.lib.dir}">
				<include name="**/*.jar" />
			</fileset>
			<pathelement
path="${assemble.dir}/${xyz.module}/ejb"/>
		</classpath>
	</iplanet-ejbc>
	</target>

	<target name="xyz_jar" depends="my_stubs">
		<jar destfile="${ear.dir}/${xyz.module}EJB.jar"
			basedir="${assemble.dir}/${xyz.module}/ejb"
			includes="**/*.class"
			excludes="**/*Test.class">
			<metainf
dir="${assemble.dir}/${xyz.module}/ejb/meta-inf">
				<include name="*.xml"/>
			</metainf>
		</jar>
	</target>

-----Original Message-----
From: Ravendranath S (Adyar) [mailto:sravi@rsi.ramco.com]
Sent: Monday, April 21, 2003 8:25 PM
To: user@ant.apache.org
Subject: problem with EjbJar Task and Iplanet not able to look for the
loc al DTD


Hi, 

I am having this problem trying to use the ejbjar task with iplanet, even
when I include the dtd publicId ant is not looking at the local copy instead
its trying to make socket conections to get the dtd.
I am having my machine configured to use a proxy,  using ant -1.5.2 and
jdk1.4.0

If I remove the DOCTYPE everything works fine

Thanks in advance

Ravi

Build script: 
<ejbjar srcdir="classes"
            descriptordir="ejb"  basejarname="Address">
            <iplanet destdir="jar"
                     iashome="d:\servers\iplanet\ias6\ias"
                     debug="yes"
                     keepgenerated="yes">
                <classpath>
                  <fileset dir="lib">
                      <include name="*.jar"/>
                  </fileset>
                  <fileset dir="dtds">
                      <include name="*.dtd"/>
                  </fileset>
                </classpath>
            </iplanet>
           <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 1.1//EN"
	      location="${basedir}/dtds/ejb-jar_1_1.dtd "/>
           <dtd publicId="-//Sun Microsystems, Inc.//DTD iAS Enterprise
JavaBeans 1.0//EN"
              location="${basedir}/dtds/IASEjb_jar_1_0.dtd" />

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


The Error Message I get is

BUILD FAILED
 IOException while parsing'ActBonus_Jar\ejb-jar.xml'.  T
his probably indicates that the descriptor doesn't exist. Details:
Connection timed out: connect
        at
org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.processDesc
riptor(Generi
cDeploymentTool.java:501)
        at
org.apache.tools.ant.taskdefs.optional.ejb.IPlanetDeploymentTool.processDesc
riptor(IPlane
tDeploymentTool.java:219)
        at
org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java:592)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
        at java.net.Socket.connect(Socket.java:425)
        at java.net.Socket.connect(Socket.java:375)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:366)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:582)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:292)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:253)
        at sun.net.www.http.HttpClient.New(HttpClient.java:321)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.http.HttpClient.New(HttpClient.java:301)
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:463)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:4
54)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:556)
        at java.net.URL.openStream(URL.java:955)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown
Source)
        at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown
Source)
        at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:253)
        at
org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbc.getEjbs(IPlanetEjbc.j
ava:537)
        at
org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbc.execute(IPlanetEjbc.j
ava:413)
        at
org.apache.tools.ant.taskdefs.optional.ejb.IPlanetDeploymentTool.parseEjbFil
es(IPlanetDep
loymentTool.java:296)



	Because e-mail can be altered electronically, 
	the integrity of this communication cannot be guaranteed.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Mime
View raw message