You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by MyScreenName <bo...@nortel.com> on 2007/12/06 22:59:32 UTC

java.lang.NullPointerException

CXF versions: 2.0.3 and 2.1
Using JAXWS/Annotations

When I start my server (Jboss) I get the following error.  The wierd thing
is that the Web service works.  I can call the operations as well as
retrieve the WSDL.  Anybody run into this?

16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
org.apache.cxf.configuration.spring.ConfigurerImpl <init>
WARNING: Failed to create application context.
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'TestName': Invocation of init me
thod failed; nested exception is java.lang.NullPointerException
Caused by: java.lang.NullPointerException
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
java:157)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
:99)
-- 
View this message in context: http://www.nabble.com/java.lang.NullPointerException-tf4958831.html#a14201919
Sent from the cxf-user mailing list archive at Nabble.com.


Re: java.lang.NullPointerException

Posted by Willem2 <ni...@iona.com>.
If you publish the endpoints with cxf-servlet.xml (Note it is not the
"META-INF/cxf/cxf-servlet.xml")
Since the bus is already loaded by CXFServlet, you do not need to import
cxf.xml , cxf-extension-soap.xml 

But if you define the endpoints in beans.xml which load with spring
application context listener.
You need to make sure the bus will be load rightly, in your case you already
setup the bus with the interceptors and when the CXFSpringBusFactory create
the bus , CXFServlet will not search the default configuration (include
cxf.xml , cxf-extens*.xml) for you, since the CXFSpringBusFactory detects
here is already cxf bus there. 

So you will get a NPE here.

Now you just need to set your bus configuration with <cxf:bus> tags as the
doc[1]

[1] http://cwiki.apache.org/CXF20DOC/bus-configuration.html

Willem. 


MyScreenName wrote:
> 
> Here's my config file.  I've used Spring 2.0.6 and 2.0.4.  Both seem to do
> the same thing.  Missing are the import statements for the cxf.xml,
> cxf-servlet.xml, etc. because I thought I read somewhere that you could
> provide all the config in one file.
> 
> Thanks,
> Bob
> 
> -----------------------------------  Beans Config File
> -------------------------------------
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:jaxws="http://cxf.apache.org/jaxws"
>       xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd">
> 
>     <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>     <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>     <bean id="SoapPreambleHandler"
> class="com.nortel.webservices.mpsip.interceptors.SoapPreambleHandler"/>
>     
>     <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
>  
>         <property name="inInterceptors">
>             <list>
>                 <ref bean="logInbound"/>
>                 <ref bean="SoapPreambleHandler"/>
>             </list>
>         </property>
>         <property name="outInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>         <property name="outFaultInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>     </bean> 
>     
>     <jaxws:endpoint 
>         id="TestName" 
>         implementor="com.nortel.webservices.xxxxx.service.CTI_WebService"
>         address="http://localhost:8080/TestName_WebServices">
>     </jaxws:endpoint>
> </beans>
> 
> ----------------------------------------------------------------------------------------------
> 
> 
> Willem2 wrote:
>> 
>> Hi,
>> 
>> I just checked the code,  it looks like you can't get the 
>> DestinationManager from bus .
>> Can you show the configuration file for us to dig the problem ?
>> BTW, which spring version are you using?
>> 
>> Willem.
>> MyScreenName wrote:
>>> CXF versions: 2.0.3 and 2.1
>>> Using JAXWS/Annotations
>>>
>>> When I start my server (Jboss) I get the following error.  The wierd
>>> thing
>>> is that the Web service works.  I can call the operations as well as
>>> retrieve the WSDL.  Anybody run into this?
>>>
>>> 16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
>>> org.apache.cxf.configuration.spring.ConfigurerImpl <init>
>>> WARNING: Failed to create application context.
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean
>>> with name 'TestName': Invocation of init me
>>> thod failed; nested exception is java.lang.NullPointerException
>>> Caused by: java.lang.NullPointerException
>>>         at
>>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
>>> java:157)
>>>         at
>>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
>>> :99)
>>>   
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/java.lang.NullPointerException-tf4958831.html#a14224738
Sent from the cxf-user mailing list archive at Nabble.com.


Re: java.lang.NullPointerException

Posted by MyScreenName <bo...@nortel.com>.
Got it working.  Thanks!!!



