Quantcast

WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

nicolasduminil
Hello,

It seems that WebSphere 9.0.0.3 comes with Apache CXF, as opposed to the previous releases that came with Apache Wink. How could I know what release of the Apache CXF is that. Is there anyway to see in the app server console, or by running any command (as this is the case of the wsjpaversion script which displays the release of the Apache OpenJPA) ? Or even by calling any CXF endpoint at the runtime ?

Many thanks in advance,

Nicolas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

Andy McCright
HI Nicolas,

Traditional WAS v9 uses a forked version of CXF 3.0.3 for it's JAX-RS
implementation - I think it may still be using 2.6.2 for it's JAX-WS
implementation.  I'm not aware of any official way to tell what version
ships with tWAS, but I don't expect it to change much in the future - at
least not without significant customer requests.  That said, bug fixes
discovered can be back ported to IBM's fork.

Hope this helps,

Andy

On Thu, May 18, 2017 at 10:28 AM, nicolasduminil <
[hidden email]> wrote:

> Hello,
>
> It seems that WebSphere 9.0.0.3 comes with Apache CXF, as opposed to the
> previous releases that came with Apache Wink. How could I know what release
> of the Apache CXF is that. Is there anyway to see in the app server
> console,
> or by running any command (as this is the case of the wsjpaversion script
> which displays the release of the Apache OpenJPA) ? Or even by calling any
> CXF endpoint at the runtime ?
>
> Many thanks in advance,
>
> Nicolas
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/WebSphere-9-0-0-3-How-to-know-what-is-the-version-of-
> Apache-CXF-tp5780567.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

nicolasduminil
Hi Andy,

Thanks for replying to my post.

So, I assume that yes, as a matter of fact, WebSphere 9.0 comes with Apache CXF 3.0.3.

I'm deploying JAX-RS services and clients using <scope>provided</scope> such that to use the artifacts already deployed with WebSphere. However, I get this kind of exceptions:

Caused by: java.lang.ClassNotFoundException: org.apache.cxf.jaxrs.ext.multipart.Attachment
    at java.net.URLClassLoader.findClass(URLClassLoader.java:609)
    at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:243)
    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:850)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:829)
    at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:134)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
    at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
    at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:587)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:587)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
    ... 37 more

In general things work properly and the required classes are found, it's only that a couple of them, like org.apache.cxf.jaxrs.ext.multipart.*, that raise exceptions. I don't know how to deal with that as I don't want to use anything else then what comes with the server and hence don't want to deploy Apache CXF with my own WAR and to use parent-last classloading strategy.

Additionally, I don't find any trace of CXF in the WebSphere installation. I did searches in all the directories, all the libraries and archives, etc. but nothing. So it's a heavy mistery for me how CXF is included in WebSphere 9. Of course, I posted on the dedicate WebSphere forum as well but nobody feels concerned.

Any suggestion would be welcome.

Many thanks in advance.

Kind regards,

Nicolas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

Andy McCright
HI Nicolas,

WebSphere blocks the org.apache.cxf.* classes from being loaded by customer
applications.  This is intentional, though I don't know the full reason
why.

Packaging your own CXF library in your app will likely fail because the
classes in your app will be loaded by a different classloader than the
classes in WAS's bundle.  It is possible to disable WAS's JAX-RS
implementation and then provide your own (which would allow you to have
more control over the version used, but it sound like you don't really want
to go down that road).

As for how it is packaged, all of the JAX-RS-related CXF jars are bundled
together in a single com.ibm.ws.prereq.jaxrs20 bundle in the
WAS_HOME/plugins directory.  You can see that the Attachment class is
provided, but that it and all classes are prevented from being loaded by
customer applications because that bundle's manifest specifies a mandatory
attribute indicating "was_internal".

You can request that IBM externalize the CXF-specific APIs by opening an
RFE at:
https://www.ibm.com/developerworks/rfe/execute?use_case=changeRequestLanding&BRAND_ID=181&PROD_ID=520

Hope this helps,

