camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Problem using unit test + spring + cxf
Date Wed, 16 Jan 2013 08:15:20 GMT
There is an known issue that jetty server will not accept the request if you restart it in
the same JVM , due to the HTTP keep alive. You may consider to start the application context
per test class.

发自我的 iPhone

在 2013-1-16,下午2:50,Charles Moulliard <ch007m@gmail.com> 写道:

> Hi,
> 
> I have 2 unit tests that I can run perfectly but when they are run during
> mvn test phase, one of the two fails for the following reason
> 
> - Both class extends extends CamelSpringTestSupport
> - They override createApplicationContext()
> 
> Could it be related to the timeout issue with Jetty Server when it has been
> created in a previous Test but within same JVM ?
> 
> java.lang.IllegalStateException: BeanFactory not initialized or already
> closed - call 'refresh' before accessing beans via the ApplicationContext
> at
> org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
> at
> org.springframework.context.support.AbstractApplicationContext.containsBean(AbstractApplicationContext.java:1091)
> at
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:145)
> at
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:115)
> at
> org.apache.cxf.frontend.ClientProxyFactoryBean.configureObject(ClientProxyFactoryBean.java:104)
> at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:131)
> at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:156)
> at
> com.redhat.fuse.example.camel.WebServiceAuthenticateCustomerUsingRealmTest.createCXFClient(WebServiceAuthenticateCustomerUsingRealmTest.java:73)
> at
> com.redhat.fuse.example.camel.WebServiceAuthenticateCustomerUsingRealmTest.testGetAllCustomers(WebServiceAuthenticateCustomerUsingRealmTest.java:87)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
> 
> Regards
> 
> -- 
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Mime
View raw message