我正在使用Jetty并在我的构建服务器上遇到以下问题(我的开发机器上没有它。)
2013-07-22 14:19:20,647972350: WARN : org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://rs.rtiservice.esi.v21.xxxx.com/}RTIServiceRSI has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
<SNIP>
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking http://localhost:25000/esi-rtiservice/ESI/RTIService/rs-rtiservice/addLineItem/: Read timed out
<SNIP>
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 104 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
<SNIP>
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1308)
... 107 more
2013-07-22 14:19:20,654681221: ERROR : [qtp23135205-124] com.xxx.v21.mpos.MPOSEndPoint: System error
javax.ws.rs.NotAuthorizedException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
<SNIP>
at java.lang.Thread.run(Thread.java:662)
2013-07-22 14:19:20,656234277: WARN : org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://mpos.v21.xxx.com/}MPOSEndPoint has thrown exception, unwinding now
java.lang.IllegalStateException: WRITER
at org.eclipse.jetty.server.Response.getOutputStream(Response.java:673)
<SNIP>
at java.lang.Thread.run(Thread.java:662)
2013-07-22 14:19:20,658931461: WARN : [qtp23135205-124] org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://mpos.v21.xxx.com/}MPOSEndPoint has thrown exception, unwinding now
java.lang.IllegalStateException: WRITER
at org.eclipse.jetty.server.Response.getOutputStream(Response.java:673)
at org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:564)
现在我可以看到有人说我需要在我的连接上设置ReceiveTimeout
。1
这些人似乎没有像我这样NotAuthorizedException
。
我看到的所有例子都是这样的:
<http-conf:destination
name="{http://apache.org/hello_world_soap_http}SoapPort.http-destination">
<http-conf:server ReceiveTimeout="30000"
HonorKeepAlive="true" />
</http-conf:destination>
相反,我已经定义了这样的:
<jaxrs:client id="itemService" address="http://${itemservice.address}/esi-itemservice/ESI/ItemService" serviceClass="com.xxx.v21.esi.itemservice.rs.ItemServiceRSI" inheritHeaders="true">
<jaxrs:headers>
<entry key="Accept" value="application/xml" />
</jaxrs:headers>
<jaxrs:providers>
<ref bean="jaxbextprovider" />
</jaxrs:providers>
</jaxrs:client>
有人可以告诉我如何在我的连接上设置ReceiveTimeout
- 或者给我一些别的东西可以继续吗?
答案 0 :(得分:-1)
我没有找到原因,但我所做的工作是在我的集成测试中从Jetty切换到开始使用Cargo下载Tomcat,安装工件/战争并运行测试。
货物正在进行5秒测试,Jetty需要5分钟!所以他们现在都跑了,跑了2分钟,差不多一个小时!
简而言之,请查看Cargo(cargo.codehaus.org)
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.5</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<zipUrlInstaller>
<url>ftp://x.x.x.x/install_pack/Tomcat7/tomcat7.zip</url>
<downloadDir>${project.build.directory}/cargo/downloads</downloadDir>
</zipUrlInstaller>
<output>${project.build.directory}/cargo/container.log</output>
<append>false</append>
<log>${project.build.directory}/cargo/cargo.log</log>
<timeout>240000</timeout>
<systemProperties>
<logLevel>INFO</logLevel>
<itemservice.address>localhost:9080</itemservice.address>
<deviceservice.address>localhost:9080</deviceservice.address>
<userservice.address>localhost:9080</userservice.address>
<rtiservice.address>localhost:9080</rtiservice.address>
<corporateservice.address>localhost:9080</corporateservice.address>
</systemProperties>
</container>
<configuration>
<properties>
<cargo.servlet.port>9080</cargo.servlet.port>
<cargo.tomcat.ajp.port>9085</cargo.tomcat.ajp.port>
<cargo.jvmargs>-XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
<cargo.logging>high</cargo.logging>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.test</groupId>
<artifactId>test-war</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>