Spring boot remote Websphere EJB call - spring

I have Websphere thin client jars in my classpath and a sample spring boot application. I am unable to make remote ejb call because it is throwing corab exception. I am using oracle jdk1.8 to make websphere ejb call
09:50:28.505 com.ibm.rmi.corba.PluginRegistry instantiatePlugins:119 P=428317:O=0:CT ORBRas[default] java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:219)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:152)
at com.sun.corba.se.impl.util.JDKBridge.loadClassM(JDKBridge.java:189)
at com.sun.corba.se.impl.util.JDKBridge.loadClass(JDKBridge.java:86)
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.loadClass(Util.java:602)
at javax.rmi.CORBA.Util.loadClass(Util.java:265)
at com.ibm.rmi.corba.PluginRegistry.instantiatePlugins(PluginRegistry.java:116)
at com.ibm.rmi.corba.ORB.instantiatePlugins(ORB.java:1518)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1423)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1349)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1697)
at org.omg.CORBA.ORB.init(ORB.java:353)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:169)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:64)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:44)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:85)
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.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:505)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:466)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiLocatorDelegate.lookup(JndiLoc
The above log shows the corba errors generated by ibm jar files.

java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient
Looks like this is the class you're missing.
You'll need to add the com.ibm.ws.wlm.jar to your class path.

Related

Weka running via Spring Boot Jar errors with "Can't find a permissible class called: weka.clusterers.Canopy"

I start "java -jar .../my-spring-boot-jar-with-weka-jar-inside.jar", the app is up, however when I hit my use case (via rest endpoint) I get the following. It all works fine if I start the app via Eclipse. I suspect it is due to classloading diff between what's in my Eclipse project (expanded classes, etc) and the Spring Boot's "uber-jar" it creates. I verified the weka jar inside the SB jar has the exact class "weka.clusterers.Canopy".
java.lang.Exception: Can't find a permissible class called: weka.clusterers.Canopy
at weka.core.Utils.forName(Utils.java:1122) ~[weka-stable-3.8.1.jar!/:na]
at weka.clusterers.AbstractClusterer.forName(AbstractClusterer.java:276) ~[weka-stable-3.8.1.jar!/:na]
at weka.filters.unsupervised.attribute.AddCluster.setOptions(AddCluster.java:440) ~[weka-stable-3.8.1.jar!/:na]
at com.abc.ace.predictive.outlier.ClusterDetector.calculateClusterCentroids(ClusterDetector.java:56) ~[classes!/:0.0.1-SNAPSHOT]
at com.abc.ace.predictive.api.PredictiveController.getClusterCentroids(PredictiveController.java:53) ~[classes!/:0.0.1-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]

Can not find KieModule in OSGi JVM Server in CICS on ZOS

I am trying to set up drools on zos environment. I created my run time environment by adding the following jars (droolsjbpm-integration-distribution-6.5.0.Final) in OSGi framework bundles. I placed my drl files in unix directory outside the OSGi Application jar, when I run the OSGi app, I get the following error.
java.lang.RuntimeException: Cannot find KieModule:
org.default:artifact:1.0.0-SNAPSHOT at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:186)
at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:180)
at com.cft.hogan.fwk.adapter.pem.DroolsTest.test4(DroolsTest.java:95)
at com.cft.hogan.fwk.adapter.pem.DroolsTest.main(DroolsTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620) at
com.ibm.cics.server.Wrapper.call_main(Wrapper.java:810) at
com.ibm.cics.server.Wrapper.callOSGiClass(Wrapper.java:2580) at
com.ibm.cics.server.Wrapper.invokeJvmServerOSGiClass(Wrapper.java:2455)
at com.ibm.cics.server.Wrapper.jvmServerOSGiEntry(Wrapper.java:2413)
at com.ibm.cics.osgi.impl.Controller.runService(Controller.java:935)
at
com.ibm.cics.osgi.impl.Controller.acceptRequest(Controller.java:230)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)

