cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiang, Ning \(Willem\)" <Ning.Ji...@iona.com>
Subject RE: Problem with CXFServlet - migrating from xfire to CXF
Date Tue, 17 Jul 2007 14:57:17 GMT
Hi Scott,

After studying your logger file, I found you were using your customer web context to start
up the spring application context.[com.medseek.spring.context.support.ManualWebApplicationContext]
Current CXF only support spring 1.x and spring 2.x web application context.
Here is the code of CXFServlet application context loading in the method loadSpringBus(),
maybe you should do some customering to get the CXF work again.

        ServletContext svCtx = getServletContext(); 
        
        // Spring 1.x
        ApplicationContext ctx = (ApplicationContext)svCtx
            .getAttribute("interface org.springframework.web.context.WebApplicationContext.ROOT");

        // Spring 2.0
        if (ctx == null) {
            ctx = (ApplicationContext)svCtx
                .getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
        }
        
Cheers,

Willem


-----Original Message-----
From: Scott Archer [mailto:scott.archer@gmail.com]
Sent: Tue 7/17/2007 22:19
To: cxf-dev@incubator.apache.org
Subject: Re: Problem with CXFServlet - migrating from xfire to CXF
 
I just noticed this new error in the log file.
Jul 17, 2007 9:11:41 AM
org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: Could not find the configuration file cxf.xml on the classpath.

Thanks for all the help. I think we're getting closer.
I'm running java 6 and tomcat 6.0.10


Spring startup logging

2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[cxf]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.bus.spring.Jsr250BeanPostProcessor]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.bus.spring.BusExtensionPostProcessor]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.resource.ResourceManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.binding.BindingFactoryManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.transport.DestinationFactoryManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.transport.ConduitInitiatorManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.wsdl.WSDLManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.phase.PhaseManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.workqueue.WorkQueueManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.buslifecycle.BusLifeCycleManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.endpoint.ServerRegistry]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.endpoint.ServerLifeCycleManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.endpoint.ClientLifeCycleManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.transports.http.QueryHandlerRegistry]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.endpoint.EndpointResolverRegistry]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.headers.HeaderManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.catalog.OASISCatalogManager]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.binding.soap.SoapBindingFactory]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.binding.soap.SoapTransportFactory]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.binding.soap.customEditorConfigurer]
2007-07-17 09:11:40,959
[main]TRACE[com.madeupname.product.core.ContextFactory] - spring bean:
[org.apache.cxf.transport.servlet.ServletTransportFactory]

Here's the exception portion of the log.

Jul 17, 2007 9:11:41 AM
org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: Could not find the configuration file cxf.xml on the classpath.
2007-07-17 09:11:41,084
[main]DEBUG[com.medseek.spring.context.support.ManualWebApplicationContext]
- Publishing event in context
[com.medseek.spring.context.support.ManualWebApplicationContext@a9c09e]:
org.springframework.context.event.ContextRefreshedEvent[source=org.apache.cxf.bus.spring.BusApplicationContext@182c132:
display name [org.apache.cxf.bus.spring.BusApplicationContext@182c132];
startup date [Tue Jul 17 09:11:41 CDT 2007]; parent:
com.medseek.spring.context.support.ManualWebApplicationContext@a9c09e]
Jul 17, 2007 9:11:41 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.NullPointerException
	at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:148)
	at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:96)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jul 17, 2007 9:11:41 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /econnect threw load() exception
java.lang.NullPointerException
	at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:148)
	at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:96)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