Andy



On Fri, May 19, 2017 at 4:46 AM, nicolasduminil <
[hidden email]> wrote:

> Hi Andy,
>
> Thanks for replying to my post.
>
> So, I assume that yes, as a matter of fact, WebSphere 9.0 comes with Apache
> CXF 3.0.3.
>
> I'm deploying JAX-RS services and clients using <scope>provided</scope>
> such
> that to use the artifacts already deployed with WebSphere. However, I get
> this kind of exceptions:
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.cxf.jaxrs.ext.multipart.Attachment
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:609)
>     at
> com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:243)
>     at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:850)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:829)
>     at
> com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:134)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
>     at
> com.ibm.ws.classloader.ProtectionClassLoader.loadClass(
> ProtectionClassLoader.java:62)
>     at
> com.ibm.ws.classloader.ProtectionClassLoader.loadClass(
> ProtectionClassLoader.java:58)
>     at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(
> CompoundClassLoader.java:587)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
>     at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(
> CompoundClassLoader.java:587)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:809)
>     ... 37 more
>
> In general things work properly and the required classes are found, it's
> only that a couple of them, like org.apache.cxf.jaxrs.ext.multipart.*,
> that
> raise exceptions. I don't know how to deal with that as I don't want to use
> anything else then what comes with the server and hence don't want to
> deploy
> Apache CXF with my own WAR and to use parent-last classloading strategy.
>
> Additionally, I don't find any trace of CXF in the WebSphere installation.
> I
> did searches in all the directories, all the libraries and archives, etc.
> but nothing. So it's a heavy mistery for me how CXF is included in
> WebSphere
> 9. Of course, I posted on the dedicate WebSphere forum as well but nobody
> feels concerned.
>
> Any suggestion would be welcome.
>
> Many thanks in advance.
>
> Kind regards,
>
> Nicolas
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/WebSphere-9-0-0-3-How-to-know-what-is-the-version-of-
> Apache-CXF-tp5780567p5780573.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

nicolasduminil
Hi Andy,

Thanks for these explanations. So, besides changing the app server, I don't seem to have much choices here, do I ?

Kind regards,
Nicolas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

bpaskin
This post has NOT been accepted by the mailing list yet.
In reply to this post by Andy McCright
Since this was posted on the WAS forum, let me explain why all the APIs are not opened.  When programming for a JEE App Server the developer should not have to worry about which implementation is running under the covers.  As you noted, Wink was used in the past and replaced with CXF with WAS v9 and in Liberty. Applications written in the past should function as nothing has changed.  If IBM were decide to replace CXF in an upcoming fixpak or release, then this should continue to hold true.

Attachments are not part of the JAX-RS specification yet, and are provided as extensions in CXF.  WAS does implement these extensions, but with com.ibm interfaces so that future releases of the product will allow programs written today to function in the future.  See the Knowledge Center for Attachments with JAX-RS in WAS .   If IBM were to allow direct access to the extensions, then it could cause issues with applications that made use of those extensions if CXF was replaced with another JAX-RS compliant product (i.e. RESTEasy uses org.jboss.resteasy.*).  

Brian
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: WebSphere 9.0.0.3 - How to know what is the version of Apache CXF ?

Andy McCright
In reply to this post by nicolasduminil
For multipart attachment support, have you tried these instructions?
https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_jaxrs_multipart_formdata_from_html.html

A similar question was posted to stack overflow, that provided similar
advice:
https://stackoverflow.com/questions/31908792/jax-rs-2-0-multipart-form-data-file-upload-not-library-specific

Hope this helps,
Andy

On Sat, May 20, 2017 at 5:25 AM, nicolasduminil <
[hidden email]> wrote:

> Hi Andy,
>
> Thanks for these explanations. So, besides changing the app server, I don't
> seem to have much choices here, do I ?
>
> Kind regards,
> Nicolas
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/WebSphere-9-0-0-3-How-to-know-what-is-the-version-of-
> Apache-CXF-tp5780567p5780603.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Loading...