[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[THREDDS #SEG-622383]: thredds.servlet.DatasetSource...



Thanks Rick, we are working on a fix for 4.4.0.

John

> Hi,
> 
> I believe this is actually a bug in DataRootHandler.  The
> getInstance() method was not the issue, but a NPE is thrown when I
> call:
> 
> DataRootHandler.getInstance().findDataRootMatch(req)
> 
> A quick peek at that code reveals:
> 
> /**
> * Extract the DataRoot from the request.
> * Use this when you need to manipulate the path based on the part
> that matches a DataRoot.
> *
> * @param req the request
> * @return the DataRootMatch, or null if not found
> */
> public DataRootMatch findDataRootMatch(HttpServletRequest req) {
> String spath = req.getPathInfo();
> 
> if (spath.length() > 0) {
> if (spath.startsWith("/"))
> spath = spath.substring(1);
> }
> 
> return findDataRootMatch(spath);
> }
> 
> Notice in the 1st line, the call to req.getPathInfo() -- that method's
> contract is a null can be returned (and is in my case!) if there is no
> extra path information. The comment for  findDataRootMatch() indicates
> that possibility was anticipated, but its not checked for and the call
> to spath.length() is what actually throws the NPE.
> 
> I hope that's useful info for the THREDDS team...
> 
> Rick
> 
> 
> On Fri, 08 Nov 2013 10:35:50 -0700
> "Unidata THREDDS Support" <address@hidden> wrote:
> >> Hi,
> >>
> >> I'm trying to find out more information about the environment a
> >>servlet (not catalog) DatasetSource lives in. I've reaad the "Dataset
> >>Source Plugin" section in the THREDDS reference manual;  I've
> >>searched in vane for javadocs for the THREDDS server, and searched
> >>the email archives, all to no avail.  For example, the code example
> >>in the Plugin chapter shows the getNetcdfFile() method making use of
> >>a static DataRootHandler class;  I get an exception when I try to
> >>reference DataRootHandler.getInstance().  Is there any docs on the
> >>class and others that might be available/useful to a DatasetSource
> >>instance?
> >>
> >> I appreciate any help -- Thanks
> >> Rick Brownrigg
> >>
> >>
> >>
> >
> > Hi Rick:
> >
> > I assume you are running inside Tomcat with tds.war loaded? Can you
> >post the Exception?
> >
> > Not a lot of docs, but you could post to address@hidden
> >where there are a few others who have used DataSource.
> >
> > John
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: SEG-622383
> > Department: Support THREDDS
> > Priority: Normal
> > Status: Closed
> >
> 
> 


Ticket Details
===================
Ticket ID: SEG-622383
Department: Support THREDDS
Priority: Normal
Status: Closed