cxf和myeclipse工具生成webservice client的jax-ws冲突
2014-02-26 14:43
225 查看
项目是SSH架构的,因为本来项目就有一个webservice,是用cxf发布的,
配置文件内容为:
现在要调用又要调用外部的webservice接口,用myeclipse生成客户端的文件后,配置文件修改为
不知道什么原因,服务器启动就报错,这个“cusClient”的bean创建不了,到现在也没能解决。
错误内容如下:
无奈之下,就放弃使用cxf方式的客户端调用方法。
用了原始的方式,发现也不行,经过长时间测试,
原来用myeclipse生成客户端的时候引入了四个webservice开头的jar,把他删掉,就好了。
总结:框架间的使用,很多问题的产生都是jar包冲突,有的网上百度不到,要慢慢找,花费的时间要多。
配置文件内容为:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <!-- 服务端 --> <bean id="webAuthentImpl" class="com.sso.webservice.impl.WebAuthentImpl" /> <jaxws:endpoint id="webAuthent" implementor="#webAuthentImpl" address="/webAuthent" /> </beans>
现在要调用又要调用外部的webservice接口,用myeclipse生成客户端的文件后,配置文件修改为
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <!-- 服务端 --> <bean id="webAuthentImpl" class="com.sso.webservice.impl.WebAuthentImpl" /> <jaxws:endpoint id="webAuthent" implementor="#webAuthentImpl" address="/webAuthent" /> <!-- 短信客户端 --> <jaxws:client id="cusClient" serviceClass="com.sso.webservice.CustomerPortType" address="http://110.131.20.11:8957/services/customer"/> </beans>
不知道什么原因,服务器启动就报错,这个“cusClient”的bean创建不了,到现在也没能解决。
错误内容如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cusClient': Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4681) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184) at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.reflect.MalformedParameterizedTypeException at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:42) at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:35) at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:77) at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:86) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:122) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31) at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:82) at java.lang.Class.getGenericInterfaces(Class.java:794) at org.springframework.core.GenericTypeResolver.getTypeVariableMap(GenericTypeResolver.java:151) at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:99) at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.java:76) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) ... 22 more
无奈之下,就放弃使用cxf方式的客户端调用方法。
用了原始的方式,发现也不行,经过长时间测试,
原来用myeclipse生成客户端的时候引入了四个webservice开头的jar,把他删掉,就好了。
总结:框架间的使用,很多问题的产生都是jar包冲突,有的网上百度不到,要慢慢找,花费的时间要多。
相关文章推荐
- MyEclipse使用JAX-WS 2.0生成WebService报错,无法生成WSDL文件
- MyEclipse 8.6编写JAX-WS的WebService-minOccurs等在Java里怎么生成的?
- WebService -- Java 实现之 CXF ( 使用CXF工具生成client 程序)
- Eclipse 生成webservice Client与JAX-WS不兼容问题解决
- myEclipse2014、JAX-WS、tomcat 配置webservice
- myeclipse6.5上基于JAX-WS开发Webservice(英文)
- CXF生成webservice Client代码
- 基于CXF的JAX-WS、JAX-RS(RESTful)的webService
- java调用Myeclipse通过jax-ws方式搭建的webservice
- MyEclipse6.5上基于JAX-WS开发Webservice(中文示例)
- MyEclipse8.5 基于jax-ws的webservice对象(实体)传递的开发
- JAX-WS生成代码工具说明
- WebService第一步 - MyEclipse中开发JAX-WS
- (二)CXF之用CXF官方工具生成客户端Client
- CXF生成本地ws调用代码测试webservice
- CXF动态客户端如何优化JaxWsDynamicClientFactory.createClient -- 慢
- 使用CXF开发JAX-WS类型的WebService
- 一、使用cxf的JaxWsServerFactoryBean创建webservice的服务端和客户端
- 如何使用JAX-WS生成WebService