com.ctc.wstx asl 3.2.0.jar.stax.wstx asl 3.2.0.jarinputfactory 是哪个jar

com.ctc.wstx.stax.WstxInputFactory cannot be cast to javax.xml.stream.XMLInputFactory_百度知道Weblogic常见错误解决(持续更新)
---------------------------------------------------------
错误:windows下启动startWebLogic.cmd,提示enter your boot
webLogic username,输入后显示启动不了
分析:以前启动都没有什么问题,这次不知道为什么启动不了。提示输入boot webLogic
username后,输入后不接着提示输入password直接启动,然后就报错。我就纳闷,为什么我已经新建了boot.properties,启动服务器还让我输入。经过观察才发现不是提示我输入weblogic
username,而是多了boot。我想应该是文件boot.properties出了问题。
解决:在域的\servers\AdminServer\security这个文件夹下打开了boot.properties,发现username和password都变成了乱码,然后改成了我的用户名和密码,启动就没有问题了。
---------------------------------------------------------
错误:控制台部署项目报错,“com.ctc.wstx.stax.WstxInputFactory
cannot be cast to javax.xml.stream.XMLInputFactory”
分析:这个错误来得莫名其妙,与weblogic冲突的包已经删掉了,之前每次部署都很好,什么配置也没动,这个错误就来了。网上提了一个解决办法:
在WEB-INF目录下添加weblogic.xml,内容如下:
&?xml version="1.0"
encoding="UTF-8"?&
&weblogic-web-app&
&&container-descriptor&
&&&prefer-web-inf-classes&false&/prefer-web-inf-classes&
&&/container-descriptor&
&/weblogic-web-app&
prefer-web-inf-classes&
如果设置true还报错,就更改为false。
我的war包里有这个配置文件了,一模一样,于是听这位仁兄的把true改成了false,结果出错更多,后来就改回true,结果一部署就好了,同样是莫名其妙。
解决:war包里weblogic.xml,true改为false,又改回来true,莫名其妙地好了
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Hi Servicemix-guys,Following is the my use case message flow:Client App &--& HTTPConsumerSu --& CamelSu &---& HTTPProviderSu&--& External AppWe are struggling with a problem having INFO level in log4j.xml fororg.apache.servicemix logger and WARN levels for rest of all loggers.Problem was java.io.IOException: Stream closed. The message was notdelivered to External App. Following is the link for forum discussion :The error is related to and isoccurring for us in ServiceMix-Camel component.It finally got resolved based on suggestion mentioned in the forum.But this time I am facing error after getting response from Externalapplication. The error log is:com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.atcom.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)atcom.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)atcom.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)atcom.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)atorg.apache.servicemix.jbi.jaxp.StAXSourceTransformer.toXMLStreamReader(StAXSourceTransformer.java:86)atorg.apache.servicemix.http.endpoints.DefaultHttpConsumerMarshaler.sendOut(DefaultHttpConsumerMarshaler.java:78)atorg.apache.servicemix.http.endpoints.HttpConsumerEndpoint.sendOut(HttpConsumerEndpoint.java:392)atorg.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:273)atorg.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)To solve the above problem I tried same way as Gert suggested havingconvertToBody(DOMSource.class) after to(.......) statement.Camel configuration with the added changes is as follows :from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added hereAfter the above changes almost all working, but some times I am gettingfollowing exception:ERROR - DeadLetterChannel
- Failed delivery forexchangeId:ID-rsandeep/-0. On delivery attempt: 0 caught:org.apache.camel.RuntimeCamelException: java.io.IOException:Attempted readon closed stream.org.apache.camel.RuntimeCamelException: java.io.IOException: Attempted readon closed stream.atorg.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:411)atorg.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo(InstanceMethodTypeConverter.java:50)atorg.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:67)atorg.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:59)atorg.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:50)atorg.apache.camel.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:41)atorg.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)atorg.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155)atorg.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:91)at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)atorg.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)atorg.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)atorg.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)atorg.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)atorg.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:101)atorg.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)atorg.mon.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)atorg.mon.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)atorg.mon.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)atorg.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)atorg.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)atorg.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)atorg.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: Attempted read on closed stream.atmons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:165)atmons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:85)atorg.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(UnknownSource)atorg.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)atorg.apache.xerces.impl.XMLVersionDetector.determineDocVersion(UnknownSource)at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)atorg.apache.camel.converter.jaxp.XmlConverter.toDOMSourceFromStream(XmlConverter.java:366)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)atorg.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:407)... 26 morePlease help me resolve this problem. This is acting as a blocker as wecannot release with the DEBUG mode in log4j.xmlSandeep.--View this message in context: Sent from the ServiceMix - User mailing list archive .
Search Discussions
Sandeep,Can you pinpoint the messages that are causing this error?
Is thereanything special to them?
BTW, I see you are using the Camel deadletter channel.
Make sure you configure that properly (not related toyour current question, but the default configuration just writes amessage to the log when things go wrong without information the JBIendpoint).Regards,Gertsandeep reddy wrote:Hi Servicemix-guys,Following is the my use case message flow:Client App &--& HTTPConsumerSu --& CamelSu &---& HTTPProviderSu&--& External AppWe are struggling with a problem having INFO level in log4j.xml fororg.apache.servicemix logger and WARN levels for rest of all loggers.Problem was java.io.IOException: Stream closed. The message was notdelivered to External App. Following is the link for forum discussion :The error is related to and isoccurring for us in ServiceMix-Camel component.It finally got resolved based on suggestion mentioned in the forum.But this time I am facing error after getting response from Externalapplication. The error log is:com.ctc.wstx.exc.WstxIOException: Attempted read on closed stream.atcom.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)atcom.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)atcom.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)atcom.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:331)atorg.apache.servicemix.jbi.jaxp.StAXSourceTransformer.toXMLStreamReader(StAXSourceTransformer.java:86)atorg.apache.servicemix.http.endpoints.DefaultHttpConsumerMarshaler.sendOut(DefaultHttpConsumerMarshaler.java:78)atorg.apache.servicemix.http.endpoints.HttpConsumerEndpoint.sendOut(HttpConsumerEndpoint.java:392)atorg.apache.servicemix.http.endpoints.HttpConsumerEndpoint.process(HttpConsumerEndpoint.java:273)atorg.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet.java:71)at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)To solve the above problem I tried same way as Gert suggested havingconvertToBody(DOMSource.class) after to(.......) statement.Camel configuration with the added changes is as follows :from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added hereAfter the above changes almost all working, but some times I am gettingfollowing exception:ERROR - DeadLetterChannel
- Failed delivery forexchangeId:ID-rsandeep/-0. On delivery attempt: 0 caught:org.apache.camel.RuntimeCamelException: java.io.IOException:Attempted readon closed stream.org.apache.camel.RuntimeCamelException: java.io.IOException: Attempted readon closed stream.atorg.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:411)atorg.apache.camel.impl.converter.InstanceMethodTypeConverter.convertTo(InstanceMethodTypeConverter.java:50)atorg.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:67)atorg.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:59)atorg.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:50)atorg.apache.camel.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:41)atorg.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)atorg.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:155)atorg.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:91)at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)atorg.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:57)atorg.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)atorg.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)atorg.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)atorg.apache.servicemix.camel.CamelJbiEndpoint.handleActiveProviderExchange(CamelJbiEndpoint.java:101)atorg.apache.servicemix.camel.CamelJbiEndpoint.process(CamelJbiEndpoint.java:74)atorg.mon.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)atorg.mon.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)atorg.mon.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)atorg.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)atorg.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)atorg.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)atorg.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: Attempted read on closed stream.atmons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:165)atmons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:85)atorg.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(UnknownSource)atorg.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)atorg.apache.xerces.impl.XMLVersionDetector.determineDocVersion(UnknownSource)at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)at org.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)atorg.apache.camel.converter.jaxp.XmlConverter.toDOMSourceFromStream(XmlConverter.java:366)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)atorg.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:407)... 26 morePlease help me resolve this problem. This is acting as a blocker as wecannot release with the DEBUG mode in log4j.xmlSandeep.
Can you pinpoint the messages that are causing this error?This is the response message from External application:when it is success:&?xml version='1.0' encoding='UTF-8'?&&response&&message&password changed&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0' encoding='UTF-8'?&&response&&message&Internal ServerError: failed to change password&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with response message.And we are pretty surethat message is not creating any sought of problem because if message is notproper it should fail for each time. And it works fine having DEBUG level inlog4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure that properly (not related toyour current question, but the default configuration just writes amessage to the log when things go wrong without information the JBIendpoint).Yes we are using Dead letter channel, and it is configured properly.Thisis camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ ErrorConstants.SYSTEM_ERROR+&&/status&&message&System Error&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ ErrorConstants.SOCKET_ERROR+&&/status&&message&Connection Error&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added here}--View this message in context: Sent from the ServiceMix - User mailing list archive .
Hi,I am still facing this same problem and I am not able to resolve it.Please provide some advice on how to solve this or at least a workaround.This is very important so please help us.Thanks,Sandeepsandeep reddy wrote:Can you pinpoint the messages that are causing this error?This is the response message from External application:when it is success:&?xml version='1.0' encoding='UTF-8'?&&response&&message&password changed&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0' encoding='UTF-8'?&&response&&message&InternalServer Error: failed to changepassword&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with response message.And we are pretty surethat message is not creating any sought of problem because if message isnot proper it should fail for each time. And it works fine having DEBUGlevel in log4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure that properly (not related toyour current question, but the default configuration just writes amessage to the log when things go wrong without information the JBIendpoint).Yes we are using Dead letter channel, and it is configuredproperly.This is camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ErrorConstants.SYSTEM_ERROR +&&/status&&message&SystemError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ErrorConstants.SOCKET_ERROR +&&/status&&message&ConnectionError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added here}--View this message in context: Sent from the ServiceMix - User mailing list archive .
Hi Sandeep,We also faced the same problem with http component.
servicemix-http returnsthe response with source as StaxSource or DOMSource.and StaxSource messagesare giving inconsitent results.
I don't know the reason for this.But,
work around for this to get the message from the http
with DOMSource.For this purpose, add the following policy definition in the http endpointdefinition.&http:policies&&bean class=&org.apache.servicemix.soap.handlers.dom.DomHandler&/&&/http:policies&If we add the above policy to http endpoint, NM
contents will be in DOMsource and we can avoid this problem.If you find any other good solution let me know.sandeep reddy wrote:Hi,I am still facing this same problem and I am not able to resolve it.Please provide some advice on how to solve this or at least a workaround.This is very important so please help us.Thanks,Sandeepsandeep reddy wrote:Can you pinpoint the messages that are causing this error?This is the response message from External application:when it is success:&?xml version='1.0' encoding='UTF-8'?&&response&&message&password changed&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0' encoding='UTF-8'?&&response&&message&InternalServer Error: failed to changepassword&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with response message.And we are pretty surethat message is not creating any sought of problem because if message isnot proper it should fail for each time. And it works fine having DEBUGlevel in log4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure that properly (not related toyour current question, but the default configuration just writes amessage to the log when things go wrong without information the JBIendpoint).Yes we are using Dead letter channel, and it is configuredproperly.This is camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ErrorConstants.SYSTEM_ERROR +&&/status&&message&SystemError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ErrorConstants.SOCKET_ERROR +&&/status&&message&ConnectionError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added here}-----CheersPraveen Oruganti&Think before you act and act on what you believe&--View this message in context: Sent from the ServiceMix - User mailing list archive .
Sandeep,This problem bit us not too long ago and I figured out why.
SinceServiceMix makes use of of an InputStream (see: by mulitplecomponents, it requires that the InputStream being returned can be readmultiple times if the message is being used (i.e. parsed for logic, etc.) bymultiple components.
This is the reason the wiki page says to make use ofthe StringSource so that a String buffer is stored in memory to allow formultiple reads of the response.
The reason your input stream cannot be readmultiple times is because the returned server objects is of the typemons.io.input.AutoCloseInputStream .from the AutoCloseInputStream Javadoc:Proxy stream that closes and discards the underlying stream as soon as theend of input has been reached or when the stream is explicitly closed. Noteven a reference to the underlying stream is kept after it has beenclosed, so any allocated in-memory buffers can be freed even if the clientapplication still keeps a reference to the proxy stream.There are 2 reasons the AutoCloseInputStream is being used to wrap the HTTPserver response:1) The HTTP API being used is the Apache HTTP Commons Client and it hasspecial rules to wrap the server responses in different input streamsdepending on the response headers.2) The HTTP response coming from the Server is most likely using the 'Transfer-Encoding:chunked'
Use a program like
Wiresharkor
to monitor the response to see ifthis is the case.
I have a high degree of confidence that it is.
When theserver responds with a chunked encoding the HTTP Commons client wraps theresponse with aChunkedInputStream
enclosed in an AutoCloseInputStream object.There are a few ways this can be fixed:1) Change your server to respond using the normal 'Content-Length: XXX'header instead of 'Transfer-Encoding: chunked'.
This will cause the HTTPcommons client to return a different InputStream type which can be read frommultiple times.2) Modify the internal Camel/ServiceMix API's to use theHttpMethodBase.getResponseBody()
instead ofHttpMethodBase#getResponseBodyAsStream() .
You will most likely need towrap the HttpMethodBase.getResponseBody() call in ajava.io.ByteArrayInputStream
if you do not want to modify the source codetoo much.Example API replacement:replace HttpMethodBase.getResponseBodyAsStream()with new ByteArrayInputStream(HttpMethodBase.getResponse())I also found these threads and JIRA tickets which may be related to theserver sending a chunked response.Fuse JIRA
ESB-73Hope this helps and good luck!Thanks,Trevorsandeep reddy wrote:Hi,I am still facing this same problem and I am not able to resolve it.Please provide some advice on how to solve this or at least a workaround.This is very important so please help us.Thanks,Sandeepsandeep reddy wrote:Can you pinpoint the messages that are causing this error?This is the response message from External application:when it is success:&?xml version='1.0' encoding='UTF-8'?&&response&&message&password changed&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0' encoding='UTF-8'?&&response&&message&InternalServer Error: failed to changepassword&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with response message.And we are pretty surethat message is not creating any sought of problem because if message isnot proper it should fail for each time. And it works fine having DEBUGlevel in log4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure that properly (not related toyour current question, but the default configuration just writes amessage to the log when things go wrong without information the JBIendpoint).Yes we are using Dead letter channel, and it is configuredproperly.This is camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ErrorConstants.SYSTEM_ERROR +&&/status&&message&SystemError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ErrorConstants.SOCKET_ERROR +&&/status&&message&ConnectionError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//added here.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)
//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);
//added here}--View this message in context: Sent from the ServiceMix - User mailing list archive .
All,I wonder if someone has some ideas on this.
Any advices or document are appriciated.ThanksQuan--- On Thu, 9/4/08, tpounds wrote:From: tpounds &trevor.&Subject: Re: RuntimeCamelException: java.io.IOException:Attempted read on closed streamTo: users@servicemix.apache.orgDate: Thursday, September 4,
PMSandeep,This problem bit us not too long ago and I figured out why.SinceServiceMix makes use of of an InputStream (see:by mulitplecomponents, it requires that the InputStream being returnedcan be readmultiple times if the message is being used (i.e. parsedfor logic, etc.) bymultiple components.
This is the reason the wiki page saysto make use ofthe StringSource so that a String buffer is stored inmemory to allow formultiple reads of the response.
The reason your inputstream cannot be readmultiple times is because the returned server objects is ofthe typemons.io.input.AutoCloseInputStream .from the AutoCloseInputStream Javadoc:Proxy stream that closes and discards the underlyingstream as soon as theend of input has been reached or when the stream isexplicitly closed. Noteven a reference to the underlying stream is keptafter it has beenclosed, so any allocated in-memory buffers can befreed even if the clientapplication still keeps a reference to the proxy stream.There are 2 reasons the AutoCloseInputStream is being usedto wrap the HTTPserver response:1) The HTTP API being used is the Apache HTTP CommonsClient and it hasspecial rules to wrap the server responses in differentinput streamsdepending on the response headers.2) The HTTP response coming from the Server is most likelyusing the'Transfer-Encoding:chunked'
Use a program like Wiresharkor
to monitor theresponse to see ifthis is the case.
I have a high degree of confidence thatit is.
When theserver responds with a chunked encoding the HTTP Commonsclient wraps theresponse with aChunkedInputStream
enclosed in an AutoCloseInputStreamobject.There are a few ways this can be fixed:1) Change your server to respond using the normal'Content-Length: XXX'header instead of 'Transfer-Encoding: chunked'.This will cause the HTTPcommons client to return a different InputStream type whichcan be read frommultiple times.2) Modify the internal Camel/ServiceMix API's to usetheHttpMethodBase.getResponseBody()
instead ofHttpMethodBase#getResponseBodyAsStream() .
You will mostlikely need towrap the HttpMethodBase.getResponseBody() call in ajava.io.ByteArrayInputStream
if you do not want to modifythe source codetoo much.Example API replacement:replace HttpMethodBase.getResponseBodyAsStream()with newByteArrayInputStream(HttpMethodBase.getResponse())I also found these threads and JIRA tickets which may berelated to theserver sending a chunked response.Fuse JIRA
ESB-73Hope this helps and good luck!Thanks,Trevorsandeep reddy wrote:Hi,I am still facing this same problem and I am notable to resolve it.Please provide some advice on how to solve this or atleast a workaround.This is very important so please help us.Thanks,Sandeepsandeep reddy wrote:Can you pinpoint the messages that are causingthis error?This is the response message from Externalapplication:when it is success:&?xml version='1.0'encoding='UTF-8'?&&response&&message&passwordchanged&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0'encoding='UTF-8'?&&response&&message&InternalServer Error: failed to changepassword&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with responsemessage.And we are pretty surethat message is not creating any sought of problembecause if message isnot proper it should fail for each time. And itworks fine having DEBUGlevel in log4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure thatproperly (not related toyour current question, but the defaultconfiguration just writes amessage to the log when things go wrong withoutinformation the JBIendpoint).Yes we are using Dead letter channel, and itis configuredproperly.This is camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ErrorConstants.SYSTEM_ERROR+&&/status&&message&SystemError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ErrorConstants.SOCKET_ERROR+&&/status&&message&ConnectionError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//addedhere.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);//added here}--View this message in context:Sent from the ServiceMix - User mailing list archive at.
I may have missed something about the actual problem, but imho, itcomes from a bad use of the incoming message exchange.
ServiceMixcomponents take care about either:* reading the source only once so that such problem don't happen* in case where the source needs to be read multiple times, convertit to a re-readable sourceI don't think forcing a re-readable source (using a StringSource orwhatever implementation) on the servicemix-http is a good thing.Actually, I think this would be a very bad idea, as you would not beable to support large requests concurrently.We may want to do that in servicemix-camel instead if there is arequirement, but I think the conversion of the source to a DOM sourceshould solve most problems.
Or should be change the default behaviorfor servicemix-camel and maybe add a property on the consumer to allownot transforming the content ?On Thu, Sep 4, 2008 at 7:23 PM, quan tran wrote:All,I wonder if someone has some ideas on this.
Any advices or document are appriciated.ThanksQuan--- On Thu, 9/4/08, tpounds wrote:From: tpounds &trevor.&Subject: Re: RuntimeCamelException: java.io.IOException:Attempted read on closed streamTo: users@servicemix.apache.orgDate: Thursday, September 4,
PMSandeep,This problem bit us not too long ago and I figured out why.SinceServiceMix makes use of of an InputStream (see:by mulitplecomponents, it requires that the InputStream being returnedcan be readmultiple times if the message is being used (i.e. parsedfor logic, etc.) bymultiple components.
This is the reason the wiki page saysto make use ofthe StringSource so that a String buffer is stored inmemory to allow formultiple reads of the response.
The reason your inputstream cannot be readmultiple times is because the returned server objects is ofthe typemons.io.input.AutoCloseInputStream .from the AutoCloseInputStream Javadoc:Proxy stream that closes and discards the underlyingstream as soon as theend of input has been reached or when the stream isexplicitly closed. Noteven a reference to the underlying stream is keptafter it has beenclosed, so any allocated in-memory buffers can befreed even if the clientapplication still keeps a reference to the proxy stream.There are 2 reasons the AutoCloseInputStream is being usedto wrap the HTTPserver response:1) The HTTP API being used is the Apache HTTP CommonsClient and it hasspecial rules to wrap the server responses in differentinput streamsdepending on the response headers.2) The HTTP response coming from the Server is most likelyusing the'Transfer-Encoding:chunked'
Use a program like Wiresharkor
to monitor theresponse to see ifthis is the case.
I have a high degree of confidence thatit is.
When theserver responds with a chunked encoding the HTTP Commonsclient wraps theresponse with aChunkedInputStream
enclosed in an AutoCloseInputStreamobject.There are a few ways this can be fixed:1) Change your server to respond using the normal'Content-Length: XXX'header instead of 'Transfer-Encoding: chunked'.This will cause the HTTPcommons client to return a different InputStream type whichcan be read frommultiple times.2) Modify the internal Camel/ServiceMix API's to usetheHttpMethodBase.getResponseBody()
instead ofHttpMethodBase#getResponseBodyAsStream() .
You will mostlikely need towrap the HttpMethodBase.getResponseBody() call in ajava.io.ByteArrayInputStream
if you do not want to modifythe source codetoo much.Example API replacement:replace HttpMethodBase.getResponseBodyAsStream()with newByteArrayInputStream(HttpMethodBase.getResponse())I also found these threads and JIRA tickets which may berelated to theserver sending a chunked response.Fuse JIRA
ESB-73Hope this helps and good luck!Thanks,Trevorsandeep reddy wrote:Hi,I am still facing this same problem and I am notable to resolve it.Please provide some advice on how to solve this or atleast a workaround.This is very important so please help us.Thanks,Sandeepsandeep reddy wrote:Can you pinpoint the messages that are causingthis error?This is the response message from Externalapplication:when it is success:&?xml version='1.0'encoding='UTF-8'?&&response&&message&passwordchanged&/message&&status&0&/status&&/response&when it is error:&?xml version='1.0'encoding='UTF-8'?&&response&&message&InternalServer Error: failed to changepassword&/message&&status&1000&/status&&/response&Is there anything special to them?There is nothing special with responsemessage.And we are pretty surethat message is not creating any sought of problembecause if message isnot proper it should fail for each time. And itworks fine having DEBUGlevel in log4j.xml file.BTW, I see you are using the Camel deadletter channel.
Make sure you configure thatproperly (not related toyour current question, but the defaultconfiguration just writes amessage to the log when things go wrong withoutinformation the JBIendpoint).Yes we are using Dead letter channel, and itis configuredproperly.This is camel configure method:public void configure() {exception(java.lang.Throwable.class).setBody(constant(&&response&&status&&+ErrorConstants.SYSTEM_ERROR+&&/status&&message&SystemError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);exception(java.net.SocketException.class).setBody(constant(&&response&&status&&+ErrorConstants.SOCKET_ERROR+&&/status&&message&ConnectionError&/message&&/response&&)).to(&jbi:service:/operations/changepassword/ResponseGeneratorService?mep=in-out&);from(&jbi:service:/operations/changepassword/RoutingService&).convertBodyTo(DOMSource.class)
//addedhere.choice().when(header(&userPrincipals&).contains(&director&)).to(&jbi:service:/operations/changepassword/PortalService?mep=in-out&).convertBodyTo(DOMSource.class)//added here.when(header(&userPrincipals&).contains(&portal&)).to(&jbi:service:/operations/changepassword/DirectorService?mep=in-out&).convertBodyTo(DOMSource.class);//added here}--View this message in context:Sent from the ServiceMix - User mailing list archive at.--Cheers,Guillaume Nodet------------------------Blog:
Related Discussions
viewthread |
categories
user style
6 users in discussion
site design / logo & 2016 Grokbase

我要回帖

更多关于 wstx asl 3.2.4.jar 的文章

 

随机推荐