Cannot deploy ear package when there is to many web modules inside - ejb-3.0

I've created ear app on payara server. There is an ejb package and some web modules. Everything was fine till I added a new web module.
I have an error message that says in my EJB jar there is no EJB class which is not true. When I have less than three web modules then everything works fine, but when I add new modules the error occurs again.
SEVERE: Exception while parsing file file:/Users/mikolaj/Documents/programowanie/NetBeansProjects/pstdio_services/pstdio_services-ear/target/gfdeploy/pstdio_services-ear/
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask#735ef671 rejected from java.util.concurrent.ThreadPoolExecutor#60f1aa16[Running, pool size = 20, active threads = 8, queued tasks = 30, completed tasks = 243]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.glassfish.hk2.classmodel.reflect.Parser.parse(Parser.java:293)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleJar(ReadableArchiveScannerAdapter.java:197)
at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:131)
at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:345)
at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:68)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:304)
at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:293)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
WARNING: result fault org.glassfish.hk2.classmodel.reflect.Parser$Result#1e051c19 Result for /Users/mikolaj/Documents/programowanie/NetBeansProjects/pstdio_services/pstdio_services-ear/target/gfdeploy/pstdio_services-ear/
SEVERE: Exception while deploying the app [pstdio_services-ear]
SEVERE: Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid ejb jar [pstdio_services-ejb-1.0.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
2. EJB3+ entity beans (#Entity) are POJOs and please package them as library jar.
3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (#Stateless, #Stateful, #MessageDriven, #Singleton), please check server.log to see whether the annotations were processed properly.
at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:149)
at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:114)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:643)
at org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl.visit(EjbBundleDescriptorImpl.java:767)
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:121)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:643)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:723)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:268)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:232)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:189)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:223)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:91)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:934)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:874)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:384)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:540)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:549)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:545)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:544)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:575)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:567)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:566)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1475)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1857)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1733)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:564)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:251)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:166)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:208)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:208)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
at java.lang.Thread.run(Thread.java:748)

I think it's because Payara Server processes the EAR asynchronously in several threads using the Payara Executor Service. It looks like you're using Payara Server 5.184 or older which has the queue size limited to 30 by default and then it stops accepting more tasks, which results in the rejected exception. You should set the queue size to a higher value with the command set-payara-executor-service-configuration. The default value was set to 500 in version 5.191: https://github.com/payara/Payara/pull/3497

Related

Calling a remote EJB hosted on WebSphere Full Profile(v7) from app. running in Liberty

