You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2012/11/15 06:32:27 UTC

svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Author: ningjiang
Date: Thu Nov 15 05:32:26 2012
New Revision: 1409651

URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
Log:
Try to fix the camel-cxf related test failures

Modified:
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
    camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
@@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
         clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
         clientBean.setServiceClass(HelloService.class);
-        clientBean.setBus(BusFactory.getDefaultBus());
+        clientBean.setBus(BusFactory.newInstance().createBus());
 
         HelloService client = (HelloService) proxyFactory.create();
 

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
@@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co
 import org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.soap.SoapHeader;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ClientFactoryBean;
@@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
         ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
         clientBean.setAddress(ROUTER_ADDRESS);
-        clientBean.setServiceClass(HelloService.class); 
+        clientBean.setServiceClass(HelloService.class);
+        clientBean.setBus(BusFactory.newInstance().createBus());
         
         HelloService client = (HelloService) proxyFactory.create();
         return client;

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
@@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
         ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
         factory.setServiceClass(BareSoapService.class);
         factory.setAddress(PROXY_URL);
+        factory.setBus(BusFactory.newInstance().createBus());
         BareSoapService client = (BareSoapService) factory.create();
 
         client.doSomething();

Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
+++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
@@ -38,7 +38,8 @@ public final class Client {
         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
         clientBean.setAddress(address);
         clientBean.setServiceClass(LoanBrokerWS.class);
-        clientBean.setBus(BusFactory.getDefaultBus());
+        // just create a new bus for use
+        clientBean.setBus(BusFactory.newInstance().createBus());
         return (LoanBrokerWS) proxyFactory.create();
     }
 



Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Nov 16, 2012 at 12:08 AM, Daniel Kulp <dk...@apache.org> wrote:
>
> OK.  Was able to reproduce this with the IBM JDK 7 on Linux.
>
> I would consider this a bug in the JDK's garbage collector.   It is being overly aggressive, IMO.   The code basically looks like:
>
> client = … create client …
> try {
>     client.callMethod(…)
> } catch (Exception) {
> ..
> }
> …. never reference the client object again …
>
> At some point in there, the GC is deciding it can garbage collect the client proxy since it's never used again.   That causes the finalizer to be called which "closes" the ClientImpl which nulls out everything.   A simple fix is to add something like:
>
> client.getClass();
>
> after the call which forces the client to hang around.  But this definitely is strange behavior.   Not sure what we can do to work around it.  :-(   No idea why the GC is deciding it can be collected before the method even returns.  Not good.   It really shouldn't be garbage collecting and finalizing something that is obviously still on the stack.
>

Hmm yeah not a good situation.

Just noticed this issue as well on AIX JDK6

[aix5] $ /home/hudson/tools/maven-3.0.2/bin/mvn -f pom.xml
-Dlabel=aix5 -Djdk=jdk6 --settings /home/hudson/.m2/m3-settings.xml -V
-B -fae clean install
Apache Maven 3.0.2 (r1056850; 2011-01-08 18:58:10-0600)
Java version: 1.6.0, vendor: IBM Corporation
Java home: /usr/java6_64/jre
Default locale: en_US, platform encoding: ISO8859-1
OS name: "aix", version: "5.3", arch: "ppc64", family: "unix"




Failed

org.apache.camel.loanbroker.webservice.version.LoanBrokerWSTest.testInvocation

Failing for the past 1 build (Since #24 )
Took 10 sec.
add description
Stacktrace

java.lang.NullPointerException
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)
	at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
	at $Proxy66.getLoanQuote(Unknown Source)
	at org.apache.camel.loanbroker.webservice.version.LoanBrokerWSTest.testInvocation(LoanBrokerWSTest.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	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:30)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
	at org.junit.rules.RunRules.evaluate(RunRules.java:18)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:119)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
	at $Proxy0.invoke(Unknown Source)
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:74)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)


>
>
> Dan
>
>
>
>
>
>
>
>
>
> On Nov 15, 2012, at 2:51 PM, Daniel Kulp <dk...@apache.org> wrote:
>
>>
>> On Nov 15, 2012, at 9:09 AM, Willem jiang <wi...@gmail.com> wrote:
>>> The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
>>> As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)
>>>
>>> I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this
>>>
>>> Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
>>> java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720)
>>> at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
>>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
>>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351)
>>> at java.lang.Thread.run(Thread.java:779)
>>> Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
>>> testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR!
>>> java.lang.NullPointerException
>>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369)
>>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
>>> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)
>>> at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
>>> at $Proxy28.sayHiWithException(Unknown Source)
>>
>> The Bus would be null at this point.   Not sure how that can happen.  It's one of two things:
>>
>> 1) The bus is passed in as null, which would be really bad
>> 2) The client has been destroyed, thus making the bus null.
>>
>> I would breakpoint the constructors (or add a "assert bus != null" line there, the test should be enabling assertions) and if it's null, try and figure that out.
>>
>> Dan
>>
>>
>>
>>
>>>
>>>
>>> Any suggestion is appreciated.
>>>
>>> --
>>> Willem Jiang
>>>
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://www.fusesource.com | http://www.redhat.com
>>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>>>         http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
>>> Twitter: willemjiang
>>> Weibo: willemjiang
>>>
>>>
>>>
>>> On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:
>>>
>>>> Hi
>>>>
>>>> Dan thanks for sharing this. I guess we should go over the example
>>>> tests and make sure they shutdown properly.
>>>> Those tests Willem is trying to fix, hasn't been surfaced as often, as
>>>> these tests is run last.
>>>> And as many times the CI server may not get so far.
>>>>
>>>> What we have seen is that these tests fails more often on AIX, than
>>>> the other platforms.
>>>> Though we reached the end of the test suite (eg it was able to attempt
>>>> all tests)
>>>>
>>>> So we (I guess its my work to do) can enable the AIX tests again, as
>>>> we have a "complete picture" now, where those examples tests are the
>>>> last issues covered.
>>>>
>>>> BTW: Any chance you guys have seen AIX test failures in Apache CXF
>>>> project itself? And if so do you guys run on both Java6 and Java7?
>>>>
>>>> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
>>>> effect of something else.
>>>>
>>>> 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
>>>> - Interceptor for
>>>> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
>>>> has thrown exception, unwinding now
>>>> java.lang.NullPointerException
>>>> at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
>>>>
>>>>
>>>>
>>>> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
>>>>>
>>>>> Willem,
>>>>>
>>>>> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
>>>>>
>>>>> More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>>>>>
>>>>> Dan
>>>>>
>>>>>
>>>>>
>>>>> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
>>>>>
>>>>>> Author: ningjiang
>>>>>> Date: Thu Nov 15 05:32:26 2012
>>>>>> New Revision: 1409651
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>>>>>> Log:
>>>>>> Try to fix the camel-cxf related test failures
>>>>>>
>>>>>> Modified:
>>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>>> camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>>>
>>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>>> ==============================================================================
>>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>>>>>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>>> clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>>>>> clientBean.setServiceClass(HelloService.class);
>>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>>>
>>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>>>
>>>>>>
>>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>>> ==============================================================================
>>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>>>>>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
>>>>>> import org.apache.camel.converter.jaxp.XmlConverter;
>>>>>> import org.apache.camel.impl.DefaultCamelContext;
>>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>>> +import org.apache.cxf.BusFactory;
>>>>>> import org.apache.cxf.binding.soap.SoapHeader;
>>>>>> import org.apache.cxf.endpoint.Server;
>>>>>> import org.apache.cxf.frontend.ClientFactoryBean;
>>>>>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>>>>> ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>>> clientBean.setAddress(ROUTER_ADDRESS);
>>>>>> - clientBean.setServiceClass(HelloService.class);
>>>>>> + clientBean.setServiceClass(HelloService.class);
>>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>>>
>>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>>> return client;
>>>>>>
>>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>>> ==============================================================================
>>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>>>>>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>>>>>> import org.apache.camel.builder.RouteBuilder;
>>>>>> import org.apache.camel.test.AvailablePortFinder;
>>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>>> +import org.apache.cxf.BusFactory;
>>>>>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>>>>>> import org.junit.BeforeClass;
>>>>>> import org.junit.Test;
>>>>>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>>>>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>>>>> factory.setServiceClass(BareSoapService.class);
>>>>>> factory.setAddress(PROXY_URL);
>>>>>> + factory.setBus(BusFactory.newInstance().createBus());
>>>>>> BareSoapService client = (BareSoapService) factory.create();
>>>>>>
>>>>>> client.doSomething();
>>>>>>
>>>>>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>>> ==============================================================================
>>>>>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>>>>>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>>>>>> @@ -38,7 +38,8 @@ public final class Client {
>>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>>> clientBean.setAddress(address);
>>>>>> clientBean.setServiceClass(LoanBrokerWS.class);
>>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>>> + // just create a new bus for use
>>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>>> return (LoanBrokerWS) proxyFactory.create();
>>>>>> }
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Daniel Kulp
>>>>> dkulp@apache.org - http://dankulp.com/blog
>>>>> Talend Community Coder - http://coders.talend.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -----------------
>>>> Red Hat, Inc.
>>>> FuseSource is now part of Red Hat
>>>> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
>>>> Web: http://fusesource.com
>>>> Twitter: davsclaus
>>>> Blog: http://davsclaus.com
>>>> Author of Camel in Action: http://www.manning.com/ibsen
>>>
>>>
>>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 15, 2012, at 9:01 PM, Willem jiang <wi...@gmail.com> wrote:
> Thanks for sharing this. I check the code of CXF, the ClientProxy has the finalize() method, I think JDK calling it before GC is kicked[1].
> " After a finalizer is invoked, objects are not freed right away. This is because a finalizer method can resurrect an object by storing the this pointer somewhere so that the object once again has references. Thus, after finalize() is called, the garbage collector must once again determine that the object is unreferenced before it can garbage-collect it. "
> 
> But I still not quite sure why the finalize() is called when the proxy invoke method is called, maybe IBM JDK GC is too aggressive.  

