Hey guys,
I am trying to get the BIRT war file deploying under Pax web (using the
extender-war bundle) and am running into some issues maybe some expert advice
can cure.
When the war is deploying, I am getting a NullPointerException in BIRT
initialization. It appears that the BIRT code, in a class called
ParameterAccessor is calling this ServletContext method:
context.getRealPath( path );
It appears that this gets routed to HttpServiceContext.SContext which does not
override the default behavior and instead returns null. I believe it should
get a value here. That is the first issue. Subsequently, because it is
returned a null from context.getRealPath() it calls context.getResource() in
this case with a value of "/" ... i.e. Context.getResource("/"). The
implementation of this in Pax is WebAppHttpContext, which calls the Path class
to normalize the path. The logic from path is this:
public static String normalizeResourcePath( final String path )
{
if( path == null )
{
return null;
}
String normalizedPath = replaceSlashes( path );
if( normalizedPath.startsWith( "/" ) )
{
normalizedPath = normalizedPath.substring( 1 );
}
return normalizedPath;
}
Because the path is simply "/" the logic here results in an empty path name,
which is then supplied to the bundle as the resource to load. The messages
from my log are:
[HttpServiceContext ] INFO - getting resource: [/]
[WebAppHttpContext ] DEBUG - Searching bundle
[reference:file:./core/org.ziptie.server.birt_1.0.0.dev [73]] for resource [/],
normalized to []
[WebAppHttpContext ] DEBUG - Resource not found
[HttpServiceContext ] INFO - found resource: null
So I think there maybe two separate issues. In the first, shouldn't
HttpServiceContext.SContext also override getRealPath()? And in the second, I
think the Path.normalizeResourcePath() should not remove the leading slash if
that is all there is in the path. In fact, I think OSGi allows a leading "/"
when requesting bundle resources. Both "/tmp" and "tmp" refer to the same
directory within a bundle (i.e. "tmp" in the root of the bundle).
Has anyone else gotten BIRT deployed under Pax? And does anyone know whether
the above analysis is correct?
Thanks,
Brett
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general