I have:
Application A running in Liberty Profile (8.5.5.7)
Application B running in WAS Full Profile V7, hosting EJB called MyBean.
I want to invoke MyBean's methods from application A.
I'm programmatically doing the lookup for MyBean with code as below, based on the documentation at:http://www-01.ibm.com/support/knowledgecenter/?lang=en#!/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_ejb_remote.html
String corbaURL = "corbaname::wasv7Server:wasv7Port#ejb/global/B/MyBean/beans.\\MyBean!com\\.acme\\.MyBeanRemoteInterface";
Object ref = new InitialContext().lookup(corbaURL);
// .. boilerplate code for narrowing the remote object and calling the remote method.
The Liberty where the app. A is running has the ejbRemote-3.2 feature enabled.
The application B deployed in WAS7 full profile had application name B and EJB module MyBean and MyBean's deployment descriptor is:
<session id="Session_beans.MyBean">
<ejb-name>beans.MyBean</ejb-name>
<home>com.acme.MyBeanHome</home>
<remote>com.acme.MyBeanRemote</remote>
<ejb-class>com.acme.MyBean</ejb-class>
...
</session>
When executing the lookup in app. A (in Liberty) I got a NameNotFoundException,
and I'm wondering if the LocationService at the WAS Full Profile V7 is understanding the corba name URL being sent by Liberty since V7, afaik, doesn't support JEE6; if this is the case how can I invoke the the bean MyBean from A running in the Liberty Profile? Can I use ejbRemote-3.2 feature and just use a different corba name URL, if so what is the correct URL to use?
UPDATE
As per #bkail recommendation changed the lookup URL to:
String corbaURL = "corbaname::wasv7Server:wasv7Port#beans\\.MyBean" ;
// dumpNameSpace shows:
// (top)/nodes/napp_srmwrk1_app-FULL/servers/AppServer/beans.MyBean
// 8 Bound Java type: com.acme.MyBeanHome
// 8 Local Java type: org.omg.stub.java.rmi._Remote_Stub
After the change still getting the NameNotFoundException. The stack trace is:
16:21:35.580 [Default Executor-thread-51] ERROR qsr - NamingException
javax.naming.NameNotFoundException: null
at
com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:61) ~ [na:1.8.0_60]
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:500) ~[na:1.8.0_60]
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:539) ~[na:1.8.0_60]
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:205) ~[na:1.8.0_60]
at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161) ~[na:na]
at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[na:1.8.0_60]
at net.gbm.App.doGet(App.java:65) ~[mnr.war:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [com.ibm.ws.javaee.servlet.3.1_1.0.10.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [com.ibm.ws.javaee.servlet.3.1_1.0.10.jar:na]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1287) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:778) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1158) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4867) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer31.osgi.webapp.WebApp31.handleRequest(WebApp31.java:523) [com.ibm.ws.webcontainer31_1.0.10.jar:na]
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:297) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:997) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262) [com.ibm.ws.webcontainer_1.1.10.jar:na]
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:341) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:470) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:404) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:284) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:255) [com.ibm.ws.transport.http_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174) [com.ibm.ws.channelfw_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83) [com.ibm.ws.channelfw_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504) [com.ibm.ws.channelfw_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574) [com.ibm.ws.channelfw_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929) [com.ibm.ws.channelfw_1.0.10.jar:na]
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018) [com.ibm.ws.channelfw_1.0.10.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72) ~[com.ibm.ws.org.apache.yoko.corba.spec.1.5_1.0.10.jar:1.8.0_60]
at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:251) ~[com.ibm.ws.org.apache.yoko.corba.spec.1.5_1.0.10.jar:1.8.0_60]
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:486) ~[na:1.8.0_60]
... 31 common frames omitted
Thanks,
The corbaname: URLs listed in the "Using enterprise JavaBeans with remote interfaces on the Liberty profile" topic are the names used to access EJBs running in the Liberty profile. To connect to an EJB on a full profile server, you need to use the binding name from the full profile, which likely starts with ejb/... rather than ejb/global/.... See the "Default binding pattern" section of the EJB 3.0 application bindings overview topic in the Knowledge Center.
Unlike the Liberty profile, the full profile mirrors the JNDI default namespace to the CosNaming context, so you should copy the relevant JNDI name from the CNTR0167I message in SystemOut.log (the JNDI name that does not start with java:global). Alternatively, run the PROFILE_HOME/bin/dumpNameSpace command on the full profile to dump the namespace, and you should be able to find the binding name.
Let me share my experience of very similar work that I did just yesterday.
Hope this helps somebody who searches the stackoverflow.
First I downloaded Wlp8.5.5.8 and tried adding features like ejbRemote3.2. It was not available for reasons I am unaware of.
Then I googled to find the wlp having ejbRemote3.2 feature
Downloaded that
Added following features to the ServerConfiguration.
How to add these features to Serverconfiguration? Please refer the following link:
Liberty Profile - Remote EJB
Praveen has made a spoon-feed, thanks to him
<feature>javaee-7.0</feature>
<feature>ejbRemote-3.2</feature>
<feature>jndi-1.0</feature>
<feature>ejbLite-3.2</feature>
<feature>localConnector-1.0</feature>
<feature>servlet-3.1</feature>
Added the following 6 lines of code in my servlet deployed in Liberty profile
Properties ejbProps = new Properties();
ejbProps.put(Context.PROVIDER_URL, ejbUrl);
InitialContext ffmContext = new InitialContext(ejbProps);
Object remoteObject = ffmContext.lookup(ejbName);
MyBeanRemote myBean = PortableRemoteObject.narrow(remoteObject, MyBean.class);
myBean.callingMethod();
And the magic worked: MyBean method got invoked/called.
Note: I had MyBean stub jar file generated and placed in my servlet deployed in wlp

