java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory - websphere

I have installed my application and restarted in WAS 8.5, I see below exception in SystemOut.log,where as it works fine in WAS 7.
java.lang.NoSuchMethodError: org/apache/http/conn/ssl/SSLSocketFactory.<init>(Ljava/lang/String;Ljava/security/KeyStore;Ljava/lang/String;Ljava/security/KeyStore;Ljava/security/SecureRandom;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V
Can any one help me how to resolve this issue?

I'd guess you're deploying and trying to use one version of Apache HttpClient, but that WebSphere has a different version included in its libraries. If you could use the WebSphere-included version, that would be simplest, but if you need to use the specific version, you could change the WebSphere classloader policy to PARENT_LAST.

websphere8 /WebSphere/AppServer/plugins/com.ibm.ws.prereq.jaxrs.jar has packages org.http.*
com.ibm.ws.prereq.jaxrs.jar and HttpClient.jar conflict!
Change classloaders order invalid because com.ibm.ws.prereq.jaxrs.jar has been loaded when websphere start!
you can change HttpClient packages from org.http.* to net.test.* to avoid conflict
ps:
http://www.ibm.com/developerworks/cn/websphere/library/techarticles/1108_jiangwk_classloader/1108_jiangwk_classloader.html

Related

Liberty Profile and MQ version conflict

I currently have an environment where I am trying to get a Liberty Profile v8.5.5.9(using Java 7) to utilize a WebSphere MQ v9.0.3(using Java 8). These two are on the same box, the server.xml is configured correctly, but I'm getting a namespace error when I'm trying to do a direct client connection.
I'm just trying to rule out if there's a problem using these two versions together that would cause a JNDI problem.
There apparently is a conflict between the two environments. Once I removed 9.0.3 and installed 7.5(MQ) it now works.

pluginutility in Liberty 16.0.0.3 class not found

As I know for Liberty 16.0.0.3 has a new pluginutility function, however when I run it, it always throw NoClassDefFoundError, no matter I'm using oracle / IBM JDK, anyone has this problem too?
java.lang.NoClassDefFoundError: com.ibm.ws.http.plugin.merge.PluginMergeToolFactory
This is a bug in the pluginUtility and the following APAR will correct this issue : PI69803. Currently the pluginUtility merge action will only work with an ND install.

Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ORB in WAS Liberty

I started using WAS Liberty 8.5 in my eclipse,when i try to deploy an application I am getting this error.
Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ORB
I found that its due to the WAS runtime jar ibmorb.jar provided with WAS server install.
I dont know how to configure in WAS Liberty profile.Any clues.
Even i mentioned in the library path,but still error getting.
<variable name="DRIVER_PATH" value="C:\NovemberR2\DMS\deploy\lib"/>
<library id="db2Lib">
<fileset dir="${DRIVER_PATH}" includes="com.ibm.ws.orb_8.5.0.jar classes12.jar oracleJDBC.jar ojdbc6.jar ojdbc14.jar ibmorbapi.jar ibmorb.jar"/>
</library>
The stacktrace is --->
here is the stack trace. ...` 61 more
Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ORB
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at com.ibm.ws.naming.util.Helpers.getInitORBMethodForNonApplet(Helpers.java:411)
at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:390)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:462)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
orSourcesPropertyResolver.java:84)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:60)
at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:511)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:135)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:132)
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:84)
at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:70)
at org.springframework.core.env.AbstractPropertyResolver$1.resolvePlaceholder(AbstractPropertyResolver.java:207)
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:147)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:204)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:178)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:175)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:801)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:962)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 63 more
Thanks for the hints,but i used to run this application well in WAS 8.0 server and IBM WAS JDK provide in built and i started migration to WAS 8.5 using liberty profile thought of experimenting it.
Hope this answer would be helpful to others as it may be too late!
Try adding com.ibm.ws.orb_8.5.0.jar in the class path. This jar will be available under <WAS_HOME>\AppServer\runtimes . This will resolve the issue.
The issue here looks like you are using the JDK provided with WAS traditional to run a Liberty server.
The JDK that comes with WAS traditional is going to have extra stuff in it that is specifically for running with WAS traditional (it does not not support pluggable JDKs).
Instead:
Use a standard JDK to run your Liberty server. You can get a standard JDK from IBM (not the one that comes with WAS traditional), Oracle, or OpenJDK.
The question states that the application worked correctly on WAS 8.0. With WAS 8.5, you are now trying to run the same application on the Liberty Profile. The Liberty profile supports a subset of the functionality of the traditional WAS profile (now termed 'full profile').
As user #aguibert mentioned in their answer, you have to provide the Java runtime environment for the Liberty profile. This can be any compliant Java SE 6/7/8 JRE/JDK*. For the full profile, a different JDK is required; this is bundled with the installation package. This WebSphere JDK should contain the ibmorb.jar file.
Therefore, try running your application using the WAS 8.5 full profile. This should resolve the problem. You can also consider migrating to the latest version of WAS, which is v9.0.
Additional resource at IBM Knowledge Center: Liberty profile overview.
*Subject to minimum supported Java levels.

MQSeries CSIException: JMSCS0002 but classpath looks ok for commonservices

In trying to connect from an MQSeries 7.5 client to a 7.5 local server I'm getting a CSIException: JMSCS0002 which when I look up the error in the IBM codes says:
JMSCS0002
The call could not be completed because CommonServices has not been initialized.
CommonServices is an internal component and needs to be initialized at startup but has failed.
Check that the installation and classpath setup is correct.
But both my compile and run classpaths include com.ibm.mq.commonservices.jar, com.ibm.msg.client.commonservices.jar, and com.ibm.msg.client.commonservices.j2se.jar
I'm was using Oracle JDK 1.6. I tried using the WS MQ java but it made no difference.
Any help appreciated. Thanks.
Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002
at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:67)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:225)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:194)
at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:91)
I had been using jar files from an uninstalled MQSeries 7.5 Client because I wanted to make sure that the functionality I was using would work just with the jars provided by the free client license. According to IBM documentation taking uninstalled jars is problematic.
When I switched to the jars from the installed server trial then things works ok.

IBM Websphere portlet classloader issue

I am currently working on a portlet that is using the commons-collections jar file and am getting a NoSuchMethodError. To resolve this issue I need to change the classloader of my WAR file from PARENT_FIRST to PARENT_LAST (in the application.xml file).
However, when I do this my portlet will not launch and when I log into the console it displays the message "The portlet is temporarily disabled". If I change the classloader back to PARENT_FIRST then it will launch again but then I get the NoSuchMethodError.
Does anybody have any suggestions on how to fix this issue ?
I am not sure how, but today I started getting error messages in the logs when I was getting "The portlet is temporarily disabled". I was getting a java.lang.LinkageError which was down to the fact that I had the servlet-api-2.5.jar and a jaxb jar which was conflicting with webshpere j2ee.jar. Once I removed these dependencies and set the classloader to PARENT_LAST, it seems to work properly. It seems that a lot of people face similar issues. The link below is also useful http://forum.springsource.org/showthread.php?33663-dispatcher-servlet-quot-not-a-servlet-class-quot-in-websphere
#MTH,
please try adding commons-collections as a shared library. See here for an example on how others have used shared library support [1]. That will give you the steps, just do it for the jars that you need to override/replace from WAS's classloader
[1] http://portals.apache.org/jetspeed-2/deployguide/deploying-jetspeed-to-websphere.html#section_4_2
thanks,
dims
You haven't provided any logs... but still, one of the most important things to look out for when setting your application to run PARENT_LAST is that your application isn't bundled with any system-level classes that may conflict with the ones provided by WebSphere Portal. For example, classes that pertain to the Portlet specification or the JavaEE specification.

Resources