Re: NullPointerException in while initializing message resource
Hi Ganesh, thanks for your reply. But my properties file is directly under the WEB-INF/classes folder, not under any package. regs, Ramkumar On 4/4/06, RathinaGanesh MeenakshiSundaram [EMAIL PROTECTED] wrote: Hi, You should specify the full package location of the message-resource file.. The parameter should be like this.. message-resources parameter=com.vrst.self.struts.ApplicationResources / Hope this helps..! Thanks, Ganesh. On 4/4/06, Ramkumar Krishnan [EMAIL PROTECTED] wrote: Hi All, I am getting Null PointerException when i tried to view my login page. Struts is not able to find the message resources. This is configuration in my struts-config.xml message-resources parameter=security null=false/message-resources i am getting java.lang.NullPointerException at org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java :1174) atorg.apache.struts.taglib.TagUtils.message( TagUtils.java:1037) at org.apache.struts.taglib.bean.MessageTag.doStartTag ( MessageTag.java:224) at jsp_servlet._content._jsp.__login._jspService(__login.java:161) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) I have attached the struts source i and i found it is happening in the following line of TagUtils class if (resources == null) { ModuleConfig moduleConfig = getModuleConfig(pageContext); // Returns Null !! resources = (MessageResources) pageContext.getAttribute( bundle + moduleConfig.getPrefix(), PageContext.APPLICATION_SCOPE); } While debugging, it is returning the ModuleConfig as null. I dont' know why it is trying to get the module config even though i haven't configured any struts module. This is my web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameAdminWar/display-name context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/classes/spring/*.xml/param-value /context-param !-- load a shared service layer parent application context -- context-param param-namelocatorFactorySelector/param-name param-valuebeanRefContext.xml/param-value /context-param context-param param-nameparentContextKey/param-name param-valueapplication-context/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param !--init-param param-nameapplication/param-name param-valuesecurity/param-value /init-param --/servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-logic.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/c.tld/taglib-uri taglib-location/WEB-INF/tlds/c.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-extn.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-extn.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/fmt.tld/taglib-uri taglib-location/WEB-INF/tlds/fmt.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-el.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean-el.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-nested.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/tavant_taglib.tld/taglib-uri taglib-location/WEB-INF/tlds/tavant_taglib.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/homer.tld/taglib-uri
NullPointerException in while initializing message resource
Hi All, I am getting Null PointerException when i tried to view my login page. Struts is not able to find the message resources. This is configuration in my struts-config.xml message-resources parameter=security null=false/message-resources i am getting java.lang.NullPointerException at org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1174) atorg.apache.struts.taglib.TagUtils.message( TagUtils.java:1037) at org.apache.struts.taglib.bean.MessageTag.doStartTag( MessageTag.java:224) at jsp_servlet._content._jsp.__login._jspService(__login.java:161) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) I have attached the struts source i and i found it is happening in the following line of TagUtils class if (resources == null) { ModuleConfig moduleConfig = getModuleConfig(pageContext); // Returns Null !! resources = (MessageResources) pageContext.getAttribute( bundle + moduleConfig.getPrefix(), PageContext.APPLICATION_SCOPE); } While debugging, it is returning the ModuleConfig as null. I dont' know why it is trying to get the module config even though i haven't configured any struts module. This is my web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameAdminWar/display-name context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/classes/spring/*.xml/param-value /context-param !-- load a shared service layer parent application context -- context-param param-namelocatorFactorySelector/param-name param-valuebeanRefContext.xml/param-value /context-param context-param param-nameparentContextKey/param-name param-valueapplication-context/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param !--init-param param-nameapplication/param-name param-valuesecurity/param-value /init-param --/servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/c.tld/taglib-uri taglib-location/WEB-INF/tlds/c.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-extn.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-extn.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/fmt.tld/taglib-uri taglib-location/WEB-INF/tlds/fmt.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-el.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean-el.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tavant_taglib.tld/taglib-uri taglib-location/WEB-INF/tlds/tavant_taglib.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/homer.tld/taglib-uri taglib-location/WEB-INF/tlds/homer.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/PermissionTags.tld/taglib-uri taglib-location/WEB-INF/tlds/PermissionTags.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/oscache.tld/taglib-uri taglib-location/WEB-INF/tlds/oscache.tld/taglib-location /taglib security-constraint web-resource-collection web-resource-nameSecurePages/web-resource-name descriptionSecurity constraint /secure/description url-pattern/content/jsp/*/url-pattern http-methodPOST/http-method
Re: NullPointerException in while initializing message resource
Hi, You should specify the full package location of the message-resource file.. The parameter should be like this.. message-resources parameter=com.vrst.self.struts.ApplicationResources / Hope this helps..! Thanks, Ganesh. On 4/4/06, Ramkumar Krishnan [EMAIL PROTECTED] wrote: Hi All, I am getting Null PointerException when i tried to view my login page. Struts is not able to find the message resources. This is configuration in my struts-config.xml message-resources parameter=security null=false/message-resources i am getting java.lang.NullPointerException at org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java :1174) atorg.apache.struts.taglib.TagUtils.message( TagUtils.java:1037) at org.apache.struts.taglib.bean.MessageTag.doStartTag ( MessageTag.java:224) at jsp_servlet._content._jsp.__login._jspService(__login.java:161) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) I have attached the struts source i and i found it is happening in the following line of TagUtils class if (resources == null) { ModuleConfig moduleConfig = getModuleConfig(pageContext); // Returns Null !! resources = (MessageResources) pageContext.getAttribute( bundle + moduleConfig.getPrefix(), PageContext.APPLICATION_SCOPE); } While debugging, it is returning the ModuleConfig as null. I dont' know why it is trying to get the module config even though i haven't configured any struts module. This is my web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameAdminWar/display-name context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/classes/spring/*.xml/param-value /context-param !-- load a shared service layer parent application context -- context-param param-namelocatorFactorySelector/param-name param-valuebeanRefContext.xml/param-value /context-param context-param param-nameparentContextKey/param-name param-valueapplication-context/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener/listener-class /listener servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value0/param-value /init-param !--init-param param-nameapplication/param-name param-valuesecurity/param-value /init-param --/servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/c.tld/taglib-uri taglib-location/WEB-INF/tlds/c.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-extn.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-extn.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/fmt.tld/taglib-uri taglib-location/WEB-INF/tlds/fmt.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html-el.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean-el.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean-el.tld /taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tavant_taglib.tld/taglib-uri taglib-location/WEB-INF/tlds/tavant_taglib.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/homer.tld/taglib-uri taglib-location/WEB-INF/tlds/homer.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/PermissionTags.tld/taglib-uri taglib-location/WEB-INF/tlds/PermissionTags.tld/taglib-location