- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我对以下客户端代码有一些问题。
private FlightSchedule loadFlightSchedule() throws ServiceException {
if (flightSchedule == null) {
logger.debug("flightSchedule is null in loadFlightSchedule");
String endPoint = null;
String userId = null;
String password = null;
try {
endPoint = getProperty("schedule_url") + "?wsdl";
logger.debug("In loadFlightSchedule, flightSchedule endPoint is " + endPoint);
userId = getProperty("schedule_username");
password = getProperty("schedule_password");
}
catch( Exception ex ) {
logger.error("Exception in loadFlightSchedule getting properties from configProps...");
throw new ServiceException("Unable to get endpoint for FlightSchedule from Config...");
}
URL url = null;
try {
url = new URL (endPoint);
}
catch( MalformedURLException e ) {
logger.error("Exception in loadFlightSchedule creating URL...");
throw new ServiceException("Unable to build FlightSchedule url from the endpoint.", e );
}
try {
flightSchedule = new FlightScheduleService(url, flightScheduleName).getFlightSchedulePort();
//((BindingProvider)flightSchedulePort).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, new Integer(300000));
((BindingProvider)flightSchedule).getRequestContext().put("javax.xml.ws.client.connectionTimeout", new Integer (300000));
((BindingProvider)flightSchedule).getResponseContext().put("javax.xml.ws.client.receiveTimeout", new Integer (100000));
((BindingProvider)flightSchedule).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userId );
((BindingProvider)flightSchedule).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password );
}
catch( Exception ex ) {
logger.error("Exception in loadFlightSchedule getting FlightSchedulePort...");
ex.printStackTrace();
throw new ServiceException("Unable to get FlightSchedule service.", ex );
}
}
return flightSchedule;
}
我一直收到以下错误消息。
04:31:05,085 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (EJB default - 7) Interceptor for {http://airways.com}FlightScheduleService#{http://airways.com}getCancelledFlightsFromPreviousDay 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)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:461)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:364)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
at com.sun.proxy.$Proxy111.getCancelledFlightsFromPreviousDay(Unknown Source)
at com.airways.pdlloader.services.clients.FlightScheduleClient.getAllFlightsFromService(FlightScheduleClient.java:42) [pdl-loader-ejb-1.0.jar:]
at com.airways.pdlloader.App.load(App.java:82) [pdl-loader-ejb-1.0.jar:]
at com.airways.pdlloader.App.automatedLoad(App.java:67) [pdl-loader-ejb-1.0.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_40]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:34) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:34) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:105) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:56) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:101) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.timerservice.task.CalendarTimerTask.callTimeout(CalendarTimerTask.java:60) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.7.0_40]
at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_40]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking http://devetc-flights.lcc.airways.com:12080/schedule/FlightSchedule: Read timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.7.0_40]
at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.7.0_40]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1430)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1415)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:648)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 59 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method) [rt.jar:1.7.0_40]
at java.net.SocketInputStream.read(Unknown Source) [rt.jar:1.7.0_40]
at java.net.SocketInputStream.read(Unknown Source) [rt.jar:1.7.0_40]
at java.io.BufferedInputStream.fill(Unknown Source) [rt.jar:1.7.0_40]
at java.io.BufferedInputStream.read1(Unknown Source) [rt.jar:1.7.0_40]
at java.io.BufferedInputStream.read(Unknown Source) [rt.jar:1.7.0_40]
at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source) [rt.jar:1.7.0_40]
at sun.net.www.http.HttpClient.parseHTTP(Unknown Source) [rt.jar:1.7.0_40]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) [rt.jar:1.7.0_40]
at java.net.HttpURLConnection.getResponseCode(Unknown Source) [rt.jar:1.7.0_40]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1541)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1493)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1401)
... 62 more
04:31:05,248 FINER [com.airways.configprops.ConfigResourceBundle] (EJB default - 7) Config service URL is: http://devetc-config.lcc.airways.com:11080/configuration/ConfigurationService
04:31:05,265 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (EJB default - 7) Creating Service {http://airways.com}ConfigurationServiceService from WSDL: http://devetc-config.lcc.airways.com:11080/configuration/ConfigurationService?wsdl
04:31:10,460 ERROR [com.airways.pdlloader.App] (EJB default - 7) *****General Exception occurred in load. Transaction successfully rolled back. Printing stack trace...
04:31:10,461 ERROR [stderr] (EJB default - 7) javax.xml.ws.WebServiceException: Could not send Message.
04:31:10,462 ERROR [stderr] (EJB default - 7) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
04:31:10,463 ERROR [stderr] (EJB default - 7) at com.sun.proxy.$Proxy111.getCancelledFlightsFromPreviousDay(Unknown Source)
04:31:10,464 ERROR [stderr] (EJB default - 7) at com.usairways.pdlloader.services.clients.FlightScheduleClient.getAllFlightsFromService(FlightScheduleClient.java:42)
04:31:10,465 ERROR [stderr] (EJB default - 7) at com.usairways.pdlloader.App.load(App.java:82)
04:31:10,465 ERROR [stderr] (EJB default - 7) at com.usairways.pdlloader.App.automatedLoad(App.java:67)
04:31:10,466 ERROR [stderr] (EJB default - 7) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
04:31:10,467 ERROR [stderr] (EJB default - 7) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
04:31:10,468 ERROR [stderr] (EJB default - 7) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
04:31:10,468 ERROR [stderr] (EJB default - 7) at java.lang.reflect.Method.invoke(Unknown Source)
04:31:10,469 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
04:31:10,471 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,472 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)
04:31:10,473 ERROR [stderr] (EJB default - 7) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127)
04:31:10,474 ERROR [stderr] (EJB default - 7) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137)
04:31:10,475 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:34)
04:31:10,476 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,477 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
04:31:10,478 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:34)
04:31:10,479 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,480 ERROR [stderr] (EJB default - 7) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
04:31:10,481 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,482 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:105)
04:31:10,483 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:56)
04:31:10,484 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,485 ERROR [stderr] (EJB default - 7) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:101)
04:31:10,486 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,487 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
04:31:10,488 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,616 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
04:31:10,617 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
04:31:10,618 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,619 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
04:31:10,620 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,621 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
04:31:10,622 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,623 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76)
04:31:10,624 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,625 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
04:31:10,626 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,627 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:43)
04:31:10,629 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,630 ERROR [stderr] (EJB default - 7) at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
04:31:10,631 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
04:31:10,632 ERROR [stderr] (EJB default - 7) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
04:31:10,633 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.timerservice.TimedObjectInvokerImpl.callTimeout(TimedObjectInvokerImpl.java:101)
04:31:10,634 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.timerservice.task.CalendarTimerTask.callTimeout(CalendarTimerTask.java:60)
04:31:10,635 ERROR [stderr] (EJB default - 7) at org.jboss.as.ejb3.timerservice.task.TimerTask.run(TimerTask.java:132)
04:31:10,636 ERROR [stderr] (EJB default - 7) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
04:31:10,637 ERROR [stderr] (EJB default - 7) at java.util.concurrent.FutureTask.run(Unknown Source)
04:31:10,637 ERROR [stderr] (EJB default - 7) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
04:31:10,638 ERROR [stderr] (EJB default - 7) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
04:31:10,639 ERROR [stderr] (EJB default - 7) at java.lang.Thread.run(Unknown Source)
04:31:10,640 ERROR [stderr] (EJB default - 7) at org.jboss.threads.JBossThread.run(JBossThread.java:122)
04:31:10,640 ERROR [stderr] (EJB default - 7) Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking http://devetc-flights.lcc.airways.com:12080/schedule/FlightSchedule: Read timed out
04:31:10,642 ERROR [stderr] (EJB default - 7) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
04:31:10,643 ERROR [stderr] (EJB default - 7) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
04:31:10,644 ERROR [stderr] (EJB default - 7) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
04:31:10,644 ERROR [stderr] (EJB default - 7) at java.lang.reflect.Constructor.newInstance(Unknown Source)
04:31:10,645 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1430)
04:31:10,674 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1415)
04:31:10,675 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
04:31:10,676 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:648)
04:31:10,676 ERROR [stderr] (EJB default - 7) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
04:31:10,678 ERROR [stderr] (EJB default - 7) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
04:31:10,679 ERROR [stderr] (EJB default - 7) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
04:31:10,679 ERROR [stderr] (EJB default - 7) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:461)
04:31:10,680 ERROR [stderr] (EJB default - 7) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:364)
04:31:10,681 ERROR [stderr] (EJB default - 7) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317)
04:31:10,682 ERROR [stderr] (EJB default - 7) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
04:31:10,682 ERROR [stderr] (EJB default - 7) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
04:31:10,683 ERROR [stderr] (EJB default - 7) ... 52 more
04:31:10,684 ERROR [stderr] (EJB default - 7) Caused by: java.net.SocketTimeoutException: Read timed out
04:31:10,684 ERROR [stderr] (EJB default - 7) at java.net.SocketInputStream.socketRead0(Native Method)
04:31:10,685 ERROR [stderr] (EJB default - 7) at java.net.SocketInputStream.read(Unknown Source)
04:31:10,686 ERROR [stderr] (EJB default - 7) at java.net.SocketInputStream.read(Unknown Source)
04:31:10,687 ERROR [stderr] (EJB default - 7) at java.io.BufferedInputStream.fill(Unknown Source)
04:31:10,687 ERROR [stderr] (EJB default - 7) at java.io.BufferedInputStream.read1(Unknown Source)
04:31:10,688 ERROR [stderr] (EJB default - 7) at java.io.BufferedInputStream.read(Unknown Source)
04:31:10,689 ERROR [stderr] (EJB default - 7) at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
04:31:10,689 ERROR [stderr] (EJB default - 7) at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
04:31:10,690 ERROR [stderr] (EJB default - 7) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
04:31:10,691 ERROR [stderr] (EJB default - 7) at java.net.HttpURLConnection.getResponseCode(Unknown Source)
04:31:10,692 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1541)
04:31:10,693 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1493)
04:31:10,694 ERROR [stderr] (EJB default - 7) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1401)
04:31:10,695 ERROR [stderr] (EJB default - 7) ... 62 more
我在我的代码中添加了超时以及我在 standalone.xml 中增加了套接字超时
<subsystem xmlns="urn:jboss:domain:transactions:1.1">
<core-environment>
<process-id>
<uuid/>
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
<coordinator-environment default-timeout="100000"/>
</subsystem>
非常感谢您对此问题的任何帮助。提前致谢!
最佳答案
所以你的超时时间太短,或者服务器端出了点问题,所以你的超时时间被触发了。
超时间隔应该足够长,以便服务器有足够的时间来做它必须做的事情,所以超时真的意味着服务器故障,而不仅仅是加载的服务器或复杂的请求。您可以首先将其设置为预期服务时间的两倍,但如果服务时间差异很大,则可能需要反复试验才能确定正确的值。您需要与均值相差超过三个标准差,以便包含尽可能多的成功案例。
说了这么多,你有 100 秒,对于大多数用途来说应该足够了。所以也许这真的是服务器故障。您必须检查服务器日志才能确定。
关于java - 网络服务失败。 java.net.SocketTimeoutException : Read timed out - Using Jboss 7. 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25966025/
我有一个给定的 FTP 服务器。我可以通过 WinSCP 和其他程序连接到服务器。我已经通过 Java 连接到服务器,但过了一会儿我无法连接。根据 WinSCP,我可以一直连接。现在的问题是服务器是问
以下代码应根据是否达到超时抛出异常: public boolean isAlive(int workerNum) throws Exception { System.out.println("
我正在编写一个从服务器接收数据的 Android 应用程序。理论上不可能有互联网连接,所以我尝试通过捕获 SocketTimeoutException 来显示错误消息重试屏幕或其他内容来捕获这种情况。
我试图在我的 Android 手机上测试我的第一个应用程序,但扫描后,我收到以下错误消息: “ Uncaught Error :java.error.sockettimeoutexception:10
当客户端 A 连接到服务器 B 时,我们在服务器 B 上收到 java.net.SocketTimeoutException。不知道为什么。客户端正在向服务器发送数据,然后服务器抛出此异常。如何解决此
以下是我尝试编写的 Java 应用程序的一小部分: Socket socket = new Socket(hostname, portnumber); DataInputStream socketIn
'java.net.SocketTimeoutException:连接超时' 循环一段时间后我收到此错误。为什么我会收到 SocketTimeoutException?我该如何修复这个错误? @Ove
很抱歉,如果这已发布在我工作/寻找几天的地方。 问题: 当通过对等网络与 Android 设备进行通信时,我收到 SocketTimeoutExceptions。 详细信息: 发生这种情况时,andr
我正在尝试使用 DOT NET 网络服务将我的 Android 应用程序连接到我计算机中存在的 MySql 数据库(本地主机)。我能够仅通过单一输入 (EditText) 连接到在线数据库。这里有 3
我正在我的 android 应用程序中使用改造构建一个 Restful 客户端,但是我在尝试从我的网络服务中检索数据时遇到异常,第一次调用毫无异常(exception)地工作,但我更改了参数并重试获取
我有一个复杂的应用程序,可以从我在 AWS 上的网络服务下载大量内容。但是,我一直有 50% 的时间收到 SocketTimeoutException。根据我的研究,我怀疑可能有以下原因: 连接超时
我想在我的应用程序中使用 REST API。它为我从这个应用程序发出的所有请求抛出 SocketTimeoutException。 Logcat 输出:(您也可以在此处看到带有漂亮格式的输出:http
假设我有一个名为 SuperSocket 的套接字变量,有什么方法可以捕获超时异常吗? SuperSocket.setSoTimeout(5000); catch (Soc
我为 Retrofit 设置: private Interceptor interceptor = new Interceptor() { @Override publ
我正在尝试向服务器发送 POST 请求以获取数据,但有时会发生 SocketTimeoutException! 我使用 Ok3Client 解决了它,但我遇到了同样的异常我该如何解决它? 我的代码在下
我正在运行多个工作线程(大约 10 个)来访问来自 redis Q 的数据。 对于我正在为 Jedis Client 使用无限超时。 Jedis jedis = pool.getResource();
我有一个运行spring-boot的应用程序,可以访问mongodb 当我使用单个docker run命令时,该应用程序运行正常。但是,当我尝试将它们全部作为服务运行时,由于某种原因,该应用程序永远无
我正在开发一个 Web 应用程序,它接受来自第三方的 json 数据,处理该数据并使用处理后的 json 数据响应它们。 我在生产服务器上收到 java.net.SocketTimeoutExcept
我们正在学习使用 JSOUP 和 urlconnection,因此我们正在解析我们选择的网站中的页面,并解析页面以回答有趣的问题。 一切正常,但是时不时地我会收到 SocketTimeOutExcep
我正在编写一个小应用程序,它使用深度优先搜索通过URL扫描所有页面。所以我应该多联系。在 n 页之后,我通常会捕获 SocketTimeoutException 并且我的应用程序崩溃。那么避免这种情况
我是一名优秀的程序员,十分优秀!