3

我对以下客户端代码有一些问题。

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>

非常感谢您对此问题的任何帮助。提前致谢!

4

1 回答 1

2

所以你的超时太短了,或者服务器端出了问题,所以你的超时被触发了。

超时间隔应该足够长,以便服务器有足够的时间去做它必须做的事情,这样超时就意味着服务器故障,而不仅仅是加载的服务器或复杂的请求。您可以先将其设置为预期服务时间的两倍,但如果服务时间差异很大,则正确的值可能需要反复试验。您需要与平均值相差三个以上的标准差,以便包含尽可能多的成功案例。

说了这么多,你有 100 秒,对于大多数目的来说应该足够长了。所以也许这真的是服务器故障。您必须检查服务器日志才能确定。

于 2014-09-22T02:51:01.323 回答