Error with ServiceInvoker, throws MessageDeliverException: o
meenakshik Dec 6, 2007 11:05 AMHi All,
I had done some modifications in the native_client sample where I don't want to use web service but just receive a xml file and send it to the JBoss ESB.
The code is pretty straight forward without any major modifications. I just remove the reference to the Web Service.
now, the problem that arises is in the HelloWorldWS.java file. I have converted it into a httpServlet and in my doPost method, I write the following code:
String fileName = "C://data.xml"; try { ServiceInvoker deliveryAdapter; Message requestMessage; // Create the delivery adapter for the target service (you'd normally cache this!!)... deliveryAdapter = new ServiceInvoker("MyServiceCategory", "MyNativeClientService"); // Create and populate the request message... requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML); // requestMessage.getBody().add(fileName); // inject the value from the WS client deliveryAdapter.deliverAsync(requestMessage);
If you notice, the only change is that I have done is the remove "toWhom" and instead pass "fileName". Also, I want to do it as asynchronous so i have used
deliveryAdapter.deliverAsync(requestMessage);
but when I try to access this servlet, it gets the xml file but then it throws me the following error:
16:29:25,974 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:25,974 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:29,889 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:29,899 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:31,642 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:31,642 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:33,054 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:33,054 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:36,339 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:36,349 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file. 16:29:36,849 INFO [STDOUT] org.jboss.soa.esb.listeners.message.MessageDeliverException: org.xml.sax.SAXParseException: Prema ture end of file. 16:29:36,849 INFO [STDOUT] org.jboss.soa.esb.listeners.message.MessageDeliverException: org.xml.sax.SAXParseException: Prema ture end of file. 16:29:36,849 INFO [STDOUT] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:364) 16:29:36,849 INFO [STDOUT] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:114) 16:29:36,849 INFO [STDOUT] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:137) 16:29:36,859 INFO [STDOUT] at org.jboss.soa.esb.samples.quickstart.nativeclient.webservice.HelloWorldWSTest.doGet(HelloW orldWSTest.java:39) 16:29:36,859 INFO [STDOUT] at org.jboss.soa.esb.samples.quickstart.nativeclient.webservice.HelloWorldWSTest.doPost(Hello WorldWSTest.java:59) 16:29:36,859 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) 16:29:36,859 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 16:29:36,859 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:290) 16:29:36,859 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 16:29:36,869 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 16:29:36,869 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja va:235) 16:29:36,869 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 16:29:36,869 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 16:29:36,869 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 16:29:36,869 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.jav a:179) 16:29:36,869 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 16:29:36,879 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 16:29:36,879 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) 16:29:36,879 INFO [STDOUT] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:1 57) 16:29:36,879 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 16:29:36,879 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) 16:29:36,879 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 16:29:36,889 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.jav a:580) 16:29:36,889 INFO [STDOUT] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 16:29:36,889 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619) 16:29:36,889 INFO [STDOUT] Caused by: org.jboss.soa.esb.services.registry.RegistryException: org.xml.sax.SAXParseException: Premature end of file. 16:29:36,889 INFO [STDOUT] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.ja va:369) 16:29:36,889 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:29:36,899 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 16:29:36,899 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 16:29:36,899 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:597) 16:29:36,899 INFO [STDOUT] at org.jboss.internal.soa.esb.services.registry.RegistryService$1.invoke(RegistryService.java :61) 16:29:36,899 INFO [STDOUT] at $Proxy24.findEPRs(Unknown Source) 16:29:36,909 INFO [STDOUT] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) 16:29:36,909 INFO [STDOUT] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:351) 16:29:36,909 INFO [STDOUT] ... 24 more 16:29:36,909 INFO [STDOUT] Caused by: org.jboss.soa.esb.UnmarshalException: org.xml.sax.SAXParseException: Premature end of file. 16:29:36,909 INFO [STDOUT] at org.jboss.internal.soa.esb.addressing.helpers.EPRHelper.fromXMLString(EPRHelper.java:270) 16:29:36,909 INFO [STDOUT] at org.jboss.internal.soa.esb.addressing.helpers.EPRHelper.fromXMLString(EPRHelper.java:237) 16:29:36,909 INFO [STDOUT] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.ja va:358) 16:29:36,920 INFO [STDOUT] ... 32 more 16:29:36,920 INFO [STDOUT] Caused by: org.xml.sax.SAXParseException: Premature end of file. 16:29:36,920 INFO [STDOUT] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) 16:29:36,920 INFO [STDOUT] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) 16:29:36,920 INFO [STDOUT] at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) 16:29:36,920 INFO [STDOUT] at org.jboss.internal.soa.esb.addressing.helpers.EPRHelper.fromXMLString(EPRHelper.java:262) 16:29:36,930 INFO [STDOUT] ... 34 more
I have not done any modifications with the service nor with the listener. Could you please help me with the above error?
Thanks in advance,
Meenakshi