geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viola lu <>
Subject NPE in MyFacesWebAppContext.doStart() if jsf web application is packaged into an EAR
Date Fri, 15 Jul 2011 11:07:02 GMT
Hi, Dev:

 I packaged a web app with jsf features into an EAR, and deployed it, but
got an NPE when starting MyFacesWebAppContext gbean. This is related with
code line in MyFacesModuleBuilderExtension

*AbstractName myFacesWebAppContextName =
"myFacesWebAppContext", "MyFacesWebAppContext");*

In an EAR,  ModuleContext abstract name is  like:


The result won't contain "WebModule"

But in an WAR is like

WebModule=com.apache.geronimo.samples/jsf/ # **contaning

The result contains "WebModule"

After constructing  MyFacesWebAppContext GBean, and start it as below,

*public String getWebModuleName(){*
*        return abName.getNameProperty(NameFactory.WEB_MODULE); **#
value is "WebModule"*
*    }*
*    @Override*
*    public void doStart() throws Exception {*
*        MYFACES_WEBAPP_CONTEXTS.put(getWebModuleName(), this);*
*    }*

 trying to find a *WebModule* string in its abstract name, but if jsf web
app is in an ear, its abstractname doesn't contain *WebModule*, coz of its
parent  is an EAR, whose abstract name doesn't include WebModule. This code
only work when jsf web app is standalone.

What i think is change MyFacesWebAppContext mapping way or change
myfaceswebappcontext abstractname generation way,not sure which is better.

Appreciate if somebody can shadow some lights on it.


Apache Geronimo

View raw message