You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Knuplesch, Juergen" <Ju...@icongmbh.de> on 2010/05/07 14:48:07 UTC

Ant 1.7.1, Xalan and Java 1.6.0_17

Hello,

 

I found out that the xalanimpl shipped with Ant1.7.1 is probably
incompatible to Java1.6.0_17, because

 

Java1.6 is shipped with a different xalan version

When I run Ant together with Java 1,6.0_17 I get a certain error

When I remove xalanimpl in the ANT lib dir I don't get this error

When I run this with Java1.5.0_16 I do not get this error

 

So either the shipped xalan is buggy or incompatible or both.

 

Is there already a common solution to solve this issue?

 

I ask because I have a lot of builds. Some use Java 1.5 and some Java
1.6.

 

 

Regards Juergen

 


RE: Ant 1.7.1, Xalan and Java 1.6.0_17

Posted by Gary Hirschhorn <gh...@fetch.com>.
We don't use the Xalan shipped with Java -- we substitute our preferred version via the java endorsed directories mechanism.  When Xalan was first included with Java several years ago, there was a bug in the Xalan version shipped, but fixed in the latest version of Xalan.  So we started using "-Djava.endorsed.dirs" for all of our Java apps (see http://java.sun.com/javase/6/docs/technotes/guides/standards/) and we include our preferred version of Xerces and Xalan in this directory.


-----Original Message-----
From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de] 
Sent: Friday, May 07, 2010 5:48 AM
To: Ant Users List
Subject: Ant 1.7.1, Xalan and Java 1.6.0_17

Hello,

 

I found out that the xalanimpl shipped with Ant1.7.1 is probably
incompatible to Java1.6.0_17, because

 

Java1.6 is shipped with a different xalan version

When I run Ant together with Java 1,6.0_17 I get a certain error

When I remove xalanimpl in the ANT lib dir I don't get this error

When I run this with Java1.5.0_16 I do not get this error

 

So either the shipped xalan is buggy or incompatible or both.

 

Is there already a common solution to solve this issue?

 

I ask because I have a lot of builds. Some use Java 1.5 and some Java
1.6.

 

 

Regards Juergen

 


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


AW: Ant 1.7.1, Xalan and Java 1.6.0_17

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Hello,

thanks for the response.

No, I do not know a simple way to reproduce this.

It happens in self defined task that parses xml.
So it has to do with classpath issues and taskdef.

The stacktrace shows that the classptahs are mixed up:
com.sun.org.apache.xerces: This is the cp if the Java sdk
org.apache.xerces: This is the cp of xerxes inside Ant

I could not reproduce this behavior on my local machine.
The tough thing about it was, that it happened after 2 hours of building.

My workaround is 
set ANT_OPTS=... -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

Here is my stacktrace:

