cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2551) NullPointerException at org.apache.cxf.transport.servlet.ServletController.updateDests(ServletController.java:92)
Date Fri, 20 Nov 2009 01:50:39 GMT

    [ https://issues.apache.org/jira/browse/CXF-2551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780369#action_12780369
] 

Gary Gregory commented on CXF-2551:
-----------------------------------

I forgot to say above that it would be nice if the code could be bullet proofed. The NPE is
in this method:

    protected synchronized void updateDests(HttpServletRequest request) {
        if (disableAddressUpdates) {
            return;
        }
        String base = forcedBaseAddress == null ? getBaseURL(request) : forcedBaseAddress;
                
        if (base.equals(lastBase)) {
            return;
        }
        Set<String> paths = transport.getDestinationsPaths();
        for (String path : paths) {
            ServletDestination d2 = transport.getDestinationForPath(path);
            String ad = d2.getEndpointInfo().getAddress();
            if (ad.equals(path)
                || ad.equals(lastBase + path)) {
                d2.getEndpointInfo().setAddress(base + path);
                if (d2.getEndpointInfo().getExtensor(AddressType.class) != null) {
                    d2.getEndpointInfo().getExtensor(AddressType.class).setLocation(base +
path);
                }
            }
        }
        lastBase = base;
    }

At this line:

            if (ad.equals(path)

In a debugger I can see that ad is set to null with:

String ad = d2.getEndpointInfo().getAddress();

The address value is null in the object org.apache.cxf.ws.addressing.AttributedURIType@5d535057.

> NullPointerException 	at org.apache.cxf.transport.servlet.ServletController.updateDests(ServletController.java:92)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-2551
>                 URL: https://issues.apache.org/jira/browse/CXF-2551
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>         Environment: java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Microsoft Windows [Version 6.0.6002]
>            Reporter: Gary Gregory
>         Attachments: SignOn-doclit.wsdl
>
>
> I am getting the following NPE when submitting a request to our server implemented using
CXF 2.2.4.
> java.lang.NullPointerException
> 	at org.apache.cxf.transport.servlet.ServletController.updateDests(ServletController.java:92)
> 	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:132)
> 	at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:45)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> 	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:101)
> 	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> 	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
> Here is the sample request sent with soapUI 3.0.1:
> {code:xml}
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:app="http://com.seagullsw.appinterface/AppInterfaceServer">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <app:SignOn>
>          <!--Optional:-->
>          <Password>Gary</Password>
>          <!--Optional:-->
>          <UserName>MyPwd</UserName>
>       </app:SignOn>
>    </soapenv:Body>
> </soapenv:Envelope>
> {code}
> I'll attach the WSDL.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message