[英]Websphere Application Server calls classes from axis jar
I am using JAX-WS to create stub. 我正在使用JAX-WS创建存根。 I have to deploy my EAR file on WAS 7.0.
我必须在WAS 7.0上部署EAR文件。
By default, call to the class is made to the classes in in the axis jar org.apache.axis2.jar which is present in the plugins folder and an error is occured which stops the application to run. 默认情况下,将对plugins文件夹中存在的轴jar org.apache.axis2.jar中的类进行调用,并且发生错误,该错误使应用程序停止运行。
In the configuration menu I have checked the parent last option and removed the axis jar from the plugins folder.Then the application runs fine. 在配置菜单中,我检查了上一个上一个选项,并从plugins文件夹中删除了axis jar。然后应用程序运行正常。
But now my requirement is to run the application without deleting the org.apache.axis2.jar from the plugins folder. 但是现在我的要求是运行应用程序,而不要从plugins文件夹中删除org.apache.axis2.jar。 Is there any way we can make the application run without removing the jar.
有什么方法可以使应用程序在不删除jar的情况下运行。
Thanks in advance. 提前致谢。
Edited after trying aviad's answer: I am still facing the same problem 尝试aviad的答案后进行了编辑:我仍然面临着同样的问题
Caused by: java.lang.ClassCastException: Cannot cast class org.apache.axis2.jaxws.spi.Provider to class javax.xml.ws.spi.Provider
at java.lang.Class.cast(Class.java:1691)
... 131 more
I strongly recommend you to read WAS Class loader determination paper. 我强烈建议您阅读WAS类装入器确定文件。 .
。 You need to use shared library and also define dependency load order inside your EAR.
您需要使用共享库 ,还需要在EAR中定义依赖项加载顺序。
Good Luck! 祝好运!
First idea that comes to mind is generating the stubs for WebSphere webservice framework (which is based on axis2). 想到的第一个想法是为WebSphere webservice框架(基于axis2)生成存根。 This works that well that I have projects running axis1 and axis2 webservices together.
我有一起运行axis1和axis2 Web服务的项目,效果很好。 The job can be done in Eclipse pretty easy (or Rational Software Architect / Developer for WebSphere - available as demo versions as well )
可以很容易地在Eclipse中完成该工作(或者可以通过WebSphere的Rational Software Architect / Developer-也可以作为演示版本使用 )。
Second shot is to change the import in the generated classes. 第二步是在生成的类中更改导入。 This of course needs a stable WSDL so that classes do not need to be generated on a regular basis.
当然,这需要稳定的WSDL,因此不需要定期生成类。 I think it's always a good idea to start with generated classes to finally adapt them to your needs and append additional code by hand.
我认为从生成的类开始以使它们最终适应您的需求并手动添加其他代码始终是一个好主意。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.