On 7/16/07, Willem Jiang <ning.jiang@iona.com> wrote:
> Hi Scott
>
> It is strange to get NPE if you just set the configuration like the wiki
> said.
> Maybe you need to tell me the tomcat version that you use and you can
> send me the more detail loge about how the spring wires components for
> the bus.
>
> Willem
>
> Scott Archer wrote:
> > I didn't set a bus.id parameter in the web.xml
> > my web.xml looks like the one described on this page.
> >
> > http://cwiki.apache.org/CXF20DOC/servlet-transport.html
> >
> > it just has the servlet and the servlet mapping.
> > Where does the bus.id need to be set?
> >
> > Thanks!
> >
> >
> > On 7/16/07, Willem Jiang <ning.jiang@iona.com> wrote:
> >>
> >> I think the Bus is not start up rightly.
> >> Because you just got the CXFBusImpl's extensions HashMap with only
> >> Configurer Object.
> >> If the Bus start right, here should be lots of other Objects such as
> >> ResourceManager , BindingFactoryManager etc.
> >>
> >> I just went through the code,  do you set the bus.id parameter in you
> >> web.xml ?
> >>
> >> Willem.
> >>
> >> Scott Archer wrote:
> >> > I initially tried it with 2.0.4, but It didn't work with that either.
> >> > I went ahead and upgraded to 2.0.6. I can move back to 2.0.4 if it
> >> > will help diagnose the problem.
> >> >
> >> > Thanks for all the help.
> >> >
> >> > The main problem is still that
> >> > ResourceManager resourceManager =
> >> > bus.getExtension(ResourceManager.class);
> >> > returns null for the resourceManager.
> >> >
> >> > I looked in CXFBusImpl and the extensions HashMap has the following in
> >> > it at runtime
> >> > {interface
> >> >
> >> org.apache.cxf.configuration.Configurer=org.apache.cxf.configuration.spring.ConfigurerImpl@f6af3b}
> >>
> >> >
> >> >
> >> > I hope this helps.
> >> >
> >> > Thanks,
> >> >
> >> > Scott
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On 7/16/07, Jiang, Ning (Willem) <Ning.Jiang@iona.com> wrote:
> >> >>
> >> >> It looks like you do not use the cxf shipped spring jars, which
> >> >> should be spring 2.0.4, we tested it in development.
> >> >>
> >> >> BTW , you use the cxf-2.0-incubator.jar which is a bundler jar of
> >> cxf.
> >> >>
> >> >> I think you can remove the cxf-common-utilities-2.0-incubator.jar and
> >> >> cxf-manifest-incubator.jar from the class path.
> >> >>
> >> >> Hope these can help you.
> >> >>
> >> >> Willem.
> >> >>
> >> >> -----Original Message-----
> >> >> From: Scott Archer [mailto:scott.archer@gmail.com]
> >> >> Sent: Mon 7/16/2007 21:20
> >> >> To: cxf-dev@incubator.apache.org
> >> >> Subject: Re: Problem with CXFServlet - migrating from xfire to CXF
> >> >>
> >> >> It's still getting that same exception.
> >> >>
> >> >> Here's an excerpt from my spring.xml file.
> >> >> I have these .jar files in my classpath
> >> >>
> >> >> Thanks for your help!
> >> >>
> >> >> activation.jar
> >> >> antlr-2.7.6.jar
> >> >> aopalliance.jar
> >> >> asm.jar
> >> >> asm-attrs.jar
> >> >> cglib-2.1.3.jar
> >> >> commons-beanutils-core.jar
> >> >> commons-codec-1.3.jar
> >> >> commons-collections-3.2.jar
> >> >> commons-configuration-1.4.jar
> >> >> commons-dbcp-1.2.2.jar
> >> >> commons-dbutils-1.1.jar
> >> >> commons-digester-1.8.jar
> >> >> commons-discovery-0.4.jar
> >> >> commons-httpclient-3.1-rc1.jar
> >> >> commons-io-1.3.1.jar
> >> >> commons-lang-2.3.jar
> >> >> commons-logging-1.1.jar
> >> >> commons-pool-1.3.jar
> >> >> concurrent.jar
> >> >> cxf-2.0-incubator.jar
> >> >> cxf-common-utilities-2.0-incubator.jar
> >> >> cxf-manifest-incubator.jar
> >> >> dom4j-1.6.1.jar
> >> >> ehcache-1.2.3.jar
> >> >> geronimo-activation_1.1_spec-1.0-M1.jar
> >> >> geronimo-annotation_1.0_spec-1.1.jar
> >> >> geronimo-javamail_1.4_spec-1.0-M1.jar
> >> >> geronimo-servlet_2.5_spec-1.1-M1.jar
> >> >> geronimo-ws-metadata_2.0_spec-1.1.1.jar
> >> >> hibernate3.jar
> >> >> itext-1.4.8.jar
> >> >> jakarta-oro-2.0.8.jar
> >> >> jasperreports-1.3.0.jar
> >> >> jaxb-api-2.0.jar
> >> >> jaxb-impl-2.0.5.jar
> >> >> jaxb-xjc-2.0.1.jar
> >> >> jaxen-1.1.jar
> >> >> jaxws-api-2.0.jar
> >> >> jcommon-1.0.6.jar
> >> >> jcs-1.3.jar
> >> >> jdom-1.0.jar
> >> >> jfreechart-1.0.3.jar
> >> >> jsr173_api-1.0.jar
> >> >> jstl.jar
> >> >> jta.jar
> >> >> jt-cron.jar
> >> >> log4j-1.2.14.jar
> >> >> mail.jar
> >> >> mysql-connector-java-5.0.4-bin.jar
> >> >> saaj-api-1.3.jar
> >> >> saaj-impl-1.3.jar
> >> >> spring.jar
> >> >> spring-aspects.jar
> >> >> spring-beans.jar
> >> >> spring-context.jar
> >> >> spring-core.jar
> >> >> spring-dao.jar
> >> >> spring-hibernate3.jar
> >> >> spring-jdbc.jar
> >> >> spring-mock.jar
> >> >> spring-remoting.jar
> >> >> spring-web.jar
> >> >> spring-webmvc.jar
> >> >> standard.jar
> >> >> stax-api-1.0.1.jar
> >> >> wsdl4j-1.6.1.jar
> >> >> wstx-asl-3.2.1.jar
> >> >> XmlSchema-1.2.jar
> >> >>
> >> >>
> >> >> <?xml version="1.0" encoding="UTF-8"?>
> >> >> <beans
> >> >>         xmlns="http://www.springframework.org/schema/beans"
> >> >>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >>         xmlns:lang="http://www.springframework.org/schema/lang"
> >> >>         xmlns:util="http://www.springframework.org/schema/util"
> >> >>
> >> xsi:schemaLocation="http://www.springframework.org/schema/beans
> >> >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> >> >>         http://www.springframework.org/schema/lang
> >> >> http://www.springframework.org/schema/lang/spring-lang-2.0.xsd
> >> >>         http://www.springframework.org/schema/util
> >> >> http://www.springframework.org/schema/util/spring-util-2.0.xsd"
> >> >>         >
> >> >>         <import resource="classpath:META-INF/cxf/cxf.xml" />
> >> >>         <import
> >> >> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> >> >>         <import resource="classpath:META-INF/cxf/cxf-servlet.xml"
/>
> >> >>
> >> >>         <jaxws:enpoint id="allWs"
> >> >> implementor="com.madeupname.madeupproduct.ws.example.AllWsImpl"
> >> >> address="/webservice/allWebServices" />
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On 7/13/07, Jiang, Ning (Willem) <Ning.Jiang@iona.com> wrote:
> >> >> > Can you show me your bean.xml?
> >> >> >
> >> >> > I think you do not use the bundle jar, right?
> >> >> > You need to add the resourceManager implementation jar in the
class
> >> >> path.
> >> >> > It is cxf-common-utilities-2.0-incubator.jar in the
> >> >> CXF_INSTALL\modules\ directory.
> >> >> >
> >> >> > Willem.
> >> >> >
> >> >> > -----Original Message-----
> >> >> > From: Scott Archer [mailto:scott.archer@gmail.com]
> >> >> > Sent: Fri 7/13/2007 22:46
> >> >> > To: cxf-dev@incubator.apache.org
> >> >> > Subject: Problem with CXFServlet - migrating from xfire to CXF
> >> >> >
> >> >> > I'm trying to migrate from xfire to CXF.
> >> >> >
> >> >> > When my application starts up I get the following Exception.
> >> >> > I checked the CXFServlet at line 148 and It looks like the
> >> problem is
> >> >> > actually on line 147.
> >> >> >
> >> >> > ResourceManager resourceManager =
> >> >> bus.getExtension(ResourceManager.class);
> >> >> >
> >> >> > This call is returning null for the resourceManager. I'm not really
> >> >> > sure why, and I don't know where to look, so I thought I'd try
the
> >> >> > mailing list.
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > Scott
> >> >> >
> >> >> >
> >> >> > java.lang.NullPointerException
> >> >> >         at
> >> >>
> >> org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:148)
> >>
> >> >>
> >> >> >         at
> >> >> org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:96)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
> >>
> >> >>
> >> >> >         at
> >> >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
> >> >> >         at
> >> >> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> >> >> >         at
> >> >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardService.start(StandardService.java:448)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> >> >> >         at
> >> >> org.apache.catalina.startup.Catalina.start(Catalina.java:552)
> >> >> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >> >> >         at
> >> >>
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>
> >> >>
> >> >> >         at java.lang.reflect.Method.invoke(Method.java:585)
> >> >> >         at
> >> >> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> >> >> >         at
> >> >> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> >> >> > Jul 13, 2007 9:34:16 AM org.apache.catalina.core.StandardContext
> >> >> loadOnStartup
> >> >> > SEVERE: Servlet /econnect threw load() exception
> >> >> > java.lang.NullPointerException
> >> >> >         at
> >> >>
> >> org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:148)
> >>
> >> >>
> >> >> >         at
> >> >> org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:96)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
> >>
> >> >>
> >> >> >         at
> >> >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
> >> >> >         at
> >> >> org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> >> >> >         at
> >> >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardService.start(StandardService.java:448)
> >> >> >         at
> >> >>
> >> org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> >> >> >         at
> >> >> org.apache.catalina.startup.Catalina.start(Catalina.java:552)
> >> >> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> Method)
> >> >> >         at
> >> >>
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>
> >> >>
> >> >> >         at
> >> >>
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>
> >> >>
> >> >> >         at java.lang.reflect.Method.invoke(Method.java:585)
> >> >> >         at
> >> >> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> >> >> >         at
> >> >> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> >> >> > Jul 13, 2007 9:34:16 AM org.apache.coyote.http11.Http11Protocol
> >> start
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >
>



Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message