• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems calling servlet at startup

 
Dave Mere
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm setting up an embedded database with my struts app, which works by creating a local database copy on startup. To do this, I need to place the relevant code in a servlet that is called on tomcat start-up, but I'm having problems calling this file.

I've set the servlet-classs in my web.xml like this:


I thought that this entry was sufficient but obviously not. Can anyone spot what I might be doing wrong?

Many thanks in advance!

Dave
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put the class file.
 
Dave Mere
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

It compiles to
classes/org/kew/alpine/datalayer.

My build.xml file then copies this to
WEB-INF/classes/org/kew/alpine/datalayer which is where tomcat reads it from. I have a number of other class files in there which run as I expect them to. The init file just doesn't seem to be running on startup.

thanks

Dave
 
Dave Mere
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wait, I got it.

My class was called DatalayerServlet

My web.xml was declaring DataLayerServlet

Only took me an hour to spot that. :roll:


Thanks for looking at this Ben!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic