Re: cxf without spring
Yes, you could init a bus without the spring just as Glen shows. Here is one thing that I should say about the bus = BusFactory.newInstance().createBus(); The BusFactory will check your class path , if it can find some spring relate class , it will use SpringBusFactory to load bus. Unless you can the upper code to be BusFactory busFactory = new CXFBusFactory(); bus = busFactory.createBus(); In you case , I think you still want to use spring , am I right :) So what I am interested now is what kind of issue that Jsr250PostProcessor caused. We fixed some Spring 2.5 relate issues[1][2] in CXF 2.0.4 snapshot, please feel free to try it out. [1]http://issues.apache.org/jira/browse/CXF-1187 [2]http://issues.apache.org/jira/browse/CXF-1249 Willem. Glen Mazza wrote: cxf.xml is for bus (generic service/client endpoing) configuration--I don't know what you're trying to do to be able to answer your question directly. The Service configuration files section of [1] gives you two separate ways of configuring a CXF-based web service. Also, Willem recently created a CXFNonSpringServlet[2] which may be what you're looking for. Unfortunately AFAIK its usage has not been documented yet, but if you ask Willem enough questions he may become motivated to write up about it. HTH, Glen [1] http://cwiki.apache.org/CXF20DOC/configuration.html [2] http://www.mail-archive.com/[EMAIL PROTECTED]/msg03018.html Am Mittwoch, den 02.01.2008, 17:09 -0600 schrieb Patidar, Manoj: Hi All, can we configure cxf without using following xml as we are facing issue with intiallizing the beans of our product if we import cxf.xml in our application-context.xml. Jsr250PostProcessor.java is creating some issue and none of our beans are intialized. So my questions is can we avoid including cxf.xml. If yes how? cxf.xml cxf-extension.xml cxf-property-editors.xml your help is apreciated. Thanks Manoj patidar
Re: cxf without spring
cxf.xml is for bus (generic service/client endpoing) configuration--I don't know what you're trying to do to be able to answer your question directly. The Service configuration files section of [1] gives you two separate ways of configuring a CXF-based web service. Also, Willem recently created a CXFNonSpringServlet[2] which may be what you're looking for. Unfortunately AFAIK its usage has not been documented yet, but if you ask Willem enough questions he may become motivated to write up about it. HTH, Glen [1] http://cwiki.apache.org/CXF20DOC/configuration.html [2] http://www.mail-archive.com/[EMAIL PROTECTED]/msg03018.html Am Mittwoch, den 02.01.2008, 17:09 -0600 schrieb Patidar, Manoj: Hi All, can we configure cxf without using following xml as we are facing issue with intiallizing the beans of our product if we import cxf.xml in our application-context.xml. Jsr250PostProcessor.java is creating some issue and none of our beans are intialized. So my questions is can we avoid including cxf.xml. If yes how? cxf.xml cxf-extension.xml cxf-property-editors.xml your help is apreciated. Thanks Manoj patidar
Re: CXF without Spring?
Willem, Unfortunatetly it's not actually possible to use CXFServlet without having the Spring framework on your path! Althought reflection is used as an initial test for the existence of spring on the classpath CXFServlet itself has a number of instance variables that require Spring to be on the classpath. I've created a JIRA bug for this issue: https://issues.apache.org/jira/browse/CXF-1072. Anyways, the upshot of it all is you can't actually use CXFServlet to configure things for you without using Spring. :( Corey Willem2 wrote: Hi, I think you need to look up your class path if there any spring related class. Here is part of CXFServlet init code: String springCls = org.springframework.context.ApplicationContext; try { ClassLoaderUtils.loadClass(springCls, getClass()); loadSpringBus(servletConfig); } catch (ClassNotFoundException e) { loadBusNoConfig(servletConfig); } If you want to create bus from CXFBusfactory , you need to remove the spring related jars first. Willem. -- View this message in context: http://www.nabble.com/CXF-without-Spring--tf4470086.html#a12925133 Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF without Spring?
Thanks, I'm using Tomcat 6 in windows. So I added -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory under the Java tab. Then I checked the System.properties and I saw that it property had been set: org.apache.cxf.bus.factory org.apache.cxf.bus.CXFBusFactory However I still get the message: Sep 20, 2007 2:52:45 PM org.apache.cxf.transport.servlet.CXFServlet loadSpringBus in my catalina log. And I still get the following exception: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:159) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) when the servlet starts up. Thanks again for the help. I feel like you guys have gone out of your way to help me on this... Do you have any other suggestions? Willem2 wrote: Hi It looks like the servlet transport factory did not set up the transport id for you to use. If you just want CXF Servlet to use the CXFBusFactory , you can add this option -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory to your WebContainer's start up script. Willem. bobbydole wrote: Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: 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
Re: CXF without Spring?
Hi, I think you need to look up your class path if there any spring related class. Here is part of CXFServlet init code: String springCls = org.springframework.context.ApplicationContext; try { ClassLoaderUtils.loadClass(springCls, getClass()); loadSpringBus(servletConfig); } catch (ClassNotFoundException e) { loadBusNoConfig(servletConfig); } If you want to create bus from CXFBusfactory , you need to remove the spring related jars first. Willem. bobbydole wrote: Thanks, I'm using Tomcat 6 in windows. So I added -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory under the Java tab. Then I checked the System.properties and I saw that it property had been set: org.apache.cxf.bus.factory org.apache.cxf.bus.CXFBusFactory However I still get the message: Sep 20, 2007 2:52:45 PM org.apache.cxf.transport.servlet.CXFServlet loadSpringBus in my catalina log. And I still get the following exception: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:159) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) when the servlet starts up. Thanks again for the help. I feel like you guys have gone out of your way to help me on this... Do you have any other suggestions? Willem2 wrote: Hi It looks like the servlet transport factory did not set up the transport id for you to use. If you just want CXF Servlet to use the CXFBusFactory , you can add this option -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory to your WebContainer's start up script. Willem. bobbydole wrote: Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: 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
Re: CXF without Spring?
Hi It looks like the servlet transport factory did not set up the transport id for you to use. If you just want CXF Servlet to use the CXFBusFactory , you can add this option -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory to your WebContainer's start up script. Willem. bobbydole wrote: Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: 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:
Re: CXF without Spring?
Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: 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
Re: CXF without Spring?
Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: 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
Re: CXF without Spring?
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(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.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(AbstractEndpointFactory.java:274) at org.apache.cxf.frontend.AbstractEndpointFactory.initializeServiceFactory(AbstractEndpointFactory.java:150) at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(ServerFactoryBean.java:144) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.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
Re: CXF without Spring?
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(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.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(AbstractEndpointFactory.java:274) at org.apache.cxf.frontend.AbstractEndpointFactory.initializeServiceFactory(AbstractEndpointFactory.java:150) at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory(ServerFactoryBean.java:144) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.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 -- View this message in context: http://www.nabble.com/CXF-without-Spring--tf4470086.html#a12746341 Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF without Spring?
One more note. If you use Dispatch style clients, you may need to use the trunk snapshots (deploying another one now) until 2.0.2 is released (hopefully rebuilding that tomorrow if we can get all the TCK's passing). There is an issue where it won't be able to find the soap binding or http transports unless a non-dispatch client or similar is first used to force loading of those. Dan On Monday 17 September 2007, Daniel Kulp 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(SpringBusFac to ry.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFac to ry.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFac to 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(AbstractEn dp ointFactory.java:274) at org.apache.cxf.frontend.AbstractEndpointFactory.initializeService Fa ctory(AbstractEndpointFactory.java:150) at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactor y( ServerFactoryBean.java:144) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Ab st ractEndpointFactory.java:80) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBea n. 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-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog