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
Related
I'm using saaj to get attachments with my java servlet (hosted with apache and tomcat).
When trying to call message.getAttachments(); (where message is SOAPMessage object):
If the attachment is small (few KB) - it works
If the attachment is big (few MB) - it throws the following exception:
java.lang.RuntimeException: org.jvnet.mimepull.MIMEParsingException: java.io.IOException: The system cannot find the path specified
at com.sun.xml.messaging.saaj.soap.MessageImpl.getAttachments(MessageImpl.java:826)
at MyCode.MyServlet.doPost(MyServlet.java:215)
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.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
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:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jvnet.mimepull.MIMEParsingException: java.io.IOException: The system cannot find the path specified
at org.jvnet.mimepull.MemoryData.createNext(MemoryData.java:93)
at org.jvnet.mimepull.Chunk.createNext(Chunk.java:59)
at org.jvnet.mimepull.DataHead.addBody(DataHead.java:82)
at org.jvnet.mimepull.MIMEPart.addBody(MIMEPart.java:192)
at org.jvnet.mimepull.MIMEMessage.makeProgress(MIMEMessage.java:235)
at org.jvnet.mimepull.MIMEMessage.parseAll(MIMEMessage.java:176)
at org.jvnet.mimepull.MIMEMessage.getAttachments(MIMEMessage.java:101)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimePullMultipart.parseAll(MimePullMultipart.java:118)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimePullMultipart.parse(MimePullMultipart.java:129)
at com.sun.xml.messaging.saaj.packaging.mime.internet.MimeMultipart.getCount(MimeMultipart.java:199)
at com.sun.xml.messaging.saaj.soap.MessageImpl.initializeAllAttachments(MessageImpl.java:1384)
at com.sun.xml.messaging.saaj.soap.MessageImpl.getAttachments(MessageImpl.java:824)
... 22 more
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at java.io.File.createTempFile(Unknown Source)
at org.jvnet.mimepull.MemoryData.createNext(MemoryData.java:87)
... 33 more
How can I solve this issue?
Thanks!
The sourcecode of MimePull, which produces the Exception, says this:
if (!config.isOnlyMemory() && dataHead.inMemory >= config.memoryThreshold) {
try {
String prefix = config.getTempFilePrefix();
String suffix = config.getTempFileSuffix();
File dir = config.getTempDir();
File tempFile = (dir == null)
? File.createTempFile(prefix, suffix) // here your code crashes
: File.createTempFile(prefix, suffix, dir);
LOGGER.fine("Created temp file = "+tempFile);
dataHead.dataFile = new DataFile(tempFile);
} catch(IOException ioe) {
throw new MIMEParsingException(ioe);
}
It tries to open a temp file, because the memory size threshold is passed.
It is called
at MyCode.MyServlet.doPost(MyServlet.java:215)
It looks like you are using SAAJ to receive the messages and have enabled the MimePull plugin (using -Dsaaj.use.mimepull=true flag). It should allow receiving larger files, as the MimePull implementation uses temporary files as a fallback.
Now the bad news seems to be, that you can't configure the MimePull reader through your SAAJ configuration.
The good news may be that you are able to tweak the logic of File.createTempFile(...) through the system property java.io.tmpdir.
Try starting with -Djava.io.tmpdir=/path/to/tmpdir.
Else maybe try to consume the message directly with MimePull I never did this myself, so don't ask me about it. ;-)
EDIT:
Or switch off MimePull completely by setting -Dsaaj.use.mimepull=false if you do not expect your attachments to soak up all your memory.
We solved the problem by just changing the Jersey-Libs version from 1.13 to 1.19. Seems that 1.13 is buggy.
ok I have really a strange problem that I keep looking for solution in google and yahoo for almost 4 hours today. And I desperately looking for a solution.
public static String [] checkCardAccount(String cardNumber, String cardIssuer, String securityNumber){
URL url = null;
try {
url = new URL("http://localhost:8999/bankcard?wsdl");
} catch (MalformedURLException e) {
e.printStackTrace();
}
QName qname = new QName("http://server.bcard.soap.com/","BankCardImplService");
Service service = Service.create(url,qname);
BankCard bankcard = service.getPort(BankCard.class);
return bankcard.getCardClientData(cardNumber, cardIssuer);
}
the above code is my client for accessing the SOAP service, it really works in a standalone java application but when I embed it to my Java Struts application it says the following error below
javax.xml.ws.WebServiceException: Undefined port type:
{http://bankcard.api.com/}BankCard at
com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:349)
at
com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:355)
at javax.xml.ws.Service.getPort(Service.java:161) at
com.api.bankcard.BankCardClient.checkCardAccount(BankCardClient.java:25)
at com.action.CardregAction.execute(CardregAction.java:18) at
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
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.Http11Processor.process(Http11Processor.java:857)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Now I really see that the problem is the target namespace because as I change it the error changes to that it says that the valid services is {http://bankcard.api.com/}BankCard
where I went wrong? this code works on standalone on Java Application but not in my Java Struts web app
give endpointIneterface in #WebService annotation in the implementation class, if you dont give endpoint interface, you have to mention fully qualified port name while using getPort method.
service.getPort("PortQName",BankCard.class);
You need to annotate the BankCardImpl class with #WebService(name="BankCard")
You can then use service.getPort(BankCard.class);
OR
If you just annotate it with #WebService or have given it another name, then you will need to provide more information to the getPort() method:
replace
BankCard bankcard = service.getPort(BankCard.class);
with
QName port_name = new QName("http://server.bcard.soap.com/","BankCardImplPort");
BankCard bankcard = service.getPort(port_name, BankCard.class);
I'm simply trying to send back an error to the client when a request fails. Here's what my code looks like:
response.sendError(HttpServletResponse.SC_BAD_REQUEST,
"Email and username are required fields.");
This code throws the following error:
java.lang.IllegalStateException: null
at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) ~[catalina-6.0.26.jar:6.0.26]
at com.****.****.****.*********Servlet.service(********Servlet.java:68) ~[********Servlet.class:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) ~[javaee-api-5.1.2.jar:5.1.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) ~[catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina-6.0.26.jar:6.0.26]
at org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:78) ~[red5.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) ~[catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) ~[catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina-6.0.26.jar:6.0.26]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina-6.0.26.jar:6.0.26]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) [tomcat-coyote-6.0.26.jar:6.0.26]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote-6.0.26.jar:6.0.26]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) [tomcat-coyote-6.0.26.jar:6.0.26]
Why is this being thrown here? I'm not doing anything before this call that has anything at all to do with the response object, I'm not even touching it until this error is sent in an if clause. Why am I getting this error?
The only reason for HttpServletResponse (implemented by ResponseFacade) to throw an IllegalStateException is that the response was already committed before. It must have been touched by someone before already.
If your ResponseFacade does not override response.sendError() or it leads to forwarding to the error page, it is happening because the response is getting committed before forwarding to the error page.
To resolve this issue,
make sure you are not flushing the response
If the response is committing automatically because the max buffer size has reached, try increasing the buffer size.
Apologies for the lack of a code example but I'm not sure I could replicate the issue in a simple example.
The exception below has started to appear recently in my RichFaces application. It is a web front end for querying a database and display the data in a simple table. The problem occurs when my application finishes executing my code on the bean linked to a command button. It calls FilterChain.doFilter when you click the button on the pop panel, then completes the code on the bean, then i assume while trying to rerender the main window this exception is thrown.
The problem appeared when a new entry point to this same popup panel that performs the same code on the bean when the button is clicked that works fine, however since this new entry point was added the old one has started throwing this exception.
I know it's unlikely anyone will be able to provide an answer to the problem without code but having little understanding of how these filter chains work, I am not even sure where to start looking and was wondering if anyone could point me in a direction that might lead me to finding a solution.
The service is running on WASCE 2.1.
Any help will be greatly appreciated.
javax.servlet.ServletException: IteratedExpression.getItem: Index out of Bounds
at javax.faces.webapp._ErrorPageWriter.throwException(_ErrorPageWriter.java:549)
at javax.faces.webapp.FacesServlet.handleLifecycleException(FacesServlet.java:293)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPacakge.jsfutils.CheckLogonFilter.doFilter(CheckLogonFilter.java:81)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
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.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.geronimo.tomcat.valve.ThreadCleanerValve.invoke(ThreadCleanerValve.java:40)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621)
at org.ajax4jsf.component.UIDataAdaptor.getRowIndex(UIDataAdaptor.java:311)
at javax.faces.component._ComponentUtils.idsAreEqual(_ComponentUtils.java:134)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:110)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:449)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:912)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:882)
at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:395)
at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:216)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
... 29 more
2011-12-12 16:35:48,342 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621)
at org.ajax4jsf.component.UIDataAdaptor.getRowIndex(UIDataAdaptor.java:311)
at javax.faces.component._ComponentUtils.idsAreEqual(_ComponentUtils.java:134)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:110)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:449)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:912)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findUIComponentBelow(RendererUtils.java:919)
at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:882)
at org.ajax4jsf.context.AjaxContextImpl.convertId(AjaxContextImpl.java:395)
at org.ajax4jsf.context.AjaxContextImpl.addRegionsFromComponent(AjaxContextImpl.java:331)
at org.ajax4jsf.component.AjaxActionComponent.setupReRender(AjaxActionComponent.java:96)
at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:60)
at org.ajax4jsf.component.UIInclude.broadcast(UIInclude.java:170)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastAjaxEvents(AjaxViewRoot.java:340)
at org.ajax4jsf.application.AjaxViewHandler.processAjaxEvents(AjaxViewHandler.java:216)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:169)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:182)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at myPackage.jsfutils.CheckLogonFilter.doFilter(CheckLogonFilter.java:81)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
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.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.geronimo.tomcat.valve.ThreadCleanerValve.invoke(ThreadCleanerValve.java:40)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Problem solved was trying to rerender part of the panel that didn't exist. Strange how it only happened on the one entry point was in the jsp as a rerender attribute on the confirm button on the popup panel so both entry points where using the same button and jsp declaration. Added in the part that was missing as it was meant to be there and can only imagine it was removed by mistake or an svn merge.
Look at the root cause:
java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds
at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75)
at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
at javax.faces.component.UIData.getValue(UIData.java:1081)
at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624)
at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65)
at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59)
at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120)
...
This is absolutely not related to filters. The request just happens to being passed through a filter. If the filter would have caused any problem, you would have seen it in the 1st line of the stacktrace.
Your concrete problem is most likely caused by not preserving the proper data model for the data table in the subsequent request. The managed bean is apparently in the request scope instead of the view scope. To fix this, you need to put the bean in the view scope and if necessary review your data model preserving/preloading logic. This should take place in (post)constructor and/or (action)listener methods, but for sure not in the getter method. The getter method should only return the data model, nothing more.
If you are still on JSF 1.x which doesn't have the new JSF 2.x view scope, you need to add an <a4j:keepAlive> to the page which references the request scoped managed bean.
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.