cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: CXF JAX-RS on WebSphere 7
Date Tue, 25 Jun 2013 19:34:09 GMT
Hi

I think you may need to clear some cache in WebSphere, something like 
that, a message like

"The type java.lang.String cannot be resolved. It is indirectly referenced
from required .class files
...
The method getAmount() from the type PaymentAuthorisationReq refers to the
missing type String"

suggests that the compiler is temporarily confused...

Cheers, Sergey

On 25/06/13 19:43, Gaetano Ciotola wrote:
> sorry  the I sent the email by mistake...
> I have finally added  javax.ws.rs-api-2.0-m10.jar
> and this is the stack trace I got:
> [6/25/13 19:22:07:277 BST] 0000000c ContextLoader I
> org.springframework.web.context.ContextLoader initWebApplicationContext
> Root WebApplicationContext: initialization started
> [6/25/13 19:22:07:340 BST] 0000000c XmlWebApplica I
> org.springframework.context.support.AbstractApplicationContext
> prepareRefresh Refreshing Root WebApplicationContext: startup date [Tue Jun
> 25 19:22:07 BST 2013]; root of context hierarchy
> [6/25/13 19:22:07:434 BST] 0000000c XmlBeanDefini I
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions Loading XML bean definitions from ServletContext
> resource [/WEB-INF/cxf.xml]
> [6/25/13 19:22:07:527 BST] 0000000c XmlBeanDefini I
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions Loading XML bean definitions from class path resource
> [META-INF/cxf/cxf.xml]
> [6/25/13 19:22:07:856 BST] 0000000c DefaultListab I
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1c341c34:
> defining beans
> [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,paymentService,serviceBean];
> root of factory hierarchy
> [6/25/13 19:22:08:871 BST] 0000000c DefaultListab I
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
> destroySingletons Destroying singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1c341c34:
> defining beans
> [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,paymentService,serviceBean];
> root of factory hierarchy
> [6/25/13 19:22:08:871 BST] 0000000c ContextLoader E
> org.springframework.web.context.ContextLoader initWebApplicationContext
> Context initialization failed
>
>   org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'paymentService': Cannot resolve reference to bean
> 'serviceBean' while setting bean property 'serviceBeans' with key [0];
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'serviceBean' defined in ServletContext resource
> [/WEB-INF/cxf.xml]: Instantiation of bean failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Could not instantiate
> bean class [com.cgi.webservice.services.PymtServiceImpl]: Constructor threw
> exception; nested exception is java.lang.Error: Unresolved compilation
> problems:
> The type java.lang.Object cannot be resolved. It is indirectly referenced
> from required .class files
> The type java.lang.String cannot be resolved. It is indirectly referenced
> from required .class files
> Implicit super constructor Object() is undefined for default constructor.
> Must define an explicit constructor
> String cannot be resolved to a type
> String cannot be resolved to a type
> String cannot be resolved to a type
> String cannot be resolved to a type
> The method getAmount() from the type PaymentAuthorisationReq refers to the
> missing type String
> String cannot be resolved to a type
> The method getCurrency() from the type PaymentAuthorisationReq refers to
> the missing type String
> String cannot be resolved to a type
> The method getCustomer_id() from the type PaymentAuthorisationReq refers to
> the missing type String
> String cannot be resolved to a type
> The method getFunding_id() from the type PaymentAuthorisationReq refers to
> the missing type String
> String cannot be resolved to a type
> The method getRequest_id() from the type BaseAuthReqRes refers to the
> missing type String
> String cannot be resolved to a type
> The method getType() from the type PaymentAuthorisationReq refers to the
> missing type String
> String cannot be resolved to a type
> The method getVersion() from the type BaseAuthReqRes refers to the missing
> type String
> System cannot be resolved
> Long cannot be resolved to a type
> Long cannot be resolved to a type
> System cannot be resolved
> String cannot be resolved to a type
> The method setAuth_reason_desc(String) from the type
> PaymentAuthorisationResp refers to the missing type String
> String cannot be resolved to a type
>
> at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
> at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
> at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
>
> I have no idea how to proceed any suggestion would be much appreciated
>
> thanks
> Gaetano
>
>
> On 25 June 2013 19:39, Gaetano Ciotola <gaetano.ciotola@gmail.com> wrote:
>
>> 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
>>
>>
>>
>>
>>
>>
>


-- 
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Mime
View raw message