Re: NullPointerException in while initializing message resource

2006-04-05 Thread Ramkumar Krishnan
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
  taglib

NullPointerException in while initializing message resource

2006-04-04 Thread Ramkumar Krishnan
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

form field is not populating immediately

2005-06-13 Thread Ramkumar Krishnan
Hi All,
 I have a form which has two fields.One is a string array and
another field which determines the size of the first field. i have
indexed methods to populate the string array.

i need to initialize the string[] based on the size(another form
field) when the indexed method gets invoked. But my second form field
is not populated by the struts.
Because of this i am getting null pointer exception.

This is my indexed method in my form
..
 public void setDisabledUser(int index, String object)
{
if (arr == null)
arr = new String[Integer.parseInt(getTotalSizePerPage())];
arr[index] = object;
}
...

getTotalSizePerPage() returns null because the form field is not yet
populated by struts when this method gets invoked.


Any clues to solve this problem?

thanks in advance,
-- 
Ramkumar Yadav K,

a href=http://www.spreadfirefox.com/?q=affiliatesamp;id=0amp;t=65;img
border=0 alt=Get Firefox! title=Get Firefox!
src=http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif//a

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]