Unable to call JAX-WS client deployed on JBoss 7.1.1 - jboss

I have a generated jax-ws web service client that runs fine when I run it as a java standalone project. However if I add it to a web application (war) deployed on JBoss 7.1.1 and call the web service it throws the following exception:
Caused by: java.lang.NoClassDefFoundError: com/ctc/wstx/io/DefaultInputResolver
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:628)
at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324)
at __redirected.__XMLInputFactory.createXMLStreamReader(__XMLInputFactory.java:139) [jboss-modules.jar:1.1.1.GA]
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1176)
at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:104)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:795)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1493)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1401)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:648)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:461)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:364)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
at $Proxy189.getcodelists(Unknown Source)
Idea what I may be missing?

As the error says, the App server is unable to find the said class file. Is it possible in your standalone app your classpath has the library but JBoss AS 7 is unable to find it.
If you can isolate where this library is, you can either bundle it with your WAR file or create a jboss_module to satisfy the dependency.
Good luck!

Related

NoClassDefFoundError Fop Library when deployed in Prod Server - Jdeveloper 11 Oracle ADF

Oracle Jdeveloper (Version 11.1.1.6.0) building ADF application that generate PDF file using Apache FOP Library. My Application runs local web server. But when deploy in production server, below NoClassDefFoundError exception is showing and failing to generate PDF file.
Exception output:
<code>
javax.el.ELException: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException
at com.sun.el.parser.AstValue.invoke(AstValue.java:191)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
...
...
Caused by: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException
at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:153)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:177)
...
...
Caused by: java.lang.ClassNotFoundException: org.apache.avalon.framework.configuration.ConfigurationException
...
...
</code>
A NoClassDefFoundError with a caused by ClassNoFoundException points to a missing library on the server. Have you checked your deployment artifact (the EAR) if it contains all the needed FOP jars?
If all jars are part of the EAR (or better the WAR inside the EAR), you need to tell the Weblogic Server to load the jars from your deployment first before looking into jars already on the server. See https://tompeez.wordpress.com/2015/06/06/pitfalls-when-using-newer-versioned-libraries-than-shipped-with-jdeveloper-or-weblogic-server/ for more info on that.

#WebServiceRef wsdlLocation can not refer to a classpath entry in JBoss EAP 7 / Wildfly 10

When injecting a webservice client with #WebServiceRef in JBoss EAP, the wsdl is not found by the app server. The webservice client has been generated and the wsdl is bundled with the jar file. When trying to refer to the classpath of the wsdl in the wsdlLocation attribute of the #WebServiceRef annotation, JBoss will produce the following exception:
Caused by: java.io.IOException: WFLYWS0039: Child '/wsdl/mywsdlfile.wsdl' not found for VirtualFile: "/C:/jboss/standalone/deployments/mywebapp.war"
How do I correctly refer to the wsdl which resides in the webservice client jar?
Try this:
<wsdlLocation>/WEB-INF/classes/wsdl/*</wsdlLocation>
Works in my case.
Regards.

Resteasy migration from JBoss 7.1.1 to Wildfly 9.0 special tasks?

After ensuring that all the libraries (only newer) seemed to exist on Wildfly 9, and checking the RestEasy migration page, I tried to deploy an app that works find on AS 7.1.1 (uses Resteasy 2.3.2) to WF9 (Resteasy 3.0.11) but it was unable to deploy due to this error:
Caused by: java.lang.NoClassDefFoundError: org/jboss/resteasy/core/ResourceMethod
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.core.ResourceMethod from [Module \\\"deployment.CodecMapper.war:main\\\" from Service Module Loader]\"}}"
I jarfinded the class and looked in the catalog of resteasy-jaxrs-3.0.11-Final.jar but didn't find it (it was in the 2.3.2 version). Is it in a new jar or failed dependency? Or is this a migration issue I'll need to address in my code (even though it's not listed as one on the Resteasy migration page)?
I have also reviewed the Wildfly migration page specific to Resteasy, but I don't see any changes required.

Java advanced imaging not available to EJB modules in Glassfish on Mac, but show up in EARs

I'm developing an application that uses the Geotools, which in turn uses the Java Advanced imaging (JAI) API to run under Glassfish. When I run my application from Netbeans as an EJB jar file it fails to deploy because of a ClassNotFoundException during CDI scanning :
com.google.common.collect.ComputationException: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.autogena.skyserver.data.filetypes.SwathFile
at com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:218)
....
Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class org.autogena.skyserver.data.filetypes.SwathFile
at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:189)
.....
Caused by: java.lang.NoClassDefFoundError: javax/media/jai/PropertySource
at java.lang.ClassLoader.defineClass1(Native Method)
....
Caused by: java.lang.ClassNotFoundException: javax.media.jai.PropertySource
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
However, if I package the EJB module into an EAR file then I don't get the exception above and it seems to load ok.
Since on the Mac the JAI core classes are in the system extension library I'm baffled how it's not showing up on the classpath.
Is there a difference between an EJB jar and and EAR file when it comes to class loading, or is this a big in Glassfish / Weld?
Come to think of it - how is glassfish finding the libraries my prject uses anyway - they don't seem to be packaged into the ejb jar file - is netbeans doing something clever under the hood here that's going somehow askew?
thanks,
Josh
Try to configure the CLASSPATH on Glassfish in order to use the JAI libraries.

Failure to create Axis2 service in Eclipse WTP, Failure to create Axis2 service in Eclipse WTP, NoClassDefFoundError -CatalogManager

I am using Eclipse Galileo with Web tools platform and I am trying to create a sample Axis2 service. I learned that Eclipse WTP does not work with Axis2 1.5, so I am using 1.4.1. I mostly follow the following tutorial:
Eclipse WTP Tutorials - Creating Bottom Up Web Service via Apache Axis2 (http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html)
When I start tomcat built in Eclipse I am getting the following error:
[INFO] Exception creating Axis Service : null
java.lang.NoClassDefFoundError: org/apache/xml/resolver/CatalogManager
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1850)
…..
[ERROR] Error:
No annotated classes found in the jar: file:/C:/Users/narinskya/workspace5/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/axis2service/WEB-INF/servicejars/version.jar. Service deployment failed.
It looks like class loader is unable to load the CatalogManager class, which is in XML resolver jar file. Try to add XML resolver jar (xml-resolver-1.2.jar) to your WEB-INF/lib directory.