tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lamine Ba" <lamin...@hotmail.com>
Subject RE: Unable to use JNDI Datasource name with JSTL on jrun 4
Date Wed, 09 Feb 2005 13:32:30 GMT
Dear Dipak,

I was working on the same problem all last week.  It turns out that the
error "usually" means that your Tomcat container is not able to read
your database driver (the jar file).
I would strongly suggest you to configure JDNI using the admin tool
(WEBAPP/admin) instead of modifying the configuration files manually.
That is how I eventually got it to function properly.  Setup a user
account for admin in the $CATALINA_HOME/conf/tomcat-users.xml file and
go to the URL http://localhost/admin, login, then configure your
dataSource.

Thierno Ba.
Focus Cube Inc.
Spend less, Gain more: On-demand Marketing Intelligence.
 

-----Original Message-----
From: Dipak Bhandari [mailto:d.bhandari@qut.edu.au] 
Sent: Tuesday, February 08, 2005 8:20 PM
To: taglibs-user@jakarta.apache.org
Subject: Unable to use JNDI Datasource name with JSTL on jrun 4

Hi
I've not been able to make my web application use JNDI dataSource name  
with JSTL 1.0 on JRUN 4. However, when I use jdbc url instead of JNDI 
name the database connection is established. Please find below the 
relevant entries in web.xml and jrun-resources.xml  along with the error

message thrown by JRUN 4.

web.xml entries:

 <context-param>
    <param-name>
      javax.servlet.jsp.jstl.sql.dataSource
    </param-name>
    <param-value>
     jdbc/myDatasource
    </param-value>
   </context-param>

jrun-resources.xml entries:

 <data-source>
    <dbname>myDatasource</dbname>
    <driver>oracle.jdbc.driver.OracleDriver</driver>
    <url>jdbc:oracle:thin:@host:1521:sid</url>
    <username>username</username>
    <password>password</password>
    <encrypted>true</encrypted>
 
<encryption-class>jrun.security.JRunCrypterForTwofish</encryption-class>
    <native-results>true</native-results>
    <remove-on-exceptions>true</remove-on-exceptions>
    <pool-statements>true</pool-statements>
    <initial-connections>1</initial-connections>
    <connection-timeout>1200</connection-timeout>
    <transaction-timeout>20</transaction-timeout>
    <cache-enabled>false</cache-enabled>
    <cache-size>5</cache-size>
    <cache-refresh-interval>30</cache-refresh-interval>
    <jndi-name>myDatasource</jndi-name>
    <poolname>Pool</poolname>
    <minimum-size>0</minimum-size>
    <maximum-size>2147483647</maximum-size>
    <user-timeout>20</user-timeout>
    <skimmer-frequency>420</skimmer-frequency>
    <shrink-by>5</shrink-by>
    <maximum-soft>true</maximum-soft>
    <debugging>false</debugging>
    <disable-pooling>false</disable-pooling>
    <description />
    <isolation-level>READ_COMMITTED</isolation-level>
  </data-source>

The error thrown is:

 javax.servlet.jsp.JspException: Unable to get connection, DataSource
invalid: "No suitable driver"
	at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection
(QueryTagSupport.java:309)
	at
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Qu
eryTagSupport.java:192)
	at
org.apache.taglibs.standard.tag.el.sql.QueryTag.doStartTag(QueryTag.java
:125)
	at jrun__test2ejsp9._jspService(jrun__test2ejsp9.java:117)
	at
jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
	at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
	at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252
)
	at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527
)
	at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
	at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java
:451)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


however, the database connection is established if in my deployment 
descriptor I replace
<param-value>
     jdbc/myDatasource
    </param-value>
with
 <param-value>
       
jdbc:oracle:thin:@host:1521:SID,oracle.jdbc.driver.OracleDriver,user,pas
sword
    </param-value>

I'd appreciate any help to find a solution to use JNDI name on JRUN4.

Much appreciated,
Dipak Bhandari
d.bhandari@qut.edu.au



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


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


Mime
View raw message