NoClassDefFoundError: com.ibm.ws.wstx.handler.WSATGenerator - web-services

I'm using the web client for web service. Client stub is generated with Axis 2. Everything is deployed on WebSphere 7.0.
When deployed on my developer machine (websphere instance run inside IBM RAD Eclipse) I'm connected with remote web service. However, on test machine, the error is thrown:
java.lang.NoClassDefFoundError: com.ibm.ws.wstx.handler.WSATGenerator (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at com.ibm.ws.wstx.WSTXClientTCMImpl.handleInbound(WSTXClientTCMImpl.java:100)
at com.ibm.ws.wstx.WSTXClientTCMImpl.cleanupContext(WSTXClientTCMImpl.java:81)
at org.apache.axis2.util.ThreadContextMigratorUtil.performContextCleanup(ThreadContextMigratorUtil.java:192)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.postExecute(AxisInvocationController.java:657)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:589)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:130)
at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:364)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:185)
at $Proxy94.getList(Unknown Source)
The ear that is deployed there is made by me on my development machine, so it's exactly the same code. So I suppose that it's some configuration issue. However, I have no idea, what part of configuration can be responsible for that.
So, I have the question, what is this WSATGenerator, and in which jar it should be available? Is it a standard library on WebSphere, or must it be manually configured? What configuration differences could cause that error thrown on test server and no by me?
I'm running Windows 7, the test machine is on Unix. Both machines are 64bit.
--edit--
Before NoClassDefFoundError, there is throws ExceptionInInitializerError:
java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.initialize(J9VMInternals.java:222)
at com.ibm.ws.wstx.handler.WSATGenerator.<clinit>(WSATGenerator.java:127)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at com.ibm.ws.wstx.WSTXClientTCMImpl.migrateThreadToContext(WSTXClientTCMImpl.java:61)
at org.apache.axis2.util.ThreadContextMigratorUtil.performMigrationToContext(ThreadContextMigratorUtil.java:163)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.preExecute(AxisInvocationController.java:608)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:570)
... 82 more
Caused by:
java.lang.ClassCastException: com.systinet.jaxrpc.rpc.ServiceFactoryImpl incompatible with com.ibm.wsspi.webservices.rpc.ServiceFactory
at com.ibm.ws.Transaction.wstx.WSATServices$1.run(WSATServices.java:83)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ws.Transaction.wstx.WSATServices.<clinit>(WSATServices.java:74)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
... 89 more

Related

Problems running wso2ei sample 904 - kafka inbound endpoint

I trying out sample 904 for WSO2 EI and following the sample guidelines.
Still I'm getting the following error when starting up the runtime:
[2018-05-12 19:54:45,960] [] INFO - KAFKAMessageListener Creating Kafka Consumer Connector...
[2018-05-12 19:54:45,977] [] INFO - MediationStatisticsComponent Global Message-Flow Statistic Reporting is Disabled
Exception in thread "Thread-18" java.lang.NoClassDefFoundError: com/typesafe/scalalogging/Logger$
at kafka.utils.Log4jControllerRegistration$.<init>(Logging.scala:25)
at kafka.utils.Log4jControllerRegistration$.<clinit>(Logging.scala)
at kafka.utils.Logging.$init$(Logging.scala:47)
at kafka.utils.VerifiableProperties.<init>(VerifiableProperties.scala:27)
at kafka.consumer.ConsumerConfig.<init>(ConsumerConfig.scala:110)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAMessageListener.createKafkaConsumerConnector(KAFKAMessageListener.java:56)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAPollingConsumer.poll(KAFKAPollingConsumer.java:145)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAPollingConsumer.execute(KAFKAPollingConsumer.java:116)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKATask.taskExecute(KAFKATask.java:48)
at org.wso2.carbon.inbound.endpoint.common.InboundRunner.run(InboundRunner.java:108)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.typesafe.scalalogging.Logger$ cannot be found by kafka_2.12_1.1.0_1.0.0
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
Don't know my options and I ran out of ideas. Any help would be appreciated.
Versions:
jre 1.8.0_161
wso2ei 6.2.0
kafka 2.12-1.1.0
zookeeper 3.4.12
Looks like it cannot find the "Logger" class. Are you sure you copied all of the required libs to /lib (also the one mentioned in the notes section of wso2 documentation if needed)?
What you could try is to start EI with osgi console enabled and check if the class is there. The following link might help.
OSGI
What you could also do is to open/extract the imported jar's and see if there's the class inside.

Startup Errors for Version 5.2 of WSO2 Identity Server

I have downloaded the latest version of wso2 identity server (5.2). However during the startup process I am getting the following errors.
[2016-10-26 09:50:27,563] INFO {org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer} - Deployed webapp: StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wso2].File[D:\wso2is-5.2.0\bin\..\repository\deployment\server\webapps\wso2.war]
java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
java.security.KeyStoreException: failed to extract any certificates or private keys - maybe bad password?
[2016-10-26 09:50:29,074] ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} -
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at org.apache.commons.ssl.SSL.<init>(SSL.java:154)
at org.apache.commons.ssl.SSLClient.<init>(SSLClient.java:60)
at org.apache.commons.ssl.HttpSecureProtocol.<init>(HttpSecureProtocol.java:55)
at org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory.<init>(EasySSLProtocolSocketFactory.java:94)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.<init>(XMLHttpRequestHostObject.java:84)
... 113 more
Caused by: java.lang.NullPointerException
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:127)
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:118)
at org.apache.commons.ssl.TrustMaterial.<clinit>(TrustMaterial.java:108)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.KeyMaterial
at org.apache.commons.ssl.SSL.<init>(SSL.java:154)
at org.apache.commons.ssl.SSLClient.<init>(SSLClient.java:60)
It is a vanilla version of the server and I haven't made any kind of configuration changes. I am running on JDK 1.8. Can someone tell me what the resolution will be. I tried including "not-yet-commons-ssl-0.3.10.jar" and that didnt help.
Regards
Ranjith Madhavan
I recently got this exception, it was due to the fact that i donot have /lib/security/cacerts and /lib/security/jssecacerts in my jre.