Soap Request Error in Websphere Portal

The scenario is,
We created a Webservice (say WS1) using WebExperience factory V8.0.0.2 and the websphere application server is V8.0.0.10. The WS1 has an operation which calls another webservice (say WS2) for some authentication. All are soap services. When testing this scenario locally we were able to invoke the underlying webservice WS2 and was able to get the response.
I deployed it in Webphere Portal, wp_profile, but when I called the service WS1 it is showing some SOAP error. The error is happening when WS1 invokes WS2. We are using Portal 8.0 and the Application Server version is 8.0.0.10.
I changed the class loading to parent last in the application module. But it is still showing the error.
Stack trace is given
Category: bowstreet.system.server.logging.event.criterion.abnormal
Priority: ERROR
Msg: Component: SERVICE
Caught an exception processing a message style web service call.
The associated exception is: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.axis.providers.java.MsgProvider.processMessage(MsgProvider.java:141)
at com.bowstreet.axis.providers.WebAppMSGProvider.processMessage(WebAppMSGProvider.java:46)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)
Caused by: java.rmi.RemoteException: Error in method BatchInvoke_al. Error in method getDetail_ws.invoke. Error in method getDetail_ws.invokeInternal. javax/xml/soap/MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
at com.bowstreet.axis.WebAppRPCInterface.aMethod(WebAppRPCInterface.java:68)
... 41 more
Can anyone help me on this issue..
The WARs you're deploying to the two servers (working and non-working) are different one is dev mode WAR built by deploying from designer (which is a dual mode WAR that supports the WEF standalone servlet mode plus portlets) and the other an exported portlet WAR. If so, then the two WARs would have different sets of JARs (less jars in the portlet WAR which defers to portal for some of those APIs).
Please cross checked the module class loader in the application module.
saaj-api.jar will be missing in dev mode war bulid.
Remove the saaj-api.jar from the lib and export the war and deploy.
Can you provide the libraries using in the Applications?
Please check whether any dependant jar files is loading twice after starting the application.
You can view the loaded class files in the application server console.

ejb2.0, log4j and EAR project configuration