Glen Mazza-2 wrote:
> 
> Am Freitag, den 07.12.2007, 06:12 -0800 schrieb MyScreenName:
>> Here's my config file.  I've used Spring 2.0.6 and 2.0.4.  Both seem to
>> do
>> the same thing.  Missing are the import statements for the cxf.xml,
>> cxf-servlet.xml, etc. because I thought I read somewhere that you could
>> provide all the config in one file.
> 
> Be careful--there are unfortunately *two* types of cxf-servlet.xml
> config files.  The one above you are mentioning does indeed need to be
> included in your Spring beans file.  Please look again at the examples
> under "Server configuration" here:
> http://cwiki.apache.org/CXF20DOC/configuration.html
> 
> You can avoid including these imports if you use a cxf-servlet.xml file
> (which is the other type of cxf-servlet.xml) in your WEB-INF/ directory,
> because it includes all of the modules by default.  The above link (and
> #1 below) also includes an example of using this option.  Probably you
> should stay with your Spring config file instead though.
> 
> HTH,
> Glen
> 
> [1] http://www.jroller.com/gmazza/date/20071019#step8
> 
>> 
>> Thanks,
>> Bob
>> 
>> -----------------------------------  Beans Config File
>> -------------------------------------
>> 
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:jaxws="http://cxf.apache.org/jaxws"
>>       xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>> http://cxf.apache.org/jaxws
>> http://cxf.apache.org/schemas/jaxws.xsd">
>> 
>>     <bean id="logInbound"
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>>     <bean id="logOutbound"
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>>     <bean id="SoapPreambleHandler"
>> class="com.nortel.webservices.mpsip.interceptors.SoapPreambleHandler"/>
>>     
>>     <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
>>  
>>         <property name="inInterceptors">
>>             <list>
>>                 <ref bean="logInbound"/>
>>                 <ref bean="SoapPreambleHandler"/>
>>             </list>
>>         </property>
>>         <property name="outInterceptors">
>>             <list>
>>                 <ref bean="logOutbound"/>
>>             </list>
>>         </property>
>>         <property name="outFaultInterceptors">
>>             <list>
>>                 <ref bean="logOutbound"/>
>>             </list>
>>         </property>
>>     </bean> 
>>     
>>     <jaxws:endpoint 
>>         id="TestName" 
>>         implementor="com.nortel.webservices.xxxxx.service.CTI_WebService"
>>         address="http://localhost:8080/TestName_WebServices">
>>     </jaxws:endpoint>
>> </beans>
>> 
>> ----------------------------------------------------------------------------------------------
>> 
>> 
>> Willem2 wrote:
>> > 
>> > Hi,
>> > 
>> > I just checked the code,  it looks like you can't get the 
>> > DestinationManager from bus .
>> > Can you show the configuration file for us to dig the problem ?
>> > BTW, which spring version are you using?
>> > 
>> > Willem.
>> > MyScreenName wrote:
>> >> CXF versions: 2.0.3 and 2.1
>> >> Using JAXWS/Annotations
>> >>
>> >> When I start my server (Jboss) I get the following error.  The wierd
>> >> thing
>> >> is that the Web service works.  I can call the operations as well as
>> >> retrieve the WSDL.  Anybody run into this?
>> >>
>> >> 16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
>> >> org.apache.cxf.configuration.spring.ConfigurerImpl <init>
>> >> WARNING: Failed to create application context.
>> >> org.springframework.beans.factory.BeanCreationException: Error
>> creating
>> >> bean
>> >> with name 'TestName': Invocation of init me
>> >> thod failed; nested exception is java.lang.NullPointerException
>> >> Caused by: java.lang.NullPointerException
>> >>         at
>> >>
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
>> >> java:157)
>> >>         at
>> >>
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
>> >> :99)
>> >>   
>> > 
>> > 
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/java.lang.NullPointerException-tf4958831.html#a14218815
Sent from the cxf-user mailing list archive at Nabble.com.


Re: java.lang.NullPointerException

Posted by Glen Mazza <gl...@verizon.net>.
Am Freitag, den 07.12.2007, 06:12 -0800 schrieb MyScreenName:
> Here's my config file.  I've used Spring 2.0.6 and 2.0.4.  Both seem to do
> the same thing.  Missing are the import statements for the cxf.xml,
> cxf-servlet.xml, etc. because I thought I read somewhere that you could
> provide all the config in one file.

Be careful--there are unfortunately *two* types of cxf-servlet.xml
config files.  The one above you are mentioning does indeed need to be
included in your Spring beans file.  Please look again at the examples
under "Server configuration" here:
http://cwiki.apache.org/CXF20DOC/configuration.html

You can avoid including these imports if you use a cxf-servlet.xml file
(which is the other type of cxf-servlet.xml) in your WEB-INF/ directory,
because it includes all of the modules by default.  The above link (and
#1 below) also includes an example of using this option.  Probably you
should stay with your Spring config file instead though.

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20071019#step8

> 
> Thanks,
> Bob
> 
> -----------------------------------  Beans Config File
> -------------------------------------
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xmlns:jaxws="http://cxf.apache.org/jaxws"
>       xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd">
> 
>     <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>     <bean id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>     <bean id="SoapPreambleHandler"
> class="com.nortel.webservices.mpsip.interceptors.SoapPreambleHandler"/>
>     
>     <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
>  
>         <property name="inInterceptors">
>             <list>
>                 <ref bean="logInbound"/>
>                 <ref bean="SoapPreambleHandler"/>
>             </list>
>         </property>
>         <property name="outInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>         <property name="outFaultInterceptors">
>             <list>
>                 <ref bean="logOutbound"/>
>             </list>
>         </property>
>     </bean> 
>     
>     <jaxws:endpoint 
>         id="TestName" 
>         implementor="com.nortel.webservices.xxxxx.service.CTI_WebService"
>         address="http://localhost:8080/TestName_WebServices">
>     </jaxws:endpoint>
> </beans>
> 
> ----------------------------------------------------------------------------------------------
> 
> 
> Willem2 wrote:
> > 
> > Hi,
> > 
> > I just checked the code,  it looks like you can't get the 
> > DestinationManager from bus .
> > Can you show the configuration file for us to dig the problem ?
> > BTW, which spring version are you using?
> > 
> > Willem.
> > MyScreenName wrote:
> >> CXF versions: 2.0.3 and 2.1
> >> Using JAXWS/Annotations
> >>
> >> When I start my server (Jboss) I get the following error.  The wierd
> >> thing
> >> is that the Web service works.  I can call the operations as well as
> >> retrieve the WSDL.  Anybody run into this?
> >>
> >> 16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
> >> org.apache.cxf.configuration.spring.ConfigurerImpl <init>
> >> WARNING: Failed to create application context.
> >> org.springframework.beans.factory.BeanCreationException: Error creating
> >> bean
> >> with name 'TestName': Invocation of init me
> >> thod failed; nested exception is java.lang.NullPointerException
> >> Caused by: java.lang.NullPointerException
> >>         at
> >> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
> >> java:157)
> >>         at
> >> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
> >> :99)
> >>   
> > 
> > 
> 


Re: java.lang.NullPointerException

Posted by MyScreenName <bo...@nortel.com>.
Here's my config file.  I've used Spring 2.0.6 and 2.0.4.  Both seem to do
the same thing.  Missing are the import statements for the cxf.xml,
cxf-servlet.xml, etc. because I thought I read somewhere that you could
provide all the config in one file.

Thanks,
Bob

-----------------------------------  Beans Config File
-------------------------------------

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">

    <bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
    <bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
    <bean id="SoapPreambleHandler"
class="com.nortel.webservices.mpsip.interceptors.SoapPreambleHandler"/>
    
    <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
 
        <property name="inInterceptors">
            <list>
                <ref bean="logInbound"/>
                <ref bean="SoapPreambleHandler"/>
            </list>
        </property>
        <property name="outInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
        <property name="outFaultInterceptors">
            <list>
                <ref bean="logOutbound"/>
            </list>
        </property>
    </bean> 
    
    <jaxws:endpoint 
        id="TestName" 
        implementor="com.nortel.webservices.xxxxx.service.CTI_WebService"
        address="http://localhost:8080/TestName_WebServices">
    </jaxws:endpoint>
</beans>

----------------------------------------------------------------------------------------------


Willem2 wrote:
> 
> Hi,
> 
> I just checked the code,  it looks like you can't get the 
> DestinationManager from bus .
> Can you show the configuration file for us to dig the problem ?
> BTW, which spring version are you using?
> 
> Willem.
> MyScreenName wrote:
>> CXF versions: 2.0.3 and 2.1
>> Using JAXWS/Annotations
>>
>> When I start my server (Jboss) I get the following error.  The wierd
>> thing
>> is that the Web service works.  I can call the operations as well as
>> retrieve the WSDL.  Anybody run into this?
>>
>> 16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
>> org.apache.cxf.configuration.spring.ConfigurerImpl <init>
>> WARNING: Failed to create application context.
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean
>> with name 'TestName': Invocation of init me
>> thod failed; nested exception is java.lang.NullPointerException
>> Caused by: java.lang.NullPointerException
>>         at
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
>> java:157)
>>         at
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
>> :99)
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/java.lang.NullPointerException-tf4958831.html#a14213226
Sent from the cxf-user mailing list archive at Nabble.com.


Re: java.lang.NullPointerException

Posted by Willem Jiang <ni...@iona.com>.
Hi,

I just checked the code,  it looks like you can't get the 
DestinationManager from bus .
Can you show the configuration file for us to dig the problem ?
BTW, which spring version are you using?

Willem.
MyScreenName wrote:
> CXF versions: 2.0.3 and 2.1
> Using JAXWS/Annotations
>
> When I start my server (Jboss) I get the following error.  The wierd thing
> is that the Web service works.  I can call the operations as well as
> retrieve the WSDL.  Anybody run into this?
>
> 16:33:09,099 ERROR [STDERR] Dec 6, 2007 4:33:09 PM
> org.apache.cxf.configuration.spring.ConfigurerImpl <init>
> WARNING: Failed to create application context.
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'TestName': Invocation of init me
> thod failed; nested exception is java.lang.NullPointerException
> Caused by: java.lang.NullPointerException
>         at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.
> java:157)
>         at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java
> :99)
>