You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jacob Zwiers <Ja...@tpsgc-pwgsc.gc.ca> on 2011/11/18 16:23:26 UTC

RE: Changing Parser Type on for JAX-RS Services

To close the loop on this issue ...

The Oracle Forums Thread [1] has been updated to provide a solution that allows Woodstox to be used as the StAX parser on WL 9.2.x (and possibly other versions of Weblogic).

The short answer is that WebLogic requires the following stanza in the proprietary deployment descriptor weblogic.xml:
  <container-descriptor>
   [SNIP]
   <prefer-web-inf-classes>true</prefer-web-inf-classes>
  </container-descriptor>

This instructs WebLogic's classloaders to look FIRST in the JARS from the application's WEB-INF/lib directory for Service Provider Implementations (in this case, to find META-INF/services/javax.xml.stream.XMLInputFactory in the Woodstox JAR) rather than to the system classloader (which will find the same SPI in weblogic.jar ... which Oracle has admitted is broken and will provide a patch for on request).

More details available in the Oracle forums post.

So, in the end, neither Daniels patch (to ignore the "unsupported property" exception) or alternate parser types was required... although the support from this list was very helpful and appreciated!

[1] - https://forums.oracle.com/forums/message.jspa?messageID=9953045

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Wednesday, October 26, 2011 5:18 PM
To: users@cxf.apache.org
Cc: Jacob Zwiers
Subject: Re: Changing Parser Type on for JAX-RS Services


I cannot really help you with the Oracle part of this, but after reading the stack trace, I updated StaxUtils to trap the unsupported properties and 
continue.   Thus, tomorrows snapshots should start working for this.
 
That said, getting it to use woodstox is definitely a good thing to keep 
pursuing.   Woodstox is pretty much the best stax parser out there.


Dan



On Wednesday, October 26, 2011 2:51:05 PM Jacob Zwiers wrote:
> I've deployed a JAX-RS method defined as follows:
> 
>    @POST
>    @Consumes( "text/xml")
>    @Path( "{order_id}/" + ANALYSE_PARAM )
>    public void reportResult( @PathParam( "order_id") int _orderId, 
> AnalyseResults _analyseResults ) { // NOTE: AnalyseResults is a JAXB object
>    }
> 
> When using CXF 2.4.0 with Weblogic 9.2.3 (Java 1.5), I get all sorts 
> of grief because of the StAX parser.
> 
> The details are in an Oracle Forums[1] post.
> 
> While I wait for them to tell me I can't change the StAX parser in 
> WebLogic...
> 
> ... is there a way to instruct the JAX-RS to use a different type of 
> parsing (eg. SAX rather than StAX ... I'd even take DOM at this point)?
> 
> Thanks...
> jz
> 
> [1] -
> https://forums.oracle.com/forums/message.jspa?messageID=9953045#995304
> 5
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Changing Parser Type on for JAX-RS Services

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I've added this info to the new page (with more tips to follow, the 
input is welcome):
https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Deployment

I've also tried to add this tip to the existing page [1] too, for some 
reasons I could not do it, it would just not accept the modifications 
after I canceled the edit earlier on...

Thanks, Sergey

[1] 
http://cxf.apache.org/docs/application-server-specific-configuration-guide.html

On 18/11/11 17:23, Jacob Zwiers wrote:
> To close the loop on this issue ...
>
> The Oracle Forums Thread [1] has been updated to provide a solution that allows Woodstox to be used as the StAX parser on WL 9.2.x (and possibly other versions of Weblogic).
>
> The short answer is that WebLogic requires the following stanza in the proprietary deployment descriptor weblogic.xml:
>    <container-descriptor>
>     [SNIP]
>     <prefer-web-inf-classes>true</prefer-web-inf-classes>
>    </container-descriptor>
>
> This instructs WebLogic's classloaders to look FIRST in the JARS from the application's WEB-INF/lib directory for Service Provider Implementations (in this case, to find META-INF/services/javax.xml.stream.XMLInputFactory in the Woodstox JAR) rather than to the system classloader (which will find the same SPI in weblogic.jar ... which Oracle has admitted is broken and will provide a patch for on request).
>
> More details available in the Oracle forums post.
>
> So, in the end, neither Daniels patch (to ignore the "unsupported property" exception) or alternate parser types was required... although the support from this list was very helpful and appreciated!
>
> [1] - https://forums.oracle.com/forums/message.jspa?messageID=9953045
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Wednesday, October 26, 2011 5:18 PM
> To: users@cxf.apache.org
> Cc: Jacob Zwiers
> Subject: Re: Changing Parser Type on for JAX-RS Services
>
>
> I cannot really help you with the Oracle part of this, but after reading the stack trace, I updated StaxUtils to trap the unsupported properties and
> continue.   Thus, tomorrows snapshots should start working for this.
>
> That said, getting it to use woodstox is definitely a good thing to keep
> pursuing.   Woodstox is pretty much the best stax parser out there.
>
>
> Dan
>
>
>
> On Wednesday, October 26, 2011 2:51:05 PM Jacob Zwiers wrote:
>> I've deployed a JAX-RS method defined as follows:
>>
>>     @POST
>>     @Consumes( "text/xml")
>>     @Path( "{order_id}/" + ANALYSE_PARAM )
>>     public void reportResult( @PathParam( "order_id") int _orderId,
>> AnalyseResults _analyseResults ) { // NOTE: AnalyseResults is a JAXB object
>>     }
>>
>> When using CXF 2.4.0 with Weblogic 9.2.3 (Java 1.5), I get all sorts
>> of grief because of the StAX parser.
>>
>> The details are in an Oracle Forums[1] post.
>>
>> While I wait for them to tell me I can't change the StAX parser in
>> WebLogic...
>>
>> ... is there a way to instruct the JAX-RS to use a different type of
>> parsing (eg. SAX rather than StAX ... I'd even take DOM at this point)?
>>
>> Thanks...
>> jz
>>
>> [1] -
>> https://forums.oracle.com/forums/message.jspa?messageID=9953045#995304
>> 5
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com