Monday, 26 June 2017

Failed to instantiate [org.apache.cxf.endpoint.Server]: Factory method 'jaxRsServer' threw exception;



Exception:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.cxf.endpoint.Server]: Factory method 'jaxRsServer' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.AopUtils.isCglibProxyClass(Ljava/lang/Class;)Z
 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
 at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
 ... 28 more
Caused by: java.lang.NoSuchMethodError: org.springframework.aop.support.AopUtils.isCglibProxyClass(Ljava/lang/Class;)Z
 at org.apache.cxf.common.util.SpringAopClassHelper.getRealClassInternal(SpringAopClassHelper.java:85)
 at org.apache.cxf.common.util.ClassHelper.getRealClass(ClassHelper.java:55)
 at org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClassesFromBeans(JAXRSServiceFactoryBean.java:218)
 at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(JAXRSServerFactoryBean.java:302)
 at com.example.config.AppConfig.jaxRsServer(AppConfig.java:29)
 at com.example.config.AppConfig$$EnhancerBySpringCGLIB$$67f4649c.CGLIB$jaxRsServer$3(<generated>)
 at com.example.config.AppConfig$$EnhancerBySpringCGLIB$$67f4649c$$FastClassBySpringCGLIB$$ae89a288.invoke(<generated>)
 at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
 at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
 at com.example.config.AppConfig$$EnhancerBySpringCGLIB$$67f4649c.jaxRsServer(<generated>)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:483)
 at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(Simpl




 To solve this issue update your versions of below dependencies:

<org.apache.cxf.version>3.1.0</org.apache.cxf.version>

<org.springframework.version>4.3.5.RELEASE</org.springframework.version>

this will resolve the issue,


No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...