The IBM JDK/JIT is doing some really awesome stack analysis and removing references off the stack once it knows it's not needed in the current stack frame anymore.   This is AWESOME and something I've wished the JDK's would do for years.    This opens up a bunch of potential optimizations in CXF that I haven't bothered pursing due to the lack of support for this in any of the JDK's I've ever tested with.   As an example, if you have CXF code like:

MyBigJAXBObject obj = createSomeHugeTreeOfJAXBThings(….);
MyResult result = client.sendObject(obj);

With CXF, if we are careful, once we are done writing "obj" out to streams, we could discard it (remove the contents list from the request message) which could allow the gc to completely remove that from memory.  However, I never pursued that because with all the other JDK's, since the reference to it is on the stack, (both as the "obj" above and also as params in the "invoke" method of the proxy handler)  it wouldn't get collected.   With the IBM JDK, this looks like it may actually be possible now.    


In any case, what's happing is that in ClientProxy.invoke(…), we're doing something like:


public Object invoke(….) {
    …..
    return clientImpl.invokeSync(….);
}

Once the invokeSync is entered, the "this" for the ClientProxy isn't needed on the stack anymore and thus the stack is cleaned up.   Likewise, the original call to "client.echo(…)" results in the "client" not being needed so that is removed from the stack.   Thus, ClientProxy has no references and can be removed.

I've made a "workaround" in ClientProxy to do:

public Object invoke(….) {
    …..
    Object obj = clientImpl.invokeSync(….);
    obj = adjustObject(obj);
    return obj;
}
protected Object adjustObject(obj) {
    return obj;
}

which seems to work.   The call to "invokeSync" must keep the "this" reference on the stack so it can call the virtual adjustObject method after the return.   That seems to allow things to work significantly better. 

In any case, I now have all the CXF unit tests running "most of the time" with the IBM7 JDK.   There are some problems in the ws-security system tests with some of the GSM algorithms.  I'll need to follow up with Colm about those.    There are a couple other random failure stragglers that I'm trying to look at, but I think I got the big ones.   Many of the issues were related to things in WSDL/IDL being generated in different orders, type names being picked up different due to the difference in the reflection ordering, etc… Those were definitely all test issues.   Another class of stuff is related to the garbage collector being very aggressive.    The IBM gc apparently runs very often so discarded clients are collected sooner resulting in their close being called sooner.   For "decoupled" clients, that then shuts down the decoupled port which could then result in the "next" test that wants to use that port to fail.   I've fixed as many of those as I could be making sure each test:

1) calls the close() on the client specifically when done.   The tests should cleanup after themselves.   
2) Make sure each test dynamically grabs it's own ports.

I've likely missed a bunch of those, but the tests are now running again which is a good start.

Anyway, the next snapshot builds should have a bunch of fixes in place that should hopefully work better.      I likely won't have time to look into the camel side of things next week, but possibly after Thanksgiving unless someone beats me to it.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 15, 2012, at 9:01 PM, Willem jiang <wi...@gmail.com> wrote:
> Thanks for sharing this. I check the code of CXF, the ClientProxy has the finalize() method, I think JDK calling it before GC is kicked[1].
> " After a finalizer is invoked, objects are not freed right away. This is because a finalizer method can resurrect an object by storing the this pointer somewhere so that the object once again has references. Thus, after finalize() is called, the garbage collector must once again determine that the object is unreferenced before it can garbage-collect it. "
> 
> But I still not quite sure why the finalize() is called when the proxy invoke method is called, maybe IBM JDK GC is too aggressive.  

The IBM JDK/JIT is doing some really awesome stack analysis and removing references off the stack once it knows it's not needed in the current stack frame anymore.   This is AWESOME and something I've wished the JDK's would do for years.    This opens up a bunch of potential optimizations in CXF that I haven't bothered pursing due to the lack of support for this in any of the JDK's I've ever tested with.   As an example, if you have CXF code like:

MyBigJAXBObject obj = createSomeHugeTreeOfJAXBThings(….);
MyResult result = client.sendObject(obj);

With CXF, if we are careful, once we are done writing "obj" out to streams, we could discard it (remove the contents list from the request message) which could allow the gc to completely remove that from memory.  However, I never pursued that because with all the other JDK's, since the reference to it is on the stack, (both as the "obj" above and also as params in the "invoke" method of the proxy handler)  it wouldn't get collected.   With the IBM JDK, this looks like it may actually be possible now.    


In any case, what's happing is that in ClientProxy.invoke(…), we're doing something like:


public Object invoke(….) {
    …..
    return clientImpl.invokeSync(….);
}

Once the invokeSync is entered, the "this" for the ClientProxy isn't needed on the stack anymore and thus the stack is cleaned up.   Likewise, the original call to "client.echo(…)" results in the "client" not being needed so that is removed from the stack.   Thus, ClientProxy has no references and can be removed.

