You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Krystian Lider <kr...@gryfsoft.pl> on 2007/07/10 10:38:23 UTC

CXF and JDK 1.6 compatibility

Hi
I have some question/thoughts about using CXF with JDK 1.6.

As I understand the core module of CXF was written, officially tested 
against and should be used with Java5.

There were some discussions on mailing list, if it is possible or not to 
use Java6 as runtime:
“The next milestone release” Feb 21, 2007
“Java 6 failures” Jan 22, 2007

The main problems which were there described are (content from the 
discussion):
- The versions of STAX, JAXB, JAX-WS, etc... that are required/used by 
CXF are not compatible with the ones in 1.6. (as I understand in 1.6 
there are older)
- The parser (XML) and such (validator) is different. Some of our (CXF 
developers) tests are failing with JDK 1.6.



Actually I’m using CXF 2.0-RC with JDK 1.6 and till now I didn’t have 
any problems.
What I have tried:
- Java6 and all jars from CXF distribution
- Java6 and jars from CXF distribution without: STAX, JAXB, JAX-WS jars 
(I removed: jaxb-api-2.0.jar, jaxb-impl-2.0.5.jar, jaxb-xjc-2.0.jar, 
jaxws-api-2.0.jar, stax-api-1.0.1.jar, stax-utils-20060502.jar, 
wstx-asl-3.2.1.jar)

I did not use /lib/endorsed dir mechanism so in first try there were 
some kind of mix: some classes of eg. JAXB were taken from JAXB jars 
while others from JDK 1.6 runtime.

In both, communication client server and creating services from WSDL 
file was successful.

My questions are:
1) I wonder if there are some parts which I can double check – any hints 
how to get error situation?
2) Are there the results of your tests against Java6 available somewhere?
3) Do you have any plans/schedule referring to the CXF and Java6?


-- 
Best Regards,
Krystian Lider




Re: CXF and JDK 1.6 compatibility

Posted by Eesan Lin <ee...@gmail.com>.
Hi Daniel,

The CXF 2.5.1 with JDK 1.5 works fine but with jdk 1.6.0.31 i am getting the
following error while doing a build.

 /WSDLToJava Error: Thrown by JAXB:
 Thrown by JAXB:
 JAXB version attribute must be present
  at line 1 column 240 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied2919033589611390804.xsd

 JAXB version attribute must be present
  at line 1 column 228 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied404554409616866985.xsd

 JAXB version attribute must be present
  at line 1 column 235 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied6832076967347622205.xsd

 JAXB version attribute must be present
  at line 1 column 238 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied203083681593723469.xsd


 org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
 Thrown by JAXB:
 JAXB version attribute must be present
  at line 1 column 240 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied2919033589611390804.xsd

 JAXB version attribute must be present
  at line 1 column 228 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied404554409616866985.xsd

 JAXB version attribute must be present
  at line 1 column 235 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied6832076967347622205.xsd

 JAXB version attribute must be present
  at line 1 column 238 of schema
file:/C:/Windows/TEMP/cxf-tmp-961911/customzied203083681593723469.xsd

     at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.throwError(JAXBBindErrorListener.java:40)
     at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:413)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:591)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:243)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
     at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
     at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
     at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
 Caused by: org.xml.sax.SAXParseException: JAXB version attribute must be
present
     at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:61)
     at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:316)
     at
com.sun.tools.xjc.reader.internalizer.VersionChecker.endDocument(VersionChecker.java:136)
     at org.xml.sax.helpers.XMLFilterImpl.endDocument(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown
Source)
     at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown
Source)
     at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
     at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
     at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
     at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown
Source)
     at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
     at
com.sun.tools.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:398)
     at
com.sun.tools.xjc.reader.internalizer.DOMForest.parse(DOMForest.java:278)
     at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.parseSchema(SchemaCompilerImpl.java:157)
     at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:380)
     ... 8 more
/



I also tried having the jaxb-api2.2.3.jar under the jre/lib/endorsed dir and
still getting the same error as above. Please let me know if there are any
solutions.. I have been stucked here for a while.

