Websphere 8.5.5.12 - Spring Boot not working - spring

My spring boot applications working great on tomcat. But I need to deploy this in IBM Websphere 8.5.5.12 and there my troubles began.
I had referred to article and added the dependency 'spring-boot-starter-validation' to avoid the error:
Error activating Bean Validation integration Caused by:
java.lang.NoClassDefFoundError: javax/el/ELManager
But if I keep it, I receive another error
Error 500: org.springframework.web.util.NestedServletException:
Request processing failed; nested exception is
java.lang.ClassCastException: org.apache.el.ExpressionFactoryImpl
incompatible with javax.el.ExpressionFactory
Please note that on WAS, I have already ensured local class loading to load first over parent.
>
In the administrative console, click Applications > >Application Types > WebSphere enterprise applications > >application_name > Manage modules > webmodule_name.
Select Classes loaded with local class loader first (parent >last) from the drop down list.

Issue resolved!!!
After multiple attempts, I finally used and this fixed my issue:
compile(group: 'javax.el', name: 'javax.el-api', version: '3.0.0')
instead of below mentioned in article
compile(group: 'org.springframework.boot', name:
'spring-boot-starter-validation', version: '2.2.1.RELEASE')
End days for Websphere, I felt with the frustration of this issue!

Have you tried this on 8.5.5.16 . If I try it I am getting the same catch-22 situation.
if I have it there, I get ClassCastException , if I remove it I get NoClassDefFoundError

Related

Work Performer Exception: org.apache.soap.transport.SOAPTransport while executing ComponentStep in ProcessConfiguration of IBM FileNet

While running component Step in ProcessConfiguration of workflows, facing below issue. This component includes web service calls. Added soap.jar file in the component but issue remains the same.
Work Performer Exception: org.apache.soap.transport.SOAPTransport
When verified in PCCE logs, I find as below.
CMDp.MAS678A PEPrimary2 [Error] CMExecute[12917].MASMEDOC01.XSHDC510_DS_30.AdapterOperations.Y988309 [UKE_IndexingSME:D5C52E6172F0284385411683A8496EAB:sub_local_ExecuteForAttachment:adaptorCall] FAILED.; Exception: java.lang.ClassNotFoundException: org.apache.soap.transport.SOAPTransport
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:240)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:702)
at java.lang.ClassLoader.loadClass(ClassLoader.java:681)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:133)
at java.lang.ClassLoader.loadClass(ClassLoader.java:664)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:617)
at java.lang.ClassLoader.loadClass(ClassLoader.java:664)
Issue : Work Performer Exception: org.apache.soap.transport.SOAPTransport
Can someone help the reason for this issue??
try this
add the supporting jar as a content element within the code module
If 1 doesn't work, add the supporting jar to CPE Websphere library and restart the websphere

How to use Jersey in Sling?

