Thanks for the test case.

I'm actually surprised this has ever worked.  Or, more specifically, ever 
produced a bus that is actually usable for anything other than holding onto 
those couple of interceptors.   For example, if you change your testcase to 
do:

    @Autowired
    ApplicationContext ctx;
    
    @Test
    public void testMe() throws Exception {
        Assert.assertNotNull(ctx);
        
        Object o = ctx.getBean("cxf");
        Assert.assertNotNull(o);
        System.out.println(o);
        Bus bus = (Bus)o;
        
        System.out.println(bus.getExtension(WSDLManager.class));
    }

You'll see the second println is null which basically says the bus doesn't 
have any useful extensions configured in, which, for the most part, means the 
bus is useless.    In anycase, I'm testing a fix that would allow this style 
of config by grabbing a default bus (which WOULD be properly/fully configured) 
and add the interceptors to it.   Thus, this will work differently than 2.2, 
but I think it's more correct.

The actual proper way would be to add:

<import resource="classpath:META-INF/cxf/cxf.xml" />
to load the cxf bus definitions, then also add the various components you 
really need:
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
etc....


Dan




On Mon September 7 2009 6:12:20 am RuneB wrote:
> Ok, here's a minimal project with a junit test that demonstrates the
>  problem. Just run: mvn test
> 
> Reverting the CXF version to 2.2 makes the problem go away.
> 
> - Rune
> 
> dkulp wrote:
> > Well, that's interesting.   Any chance you can create a small testcase
> > and send it along?
> >
> > You may also be able to get around it by doing:
> > <cxf:bus bus="cxf">
> > as that would force the contructor arg.
> >
> > However, I'd REALLY like to get a test case if at all possible.   We use
> > this
> > same syntax in MAY of our own unit tests so I'm not sure what could
> > possibly
> > be going wrong.
> >
> > Dan
> 
> http://www.nabble.com/file/p25328146/cxf-bus-bug.zip cxf-bus-bug.zip
> 

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to