I've made a "workaround" in ClientProxy to do:

public Object invoke(….) {
    …..
    Object obj = clientImpl.invokeSync(….);
    obj = adjustObject(obj);
    return obj;
}
protected Object adjustObject(obj) {
    return obj;
}

which seems to work.   The call to "invokeSync" must keep the "this" reference on the stack so it can call the virtual adjustObject method after the return.   That seems to allow things to work significantly better. 

In any case, I now have all the CXF unit tests running "most of the time" with the IBM7 JDK.   There are some problems in the ws-security system tests with some of the GSM algorithms.  I'll need to follow up with Colm about those.    There are a couple other random failure stragglers that I'm trying to look at, but I think I got the big ones.   Many of the issues were related to things in WSDL/IDL being generated in different orders, type names being picked up different due to the difference in the reflection ordering, etc… Those were definitely all test issues.   Another class of stuff is related to the garbage collector being very aggressive.    The IBM gc apparently runs very often so discarded clients are collected sooner resulting in their close being called sooner.   For "decoupled" clients, that then shuts down the decoupled port which could then result in the "next" test that wants to use that port to fail.   I've fixed as many of those as I could be making sure each test:

1) calls the close() on the client specifically when done.   The tests should cleanup after themselves.   
2) Make sure each test dynamically grabs it's own ports.

I've likely missed a bunch of those, but the tests are now running again which is a good start.

Anyway, the next snapshot builds should have a bunch of fixes in place that should hopefully work better.      I likely won't have time to look into the camel side of things next week, but possibly after Thanksgiving unless someone beats me to it.


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Willem jiang <wi...@gmail.com>.
Hi Dan,

Thanks for sharing this. I check the code of CXF, the ClientProxy has the finalize() method, I think JDK calling it before GC is kicked[1].
" After a finalizer is invoked, objects are not freed right away. This is because a finalizer method can resurrect an object by storing the this pointer somewhere so that the object once again has references. Thus, after finalize() is called, the garbage collector must once again determine that the object is unreferenced before it can garbage-collect it. "


But I still not quite sure why the finalize() is called when the proxy invoke method is called, maybe IBM JDK GC is too aggressive.  

[1]http://docstore.mik.ua/orelly/java-ent/jnut/ch03_03.htm

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: willemjiang





On Friday, November 16, 2012 at 7:08 AM, Daniel Kulp wrote:

