Issue with neethi jar in WAS7 - java

I am deploying a SOAP based webservice client on WAS7. I am able to consume service from my machine by deploying client on Tomcat 8.0 but I am getting errors related to neethi jar on WAAS7.
Error: org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.IncompatibleClassChangeError: org.apache.neethi.AssertionBuilderFactory
So I went through several articles on net but nothing seems to help. I have tried changing the class loader policy to "parent_last" for my module but it as suggested in one of the stackoverflow questions but it didn't work.
Incompatible neethi.jar with WAS 7
I have tried following :
(a) change the class loader policy
(b)change the manifest file to include "DisableIBMJAXWSEngine: true"
(c) tried using CXF 2.7.5 with neethi 3.0.2 and xmlschema-core 2.0.3
Any info/help is much appreciated.
TIA

Related

Error on war file deployment on WebLogic Server

I am deploying one war file on WebLogic server (12.1.3.0.0) but when I try to start that application to serve all requests. It get failed with the following error message:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.web.method.annotation.ExceptionHandlerMethodResolver.hasExceptionMappings()Z .
The same war file is working fine on Windows platform and other Linux machines but I am getting that error on one particular Linux machine so my understanding is that there is something missing (e.g. some package) on this machine but I am unable to identify that what exactly.
It means "I cannot find the method hasExceptionMappings inside class org.springframework.web.method.annotation.ExceptionHandlerMethodResolver"
Please check if the spring jar version that the WebLogic using is different when you are compile the WAR. The spring library could be a shared library, you may check the classpath first.
FYI: https://docs.oracle.com/middleware/1212/wls/WLPRG/classloading.htm#WLPRG319
If this code works on other machines and is definitely an identical deployment, then the difference must be on the machine where you are deploying it. I agree you should check the versions of the Spring files that are provided on this server against those where it does run successfully. When you find a difference you will know what needs fixing.

How to resolve java.lang.NoClassDefFoundError: iaik/x509/X509Certificate?

I am using Struts 2.0 for one application and getting the class not found exception:
java.lang.NoClassDefFoundError: iaik/x509/X509Certificate
After searching some site i found this class is in iaik_jce.jar.Can anyone help me understanding when this jar is required and if the jar is proper
Cannot paste the entire stacktarce.
The issue is resolved adding enttoolkit.jar .
The jar is available with webmethods client \common\lib\ext\enttoolkit.jar
The java code is calling service of webmethods,so the jar is required in the java app classpath.

Spring Boot Starter Integration and Starter WS not playing well together?

I'm working on a spike to try to exercise a number of technologies with spring boot (1.1.6.RELEASE), gradle (2.1) and Java 1.8. So we are looking at supporting some old style SOAP Web Service calls as well as Spring Integration. So to get off the ground I was looking at working with the example for producing a web service (http://spring.io/guides/gs/producing-web-service/) and adding spring integration into the mix.
When I did this though and try to hit the WSDL location I am now seeing this stack trace :
2014-09-22 09:53:17.823 ERROR 15188 --- [nio-8080-exec-1] a.c.c.C.[.[.[.[messageDispatcherServlet] : Servlet.service() for servlet[messageDispatcherServlet] in
context with path [] threw exception [Request processing failed; nested exception is java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.getXmlStandalone()Z] with root cause
java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.getXmlStandalone()Z
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:377)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:131)
at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:98)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:699)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:743)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:357)
at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.handle(WsdlDefinitionHandlerAdapter.java:144)...
Looking around this looks to be related to the Xerces implementation that is pulled in for Integration. You can reproduce this by taking the example Producing a SOAP web service and changing the dependency section to look like this :
dependencies {
compile("org.springframework.boot:spring-boot-starter-ws")
compile("wsdl4j:wsdl4j:1.6.1")
jaxb("com.sun.xml.bind:jaxb-xjc:2.2.4-1")
compile(files(genJaxb.classesDir).builtBy(genJaxb))
compile("org.springframework.boot:spring-boot-starter-integration")
}
Basically adding compile("org.springframework.boot:spring-boot-starter-integration") and then try hitting the WSDL at http://:/ws/countries.wsdl. (running gradle bootRun)
Now arguably this may not be the best way to do this and maybe I should just look to spring integration to expose the endpoint, but has anyone else seen and dealt with this?
Thanks in advance
Tristan
Note I did add the compile "org.apache.ws.xmlschema:xmlschema-core:2.1.0" dep
Here is my jar list from the lib directory
aopalliance-1.0.jar
aspectjrt-1.8.2.jar
aspectjweaver-1.8.2.jar
classmate-1.0.0.jar
commons-codec-1.2.jar
commons-httpclient-3.0.1.jar
commons-io-2.4.jar
hibernate-validator-5.0.3.Final.jar
jackson-annotations-2.3.0.jar
jackson-core-2.3.4.jar
jackson-databind-2.3.4.jar
jboss-logging-3.1.1.GA.jar
jcl-over-slf4j-1.7.7.jar
jdom-1.0.jar
jul-to-slf4j-1.7.7.jar
log4j-over-slf4j-1.7.7.jar
logback-classic-1.1.2.jar
logback-core-1.1.2.jar
rome-1.0.0.jar
rome-fetcher-1.0.0.jar
slf4j-api-1.7.7.jar
snakeyaml-1.13.jar
spring-aop-4.0.7.RELEASE.jar
spring-beans-4.0.7.RELEASE.jar
spring-boot-1.1.6.RELEASE.jar
spring-boot-autoconfigure-1.1.6.RELEASE.jar
spring-boot-starter-1.1.6.RELEASE.jar
spring-boot-starter-aop-1.1.6.RELEASE.jar
spring-boot-starter-integration-1.1.6.RELEASE.jar
spring-boot-starter-logging-1.1.6.RELEASE.jar
spring-boot-starter-tomcat-1.1.6.RELEASE.jar
spring-boot-starter-web-1.1.6.RELEASE.jar
spring-boot-starter-ws-1.1.6.RELEASE.jar
spring-context-4.0.7.RELEASE.jar
spring-core-4.0.7.RELEASE.jar
spring-expression-4.0.7.RELEASE.jar
spring-integration-core-4.0.3.RELEASE.jar
spring-integration-file-4.0.3.RELEASE.jar
spring-integration-http-4.0.3.RELEASE.jar
spring-integration-ip-4.0.3.RELEASE.jar
spring-integration-stream-4.0.3.RELEASE.jar
spring-jms-4.0.7.RELEASE.jar
spring-messaging-4.0.7.RELEASE.jar
spring-oxm-4.0.7.RELEASE.jar
spring-retry-1.1.0.RELEASE.jar
spring-tx-4.0.7.RELEASE.jar
spring-web-4.0.7.RELEASE.jar
spring-webmvc-4.0.7.RELEASE.jar
spring-ws-core-2.2.0.RELEASE.jar
spring-ws-support-2.2.0.RELEASE.jar
spring-xml-2.2.0.RELEASE.jar
tomcat-embed-core-7.0.55.jar
tomcat-embed-el-7.0.55.jar
tomcat-embed-logging-juli-7.0.55.jar
validation-api-1.1.0.Final.jar
wsdl4j-1.6.1.jar
xercesImpl-2.4.0.jar
xmlschema-core-2.1.0.jar
Looks like for the WSDL generation you should provide this dependency:
compile "org.apache.ws.xmlschema:xmlschema-core:2.1.0"
Which is optional from the Spring WS and looks like there is no appropriate implementation in your environment.
UPDATE
Try to add xalan too:
compile "xalan:xalan:2.7.1"
https://groups.google.com/forum/#!topic/google-web-toolkit/07rVeEkCtyU
Or do some tricks with Xerses: java.lang.AbstractMethodError: org.apache.xerces.dom.ElementImpl.getTextContent()Ljava/lang/String

