cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <GGreg...@seagullsoftware.com>
Subject RE: NullPointerException migrating from 2.1.10 to CXF 2.3.0 and 2.2.11
Date Fri, 22 Oct 2010 00:46:37 GMT
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@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();
    }

And see this in our server log:

2010-10-21 17:35:52,391 [22@qtp0-6] INFO : Creating Service {http://soap.comm.server.appinterface.seagullsw.com/}LdeWebServiceProviderService
from class com.seagullsw.appinterface.server.comm.soap.SoapServletCxf$LdeWebServiceProvider
2010-10-21 17:35:52,510 [22@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,
Gary

> 
> Dan
> 
> 
> 
> > Where does the value from "getAddress().getAddress().getValue()" gets its
> > value? From a (Jetty) config file or from the incoming HTTP SOAP?
> >
> > In CXF 2.2.11, the method is:
> >
> > protected String getBasePath(String contextPath) throws IOException {
> >   String address = getAddress().getAddress().getValue();
> >   if (address.startsWith("http")) {
> >      return URI.create(address).getPath();
> >   }
> >   return contextPath + address;
> > }
> >
> > Thank you,
> >
> > Gary
> >
> > > -----Original Message-----
> > > From: Gary Gregory [mailto:GGregory@seagullsoftware.com]
> > > Sent: Thursday, October 21, 2010 15:25
> > > To: users@cxf.apache.org; Daniel Kulp
> > > Subject: RE: NullPointerException migrating from 2.1.10 to CXF 2.3.0 and
> > > 2.2.11
> > >
> > > Here is my HttpClient debug output that shows the issue from the client
> > > side.
> > >
> > > Is the problem the simple "/" in the POST? As opposed to "/Foo"?
> > >
> > > 2010-10-21 15:05:50,746 [main] DEBUG: Get connection for route
> > > HttpRoute[{}-
> > >
> > > >http://localhost:8071]
> > >
> > > 2010-10-21 15:05:50,780 [main] DEBUG: CookieSpec selected: best-match
> > > 2010-10-21 15:05:50,797 [main] DEBUG: Attempt 1 to execute request
> > > 2010-10-21 15:05:50,798 [main] DEBUG: Sending request: POST / HTTP/1.1
> > > 2010-10-21 15:05:50,798 [main] DEBUG: >> "POST / HTTP/1.1[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "Content-Type: text/xml[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "Content-Length: 700[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "Host: localhost:8071[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "Connection: Keep-Alive[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "User-Agent:
> > > Apache-HttpClient/4.0.3 (java 1.5)[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "Expect: 100-Continue[EOL]"
> > > 2010-10-21 15:05:50,799 [main] DEBUG: >> "[EOL]"
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> POST / HTTP/1.1
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> Content-Type: text/xml
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> Content-Length: 700
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> Host: localhost:8071
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> Connection: Keep-Alive
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> User-Agent:
> > > Apache-HttpClient/4.0.3 (java 1.5)
> > > 2010-10-21 15:05:50,800 [main] DEBUG: >> Expect: 100-Continue
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >> "<?xml version="1.0"
> > > encoding="UTF- 8"?>[\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >> "<soapenv:Envelope
> > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">[\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >> "[0x9]<soapenv:Header>[\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >> "[0x9][0x9]<requestID>{c0a80102-
> > > 00ce16ad0000010e75da25398002}</requestID>[\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >> "[0x9][0x9]<tns:docLitHeader
> > > xmlns:tns="http://com.seagullsw.appinterface/AppInterfaceServer"/>[\r][\n
> > > ]" 2010-10-21 15:05:52,848 [main] DEBUG: >>
> > > "[0x9]</soapenv:Header>[\r][\n]" 2010-10-21 15:05:52,848 [main] DEBUG:
> > > >> "[0x9]<soapenv:Body>[\r][\n]" 2010-10-21 15:05:52,848 [main]
DEBUG:
> > > >>
> > > "[0x9][0x9]<tns:test.oneStringArg[\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >>
> > > "[0x9][0x9][0x9]xmlns:tns="http://com.seagullsw.appinterface/AppInterface
> > > Serve r" [\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >>
> > > "[0x9][0x9][0x9]xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > > [\r][\n]"
> > > 2010-10-21 15:05:52,848 [main] DEBUG: >>
> > > "[0x9][0x9][0x9]xmlns:xsd="http://www.w3.org/2001/XMLSchema"[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >>
> > > "[0x9][0x9][0x9]xmlns:xsi="http://www.w3.org/2001/XMLSchema-
> > > instance">[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >> "[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >>
> > > "[0x9][0x9][0x9]<aString>aStringValue</aString>[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >>
> > > "[0x9][0x9]</tns:test.oneStringArg>[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >> "[0x9]</soapenv:Body>[\r][\n]"
> > > 2010-10-21 15:05:52,849 [main] DEBUG: >> "</soapenv:Envelope>[\r][\n]"
> > > 2010-10-21 15:05:55,219 [main] DEBUG: << "HTTP/1.1 100 Continue[EOL]"
> > > 2010-10-21 15:05:55,223 [main] DEBUG: << "[EOL]"
> > > 2010-10-21 15:05:55,223 [main] DEBUG: Receiving response: HTTP/1.1 100
> > > Continue
> > > 2010-10-21 15:05:55,223 [main] DEBUG: << HTTP/1.1 100 Continue
> > > 2010-10-21 15:05:55,255 [main] DEBUG: << "HTTP/1.1 500 Server Error[EOL]"
> > > 2010-10-21 15:05:55,255 [main] DEBUG: << "Content-Type:
> > > text/html;charset=ISO- 8859-1[EOL]"
> > > 2010-10-21 15:05:55,255 [main] DEBUG: << "Cache-Control:
> > > must-revalidate,no- cache,no-store[EOL]"
> > > 2010-10-21 15:05:55,255 [main] DEBUG: << "Content-Length: 4035[EOL]"
> > > 2010-10-21 15:05:55,255 [main] DEBUG: << "Server:
> > > Jetty(7.1.6.v20100715)[EOL]" 2010-10-21 15:05:55,255 [main] DEBUG: <<
> > > "[EOL]"
> > > 2010-10-21 15:05:55,257 [main] DEBUG: Receiving response: HTTP/1.1 500
> > > Server Error
> > > 2010-10-21 15:05:55,257 [main] DEBUG: << HTTP/1.1 500 Server Error
> > > 2010-10-21 15:05:55,257 [main] DEBUG: << Content-Type:
> > > text/html;charset=ISO- 8859-1
> > > 2010-10-21 15:05:55,257 [main] DEBUG: << Cache-Control:
> > > must-revalidate,no- cache,no-store
> > > 2010-10-21 15:05:55,257 [main] DEBUG: << Content-Length: 4035
> > > 2010-10-21 15:05:55,257 [main] DEBUG: << Server: Jetty(7.1.6.v20100715)
> > > 2010-10-21 15:05:55,262 [main] DEBUG: Connection can be kept alive
> > > indefinitely
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "<html>[\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "<head>[\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "<meta http-equiv="Content-Type"
> > > content="text/html; charset=ISO-8859-1"/>[\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "<title>Error 500 Server
> > > Error</title>[\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "</head>[\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "<body><h2>HTTP
ERROR
> > > 500</h2>[\n]" 2010-10-21 15:05:55,267 [main] DEBUG: << "<p>Problem
> > > accessing /. Reason:[\n]" 2010-10-21 15:05:55,267 [main] DEBUG: <<
> > > "<pre>    Server
> > > Error</pre></p><h3>Caused
> > > by:</h3><pre>java.lang.NullPointerException[\r][\n]" 2010-10-21
> > > 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.ServletDestination.getBasePath(ServletDe
> > > stina tion.java:105)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(Abstra
> > > ctHTT PDestination.java:335)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestina
> > > tion. java:88)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.ServletController.invokeDestination(Serv
> > > letCo ntroller.java:428)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.ServletController.invoke(ServletControll
> > > er.ja va:183)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSer
> > > vlet. java:148)[\r][\n]"
> > > 2010-10-21 15:05:55,267 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstra
> > > ctHTT PServlet.java:179)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPS
> > > ervle t.java:103)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > javax.servlet.http.HttpServlet.service(HttpServlet.java:727)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTP
> > > Servl et.java:159)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)[\r
> > > ][\n] "
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:423
> > > )[\r] [\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:
> > > 119)[ \r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:49
> > > 3)[\r ][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.j
> > > ava:2 25)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.j
> > > ava:9 30)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
> > > [\r][ \n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.ja
> > > va:18 3)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.ja
> > > va:86 6)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:
> > > 117)[ \r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollecti
> > > on.ja va:126)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.jav
> > > a:113 )[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.Server.handle(Server.java:351)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java
> > > :594) [\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(Htt
> > > pConn ection.java:1042)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:558)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:211)[\r]
> > > [\n]" 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424)[\
> > > r][\n ]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.
> > > java: 506)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "[0x9]at
> > > org.eclipse.jetty.util.thread.OldQueuedThreadPool$PoolThread.run(OldQueue
> > > dThre adPool.java:524)[\r][\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "</pre>[\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "<hr /><i><small>Powered
by
> > > Jetty://</small></i><br/>
> > > [\n]" 2010-10-21 15:05:55,268 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,268 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "<br/>
> > > [\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "[\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "</body>[\n]"
> > > 2010-10-21 15:05:55,269 [main] DEBUG: << "</html>[\n]"
> > > 2010-10-21 15:05:55,270 [main] DEBUG: Releasing connection
> > > org.apache.http.impl.conn.SingleClientConnManager$ConnAdapter@11f18cbe
> > >
> > > Gary Gregory
> > > Senior Software Engineer
> > > Rocket Software
> > > 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> > > Tel: +1.404.760.1560
> > > Email: ggregory@seagullsoftware.com
> > > Web: seagull.rocketsoftware.com
> > >
> > > > -----Original Message-----
> > > > From: Gary Gregory [mailto:GGregory@seagullsoftware.com]
> > > > Sent: Thursday, October 21, 2010 14:44
> > > > To: Daniel Kulp; users@cxf.apache.org
> > > > Subject: RE: NullPointerException migrating from 2.1.10 to CXF 2.3.0
> > > > and 2.2.11
> > > >
> > > > > -----Original Message-----
> > > > > From: Daniel Kulp [mailto:dkulp@apache.org]
> > > > > Sent: Thursday, October 21, 2010 13:41
> > > > > 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
> > > > >
> > > > >
> > > > > I really don't have an objection to putting a null guard there, but
I
> > > > > do
> > > >
> > > > have
> > > >
> > > > > to wonder how something is being started up without an address. 
That
> > >
> > > seems
> > >
> > > > a
> > > >
> > > > > bit strange to me.    Can you post the setup code or whatever that
> > > > > you
> > >
> > > have
> > >
> > > > so
> > > >
> > > > > I can see why the address is ending up null?
> > > >
> > > > I'm going to step through the debugger to see what happens.
> > > >
> > > > Creating a standalone unit test is not trivial because we are testing
a
> > >
> > > large
> > >
> > > > code based with lots of dependencies.
> > > >
> > > > Thank you,
> > > > Gary
> > > >
> > > > > Thanks!
> > > > > Dan
> > > > >
> > > > > On Thursday 21 October 2010 3:46:55 pm Gary Gregory wrote:
> > > > > > Hi All:
> > > > > >
> > > > > >
> > > > > >
> > > > > > I am currently on CXF 2.2.10 and our unit tests are humming
along
> > > > > > great.
> > > > > >
> > > > > >
> > > > > >
> > > > > > When I switch to 2.1.11 or 2.3.0, I see many NullPointerException
> > > > > > like:
> > > > > >
> > > > > >
> > > > > >
> > > > > > junit.framework.AssertionFailedError: Expected response to start
> > > > > > with "<?xml": <html>
> > > > > >
> > > > > > <head>
> > > > > >
> > > > > > <meta http-equiv="Content-Type" content="text/html;
> > > > > > charset=ISO-8859-
> > >
> > > 1"/>
> > >
> > > > > > <title>Error 500 Server Error</title>
> > > > > >
> > > > > > </head>
> > > > > >
> > > > > > <body><h2>HTTP ERROR 500</h2>
> > > > > >
> > > > > > <p>Problem accessing /. Reason:
> > > > > >
> > > > > > <pre>    Server Error</pre></p><h3>Caused
> > > > > > by:</h3><pre>java.lang.NullPointerException
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.ServletDestination.getBasePath(ServletDe
> > > s
> > >
> > > > > > tination.java:105)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.http.AbstractHTTPDestination.setupMessage(Abstra
> > > c
> > >
> > > > > > tHTTPDestination.java:335)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestina
> > > t
> > >
> > > > > > ion.java:88)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.ServletController.invokeDestination(Serv
> > > l
> > >
> > > > > > etController.java:428)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.ServletController.invoke(ServletControll
> > > e
> > >
> > > > > > r.java:183)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSer
> > > v
> > >
> > > > > > let.java:148)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstra
> > > c
> > >
> > > > > > tHTTPServlet.java:179)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPS
> > > e
> > >
> > > > > > rvlet.java:103)
> > > > > >
> > > > > >       at
> > > > > >       javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> > > > > >
> > > > > >       at
> > >
> > > org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTP
> > > S
> > >
> > > > > > ervlet.java:159)
> > > > > >
> > > > > >       at
> > > > > >
> > > > > > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:5
> > > > > > 27)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:423
> > > )
> > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:
> > > 1
> > >
> > > > > > 19)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:49
> > > 3
> > >
> > > > > > )
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.j
> > > a
> > >
> > > > > > va:225)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.j
> > > a
> > >
> > > > > > va:930)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
> > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.ja
> > > v
> > >
> > > > > > a:183)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.ja
> > > v
> > >
> > > > > > a:866)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:
> > > 1
> > >
> > > > > > 17)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollecti
> > > o
> > >
> > > > > > n.java:126)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.jav
> > > a
> > >
> > > > > > :113)
> > > > > > :
> > > > > >       at org.eclipse.jetty.server.Server.handle(Server.java:351)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:
> > > > > > 594)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(Htt
> > > p
> > >
> > > > > > Connection.java:1042)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:558)
> > >
> > > > > >       at
> > > > > >
> > > > > > org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:21
> > > > > > 1)
> > > > > >
> > > > > >       at
> > > > > >
> > > > > > org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:
> > > > > > 424)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.
> > > j
> > >
> > > > > > ava:506)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jetty.util.thread.OldQueuedThreadPool$PoolThread.run(OldQueue
> > > d
> > >
> > > > > > ThreadPool.java:524)
> > > > > >
> > > > > > </pre>
> > > > > >
> > > > > > <hr /><i><small>Powered by Jetty://</small></i><br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > > <br/>
> > > > > >
> > > > > >
> > > > > >
> > > > > > </body>
> > > > > >
> > > > > > </html>
> > > > > >
> > > > > >       at junit.framework.Assert.fail(Assert.java:47)
> > > > > >
> > > > > >       at junit.framework.Assert.assertTrue(Assert.java:20)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.http.TestUtils.assertExecute(TestU
> > > t
> > >
> > > > > > ils.java:51)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.http.TestUtils.execute(TestUtils.j
> > > a
> > >
> > > > > > va:114)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.http.TestUtils.doATest(TestUtils.j
> > > a
> > >
> > > > > > va:102)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.http.TestUtils.doAnOkTest(TestUtil
> > > s
> > >
> > > > > > .java:78)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.http.TestUtils.doAnOkTest(TestUtil
> > > s
> > >
> > > > > > .java:74)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.soap.SoapCmRoundtripTestCase.doAnO
> > > k
> > >
> > > > > > Test(SoapCmRoundtripTestCase.java:76)
> > > > > >
> > > > > >       at
> > >
> > > com.seagullsw.appinterface.server.comm.soap.SoapCmRoundtripTestCase.testN
> > > o
> > >
> > > > > > opDocLiteralSoap(SoapCmRoundtripTestCase.java:126)
> > > > > >
> > > > > >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > > >       Method)
> > > > > >
> > > > > >       at
> > >
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> > > > > > 39)
> > > > > >
> > > > > >       at
> > >
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
> > > m
> > >
> > > > > > pl.java:25)
> > > > > >
> > > > > >       at java.lang.reflect.Method.invoke(Method.java:597)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMeth
> > > o
> > >
> > > > > > d.java:44)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallabl
> > > e
> > >
> > > > > > .java:15)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod
> > > .
> > >
> > > > > > java:41)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.
> > > j
> > >
> > > > > > ava:20)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
> > > > > > 28)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRu
> > > n
> > >
> > > > > > ner.java:79)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.
> > > j
> > >
> > > > > > ava:71)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.
> > > j
> > >
> > > > > > ava:49)
> > > > > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> > > > > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
> > > > > >       52)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner.access$000(ParentRunner.java:
> > > > > >       42)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> > >
> > > > > >       at
> > >
> > > org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
> > > > > > 28)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:3
> > > 1
> > >
> > > > > > )
> > > > > >
> > > > > >       at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> > > > > >
> > > > > >       at org.junit.runners.Suite.runChild(Suite.java:128)
> > > > > >
> > > > > >       at org.junit.runners.Suite.runChild(Suite.java:24)
> > > > > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> > > > > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
> > > > > >       52)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> > >
> > > > > >       at
> > > > > >       org.junit.runners.ParentRunner.access$000(ParentRunner.java:
> > > > > >       42)
> > > > > >
> > > > > >       at
> > >
> > > org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> > >
> > > > > >       at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Test
> > > R
> > >
> > > > > > eference.java:49)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.jav
> > > a
> > >
> > > > > > :38)
> > > > > > :
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes
> > > t
> > >
> > > > > > Runner.java:467)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes
> > > t
> > >
> > > > > > Runner.java:683)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn
> > > e
> > >
> > > > > > r.java:390)
> > > > > >
> > > > > >       at
> > >
> > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun
> > > n
> > >
> > > > > > er.java:197)
> > > > > >
> > > > > > Should the method:
> > > > > >     protected String getBasePath(String contextPath) throws
> > > > > >     IOException
> > >
> > > {
> > >
> > > > > >         String address = getAddress().getAddress().getValue();
> > > > > >
> > > > > >         if (address.startsWith("http")) {
> > > > > >
> > > > > >             return URI.create(address).getPath();
> > > > > >
> > > > > >         }
> > > > > >
> > > > > >
> > > > > >
> > > > > >         return contextPath + address;
> > > > > >
> > > > > >     }
> > > > > >
> > > > > > have guard clause like:
> > > > > >     protected String getBasePath(String contextPath) throws
> > > > > >     IOException
> > >
> > > {
> > >
> > > > > >         String address = getAddress().getAddress().getValue();
> > > > > >
> > > > > >         if (address == null) {
> > > > > >
> > > > > >            return contextPath;
> > > > > >
> > > > > >         }
> > > > > >
> > > > > >         if (address.startsWith("http")) {
> > > > > >
> > > > > >             return URI.create(address).getPath();
> > > > > >
> > > > > >         }
> > > > > >
> > > > > >
> > > > > >
> > > > > >         return contextPath + address;
> > > > > >
> > > > > >     }
> > > > > >
> > > > > > ?
> > > > > >
> > > > > >
> > > > > >
> > > > > > Gary Gregory
> > > > > >
> > > > > > Senior Software Engineer
> > > > > >
> > > > > > Rocket Software
> > > > > >
> > > > > > 3340 Peachtree Road, Suite 820 * Atlanta, GA 30326 * USA
> > > > > >
> > > > > > Tel: +1.404.760.1560
> > > > > >
> > > > > > Email: ggregory@seagullsoftware.com
> > > > > >
> > > > > > Web: seagull.rocketsoftware.com
> > > > >
> > > > > --
> > > > > Daniel Kulp
> > > > > dkulp@apache.org
> > > > > http://dankulp.com/blog
> 
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog

Mime
View raw message