>  
> OK. Was able to reproduce this with the IBM JDK 7 on Linux.  
>  
> I would consider this a bug in the JDK's garbage collector. It is being overly aggressive, IMO. The code basically looks like:
>  
> client = … create client …
> try {  
> client.callMethod(…)
> } catch (Exception) {
> ..
> }
> …. never reference the client object again …
>  
> At some point in there, the GC is deciding it can garbage collect the client proxy since it's never used again. That causes the finalizer to be called which "closes" the ClientImpl which nulls out everything. A simple fix is to add something like:
>  
> client.getClass();
>  
> after the call which forces the client to hang around. But this definitely is strange behavior. Not sure what we can do to work around it. :-( No idea why the GC is deciding it can be collected before the method even returns. Not good. It really shouldn't be garbage collecting and finalizing something that is obviously still on the stack.  
>  
>  
>  
> Dan
>  
>  
>  
>  
>  
>  
>  
>  
>  
> On Nov 15, 2012, at 2:51 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
>  
> >  
> > On Nov 15, 2012, at 9:09 AM, Willem jiang <willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)> wrote:
> > > The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
> > > As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)
> > >  
> > > I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this
> > >  
> > > Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
> > > java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720)  
> > > at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
> > > at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
> > > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
> > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
> > > at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351)  
> > > at java.lang.Thread.run(Thread.java:779)  
> > > Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
> > > testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR!  
> > > java.lang.NullPointerException  
> > > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369)  
> > > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
> > > at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)  
> > > at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
> > > at $Proxy28.sayHiWithException(Unknown Source)
> >  
> >  
> >  
> > The Bus would be null at this point. Not sure how that can happen. It's one of two things:
> >  
> > 1) The bus is passed in as null, which would be really bad
> > 2) The client has been destroyed, thus making the bus null.  
> >  
> > I would breakpoint the constructors (or add a "assert bus != null" line there, the test should be enabling assertions) and if it's null, try and figure that out.  
> >  
> > Dan
> >  
> >  
> >  
> >  
> > >  
> > >  
> > > Any suggestion is appreciated.  
> > >  
> > > --  
> > > Willem Jiang
> > >  
> > > Red Hat, Inc.
> > > FuseSource is now part of Red Hat
> > > Web: http://www.fusesource.com | http://www.redhat.com
> > > Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
> > > http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> > > Twitter: willemjiang  
> > > Weibo: willemjiang
> > >  
> > >  
> > >  
> > > On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:
> > >  
> > > > Hi
> > > >  
> > > > Dan thanks for sharing this. I guess we should go over the example
> > > > tests and make sure they shutdown properly.
> > > > Those tests Willem is trying to fix, hasn't been surfaced as often, as
> > > > these tests is run last.
> > > > And as many times the CI server may not get so far.
> > > >  
> > > > What we have seen is that these tests fails more often on AIX, than
> > > > the other platforms.
> > > > Though we reached the end of the test suite (eg it was able to attempt
> > > > all tests)
> > > >  
> > > > So we (I guess its my work to do) can enable the AIX tests again, as
> > > > we have a "complete picture" now, where those examples tests are the
> > > > last issues covered.
> > > >  
> > > > BTW: Any chance you guys have seen AIX test failures in Apache CXF
> > > > project itself? And if so do you guys run on both Java6 and Java7?
> > > >  
> > > > A piece of a stracetrace shows NPE in CXF itself, but it may be a side
> > > > effect of something else.
> > > >  
> > > > 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
> > > > - Interceptor for
> > > > {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
> > > > has thrown exception, unwinding now
> > > > java.lang.NullPointerException
> > > > at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
> > > >  
> > > >  
> > > >  
> > > > On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
> > > > >  
> > > > > Willem,
> > > > >  
> > > > > If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
> > > > >  
> > > > > More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
> > > > >  
> > > > > Dan
> > > > >  
> > > > >  
> > > > >  
> > > > > On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
> > > > >  
> > > > > > Author: ningjiang
> > > > > > Date: Thu Nov 15 05:32:26 2012
> > > > > > New Revision: 1409651
> > > > > >  
> > > > > > URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
> > > > > > Log:
> > > > > > Try to fix the camel-cxf related test failures
> > > > > >  
> > > > > > Modified:
> > > > > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
> > > > > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
> > > > > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
> > > > > > camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> > > > > >  
> > > > > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
> > > > > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > > > > ==============================================================================
> > > > > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
> > > > > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
> > > > > > @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
> > > > > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > > > > clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
> > > > > > clientBean.setServiceClass(HelloService.class);
> > > > > > - clientBean.setBus(BusFactory.getDefaultBus());
> > > > > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > > > >  
> > > > > > HelloService client = (HelloService) proxyFactory.create();
> > > > > >  
> > > > > >  
> > > > > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
> > > > > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > > > > ==============================================================================
> > > > > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
> > > > > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
> > > > > > @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
> > > > > > import org.apache.camel.converter.jaxp.XmlConverter;
> > > > > > import org.apache.camel.impl.DefaultCamelContext;
> > > > > > import org.apache.camel.test.junit4.CamelTestSupport;
> > > > > > +import org.apache.cxf.BusFactory;
> > > > > > import org.apache.cxf.binding.soap.SoapHeader;
> > > > > > import org.apache.cxf.endpoint.Server;
> > > > > > import org.apache.cxf.frontend.ClientFactoryBean;
> > > > > > @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
> > > > > > ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
> > > > > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > > > > clientBean.setAddress(ROUTER_ADDRESS);
> > > > > > - clientBean.setServiceClass(HelloService.class);
> > > > > > + clientBean.setServiceClass(HelloService.class);
> > > > > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > > > >  
> > > > > > HelloService client = (HelloService) proxyFactory.create();
> > > > > > return client;
> > > > > >  
> > > > > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
> > > > > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > > > > ==============================================================================
> > > > > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
> > > > > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
> > > > > > @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
> > > > > > import org.apache.camel.builder.RouteBuilder;
> > > > > > import org.apache.camel.test.AvailablePortFinder;
> > > > > > import org.apache.camel.test.junit4.CamelTestSupport;
> > > > > > +import org.apache.cxf.BusFactory;
> > > > > > import org.apache.cxf.frontend.ClientProxyFactoryBean;
> > > > > > import org.junit.BeforeClass;
> > > > > > import org.junit.Test;
> > > > > > @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
> > > > > > ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
> > > > > > factory.setServiceClass(BareSoapService.class);
> > > > > > factory.setAddress(PROXY_URL);
> > > > > > + factory.setBus(BusFactory.newInstance().createBus());
> > > > > > BareSoapService client = (BareSoapService) factory.create();
> > > > > >  
> > > > > > client.doSomething();
> > > > > >  
> > > > > > Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> > > > > > URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > > > > ==============================================================================
> > > > > > --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
> > > > > > +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
> > > > > > @@ -38,7 +38,8 @@ public final class Client {
> > > > > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > > > > clientBean.setAddress(address);
> > > > > > clientBean.setServiceClass(LoanBrokerWS.class);
> > > > > > - clientBean.setBus(BusFactory.getDefaultBus());
> > > > > > + // just create a new bus for use
> > > > > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > > > > return (LoanBrokerWS) proxyFactory.create();
> > > > > > }
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > > --
> > > > > Daniel Kulp
> > > > > dkulp@apache.org - http://dankulp.com/blog
> > > > > Talend Community Coder - http://coders.talend.com
> > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > > --  
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > FuseSource is now part of Red Hat
> > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > Web: http://fusesource.com
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > >  
> >  
> >  
> >  
> > --  
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog
> > Talend Community Coder - http://coders.talend.com
>  
>  
>  
> --  
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com




Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
OK.  Was able to reproduce this with the IBM JDK 7 on Linux. 

I would consider this a bug in the JDK's garbage collector.   It is being overly aggressive, IMO.   The code basically looks like:

client = … create client …
try { 
    client.callMethod(…)
} catch (Exception) {
..
}
…. never reference the client object again …

At some point in there, the GC is deciding it can garbage collect the client proxy since it's never used again.   That causes the finalizer to be called which "closes" the ClientImpl which nulls out everything.   A simple fix is to add something like:

client.getClass();

after the call which forces the client to hang around.  But this definitely is strange behavior.   Not sure what we can do to work around it.  :-(   No idea why the GC is deciding it can be collected before the method even returns.  Not good.   It really shouldn't be garbage collecting and finalizing something that is obviously still on the stack.  



Dan









On Nov 15, 2012, at 2:51 PM, Daniel Kulp <dk...@apache.org> wrote:

> 
> On Nov 15, 2012, at 9:09 AM, Willem jiang <wi...@gmail.com> wrote:
>> The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
>> As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)
>> 
>> I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this
>> 
>> Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
>> java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720) 
>> at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351) 
>> at java.lang.Thread.run(Thread.java:779) 
>> Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
>> testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR! 
>> java.lang.NullPointerException 
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369) 
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
>> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
>> at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
>> at $Proxy28.sayHiWithException(Unknown Source)
> 
> The Bus would be null at this point.   Not sure how that can happen.  It's one of two things:
> 
> 1) The bus is passed in as null, which would be really bad
> 2) The client has been destroyed, thus making the bus null. 
> 
> I would breakpoint the constructors (or add a "assert bus != null" line there, the test should be enabling assertions) and if it's null, try and figure that out.   
> 
> Dan
> 
> 
> 
> 
>> 
>> 
>> Any suggestion is appreciated.  
>> 
>> -- 
>> Willem Jiang
>> 
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://www.fusesource.com | http://www.redhat.com
>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>>         http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
>> Twitter: willemjiang 
>> Weibo: willemjiang
>> 
>> 
>> 
>> On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:
>> 
>>> Hi
>>> 
>>> Dan thanks for sharing this. I guess we should go over the example
>>> tests and make sure they shutdown properly.
>>> Those tests Willem is trying to fix, hasn't been surfaced as often, as
>>> these tests is run last.
>>> And as many times the CI server may not get so far.
>>> 
>>> What we have seen is that these tests fails more often on AIX, than
>>> the other platforms.
>>> Though we reached the end of the test suite (eg it was able to attempt
>>> all tests)
>>> 
>>> So we (I guess its my work to do) can enable the AIX tests again, as
>>> we have a "complete picture" now, where those examples tests are the
>>> last issues covered.
>>> 
>>> BTW: Any chance you guys have seen AIX test failures in Apache CXF
>>> project itself? And if so do you guys run on both Java6 and Java7?
>>> 
>>> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
>>> effect of something else.
>>> 
>>> 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
>>> - Interceptor for
>>> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
>>> has thrown exception, unwinding now
>>> java.lang.NullPointerException
>>> at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
>>> 
>>> 
>>> 
>>> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
>>>> 
>>>> Willem,
>>>> 
>>>> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
>>>> 
>>>> More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>> 
>>>> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
>>>> 
>>>>> Author: ningjiang
>>>>> Date: Thu Nov 15 05:32:26 2012
>>>>> New Revision: 1409651
>>>>> 
>>>>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>>>>> Log:
>>>>> Try to fix the camel-cxf related test failures
>>>>> 
>>>>> Modified:
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>> camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>>>> clientBean.setServiceClass(HelloService.class);
>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> 
>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>> 
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
>>>>> import org.apache.camel.converter.jaxp.XmlConverter;
>>>>> import org.apache.camel.impl.DefaultCamelContext;
>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>> +import org.apache.cxf.BusFactory;
>>>>> import org.apache.cxf.binding.soap.SoapHeader;
>>>>> import org.apache.cxf.endpoint.Server;
>>>>> import org.apache.cxf.frontend.ClientFactoryBean;
>>>>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>>>> ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(ROUTER_ADDRESS);
>>>>> - clientBean.setServiceClass(HelloService.class);
>>>>> + clientBean.setServiceClass(HelloService.class);
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> 
>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>> return client;
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>>>>> import org.apache.camel.builder.RouteBuilder;
>>>>> import org.apache.camel.test.AvailablePortFinder;
>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>> +import org.apache.cxf.BusFactory;
>>>>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>>>>> import org.junit.BeforeClass;
>>>>> import org.junit.Test;
>>>>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>>>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>>>> factory.setServiceClass(BareSoapService.class);
>>>>> factory.setAddress(PROXY_URL);
>>>>> + factory.setBus(BusFactory.newInstance().createBus());
>>>>> BareSoapService client = (BareSoapService) factory.create();
>>>>> 
>>>>> client.doSomething();
>>>>> 
>>>>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>>>>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>>>>> @@ -38,7 +38,8 @@ public final class Client {
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(address);
>>>>> clientBean.setServiceClass(LoanBrokerWS.class);
>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>> + // just create a new bus for use
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> return (LoanBrokerWS) proxyFactory.create();
>>>>> }
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Daniel Kulp
>>>> dkulp@apache.org - http://dankulp.com/blog
>>>> Talend Community Coder - http://coders.talend.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Claus Ibsen
>>> -----------------
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
>>> Web: http://fusesource.com
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.com
>>> Author of Camel in Action: http://www.manning.com/ibsen
>> 
>> 
>> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
OK.  Was able to reproduce this with the IBM JDK 7 on Linux. 

I would consider this a bug in the JDK's garbage collector.   It is being overly aggressive, IMO.   The code basically looks like:

client = … create client …
try { 
    client.callMethod(…)
} catch (Exception) {
..
}
…. never reference the client object again …

At some point in there, the GC is deciding it can garbage collect the client proxy since it's never used again.   That causes the finalizer to be called which "closes" the ClientImpl which nulls out everything.   A simple fix is to add something like:

client.getClass();

after the call which forces the client to hang around.  But this definitely is strange behavior.   Not sure what we can do to work around it.  :-(   No idea why the GC is deciding it can be collected before the method even returns.  Not good.   It really shouldn't be garbage collecting and finalizing something that is obviously still on the stack.  



Dan









On Nov 15, 2012, at 2:51 PM, Daniel Kulp <dk...@apache.org> wrote:

> 
> On Nov 15, 2012, at 9:09 AM, Willem jiang <wi...@gmail.com> wrote:
>> The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
>> As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)
>> 
>> I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this
>> 
>> Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
>> java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720) 
>> at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
>> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351) 
>> at java.lang.Thread.run(Thread.java:779) 
>> Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
>> testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR! 
>> java.lang.NullPointerException 
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369) 
>> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
>> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
>> at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
>> at $Proxy28.sayHiWithException(Unknown Source)
> 
> The Bus would be null at this point.   Not sure how that can happen.  It's one of two things:
> 
> 1) The bus is passed in as null, which would be really bad
> 2) The client has been destroyed, thus making the bus null. 
> 
> I would breakpoint the constructors (or add a "assert bus != null" line there, the test should be enabling assertions) and if it's null, try and figure that out.   
> 
> Dan
> 
> 
> 
> 
>> 
>> 
>> Any suggestion is appreciated.  
>> 
>> -- 
>> Willem Jiang
>> 
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://www.fusesource.com | http://www.redhat.com
>> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>>         http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
>> Twitter: willemjiang 
>> Weibo: willemjiang
>> 
>> 
>> 
>> On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:
>> 
>>> Hi
>>> 
>>> Dan thanks for sharing this. I guess we should go over the example
>>> tests and make sure they shutdown properly.
>>> Those tests Willem is trying to fix, hasn't been surfaced as often, as
>>> these tests is run last.
>>> And as many times the CI server may not get so far.
>>> 
>>> What we have seen is that these tests fails more often on AIX, than
>>> the other platforms.
>>> Though we reached the end of the test suite (eg it was able to attempt
>>> all tests)
>>> 
>>> So we (I guess its my work to do) can enable the AIX tests again, as
>>> we have a "complete picture" now, where those examples tests are the
>>> last issues covered.
>>> 
>>> BTW: Any chance you guys have seen AIX test failures in Apache CXF
>>> project itself? And if so do you guys run on both Java6 and Java7?
>>> 
>>> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
>>> effect of something else.
>>> 
>>> 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
>>> - Interceptor for
>>> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
>>> has thrown exception, unwinding now
>>> java.lang.NullPointerException
>>> at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
>>> 
>>> 
>>> 
>>> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
>>>> 
>>>> Willem,
>>>> 
>>>> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
>>>> 
>>>> More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>> 
>>>> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
>>>> 
>>>>> Author: ningjiang
>>>>> Date: Thu Nov 15 05:32:26 2012
>>>>> New Revision: 1409651
>>>>> 
>>>>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>>>>> Log:
>>>>> Try to fix the camel-cxf related test failures
>>>>> 
>>>>> Modified:
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>> camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>>>> clientBean.setServiceClass(HelloService.class);
>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> 
>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>> 
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
>>>>> import org.apache.camel.converter.jaxp.XmlConverter;
>>>>> import org.apache.camel.impl.DefaultCamelContext;
>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>> +import org.apache.cxf.BusFactory;
>>>>> import org.apache.cxf.binding.soap.SoapHeader;
>>>>> import org.apache.cxf.endpoint.Server;
>>>>> import org.apache.cxf.frontend.ClientFactoryBean;
>>>>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>>>> ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(ROUTER_ADDRESS);
>>>>> - clientBean.setServiceClass(HelloService.class);
>>>>> + clientBean.setServiceClass(HelloService.class);
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> 
>>>>> HelloService client = (HelloService) proxyFactory.create();
>>>>> return client;
>>>>> 
>>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>>>>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>>>>> import org.apache.camel.builder.RouteBuilder;
>>>>> import org.apache.camel.test.AvailablePortFinder;
>>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>>> +import org.apache.cxf.BusFactory;
>>>>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>>>>> import org.junit.BeforeClass;
>>>>> import org.junit.Test;
>>>>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>>>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>>>> factory.setServiceClass(BareSoapService.class);
>>>>> factory.setAddress(PROXY_URL);
>>>>> + factory.setBus(BusFactory.newInstance().createBus());
>>>>> BareSoapService client = (BareSoapService) factory.create();
>>>>> 
>>>>> client.doSomething();
>>>>> 
>>>>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>>> ==============================================================================
>>>>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>>>>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>>>>> @@ -38,7 +38,8 @@ public final class Client {
>>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>>> clientBean.setAddress(address);
>>>>> clientBean.setServiceClass(LoanBrokerWS.class);
>>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>>> + // just create a new bus for use
>>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>>> return (LoanBrokerWS) proxyFactory.create();
>>>>> }
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Daniel Kulp
>>>> dkulp@apache.org - http://dankulp.com/blog
>>>> Talend Community Coder - http://coders.talend.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Claus Ibsen
>>> -----------------
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
>>> Web: http://fusesource.com
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.com
>>> Author of Camel in Action: http://www.manning.com/ibsen
>> 
>> 
>> 
> 
> -- 
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 15, 2012, at 9:09 AM, Willem jiang <wi...@gmail.com> wrote:
> The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
> As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)
> 
> I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this
> 
> Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
> java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720) 
> at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
> at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351) 
> at java.lang.Thread.run(Thread.java:779) 
> Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
> testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR! 
> java.lang.NullPointerException 
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369) 
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
> at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
> at $Proxy28.sayHiWithException(Unknown Source)

The Bus would be null at this point.   Not sure how that can happen.  It's one of two things:

1) The bus is passed in as null, which would be really bad
2) The client has been destroyed, thus making the bus null. 

I would breakpoint the constructors (or add a "assert bus != null" line there, the test should be enabling assertions) and if it's null, try and figure that out.   

Dan