Exception when starting liberty server 16.0.0.4

Noticed the below exception when starting websphere liberty server.
How can this be removed? Appreciate any help.
We have both javaee7 profile and webProfile-6.0 features installed.
The EAR application has one WAR file which uses jee6.0 / "3.0" web.xml
Exception = java.lang.NoClassDefFoundError
Source = com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields
probeid = 249
Stack Dump = java.lang.NoClassDefFoundError: com.ibm.websphere.sdo.mediator.jdbc.ConnectionWrapper
at java.lang.Class.getDeclaredFieldsImpl(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:833)
at com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields(InjectionProcessorManager.java:375)
at com.ibm.ws.injectionengine.InjectionProcessorManager.processAnnotations(InjectionProcessorManager.java:216)
at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:514)
at com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl.processInjectionMetaData(OSGiInjectionEngineImpl.java:239)
at com.ibm.ws.injectionengine.ReferenceContextImpl.processImpl(ReferenceContextImpl.java:633)
at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:305)
at com.ibm.ws.injectionengine.osgi.internal.OSGiReferenceContextImpl.process(OSGiReferenceContextImpl.java:31)
at com.ibm.ws.webcontainer.osgi.webapp.WebApp.commonInitializationStart(WebApp.java:254)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1038)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6562)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:468)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:266)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:331)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:301)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:471)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:405)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:285)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:256)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.sdo.mediator.jdbc.ConnectionWrapper
at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:499)
at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:282)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
... 30 more
The SDO API (com.ibm.websphere.sdo) is not available in Liberty. Looks like you are trying to run some traditional WAS application on Liberty. You will have to change your application to make it runnable in Liberty.
I'd suggest to install WebSphere Application Migration Toolkit(free Eclipse plugin from Marketplace) and analyze your application.

Spring Boot Thin Jar, How To?

I want to use thin jar created by Spring Boot Maven Plugin (jarname.jar.original). I got all dependencies in lib directory. Tried to run. But it is giving following exception related to Banner. I tried to switch it off using spring.main.banner_mode=off. Why it is so obscure information about Spring boot thin jar ? I did not find any useful by googling.
java -cp 'target/thin-jar-0.1.0.jar:target/lib/*' com.example.cloudpayables.api.Application
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
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:497)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.showBanner(Z)Lorg/springframework/boot/builder/SpringApplicationBuilder;
I would recommend looking at the maven-dependency-plugin to make sure you are capturing all the required dependencies for your project. What I am guessing is missing is some transitive dependency.
http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html
Josh Long will be very sad that the banner isn't showing and is causing the problem in your situation. :)

Jetty Server exceptions while using in jersey framework

I am trying to use Jetty HTTPserver with jersey framework to make RESTful services. The code used is pretty simple:
URI baseUri = UriBuilder.fromUri("http://localhost/").port(9998).build();
ResourceConfig config = new ResourceConfig().packages("main.java");
Server server = JettyHttpContainerFactory.createServer(baseUri, config);
I am using maven to build the project with Java8 and following versions for jersey-container and jetty:
jersey-container-jetty-http - 2.17
jetty-server - 9.2.0.v20140526
But running the server is giving me AbstractMethodError. Here's the full stack trace:
java.lang.reflect.InvocationTargetException
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:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.AbstractMethodError: org.glassfish.jersey.jetty.JettyHttpContainerProvider.createContainer(Ljava/lang/Class;Ljavax/ws/rs/core/Application;)Ljava/lang/Object;
at org.glassfish.jersey.server.ContainerFactory.createContainer(ContainerFactory.java:81)
at org.glassfish.jersey.jetty.JettyHttpContainerFactory.createServer(JettyHttpContainerFactory.java:116)
at main.java.Main.startServer(Main.java:43)
at main.java.Main.main(Main.java:76)
... 6 more
Have you guys encountered this before and would anyone know a workaround for this?

Resources