Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Struts Datasource config Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Datasource config" Watch "Struts Datasource config" New topic
Author

Struts Datasource config

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I am trying to use the Datasource config in the struts-config.xml file and I am having some issues.
[struts-config.xml Datasource]

[Test Action for Connection]

And here is the lovely error I am recieving

I thought that since I told it to use DBCP that it wouldn't try and use Stut's Datasource class. And yes, I have the DBCP jar file in my WEB-INF/lib folder.
Anyone know what is going on?


GenRocket - Experts at Building Test Data
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Ok, this isn't the answer you are looking for, but I feel compelled to offer my unsolicited opinion anyway. That test action... in production, it is uber-bad practice to be doing database stuff ("database stuff", that's the technical term) in your Action. *YECH* *GAG* I can honestly say that I've never used the datasource element as my webapp has never had to have access to it. Now my business objects... that's a different story. I know, I know, it's only a test. I just had to get that off my chest though as that test action just made me go into a frenzy and start breaking things in a violent rage. *Hulk Smash Puny Action Class!!!*
I now return you to your regularly scheduled topic.
Praveen Teegala
Greenhorn

Joined: Apr 03, 2004
Posts: 11
Please check if struts-legacy.jar is in you lib, along with other sturts jars.


Praveen
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Jason Menard:
Ok, this isn't the answer you are looking for, but I feel compelled to offer my unsolicited opinion anyway. That test action... in production, it is uber-bad practice to be doing database stuff ("database stuff", that's the technical term) in your Action. *YECH* *GAG* I can honestly say that I've never used the datasource element as my webapp has never had to have access to it. Now my business objects... that's a different story. I know, I know, it's only a test. I just had to get that off my chest though as that test action just made me go into a frenzy and start breaking things in a violent rage. *Hulk Smash Puny Action Class!!!*
I now return you to your regularly scheduled topic.

I know, I know. In fact, I have even dropped the use of the Struts defined datasource. The Struts docs even say you shouldn't use it. So I am using a Tomcat defined datasource that works via JNDI lookup just like any other webapp I have worked on.
Thanks for you amusing opinion though.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Gregg Bolinger:
Thanks for you amusing opinion though.

That's what I'm here for.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Datasource config