> 
> 
> Any suggestion is appreciated.  
> 
> -- 
> Willem Jiang
> 
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang 
> Weibo: willemjiang
> 
> 
> 
> On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:
> 
>> Hi
>> 
>> Dan thanks for sharing this. I guess we should go over the example
>> tests and make sure they shutdown properly.
>> Those tests Willem is trying to fix, hasn't been surfaced as often, as
>> these tests is run last.
>> And as many times the CI server may not get so far.
>> 
>> What we have seen is that these tests fails more often on AIX, than
>> the other platforms.
>> Though we reached the end of the test suite (eg it was able to attempt
>> all tests)
>> 
>> So we (I guess its my work to do) can enable the AIX tests again, as
>> we have a "complete picture" now, where those examples tests are the
>> last issues covered.
>> 
>> BTW: Any chance you guys have seen AIX test failures in Apache CXF
>> project itself? And if so do you guys run on both Java6 and Java7?
>> 
>> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
>> effect of something else.
>> 
>> 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
>> - Interceptor for
>> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
>> has thrown exception, unwinding now
>> java.lang.NullPointerException
>> at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
>> 
>> 
>> 
>> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
>>> 
>>> Willem,
>>> 
>>> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
>>> 
>>> More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>>> 
>>> Dan
>>> 
>>> 
>>> 
>>> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
>>> 
>>>> Author: ningjiang
>>>> Date: Thu Nov 15 05:32:26 2012
>>>> New Revision: 1409651
>>>> 
>>>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>>>> Log:
>>>> Try to fix the camel-cxf related test failures
>>>> 
>>>> Modified:
>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>> camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>> camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>> 
>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>> ==============================================================================
>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>>>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>> clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>>> clientBean.setServiceClass(HelloService.class);
>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>> 
>>>> HelloService client = (HelloService) proxyFactory.create();
>>>> 
>>>> 
>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>> ==============================================================================
>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>>>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
>>>> import org.apache.camel.converter.jaxp.XmlConverter;
>>>> import org.apache.camel.impl.DefaultCamelContext;
>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>> +import org.apache.cxf.BusFactory;
>>>> import org.apache.cxf.binding.soap.SoapHeader;
>>>> import org.apache.cxf.endpoint.Server;
>>>> import org.apache.cxf.frontend.ClientFactoryBean;
>>>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>>> ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>> clientBean.setAddress(ROUTER_ADDRESS);
>>>> - clientBean.setServiceClass(HelloService.class);
>>>> + clientBean.setServiceClass(HelloService.class);
>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>> 
>>>> HelloService client = (HelloService) proxyFactory.create();
>>>> return client;
>>>> 
>>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>> ==============================================================================
>>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>>>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>>>> import org.apache.camel.builder.RouteBuilder;
>>>> import org.apache.camel.test.AvailablePortFinder;
>>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>>> +import org.apache.cxf.BusFactory;
>>>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>>>> import org.junit.BeforeClass;
>>>> import org.junit.Test;
>>>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>>> ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>>> factory.setServiceClass(BareSoapService.class);
>>>> factory.setAddress(PROXY_URL);
>>>> + factory.setBus(BusFactory.newInstance().createBus());
>>>> BareSoapService client = (BareSoapService) factory.create();
>>>> 
>>>> client.doSomething();
>>>> 
>>>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>>> ==============================================================================
>>>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>>>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>>>> @@ -38,7 +38,8 @@ public final class Client {
>>>> ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>> clientBean.setAddress(address);
>>>> clientBean.setServiceClass(LoanBrokerWS.class);
>>>> - clientBean.setBus(BusFactory.getDefaultBus());
>>>> + // just create a new bus for use
>>>> + clientBean.setBus(BusFactory.newInstance().createBus());
>>>> return (LoanBrokerWS) proxyFactory.create();
>>>> }
>>> 
>>> 
>>> 
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org - http://dankulp.com/blog
>>> Talend Community Coder - http://coders.talend.com
>> 
>> 
>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
> 
> 
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Willem jiang <wi...@gmail.com>.
The bus is set on the client side to avoid the NPE , The most CXF related Unit tests are shutdown the bus after test to clean up the resources on the server side.
As Claus mentioned we just found the NPE is thrown from the CXF client invoke method when running the test from AIX (both 1.6.x and 1.7.x)

I saw there is a IBM JDK 6 test running against CXF trunk, but I don't see this kind of NPE is thrown from CXF tests as We get from AIX like this

Running org.apache.cxf.aegis.exception.ExceptionTest Exception in thread "default-workqueue-2"
 java.lang.NullPointerException at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:720) 
 at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1$1.run(LocalDestination.java:99)
 at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
 at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351) 
 at java.lang.Thread.run(Thread.java:779) 
Tests run: 4, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 60.493 sec <<< FAILURE!
 testHeaders(org.apache.cxf.aegis.exception.ExceptionTest) Time elapsed: 60.154 sec <<< ERROR! 
java.lang.NullPointerException 
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:369) 
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
 at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) 
 at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:81)
 at $Proxy28.sayHiWithException(Unknown Source)


Any suggestion is appreciated.  

-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang



On Thursday, November 15, 2012 at 9:47 PM, Claus Ibsen wrote:

