tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kitching Simon <Simon.Kitch...@orange.ch>
Subject RE: load-on-startup
Date Thu, 14 Sep 2000 14:16:04 GMT
Hi,

> -----Original Message-----
> From:	Braswell, Sy  [SMTP:KK2269@dfa.state.ny.us]
> Sent:	Thursday, September 14, 2000 3:20 PM
> To:	'tomcat-user@jakarta.apache.org'
> Subject:	load-on-startup
> 
> i have a connection pool servlet that i would like loaded when tomcat
> starts. i have tried using the following syntax in the web.xml file:
> 
>     <servlet>
>          <servlet-nameConnectionPool</servlet-name>
>          <servlet-class>berm.search.ConnectionPool</servlet-class>
>          <load-on-startup>1</load-on-startup>
>     </servlet>
> 
> 1) im not sure if the ConnectionPool.class is suppose to be on the path
> /usr/local/tomcat/classes/berm/search/ConnectionPool.class
> 
> or 
> 
> /usr/local/tomcat/webapps/bermPatSearch/WEB-INF/classes/berm/search/Connec
> ti
> onPool.class
> 
> if i do not put it in the path 
>    /usr/local/tomcat/classes/berm/search/ConnectionPool.class
> i get the error:
> cannot load servlet name: ConnectionPool
> cannot load servlet name: ConnectionPool
> cannot load servlet name: ConnectionPool
> cannot load servlet name: ConnectionPool
> cannot load servlet name: ConnectionPool
> cannot load servlet name: ConnectionPool
> 
> if i do put it on the path:
> /usr/local/tomcat/classes/berm/search/ConnectionPool.class
> i do not get the above error
> but it does not load either.
> 
> 2) which xml file does is go in?
> /usr/local/tomcat/conf/web.xml
> or
> /usr/local/tomcat/webapps/bermPatSearch/WEB-INF/web.xml
> 
> i have tried all combinations of above with no luck...
> any ideas?
> is there another parameter that needs to be set?
	[Kitching Simon]  
	I'm doing almost exactly the same thing, and it works great.
	The servlet class is under the WEB-INF/classes directory,
	and the WEB-INF/web.xml is used to define the servlet
	name, class and load-on-startup attributes.

	As with all servlets, the code should be under the WEB-INF/
	classes directory. Why you get the "cannot load servlet" message,
	I have no idea. Perhaps your servlet is throwing an exception
	on startup?

	Good luck,

	Simon


Mime
View raw message