tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julio César Chaves Fernández <he...@hotmail.com>
Subject RE: NullPointerException on Struts Action
Date Fri, 18 Sep 2009 19:28:06 GMT

mmm yes you're right I should post this on the struts forum but thanks... i'll check what
you said about the right implementation.

Thanks

> Date: Fri, 18 Sep 2009 12:04:11 -0400
> From: chris@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: NullPointerException on Struts Action
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Julio,
> 
> On 9/18/2009 9:44 AM, Julio César Chaves Fernández wrote:
> > Hi, i've been having a strange behavior with some struts apps deployed on Oracle
portal.
> 
> Given that this is Struts running on Oracle, why not ask your question
> on the Struts list or ask someone at Oracle? This is a forum for Apache
> Tomcat users. :(
> 
> > 09/09/17 16:10:19 java.lang.NullPointerException
> > 09/09/17 16:10:19     at org.apache.struts.action.Action.getDataSource(Action.java:532)
> > 09/09/17 16:10:19     at co.edu.icesi.notas.action.InicioAction.execute(InicioAction.java:46)
> 
> [snip]
> 
> Wow, you're using Action.getDataSource? Wasn't that deprecated like 5
> years ago?
> 
> > InicioAction is the init action that sets some data in the user
> > session and makes some validations. The code in Action.java at line 532 is:
> > 
> > protected DataSource getDataSource(HttpServletRequest request, String key)
> >   {
> >     ServletContext context = getServlet().getServletContext();  ------------------------->
line 532
> >     ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request, context);
> > 
> >     return ((DataSource)context.getAttribute(key + moduleConfig.getPrefix()));
> >   }
> 
> Are you sure you're looking at the right version of the code?
> 
> Are you doing something silly like trying to use this Action before it
> has been properly brought into service? If that's the case, then
> getServlet() would return null.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkqzr3sACgkQ9CaO5/Lv0PA5UACdG+1Bhn2dhBuIHqF0E/gIKCWJ
> lxYAnjcN1rTlDXhEcf3+F1x0f3xiTqBV
> =PB58
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message