I've got Sling 8. I then include Jersey and this Jersey connector in my build: https://github.com/hstaudacher/osgi-jax-rs-connector
My next step should be simply write a Jersey Service and test it, but I'm getting this Exception immediately:
27.01.2017 10:54:16.696 *ERROR* [FelixDispatchQueue] com.eclipsesource.jaxrs.publisher FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null.)org.osgi.framework.ServiceException: Service factory returned null.
and
[FelixDispatchQueue] com.eclipsesource.jaxrs.publisher FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory exception: org/apache/felix/shell/Command)
org.osgi.framework.ServiceException: Service factory exception: org/apache/felix/shell/Command
and
Caused by: java.lang.NoClassDefFoundError: org/apache/felix/shell/Command
So I look at my bundles list in Felix, and I don't see any bundle that appears to provide this... So I find it online and install it myself. Now I get this exception:
Service factory exception: org/apache/sling/extensions/threaddump/internal/ThreadDumpCommand
and
Caused by: java.lang.NoClassDefFoundError: org/apache/sling/extensions/threaddump/internal/ThreadDumpCommand
and
Caused by: java.lang.NoClassDefFoundError: org/apache/felix/webconsole/plugins/memoryusage/internal/MemoryUsageCommand
Now, I DO have a bundle installed with this class (it's "Apache Felix Web Console Memory Usage Plugin"). So now I really don't understand what the heck is going on.
I have a feeling that I'm not supposed to be providing my own "felix shell" bundle and that the OSGI in Sling is failing to provide it...
Is anybody successfully using Sling 8 and Jersey?
Maybe you should try with just a vanilla OSGi environment for starters. Once you have Jersey working then you can try integrating with Sling.
I have had success with jaxrs in OSGi, specifically using the Amdatu REST bundles.
https://amdatu.org/application/tutorial/step1/
With this I was able to use JAX-RS annotations to serve HTTP services:
https://github.com/figurate/figurate-core/blob/master/modules/figurate-osgi/src/main/groovy/org/figurate/osgi/http/ServiceInfo.groovy
You can see the bundles I used here:
https://github.com/figurate/figurate-core/blob/master/modules/figurate-osgi/src/test/resources/config/HttpVersionSpec.config

stomp-chat web socket with embedded tomcat reactor error - type reactor.tuple.Tuple not found

I am having problems getting web socket subscriptions to work properly using Spring with an embedded Tomcat server.
When running this stomp-chat application I get the following error:
org.springframework.messaging.MessageHandlingException: Expression evaluation failed: #chatRoomSessions[headers.simpDestination].add(T(reactor.tuple.Tuple).of(headers.simpSessionId, headers.simpSubscriptionId));
nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 58): Type cannot be found 'reactor.tuple.Tuple'
I tried to add the following dependency:
compile ("io.projectreactor:reactor-stream:$reactorVersion")
but it gave the same error. Any help would be appreciated.
OK. I see the problem.
The dependency for the io.projectreactor:reactor-stream:2.0.8 isn't enough.
The Tuple class has been moved to the new reactor.fn.tuple package.
So, you still have to fix all the reactor.tuple.Tuple mentioning in the stomp-server.xml to the new reactor.fn.tuple.Tuple.
The sample will be fixed soon: https://github.com/spring-projects/spring-integration-samples/issues/185
Sorry for inconvenience.

Deploying Worklight on WebSphere

I've deployed Worklight 6 on WebSphere 8.5.5 trying to follow these instructions ( http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp ) with a derby database and I've encountered the following error when trying to hit my Worklight instance:
Error 500: javax.servlet.ServletException: Worklight Project not initialized
When I check the log, I can see that the worklight server has not been started due to this exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [jar:file:/C:/IBM/WebSphere/AppServer/lib/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError: javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
...
Caused by: java.lang.AbstractMethodError: javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode
at org.apache.openjpa.persistence.PersistenceUnitInfoImpl.toOpenJPAProperties(PersistenceUnitInfoImpl.java:499)
at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:317)
at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:160)
at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:62)
I put the worklight jar directly in the WebSphere lib to solve another problem related to an Authentication class not being found if I recall correctly... Perhaps I need more jars in there, or did I solve my previous problem incorrectly? I put the javax.peristence.jar inside websphere as well, but that didn't help.
Are you using Ant scripts for deployment? This happens if you miss some steps while doing the manual application deployment.

using Aspectj on Websphere

we are using Aspectj compile time loading in Spring source tool suite..when we are trying to deploy this project on websphere server ,we are getting following exception .this project work fine on the tomcat server..is there is some problem with libraries as AspectJ compiler is are already there in Spring Source Tool.
Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions
(1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:
Property 'exceptionProp' threw exception; nested exception is java.lang.NoSuchMethodError: org/aspectj/runtime/internal/AroundClosure.linkClosureAndJoinPoint(I)
Lorg/aspectj/lang/ProceedingJoinPoint
WebSphere ships with it's own version of AspectJ Runtime. It is installed in:
base_${version}/lib/aspectjrt.jar
Flipping the class loader order from 'parent first' to 'parent last' won't work -- you'll have to take a different route.
Create a Shared Library (in the WebSphere Admin Console)
Add your version of AspectJ to this Shared Library
Create a new Classloader for your application or server and attach this classloader to it.
Instructions on how do to this can be found on IBM's website:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tcws_sharedlib.html

Resources