Skip to main content

@SchemaValidation annotation causes wsgen to fail

8 replies [Last post]
karlinsky
Offline
Joined: 2008-02-29
Points: 0

Hi,

I'm using JAX-WS RI 2.1.3 and would like for the WS requests to be automatically validated agaist the XSD.

If I tried adding @SchemaValidation to my @WebService objects but get the following error from WSGEN ant task:
javax.xml.ws.WebServiceException: Annotation @com.sun.xml.ws.developer.SchemaValidation(handler=class com.sun.xml.ws.server.DraconianValidationErrorHandler) is not recognizable, atleast one constructor of class com.sun.xml.ws.developer.SchemaValidationFeature should be marked with @FeatureConstructor
at com.sun.xml.ws.binding.WebServiceFeatureList.getWebServiceFeatureBean(WebServiceFeatureList.java:153)
at com.sun.xml.ws.binding.WebServiceFeatureList.parseAnnotations(WebServiceFeatureList.java:128)
at com.sun.xml.ws.binding.WebServiceFeatureList.(WebServiceFeatureList.java:96)
at com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:222)
at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:119)

I ran the ant task with verbose classloading and it seems that the problem is that @FeatureConstructor annotation is loaded twice by two different classloaders: once by com.sun.istack.tools.ParallelWorldClassLoader and once by the regular classloader from jaxws-rt.jar.
Am I doing something wrong? Am I missing something?

Thanks,
Dmitry.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
karlinsky
Offline
Joined: 2008-02-29
Points: 0

ramapulavarthi,
I just tried running WSGEN with JAX-WS RI 2.1.4 jars, and I'm still getting the same error.

ramapulavarthi
Offline
Joined: 2004-06-01
Points: 0

I have tried a simple WebService with @SchemaValidation and @SchemaValidation(handler=MyErrorHandler.class) and both worked fine with JAX-WS RI 2.1.4 wsgen.
Show us your endpoint impl to see if you are using it correctly.
Otherwise, Please file an issue with a testcase.

karlinsky
Offline
Joined: 2008-02-29
Points: 0

Ok, I'm attaching a zip archive with a dummy endpoint source and an ant script, which when run in my environment (paths to JAX-WS jars, compiled classes, etc.) reproduces the error.
Thanks.

kristoff
Offline
Joined: 2004-06-04
Points: 0

I grabbed the latest JAX-WS RI and experienced the same exact thing. Still stumped.

bootalex
Offline
Joined: 2009-06-18
Points: 0

Hi guys.
I know how to solve your problem.
You need to add in wsgen classpath

karlinsky
Offline
Joined: 2008-02-29
Points: 0

Forgot to mention - I'm running on Java 1.5.

ramapulavarthi
Offline
Joined: 2004-06-01
Points: 0

Nothing much changed from JAX-WS RI 2.1.3 and 2.1.4 in this area.
Can you check with the latest bits and check your environment again?

Jitendra Kotamraju

metro@javadesktop.org wrote:
> Nothing much changed from JAX-WS RI 2.1.3 and 2.1.4 in this area.
> Can you check with the latest bits and check your environment again?
> [Message sent by forum member 'ramapulavarthi' (ramapulavarthi)]
>
> http://forums.java.net/jive/thread.jspa?messageID=289936
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>
Yeah, we have few tests with the schema valiation and they work fine.
http://fisheye5.cenqua.com/browse/jax-ws-sources/jaxws-unit/testcases/fr...

Can you check your environment also see if the endpoint impl is using
schema validation similar to the above.

Jitu

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net