CXF发布webservice在tomcat中没问题。
部署在Websphere中,直接访问WebServices没有问题,在访问?wsdl时出问题,问题出在wsdl4j-1.6.2.jar上面,也是ClassLoader的问题。
在网上搜到了 http://topic.csdn.net/u/20081025/17/3a60662f-a7aa-4454-a737-0a2863c7dda4.html
这里引用一下
建议用第二种
put jar in the endorsed folder
put the wsdl4j-1.6.1.jar in the $WebSphere_HOME/java/jre/lib/endorsed folder.
In the WebSphere console, find the specific enterprise application, click the "Class loading and update detection".
Mark the "Classes loaded with application class loader first" selected.
Mark the "Class loader for each war file in application" selected.
And then restart the Websphere server. (Because we changed the endorsed folder, we need to restart it to make it take effect).
Please make sure your classpath doesn't have the servlet-2.5 library, since WebSphere6.1 is servlet-2.4 compliant!
Add your own class loader
If you put your wsdl4j-1.6.1 jar in $WAS_HOME/java/jre/lib/endorsed, all your applications will depend on your version of wsdl4j. Another solution is to create a new class loader in your server which loads before parent class loader, create a shared library with your version of wsdl4j, and add this shared library to your new class loader. This version of wsdl4j will only be available for your specific server and not affect applications running in other servers.
Step by step
In the WAS console navigate to Environment > Shared Libraries
Select the scope you wish your library should be visible in
Click New and set values ex: name=MYAPP_SHARED_LIB, classpath=PATH_TO/wsdl4j-1.6.1.jar and Save
Navigate to Application servers > [your server name] > Java and Process Management > Class loader > New
Select Classes loaded with application class loader first and Save
Select your new class loader and click Shared library references
Add your shared library (MYAPP_SHARED_LIB) Save and restart your server.
Tested in WAS 6.1 only but should work in earlier versions as well.
分享到:
相关推荐
NULL 博文链接:https://hw1287789687.iteye.com/blog/2034439
CXF是一个很好用的web service框架,但是部署在WebSphere上容易出现问题,这是收集到的解决这些问题的方法。
webservice CXF 报错:java.lang.NoClassDefFoundError: org/apache/neethi/builders/AssertionBuilder 需要用到此jar文件 通过apache官网可获得。 文件位置\apache-cxf-2.7.13\lib
cxf html.rar cxf html.rar
JAVA的WebService support
为了解决wsdl解析 生成对应的Java类对象 本网址可以直接点击下载
WebService之CXF开发.pdfWebService之CXF开发.pdf
spring 4.2.0 集成的cxf3.1.18的jar包,cxf-core-3.1.18.jar、cxf-rt-bindings-soap-3.1.18.jar、cxf-rt-databinding-jaxb-3.1.18.jar、cxf-rt-frontend-jaxws-3.1.18.jar、cxf-rt-frontend-simple-3.1.18.jar、cxf-...
s.addLocation(StaxUtils.java:1038) at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java:893) at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:965) at org.apache.cxf....
cxf2.7.1.jar该文件为cxf全量包,各jar包间无冲突,亲测可用(已使用其搭建项目)
WebService流行框架之Axis和CXF=.docxWebService流行框架之Axis和CXF=.docx
CXF restful的许多异常java.lang.NoClassDefFoundError: javax/ws/rs/MessageProcessingException.需要javax.ws.rs-api-2.0-m10.jar
WebService_CXF学习.doc
CXF配置.doc
CXF3.1.10版本全部jar包
目前最新版本的CXF包,可以辅助开发Web Service的服务器端和客户端
<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"/>
apache-cxf-2.6.1.zip cxf转化wsdl文件,生成javaBean实体类 附上使用文章:http://blog.csdn.net/sinat_34979884/article/details/78776305
在使用Idea根据wsdl自动生成java code的时候;抛出无法找到主类:org.apache.axis.wsdl.WSDL2Java(Throws Could not find main class: org.apache.axis.wsdl.WSDL2Java)。 添加本文的jar包压缩包解压出来的所有jar包...