[dope-task-fatclient] 2010-05-07 01:41:20.025 [E] de.icongmbh.dope.util.reload.ReloadManager $Revision: 1.331 $ execute() main 
[dope-task-fatclient]   java.lang.ArrayIndexOutOfBoundsException: -1
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.addAttribute(XMLAttributesImpl.java:310)
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.addAttribute(XMLAttributesImpl.java:216)
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.addDefaultAttributes(XMLSchemaValidator.java:2868)
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2041)
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685)
[dope-task-fatclient] 	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.startElement(ValidatorHandlerImpl.java:549)
[dope-task-fatclient] 	at org.apache.xerces.jaxp.JAXPValidatorComponent$XNI2SAX.startElement(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.jaxp.JAXPValidatorComponent.startElement(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.jaxp.JAXPValidatorComponent.emptyElement(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
[dope-task-fatclient] 	at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
[dope-task-fatclient] 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
[dope-task-fatclient] 	at de.icongmbh.dope.util.reload.ReloadManager.createRepositoryObjects(ReloadManager.java:1466)
[dope-task-fatclient] 	at de.icongmbh.dope.util.reload.ReloadManager.execute(ReloadManager.java:319)
[dope-task-fatclient] 	at de.icongmbh.dope.util.ant.ReloadTask$1.execute(ReloadTask.java:47)
[dope-task-fatclient] 	at de.icongmbh.dope.util.ant.SaveFormatTask.execute(SaveFormatTask.java:85)
[dope-task-fatclient] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[dope-task-fatclient] 	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
[dope-task-fatclient] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
[dope-task-fatclient] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.execute(Target.java:357)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.performTasks(Target.java:385)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[dope-task-fatclient] 	at net.sf.antcontrib.logic.RunTargetTask.execute(RunTargetTask.java:48)
[dope-task-fatclient] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.execute(Target.java:357)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.performTasks(Target.java:385)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[dope-task-fatclient] 	at net.sf.antcontrib.logic.RunTargetTask.execute(RunTargetTask.java:48)
[dope-task-fatclient] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[dope-task-fatclient] 	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
[dope-task-fatclient] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
[dope-task-fatclient] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[dope-task-fatclient] 	at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
[dope-task-fatclient] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[dope-task-fatclient] 	at java.lang.reflect.Method.invoke(Method.java:597)
[dope-task-fatclient] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[dope-task-fatclient] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.execute(Target.java:357)
[dope-task-fatclient] 	at org.apache.tools.ant.Target.performTasks(Target.java:385)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[dope-task-fatclient] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[dope-task-fatclient] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[dope-task-fatclient] 	at org.apache.tools.ant.Main.runBuild(Main.java:758)
[dope-task-fatclient] 	at org.apache.tools.ant.Main.startAnt(Main.java:217)
[dope-task-fatclient] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[dope-task-fatclient] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)





-----Ursprüngliche Nachricht-----
Von: Martin Gainty [mailto:mgainty@hotmail.com] 
Gesendet: Freitag, 7. Mai 2010 16:29
An: Ant Users List
Betreff: RE: Ant 1.7.1, Xalan and Java 1.6.0_17


i downloaded xalan 2.7.1 and discovered these specifications displayed in /META-INF/manifest.mf

Manifest-Version: 1.0
Created-By: 1.3.1 (IBM Corporation)
Main-Class: org.apache.xalan.xslt.Process
Class-Path: xercesImpl.jar xml-apis.jar serializer.jar

Name: org/apache/xalan/
Comment: Main Xalan engine implementing TrAX/JAXP
Specification-Title: Java API for XML Processing
Specification-Vendor: Sun Microsystems Inc.
Specification-Version: 1.3
Implementation-Title: org.apache.xalan
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Name: org/apache/xml/
Comment: DTM implementation and utilities
Implementation-Title: org.apache.xml
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Name: org/apache/xpath/
Comment: XPath engine
Implementation-Title: org.apache.xpath
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Created-By: 1.3.1 (IBM Corporation) --Created-By defines the version and the vendor of the java implementation on top
of which this manifest file is generated. --This attribute is generated by
the jar tool.


Specification-Version: 1.3  --This attribute specifies the minimum extension specification version
that is required by the applet. The Java Plug-in will  compare the --value
of this attribute with the Specification-Version attribute of the installed
extension to determine if the extension is up to date.


--and the applicable release notes for xalan 2.7.1
Xalan-Java 2.7.1 was released in August 2007.
     

      
      The serializer now has support for DOM Level 3 serialization
      (LSSerializer)
      for an XML parser. These changes are seen in the new class
      
      org.apache.xml.serializer.DOM3Serializer 
      and the new package
      org.apache.xml.serializer.dom3
      as well as a new method,       
      asDOM3Serializer() on the older 
      
      org.apache.xml.serializer.Serializer interface.
      

      
      More details are in the javadoc of those classes and interfaces.
      


        
    The distributions contain upgraded versions of xercesImpl.jar 
    (Xerces-J 2.9.0) and  xml-apis.jar (XML Commons External 1.3.04).
    The distributions were tested with these versions of Xerces-J
    and XML Commons External and are the recommended versions to use with
    the release.
    

    
      Important: You may experience unpredictable anomalies
      if your Xalan-Java and Xerces-Java builds are not in synch.
    


   
     
so the only possible discontinuity i see is a possible version mismatch in the dependency tree e.g.
xalan-version (2.7.1) != xercesImpl-version (2.9.0) != xml-commons-external (1.3.04)

are there any testcases we can run which will identify the version mismatch
?
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Subject: Ant 1.7.1, Xalan and Java 1.6.0_17
> Date: Fri, 7 May 2010 14:48:07 +0200
> From: Juergen.Knuplesch@icongmbh.de
> To: user@ant.apache.org
> 
> Hello,
> 
>  
> 
> I found out that the xalanimpl shipped with Ant1.7.1 is probably
> incompatible to Java1.6.0_17, because
> 
>  
> 
> Java1.6 is shipped with a different xalan version
> 
> When I run Ant together with Java 1,6.0_17 I get a certain error
> 
> When I remove xalanimpl in the ANT lib dir I don't get this error
> 
> When I run this with Java1.5.0_16 I do not get this error
> 
>  
> 
> So either the shipped xalan is buggy or incompatible or both.
> 
>  
> 
> Is there already a common solution to solve this issue?
> 
>  
> 
> I ask because I have a lot of builds. Some use Java 1.5 and some Java
> 1.6.
> 
>  
> 
>  
> 
> Regards Juergen
> 
>  
> 
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4

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


RE: Ant 1.7.1, Xalan and Java 1.6.0_17

Posted by Martin Gainty <mg...@hotmail.com>.
i downloaded xalan 2.7.1 and discovered these specifications displayed in /META-INF/manifest.mf

Manifest-Version: 1.0
Created-By: 1.3.1 (IBM Corporation)
Main-Class: org.apache.xalan.xslt.Process
Class-Path: xercesImpl.jar xml-apis.jar serializer.jar

Name: org/apache/xalan/
Comment: Main Xalan engine implementing TrAX/JAXP
Specification-Title: Java API for XML Processing
Specification-Vendor: Sun Microsystems Inc.
Specification-Version: 1.3
Implementation-Title: org.apache.xalan
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Name: org/apache/xml/
Comment: DTM implementation and utilities
Implementation-Title: org.apache.xml
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Name: org/apache/xpath/
Comment: XPath engine
Implementation-Title: org.apache.xpath
Implementation-Version: 2.7.1
Implementation-Vendor: Apache Software Foundation
Implementation-URL: http://xml.apache.org/xalan-j/dist/

Created-By: 1.3.1 (IBM Corporation) --Created-By defines the version and the vendor of the java implementation on top
of which this manifest file is generated. --This attribute is generated by
the jar tool.


Specification-Version: 1.3  --This attribute specifies the minimum extension specification version
that is required by the applet. The Java Plug-in will  compare the --value
of this attribute with the Specification-Version attribute of the installed
extension to determine if the extension is up to date.


--and the applicable release notes for xalan 2.7.1
Xalan-Java 2.7.1 was released in August 2007.
     

      
      The serializer now has support for DOM Level 3 serialization
      (LSSerializer)
      for an XML parser. These changes are seen in the new class
      
      org.apache.xml.serializer.DOM3Serializer 
      and the new package
      org.apache.xml.serializer.dom3
      as well as a new method,       
      asDOM3Serializer() on the older 
      
      org.apache.xml.serializer.Serializer interface.
      

      
      More details are in the javadoc of those classes and interfaces.
      


        
    The distributions contain upgraded versions of xercesImpl.jar 
    (Xerces-J 2.9.0) and  xml-apis.jar (XML Commons External 1.3.04).
    The distributions were tested with these versions of Xerces-J
    and XML Commons External and are the recommended versions to use with
    the release.
    

    
      Important: You may experience unpredictable anomalies
      if your Xalan-Java and Xerces-Java builds are not in synch.
    


   
     
so the only possible discontinuity i see is a possible version mismatch in the dependency tree e.g.
xalan-version (2.7.1) != xercesImpl-version (2.9.0) != xml-commons-external (1.3.04)

are there any testcases we can run which will identify the version mismatch
?
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Subject: Ant 1.7.1, Xalan and Java 1.6.0_17
> Date: Fri, 7 May 2010 14:48:07 +0200
> From: Juergen.Knuplesch@icongmbh.de
> To: user@ant.apache.org
> 
> Hello,
> 
>  
> 
> I found out that the xalanimpl shipped with Ant1.7.1 is probably
> incompatible to Java1.6.0_17, because
> 
>  
> 
> Java1.6 is shipped with a different xalan version
> 
> When I run Ant together with Java 1,6.0_17 I get a certain error
> 
> When I remove xalanimpl in the ANT lib dir I don't get this error
> 
> When I run this with Java1.5.0_16 I do not get this error
> 
>  
> 
> So either the shipped xalan is buggy or incompatible or both.
> 
>  
> 
> Is there already a common solution to solve this issue?
> 
>  
> 
> I ask because I have a lot of builds. Some use Java 1.5 and some Java
> 1.6.
> 
>  
> 
>  
> 
> Regards Juergen
> 
>  
> 
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4