-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ahmed,
On 12/5/2009 7:17 AM, ahmed kasim wrote: > I have few jars which need to get loaded only when the war file is > getting loaded or when the request comes, to be more clear I have > some jar which is having connection to DB, if I specify in my > context.xml file it is getting loaded when the server getting > started up initially, so I want to avoid this and make it when my war > file gets loaded the db connection should get loaded. > > <Resource name="jdbc/DB2DS" auth="Container" > type="javax.sql.DataSource" > driverClassName="com.ibm.db2.jcc.DB2Driver" > url="jdbc:db2://localhost:50000/SPARK" username="db2admin" > password="d...@dmin" maxActive="20" maxIdle="10" maxWait="-1"/> So, this resource is being specified in context.xml? Which one? If it's conf/context.xml then it's the default configuration for all contexts, including ROOT, which is (nearly) always deployed, so you should expect your database connection to be established whether you have deployed "your" webapp or not. If you've placed that <Resource> definition in your webapp's META-INF/context.xml file, then the resource should not be created until webapp deployment. > I have three jar file specified for Resource What does this mean? <Resource> elements do not reference JAR files directly. > if i place jar file Where? > it is getting loaded and server starts up looking for connection > with db. What is getting loaded? The "JAR file" or the context.xml file? > How can I avoid server starting time look up and make it available > only when I deploy the war file. Make sure your <Resource> definition is in your webapp's private context.xml file. The location of the JAR file should be in $CATALINA_HOME/lib for Tomcat 6.0, which I presume you are using. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkselskACgkQ9CaO5/Lv0PDB3gCgps+AvNnwyKzfxvewxFVnnp4H vqYAnjII5yNrUyiToUUnDDPrbFsZOojp =68c3 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org