I played around with the build.xml a bit and found that (indeed) when you are careful which jars are included, the exception goes away. Now, which jar exactly causes the exception, is not clear to me ATM, but the problem for me is solved.

Tom



Daniel Kulp wrote:
Chris and Tom,

I really don't think Apache will allow us to put it into the com.sun namespace. I'll follow up with legal to see, but I'm going to doubt it.

That said, it seems to work fine if you use wsdl2java:

dk...@dilbert ~/apache-cxf-2.2.2/bin $ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

dk...@dilbert ~/apache-cxf-2.2.2/bin $ ./wsdl2java -d /tmp -xjc-Xts \
                          ../samples/wsdl_first/wsdl/hello_world.wsdl

And the code is correctly generated with the proper "toString" methods from the ts plugin. Thus, the question is, under what circumstance is this really a problem? "normal" CXF operation seems to work fine.

One option that we COULD do is to NOT put the two plugins into the cxf-bundle jar and leave them as individual module jars in the lib directory. Thus, if they ARE a problem, you could just remove the jars. Would that be OK?

Dan




On Fri May 29 2009 3:25:17 am Chris McClelland wrote:
I suggested a fix when I filed the JIRA, to move CXF's JAXB plugins to
the com.sun.tools.xjc.addon. This involves a minor patch to a couple of
java files and an update to a META-INF file

gunzip -c apache-cxf-2.1.4.tar.gz | tar xf -
cd apache-cxf-2.1.4/lib
mkdir x
cd x
gunzip -c ../../apache-cxf-2.1.4-src.tar.gz | tar xf -
apache-cxf-2.1.4-src/common/xjc/ts/src/main/java/org/apache/cxf/xjc/ts/ToSt
ringPlugin.java
apache-cxf-2.1.4-src/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/Defa
ultValuePlugin.java mv
apache-cxf-2.1.4-src/common/xjc/ts/src/main/java/org/apache/cxf/xjc/ts/ToSt
ringPlugin.java .
mv
apache-cxf-2.1.4-src/common/xjc/dv/src/main/java/org/apache/cxf/xjc/dv/Defa
ultValuePlugin.java .
rm -rf apache-cxf-2.1.4-src
sed -i 's/package /package com.sun.tools.xjc.addon./' *.java
jar xf ../cxf-2.1.4.jar
cd META-INF/services/
mv com.sun.tools.xjc.Plugin x
cat x | perl -ane 'print "com.sun.tools.xjc.addon.$_";' >
com.sun.tools.xjc.Plugin
rm x
cd ../..
/ms/dist/msjava/PROJ/sunjdk/1.5.0_15/bin/javac -d . -classpath
../cxf-manifest.jar ToStringPlugin.java DefaultValuePlugin.java
rm ToStringPlugin.java DefaultValuePlugin.java ../cxf-2.1.4.jar
jar cf ../cxf-2.1.4.jar *
cd ..
rm -rf x

Dan & co, is this fix acceptable? I'm quite happy to carry on patching
my local install of CXF but the fix above seems pretty innocuous.

- Chris

Tom wrote:
https://issues.apache.org/jira/browse/CXF-1880

I'm running into this bug after upgrading to Java 1.6. This naturally
is quite annoying and I see the issue dates from oct 20 2008. Is there
any workaround?

Tom


Reply via email to