> Hi
> 
> Dan thanks for sharing this. I guess we should go over the example
> tests and make sure they shutdown properly.
> Those tests Willem is trying to fix, hasn't been surfaced as often, as
> these tests is run last.
> And as many times the CI server may not get so far.
> 
> What we have seen is that these tests fails more often on AIX, than
> the other platforms.
> Though we reached the end of the test suite (eg it was able to attempt
> all tests)
> 
> So we (I guess its my work to do) can enable the AIX tests again, as
> we have a "complete picture" now, where those examples tests are the
> last issues covered.
> 
> BTW: Any chance you guys have seen AIX test failures in Apache CXF
> project itself? And if so do you guys run on both Java6 and Java7?
> 
> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
> effect of something else.
> 
> 2012-11-13 17:51:20,388 [main ] WARN PhaseInterceptorChain
> - Interceptor for
> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
> has thrown exception, unwinding now
> java.lang.NullPointerException
> at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)
> 
> 
> 
> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
> > 
> > Willem,
> > 
> > If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus. That needs to get fixed.
> > 
> > More importantly, you are now creating a bus and not shutting it down anywhere. Thus, you are now possibly causing issues for the next tests. I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
> > 
> > Dan
> > 
> > 
> > 
> > On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org (mailto:ningjiang@apache.org) wrote:
> > 
> > > Author: ningjiang
> > > Date: Thu Nov 15 05:32:26 2012
> > > New Revision: 1409651
> > > 
> > > URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
> > > Log:
> > > Try to fix the camel-cxf related test failures
> > > 
> > > Modified:
> > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
> > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
> > > camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
> > > camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> > > 
> > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
> > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > ==============================================================================
> > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
> > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
> > > @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
> > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
> > > clientBean.setServiceClass(HelloService.class);
> > > - clientBean.setBus(BusFactory.getDefaultBus());
> > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > 
> > > HelloService client = (HelloService) proxyFactory.create();
> > > 
> > > 
> > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
> > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > ==============================================================================
> > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
> > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
> > > @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co (http://org.apache.camel.component.cxf.co)
> > > import org.apache.camel.converter.jaxp.XmlConverter;
> > > import org.apache.camel.impl.DefaultCamelContext;
> > > import org.apache.camel.test.junit4.CamelTestSupport;
> > > +import org.apache.cxf.BusFactory;
> > > import org.apache.cxf.binding.soap.SoapHeader;
> > > import org.apache.cxf.endpoint.Server;
> > > import org.apache.cxf.frontend.ClientFactoryBean;
> > > @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
> > > ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
> > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > clientBean.setAddress(ROUTER_ADDRESS);
> > > - clientBean.setServiceClass(HelloService.class);
> > > + clientBean.setServiceClass(HelloService.class);
> > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > 
> > > HelloService client = (HelloService) proxyFactory.create();
> > > return client;
> > > 
> > > Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
> > > URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > ==============================================================================
> > > --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
> > > +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
> > > @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
> > > import org.apache.camel.builder.RouteBuilder;
> > > import org.apache.camel.test.AvailablePortFinder;
> > > import org.apache.camel.test.junit4.CamelTestSupport;
> > > +import org.apache.cxf.BusFactory;
> > > import org.apache.cxf.frontend.ClientProxyFactoryBean;
> > > import org.junit.BeforeClass;
> > > import org.junit.Test;
> > > @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
> > > ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
> > > factory.setServiceClass(BareSoapService.class);
> > > factory.setAddress(PROXY_URL);
> > > + factory.setBus(BusFactory.newInstance().createBus());
> > > BareSoapService client = (BareSoapService) factory.create();
> > > 
> > > client.doSomething();
> > > 
> > > Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> > > URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> > > ==============================================================================
> > > --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
> > > +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
> > > @@ -38,7 +38,8 @@ public final class Client {
> > > ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
> > > clientBean.setAddress(address);
> > > clientBean.setServiceClass(LoanBrokerWS.class);
> > > - clientBean.setBus(BusFactory.getDefaultBus());
> > > + // just create a new bus for use
> > > + clientBean.setBus(BusFactory.newInstance().createBus());
> > > return (LoanBrokerWS) proxyFactory.create();
> > > }
> > 
> > 
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog
> > Talend Community Coder - http://coders.talend.com
> 
> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen




Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 15, 2012, at 8:47 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Dan thanks for sharing this. I guess we should go over the example
> tests and make sure they shutdown properly.
> Those tests Willem is trying to fix, hasn't been surfaced as often, as
> these tests is run last.
> And as many times the CI server may not get so far.
> 
> What we have seen is that these tests fails more often on AIX, than
> the other platforms.
> Though we reached the end of the test suite (eg it was able to attempt
> all tests)
> 
> So we (I guess its my work to do) can enable the AIX tests again, as
> we have a "complete picture" now, where those examples tests are the
> last issues covered.
> 
> BTW: Any chance you guys have seen AIX test failures in Apache CXF
> project itself? And if so do you guys run on both Java6 and Java7?

We had CXF completely passing on AIX several months ago, but I believe it was only on Java6 as that is what the customer was requiring.   For the most part, getting the tests passing really involved only the normal "IBM JDK" issues (which also occurred on the IBM JDK on Linux) and a bunch of issues related to different security algorithms that the IBM JDK provided (or didn't provide).   The latter just affected a bunch of HTTPs related tests.   By adjusting the various HTTPs configs to use common algorithms, we had the entire test suite working.

Are you seeing these with Java6 or Java7 or both?      I don't think we've run CXF with the IBM Java7.   I'm downloading that now for Linux and I'll see how that goes.

I'm also trying to get access to our AIX box.   Apparently it's in the process of being re-setup or upgraded or something, but should be done in a couple days.   Once I get access, I'll re-run and see if I can reproduce.


> A piece of a stracetrace shows NPE in CXF itself, but it may be a side
> effect of something else.
> 
> 2012-11-13 17:51:20,388 [main           ] WARN  PhaseInterceptorChain
>        - Interceptor for
> {http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
> has thrown exception, unwinding now
> java.lang.NullPointerException
> 	at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)

Well, this shows that the endpoint of the selector is null.   That means either the setEndpoint method isn't called or it's being called with null (which would be bad).  That's where I'd start with a break point (or println).

Dan



> 
> 
> 
> On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dk...@apache.org> wrote:
>> 
>> Willem,
>> 
>> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus.   That needs to get fixed.
>> 
>> More importantly, you are now creating a bus and not shutting it down anywhere.   Thus, you are now possibly causing issues for the next tests.  I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>> 
>> Dan
>> 
>> 
>> 
>> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org wrote:
>> 
>>> Author: ningjiang
>>> Date: Thu Nov 15 05:32:26 2012
>>> New Revision: 1409651
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>>> Log:
>>> Try to fix the camel-cxf related test failures
>>> 
>>> Modified:
>>>   camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>>   camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>>   camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>>   camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>> 
>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>> ==============================================================================
>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>>        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>        clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>>        clientBean.setServiceClass(HelloService.class);
>>> -        clientBean.setBus(BusFactory.getDefaultBus());
>>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>> 
>>>        HelloService client = (HelloService) proxyFactory.create();
>>> 
>>> 
>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>> ==============================================================================
>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co
>>> import org.apache.camel.converter.jaxp.XmlConverter;
>>> import org.apache.camel.impl.DefaultCamelContext;
>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>> +import org.apache.cxf.BusFactory;
>>> import org.apache.cxf.binding.soap.SoapHeader;
>>> import org.apache.cxf.endpoint.Server;
>>> import org.apache.cxf.frontend.ClientFactoryBean;
>>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>>        ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>>        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>        clientBean.setAddress(ROUTER_ADDRESS);
>>> -        clientBean.setServiceClass(HelloService.class);
>>> +        clientBean.setServiceClass(HelloService.class);
>>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>> 
>>>        HelloService client = (HelloService) proxyFactory.create();
>>>        return client;
>>> 
>>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>> ==============================================================================
>>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>>> import org.apache.camel.builder.RouteBuilder;
>>> import org.apache.camel.test.AvailablePortFinder;
>>> import org.apache.camel.test.junit4.CamelTestSupport;
>>> +import org.apache.cxf.BusFactory;
>>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>>> import org.junit.BeforeClass;
>>> import org.junit.Test;
>>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>>        ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>>        factory.setServiceClass(BareSoapService.class);
>>>        factory.setAddress(PROXY_URL);
>>> +        factory.setBus(BusFactory.newInstance().createBus());
>>>        BareSoapService client = (BareSoapService) factory.create();
>>> 
>>>        client.doSomething();
>>> 
>>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>>> ==============================================================================
>>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>>> @@ -38,7 +38,8 @@ public final class Client {
>>>        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>>        clientBean.setAddress(address);
>>>        clientBean.setServiceClass(LoanBrokerWS.class);
>>> -        clientBean.setBus(BusFactory.getDefaultBus());
>>> +        // just create a new bus for use
>>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>>        return (LoanBrokerWS) proxyFactory.create();
>>>    }
>>> 
>>> 
>>> 
>> 
>> --
>> Daniel Kulp
>> dkulp@apache.org - http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Dan thanks for sharing this. I guess we should go over the example
tests and make sure they shutdown properly.
Those tests Willem is trying to fix, hasn't been surfaced as often, as
these tests is run last.
And as many times the CI server may not get so far.

What we have seen is that these tests fails more often on AIX, than
the other platforms.
Though we reached the end of the test suite (eg it was able to attempt
all tests)

So we (I guess its my work to do) can enable the AIX tests again, as
we have a "complete picture" now, where those examples tests are the
last issues covered.

BTW: Any chance you guys have seen AIX test failures in Apache CXF
project itself? And if so do you guys run on both Java6 and Java7?

A piece of a stracetrace shows NPE in CXF itself, but it may be a side
effect of something else.

2012-11-13 17:51:20,388 [main           ] WARN  PhaseInterceptorChain
        - Interceptor for
{http://version.webservice.loanbroker.camel.apache.org/}LoanBrokerWS#{http://version.webservice.loanbroker.camel.apache.org/}getLoanQuote
has thrown exception, unwinding now
java.lang.NullPointerException
	at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:90)



On Thu, Nov 15, 2012 at 1:47 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> Willem,
>
> If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus.   That needs to get fixed.
>
> More importantly, you are now creating a bus and not shutting it down anywhere.   Thus, you are now possibly causing issues for the next tests.  I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.
>
> Dan
>
>
>
> On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org wrote:
>
>> Author: ningjiang
>> Date: Thu Nov 15 05:32:26 2012
>> New Revision: 1409651
>>
>> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
>> Log:
>> Try to fix the camel-cxf related test failures
>>
>> Modified:
>>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>>    camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>>
>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>> ==============================================================================
>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
>> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>         clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>>         clientBean.setServiceClass(HelloService.class);
>> -        clientBean.setBus(BusFactory.getDefaultBus());
>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>
>>         HelloService client = (HelloService) proxyFactory.create();
>>
>>
>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>> ==============================================================================
>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
>> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co
>> import org.apache.camel.converter.jaxp.XmlConverter;
>> import org.apache.camel.impl.DefaultCamelContext;
>> import org.apache.camel.test.junit4.CamelTestSupport;
>> +import org.apache.cxf.BusFactory;
>> import org.apache.cxf.binding.soap.SoapHeader;
>> import org.apache.cxf.endpoint.Server;
>> import org.apache.cxf.frontend.ClientFactoryBean;
>> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>>         ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>         clientBean.setAddress(ROUTER_ADDRESS);
>> -        clientBean.setServiceClass(HelloService.class);
>> +        clientBean.setServiceClass(HelloService.class);
>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>
>>         HelloService client = (HelloService) proxyFactory.create();
>>         return client;
>>
>> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>> ==============================================================================
>> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
>> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
>> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
>> import org.apache.camel.builder.RouteBuilder;
>> import org.apache.camel.test.AvailablePortFinder;
>> import org.apache.camel.test.junit4.CamelTestSupport;
>> +import org.apache.cxf.BusFactory;
>> import org.apache.cxf.frontend.ClientProxyFactoryBean;
>> import org.junit.BeforeClass;
>> import org.junit.Test;
>> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>>         ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>>         factory.setServiceClass(BareSoapService.class);
>>         factory.setAddress(PROXY_URL);
>> +        factory.setBus(BusFactory.newInstance().createBus());
>>         BareSoapService client = (BareSoapService) factory.create();
>>
>>         client.doSomething();
>>
>> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
>> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
>> ==============================================================================
>> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
>> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
>> @@ -38,7 +38,8 @@ public final class Client {
>>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>>         clientBean.setAddress(address);
>>         clientBean.setServiceClass(LoanBrokerWS.class);
>> -        clientBean.setBus(BusFactory.getDefaultBus());
>> +        // just create a new bus for use
>> +        clientBean.setBus(BusFactory.newInstance().createBus());
>>         return (LoanBrokerWS) proxyFactory.create();
>>     }
>>
>>
>>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: svn commit: r1409651 - in /camel/trunk: components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/

Posted by Daniel Kulp <dk...@apache.org>.
Willem,

If BusFactory.newInstance().createBus() is doing something different than BusFactory.getDefaultBus(), then likely there is a test ahead of it that doesn't have a proper teardown that is shutting down the bus.   That needs to get fixed.

More importantly, you are now creating a bus and not shutting it down anywhere.   Thus, you are now possibly causing issues for the next tests.  I'm OK with creating the new bus to make sure you get a clean slate, but make sure it gets shutdown.

Dan



On Nov 15, 2012, at 12:32 AM, ningjiang@apache.org wrote:

> Author: ningjiang
> Date: Thu Nov 15 05:32:26 2012
> New Revision: 1409651
> 
> URL: http://svn.apache.org/viewvc?rev=1409651&view=rev
> Log:
> Try to fix the camel-cxf related test failures
> 
> Modified:
>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
>    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
>    camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> 
> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java (original)
> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java Thu Nov 15 05:32:26 2012
> @@ -104,7 +104,7 @@ public class CxfConsumerTest extends Cam
>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>         clientBean.setAddress(SIMPLE_ENDPOINT_ADDRESS);
>         clientBean.setServiceClass(HelloService.class);
> -        clientBean.setBus(BusFactory.getDefaultBus());
> +        clientBean.setBus(BusFactory.newInstance().createBus());
> 
>         HelloService client = (HelloService) proxyFactory.create();
> 
> 
> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java (original)
> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfMixedModeRouterTest.java Thu Nov 15 05:32:26 2012
> @@ -30,6 +30,7 @@ import org.apache.camel.component.cxf.co
> import org.apache.camel.converter.jaxp.XmlConverter;
> import org.apache.camel.impl.DefaultCamelContext;
> import org.apache.camel.test.junit4.CamelTestSupport;
> +import org.apache.cxf.BusFactory;
> import org.apache.cxf.binding.soap.SoapHeader;
> import org.apache.cxf.endpoint.Server;
> import org.apache.cxf.frontend.ClientFactoryBean;
> @@ -145,7 +146,8 @@ public class CxfMixedModeRouterTest exte
>         ClientProxyFactoryBean proxyFactory = new ClientProxyFactoryBean();
>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>         clientBean.setAddress(ROUTER_ADDRESS);
> -        clientBean.setServiceClass(HelloService.class); 
> +        clientBean.setServiceClass(HelloService.class);
> +        clientBean.setBus(BusFactory.newInstance().createBus());
> 
>         HelloService client = (HelloService) proxyFactory.create();
>         return client;
> 
> Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java
> URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> ==============================================================================
> --- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java (original)
> +++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadBareSoapTest.java Thu Nov 15 05:32:26 2012
> @@ -25,6 +25,7 @@ import javax.xml.ws.Endpoint;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.test.AvailablePortFinder;
> import org.apache.camel.test.junit4.CamelTestSupport;
> +import org.apache.cxf.BusFactory;
> import org.apache.cxf.frontend.ClientProxyFactoryBean;
> import org.junit.BeforeClass;
> import org.junit.Test;
> @@ -66,6 +67,7 @@ public class CxfPayLoadBareSoapTest exte
>         ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>         factory.setServiceClass(BareSoapService.class);
>         factory.setAddress(PROXY_URL);
> +        factory.setBus(BusFactory.newInstance().createBus());
>         BareSoapService client = (BareSoapService) factory.create();
> 
>         client.doSomething();
> 
> Modified: camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java
> URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java?rev=1409651&r1=1409650&r2=1409651&view=diff
> ==============================================================================
> --- camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java (original)
> +++ camel/trunk/examples/camel-example-loan-broker/src/main/java/org/apache/camel/loanbroker/webservice/version/Client.java Thu Nov 15 05:32:26 2012
> @@ -38,7 +38,8 @@ public final class Client {
>         ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
>         clientBean.setAddress(address);
>         clientBean.setServiceClass(LoanBrokerWS.class);
> -        clientBean.setBus(BusFactory.getDefaultBus());
> +        // just create a new bus for use
> +        clientBean.setBus(BusFactory.newInstance().createBus());
>         return (LoanBrokerWS) proxyFactory.create();
>     }
> 
> 
> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com