Re: Restart automatically Tomcat

2003-10-17 Thread Andy Wagg
I have used the Java Service Wrapper to do this for JBoss (integrated 
with Tomcat) on a Tru64 UNIX platform. However, this wrapper works for 
both UNIX and Windows NT.

http://wrapper.tanukisoftware.org/doc/english/index.html

Andy

[EMAIL PROTECTED] wrote:
I'm using Tomcat 4.1.24 et i want after it fails it restarts
automatically to have a high availability.


[Assuming Unix]
Way 1 - Set $CATALINA_PID before staarting tomcat. Then have a cron
job run occasasionally to look at the value in the file pointed at
by $CATALINA_PID.  If the process doesn't exist - start tomcat.


That's a good idea.  Another option (also assuming unix, and the
willingness to do a little bit of shell scripting) would be to add a
wrapper around tomcat's scripts.
The general idea is

  while true; do
# using run because it blocks
$CATALINA_HOME/bin/catalina.sh run
if really_shutting_down; then
  # we're supposed to stop, so exit gracefully
  exit 0
fi
  done
really_shutting_down implies that you'd need a shutdown wrapper with
some provision for allowing the `loop' script to determine whether a
shutdown was accidental or intentional.  You'd also want to have some
sort of check in place to prevent an infinite loop if tomcat was
started with a bad configuration file, or something of that nature.
There are probably other little details to work out, but that's the
basic idea.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: jspc pre-compiled pages distributed with .war file?

2002-10-25 Thread Andy Wagg
Tomcat requires the servlet and servlet mappings in the web.xml, this is 
the way it works. Essentially, servlets are generated for the jsp pages. 
I modified my web application this week to precompile the jsp files and 
no longer include these in my war.

The JspC compiler when used with the -webapp option, also allows the use 
of either -webxml or -webinc to generate a complete web.xml file or just 
the servlet and servlet mappings to be included. I found I couldnt do 
this using the ant jspc command, but rather used a java task to run the 
jspc command.

My generated .java classes were then compiled with all my other classes 
and put in the war.

Andy.


Thomas Heller wrote:
hi there,

i am migrating my projects from php to java and began to set up a
development server that ideally does all the dev work once a project is
marked release i just call an ant task to deploy the project to one or more
(load balanced) production servers.

i have written an ant build.xml to compile my webapp and to put everything i
need into mywebapp.war. thats working very fine and i can just deploy that
.war to a tomcat server without any problems.

now, i have setup another ant task to precompile every jsp file using jasper
(ant task jspc). thats working perfectly fine and i have loads of
index_jsp.java, etc files. now i compile those to .class files and i would
like to distribute them inside the .war file so that the tomcat server
itself doesnt need to compile anything by himself. _Ideally_ i'd like to
exclude _any_ .jsp file in the .war file and just include the compiled
jsp.class files.

but i wonder ... tomcat somehow doesnt really know what i'm sending him and
he doesnt recognize any of the precompiled pages. how do i tell tomcat to
use the precompiled pages in the .war instead of compiling them himself?

i know i can write this it into my web.xml

servlet
servlet-nameindex_jsp/servlet-name
servlet-class
  my.package.jsp.index_jsp
/servlet-class
/servlet

servlet-mapping
servlet-nameindex_jsp/servlet-name
url-pattern/index.jsp/url-pattern
/servlet-mapping

but somehow i dont like it this way, but i would rather use this instead of
putting jsp files into the .war file. would be cool if tomcat would do
something like this by himself when he finds *_jsp.class in a
/WEB-INF/precompiled directory.

Anyways maybe tomcat has some support for what i'm trying to find and i just
can't find it? Comments welcome

Greetings,
Thomas




--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org







--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Where should i put dynamically generated graphics

2002-08-29 Thread Andy Wagg

Hello

I have a web application that generates a gif file that is then 
subsequently displayed. It expects to find the gif file in the context 
of the web application. The web app is deployed as a war so obviously 
the generated files cant be put there. Any suggestions as to where these 
files could be copied that would be accesible by the browser.

Thanks in advance.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Newbie: Tomcat EJBs

2001-10-03 Thread Andy Wagg

Can someone tell me if tomcat supports EJB's, looking through the 
documentation I'm still not sure. Is this part of catalina in Tomcat 4
or is there something else.

Thanks,

AW