• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configuring datasource for mysql in struts-config.xml

 
santhosh prasad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Junilu Lacar
Bartender
Pie
Posts: 7749
60
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Junilu.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic