So basically, I should just have to add those lines...But I tried this, and
it won't work. I still have the same errors...


Willem2 wrote:
> 
> 
> The importing files are the cxf componets' spring configuration files. 
> They are in the cxf*.jar's META-INF/cxf/ directory and not in the WEB-INF
> directory.
> Since your server configuration file has the bus defintions , when the
> CXFSerlvet load the bus , it will not load the defualt bus and core
> components (which is in the META-INF/cxf/cxf.xml), and soap component
> (which is in META-INF/cxf/cxf-extension-soap.xml). 
> That is the cause of the NPE.
> 
> Willem.
> 
> 
> 
> -----Original Message-----
> From: Tophebboy [mailto:[EMAIL PROTECTED]
> Sent: 12/18/2007 (星期二) 21:04
> To: cxf-user@incubator.apache.org
> Subject: RE: SOAP flow Compression?
>  
> 
> Thanks for your answer!
> I only have a cxf-servlet.xml and a server.xml in the WEB-INF directory.
> What should I put un cxf.xml and in cxf-servlet.xml? Where could I find
> examples for those files?
> Thanks a lot!
> 
> 
> Willem2 wrote:
>> 
>> Please add the below lines at the head of your server.xml
>> 
>>   <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"/>
>> 
>> So you can get the enough componets to publish the services.
>> You can find more information here [1]
>> 
>> [1]http://cwiki.apache.org/CXF20DOC/servlet-transport.html
>> 
>> Willem.
>> -----Original Message-----
>> From: Tophebboy [mailto:[EMAIL PROTECTED]
>> Sent: 12/18/2007 18:32
>> To: cxf-user@incubator.apache.org
>> Subject: Re: SOAP flow Compression?
>>  
>> 
>> Hi!
>> Here is my web.xml content:
>> ======================================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE web-app
>>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>     "http://java.sun.com/dtd/web-app_2_3.dtd";>
>> <web-app>
>>      <display-name>cxf</display-name>
>>      <description>cxf</description>
>>      <context-param>
>>              <param-name>contextConfigLocation</param-name>
>>              <param-value>WEB-INF/server.xml</param-value>
>>      </context-param>
>>      <listener>
>>              <listener-class>
>>                      org.springframework.web.context.ContextLoaderListener
>>              </listener-class>
>>      </listener>
>>      <servlet>
>>              <servlet-name>cxf</servlet-name>
>>              <display-name>cxf</display-name>
>>              <description>Apache CXF Endpoint</description>
>>              <servlet-class>
>>                      org.apache.cxf.transport.servlet.CXFServlet
>>              </servlet-class>
>>              <load-on-startup>1</load-on-startup>
>>      </servlet>
>>      <servlet-mapping>
>>              <servlet-name>cxf</servlet-name>
>>              <url-pattern>/services/*</url-pattern>
>>      </servlet-mapping>
>>      <session-config>
>>              <session-timeout>60</session-timeout>
>>      </session-config>
>> </web-app>
>> ======================================
>> And my server.xml content:
>> ======================================
>> <beans xmlns="http://www.springframework.org/schema/beans";
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>        xmlns:cxf="http://cxf.apache.org/core";
>>        xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>> http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd";>
>>      <bean id="GZIPStream"
>>              
>> class="com.structis.edoc.services.utils.interceptors.StreamInterceptor"
>> />
>> 
>>      <!-- We are adding the interceptors to the bus as we will have only one
>> endpoint/service/bus. -->
>>    <cxf:bus>
>>         <cxf:inInterceptors>
>>             <list>
>>                 <ref bean="GZIPStream"/>
>>             </list>
>>         </cxf:inInterceptors>
>>         <cxf:outInterceptors>
>>             <list>
>>                 <ref bean="GZIPStream"/>
>>             </list>
>>         </cxf:outInterceptors>
>>     </cxf:bus>       
>> </beans>
>> 
>> ======================================
>> Thanks a lot!
>> Chris
>> 
>> 
>> 
>> Willem2 wrote:
>>> 
>>> Hi,
>>> 
>>> Can I see your bus configuration file ?
>>> The NPE is caused by you do not set the bus rightly.
>>> I just checked the code ,  you may not include the right bus.
>>> 
>>> Willem.
>>> Tophebboy wrote:
>>>> On top of that, on the server side, launching Tomcat now gives me 2
>>>> errors:
>>>> 17 déc. 2007 14:45:35 org.apache.cxf.transport.servlet.CXFServlet
>>>> loadSpringBus
>>>> INFO: load the bus with application context
>>>> 14:45:35,482 ERROR [main]
>>>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/EDocRequest]
>>>> - StandardWrapper.Throwable
>>>> java.lang.NullPointerException
>>>>    at
>>>> org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:162)
>>>>    at
>>>> org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98)
>>>>    at
>>>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
>>>>    at
>>>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
>>>>    at
>>>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
>>>>    at
>>>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>>>>    at
>>>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
>>>>    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>>>>    at
>>>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>>>>    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>>>>    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:700)
>>>>    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>    at java.lang.reflect.Method.invoke(Unknown Source)
>>>>    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>>>>    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
>>>> 14:45:35,482 ERROR [main]
>>>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/EDocRequest]
>>>> - La servlet /EDocRequest a généré une exception "load()"
>>>> java.lang.NullPointerException
>>>>    at
>>>> org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:162)
>>>>    at
>>>> org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98)
>>>>    at
>>>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
>>>>    at
>>>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
>>>>    at
>>>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
>>>>    at
>>>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>>>>    at
>>>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
>>>>    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
>>>>    at
>>>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>>>>    at
>>>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>>>>    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>>>>    at
>>>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>>>>    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:700)
>>>>    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>>>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>>>    at java.lang.reflect.Method.invoke(Unknown Source)
>>>>    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>>>>    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
>>>>
>>>>
>>>>
>>>>
>>>> Tophebboy wrote:
>>>>   
>>>>> Anyway, I put a new xml file, server.xml and made a reference to it in
>>>>> my
>>>>> web.xml file as an application context file and it seems to be seen by
>>>>> Tomcat.
>>>>> But I still have the same problem:
>>>>> on my client side (I just put a cxf.xml file in my client which is
>>>>> referring my interceptor, just like in the CXF sample), I have this
>>>>> error:
>>>>>
>>>>> INFO: Interceptor has thrown exception, unwinding now
>>>>> org.apache.cxf.binding.soap.SoapFault: "null" is not a valid SOAP
>>>>> version.
>>>>>
>>>>> It is really weird and I don't understand what is going on...
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Willem2 wrote:
>>>>>     
>>>>>> Maybe you need report a Bug for STP.
>>>>>> BTW,
>>>>>> You can't add any interceptor in the cxf-servlet.xml , it just uses
>>>>>> for
>>>>>> loading the endpoints with a already initiated bus.
>>>>>>
>>>>>> Willem.
>>>>>>
>>>>>>
>>>>>> Tophebboy wrote:
>>>>>>       
>>>>>>> Yes, I'm using Eclipse STP and SOA tools.
>>>>>>> When you generate the code from your wsdl, a web.xml and a
>>>>>>> cxf-servlet.xml are generated in the same folder as the wsdl. The
>>>>>>> same
>>>>>>> process occurs when you generates your war. And the generated files
>>>>>>> always overwrite your files...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Glen Mazza-2 wrote:
>>>>>>>         
>>>>>>>> Am Donnerstag, den 13.12.2007, 08:45 -0800 schrieb Tophebboy:
>>>>>>>>           
>>>>>>>>> I already saw that...But I think I'm missing something...I read it
>>>>>>>>> twice and
>>>>>>>>> it still doesn't work!!
>>>>>>>>> Anyway, I found a way of activating it copying the interceptor
>>>>>>>>> bean
>>>>>>>>> definition in the cxf-servlet.xml file (I have to this after
>>>>>>>>> deploying
>>>>>>>>> the
>>>>>>>>> project because each time I create a war file, eclipse erases my
>>>>>>>>> cxf-servlet.xml file to put the default one at its place). 
>>>>>>>>>             
>>>>>>>> I still don't understand this.  Why would Eclipse have a "default"
>>>>>>>> cxf-servlet.xml file that it surreptitiously inserts in the WAR? 
>>>>>>>> That
>>>>>>>> file is completely specific to CXF, most Eclipse committers have
>>>>>>>> never
>>>>>>>> even heard of that file.  Are you using the Eclipse SOA Tools
>>>>>>>> plugin--maybe *it* does something strange like this.
>>>>>>>>
>>>>>>>>
>>>>>>>>           
>>>>>>>>> I also copied the
>>>>>>>>> client xml file in my client app, naming it cxf.xml.
>>>>>>>>> The problem is that when I try to call my web service from the
>>>>>>>>> client,
>>>>>>>>> I
>>>>>>>>> have now this exception:
>>>>>>>>> java.io.IOException: Not in GZIP format
>>>>>>>>> It seems to occur in the client which is receiving a message.
>>>>>>>>> That's
>>>>>>>>> weird
>>>>>>>>> because the first step is to send a request to the server, isn't
>>>>>>>>> it?
>>>>>>>>> And the
>>>>>>>>> error occurs before the handleMessage method on the server is
>>>>>>>>> called...
>>>>>>>>> I really don't understand what is going on...:-(
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>             
>>>>>>>> The email I just sent a few minutes ago to Jan in Germany had links
>>>>>>>> to
>>>>>>>> a
>>>>>>>> Ant- and Maven- based builds, neither of which touch your
>>>>>>>> cxf-servlet.xml file and neither (at least in my case) caused these
>>>>>>>> error messages to occur.  You may wish to move from IDE-based
>>>>>>>> creation
>>>>>>>> of web services to Maven or Ant-based instead.
>>>>>>>>
>>>>>>>> Glen
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>           
>>>>>>>         
>>>>>>       
>>>>>     
>>>>
>>>>   
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/SOAP-flow-Compression--tp14299256p14391705.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/SOAP-flow-Compression--tp14299256p14396496.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SOAP-flow-Compression--tp14299256p14397070.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to