Hello everyone,
Recently started to look into how to develop a RESTful web service using
JAX-RS api provided by CXF framework.
I have developed a simple test web service using as guideline the following
tutorial: http://www.javatips.net/blog/2012/02/cxf-restful-tutorial

I can easily deploy my application on Tomcat 7 and it works without a
glitch. My problem start when I try to get it working on WebSphere (v7
FP13).
here is the a fragment of my original log

[6/24/13 15:41:45:608 BST] 00000018 ContextLoader E
org.springframework.web.context.ContextLoader initWebApplicationContext
Context initialization failed
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'cxf' defined in class path resource
[META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [org.apache.cxf.bus.spring.SpringBus]: Constructor threw
exception; nested exception is
org.apache.cxf.bus.extension.ExtensionException: Could not load extension
class org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl.
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:964)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:910)
...
Caused by: java.lang.IncompatibleClassChangeError:
org.apache.neethi.AssertionBuilderFactory
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:275)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)

I have tried to configure WAS it as explained below but nothing has
changed.:
http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-ForWebSphere6.1.0.29%2CV7andV8

in short it is suggested to
 1) Change the class loader order to "Classes loaded with local class
loader first (parent last)"
 2) Disable the IBM web service engine (either for the JVM as a whole or
for the particular module)


I maybe wrong but what it is suggested above seems to be specific for CXF
JAX-WS, does anyone know if it is a valid solution also for CXF JAX-RS ?

I have also done the following attempt:
 - I have removed jars from  my application (I mean from
 RestfulTest.war\WEB-INF\lib\)
 - I have created a shared library  (from web sphere console) and
referenced the shared library from my  application.
 - I have  added the required jars one by one trying to understand where
the problem is. Currently my jars are:
cxf-2.7.3.jar
httpasyncclient-4.0-beta3.jar
httpclient-4.2.1.jar
httpcore-4.2.2.jar
httpcore-nio-4.2.2.jar
neethi-3.0.2.jar
spring-aop-3.0.7.RELEASE.jar
spring-asm-3.0.7.RELEASE.jar
spring-beans-3.0.7.RELEASE.jar
spring-context-3.0.7.RELEASE.jar
spring-core-3.0.7.RELEASE.jar
spring-expression-3.0.7.RELEASE.jar
spring-web-3.0.7.RELEASE.jar
stax2-api-3.1.1.jar
woodstox-core-asl-4.2.0.jar





-- 
Gaetano Ciotola


UK +44 7880586782
____________________________________________________________________

It is your attitude, not your aptitude, that determines your altitude.

Reply via email to