tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parsons Technical Services" <parsonstechni...@earthlink.net>
Subject Re: Known problem with tomcat, jndi datasourc - PLEASE HELP
Date Fri, 09 Apr 2004 00:08:39 GMT

First check you logs and see if any error messages are showing up. As a just
for kicks try thing, move the username up in the configuration to before the
password. Crazy thing but it caused mine to not see the password. I don't
think you will get back any indications in the java trace that the password
is bad but the logs will show trying to connect with the proper user but no
reference to password. Note: It will not list the password in the log but
will say password yes or something like that.

Doug
www.parsonstechnical.com


----- Original Message ----- 
From: "MARU, SOHIL (SBCSI)" <sm8971@sbc.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Thursday, April 08, 2004 6:56 PM
Subject: Known problem with tomcat, jndi datasourc - PLEASE HELP


Hello All,
    I have been scouring the mailing list archives and lot of other
places. I am seeing a problem configuring a datasource with Tomcat. I
have put the following entry in my server.xml

<Context path="/loa"
docBase="C:\software\eclipse\workspace\HRTechnology\TOMCAT_ROOT"
reloadable="true">
<Resource name="jdbc/loacenet"
auth="Container" type="javax.sql.DataSource"/>
<ResourceParams
name="jdbc/loacenet">
.........
.........
.........
.........
<parameter>

<name>password</name>

<value>databasepassword</value>
</parameter>
<parameter>
<name>url</name>

<value>jdbc:oracle:thin@[machinename]:1521:[sid]</value>
</parameter>
<parameter>

<name>driverClassName</name>

<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>

<name>username</name>

<value>user</value>
</parameter>
</ResourceParams>
</Context>
However when I try to load my plugin in the struts application, I get
the following exception. I looked at everything on archives and on there
people were complaining about NULL for driverClassName, in my case, it
reads the drivername and url properly and still blows up. Please help. I
am using Tomcat 5.0 with the latest ojdbc14.jar/commons-dbcp-1.1.jar in
common/lib and am trying to connect to oracle 8.1.7.

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '
oracle.jdbc.driver.OracleDriver' for connect URL
'jdbc:oracle:thin@[machinename]
:1521:[sid]', cause:
java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:243)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou
rce.java:743)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource
.java:518)
        at
com.sbc.hrtech.framework.utility.InitializerPlugin.init(InitializerPl
ugin.java:41)
        at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
        at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
        at javax.servlet.GenericServlet.init(GenericServlet.java:256)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1044)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3960)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
283)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)

        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518
)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:234
5)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:598)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
Excpetion in InitializerPlugin


The java code in the plugin is as follows
Context init = new InitialContext();
Context ctx = (Context)
init.lookup("java:comp/env");
DataSource dataSource = (DataSource)
ctx.lookup("jdbc/loacenet");
c = dataSource.getConnection(); -- line which
blows up
st = c.createStatement();



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message