I am posting one more question on EJB2.0. I thought my earlier question won't get any answer since EJB2.0 is pretty much outdated technology and nobody wants to work on it any more. But my first question got answered and I am trying my luck one more time.
I created one simple EJB 2.x entity bean. My entity bean uses another class (UniqueIdGenerator) to generate value of primary key for persistent primary key field. UniqueIdGenerator uses log4j and JDBC connection, so I configured appropriate build path references for my EJB project.
Added following JARS to buildpath for EJB project
log4j-1.2.16.jar
db2jcc.jar
db2jcc_license_cu.jar
Then I mapped persistent fields to database table fields. Generated code using Prepare for Deployment option in RSA (deploying on WAS).
Created EAR project and using Project References option added EJB project (HMS) to EAR project.
I did not set any other path/classpath.
Started WAS, deployed EAR on WAS and launched Universal Test Client to test entity bean. Using remote interface I tried to create my first bean, I entered the values for fields and clicked on submit on Universal test client. On server side it called ejbCreate() of entity bean but failed when loading UniqueIdGenerator class with error NoClassDefFoundError
Here is stack trace
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.container.CreateFailureException: ; nested exception is:
java.lang.NoClassDefFoundError: org.apache.log4j.LogManager
at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:235)
at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:743)
at javax.rmi.CORBA.Util.wrapException(Util.java:296)
at ejbs._EJSRemoteCMPAddressHome_824957aa_Stub.create(_EJSRemoteCMPAddressHome_824957aa_Stub.java:258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:65)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:113)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:374)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
Caused by: com.ibm.ejs.container.CreateFailureException: ; nested exception is:
java.lang.NoClassDefFoundError: org.apache.log4j.LogManager
at ejbs.EJSCMPAddressHomeBean_824957aa.create(EJSCMPAddressHomeBean_824957aa.java:47)
at ejbs.EJSRemoteCMPAddressHome_824957aa.create(EJSRemoteCMPAddressHome_824957aa.java:28)
at ejbs._EJSRemoteCMPAddressHome_824957aa_Stub.create(_EJSRemoteCMPAddressHome_824957aa_Stub.java:251)
... 29 more
Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.LogManager
at utils.UniqueLongIdGenerator.(UniqueLongIdGenerator.java:40)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at utils.UniqueIdGenerator.(UniqueIdGenerator.java:28)
at utils.UniqueIdGenerator.(UniqueIdGenerator.java:24)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at ejbs.AddressBean.ejbCreate(AddressBean.java:46)
at ejbs.ConcreteAddress_824957aa.ejbCreate(ConcreteAddress_824957aa.java:122)
at ejbs.EJSCMPAddressHomeBean_824957aa.create(EJSCMPAddressHomeBean_824957aa.java:33)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.LogManager
at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
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:509)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
... 41 more
Have I missed anything in the configuration. Do I need to add all the jar files somewhere in EAR project. Isn't it sufficient to set them in the build path for EJB project?
I found answer for it on the following links
How to include external jar in ejb-jar
Developerworks Article
http://www.ibm.com/developerworks/rational/library/07/1211_schrag/index.html
You will need to import the third party jars into your EAR project and then setup JAR dependency in your EJB projects MANIFEST.MF file. Once you import external jars into your EAR project, they will be available in explorer for MANIFEST.MF

Trouble with class loading webapp JARs with Jetty 6

