Why don't you write a startup servlet that calls the lazy service? sv
On Tue, 25 Jan 2005, sergiu gordea wrote: > Hi Michael, > > Thanks for your answer, unfortunately my problem is a little bit different. > We have an application developed with turbine/velocity technology, and I'm > quite familiar with the installation of turbine and of our application. > > My problem is a little bit different. > I wrote a shell script to rebuild our application in each night (get > from cvs, compile, restart tomcat). > My problem is that the simple tomcat restart is not loading the context > automatically, and it is not starting turbine. > So .. the scheduled jobs that we have in our system are not > automatically loaded and executed. > I tried to use lynx to send a request to the server, but it seems that > the jobs are still not loaded. > > We instantiate the schedueled jobs in the constructor of a tool > defiened in turbine configurations. > I suspect that turbine uses laizy loading and the tool is not > instantiated untill it is used for the first time, am I right? > > So ... the real problem is to start turbine and to instantialte the > tools automatically, imeadiate after tomct restart. > > Do you have an idea of how can I achieve this in a better way then > using lynx to generate a request? > > Thanks, > > Sergiu > > I have to > > Michael Kunze wrote: > > > sergiu gordea wrote: > > > >> I would like to find out which is the best way o initialize the > >> turbine on tomcat start up? > >> > >> Is is possible to fix this problem just with configuration options? > >> Or should I write some code? > > > > > > Hello, > > > > i do not fully understand what you want to archieve. Just in case you > > want to get started you should follow this little HowTo from Jeffery > > which he posted a few days ago. It helped me alot btw ;) > > > > ---------------------------------------------------------------------------- > > > > > > # > > # build.properties - for META > > # > > > > # > > # Application Server configuration > > # > > maven.appserver.home = <directory_for_appserver_home> > > maven.appserver.name = tomcat > > > > # > > # app config > > # > > turbine.app.name = <appname> > > turbine.app.flavor=turbine-2.3.1 > > > > # > > # create the om layer interfaces for torque > > # > > turbine.app.om.layer=torque > > > > # > > # don't create demo pages > > # > > turbine.app.setup.demo=false > > > > # > > # Inplace dev mode > > # > > turbine.plugin.mode=inplace > > > > # > > # Initial ID values for the ID_TABLE > > # > > initialID = 1100 > > initialIDValue = 100 > > initialIDStep = 10 > > > > # > > # database settings > > # > > torque.database=mysql > > torque.database.driver = com.mysql.jdbc.Driver > > torque.database.user = myuser > > torque.database.password = mypassword > > torque.database.buildUrl = jdbc:mysql://localhost/<appname> > > torque.database.createUrl = jdbc:mysql://localhost/<appname> > > > > ---------------------------------------------------------------------------- > > > > > > > > 2. change to the webapps directory of your servlet container. > > 3. Create the skeleton for the app > > > > % maven -Dturbine.setup.properties=~/build.properties turbine:setup > > > > 4. change into your webapps/<newapp> directory > > > > 5. modify the <appname>-schema.xml accordingly (found in > > src/schema/<appname>-schema.xml) > > > > 6. Create SQL (all commands run from webapps/<appname> directory > > > > 1. create the database > > % maven torque:create-db > > > > 2. generate SQL code > > % maven turbine:sql > > > > 3. put SQL in database > > % maven torque:insert-sql > > > > 7. Compile your application > > > > % maven java:compile > > > > no need to deploy since we are inplace development mode > > > > ----------------------------------------------------------------------- > > > > What he was missing tho is to get tomcat working with it. So the 8th > > step would be: > > > > 8. Start tomcat. Point your browser to http://localhost:8080/manager/html > > Login with the password you set during installation of tomcat and use > > the 'Installation' form on that site (It's the one with the 3 input > > fields) > > > > I got it in german so i'm not sure what the actual translation is. > > The first field (context path) would be: /<newapp> > > The second field leave empty. And in the third field you need to put > > the path to your webapp root folder. It needs to look like this: > > file:C:/path/to/your/webapplication > > > > Note: You need to prepend 'file:' and you have to use forward slashes. > > If you did everything fine tomcat should find the 'WEB-INF' folder > > below the specified folder automatically and you should be ready to go. > > > > Just in case you didn't got it, the URL to your webapp is: > > http://localhost:8080/<webapp> > > > > 9. Here is an optional 9th step you'd like to take. > > Find the following file: > > <tomcat root>\conf\Catalina\localhost\<appname>.xml > > open it in editor and add reloadable="true" to the <context> tag as an > > attribute like this: > > <Context path="/..." docBase="..." reloadable="true"> > > > > That way you can just compile the classes in your favourite IDE and > > don't need to worry about restarting tomcat. > > > > Just incase this is crap for the old stagers *g* ignore it. Helped me > > alot anyway because something like that is really missing on the page... > > > > Michael > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
