• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

configuring datasource for mysql in struts-config.xml

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the following changes in struts-config.xml
-----------------------------------------------
<data-sources>
<data-source>
<set-property property="driveClass"
value="COM.ibm.db2.jdbc.app.DB2Driver"/>
<set-property property="url"
value="jdbc b2:xxx"/>
<set-property property="username"
value="db2admin"/>
<set-property property="password"
value="db2admin"/>
</data-source>
</data-sources>
-----------------------------------------------
and Action class I called as
ds = getDataSource(request);
if I run .jsp file I'm getting the following error
java.lang.NullPointerException
at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:316)
I need help
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"santhosh"
Welcome to JavaRanch! Please change your publicly displayed name to comply with the JavaRanch Naming Policy. Thanks!
You need to dig further into your stack trace to find the exact line in your JSP that causes the error. A NullPointerException is usually caused by attempting to invoke a method on a reference that is null so try find where the error occured, then figure out why the object reference is null.
 
santhosh prasad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junilu.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oddly enough, that error message is caused do to a problem in the DataSource configuration. Although I haven't been able to track down what exactly. I am having the same problem and have searched google and that is how I found this out.
reply
    Bookmark Topic Watch Topic
  • New Topic