Thank you so much!
I ended up doing this:
org.apache.cxf.bus.CXFBusFactory busFactory = new
org.apache.cxf.bus.CXFBusFactory();
BusFactory.setDefaultBus(busFactory.createBus());
BusFactory.setThreadDefaultBus(busFactory.createBus());
ServerFactoryBean svrFactory = new ServerFactoryBean();
However now I'm running into another problem. It seems to want to use the
Jetty jars (for a JettyHTTPTransportFactory), which I'm pretty sure I don't
want to use since I'm using Tomcat.
So I set destinationFactory as follows:
svrFactory.setDestinationFactory(new ServletTransportFactory());
svrFactory.setServiceClass(Test.class);
svrFactory.setAddress("http://localhost/Test/Hello");
svrFactory.setServiceBean(test);
svrFactory.create();
However now I get NullPointerException
java.lang.NullPointerException
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:166)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:104)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108)
Maybe it would help if I described what I want to get done. Currently I have
2 servlets running in tomcat that I need to turn into services. I'm sort of
lost and confused on what my next time would be. If I want to use the simple
frontend method do I need to add the CXFServlet to my web.xml? I dropped the
cxf-servlet.xml in my web-inf directory, how ever it doesn't seem to do
anything. Do I have to add it to a another file to get it to load?
Thanks for all the help, I feel like I'm so close!
dkulp wrote:
>
>
> You probably could call:
>
> org.apache.cxf.bus.CXFBusFactory.createBus();
>
> first to cause it to create an Extension based bus. You may need to
> call BusFactory.setDefaultBus(...) and
> BusFactory.setThreadDefaultBus(...) with the return of the createBus()
> to force the bus to be there and avoid trying to create a spring one.
>
>
> You could also set the system property:
> org.apache.cxf.bus.factory
> to:
> org.apache.cxf.bus.CXFBusFactory
>
> That should work as well.
>
> Dan
>
>
> On Monday 17 September 2007, bobbydole wrote:
>> Thanks for the reply!
>>
>> Is there any way to over ride this behavior? We are using Spring, but
>> I've been told not to stay away from the spring JARs in CXF. I think
>> that we're using an older version of spring, and we don't want to mess
>> with upgrading at this time.. I don't know how to include the newer
>> spring files without messing with the old ones.
>>
>> Any suggestions?
>>
>> This has been driving me mad all day.. :(
>>
>> Dan Diephouse-2 wrote:
>> > Hiya,
>> > I believe that the BusFactory will not create a new Bus unless it
>> > detects spring on your classpath. The fact that you're getting a
>> > NoClassDefFoundError supports this - otherwise you would have a
>> > ClassNotFoundException. So I would double check your classpath.
>> > Cheers,
>> > - Dan
>> >
>> > bobbydole wrote:
>> >> Hello, I'm trying to get a simple web service setup using CXF.
>> >> Basically I'm
>> >> following the simple frontend example. However when I run it it I
>> >> get this
>> >> exception:
>> >>
>> >> java.lang.NoClassDefFoundError:
>> >> org/springframework/beans/factory/xml/NamespaceHandlerResolver
>> >> at
>> >> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto
>> >>ry.java:83) at
>> >> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto
>> >>ry.java:65) at
>> >> org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto
>> >>ry.java:52) at
>> >> org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69) at
>> >> org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:58) at
>> >> org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:98)
>> >> at
>> >> org.apache.cxf.frontend.AbstractEndpointFactory.getBus(AbstractEndp
>> >>ointFactory.java:274) at
>> >> org.apache.cxf.frontend.AbstractEndpointFactory.initializeServiceFa
>> >>ctory(AbstractEndpointFactory.java:150) at
>> >> org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(
>> >>ServerFactoryBean.java:144) at
>> >> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abst
>> >>ractEndpointFactory.java:80) at
>> >> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.
>> >>java:108)
>> >>
>> >>
>> >> Which looks to me like it requires the Spring of some sort, or at
>> >> least it
>> >> appears to want to use Spring.
>> >>
>> >> All I want to do is get a simple frontend service running without
>> >> spring (as
>> >> I can't use it) Any one got any ideas?
>> >>
>> >> Thanks!
>> >
>> > --
>> > Dan Diephouse
>> > MuleSource
>> > http://mulesource.com | http://netzooid.com/blog
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727 C: 508-380-7194
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
>
>
--
View this message in context:
http://www.nabble.com/CXF-without-Spring--tf4470086.html#a12749741
Sent from the cxf-user mailing list archive at Nabble.com.