I have a Jetty 6.1.9 environment which I am trying to bootstrap an 'exploded' WAR style context, however, I am getting NoClassDefFoundError errors.
The Jetty env is bootstrapped like so:
public class MyServer {
public static void main(String[] argv) {
jetty_default = jetty_default + "/web-content/jetty-6.1.9";
String jetty_home = System.getProperty("jetty.home", jetty_default);
Server server = new Server();
Connector connector = new SelectChannelConnector();
connector.setPort(7895);
server.setConnectors(new Connector[]{connector});
WebAppContext myAppCxt= new WebAppContext();
myAppCxt.setContextPath("/foo");
myAppCxt.setWar(jetty_home + "/wardirs/myApp");
myAppCxt.setDefaultsDescriptor(jetty_home + "/etc/webdefault.xml");
myAppCxt.setInitParams(initParamsMaps);
myAppCxt.setTempDirectory(aTmpDir);
server.setHandler(processingNodeAppCxt);
server.start();
}
The layout of wardirs/myApp looks like so
wardirs
myApp
WEB-INF
lib\
jdom.jar
web.xml
The class I am getting the error for is in foo.jar.
It also feels like Jetty is finding the JAR in the WEB-INF/lib dir because after starting the server foo.jar becomes locked (I tried deleting it) and when I kill the server it becomes unlocked.
If I manually put the JARs on the classpath of the java cmd line which runs MyServer's main method then all works fine, however, I want these JARs to live in the WEB-INF\lib dir and be automatically picked up as they should be.
The actual exception is:
Mar 06, 2013 9:07:25 PM sun.reflect.NativeMethodAccessorImpl invoke0
SEVERE: /foo/api/process
java.lang.NoClassDefFoundError: org/jdom/Content
at com.foo.MyManager$Status.createICProcessor(MyManager.java:231)
at com.foo.myApp.Api.process(API.java:xxx)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:149)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:259)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:990)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: java.lang.ClassNotFoundException: org.jdom.Content
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 35 more
The only other thing I can think to mention since this feels like a classloader context issue is that the MyManager referenced in the top line of the stack trace is running in its own thread which was started by the webapp's ServletContextListener like so:
myMgrThread = new Thread(myManager);
long myMgrThreadId = myMgrThread.getId();
myMgrThread .setName("MyApp_MyMgr-" + myMgrThreadId);
myMgrThread .setPriority(Thread.NORM_PRIORITY);
myMgrThread .setDaemon(true);
myMgrThread .start();
According to your project layout, and that stacktrace, it found com.foo.myApp.Api and com.foo.MyManager in your WEB-INF/lib/foo.jar just fine, but it failed to find org.jdom.Content
Is org.jdom.Content present in your wEB-INF/lib/foo.jar? or in a similar file you haven't mentioned like WEB-INF/lib/jdom.jar? Or are you expecting to find org.jdom.Content from the parent classloader (in other words, whatever classloader the MyServer class was started from)?
I think I answered my own question. The IDE project this is running in does not move the 'webapp' .class files into "$jetty_home/wardirs/myApp/WEB-INF/classes" as one would expect per the servlet spec. Instead it includes them in the class path which invokes MyServer.main.
When I copied the application classes into "$jetty_home/wardirs/myApp/WEB-INF/classes" the NOCLASSDEFERRORs went away. So now the classes are WEB-INF/classes and on the classpath calling main.
As you might be able to tell here this project has no separation of concerns between the webapp and the container. All the classes and JARS for the application and jetty have been dumped together and it 'works'. I've been trying to teases things apart so that the webapp classes and dependent JARs are clearly separated, eg. introducing a ServletContextListener to move webapp code into which was previously being bootstrapped from 'main', moving JARs into WEB-INF/lib and the like. It's like trying to get chewing gum out of your hair.

Class loading issue involving CXF on Websphere, parent last not helping

My problem concerns CXF and the wsdl4j_1.6.2.jar colliding with something, presumably the axis-wsdl4j.jar.
I have read: What's wrong with my Apache CXF client?
My project does not include the axis-wsdl4j.jar in the war. I have also asked our admin to switch Websphere to Parent Last. I still get this:
[12/13/12 16:01:28:378 CST] 0000001b ServletWrappe E SRVE0068E:
Uncaught exception thrown in one of the service methods of the
servlet: CXFServlet. Exceptio n thrown : java.lang.RuntimeException:
org.apache.cxf.interceptor.Fault:
javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)
Ljavax/wsdl/Definition;
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:322)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1143)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:591)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3453)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473) Caused by: org.apache.cxf.interceptor.Fault:
javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
... 26 more Caused by: java.lang.NoSuchMethodError: javax/wsdl/xml/WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:92)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:147)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:97)
at javax.xml.ws.Service.(Service.java:35)
...
Project is built by Maven, deployed to Websphere via Continuum only; and all settings are changed via request. Application runs perfect on local Tomcat.
EDIT:
This was eventually fixed by:
Copy wsdl4j.jar to /usr/WebSphere/AppServer/appLibs/APPNAME directory.
Chmod 775 on previous.
In websphere admin console, environment (on left), Shared Libraries, and define a container wide shared library with name as APPNAME above.
Add the jar to the classpath of the shared library.
Servers (on left), APPNAME java, process management, Class Loader and make sure "Classes loaded with application class loader first"
Click on the class loader and assign the shared library to it.
Restart Server
i think you need to disable Jax ws engine
Try setting JVM property as below
com.ibm.websphere.webservices.DisableIBMJAXWSEngine=true
here is what i would do.
Turn on verbose class loading on WAS runtime and look at the JAR that contains WSDLReader.
Check if this is the JAR that you expected to be used in run-time (to start with) based on the verbose class loading.
HTH

Resources