> -----Original Message-----
> From: Daniel Kulp [mailto:dk...@apache.org]
> Sent: Thursday, October 21, 2010 19:08
> To: users@cxf.apache.org
> Cc: Gary Gregory
> Subject: Re: NullPointerException migrating from 2.1.10 to CXF 2.3.0 and
> 2.2.11
> 
> On Thursday 21 October 2010 8:46:37 pm Gary Gregory wrote:
> > > -----Original Message-----
> > > From: Daniel Kulp [mailto:dk...@apache.org]
> > > Sent: Thursday, October 21, 2010 15:55
> > > To: Gary Gregory
> > > Cc: users@cxf.apache.org
> > > Subject: Re: NullPointerException migrating from 2.1.10 to CXF 2.3.0 and
> > > 2.2.11
> > >
> > > On Thursday 21 October 2010 6:54:54 pm Gary Gregory wrote:
> > > > Hi Dan and all:
> > > >
> > > > In CXF 2.2.10, the method is:
> > > >     protected String getBasePath(String contextPath) throws IOException
> > > >     {
> > > >
> > > >         return contextPath + getAddress().getAddress().getValue();
> > > >
> > > >     }
> > > >
> > > > In my unit test, contextPath is "" and
> > > > "getAddress().getAddress().getValue()" returns null, so the method
> > > > returns "null" instead of blowing up.
> > >
> > > That should be the address that is configured for the service to be
> > > deployed on.  Are you using spring  "jaxws:endpoint" type things?   A
> > > service factory? etc....    That's what I'd like to see.
> >
> > Helmet on, digging through code.
> >
> > We do /everything/ dynamically. We have a custom servlet extending
> > CXFServlet that lives in Jetty 7.1.6 and does this:
> >
> > EndpointImpl endpoint = (EndpointImpl) Endpoint.create(new
> > LdeWebServiceProvider());
> >
> > In the servet's init method:
> >
> >     /**
> >      * Create the appropriate CXF objects, e.g. Endpoint, and initialize
> > the various Interceptors needed for things like validation, *
> > transformation, and WS-Security.
> >      *
> >      * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
> >      */
> >     @Override
> >     public void init(ServletConfig config) throws ServletException {
> >         super.init(config);
> >         EndpointImpl endpoint = (EndpointImpl) Endpoint.create(new
> > LdeWebServiceProvider()); if (LOG.isDebugEnabled()) {
> >             LOG.debug(CLASS_LOG_PREFIX + "Created EndpointImpl: " +
> > endpoint); }
> >         this.initValidators(config, endpoint);
> >         this.initTransformations(config, endpoint);
> >         this.initWsSecurity(config, endpoint);
> >         if (!this.getOmitXmlDeclaration()) {
> >             endpoint.getOutInterceptors().add(new XmlDeclOutInterceptor());
> >             endpoint.getOutFaultInterceptors().add(new
> > XmlDeclOutInterceptor()); }
> >         if (LOG.isDebugEnabled()) {
> >             endpoint.getFeatures().add(new LoggingFeature());
> >         }
> >         endpoint.publish();
> >     }
> 
> Interesting.  I'm actually surprised that works unless there is a resolvable
> wsdlLocation on the LdeWebServiceProvider class.    The endpoint.publish
> doesn't provide any sort of address.     Could you TRY changing that to
> endpoint.publish("/") or just endpoint.publish("") and seeing if that changes
> the behavior at all?  Mostly just curious.

Both endpoint.publish("/") and endpoint.publish("") work!

Which solution workaround is safest?

> 
> ANYWAY, that's the information I needed to create a test case.

I'm calling you Doctor Dan from now on :)

Thank you,

Gary

> 
> Dan
> 
> >
> > And see this in our server log:
> >
> > 2010-10-21 17:35:52,391 [...@qtp0-6] INFO : Creating Service
> > {http://soap.comm.server.appinterface.seagullsw.com/}LdeWebServiceProvider
> > Service from class
> > com.seagullsw.appinterface.server.comm.soap.SoapServletCxf$LdeWebServicePr
> > ovider 2010-10-21 17:35:52,510 [...@qtp0-6] INFO : Setting the server's
> > publish address to be null
> >
> > The last line being the problem.
> >
> > How do I set the address?
> >
> > Thank you,
> 
> 
> --
> Daniel Kulp
> dk...@apache.org
> http://dankulp.com/blog

Reply via email to