Profiling Spray HTTP Application using Yourkit

I have a Spray based HTTP application running on a remote machine and I would like to profile it using Yourkit. I followed the instructions as mentioned in the Yourkit website and I ended up hitting this error:
root#remote-worker:/home/joe/yjp-2016.02/bin# sh yjp.sh -attach 19960
Attaching to process 19960 using default options
[YourKit Java Profiler 2016.02-b36] Log file: /root/.yjp/log/yjp-23609.log
com.yourkit.runtime.PresentableException: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at com.yourkit.f.a.a(a:93)
at com.yourkit.f.b.attach(a:188)
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:498)
at com.yourkit.Main$5.run(a:17)
Attach to a running JVM failed.
Solution: start JVM with the profiler agent instead of attaching it to a running JVM:
https://www.yourkit.com/docs/java/help/running_with_profiler.jsp
root#remote-worker:/home/joe/yjp-2016.02/bin#
Solution is printed at the end of message: start JVM with the profiler agent instead of attaching it to a running JVM: https://www.yourkit.com/docs/java/help/running_with_profiler.jsp
Attach works only in HotSpot JVM; and running JVM process should have enough permissions. Please find details in "The attach mode limitations" at https://www.yourkit.com/docs/java/help/attach_agent.jsp

error when deploying Java WS in Jboss 6.3.0 EAP

I am migrating an application with Java WS from Jboss 5.1.0 to Jboss 6.3.0 EAP. It works fine with Jboss 5.1.0 but I am getting error while deploying the same in Jboss 6.3.0 EAP.
14:42:10,887 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deploy
ment.unit."my-app.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."dtm-banking.
war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "dtm-banking.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-a
s-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-ms
c-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.F
inal-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
Caused by: javax.xml.ws.WebServiceException: java.lang.reflect.UndeclaredThrowableException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:66)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)
at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:118)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:137
)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:69)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-a
s-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
... 5 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy371.visitLabel(Unknown Source)
at org.apache.cxf.jaxws.WrapperClassGenerator.createWrapperClass(WrapperClassGenerator.java:213)
at org.apache.cxf.jaxws.WrapperClassGenerator.generate(WrapperClassGenerator.java:122)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.generatedWrapperBeanClass(JaxWsServiceFactoryBean.java:6
83)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.getExtraClass(JaxWsServiceFactoryBean.java:653)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBea
n.java:484)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBe
an.java:550)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
:102)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 13 more
Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)
at java.lang.Class.getMethod(Class.java:1665) [rt.jar:1.7.0_60]
at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:85)
... 28 more
I understand Jboss 6.3.0 EAP uses CXF implementation for webservice, but I am looking for simple Java WS to use the standard Java EE environment.
tried the following in jboss-deployment-structure.xml
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
this got rid of the exception at deployment time but I get a Classcast exception when invoking the wsdl for the service
http://localhost:8080/myapp/myservice?wsdl
JBWEB000235: Allocate exception for servlet MyWebService: java.lang.ClassCastException: com.example.webservice.endpoint.DataService cannot be cast to javax.servlet.Servlet
any idea?
The problem is bundling asm.jar in your deployment.
Try remove it and add this to your jboss-deployment-structure.xml:
<jboss-deployment-structure>
<deployment>
<dependencies>
...
<module name="asm.asm" />
...
</dependencies>
</deployment>
</jboss-deployment-structure>
See more: https://developer.jboss.org/message/823745
The answer that fixed things for me was:
I had the same problem. Adding jboss-deployment-structure.xml only
work for WAR files. If I depolyed the WAR inside an EAR I got the
error back. So I added
<global-modules>
<module name="asm.asm" slot="main"/>
</global-modules>
to the current jboss configuration, ie standalone-full.xml The it
work fine for me.
So if anyone stumbles upon this question, give it a try.
Rifer this page too.
https://access.redhat.com/solutions/690353
The above Error is thrown when for given class particular method not
found. Hence user is packaging asm jar in their application and class
"org.objectweb.asm.MethodWriter" which contains in a jar does not have
method "public void visitLabel(org.objectweb.asm.Label);" hence
getting "java.lang.NoSuchMethodException".

Embedded Tomcat 7 does not found ServletContainerInitializer from servlet-api 3.x

I'm using the embedded Tomcat 7.0.40 for my unit tests. My webapp uses Servlet 3.x (with x>0).
I managed to deploy my webapp on the Tomcat.
// create the embedded Tomcat
Tomcat tomcat = new Tomcat();
// (...)
// deploy the WAR in the webApp folder
// (...)
// add the WebApp in Tomcat
Context context = tomcat.addWebapp(tomcat.getHost(), "/myapp", webApp.getAbsolutePath());
// (...)
// start the embedded Tomcat
tomcat.start()
However, when I start Tomcat an exception is thrown:
(...)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1659)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1569)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1277)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 25 more
The javax.servlet.ServletContainerInitializer is localized in the javax.servlet-api JAR starting from version 3.1.
Do you know how to solve this issue?
How can I add programatically this library in the classpath of the embedded Tomcat?
I try several methods by none work...
Thanks for help.