Axis Error unable to engage module addressing

I am using axis2 on Apache Tomcat. I am writing client side to consumer SOAP WS. I configured Eclipse to use Tomcat as a server and while executing that line
stub._getServiceClient().engageModule("addressing");
I was getting that error "unable to engage module addressing". To fix that issue I add following line in the VM arguments of run configuration
-Daxis2.repo="E:\axis2\repository"
Now I export my project as a war file and deploy it on the real server. But Now I am again getting the same error(I checked the log file). I don't know how to fix, can every one help me. Thanks
It got resolved on my side in the following way:
I had an outdated WEB-INF/modules/axis2-jaxws-mar*.mar or rather 2 versions of it and the classloader got the older one of it and AxisServlet didn't start altogether
java.lang.NoSuchMethodError: org.apache.axis2.engine.AxisConfiguration.getGlobalModules()Ljava/util/List;
at org.apache.axis2.jaxws.module.JAXWSModule.registerGlobalModule(JAXWSModule.java:51)

java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.bind.api.JAXBRIContext

I created a jaxws web service. I totally followed the url
The service was up perfectly without any error. But the server having errors when request hit it.
SEVERE: caught throwable
java.lang.ClassCastException: com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.bind.api.JAXBRIContext
at com.sun.xml.ws.db.glassfish.JAXBRIContextFactory.newContext(JAXBRIContextFactory.java:74)
at com.sun.xml.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:149)
at com.sun.xml.ws.message.jaxb.JAXBMessage.create(JAXBMessage.java:160)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createSOAP11Fault(SOAPFaultBuilder.java:433)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createSOAPFaultMessage(SOAPFaultBuilder.java:210)
I checked through out stackoverflow and many other sites all says jar file conflict.
I use java-6-openjdk.
and below is my jar file list in the jetty server.
gmbal-api-only.jar ha-api.jar jaxb-core.jar
jaxb-impl.jar jaxws-rt.jar management-api.jar
policy-2.3.1.jar stax-ex.jar streambuffer-1.5.1.jar
Since above jars are not working I tried with
Go here
Download JAX-WS RI distribution.
But those jars gave the same error.
I have also came across same exception and little bit googling it confirmed that its because of classpath/jar issue.
I'm using Java 6.0 as build and runtime environment and my project setup having jaxb-api.jar and jaxb-impl.jar. I simply removed these two jars from classpath and it works.
As if we are having Java 6.0 we dont need to use explicitely JAX binding jars. It comes by default with Java 6.0.
Check this thread: web client for web service. The main problem I think is that you have several jaxb jars that differ in versions. For example, I think that jaxb is already part of jaxws-rt.jar which would mean you don't need jaxb-core.jar and jaxb-impl.jar.
Same error occured on my Java 7 project. Removing
com/sun/xml/bind/jaxb-impl-2.2.6.jar
com/sun/xml/bind/jaxb-xjc-2.2.6.jar
dependencies solved the problem.
Alternative solution :
clientPort is an Interface with #WebService annotation.
BindingProvider prov = (BindingProvider) clientPort;
prov.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointUrl);
prov.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, serviceUsername);
prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, servicePassword);

Categories