You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Martin Renner <m....@exxcellent.de> on 2009/10/29 11:06:24 UTC
How to disable xjc ts plugin?
Hi,
we have a problem with the xjc 'ts' plugin in combination with the commons-lang plugin.
We have to use the commons-lang plugin in order to get equals() and hashCode() methods into the
generated code. So we use the wsdl2java switch "-xjc-Xcommons-lang" to enable this plugin.
However, if we use this switch, we get invalid code because the ts plugin is being executed too!
Although we did not use the switch "-xjc-Xts". So we get two toString() methods in the same class:
One from commons-lang and one from ts.
Here is the result of the different switches:
1. no "-xjc" at all
--> no toString, hashCode and equals (like expected)
2. "-xjc-Xcommons-lang"
--> toString, hashCode and equals from commons-lang plugin (like expected)
--> a 2nd toString from the ts plugin (this is not expected, because there was no "-xjc-Xts")
3. "-xjc-Xts"
--> toString from ts plugin (like expected)
We are using cxf 2.2.4 in a single jar (not the modules). So the ts plugin is already bundled within
the cxf.jar. But why is the ts plugin being executed if we use "-xjc-Xcommons-lang"?
Is there a way to explicitly disable the ts plugin?
Kind Regards,
Martin
Re: How to disable xjc ts plugin?
Posted by Daniel Kulp <dk...@apache.org>.
Well, I think the best way would be to pull the xjc plugins out of the cxf-
bundle. They aren't used at all at runtime for anything. The cxf-manifest
already would pick them up if the jars are there. Thus, if they were
external jars, the solution would be to just delete the jar.
Want to log a JIRA? (and including a patch would be great. :-)
Dan
On Tue January 5 2010 12:14:08 pm wytas wrote:
> thank you for Your suggestion. it worked and its ok for me to modify cxf
> jar
>
> :)
>
> wondering what could be "official" way to avoid this problem?
>
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: How to disable xjc ts plugin?
Posted by wytas <wy...@freemail.lt>.
thank you for Your suggestion. it worked and its ok for me to modify cxf jar
:)
wondering what could be "official" way to avoid this problem?
--
View this message in context: http://old.nabble.com/How-to-disable-xjc-ts-plugin--tp26110271p27026665.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to disable xjc ts plugin?
Posted by Martin Renner <m....@exxcellent.de>.
Hi.
I found a (ugly) workaround for the problem: I removed the line
com.sun.tools.xjc.addon.apache_cxf.ts.ToStringPlugin
from META-INF/services/com.sun.tools.xjc.Plugin.
However, this is an ugly hack to get rid of the ts plugin. I am still wondering, why
"-xjc-Xcommons-lang" triggers the execution of the ts plugin.
Kind Regards,
Martin