I have jsf page that has button when I click this button it calls method that update object
exist in the database. when I click this button twice I get this exception. I searched for it
too much but I didn't find any related answer.
I am using JPA 2.0
this is the full exception message
[4/10/14 10:36:54:532 EDT] 00000138 RegisteredSyn E WTRN0074E: Exception caught from before_completion synchronization operation: <openjpa-1.2.4-SNAPSHOT-r422266:1481680 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: Optimistic locking errors were detected when flushing to the data store. The following objects may have been concurrently modified in another transaction: [com.ibm.pp.epad.cmt.domain.Brief-1]
at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2184)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2031)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1927)
at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1845)
at com.ibm.ws.uow.ComponentContextSynchronizationWrapper.beforeCompletion(ComponentContextSynchronizationWrapper.java:65)
at com.ibm.tx.jta.RegisteredSyncs.coreDistributeBefore(RegisteredSyncs.java:289)
at com.ibm.ws.tx.jta.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:150)
at com.ibm.ws.tx.jta.TransactionImpl.prePrepare(TransactionImpl.java:2353)
at com.ibm.ws.tx.jta.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:559)
at com.ibm.tx.jta.TransactionImpl.processCommit(TransactionImpl.java:986)
at com.ibm.tx.jta.TransactionImpl.commit(TransactionImpl.java:920)
at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:436)
at com.ibm.tx.jta.TranManagerSet.commit(TranManagerSet.java:161)
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:952)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:259)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:570)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:4558)
at com.ibm.pp.epad.ejb.sessionbeans.EJSLocal0SLbriefService_92ef595f.updateBrief(EJSLocal0SLbriefService_92ef595f.java)
at com.ibm.pp.epad.controller.EditBriefController.saveBrief(EditBriefController.java:369)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.el.parser.AstValue.invoke(AstValue.java:159)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83)
at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:88)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:100)
at javax.faces.component.UICommand.broadcast(UICommand.java:120)
at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:937)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:271)
at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1249)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:675)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:34)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1602)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:80)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:878)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:84)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
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:1656)
Can you help me please.
Thanks in advance.
If I understood it correctly, it happens when you quickly click the button twice?
In that case there are several ways of doing it, e.g. here or here
User #Version field in your entity to handle optimistic locking.
Check this: https://blogs.oracle.com/carolmcdonald/entry/jpa_2_0_concurrency_and
Related
I am getting the below error after I upgraded from axis-1.3.jar to axis-1.4-osgi.jar
[9/16/19 6:13:07:783 CDT] 00000033 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet <Servlet_name> in application <application_name>. Exception created : java.lang.NoClassDefFoundError: org.apache.axis.encoding.Serializer
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:73)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:133)
...
...
...
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:576)
at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:250)
at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1694)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:970)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:508)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:879)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:516)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:307)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:278)
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1070)
at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyReadCompletedCallback.complete(SSLConnectionLink.java:644)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1820)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
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:1662)
Caused by: java.lang.ClassNotFoundException: org.apache.axis.encoding.Serializer
at java.net.URLClassLoader.findClass(URLClassLoader.java:457)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:201)
at java.lang.ClassLoader.loadClass(ClassLoader.java:676)
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:112)
at java.lang.ClassLoader.loadClass(ClassLoader.java:642)
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:513)
at java.lang.ClassLoader.loadClass(ClassLoader.java:642)
... 32 more
both JARs contains the class org.apache.axis.encoding.Serializer. then, what could be the cause of this issue.
Since org.apache.axis.encoding.Serializer is indeed in axis-1.4-osgi.jar (you can check at https://www.findjar.com/jar/mule/dependencies/maven2/org/apache/axis/axis/1.4-osgi/axis-1.4-osgi.jar.html?all=true) my guess is that this class is present in your IDE at compile time, but not in the server classpath when the application is starting/running (by inspecting the stacktrace, looks like you are trying to run a web application and the exception occurs at runtime).
Getting following exception frequently during normal usage from my java application hosted on IBM WebSphere server.
: DSRA9420E: Connection cannot be reassociated because child objects are still open.
Exception from createCallableStatement(String query,int resultSetType,int resultSetConcurrency)
java.sql.SQLException: DSRA9420E: Connection cannot be reassociated because child objects are still open.
at com.ibm.ws.rsadapter.AdapterUtil.toSQLException(AdapterUtil.java:1699)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.activate(WSJdbcConnection.java:2933)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareCall(WSJdbcConnection.java:2652)
at dataInterface.CrossRefDbConnectionProvider.createCallableStatement(CrossRefDbConnectionProvider.java:154)
at dataInterface.CrossRefDbExecutionHelper.preparedCall(CrossRefDbExecutionHelper.java:168)
at Schneider.Competitor.doPost(Competitor.java:211)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
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:1864)
Caused by: com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException: DSRA9420E: Connection cannot be reassociated because child objects are still open.
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:441)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.reassociate(WSJdbcConnection.java:3045)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.associateConnection(WSRdbManagedConnectionImpl.java:5141)
at com.ibm.ejs.j2c.MCWrapper.associateConnection(MCWrapper.java:2554)
at com.ibm.ejs.j2c.ConnectionManager.reassociateConnectionHandle(ConnectionManager.java:2949)
at com.ibm.ejs.j2c.ConnectionManager.associateConnection(ConnectionManager.java:2931)
at com.ibm.ejs.j2c.ConnectionManager.associateConnection(ConnectionManager.java:2813)
at com.ibm.ws.rsad
Please help me to find the root cause this exception and how can i fix that
Thanks in advance
Is the application accessing a JDBC connection and/or the resources obtained from it (statements, result sets,...) from multiple threads? Given the stack, that's the only explanation I can think of for how to get into this state. If so, that sort of usage isn't supported by JDBC and the application would need to be updated to avoid using a connection and its statements, result sets, ... and so on across different threads.
Can somebody help me in finding the root cause for below HUNG Thread.?
Please find the stacktrace below.
ThreadMonitor W WSVR0605W: Thread "WebContainer : 19" (0000004e) has been active for 765581 milliseconds and may be hung.
There is/are 1 thread(s) in total in the server that may be hung.
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sybase.timedio.RawDbio.reallyRead(RawDbio.java)
at com.sybase.timedio.Dbio.doRead(Dbio.java)
at com.sybase.timedio.InStreamMgr.readIfOwner(InStreamMgr.java)
at com.sybase.timedio.InStreamMgr.doRead(InStreamMgr.java)
at com.sybase.tds.TdsProtocolContext.getChunk(TdsProtocolContext.java)
at com.sybase.tds.PduInputFormatter.readPacket(PduInputFormatter.java)
at com.sybase.tds.PduInputFormatter.read(PduInputFormatter.java)
at com.sybase.tds.TdsInputStream.read(TdsInputStream.java)
at com.sybase.tds.TdsInputStream.readUnsignedByte(TdsInputStream.java)
at com.sybase.tds.Tds.nextResult(Tds.java)
at com.sybase.jdbc.ResultGetter.nextResult(ResultGetter.java)
at com.sybase.jdbc.SybStatement.nextResult(SybStatement.java)
at com.sybase.jdbc.SybStatement.queryLoop(SybStatement.java)
at com.sybase.jdbc.SybStatement.executeQuery(SybStatement.java)
at com.sybase.jdbc.SybCallableStatement.executeQuery(SybCallableStatement.java)
at com.ibm._jsp._prodStatHandlingAgent._jspService(_prodStatHandlingAgent.java:247)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:937)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:121)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:239)
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:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:557)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:607)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:984)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1069)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
NOTE: Please put a comment if you need further information.
Thank you.
It seems that your database (sybase) operations are slow.
In this case you have sent a db query and you just wait for the response.
Generally there are two reasons for this:
Your query is not optimized and it takes much time to complete.
You just fetch a lot of data with the specific query, so you should narrow the criteria.
The DB resources you are accessing are locked by another connection. You may use the DB tools to found out what is happening on your database.
WebSphere prints
8/7/13 11:43:47.318 000000AB SystemOut DETAIL receipt is null? = null
8/7/13 11:43:47.318 000000AB SystemOut DETAIL false
8/7/13 11:43:47.318 000000AB com.ibm.ws.webcontainer.servlet.ServletWrapper SEVERE com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet [ReceiptReportServlet] in application [MyWar_war]. Exception created : [java.lang.NullPointerException
at servlet.ReceiptReportServlet.doGet(ReceiptReportServlet.java:61)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1227)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:459)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:526)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:312)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:283)
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:175)
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:1862)
]
instead of
receipt is null? = null
true
This looks more like a problem with order of operations rather than WAS. Your line that prints
System.out.println("receipt is null? " + receipt == null);
is the problem. This does not print true or false if the receipt object is null or not. What it does is concatenates the string "receipt is null? " with the result of receipt's .toString() method and THEN checks if that is equal to null. That's why you see it only print false on that line.
If you really want to check for a null object there, add some appropriate ()'s around your null check.
System.out.println("receipt is null? " + (receipt == null));
This should print true or false as you are expecting.
As for why the receipt is null in one environment but not null in the other is question that we don't have enough information to answer. Your code snippets don't show us where that object is coming from or is instantiated.
I have developed a web service that is used to upload files on server, it has been created using Metro 2.1 JAX-WS engine and deployed on web sphere 7.0. I can connect to this service and transfer files successfuly but sometimes it throws java.net.SocketTimeoutException: Async operation timed out.
Following is the server stack trace -
It can be because of the bad n/w problem and files getting uploaded are also of reasonable size so we decided to increase the timeout value to 5 mins but i am not able to increase it after trying a lot of code changes. I have tried following methods to increase timeout values but nothing seems to work.
I have tried to set timeout values to '1' to test if timeout happens but web service seemed to be rolling fine without timeouts.
I would appreciate a quick help here.
Thanks,
((BindingProvider)port).getRequestContext().put(BindingProviderProperties.CONNECT_TIMEOUT, 1);
((BindingProvider)port).getRequestContext().put(BindingProviderProperties.REQUEST_TIMEOUT, 1);
AND
((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.request.timeout", 100);
((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.connect.timeout", 100);
AND
((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 1);
((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", 1);
java.net.SocketTimeoutException: Async operation timed out
at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:189)
at com.ibm.ws.tcp.channel.impl.TCPReadRequestContextImpl.read(TCPReadRequestContextImpl.java:111)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext.read(SSLReadServiceContext.java:265)
at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.fillABuffer(HttpServiceContextImpl.java:4142)
at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readSingleBlock(HttpServiceContextImpl.java:3374)
at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readBodyBuffer(HttpServiceContextImpl.java:3494)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl.getRequestBodyBuffer(HttpInboundServiceContextImpl.java:1705)
at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.bufferIsGood(WCCByteBufferInputStream.java:373)
at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.read(WCCByteBufferInputStream.java:266)
at com.ibm.ws.webcontainer.srt.http.HttpInputStream.read(HttpInputStream.java:325)
at org.jvnet.mimepull.MIMEParser.fillBuf(MIMEParser.java:434)
at org.jvnet.mimepull.MIMEParser.readBody(MIMEParser.java:204)
at org.jvnet.mimepull.MIMEParser.access$600(MIMEParser.java:62)
at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:154)
at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:123)
at org.jvnet.mimepull.MIMEMessage.makeProgress(MIMEMessage.java:193)
at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:236)
at org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:207)
at java.io.InputStream.read(InputStream.java:97)
at javax.activation.DataHandler.writeTo(DataHandler.java:307)
at com.ncr.java.service.ValidateRequest.validateCaptureFileContent(ValidateRequest.java:357)
at com.ncr.java.service.CaptureFileReceiverImpl.uploadCaptureFile(CaptureFileReceiverImpl.java:167)
at com.ncr.java.service.CaptureFileReceiverImplDelegate.uploadCaptureFile(CaptureFileReceiverImplDelegate.java:46)
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.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:295)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:515)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:155)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:189)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:76)
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.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
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.io.async.AsyncTimeoutException(Async operation timed out, [Timeout, rc=0])
at com.ibm.io.async.AbstractAsyncFuture.waitForCompletion(AbstractAsyncFuture.java:359)
at com.ibm.io.async.AsyncFuture.getByteCount(AsyncFuture.java:218)
at com.ibm.ws.tcp.channel.impl.AioSocketIOChannel.readAIOSync(AioSocketIOChannel.java:215)
at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:182)
... 64 more
Reporter BEGIN:com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream#447e447e
java.io.InputStream::SKIP_BUFFER_SIZE:2048
java.io.InputStream::skipBuffer:null
com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::logger:com.ibm.wsspi.webcontainer.logging.WebContainerLogger#2d512d51
com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::CLASS_NAME:com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream
com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::isc BEGIN:com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl#4b574b57
com.ibm.ws.http.channel.impl.HttpServiceContextImpl::tc BEGIN:com.ibm.ejs.ras.TraceComponent#4b344b34
com.ibm.ejs.ras.TraceElement::ivLevel:10
com.ibm.ejs.ras.TraceElement::ivName:com.ibm.ws.http.channel.impl.HttpServiceContextImpl
com.ibm.ejs.ras.TraceElement::ivDebugEnabled:false
com.ibm.ejs.ras.TraceElement::ivEventEnabled:false
com.ibm.ejs.ras.TraceElement::ivEntryEnabled:false
The stacktrace says that webservice on server gets timeout when reading data from client.
In conrast setting timeout props on getRequestContext() affects ws-client when waiting response from server.
It seems that very low client timeout test "succeeded". Client got a timeout and aborted request too early. That caused timeout on server side when trying to analyse request's mime type.
Try increasing client timeout to desired value.