I'm having some problems understanding how to send a request to a web service that I have deployed. I have followed the following tutorial:
http://wso2.org/library/1719
Which I have successfully applied, and it worked well. The tutorial was straightforward, and I have easily generated a web service client. All I did was creating "request" objects from the exposed web service method, set its arguments, and then using the web service stub, I have passed the request object to the exposed web service method, and got a response.
Now, I have received a WSDL file from which I'm supposed to build a web service client as well. The problem is that the generated files from the WSDL differ greatly from that of the tutorial I followed. I learned later on that when generating clients using ADB, there is a mode called "Expanded Mode" that generates " a class for each of the outer elements and the named complex types " (http://axis.apache.org/axis2/java/core/docs/adb/adb-howto.html#gen_modes). The problem is that I'm unable to understand how to create a request object and get a response from the web service from the generated classes. My best shot was as follows:
GetMfrInventoryProductItemsListE wrapper = new GetMfrInventoryProductItemsListE();
GetMfrInventoryProductItemsList request = new GetMfrInventoryProductItemsList();
request.setArg0(deviceId);
request.setArg1(macAddresses);
request.setArg2(mfrKey);
wrapper.setGetMfrInventoryProductItemsList(request);
GetMfrInventoryProductItemsListResponseE wrapperResponse = wmService.getMfrInventoryProductItemsList(wrapper);
GetMfrInventoryProductItemsListResponse response = wrapperResponse.getGetMfrInventoryProductItemsListResponse();
return response.get_return();
In the above code getGetMfrInventoryProductItemsList is the name of my exposed web service method, and wmService is my stub.
The result was the following stack Trace :
org.apache.axis2.AxisFault: Read timed out
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:197)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at wavemark.wmservice.soap.WMServiceStub.getMfrInventoryProductItemsList(WMServiceStub.java:3275)
at wavemark.linkserver.supplierconnect.controller.WsStub.getMfrInventoryProductItemsList(WsStub.java:107)
at wavemark.linkserver.supplierconnect.controller.WsManager.getProductItems(WsManager.java:384)
at wavemark.linkserver.supplierconnect.webservices.SupplierConnect.getProductItems(SupplierConnect.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
... 42 more
After trying to debug the problem, I have found out that this is the line that is throwing the exception:
GetMfrInventoryProductItemsListResponseE wrapperResponse = wmService.getMfrInventoryProductItemsList(wrapper);
I just want you guys to tell me if the way I'm using the request/response objects is correct.Your help is much appreciated.
Finally, I figured out how to solve the problem. Apparently the web service call that I was making, was taking a lot of time that it was timing out as the stack trace shows. So I added the following to my code to the section where I was instantiating my client stub:
wmService = new WMServiceStub();
Options options = new Options();
EndpointReference epr = new EndpointReference(url);
options.setTo(epr);
options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(300000));
wmService._getServiceClient().setOptions(options);
This results in increasing the Axis 2 web services' socket timeout to 5 minutes, which should be more than enough to most web service calls. I hope that this will be helpful for some developers out there.
Related
I need to consume a SOAP webservice with two endpoints
Employee
Customer
Both the endpoints have same function "getAddress" which returns list of Strings.
In order to consume the web service, I have used "wsimport" tool to generate the stubs
and apache cxf library, I get an exception
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fault occurred while processing.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
at com.sun.proxy.$Proxy39.getAddress(Unknown Source)
at com.testwebservice.Main.main(Main.java:105)
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:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.apache.cxf.binding.soap.SoapFault: Fault occurred while processing.
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1656)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1521)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1429)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:659)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
when ever I tried to use the "Employee.getAddress" method
But before, I would like to clarify whether two end points can have a same function name with same return type ?
Could not find any information in the documentation.
about your second question:
you cant have a same function name. actually you cant even have overloading. Because WSDL does not support method overloading(not OOPs). WCF generates WSDL which specifies the location of the service and the operation or methods the service exposes.
please provide more information about your service(Like WSDL file) so we can help you with details.
I have an application made with ICEfaces and ran on Tomcat 6. When I try to access one of the pages where I select users, if gives me this error. The weird thing is, after I get the error, I refresh the page, and it normally goes to where ever I needed it to go to.
Does anyone know what the error actually means, because the lines of code that are highlighted are closing of a DB connection, a comment line (weird lol), and some other syntax stuff that can't have errors in it.
exception
java.lang.RuntimeException: wrapped Exception: java.lang.NullPointerException
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:156)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
root cause
java.lang.NullPointerException
crm.CRM_SA_enter.reload_Fees(CRM_SA_enter.java:3591)
crm.CRM_SA_enter.gradeEval(CRM_SA_enter.java:3844)
crm.CRM_SA_enter.apply_dropDown(CRM_SA_enter.java:3265)
crm.CRM_SA_enter.load_function2(CRM_SA_enter.java:2314)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.el.parser.AstValue.invoke(AstValue.java:191)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
javax.faces.component.UICommand.broadcast(UICommand.java:380)
com.icesoft.faces.component.panelseries.UISeries$RowEvent.broadcast(UISeries.java:617)
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:285)
com.icesoft.faces.component.panelseries.UISeries$RowEvent.broadcast(UISeries.java:617)
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:285)
com.icesoft.faces.component.paneltabset.PanelTabSet.broadcast(PanelTabSet.java:320)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:132)
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:74)
com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:31)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
crm.CRM_SA_enter.reload_Fees(CRM_SA_enter.java:3591)
Has the NPE. Doesn't look like IceFaces code at all, probably what you are building.
I am using hibernate in my web application,when I am getting exception while:
Transaction tx=session.beginTransaction();
It gives exception once in a while, I am reloading SessionFactory while catching the exception and then it runs fine.
It is working when I am reloading the SessionFactory again.
This is my code snippet:
session = HibernateFactory.openSession(0);//Passing 0 uses the existing sessionFactory
if(session.isConnected() && session.isOpen() && session!=null)
{
try{
tx = session.beginTransaction();
logger.info("Transaction is begin successfully--Transaction is--"+tx);
}catch(Exception e){
logger.info("Could not start the transaction--Transaction is--"+tx);
session = HibernateFactory.openSession(1);//passing 1 is creating new //--SessionFactory
tx = session.beginTransaction();//now this runs fine
logger.info("Inside catch--Obtained session--"+session+"and transaction--"+tx);
e.printStackTrace();
logger.error("e.getCause(): "+e.getCause());
logger.error("e.getClass(): "+e.getClass());
// throw new HibernateException(e.getMessage());
}
}
This is the stackTrace of the exception I am getting.
org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at com.arosys.hibernateDao.AbstractDao.startOperation(AbstractDao.java:184)
at com.arosys.hibernateDao.AbstractDao.findAll(AbstractDao.java:150)
at com.arosys.beansDao.JobHierarchyDao.findAll(JobHierarchyDao.java:20)
at org.ArosysLogin.server.GWTJobImpl.getJobHierarchy(GWTJobImpl.java:416)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
Just guessing since there isn't enough information (type and message of the exception):
Connection fails due to flaky database/network connection
do you commit your transactions? I'm not sure, but Hibernate might complain if you try to start a transaction twice.
UPDATE based on the call stack.
This seems to be a problem with the database. check out the various results for googling "com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure"
This one might help: https://serverfault.com/questions/89955/unable-to-connect-to-mysql-through-jdbc-connector-through-tomcat-or-externally
Are you sure your connections get closed after usage? I can imagine the database denying access after so many connections are opened. Checking the logs of your database might help as well.
Set ValidateConnectionOnBorrow to true
and add a validation query for SQLForValidateConnection
Set autoReconnect to true for jdbc URL
either by Server connection pool configuration or connection pool configuration.
I assume(from the stack trace) that you are using MySQL,Hibernate with either JBoss or Tomcat.
Let me know in case you face any problem, I faced the same long ago.
HI,
I have a webservice running on glassfish3.1 server on one machine.
On second machine I have a java (GUI) app, that is running and calls the above mentioned web service.
In my webservice call, i send a file as SOAP attachment. It reaches the server, the file is then processed and then it is returned back to my client machine over https.
If my file is too large and takes more than 15 mins, the operation fails and I get the following error:
On Client side:
Couldn't create SOAP message due to exception: org.jvnet.mimepull.MIMEParsingException: javax.net.ssl.SSLException: SSL peer shut down incorrectly
on server side:
javax.servlet.ServletException
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:150)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.xml.ws.WebServiceException: com.ctc.wstx.exc.WstxIOException: java.nio.channels.ClosedChannelException
at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:184)
at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:282)
at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:400)
at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:96)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:618)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:162)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
... 27 more
Caused by: com.ctc.wstx.exc.WstxIOException: java.nio.channels.ClosedChannelException
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
at com.sun.xml.ws.util.xml.XMLStreamWriterFilter.flush(XMLStreamWriterFilter.java:71)
at com.sun.xml.ws.streaming.XMLStreamWriterUtil.getOutputStream(XMLStreamWriterUtil.java:101)
at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:320)
at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:147)
at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:168)
... 34 more
Caused by: org.apache.catalina.connector.ClientAbortException: java.nio.channels.ClosedChannelException
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:382)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:351)
at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:175)
at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
... 39 more
Caused by: java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:108)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
at com.sun.grizzly.util.SSLOutputWriter.flushChannel(SSLOutputWriter.java:102)
at com.sun.grizzly.ssl.SSLOutputBuffer.flushChannel(SSLOutputBuffer.java:138)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:398)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flush(SocketChannelOutputBuffer.java:376)
at com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1241)
at com.sun.grizzly.ssl.SSLProcessorTask.action(SSLProcessorTask.java:164)
at com.sun.grizzly.tcp.Response.action(Response.java:268)
at org.apache.catalina.connector.OutputBuffer.doFlush(Output
...
I think that SSL session is timed out on my client side and not on the server side.
Now I am trying to figure out a way to increase the SSL timeout on my client side which i suppose is 15 mins...
I am not able to do so, any help would be appriciated...
Thank you
I think that SSL session is timed out
on my client side
No. Your client encountered a closed (reset) connection without first receiving an SSL close_notify from the server. So it wasn't the client. I would guess that the server is imposing a POST size limit and closing the connection when you exceed it.
If you are sending too much data you are going to experience IOExceptions somewhere or other. Either obey the limit or raise it, and obey the new value.
Open your domain.xml and try to find out which SSL version you are using.
If you see something like the following one[ ssl3-enabled="false" ], then it's SSL2 which has default timeout of 100 seconds.
<ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" ssl3-enabled="false" cert-nickname="s1as"></ssl>
In such a scenario
either you can put some bigger value to ssl-session-timeout property[you may need to add this]
or you may opt for using ssl3 over ssl which has larger value for timeout by default.
Ref: http://download.oracle.com/docs/cd/E19798-01/821-1753/abhaq/index.html
I am using axis2 for my web services creation. I want to use my own wsdl file instead of using generated wsdl file. When I am placing my own wsdl file in META-INF directory and deploying my web services they are deploying successfully. But the problem is when i try to test these web service using soapui it throwing null pointer exception.
For example I am invoking following operations in soap ui.
public String testWebService(String a, String b)
{
LogHelper.info("Value of a is:"+a);
LogHelper.info("Value of b is :"+b);
String c=a.trim()+b.Trim();
return "suceess"
}
output in console:
value of a is:
value of b is:null
19:58:47,781 ERROR [RPCMessageReceiver] Exception occurred while trying to invoke service method testWebService
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:142)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at o......................................................
SO What i understand is i am getting value for a is blank and value of b is null.
Can any one give me any suggestions please.
Thanks,
Narendra