This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes configuring datasource for mysql in struts-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "configuring datasource for mysql in struts-config.xml" Watch "configuring datasource for mysql in struts-config.xml" New topic
Author

configuring datasource for mysql in struts-config.xml

santhosh prasad
Greenhorn

Joined: Feb 05, 2002
Posts: 2
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

Joined: Feb 26, 2001
Posts: 4782
    
    8

"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.


Junilu - [How to Ask Questions] [How to Answer Questions]
santhosh prasad
Greenhorn

Joined: Feb 05, 2002
Posts: 2
Thanks Junilu.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.


GenRocket - Experts at Building Test Data
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: configuring datasource for mysql in struts-config.xml