wood burning stoves
The moose likes Other Java Products and Servers and the fly likes resin-web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "resin-web.xml" Watch "resin-web.xml" New topic


Brett Favro

Joined: Mar 19, 2004
Posts: 8
I cannot seem to get connection pooling to working using my hosting co: Hostmatix.com and their Resin 2.0 config. I have tried using standard web.xml but the web-app_2.2 DTD doesn't allow for <init param> tags inside resource-ref.
*** So I'm trying a resin-web.xml. Here it is:
<driver type="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
The user and password tags have text (omitted for posting).
I am then:
1) Context env = new InitialContext().lookup("java:comp.env");
2) DataSource ds = env.lookup("jdbc/MySql");
3) Connection con = ds.getConnection();
My Connection Object is always null.
What's going wrong? Is there a way of my Hosting co. to prevent reading web or resin-web.xml[s]? Is there a DTD for resin-web.xml?
I already cannot use JavaMail on my provider's box forcing me to user com.caucho.vfs class instead. I prefer not to use a non standard solution....

Any help appreciated...
Brett Favro

Joined: Mar 19, 2004
Posts: 8
I mean to post "java:comp/env" for the initial JNDI context.
Brett Favro

Joined: Mar 19, 2004
Posts: 8
This forum is really super lamOOOOOoooooooo!
Warren Dew
Ranch Hand

Joined: Mar 04, 2004
Posts: 1332
Probably just not a lot of Resin users here.
Have you considered calling up Caucho and asking for support?
Tom Pridham
Ranch Hand

Joined: Feb 06, 2001
Posts: 92
This may sound dumb, but can you connect to the db via the command line? Also, it you don't do a cleanup in a finally block and release the connection, you will quickly run out of them :-(
Here is my mysql portion of the Resin config file:
<init-param driver-name="com.mysql.jdbc.Driver"/>
<init-param url="jdbc:mysql://"/>
<init-param user="blah"/>
<init-param password="blah2"/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
Then I have a WebConstants.java file that contains the following snippet:
public static final String DEFAULT_DATASOURCE = "jdbc/test";
Then from anywhere, can get a connection by calling WebConstants.DEFAULT_DATASOURCE = "jdbc/test";
If this doesn't work, either email me at pridam@mindspring.com or my AOL IM is Tom365MT
Hope this helps!
Tom Pridham
Tom Griffith
Ranch Hand

Joined: Aug 06, 2004
Posts: 275
Hello. I am trying something similar with Resin 3.0.8. I am packaging my ejb/servlet in a war and I am entering the jndi resource info into the web.xml for the war. I keep getting an error message back saying "...'url' is an unknown property of com.caucho.sql.DBPool". Does anybody have any idea if the tags have changed or anything? I've looked everywhere. Thank you.
Brett Favro

Joined: Mar 19, 2004
Posts: 8
A simple DTD would go a long way here. Thanks again Caucho..
I finally got my to work by modifying the resin.conf for my server (ISP gives dedicated JVMS to each account). This obviously isn't the RIGHT way to do things in a shared enterprise environment but
<init-param driver-name="org.gjt.mm.mysql.Driver"/>
<init-param url="jdbc:mysql://localhost/someuser"/>
<init-param user="******"/>
<init-param password="*******"/>
<init-param max-connections="10"/>

Of course the username and password have been *[ed] out for obvious reasons.
Note: this is a Resin 2.x server.
I agree. Here's the link: http://aspose.com/file-tools
subject: resin-web.xml
It's not a secret anymore!