jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: DataSource Error...
Date Wed, 24 Apr 2002 03:43:27 GMT
Are you setting the context-initialization parameter

	javax.servlet.jsp.jstl.sql.dataSource

or using <sql:setDataSource> to tie this connection to JSTL?  It looks
like you've set up the resource correctly, but you need to tell JSTL to
use it.

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming this summer from Manning Publications)

On Tue, 23 Apr 2002, Sankar B wrote:

> 
> Note: forwarded message attached.
> 
> Ive used the jdbc/jstl in the web.xml also. Im able to
> connect the DB using simple JSP coding from this JNDI.
> But, unable to do so with JSTL.
> 
> 	<resource-ref>
> 	  <description>
>     	Resource reference to a factory for
> java.sql.Connection
>     	instances that may be used for talking to a
> particular
>     	database that is configured in the server.xml
> file.
>    	  </description>
>   	  <res-ref-name>
>     	jdbc/jstl
> 	  </res-ref-name>
> 	  <res-type>
> 	    javax.sql.DataSource
> 	  </res-type>
> 	  <res-auth>
> 	    Container
> 	  </res-auth>
> 	</resource-ref>
> 
> 
> 
> 
> jstl.xml file in webapps directory has the following
> code:
> 
>      <Context path="/jstl" docBase="D:\web-app\jstl"
> debug="0"
>                  reloadable="true"
> crossContext="true">
>           <Logger
> className="org.apache.catalina.logger.FileLogger"
>                      prefix="localhost_vms_log."
> suffix=".txt"
>         	  timestamp="true"/>
>           <Ejb   name="ejb/EmplRecord" type="Entity"
>                 
> home="com.wombat.empl.EmployeeRecordHome"
>               
> remote="com.wombat.empl.EmployeeRecord"/>
>           <!-- PersistentManager: Uncomment the
> section below to test Persistent 
> 		       Sessions.
>                          
>                saveOnRestart: If true, all active
> sessions will be saved
>                  to the Store when Catalina is
> shutdown, regardless of
>                  other settings. All Sessions found in
> the Store will be 
>                  loaded on startup. Sessions past
> their expiration are
>                  ignored in both cases.
>                maxActiveSessions: If 0 or greater,
> having too many active 
>                  sessions will result in some being
> swapped out. minIdleSwap
>                  limits this. -1 means unlimited
> sessions are allowed.
>                  0 means sessions will almost always
> be swapped out after
>                  use - this will be noticeably slow
> for your users.
>                minIdleSwap: Sessions must be idle for
> at least this long
>                  (in seconds) before they will be
> swapped out due to 
>                maxActiveSessions. This avoids
> thrashing when the site is 
>                  highly active. -1 or 0 means there is
> no minimum - sessions
>                  can be swapped out at any time.
>                maxIdleSwap: Sessions will be swapped
> out if idle for this
>                  long (in seconds). If minIdleSwap is
> higher, then it will
>                  override this. This isn't exact: it
> is checked periodically.
>                  -1 means sessions won't be swapped
> out for this reason,
>                  although they may be swapped out for
> maxActiveSessions.
>                  If set to >= 0, guarantees that all
> sessions found in the
>                  Store will be loaded on startup.
>                maxIdleBackup: Sessions will be backed
> up (saved to the Store,
>                  but left in active memory) if idle
> for this long (in seconds), 
>                  and all sessions found in the Store
> will be loaded on startup.
>                  If set to -1 sessions will not be
> backed up, 0 means they
>                  should be backed up shortly after
> being used.
> 
>                To clear sessions from the Store, set
> maxActiveSessions, maxIdleSwap,
>                and minIdleBackup all to -1,
> saveOnRestart to false, then restart 
>                Catalina.
>           -->
> 		  <!--
>           <Manager
> className="org.apache.catalina.session.PersistentManager"
>               debug="0"
>               saveOnRestart="true"
>               maxActiveSessions="-1"
>               minIdleSwap="-1"
>               maxIdleSwap="-1"
>               maxIdleBackup="-1">
>                 <Store
> className="org.apache.catalina.session.FileStore"/>
>           </Manager>
> 		  -->
>           <Environment name="maxExemptions"
> type="java.lang.Integer"
>                       value="15"/>
>           <Parameter name="context.param.name"
> value="context.param.value"
>                      override="false"/>
>           <Resource name="jdbc/jstl" auth="Container"
>                     type="javax.sql.DataSource"/>
>           <ResourceParams name="jdbc/jstl">
>            
> <parameter><name>user</name><value>scott</value></parameter>
>            
> <parameter><name>password</name><value>tiger</value></parameter>
>            
> <parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDriver</value></parameter>
>            
> <parameter><name>driverName</name><value>jdbc:oracle:thin:@172.17.63.13:1521:orcl</value></parameter>
>           </ResourceParams>
>           <Resource name="mail/Session"
> auth="Container"
>                     type="javax.mail.Session"/>
>           <ResourceParams name="mail/Session">
>             <parameter>
>               <name>mail.smtp.host</name>
>               <value>localhost</value>
>             </parameter>
>           </ResourceParams>
>         </Context>
> 		
> 
> 
> Pl. advise me where Im wrong.
> 
> Yours,
> Sankar.B
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/


--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message