Cheers
Eesan.




--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-and-JDK-1-6-compatibility-tp549419p5723520.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: CXF and JDK 1.6 compatibility

Posted by Krystian Lider <kr...@gryfsoft.pl>.
Hi Daniel

On 7/10/2007 4:46 PM,User Daniel Kulp wrote:

>Krystian,
>
>Those emails about Java6 issues were back when we were targetting JAX-WS 
>2.1 and JAXB 2.1.   Since then, we backed down to JAX-WS 2.0 and JAXB 
>2.0 so most of the problems aren't problems right now.  That said, now 
>that we have shipped a JAX-WS 2.0 compliant version, we plan to restart 
>the 2.1 work very shortly and the problems will pop up again.
>
>  
>
Thanks for the explanation, I was a little bit confused why is it working.

-- 
Best Regards,
Krystian Lider



Re: CXF and JDK 1.6 compatibility

Posted by Daniel Kulp <dk...@apache.org>.
Krystian,

Those emails about Java6 issues were back when we were targetting JAX-WS 
2.1 and JAXB 2.1.   Since then, we backed down to JAX-WS 2.0 and JAXB 
2.0 so most of the problems aren't problems right now.  That said, now 
that we have shipped a JAX-WS 2.0 compliant version, we plan to restart 
the 2.1 work very shortly and the problems will pop up again.

The main issues were around the JAXB api and JAXWS api jars.   The 
java.xml.ws and java.xml.bind packages in the Java 6 rt.jar are the 2.0 
versions.   Thus, they work fine for CXF right now since we just need 
the 2.0 versions.   However, when we move to 2.1, we'll need the 2.1 
versions to be put into the endorsed dir so that they will be picked up 
instead of the 2.0 versions built into the JDK.

That said, we do have some unit test failures with Java 6 that I started 
trying to fix at one point, just haven't had time to finish it.   Those 
are mostly around the XML parsers/stax impl providing extra stuff we 
don't expect in the prologue.  (standalone="false")

Oh, one more note...   At the time, maven 2.0.3 or 2.0.4 was the latest 
version and that version had issues with Java 6.   We're up to 2.0.5 
which fixes those. 

Dan



On Tuesday 10 July 2007 04:38, Krystian Lider wrote:
> Hi
> I have some question/thoughts about using CXF with JDK 1.6.
>
> As I understand the core module of CXF was written, officially tested
> against and should be used with Java5.
>
> There were some discussions on mailing list, if it is possible or not
> to use Java6 as runtime:
> “The next milestone release” Feb 21, 2007
> “Java 6 failures” Jan 22, 2007
>
> The main problems which were there described are (content from the
> discussion):
> - The versions of STAX, JAXB, JAX-WS, etc... that are required/used by
> CXF are not compatible with the ones in 1.6. (as I understand in 1.6
> there are older)
> - The parser (XML) and such (validator) is different. Some of our (CXF
> developers) tests are failing with JDK 1.6.
>
>
>
> Actually I’m using CXF 2.0-RC with JDK 1.6 and till now I didn’t have
> any problems.
> What I have tried:
> - Java6 and all jars from CXF distribution
> - Java6 and jars from CXF distribution without: STAX, JAXB, JAX-WS
> jars (I removed: jaxb-api-2.0.jar, jaxb-impl-2.0.5.jar,
> jaxb-xjc-2.0.jar, jaxws-api-2.0.jar, stax-api-1.0.1.jar,
> stax-utils-20060502.jar, wstx-asl-3.2.1.jar)
>
> I did not use /lib/endorsed dir mechanism so in first try there were
> some kind of mix: some classes of eg. JAXB were taken from JAXB jars
> while others from JDK 1.6 runtime.
>
> In both, communication client server and creating services from WSDL
> file was successful.
>
> My questions are:
> 1) I wonder if there are some parts which I can double check – any
> hints how to get error situation?
> 2) Are there the results of your tests against Java6 available
> somewhere? 3) Do you have any plans/schedule referring to the CXF and
> Java6?

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog