Re: Problem with ServletFilter

2004-06-24 Thread Jacob Kjome
At 11:30 AM 6/24/2004 +0200, you wrote:
Hello,
I have a Problem with ServletFilters.
I am using a CacheFilter originally from Jason Falkner.
This CacheFilter wraps ServletWrapper and writes outpustream to a 
ByteArrayStream and finally this bytearraystream is written to disk.
Installing has been very easy and FIlter is working.
But: every page I tested (page size from 14k to 150k) is truncated. 
Truncation is already in the ByteArray.
Are you flushing the writer in the wrapper?   Hmm... Dont' have time to go 
into details.  I'll just past a useful working wrapper and helper class here...

package com.acme.servlet.filter;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
public class GenericResponseWrapper extends HttpServletResponseWrapper {
private ByteArrayOutputStream output;
private PrintWriter writer;
private int origStatus = 0;
private int contentLength = 0;
private String contentType;
public GenericResponseWrapper(HttpServletResponse response) {
super(response);
output = new ByteArrayOutputStream();
}
public byte[] toByteArray() {
if (writer != null) writer.flush();
return output.toByteArray();
}
public String toString() {
if (writer != null) writer.flush();
return output.toString();
}
public ServletOutputStream getOutputStream() {
return new FilterServletOutputStream(output);
}
public PrintWriter getWriter() {
writer = new PrintWriter(getOutputStream(), true);
return writer;
}
public void sendError(int sc) throws IOException {
super.sendError(sc);
this.origStatus = sc;
}
public void sendError(int sc, String message) throws IOException {
super.sendError(sc, message);
this.origStatus = sc;
}
public int getStatus() {
return this.origStatus;
}
public void setContentLength(int length) {
this.contentLength = length;
super.setContentLength(length);
}
public int getContentLength() {
return this.contentLength;
}
public void setContentType(String type) {
this.contentType = type;
super.setContentType(type);
}
public String getContentType() {
return this.contentType;
}
}
package com.acme.servlet.filter;
import javax.servlet.ServletOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class FilterServletOutputStream extends ServletOutputStream {
private DataOutputStream stream = null;
public FilterServletOutputStream(OutputStream output) {
stream = new DataOutputStream(output);
}
public void write(int b) throws IOException {
stream.write(b);
}
public void write(byte[] b) throws IOException {
stream.write(b);
}
public void write(byte[] b, int off, int len) throws IOException {
stream.write(b, off, len);
}
}
Jake

The JSP-Page originally contained include directives which I evetually 
removed but same result.
I am using tomcat 4.1.29 and mod_jk and Apache 2.0 (same result with 
Apache 1.3)

so any idea or any suggestion?
--

Mit freundlichen Grüßen
Dipl.Inform. Carsten Lex
Geschäftsführer DeepWeb GmbH

DeepWeb GmbH
Universität, Gebäude 30
66123 Saarbrücken
Tel.:  0681 - 302 6308
Mobil: 0163 - 33 37 002

-
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]


RE: list active sessions.

2004-06-23 Thread Jacob Kjome
Quoting Frank Zammetti <[EMAIL PROTECTED]>:

> How would the counter persist?  Even assuming the sessions persist
> (something I don't see, even though I know the sessions are fully
> serializable), the counter as I previously described is in-memory as part of
> a static class.  Are you talking about modifying it to use a database?  In
> that case, yes, I agree the counter should then persist as well.
> 
The place where you are storing the counter is a static class?  You mean a
static inner class?  Or did you, maybe mean a static variable?  You do know that
static variables are transient, right?

Sessions do persist, and if you are storing an object in the session that is
holding a non-static/non-transient counter variable and you restart the server,
and you visit the page that shows the counter and your session hasn't timed out,
then the counter value you see should reflect the last value stored before the
server restart (plus incrementing the counter, if that is what you do).


...Ok, I just re-read what you wrote previously and you are talking about
storing a count of sessions in a SessionListener.  So, I guess what I've written
kind of misses the point of what you are asking.  What you'd need to do is get a
handle, somehow, to Tomcat's count of sessions.  All your session listner would
do is count sessions which are created while the listener is listening.  Even if
you stored the value in a database, it probably wouldn't be valid because if
sessions expired between stop and start of Tomcat, I'm not sure you
SessionListener would be notified about this at startup?  You'd have to
investigate that.  If it is called for each session expiring, you could keep
that value in the database, initialize your SessionListener counter variable
with that value and then let the listener remove/add sessions.  

Jake

> Frank
> 
> 
> >From: Jacob Kjome <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: Tomcat Users List <[EMAIL PROTECTED]>
> >Subject: RE: list active sessions.
> >Date: Wed, 23 Jun 2004 15:10:31 +
> >
> >Quoting Frank Zammetti <[EMAIL PROTECTED]>:
> >
> > > I don't see that behavior.  Is there a setting in Tomcat to turn that
> > > function on and off perhaps?  None of my sessions survive a Tomcat
> >restart,
> > > so I've never had to deal with this.
> > >
> >
> >Tomcat will dump session objects which don't implement Serializable or are
> >marked as such, but fail serialization for whatever reason.  Make sure
> >objects
> >are serializable and the counter will persist across restarts (as long as
> >the
> >session hasn't already timed out).
> >
> >Jake
> >
> > > Frank
> > >
> > >
> > > >From: "Radek Liebzeit" <[EMAIL PROTECTED]>
> > > >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > > >To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
> > > >Subject: RE: list active sessions.
> > > >Date: Wed, 23 Jun 2004 07:51:08 +0200
> > > >
> > > >Really nice.
> > > >
> > > >I am just wondering about one thing - about "persistent sessions". I
> > > >have a session counter based on the SessionListeners. It is increased
> > > >when some session is created and decreased when the session is
> > > >destroyed. So, when I restart the Tomcat server some sessions are
> > > >recreated but counter state doesn't. Therefore, after session timeout,
> > > >the counter status is negative.
> > > >
> > > >It's not problem for me, it is enough for my purposes. I am just
> > > >wondering how do you solve this behaviour?
> > > >
> > > >Radek
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: Frank Zammetti [mailto:[EMAIL PROTECTED]
> > > > > Sent: Monday, June 21, 2004 3:45 PM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: RE: list active sessions.
> > > > >
> > > > > I spent a couple of days last week implementing just such a thing,
> >so
> > > >I
> > > > > feel
> > > > > qualified to answer :)
> > > > >
> > > > > There is no easy way to do it.  There USED to be a SessionContext
> > > >object
> > > > > available in the servlet spec that would allow you to do a lot of
> >cool
> > > > > things with sessions, but it w

Re: Webapps Log4j config problem

2004-06-23 Thread Jacob Kjome
Hi Igor,

It's hard to say what is happening since Enhyda and Jonas are probably
controlling the classloader configuration for Tomcat5.  You could add a
log4j.xml file to Tomcat's common/classes directory for Tomcat's logging.  For
the webapp itself, make sure log4j.jar is in WEB-INF/lib and if you are
depending on Log4j autoconfiguration, make sure log4j.xml is in WEB-INF/classes,
not the root of BarracudaDiscRack.  BTW, you wrote "Web-inf/lib".  Make double
sure that the directory is in all caps, so, "WEB-INF/lib".  Case is important,
even on Windows.

Jake

Quoting Igor Smirnov <[EMAIL PROTECTED]>:

> Hi,
> 
> I am having a problem with BarracudaDiscRack application that load withing
> Tomcat.
> I;m useing Enhydra, jonas 4.1, Tomcat 5.
> I have all the necessary files(lof4j, barracuda etc) jars in Web-inf/lib and
> the classes in Web-inf\classes.
> In the main BarracudaDiscRack folder, I have the log4j.xml that contains the
> following lines:
> 
> 
> 
> http://jakarta.apache.org/log4j/";
> debug="false" threshold="debug">
> 
> 
> 
> 
> 
> 
> 
value="C:/IgorEnhydra6.0-1/work/webapps/Enhydra/BarracudaDiscRack/WEB-INF/main.log"
> />
> 
> 
> 
> 
> 
> 
> 
value="C:/IgorEnhydra6.0-1/work/webapps/Enhydra/BarracudaDiscRack/WEB-INF/test.log"
> />
> 
> 
> 
> 
> 
>  value="off"/>
> 
> 
>  ref="A1"/>
>  name="org.enhydra.barracuda.plankton.data.ObjectRepositoryAssembler"> value="warn"/>
> 
>  name="org.enhydra.barracuda.core.event.ApplicationGateway"> ref="A1"/>
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> Now, when the application is loaded I get an error:
> log4j:WARN No appenders could be found for logger (root).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN No appenders could be found for logger
> (org.apache.catalina.session.ManagerBase)
> log4j:WARN Please initialize the log4j system properly.
> 
> The servers starts, but no logging is performed.
> 
> What might be going wrong. I had no similiar problem withing jonas 3x ant
> Tomcat 4x.
> Thank you!
> Igor

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



RE: list active sessions.

2004-06-23 Thread Jacob Kjome
Quoting Frank Zammetti <[EMAIL PROTECTED]>:

> I don't see that behavior.  Is there a setting in Tomcat to turn that
> function on and off perhaps?  None of my sessions survive a Tomcat restart,
> so I've never had to deal with this.
> 

Tomcat will dump session objects which don't implement Serializable or are
marked as such, but fail serialization for whatever reason.  Make sure objects
are serializable and the counter will persist across restarts (as long as the
session hasn't already timed out).

Jake

> Frank
> 
> 
> >From: "Radek Liebzeit" <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
> >Subject: RE: list active sessions.
> >Date: Wed, 23 Jun 2004 07:51:08 +0200
> >
> >Really nice.
> >
> >I am just wondering about one thing - about "persistent sessions". I
> >have a session counter based on the SessionListeners. It is increased
> >when some session is created and decreased when the session is
> >destroyed. So, when I restart the Tomcat server some sessions are
> >recreated but counter state doesn't. Therefore, after session timeout,
> >the counter status is negative.
> >
> >It's not problem for me, it is enough for my purposes. I am just
> >wondering how do you solve this behaviour?
> >
> >Radek
> >
> >
> > > -Original Message-
> > > From: Frank Zammetti [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, June 21, 2004 3:45 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: list active sessions.
> > >
> > > I spent a couple of days last week implementing just such a thing, so
> >I
> > > feel
> > > qualified to answer :)
> > >
> > > There is no easy way to do it.  There USED to be a SessionContext
> >object
> > > available in the servlet spec that would allow you to do a lot of cool
> > > things with sessions, but it was removed as of spec 2.1 I think
> >because
> > > Sun
> > > believed it to be a security risk.  Unfortunately there was nothing
> >added
> > > to
> > > take it's place.
> > >
> > > The way you have to do this, or at least one way (the only way I
> >found) is
> > > to track it yourself.
> > >
> > > First, I already had an AppConfig object that contains a static
> >HashMap.
> > > This has a bunch of config values for my app loaded from a config file
> >at
> > > startup.  I then added an activeSessions HashMap to that class.
> >Create a
> > > similar class for yourself, along the lines of the following:
> > >
> > > import java.util.HashMap;
> > > public class AppConfig {
> > >   private static HashMap activeUsers = null;
> > >   public static HashMap activeUsers() {
> > > return activeUsers;
> > >   }
> > >   public static void setActiveUsers(HashMap inActiveUsers) {
> > > activeUsers = inActiveUsers;
> > >   }
> > > }
> > >
> > > Then, create a SessionListener something like the following:
> > >
> > > package com.mycompany.myapp;
> > > import java.util.HashMap;
> > > import javax.servlet.http.HttpSession;
> > > import javax.servlet.http.HttpSessionEvent;
> > > import javax.servlet.http.HttpSessionListener;
> > > public class SessionListener implements HttpSessionListener {
> > >   public void sessionCreated(HttpSessionEvent se) {
> > > HashMap activeUsers = (HashMap)AppConfig.getActiveUsers();
> > > synchronized (activeUsers) {
> > >   activeUsers.put(se.getSession().getId(), new HashMap());
> > > }
> > >   }
> > >   public void sessionDestroyed(HttpSessionEvent se) {
> > > HashMap activeUsers = (HashMap)AppConfig.getActiveUsers();
> > > synchronized (appConfig) {
> > >   activeUsers.remove(se.getSession().getId());
> > > }
> > >   }
> > > }
> > >
> > > Then just add the following to web.xml after your  section:
> > >
> > >   
> > >
> >com.mycompany.myapp.SessionListener
> > >   
> > >
> > > Basically, every time a session is created, you'll get an entry in the
> > > activeUsers HashMap keyed by sessionID, and the record will be removed
> > > when
> > > the session is destroyed.  Further, what I do is that when my logon
> >Action
> > > is called, when the user is validated I add some information for that
> >user
> > > into the HashMap (first name, last name, logon time, etc).  This
> >allows me
> > > to have a pretty nice little tracking display in my app.
> > >
> > > The one problem you run into with this is that if the user just closes
> >the
> > > browser window rather than using your nice logout function, the
> >session
> > > lingers until the timeout period elapses.  I didn't like that!  My app
> >is
> > > frames-based, and I already had one hidden frame, so I added the
> >following
> > > to the  tag of that frame's source document:
> > >
> > > onUnload="openLogoffPopup();"
> > >
> > > ... and then the openLogoffPopup() function:
> > >
> > >   function openLogoffPopup() {
> > > windowHandle = window.open("", "",
> >"width=200,height=1,top=1,left=1");
> > > str =  "<" + "html><" + "head><" + "title><" + "/title><" +
> >"/head>";
> > > str += "<" + "body
> > 

Re: Defining data sources in context only

2004-06-23 Thread Jacob Kjome
Quoting "Christopher A. Brooks" <[EMAIL PROTECTED]>:

> Hi,
> 
> My problem is as follows.  I would like to have an ant script that
> auto-deploys my webapp into Tomcat 5 including any data source resources it
> might need (e.g. Database connections).  Thus far I have only been able to
> define these resources in the server.xml file, which means my deployment
> process requires two steps (deploy, then beg my admin to change my data
> source references in the server.xml).
> 
> What are the best practices for a "one click deploy" with tomcat?  Thanks in
> advance,
> 

Put at "context.xml" file in the WAR file's META-INF directory.  The root
element is  and includes anything that a normal  has in
server.xml.  Deploy and you're set to go.

Jake

> Chris
> 
> 
> -
> 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]



RE: Tomcat and hot code deployment

2004-06-22 Thread Jacob Kjome
Quoting Ivan Jouikov <[EMAIL PROTECTED]>:

> Yes I am sure I am referring to WEB-INF.
> 
> See, one of my classes has its own static daemon running, and when I update
> that class's code, a new one gets loaded in, but the old one keeps running.
> 

Are you able to shut down the daemon thread at application shutdown?  If you can
get a handle to the thread, use a servlet context listener contextDestroyed()
method to do the shutdown.  The classloader can't be destroyed properly when a
daemon thread is still running within it.  I don't pretend to know the details
of the destruction of the WebappClassLoader, so I'll leave the specifics to
someone who knows better.

Jake

> -----Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 22, 2004 3:48 AM
> To: Tomcat Users List
> Subject: Re: Tomcat and hot code deployment
> 
> At 10:37 PM 6/21/2004 -0700, you wrote:
> >Hey!
> >
> >As far as I understand, hot code deployment, is when you modify .class
> >inside /WEB-INF/classes, and tomcat reloads it,  correct?
> >
> >If so, is it true, that whenever it reloads it, the OLD instance of static
> >objects, threads, and properties stay alive, that is, tomcat doesn’t
> >destroy them?   Is that why many  developers don’t use hot code
> >deployment on production servers?  Because I’ve been trying to debug
> my
> >app, and I realized this pattern, and if I am correct, then my application
> >is bug-free.
> >
> 
> I haven't attempted to verify what you are saying, but it seems to me that
> if the classes containing static variables exist inside WEB-INF/lib or
> WEB-INF/classes, they should reflect any changes made to code as the
> WebappClassLoader is dumped and recreated upon reload.  Are you sure you
> aren't referencing static variables from classes existing in common/lib,
> common/classes, shared/lib, or shared/classes?  Those wouldn't be reloaded.
> 
> Jake
> 
> >Thanks
> >
> >---
> >Outgoing mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004
> 
> 
> 
> -
> 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]



RE: Tomcat Logging.. whats the best way ?

2004-06-22 Thread Jacob Kjome
Quoting Benson Margulies <[EMAIL PROTECTED]>:

> Sure, but the other question is this:
> 
> ServletContext.log allows a webapp to log. Wouldn't It Be Nice if that
> same log was somehow available to any old bit-o-java when running in the
> environment?
> 

So, you want all logging to go to the servlet context log file for the
application?  So use the ServletContextLogAppender from the logging-log4j-sandbox...
http://cvs.apache.org/viewcvs.cgi/logging-log4j-sandbox/src/java/org/apache/log4j/servlet/ServletContextLogAppender.java

See also:
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging


Jake

> 
> -
> 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]



Re: Tomcat and hot code deployment

2004-06-22 Thread Jacob Kjome
At 10:37 PM 6/21/2004 -0700, you wrote:
Hey!
As far as I understand, hot code deployment, is when you modify .class 
inside /WEB-INF/classes, and tomcat reloads it,  correct?

If so, is it true, that whenever it reloads it, the OLD instance of static 
objects, threads, and properties stay alive, that is, tomcat doesn’t 
destroy them?   Is that why many  developers don’t use hot code 
deployment on production servers?  Because I’ve been trying to debug my 
app, and I realized this pattern, and if I am correct, then my application 
is bug-free.

I haven't attempted to verify what you are saying, but it seems to me that 
if the classes containing static variables exist inside WEB-INF/lib or 
WEB-INF/classes, they should reflect any changes made to code as the 
WebappClassLoader is dumped and recreated upon reload.  Are you sure you 
aren't referencing static variables from classes existing in common/lib, 
common/classes, shared/lib, or shared/classes?  Those wouldn't be reloaded.

Jake
Thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004

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


Re: TC5.0.25 ignores my META-INF/context.xml

2004-06-20 Thread Jacob Kjome

At 03:23 PM 6/20/2004 +0200, you wrote:
Hello Jacob,
I thing your analyze is not correct.
Well, if your findings are right, then I'm glad I'm wrong :-)   Last time I 
checked, this was not working for me, but I can't remember how far back 
that was.  Just to be clear, I was wrong on only the bit on dropping a .war 
file into the webapps directory not deploying the META-INF/context.xml file 
to the conf/Catalina/localhost directory.  The rest should be correct.

Jake

The problem is:
currently the auto deployment for directories not implement.
Copy a war with META-INF/context.xml at your webapps (host.appbase) dir
the file context.xml was extracted and deployed. Tested with 5.0.25.
see my log
20.06.2004 15:20:16 org.apache.catalina.startup.Catalina start
INFO: Server startup in 13259 ms
20.06.2004 15:20:24 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL 
file:D:\tomcat\temp\temp\release
filter\webdev-server\conf\Catalina\localhost\releasefilter.xml

I thing, it was also a usefull feature to implement this for directory 
deployment.
   Easier for some non expert customer or developer ;-)

regards
peter
Jacob Kjome schrieb:
At 12:26 PM 6/20/2004 +0400, you wrote:
Hi, I've just upgraded from TC4.1.12 to TC5.0.25.
Everything is OK, but TC evidently ignores my context configuration file
unless I place it directly into 'conf\Catalina\localhost\'.
It is ignored both if placed as 'webapps\my-app\META-INF\context.xml' and as
'webapps\my-app.xml'.
What is wrong? Should I fix some server setting?

Nothing is wrong.  The loading of the context configuration files has 
simply changed between 4.1.xx and 5.0.xx.  The appropriate place for the 
context configuration file (CCF) is conf/[Engine]/[Host].  You can either 
put it there manually or you can go though the manager interface to 
deploy an application where either the WAR file has a 
META-INF/context.xml or you point the to the CCF explicitly.
Unfortunately, just dropping the WAR file into webapps won't autodeploy 
the META-INF/context.xml, so you'll have to put that under the conf 
directory manually.

Jake

Regards,
Sergey
-
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]


--
J2EE Systemarchitekt und Tomcat Experte
http://objektpark.de/
http://www.webapp.de/
Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:(49) 175 1660884
E-Mail:  [EMAIL PROTECTED]

-
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]


Re: TC5.0.25 ignores my META-INF/context.xml

2004-06-20 Thread Jacob Kjome
At 12:26 PM 6/20/2004 +0400, you wrote:
Hi, I've just upgraded from TC4.1.12 to TC5.0.25.
Everything is OK, but TC evidently ignores my context configuration file
unless I place it directly into 'conf\Catalina\localhost\'.
It is ignored both if placed as 'webapps\my-app\META-INF\context.xml' and as
'webapps\my-app.xml'.
What is wrong? Should I fix some server setting?
Nothing is wrong.  The loading of the context configuration files has 
simply changed between 4.1.xx and 5.0.xx.  The appropriate place for the 
context configuration file (CCF) is conf/[Engine]/[Host].  You can either 
put it there manually or you can go though the manager interface to deploy 
an application where either the WAR file has a META-INF/context.xml or you 
point the to the CCF explicitly.  Unfortunately, just dropping the WAR file 
into webapps won't autodeploy the META-INF/context.xml, so you'll have to 
put that under the conf directory manually.

Jake

Regards,
Sergey
-
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]


Re: I'll kill JNDI

2004-06-13 Thread Jacob Kjome
At 07:19 PM 6/13/2004 +0300, you wrote:
Hi all,
I've installed apache 2.049 + Tomcat 5.0.26 + PostgreSQL and i could 
connect apache to tomcat after painful night with mod_jk2.
So far so good.
I could do regular jdbc connection by using traditional 
Class.forName(ZOBARA) method to my existing fair pgsql.
Then i wanted to try my first application's jdbc connection with DBCP Pool 
exist on Tomcat. You know, we need it for bunch of reasons.
I've read the documentation and also downloaded related JNDI reference 
from sun (which is completely makes blah blah about LDAP)
Check List;
0. rh-postgresql3.jar copied to $CATALINA_HOME/common/lib and removed from 
the all other locations.
1. Server.xml changed for postgre jdbc driver as described. (Checked for 
context tags)
What does "Checked for context tags" mean?  Either add the datasource stuff 
to  and provide a  to it in your 
META-INF/context.xml or just define it completely in the latter.

2. web.xml changed as described.
3. My application connection element uses clear sample
// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
// Look up our data source
DataSource ds = (DataSource)
 envCtx.lookup("jdbc/mydb");
4. Built this holly mess with ant by using build.xml
5. Point to my page and see this
"java.sql.SQLException: No connection"
Is there any single one have an idea what's going on???
I've double checked all the things. If anyone using postgreSQL with DBCP 
please give me a hint.
Have you ever had this working with any database?  If so, then I'd suspect 
a bug in DBCP working with PostgreSQL.  However, if this is your first time 
using DBCP with Tomcat, I suspect it is something you did.  See my 
suggestion above and triple check everything.  If you still can't find 
anything wrong, post your config.

Jake

Thanks
Take care all
Note: Turkish list fellows just drop me a line :=)

-
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]


Re: [Fwd: Tomcat5.0.25 and Java Mail not seem to work]

2004-06-12 Thread Jacob Kjome
Maybe because of this?
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29255
Grab 5.0.26beta.
Jake
At 01:45 PM 6/13/2004 +1000, you wrote:
Hi all,
I am currently porting an application from Tomcat 4.1.x to Tomcat 5.0.25. 
Everything is going fine except for JavaMail.
In the application we have setup both database and JavaMail as Global 
Naming Resources. The database global work fine but I am getting the 
following with the Mail resource (see output below)

I have downloaded the 2 mail and activation Jars and added them to the 
/common/lib directory (have also tried in the endorsed directory)

   * javamail-1.3.1
   * jaf-1.0.2 (activation)
I have also tried to setup the java mail in the individual contexts with 
the same error is this a bug or am I doing something wrong?!!!

Thanks in advance,
Alex.
From the catalina.out:

13/06/2004 03:37:50 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
13/06/2004 03:37:50 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 969 ms
13/06/2004 03:37:50 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Cannot create resource instance
   at 
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132)
   at 
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:791)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
   at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:155)
   at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:160)
   at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:125)
   at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:97)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2291)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
13/06/2004 03:37:50 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
13/06/2004 03:37:50 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.25
13/06/2004 03:37:50 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled

Server.xml snippet:

 
... more stuff ...
   
   

mail.smtp.hostmail.internode.on.net
   
   
   

factoryorg.apache.commons.dbcp.BasicDataSourceFactory
usernameour_user
driverClassNameoracle.jdbc.driver.OracleDriver
urljdbc:oracle:thin:@192.168.0.6:1521:UTF8
passwordpassword
   
 
  ... more stuff ...
   
   
   
   

   
   
   
   


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


Re: Need directions on how to connect to an IP address

2004-06-12 Thread Jacob Kjome
At 10:54 PM 6/12/2004 -0400, you wrote:
I have no knowledge of either Ant or Tomcat other than a partner told me 
that both were necessary to download a file from his IP address.
U. you need to download a file or you need to host a file for 
download by others?  If the latter, you might need Tomcat (or some other 
web server), if the former, you need a browser.  Just type in the URL (or 
IP address + path) and hit .  Not to be too harsh, but if you don't 
understand this, you probably shouldn't be even thinking about using Tomcat 
or Ant, for that matter.

Jake

This being said I have tried very hard to figure out how to use them to 
accomplish this. I seem to be able to start Tomcat up and shut it down 
(seemingly without ever using Ant), but the default port, 8080, causes a 
dns server error when I try to load http://localhost:8080/ . The 
documentation said this could be caused if I had something else running on 
that port. I don't know how to check if this is the case, nor see which 
ports I have available to reassign the default port to (which the 
documentation describes very well).

Finally, if someday I get Tomcat running properly, I have no idea of how 
to connect to said IP address to download the file on my buddy's computer. 
It would seem to be the simplest of Tomcat tasks, but I can't find a 
description of how to do it on any of the web documentation. Could someone 
point me there?

Thank you for your time,
Reid

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


Re: Works! RE: 2nd inquiry: how to - programmatically - authenticate oneself as Tomcat manager?

2004-06-10 Thread Jacob Kjome
At 12:25 PM 6/10/2004 -0700, you wrote:
Jerry Miernik wrote:
  This works! How did you come to know that?
  Is there a doc I should have read to know?
Well, strictly speaking, if you read the doc you'll know that's
not a legal URL :-)
Yep, but it has worked with every server I've ever used it with.  Maybe it 
is one of those things that became a standard despite the spec, kind of 
like the innerHTML property of the MS DOM, now supported by Mozilla (not 
sure about Opera?) even though it is nowhere in the DOM spec.

Jake

RFC 1738: Uniform Resource Locators (URL) shows the format:
 3.1. Common Internet Scheme Syntax
   While the syntax for the rest of the URL may vary depending on the
   particular scheme selected, URL schemes that involve the direct use
   of an IP-based protocol to a specified host on the Internet use a
   common syntax for the scheme-specific data:
//:@:/
*BUT* (see last sentence)
 3.3. HTTP
   The HTTP URL scheme is used to designate Internet resources
   accessible using HTTP (HyperText Transfer Protocol).
   The HTTP protocol is specified elsewhere. This specification only
   describes the syntax of HTTP URLs.
   An HTTP URL takes the form:
  http://:/?
   where  and  are as described in Section 3.1. If :
   is omitted, the port defaults to 80.  No user name or password is
   allowed.
Which is not to say that it won't, in some circumstances, "work"...
FWIW!
That's not true.  You can do:
http://username:[EMAIL PROTECTED]/
so:
URL tomcatMgr =
 new 
URL("http://manager:[EMAIL PROTECTED]:8080/manager/undeploy?path=/any");
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
  dream.  code.

-
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]


Re: 2nd inquiry: how to - programmatically - authenticate oneself as Tomcat manager?

2004-06-10 Thread Jacob Kjome
Quoting Bill Barker <[EMAIL PROTECTED]>:

> 1)  Assuming boring system encodings, and something to do Base64 encoding:
>String creds = username+":"+password;
>String b64creds = Base64Util.encode(creds.getBytes());
>tmc.addRequestProperty("Authorization","Basic "+b64creds);
> 
> 2) Not with Basic.  You might be able to rig something with Form.
> 

That's not true.  You can do:

http://username:[EMAIL PROTECTED]/

so:

URL tomcatMgr =
 new URL("http://manager:[EMAIL PROTECTED]:8080/manager/undeploy?path=/any");

Jake

> 
> "Jerry Miernik" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>   The question is related to undeploying a webapplication
>   from a Java code. A connection to tomcat manager using
>   
>   URL tomcatMgr =
> new URL("http://localhost:8080/manager/undeploy?path=/any";);
>   URLConnection tmc = tomcatMgr.openConnection();
>   
> 
>   results in:
>   java.io.IOException:Server returned HTTP response code: 401
> 
>   The questions:
>   1. Is there a way to deliver - programmatically - username
>  and password for the undeploy to take effect?
> 
>   2. Could the username and password be parameters in the
>  undeploy request? Or an earlier request?
> 
>   3. This Java program is trying to undeploy itself, inside
>  a jspInit() method. Is this technically possible?
>  (do not see why not, except for the problem with user
>   name and password).
> 
>   Thanks,
>   Jerry.
> 
> -
> 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]

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



Re: NoClassDefFoundError

2004-06-09 Thread Jacob Kjome
Is your webapp in "ROOT"?  That's usually the default application for Tomcat and
your own app would be in a named context.  Assuming you are doing the latter,
and your named context is "mycontext", you'd put it in:

$CATALINA_HOME/webapps/mycontext/WEB-INF/lib

Jake

Quoting "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>:

> Hi all!
> 
> I'm new to Tomcat.
> 
> I have a problem testing my web application (jsp pages)
> 
> A page of this application fails with this exception:
> javax.servlet.ServletException: org/apache/axis/client/Service
>   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
> root cause
> 
> java.lang.NoClassDefFoundError: org/apache/axis/client/Service
>   java.lang.ClassLoader.defineClass0(Native Method)
>   java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>   java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>   java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>   java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>   java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>   java.security.AccessController.doPrivileged(Native Method)
>   java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> 
org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:520)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:857)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
>   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>   java.lang.ClassLoader.defineClass0(Native Method)
>   java.lang.ClassLoader.defineClass(ClassLoader.java:537)
>   java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>   java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
>   java.net.URLClassLoader.access$100(URLClassLoader.java:55)
>   java.net.URLClassLoader$1.run(URLClassLoader.java:194)
>   java.security.AccessController.doPrivileged(Native Method)
>   java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> 
org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:520)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:857)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:840)
> 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
> 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1370)
> 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1230)
>   org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:184)
>   org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:110)
>   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>   java.lang.Class.getDeclaredConstructors0(Native Method)
>   java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
>   java.lang.Class.getConstructor0(Class.java:1922)
>   java.lang.Class.newInstance0(Class.java:278)
>   java.lang.Class.newInstance(Class.java:261)
> ..etc etc.
> 
> i have seen in the archive a similar problem posted by Tejo Vamsi Prayaga,
> but
> no solution
> 
> At the end that class is in axis.jar, file located in
> $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
> Is this the right location for my jar files?
> 
> Thanx
> Angelo
> 
> 
> -
> 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]



Re: Printer Unfriendly Tomcat 5 Documentation

2004-06-04 Thread Jacob Kjome
At 12:41 AM 6/5/2004 -0400, you wrote:
I found the cause of the unfriendly documentation.  Certain examples,
imbedded between   tags are consuming too much horizontal space.
Not only does this cause truncation on the right margin while printing, it
also causes unnecessary horizontal scrolling.
The obvious fix is to reformat the examples, placing a single attribute on
each line.  Not only does this fix my problem, it also improves the
productivity of administrators who use the examples as templates (copy,
paste, modify, repeat as needed).
I am happy to do the work, but I need two more hints.
1) Please point me to a good CVS client or Diff utility that will generate a
suitable Diff file on my Windows XP Pro workstation.  My web search found
too many choices and insufficient information for making a choice.
http://www.tortoisecvs.org/
Jake

2) Please tell me how to generate the HTML files from the documentation XML
source.  I would like to test my changes before I submit the updates.
-
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]


Re: Problem with tomcat 5.0.25 service

2004-06-03 Thread Jacob Kjome
I think this is because tools.jar isn't added to the classpath in the
service.bat service installer file.  I've modified mine to include this.  See
attached (renamed to service.txt to avoid being removed by filters).

BTW, I've mentioned this a few times to the Tomcat developers with little
response except that they'd think about it.  I don't see how this is an optional
thing to do since, without adding tools.jar to the classpath, jsp's simply won't
compile when Tomcat is run under the service.

Jake

Quoting Jens Kühnberger <[EMAIL PROTECTED]>:

> Hi,
> 
> I got a problem with installing tomcat 5.0.25 as a service. When I run
> tomcat with the startup script (startup.bat) I don't have any problem.
> After installing the service (service.exe install) and running my
> application as a service, I get the following compilation error for
> every jsp page I want to run:
> 
> 03.06.2004 17:25:43 org.apache.jasper.compiler.Compiler generateClass
> SCHWERWIEGEND: Javac exception
> Error running javac.exe compiler
>   at
>
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:452)
>   at
>
org.apache.tools.ant.taskdefs.compilers.JavacExternal.execute(JavacExternal.java:44)
>   at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:942)
>   at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
>   at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:378)
>   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
>   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
>   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
>   at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
>   at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
>   at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
>   at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>   at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>   at
>
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
>   at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
>   at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>   at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>   at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
>   at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>   at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>   at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
>   at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>   at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>   at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
>   at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>   at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
>   at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
>   at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
>   at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
>   at java.lang.Thread.run(Unknown Source)
> Caused by: java.io.IOException: CreateProcess: javac.exe -classpath
>
C:\tomcat5025\bin\bootstrap.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\classes;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\avalon-framework-cvs-20020806.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\batik.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-beanutils.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-collections.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-digester.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-lang.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-logging.jar;C:\tomcat5025\webapps\ROOT\WEB-INF\lib\commons-validator.jar;C

Re: Looking for naming-factory.jar from 5.0.24

2004-06-02 Thread Jacob Kjome
Quoting Michael Mehrle <[EMAIL PROTECTED]>:

> I see - where can I get it? I looked around on the jakarta site and they
> still list 5.0.25 (what's up with that?).
> 

Be a little inventive.  Look at Filip's post and figure out where it might be
from there.  Hint: move up one directory.

Jake


> Michael
> 
> - Original Message -
> From: "Shapira, Yoav" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Wednesday, June 02, 2004 9:12 AM
> Subject: RE: Looking for naming-factory.jar from 5.0.24
> 
> 
> 
> Hi,
> 5.0.26 has a good naming-factory.jar and is easy to download now ;)
> 
> Yoav Shapira
> Millennium Research Informatics
> 
> 
> >-Original Message-
> >From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED]
> >Sent: Wednesday, June 02, 2004 12:02 PM
> >To: Tomcat Users List
> >Subject: Re: Looking for naming-factory.jar from 5.0.24
> >
> >http://archive.apache.org/dist/jakarta/tomcat-5/v5.0.24/
> >- Original Message -
> >From: "Michael Mehrle" <[EMAIL PROTECTED]>
> >To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >Sent: Wednesday, June 02, 2004 10:52 AM
> >Subject: Looking for naming-factory.jar from 5.0.24
> >
> >
> >I recently ran into some JNDI problem in 5.0.25, and this is mentioned
> as
> >the fix:
> >
> >"I have a vague theory on why this happened.  Regardless, this is a
> good
> >catch on your part.  I've opened a bugzilla item for it
> >(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29255), and noted in
> >the item that a quick workaround until the next build is available is
> to
> >copy the naming-factory.jar from 5.0.24 to the common/lib directory."
> >
> >Now, I looked around and am unable to find 5.0.24 anywhere - does
> anyone
> >know where it is still hosted, or even better: can someone send me
> >naming-factory.jar from 5.0.24 release? (I knew I shouldn't have dumped
> >it)...
> >
> >Thanks,
> >
> >Michael
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> This e-mail, including any attachments, is a confidential business
> communication, and may contain information that is confidential, proprietary
> and/or privileged.  This e-mail is intended only for the individual(s) to
> whom it is addressed, and may not be saved, copied, printed, disclosed or
> used by anyone else.  If you are not the(an) intended recipient, please
> immediately delete this e-mail from your computer system and notify the
> sender.  Thank you.
> 
> 
> -
> 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]

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



Re: Tomcat starts poorly on Windows XP

2004-06-01 Thread Jacob Kjome
I suggest extracting Tomcat to a directory path with no spaces.  Tomcat 
*should* work with spaces in the path, but experience tells me to avoid this.

Jake
At 08:27 AM 6/1/2004 -0400, you wrote:
The problem continues with both jakarta-tomcat-5.0.24.exe and 
jakarta-tomcat-5.0.24.zip.

At 12:41 AM 5/27/2004, Joel Shprentz wrote:
A search of the tomcat-user archives suggests that this is a new way
for Tomcat to start poorly on Windows XP.
Below is stdout.log after a clean install of 
j2sdk-1_4_2_04-windows-i586-p.exe
and jakarta-tomcat-5.0.24.exe on a Windows XP Pro desktop system.  I started
Tomcat from the Configure Tomcat application.

...
May 26, 2004 1:12:51 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 26, 2004 1:12:51 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2937 ms
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.24
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:D:\Projects\Tomcat 
5.0\conf\Catalina\localhost\admin.xml
May 26, 2004 1:12:55 AM org.apache.struts.util.MessageResourcesFactory 
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.NoClassDefFoundError: javax/servlet/jsp/JspException
at 
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at 
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at 
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at 
org.apache.webapp.admin.ApplicationServlet.init(ApplicationServlet.java:105)
...
--
Joel Shprentz  (703) 478-9668
1516 Park Glen Court   [EMAIL PROTECTED]
Reston, VA 20190
-
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]


RE: registering Tomcat as service

2004-05-29 Thread Jacob Kjome
Well, you can modify the service.bat or follow the instructions on the page 
I mentioned previously to change paramters from the command line.  And, 
yes, I think this stuff is probably stored in the registry, although I 
haven't looked at the entries (haven't needed to).  Some of the parameters 
documented for procrun aren't valid anymore with changes since that page 
was published which is why I recommended the GUI.  Look in service.bat to 
see use of the latest parameters.

Jake
At 06:21 PM 5/28/2004 +0200, you wrote:
Hi there.
The GUI is not always going to be good for me as I need to make the change
command line settings via my own web based server management interface.
I assume that the app changes registry enties?  Is there documentation on
the registry entries?  I could then make changes directly in the
registry
Carl
-Original Message-----
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: 28 May 2004 04:53 PM
To: Tomcat Users List
Subject: RE: registering Tomcat as service
You can modify the service parameters via the GUI.  See...
http://jakarta.apache.org/commons/daemon/procrun.html
Even though most of the instructions on that page are outdated, the
information near the bottom of the page is still useful.  In particular...
"Changing the Service Parameters from the GUI"
tomcat5w //ES//Tomcat5
That pops up a GUI where you can see all the parameters that are currently
added to the service.  Add/Remove as needed.
Jake
Quoting Carl Olivier <[EMAIL PROTECTED]>:
> Hi.
>
> On this subject - in the older Tomcat service executable (specifically
> jk_nt_service.exe for TC 3) the executable was pointed at a
> wrapper.properties file.
>
> This wrapper.properties provided the means to add new -X and -D
> properties to the executable without having to re-install the service
> as it was read in at start time.
>
> Is there any plan/chance that this could also be possible for the new
> tomcat5.exe?
>
> The main reason is if you wanted to change the -Xmx setting (as a good
> example) through code - it is a lot simpler to do this in a
> wrapper.properties and then simply restart the service - as opposed to
> removing the service and then re-installing it.
>
> Thanks in advance.
>
> Carl
>
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2004 03:17 PM
> To: [EMAIL PROTECTED]
> Subject: RE: registering Tomcat as service
>
>
> Take a look in tomcat/bin.  There is a service.bat file that can
> install and
>
> uninstall the service.  Should do the trick for you.
>
> >From: "Paul Wallace" <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Subject: registering Tomcat as service
> >Date: Fri, 28 May 2004 16:31:57 +1000
> >
> >Hello,
> > I installed Tomcat, formally run from the console. I am now
> >trying to get it to run as a service. I have in the registry:
> >
> >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat\Parameter
> >s:
> >
> >JVM Option Count   REG_DWORD0X0004 (4)
> >
> >JVM Option Number 0 REG_SZ-Xms256m
> >JVM Option Number 1 REG_SZ-Xmx512m
> >JVM Option Number 2 REG_SZ
> >-Djava.class.path=C:\eCommerce\Tomcat-4.1.30\bin\bootstrap.jar;C:\eCo
> >mm
> >e
> >rce\Tomcat-4.1.30\common\lib\servlet.jar;C:\j2sdk1.4.2_04\lib\tools.jar
> >JVM Option Number 3 REG_SZ
> >-Dcatalina.home=C:\eCommerce\Tomcat-4.1.30
> >
> >the paths are correct (JDK/Tomcat) but when I try to start Tomcat
> >from the service window, I get a popup:
> >
> >"The Tomcat Service on a Local Computer started and then stopped.
> >Some services stop automatically if they have no work to do, for
> >example, the Performance Logs and Alerts service"
> >
> >The service does not subsequently run. Now my service may not have
> >any work to do, but I most certainly do.
> >
> >Any info is much appreciated.
> >
> >Paul.
> >
> >
>
> _
> FREE pop-up blocking with the new MSN Toolbar - get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
> -
> 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]
-
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]

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


RE: registering Tomcat as service

2004-05-28 Thread Jacob Kjome
You can modify the service parameters via the GUI.  See...
http://jakarta.apache.org/commons/daemon/procrun.html

Even though most of the instructions on that page are outdated, the information
near the bottom of the page is still useful.  In particular...

"Changing the Service Parameters from the GUI"
tomcat5w //ES//Tomcat5


That pops up a GUI where you can see all the parameters that are currently added
to the service.  Add/Remove as needed.


Jake

Quoting Carl Olivier <[EMAIL PROTECTED]>:

> Hi.
> 
> On this subject - in the older Tomcat service executable (specifically
> jk_nt_service.exe for TC 3) the executable was pointed at a
> wrapper.properties file.
> 
> This wrapper.properties provided the means to add new -X and -D properties
> to the executable without having to re-install the service as it was read in
> at start time.
> 
> Is there any plan/chance that this could also be possible for the new
> tomcat5.exe?
> 
> The main reason is if you wanted to change the -Xmx setting (as a good
> example) through code - it is a lot simpler to do this in a
> wrapper.properties and then simply restart the service - as opposed to
> removing the service and then re-installing it.
> 
> Thanks in advance.
> 
> Carl
> 
> -Original Message-
> From: None None [mailto:[EMAIL PROTECTED]
> Sent: 28 May 2004 03:17 PM
> To: [EMAIL PROTECTED]
> Subject: RE: registering Tomcat as service
> 
> 
> Take a look in tomcat/bin.  There is a service.bat file that can install and
> 
> uninstall the service.  Should do the trick for you.
> 
> >From: "Paul Wallace" <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Subject: registering Tomcat as service
> >Date: Fri, 28 May 2004 16:31:57 +1000
> >
> >Hello,
> > I installed Tomcat, formally run from the console. I am now trying
> >to get it to run as a service. I have in the registry:
> >
> >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat\Parameters:
> >
> >JVM Option Count   REG_DWORD0X0004 (4)
> >
> >JVM Option Number 0 REG_SZ-Xms256m
> >JVM Option Number 1 REG_SZ-Xmx512m
> >JVM Option Number 2 REG_SZ
> >-Djava.class.path=C:\eCommerce\Tomcat-4.1.30\bin\bootstrap.jar;C:\eComm
> >e
> >rce\Tomcat-4.1.30\common\lib\servlet.jar;C:\j2sdk1.4.2_04\lib\tools.jar
> >JVM Option Number 3 REG_SZ
> >-Dcatalina.home=C:\eCommerce\Tomcat-4.1.30
> >
> >the paths are correct (JDK/Tomcat) but when I try to start Tomcat from
> >the service window, I get a popup:
> >
> >"The Tomcat Service on a Local Computer started and then stopped. Some
> >services stop automatically if they have no work to do, for example,
> >the Performance Logs and Alerts service"
> >
> >The service does not subsequently run. Now my service may not have any
> >work to do, but I most certainly do.
> >
> >Any info is much appreciated.
> >
> >Paul.
> >
> >
> 
> _
> FREE pop-up blocking with the new MSN Toolbar - get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> 
> 
> -
> 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]

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



Re: Tomcat starts poorly on Windows XP

2004-05-27 Thread Jacob Kjome
At 12:41 AM 5/27/2004 -0400, you wrote:
A search of the tomcat-user archives suggests that this is a new way
for Tomcat to start poorly on Windows XP.
Below is stdout.log after a clean install of j2sdk-1_4_2_04-windows-i586-p.exe
and jakarta-tomcat-5.0.24.exe on a Windows XP Pro desktop system.  I started
Tomcat from the Configure Tomcat application.
While installing and uninstalling j2sdk and Tomcat many times over the
past few days, I've found and removed older Tomcats, j2sdk, and jre
installations.  I suspect that this problem is caused by some residue
of those earlier installs.
I welcome your suggestions. Thanks.
Save yourself a lot of trouble and forget the installer.  Just unzip the 
archive to a directly, set JAVA_HOME and CATALINA_HOME, and run.  If you 
want to use the service, just use "service.bat [install | remove]".

I've never seen any problems like this and I've never used the installer.
Jake

May 26, 2004 1:12:51 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 26, 2004 1:12:51 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2937 ms
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.24
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
May 26, 2004 1:12:51 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:D:\Projects\Tomcat 
5.0\conf\Catalina\localhost\admin.xml
May 26, 2004 1:12:55 AM org.apache.struts.util.MessageResourcesFactory 
createFactory
SEVERE: MessageResourcesFactory.createFactory
java.lang.NoClassDefFoundError: javax/servlet/jsp/JspException
at 
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
at 
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
at 
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1329)
at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:464)
at 
org.apache.webapp.admin.ApplicationServlet.init(ApplicationServlet.java:105)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at 
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at 
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at 
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
  Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
at 
org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
 

Re: PrintWriter performance

2004-05-26 Thread Jacob Kjome
At 09:15 PM 5/26/2004 +0200, you wrote:
4/ depends on the JDK; newer compilers /may/ see a repeat string concat
  ("+" op) and replace w/ StringBuffer under the covers...
This is a common psuedo-misconception.  Compilers can't do anything with 
strings
that have a paramter of which the value can only be realized at runtime.

public static String OPTIMIZED = "optimized";
"This can be " + OPTIMIZED + " at compile time to a single string with no
concatenation at runtime"
You seem to have missed the final keyword. Without it, no optimization is 
possible.
Good catch.  I meant for it to be final.
Jake

Antonio


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


Re: HTTP AUTH

2004-05-26 Thread Jacob Kjome
Of course he can also just use BASIC Auth and do request.getRemoteUser() 
and do whatever he wants with that.  No realms needed there.  The original 
question was why was he setting up BASIC Auth programatically when he can 
specify it in web.xml.  It sounds like he uses some custom authentication 
stuff anyway, so realms aren't really the question.  It is simply the BASIC 
Auth that he can set up in web.xml which is what I was getting at.

Jake
At 11:31 PM 5/25/2004 -0700, you wrote:
"SH Solutions" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> > Can you explain yourself here?  It is not obvious to me.  How does the
> number of users make any difference here.  Just set up BASIC Auth in
> web.xml.  You don't have to define your users and roles in web.xml, if
> that's what you are implying.
>
> Alright, that is what I was thinking.
> So, is it possible, to use web.xml security together with our own login
> handler?
> Especially with certificates?
>
Tomcat's MemoryRealm and UserDatabaseRealm work with CLIENT-CERT auth-type,
as long as you don't need anything fancy (The user name is the cert
Subject).  You could also create your own Realm that would allow you to
authenticate any way you like.  Of course, this means that your app would
now depend on Tomcat, and so would be less portable.
To do programatic security, the easiest is to set 'clientAuth="true"' on the
Connector (Tomcat 5) or the Factory (Tomcat 4).  This forces the browser to
send the cert on all SSL requests.  In newer Tomcat 5 versions (and JDK
1.4+), you can also specify 'clientAuth="want"' to simply ask nicely :).  Of
course, this assumes that you are using the HTTP/1.1 Connector.  For the JK
Connector, you would configure this on Apache/IIS/SunOne.
If this isn't good enough for you, then there is always the Tomcat-specific:
  request.getAttribute("org.apache.coyote.request.X509Certificate");
which will re-negotiate the connection if necessary to get the client to
send the cert.  This works for the Coyote-HTTP/1.1 in TC 4.1.x and TC 5.0.x.
However, I'd really like to drop this "feature" in 5.1.x.
> Regards,
>   Steffen

-
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]


RE: HTTP AUTH

2004-05-25 Thread Jacob Kjome
At 11:58 PM 5/25/2004 +0200, you wrote:
Hi
> How about use web.xml to configure your security rather than doing it by
hand?
> That way tomcat does all the hard work.
We have a complex CMS system with about 35000 users.
We obviously do NOT want to use web.xml.
Can you explain yourself here?  It is not obvious to me.  How does the 
number of users make any difference here.  Just set up BASIC Auth in 
web.xml.  You don't have to define your users and roles in web.xml, if 
that's what you are implying.

Jake

Regards,
  Steffen
-
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]


Re: PrintWriter performance

2004-05-25 Thread Jacob Kjome
Quoting QM <[EMAIL PROTECTED]>:

> On Tue, May 25, 2004 at 03:39:31PM +0200, Rostislav Svoboda wrote:
> : I'd like to ask you if there's a significant difference in performance
> : between:
> :
> :String ret = "";
> :for (count = 0; rs.next(); count++)
> :ret += rs.getString("column_name"); // result of db query
> :out.print(ret);
> :
> : and:
> :
> :for (count = 0; rs.next(); count++)
> :out.print(rs.getString("column_name");  // result of db query
> :
> : I know I have the extra string which is (theoretically) a slow-down but I
> : don't
> : know anything about the way how tomcat handles with large strings (in my
> : case about 1MB), if is there any limited buffering etc.
> 
> 1/ what happens when you load-test the two variations?
> 
> 2/ it's not about Tomcat handling strings; it's how the underlying JVM
>handles strings.
> 
> 3/ what happens when you load-test the two variations?
> 
> 4/ depends on the JDK; newer compilers /may/ see a repeat string concat
>("+" op) and replace w/ StringBuffer under the covers...
> 

This is a common psuedo-misconception.  Compilers can't do anything with strings
that have a paramter of which the value can only be realized at runtime.

public static String OPTIMIZED = "optimized";

"This can be " + OPTIMIZED + " at compile time to a single string with no
concatenation at runtime"


private String optimized;

"This cannot be " + optimized + " at compile time.  It *has* to be evaluated at
runtime because the value isn't available at compile time"


Jake


> 5/ what happens when you load-test the two variations?
> 
> But, as always, see #1 for the end-all, be-all answer.
> 
> -QM
> 
> --
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> 
> -
> 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]



Re: PrintWriter performance

2004-05-25 Thread Jacob Kjome
At 03:39 PM 5/25/2004 +0200, you wrote:
Hi all
I'd like to ask you if there's a significant difference in performance 
between:

   PrintWriter out = response.getWriter();
   String ret = "";
   for (count = 0; rs.next(); count++)
   ret += rs.getString("column_name"); // result of db query
   out.print(ret);
   out.close();
Use a StringBuffer when looping and then do buffer.toString() after the 
loop.  Make sure to size the StringBuffer to a reasonable size for what you 
expect.  Resizing a StringBuffer to hold more string information is very 
expensive.  Concatenation will create a new StringBuffer for every 
concatenation.  Very low performance!

This should make the code above similar in performance to the code below
Jake
and:
   PrintWriter out = response.getWriter();
   for (count = 0; rs.next(); count++)
   out.print(rs.getString("column_name");  // result of db query
   out.close();
I know I have the extra string which is (theoretically) a slow-down but I 
don't
know anything about the way how tomcat handles with large strings (in my 
case about 1MB), if is there any limited buffering etc.
I know as well I can test it by myself very easilly but I hope someone's 
gonna give me a bit of explanation along with 20 funny stories etc. :)

EOF & thx
Bost
-
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]


Re: Setting -Xmx parameter to Tomcat as a Window Service

2004-05-25 Thread Jacob Kjome
For Tomcat5, look at service.bat in the "bin" directory.  Add to the 
following line...

"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions 
"-Djava.io.tmpdir=%CATALINA_BASE%\temp"

Something such as...
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions 
"-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Xmx1024m;-Xms128m"

To install, just do...
service.bat install
to remove
service.bat remove
To edit with the GUI...
tomcat5w //ES//Tomcat5
Jake
At 10:18 AM 5/25/2004 +0200, you wrote:
Hi everybody

I've a Windows XP box and I've installed tomcat 4.1 as a window service. I'm
in need to set JAVA_OPTS or CATALINA_OPTS to "-server -Xmx1024m -Xms128m"
but setting it as environment variables doesn't work at all, any help?

Please keep in mind that it is mandatory for me to use it as a service. I'm
planning to upgrade to tomcat 5.0.24, but still it will run as a service

Thanks for the help

Enrico Drusiani

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


Re: session data in Tomcat 5

2004-05-21 Thread Jacob Kjome
Well, it works for me on Win2k with Tomcat-5.0.25.  Same session every post. 
You don't have sessions turned off in web.xml by setting the session-timeout to
0 or -1 (can't remember which one, if any, disables sessions) by chance, do you?
 You might also check for virus or firewall softwared/hardware on your machine.
 That stuff can mess things up pretty badly.

Jake

Quoting "M.Hockings" <[EMAIL PROTECTED]>:

> Certainly !  They are attached (please don't laugh at them tooo much )
> 
> BTW, I'm finding that my test server on FC1  (Tomcat 5.0.24) is working
> quite well, fast response, can deploy, undeploy reliably and sessions
> seem to work as expected.  On Win2K however the 5.0.25 version is
> considerably slower, often has to be re-started to get a successful
> deploy and every touch is a new session.  This is as configured by the
> installer (I have not changed any of the config files other than setting
> up a manager id/pwd) and the only change on install was to modify the
> install directory from c:\... to d:\...  In the past I've had Tomcat 4.0
> & 4.1 working solidly on Win2K even jk'd to Apache.I must admit that
> I'm not a Tomcat expert, our main deployment platform is IBM's WAS but I
> like to make sure that our product runs on Tomcat as some prefer a
> different servlet container.
> 
> I guess what I'm trying to say is I wonder if some of my woes have been
> due to trying to use Tomcat  5 on my Win2K laptop rather than a "real"
> server box.
> 
> Mike
> 
> 
> 
> Ben Souther wrote:
> 
> >Could you just attach the src to the two JSPs?
> >
> >
> >On Friday 21 May 2004 09:18 am, M.Hockings wrote:
> >
> >
> >>Shapira, Yoav wrote:
> >>
> >>
> >>>Hi,
> >>>Oh, this reminds me to have a vote on the stability of 5.0.25!
> >>>
> >>>You never answered the key question of whether your session attributes
> >>>are Serializable or not: that's a binary question, should be easy to
> >>>determine ;)
> >>>
> >>>Yoav Shapira
> >>>Millennium Research Informatics
> >>>
> >>>
> >>Hi !
> >>
> >>Yes, sorry, I forgot.
> >>
> >>I think for the most part the answer is no, however for these apps I'm
> >>not worried about maintaining data over a shutdown-startup of the server
> >>nor am I running in a cluster.  The interesting thing is that on Windows
> >>(Win2K to be exact) every hit to Tomcat seems to start a new session!
> >>
> >>I'm making a set of tests that will eventually work up to the actions
> >>that the application does to maintain session data.  And, yes, I will be
> >>making the session objects serializable just to avoid future problems...
> >>
> >>For your enjoyment here is the same test app on two machines, my Win2K
> >>laptop and a Linux (Fedora Core 1) server.  On Windows it is
> >>5.0.25-alpha (previously 5.0.24) and on Linux it is 5.0.24
> >>(out-of-the-box with no patches applied).  I _think_ I have the external
> >>url correct.
> >>
> >>Linux http://ontarioshoots.ath.cx:8080/TC5test/
> >>Windows http://ontarioshoots.ath.cx:8088/TC5test/
> >>
> >>If you would like the .war file that it is deployed from just let me
> >>know...
> >>
> >>Mike
> >>
> >>-
> >>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]



RE: Tomcat 5: Location of 3rd party JNDI datasource jars in $CATA LINA _HOME/common/lib

2004-05-21 Thread Jacob Kjome
CATALINA_BASE allows you to have separate config files and a separate shared/lib
(along with a separate webapps and work dirs).  However, most everything such as
core libraries in server/lib and common/lib are used in each CATALINA_BASE
instance.  I guess it would be nice if there were a place to put jars which the
core server can see, but can be different per/CATALINA_BASE.  For instance when
configuring a datasource, one app might need a certain set of, say... Oracle
drivers while another might need different ones.  Tomcat must be able to see the
driver in order to use container managed datasources but, as things stand, the
only place to put them is in common/lib which would be seen by all CATALINA_BASE
instances.  The only solution is to have two entirely separate Tomcat installs.
 I think that is what you'll have to do unless the classloading hierarchy gets
changed.

As a side note (and this probably wouldn't solve the problem above, but...) it
would be nice if Tomcat supported the deployment of ear files, but only used
them for deploying contained .war files and shared libraries (not EJB's, of
course).  That would make deploying related apps and shared libs so much easier
and under the control of the developer/deployer rather than the server admin
since.  Anyway, just a thought.


Jake

Quoting "CARROLL, Chris, FM" <[EMAIL PROTECTED]>:

> I couldn't agree with you more about the logical differences between the web
> app(s) and the app server itself.  However, I would have thought that the
> CATALINA_BASE is the instance of the app server which requires the classes
> and not the "raw" installation in CATALINA_HOME.  I am trying to understand
> why jars in $CATALINA_BASE/common/lib are not included in the app server
> (common classloader) classpath.  The base common/lib augments the
> home/common/lib.  I realise that there will be problems if you placed
> conflicting versions of the jars in the base that were already in the home
> but if you were halfway sensible that wouldn't be done.
> 
> Cheers again,
> Chris
> 
> -Original Message-
> From: Benjamin Armintor [mailto:[EMAIL PROTECTED]
> Sent: 21 May 2004 15:27
> To: Tomcat Users List
> Subject: RE: Tomcat 5: Location of 3rd party JNDI datasource jars in
> $CATALINA _HOME/common/lib
> 
> 
> I understand where you're coming from.  Maybe Yoav will correct me if I'm
> wrong, but the important caveat is that  classes are only specific to the
> instance if the app server classes don't need to know about them. The
> problem with JNDI is that the naming context is created by the app server,
> and not the web app - but of course, the web app is the one that uses the
> naming context.  If you wanted to isolate the drivers by instance, you could
> forego JNDI as the access mechanism for the JDBC pools (create some
> singleton pool in the shared classloader, etc.)- although this would need
> kludging some things like password files, etc. It would, though, give you
> some ways to leave the code in shared/lib.
> 
> Benjamin J. Armintor
> Systems Analyst
> ITS-Systems: Mainframe Group
> University of Texas - Austin
> tele: (512) 232-6562
> email: [EMAIL PROTECTED]
> 
> 
> 
> -Original Message-
> From: CARROLL, Chris, FM [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 21, 2004 8:13 AM
> To: 'Tomcat Users List'
> Subject: RE: Tomcat 5: Location of 3rd party JNDI datasource jars in
> $CATALINA _HOME/common/lib
> 
> 
> Thanks for the info Ben.  The only counter argument I have is
> "...$CATALINA_BASE is for instance specific information...".  Making a
> datasource reference available to a single instance would imply
> CATALINA_BASE.  ALL Tomcat instances would imply CATALINA_HOME.  It's a
> picky point and maybe I misunderstand the use of CATALINA_BASE.
> 
> To me CATALINA_HOME is the a basic installation and CATALINA_BASE is the
> fully configured instance (including shared resources).  Not every instance
> based off a "shared tomcat installation" would use the same resources.
> Dtasources would be specific to individual instances.
> 
> Cheers,
> 
> Chris
> 
> 
> -Original Message-
> From: Benjamin Armintor [mailto:[EMAIL PROTECTED]
> Sent: 21 May 2004 14:03
> To: Tomcat Users List
> Subject: RE: Tomcat 5: Location of 3rd party JNDI datasource jars in
> $CATALINA _HOME/common/lib
> 
> 
> If a class needs to be accessed by both server components and web apps, it
> must be in the common classloader.  The classes in the common class loader
> are all in $CATALINA_HOME.  $CATALINA_BASE is for instance specific
> information, and the shared class loader is for classes that only need to be
> available to web apps (not server components); all $CATALINA_BASEs share the
> same server classes.  The unpredictable behavior mentioned is that the
> classloaders that web apps use do not necessarily delegate to their parents
> (ie, by default they prioritize the local version of a class), which means
> you might get nasty class definition errors if you put copies 

Re: session data in Tomcat 5

2004-05-20 Thread Jacob Kjome
At 04:53 PM 5/20/2004 -0400, you wrote:
Ben Souther wrote:
On Thursday 20 May 2004 10:15 am, Shapira, Yoav wrote:

in starting jsp 1
session.setAttribute("ml",ml);
in target jsp 2
MyPackage.MyClass ml = (MyPackage.MyClass)session.getAttribute("ml");
System.out.println("ml = "+ml);
then in the log I see...
 ml = null
You didn't include it in your code snippet so I have to ask:  are you 
sure that the "ml" object wasn't null before you called setAttribute?

Also, are you testing this with the same browser that you were using with 
the 4x version of Tomcat (that was working)?
I'm asking because this looks like a case of MSIE not storing session 
cookies properly.  (IOW: every hit to the server is generating it's own 
session).

Yup the original is non-null.  What I did to confirm this is that after 
the setAttribute I did a getAttribute into another reference and did a 
System.out on that to be sure that it actually got put in the session.

Today I created a new project in  WDSC 5.1.2 (the latest) imported all the 
files and cleaned up every last validation error.  It works just fine in 
the WAS 5.0 and 5.1 test environments (only J2EE 1.3 though).
Deploying to my test Tomcat 5 on Win2K shows the same problem as before.

I'm using the same browser and machine as was working with Tomcat 4.   I 
did wonder if cookies were being dropped (I have to run this Integrity 
Client thing on Win2K that does block some stuff) so I've even tried 
running with Mozilla from Linux and the symptoms are identical.  So it 
still seems to be something related to this specific webapp code but it 
hasn't dawned on me what yet.  Tomorrow I plan on writing a simple pair 
of  jsps, one to display the session id and all the session data and the 
other that will display the session id, put an element in the session and 
submit to the first one.  That will more or less simulate the function of 
the real app that seems to be failing.  Once I figure this one out I'm 
sure it will be a "duh" kinda feeling...
I didn't see the earlier posts, but are you using Tomcat-5.0.24?  There's a 
bug related to session cookies which requires a hotfix.  However, I'd just 
install 5.0.25 which has the fix, plus a few others.  Also note that 
Tomcat-5.0.24+ is very strict about objects in the session being 
serializable (where 5.0.19 was less so).  Upon application shutdown, 
non-serializable attributes will be removed so that upon restart, the 
non-serializable attributes won't exist in the session.  Not sure if that 
is your problem here, but it's a good thing to note.

http://archive.apache.org/dist/jakarta/tomcat-5/v5.0.25-alpha/
Jake

Mike


-
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]


Re: Tomcat 5.0.24 Service Install Syntax

2004-05-19 Thread Jacob Kjome
Quoting Hector Adolfo Alonso <[EMAIL PROTECTED]>:

> Hi Tomcat gurus:
>I've read carefully service.bat from Tomcat 5.0.19 and Apache Commons
> Daemon, and built a customized script for Windows 2000.
>But service installation syntax changed in Tomcat 5.0.24. I could'n
> find any new explanation in Commons Daemon page. I've observed
> tomcat.exe has changed to tomcat5.exe too.
>Can anybody send me any hint ?
>I need customize the serice installation script.
>Thanks in Advance.
> 

When you says "service installation syntax changed in Tomcat 5.0.24", I'm not
quite sure what you mean.  You still just do...

%CATALINA_HOME%\bin\service install

The syntax of the service.bat file itself changed a bit, if that is what you
mean.  It should be relatively straightforward to customize.  Just follow the
pattern that is already there.  I customize the script myself.  Maybe that would
help.  I'm attaching it to this email renamed to .txt so it doesn't get filtered
out.


Jake


> Hector./
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---
rem NT Service Install/Uninstall script
rem
rem Options
rem installInstall the service using Tomcat5 as service name.
remService is installed using default settings.
rem remove Remove the service from the System.
rem
rem name(optional) If the second argument is present it is considered
remto be new service name  
 
rem
rem $Id: service.bat,v 1.5 2004/04/08 16:49:37 mturk Exp $
rem ---

rem Guess CATALINA_HOME if not defined
set CURRENT_DIR=%cd%
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=%cd%
if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome
rem CD to the upper dir
cd ..
set CATALINA_HOME=%cd%
:gotHome
if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome
echo The tomcat.exe was not found...
echo The CATALINA_HOME environment variable is not defined correctly.
echo This environment variable is needed to run this program
goto end
:okHome
if not "%CATALINA_BASE%" == "" goto gotBase
set CATALINA_BASE=%CATALINA_HOME%
:gotBase
 
set EXECUTABLE=%CATALINA_HOME%\bin\tomcat5.exe

rem Set default Service name
set SERVICE_NAME=Tomcat5

if "%1" == "" goto displayUsage
if "%2" == "" goto setServiceName
set SERVICE_NAME=%2
:setServiceName
if %1 == install goto doInstall
if %1 == remove goto doRemove
echo Unknown parameter "%1"
:displayUsage
echo 
echo Usage: service.bat install/remove [service_name]
goto end

:doRemove
rem Remove the service
"%EXECUTABLE%" //DS//%SERVICE_NAME%
echo The service '%SERVICE_NAME%' has been removed
goto end

:doInstall
rem Install the service
rem Use the environment variables as an exaple
rem Each command line option is prefixed with PR_

set PR_DISPLAYNAME=Apache Tomcat
set PR_DESCRIPTION=Apache Tomcat Server - http://jakarta.apache.org/tomcat
set PR_INSTALL=%EXECUTABLE%
set PR_LOGPATH=%CATALINA_HOME%\logs
set PR_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar
"%EXECUTABLE%" //IS//%SERVICE_NAME% --Jvm auto --StartClass 
org.apache.catalina.startup.Bootstrap --StopClass 
org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
rem Clear the environment variables. They are not needed any more.
set PR_DISPLAYNAME=
set PR_DESCRIPTION=
set PR_INSTALL=
set PR_LOGPATH=
set PR_CLASSPATH=
rem Set extra parameters
"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions 
"-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed"
 --StartMode jvm --StopMode jvm
rem More extra parameters
set PR_STDOUTPUT=%CATALINA_HOME%\logs\stdout.log
set PR_STDERROR=%CATALINA_HOME%\logs\stderr.log
set PR_STARTPATH=%CATALINA_HOME%\bin
set PR_STOPPATH=%CATALINA_HOME%\bin
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions 
"-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Dbuild.compiler.emacs=true;-Xrs"
echo The service '%SERVICE_NAME%' has been installed

:end
cd %CURRENT_DIR%
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Does Tomcat 5 supports stop/start/reload server through admin tool ?

2004-05-17 Thread Jacob Kjome
Quoting Sheng Huang <[EMAIL PROTECTED]>:

> Hi Jake,
> 
> Thanks a lot for your reply. However, I am going to create the context of
> the new manager application for the new host (e.g. test.tlg.ca). But the
> manager context created in http://localhost:8080/admin won't be initialized
> correctly without the privileged attribute.
> 

I don't understand what you are saying here?  The manager and admin apps have to
be marked as privileged.  Are you saying you don't what to do that?  I can't
help you much there.  Please explain more if you want more help.

> And on my machine, to access the manager application, I need to use
> http://localhost:8080/manager/list instead of
> http://localhost:8080/manager/html/list. Hope this won't be the problem.
> 

I don't understand this either.  The URL of the GUI is manager/html/list.  In
fact, anything done with the GUI *has* to have the "/html" in there unless you
hack the servlet mappings.  If you don't want the GUI, such as when you access
the manager app via the Catalina Ant tasks, then you can leave out the "/html".

Beyond that, I'm a bit lost as to what you are trying to do.

Jake

> Could you give me more ideas? Thank you very much.
> 
> Best regards,
> Sheng
> 
> -Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: May 17, 2004 3:08 PM
> To: Tomcat Users List
> Subject: Re: Does Tomcat 5 supports stop/start/reload server through
> admintool ?
> 
> 
> Quoting Sheng Huang <[EMAIL PROTECTED]>:
> 
> > Does anyone know whether Tomcat 5 supports stop/start server through a GUI
> > tool? Or can I reload all the contexts in all hosts through a GUI
> interface?
> >
> 
> Look at the manager app:
> 
> http://localhost:8080/manager/html/list
> 
> You'll have to set up a user in tomcat-users.xml with the role of "manager"
> before you do this.  Then log in with that user at the URL above.
> 
> Jake
> 
> 
> > Best regards,
> > Sheng
> >
> >
> >
> > -
> > 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]
> 
> -
> 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]



Re: Does Tomcat 5 supports stop/start/reload server through admintool ?

2004-05-17 Thread Jacob Kjome
Quoting Sheng Huang <[EMAIL PROTECTED]>:

> Does anyone know whether Tomcat 5 supports stop/start server through a GUI
> tool? Or can I reload all the contexts in all hosts through a GUI interface?
> 

Look at the manager app:

http://localhost:8080/manager/html/list

You'll have to set up a user in tomcat-users.xml with the role of "manager"
before you do this.  Then log in with that user at the URL above.

Jake


> Best regards,
> Sheng
> 
> 
> 
> -
> 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]



Re: jsvc versus startup.sh with jdk 1.4

2004-05-16 Thread Jacob Kjome
I had to add tools.jar to the classpath for the windows service (in 
service.bat) in order to get jsp's to compile.  I've mentioned it to the 
Tomcat developers, but they haven't added it.  The .sh and .bat files add 
tools.jar to the classpath, so I don't know why they wouldn't want to do it 
for jsvc???

Jake
At 03:17 AM 5/16/2004 -0400, you wrote:
Using Sun jdk 1.4 on RH Linux Enterprise Workstation, when I
start Tomcat 5 using jsvc, jasper does not successfully
create the .java files from the .jsp files.  The error
reported is that the .java files are not found when they need
to be compiled.
The problem does not seem to exist on jdk 1.3.
Starting Tomcat using startup.sh also fixes the problem -
even with jdk 1.4.  Root cause unkown.
As a new user, it might be that the template script for using
jsvc is incomplete in some way that I have not determined, so
I would not go so far as to call this a bug.  Am I missing
something?
Thanks,
Jonathan
-
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]


Re: Configuration free persistence?

2004-05-13 Thread Jacob Kjome
Quoting Will Hartung <[EMAIL PROTECTED]>:

> > From: "Shapira, Yoav" <[EMAIL PROTECTED]>
> > Sent: Wednesday, May 12, 2004 6:27 AM
> 
> > Here's another take that's not seen often, but is intriguing: the
> > java.util.prefs API.  It uses the Registry on Windows, and the
> > filesystem on unix, by default, but that can be changed.  If you're
> > running on Windows this is a decent approach (but then again if you're
> > only running on windows you might make a whole set of choices based on
> > that).
> 
> No, that's very clever. I had forgotten about that API completely, and it
> handily solves the basic problem. I'll have to see how this works on a UNIX
> box (i.e. does it write to a ~/.java_prefs directory, or what).
> 
> By using this API, you can plop a WAR on a server, then when the user first
> tries to use it, run them through a "configuration wizard".
> 

You can also use Prevayler for object Prevalence...
http://prevayler.codehaus.org/

If you use Prevayler in-memory only, then no configuration will be needed. 
Otherwise, if you want to persist across application restarts, then you will
have to configure a directory to be writable.  Of course, you can always use the
"configuration wizard" to do this.

Jake

> Perfect.
> 
> Thanx!
> 
> Regards,
> 
> Will Hartung
> ([EMAIL PROTECTED])
> 
> 
> -
> 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]



Re: [ANN] The Reference Scanner and Jakarta Tomcat - Heap Profiling, Memory Leaks

2004-05-12 Thread Jacob Kjome
Quoting Joseph Shraibman <[EMAIL PROTECTED]>:

> Jacob Kjome wrote:
> > At 11:47 PM 5/11/2004 -0400, you wrote:
> >
> >> Joerg Baumgaertel wrote:
> >>
> >>> Hi all,
> >>> because often requested,
> >>> I added a Jakarta-Tomcat-Howto to the 'jb2works.com' website.
> >>> You find the following documents
> >>> - How to scan a Java webapplication
> >>>   http://jb2works.com/refscan/tomcat.html
> >>> - How to scan Jakarta-Tomcat full-space
> >>>   http://jb2works.com/refscan/tomcatfull.html
> >>
> >>
> >> I tried that, but when trying to run tomcat I got:
> >>
> >> Due to new licensing guidelines mandated by the Apache Software
> >> Foundation Board of Directors, a JMX implementation can no longer
> >> be distributed with the Apache Tomcat binaries. As a result, you
> >> must download a JMX 1.2 implementation (such as the Sun Reference
> >> Implementation) and copy the JAR containing the API and
> >> implementation of the JMX specification to:
> >> ${catalina.home}/bin/jmx.jar
> >>
> >> ...which confuses me, because jmx.jar is still where it always was.
> >> Using the bootstrap.jar that came with tomcat works fine.
> >
> >
> > If you use the latest version of Tomcat5, you'll find that this is not
> > an issue.  Download Tomcat-5.0.24.  The implementation of JMX that said
> > version of Tomcat comes with is MX4J which is open source so there is no
> > problem anymore.
> >
> > Jake
> 
> I am using 5.0.24, and jmx.jar is there.  Tomcat works if I use the
> Bootstrap.class that comes with it, but if I recompile Bootstrap.class
> per the instructions on http://jb2works.com/refscan/tomcatfull.html it
> suddenly gives me that error message.
> 
> I can post the jar file if you think that will help.
> 

No, I can't help you with recompile questions.  I just know that previous
versions of Tomcat required you to provide the JMX jar since they had been
shipping the Sun implementation, and probably in violation of the license.  For
this reason, they removed jmx.jar, but they have added it back now that they use
the MX4J implementation.  I can't remember if this affected Tomcat-5.0.19 or
alpha releases in between 5.0.19 and 5.0.24.  All I can say is that, out of the
box, 5.0.24 should work just fine.

Jake

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



Re: [ANN] The Reference Scanner and Jakarta Tomcat - Heap Profiling, Memory Leaks

2004-05-11 Thread Jacob Kjome
At 11:47 PM 5/11/2004 -0400, you wrote:
Joerg Baumgaertel wrote:
Hi all,
because often requested,
I added a Jakarta-Tomcat-Howto to the 'jb2works.com' website.
You find the following documents
- How to scan a Java webapplication
  http://jb2works.com/refscan/tomcat.html
- How to scan Jakarta-Tomcat full-space
  http://jb2works.com/refscan/tomcatfull.html
I tried that, but when trying to run tomcat I got:

Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and
implementation of the JMX specification to:
${catalina.home}/bin/jmx.jar
...which confuses me, because jmx.jar is still where it always was. Using 
the bootstrap.jar that came with tomcat works fine.
If you use the latest version of Tomcat5, you'll find that this is not an 
issue.  Download Tomcat-5.0.24.  The implementation of JMX that said 
version of Tomcat comes with is MX4J which is open source so there is no 
problem anymore.

Jake


BTW in your instructions you say to add:

 HttpScanner.start( startupInstance );

... but what is really needed is:

com.jb2works.reference.HttpScanner.start( startupInstance ); // <-- !!

-
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]


RE: problem setting --WorkingPath in service.bat (2.0.24)

2004-05-07 Thread Jacob Kjome
At 07:35 PM 5/7/2004 +0200, you wrote:


> -Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
>
> I'm trying to set --WorkingPath in service.bat, but it doesn't seem to do
> anything.  It used to in Tomcat-5.0.19 but doesn't in Tomcat-5.0.24.  Is
> there a
> new property to set the working path for the service?  I also tried adding
> the
> property PR_WORKINGPATH, but that didn't do anything either.
>
> Now, I know that I can bring up the gui and set it manually, but my
> requirement
> is to set it in the script so no manipulation of the gui is necessary.
>
Use the --StartPath and --StopPath. Those are the working paths for startup
or shutdown processes, and are used to set the custom working paths.
Thanks for the info

The preferred way of running TC since 5.0.19 is using jni, so you don't need
them.
Hmm... Can you explain a bit more?  What does using jni have to do with a 
working path?  How does using jni result in not requiring a working 
path?  If I used jni as you say, and I created a new File("testfile.txt") 
and wrote it, where would it go?  If I had a working path set, I'd expect 
this to show up at the location of the working path or, if none is 
specified, whatever directory the VM started from.  If you can clarify 
this, it would be very helpful.

Oh, one other question.  How does one specify that the service should be 
able interact with the desktop?  That is, again, in service.bat, not 
manually via the gui.

> BTW, it would be *really* nice if the docs were updated to show all the
> properties available.  The commons-daemon procrun site (
> http://jakarta.apache.org/commons/daemon/procrun.html ) hasn't been
> updated
> since January 13.
>
You are right about that. Lack of time I'm afraid.
I know the feeling.

Jake


MT.

-
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]


problem setting --WorkingPath in service.bat (2.0.24)

2004-05-07 Thread Jacob Kjome

I'm trying to set --WorkingPath in service.bat, but it doesn't seem to do
anything.  It used to in Tomcat-5.0.19 but doesn't in Tomcat-5.0.24.  Is there a
new property to set the working path for the service?  I also tried adding the
property PR_WORKINGPATH, but that didn't do anything either.

Now, I know that I can bring up the gui and set it manually, but my requirement
is to set it in the script so no manipulation of the gui is necessary.

BTW, it would be *really* nice if the docs were updated to show all the
properties available.  The commons-daemon procrun site (
http://jakarta.apache.org/commons/daemon/procrun.html ) hasn't been updated
since January 13.


Jake

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



Re: Include file?

2004-05-06 Thread Jacob Kjome
Look on the Ant-user list for "entity includes".  should work for what you need.

Jake

Quoting Steven Garrett <[EMAIL PROTECTED]>:

> Hi,
> 
> I was wondering if you can use "include" in the server.xml.  What I want to
> do is to define a bunch of different virtual hosts within my tomcat
> instance, but don't want to have to constantly change the server.xml.  Is
> this possible.  I've searched the archives and the web and I don't see
> anything telling me on way or the other.
> 
> Thanks,
> 
> Steve
> 
> -
> 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]



Re: Fw: new apps won't deploy, not sure what's going on

2004-04-25 Thread Jacob Kjome
Are you running as a service?  If so, try running running with the startup 
script.  The default "service.bat" doesn't add tools.jar to the 
"ImagePath".  You will need to do this in order for JSP's to be 
compiled.  The examples run because they are all pre-compiled and mapped as 
servlets.  I don't see why they are because then you get questions like 
this where you think that JSP's work for the apps that ship with Tomcat, 
but not yours so you try to figure out what you are doing wrong when you 
aren't doing anything wrong because it is a problem with Tomcat 
itself.  Plus it would make it more apparent to the Tomcat developers that 
tools.jar needs to be added to the "ImagePath" since the jsp examples won't 
work until that happens.

As for running over Port 80, are you fronting that with Apache or did you 
change the Tomcat connector config to use port 80?  When you say images 
won't even load, I suspect it is bad configuration of the former.  I 
suggest getting everything to work with the defaults with no jk connector 
stuff and only then modifying things to your liking.

Jake

At 09:53 AM 4/25/2004 -0400, you wrote:



OK, I get this message:
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar 
from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat 
restart.
If using an alternate Java compiler, please check its installation and 
access path.

I have tomcat installed in C:\Tomcat5.0 and %CATALINE_HOME is: C:\Tomcat5.0
JAVA_HOME is:C:\j2re1.4.2_04 which is where I have java installed
I can get tomcat to run and it loads the default tomcat page and I can 
load the examples but I tried creating a new context and I always get the 
error above.  I just wanted one of the new contexts to be a folder with 
subfolders that contained images and that won't even load.
I'm running XP with Tomcat5.0.19-all settings are default for Tomcat 
except running on port 80.

I've installed Tomcat4.0 before and was able to get it up and running in 
no time.  Does anyone have any ideas?

Thanks,
J.R.


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


Re: deploying webapps from ant

2004-04-24 Thread Jacob Kjome
Are you sure you deploying your app to the webapps directory?  Did you do 
an "install" or a "deploy"?  In Tomcat5, "install" has been deprecated and 
"deploy" should be used with the "localWar" attribute if you mean to deploy 
it to a local directory.  In both cases, "deploy" without "localWar" will 
upload the war to the server and stick it either in "webapps" (Tomcat5) or 
in the work directory (Tomcat4.1).  In both these cases, an "undeploy" 
should be used, not "remove".  "install" and "remove" were meant to deploy 
an app to a local directory that Tomcat would not delete upon the 
"remove".  Make sure to match up usage of deploy/undeploy and 
install/remove.  Mixing these will give you unexpected results.

Jake

At 02:24 PM 4/24/2004 +0530, you wrote:
I am trying to deploy my webapps from ant, however my undeploy task does 
not always work. It quietly informs me that everything is ok, however the 
webapps subdirectory still exists, with at least some of the files still 
there. Tomcat appears to be holding onto locks on the files and they 
cannot be deleted. This is with both Tomcat 4 and Tomcat 5, running on 
Windows XP. Here is my ant code showing my undeploy task:

   
   
 message="tomcat.url is not specified in local.properties 
file."/>
   
 message="tomcat.manager.url is not specified in 
local.properties file."/>
   
 message="tomcat.manager.username is not specified in 
local.properties file."/>
   
 message="tomcat.manager.password is not specified in 
local.properties file."/>
   
   
   
   
   
   
   
   
   
   

   
   
   
   
   
   
   
   
-
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]


RE: Help Please : Session problem with multiple Tomcats

2004-04-23 Thread Jacob Kjome
At 07:48 PM 4/23/2004 -0700, you wrote:
Servelet Spec requires the session cookie to be JSESSIONID.

If you launch two instances of IE, it should keep track
of a session ID for each instance.  That should let you
do what you want.
Mozilla just keeps one session ID, even with two instances.
You have to be careful about this.  IE can launch new windows in the same 
process or as a different process.  If it launches them in the same 
process, then you will share the same session, just like you observe in 
Mozilla.  If you have it set up to launch windows in a separate process, 
then you will have distinct session id's in each window.  This isn't a 
matter of IE doing something right and Mozilla doing something wrong.  In 
fact, they are both providing exactly the same behavior, except that IE can 
be configured to launch windows in a separate process and Mozilla always 
uses the same process.

Jake


-Layton

>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 23, 2004 2:52 PM
>To: Tomcat Users List
>Subject: Help Please : Session problem with multiple Tomcats
>
>
>
>
>
>
>
>Can anyone assist on this one?  Does Tomcat have the ability
>to name the
>session cookie differently ( like BEA Weblogic does )?
>
>
>We are running multiple Tomcat servers with multiple JVM's and ports.
>Everything works fine except for the sessions.
>When using one browser (IE) and I flip back an forth between
>the two sites
>( on the two ports ), the sessions are lost.
>
>How does Tomcat's session logic work?  Is there a way to define two
>different session names so they don't clash under one browser?
>
>We've worked around it so far by using IE with one port and
>Netscape with
>the other.
>
>I've included the server.xml's from the two servers.
>
>Thanks for any help
>Ted
>
>
>
>  
>  
>
>
>   port="8601"
>   enableLookups="true" redirectPort="8443"
>   acceptCount="10" debug="0" connectionTimeout="6"/>
>
>
>
>
>
>
>
>  
>directory="../logs"  prefix="pm_catalina_log."
>suffix=".txt"
>  timestamp="true"/>
>
>  
>
>  
>  unpackWARs="true" autoDeploy="true" >
>
> directory="../logs"  prefix="pm_access_log."
>suffix=".txt"
> pattern="common"/>
>
> directory="../logs"  prefix="pm_localhost_log."
>suffix=".txt"
>   timestamp="true"/>
>
>
>swallowOutput="true"  />
>
>className="org.apache.catalina.session.StandardManager"
> checkInterval="600" entropy="pubmgr">
>
>
>  
>
>
>
>  
>
>
>
>
>
>
>
>
>
>  
>  
>
>
>   port="80"
>   enableLookups="true" redirectPort="443"
>   acceptCount="10" debug="0" connectionTimeout="6"/>
>
>
>   port="443" minProcessors="3" maxProcessors="25"
>   enableLookups="true"
> acceptCount="10" debug="0" scheme="https" secure="true">
> clientAuth="false" protocol="TLS"
>   keystoreFile="conf/keystore" />
>
>
>
>
>
>  
>directory="../logs" prefix="ws_catalina_log."
>suffix=".txt"
>  timestamp="true"/>
>
>  
>
>  
> unpackWARs="true" autoDeploy="true">
>
> directory="../logs"  prefix="ws_access_log."
>suffix=".txt"
> pattern="common"/>
>
>directory="../logs"  prefix="ws_localhost_log."
>suffix=".txt"
>  timestamp="true"/>
>
>
>swallowOutput="true" />
>
>className="org.apache.catalina.session.StandardManager"
> checkInterval="600" entropy="webstore">
>
>
>  
>
>
>
>  
>
>
>
>
>
>
>-
>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]


Re: FW: Tomcat stops loading when I run my servlet with

2004-04-23 Thread Jacob Kjome
You are trying to load it up via HTTP?  That seems a bit overkill when you 
are on the same server.  Just load it like this...

context.getResourceAsStream("/WEB-INF/config/myfile.xml");

Should be able to use something like an Entity resolver to provide the 
schema.  This is done commonly for DTD's.  You specify a URL location, but 
load the schema off the classpath instead.

Jake

At 08:21 PM 4/23/2004 -0400, you wrote:
Justin,

I followed your advice immediately, but the exact same thing happens.

Just to restate the issue, my servlet hangs because it needs to obtain an
XML Schema from localhost:8080.  But it can't get it, because Tomcat won't
finish loading until the servlet is finished.  But the servlet won't finish
until Tomcat finishes loading.  Etcetera, etcetera ad infinitum.
I've got some sort of logic issue here.  If I want to kick off a program
that polls a directory for XML files, should I probably do something where I
kick off an independent thread, so that Tomcat is not waiting for my program
to finish (which if it's a good poller, it never will)?
Thanks,
Adrian
-Original Message-
From: Adrian Klingel [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 6:52 PM
To: Adrian Klingel - Exaweb
Subject: FW: Tomcat stops loading when I run my servlet with



-Original Message-
From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 6:47 PM
To: Tomcat Users List
Subject: Re: Tomcat stops loading when I run my servlet with



Yes.  Rip out the load-on-startup.  Now.  Don't wait till
Monday.  Replace with a context listener (see:
javax.servlet.ServletContextListener).  Relax and have a stress-free
weekend.
justin

At 01:55 PM 4/23/2004, you wrote:
>Look at listeners. I think there was a similar thread a while back and the
>solution was to have a listener kick off the servlet after all the other
>processes were done. You could also have your servlet start and then wait
>for a certain amount of time, to allow time for all other processes to
>start.
>
>Doug
>
>
>- Original Message -
>From: "Adrian Klingel" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, April 23, 2004 4:03 PM
>Subject: Tomcat stops loading when I run my servlet with 
>
>
> > I have a servlet which calls a method on itself to poll a directory for
>XML
> > files.  When one is found, another method ("read()" is called which
> then
> > creates a SAX parser and attempts to validate the file against an XML
> > schema.  Upon calling the "parse()" method, Tomcat freezes.  It doesn't
> > create or write to a log, and nothing else starts up.  Nothing is
>accessible
> > on port 8080, because Tomcat doesn't make it to the point where it
> mounts
> > that port.
> >
> > When I remove the  from this particular app's web.xml,
> > Tomcat completes its startup process and things are accessible.  I can
>then
> > reintroduce the  to the web.xml and Tomcat will
> > automatically kick off the servlet.  This time nothing freezes, and the
> > program runs as it is supposed to.
> >
> > My program is attempting to validate this XML file against a schema
> which
>is
> > accessible locally on port 8080.  But that port is prevented from
> becoming
> > available, so the program will just wait forever.
> >
> > My question is, how can I prevent my servlet from starting up until
> after
> > Tomcat has completed its startup procedure?  I've specified higher
> numbers
> > in the  element, but to no avail.
> >
> > Thanks for any help you can offer.
> >
> >
> > -
> > 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]
__
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
__
-
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]


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


Re: Closed war class loading.

2004-04-19 Thread Jacob Kjome
Quoting Owen Fellows <[EMAIL PROTECTED]>:

> Hi,
> 
> Cheers for that, I've unpacked the war now and it works fine.
> 
> Is there any way to redeploy an unpacked war with undeploying and then
> redeploying.
> It doesn't take that long to redeploy but it is a bit ennoying.
> 

Upgrade to Tomcat-5.  It explodes war files by default...even on a Tomcat
manager deploy.  I would still rethink using a technology that violates the J2EE
by requriing access to the file sytem in order to work properly.

Jake

> Cheers,
> Owen
> 
> On Mon, 19 Apr 2004 15:15:57 +, Jacob Kjome <[EMAIL PROTECTED]> wrote:
> 
> > You've got unpackWars="false".  I don't use Velocity, but does it use File
> IO to
> > load .vm files?  If so, you will have to unpack wars to use Velocity. 
> Pretty
> > stupid on Velocity's part if they use File IO in Webapps.
> >
> > Jake
> >
> > Quoting Owen Fellows <[EMAIL PROTECTED]>:
> >
> >> Hi,
> >>
> >> I've raised a bug online
> >>http://issues.apache.org/bugzilla/show_bug.cgi?id=28470
> >> but though I would ask the question here as well.
> >>
> >> --
> >> The problem i'm experiencing is this.
> >>
> >> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> >> resource
> >> '/index.vm'
> >>
> >> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> >> resource
> >> '/index.vm'
> >> at org.apache.velocity.runtime.resource.ResourceManagerImpl.
> >> loadResource(ResourceManagerImpl.java:501)
> >>
> >>
> >> ---
> >>
> >> I've deployed a war through the manager interface.  It deploys fine, picks
> up
> >> the xml file with my context in it, datasource etc.
> >> First time i go to a page i get the above error.
> >>
> >> I have unpackWARs set to false because i want to be able to reload my war
> >> without undeploying (I believe this possible).
> >> This is the Host tag in the server.xml
> >>   >> unpackWARs="false" autoDeploy="false"
> >> xmlValidation="false" xmlNamespaceAware="false">
> >>
> >> Questions.
> >> - Am i doing something wrong
> >> - Is there another way i can get my war to redeploy (without having to
> >> undeploy
> >> redeploy)?
> >>
> >>
> >> Any replies or advice would be great.
> >>
> >> Thanks,
> >> Owen
> >>
> >>
> >> -
> >> 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]
> >
> >
> 
> 
> 
> 
> -
> 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]



Re: Closed war class loading.

2004-04-19 Thread Jacob Kjome
You've got unpackWars="false".  I don't use Velocity, but does it use File IO to
load .vm files?  If so, you will have to unpack wars to use Velocity.  Pretty
stupid on Velocity's part if they use File IO in Webapps.

Jake

Quoting Owen Fellows <[EMAIL PROTECTED]>:

> Hi,
> 
> I've raised a bug online
>http://issues.apache.org/bugzilla/show_bug.cgi?id=28470
> but though I would ask the question here as well.
> 
> --
> The problem i'm experiencing is this.
> 
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource
> '/index.vm'
> 
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource
> '/index.vm'
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.
> loadResource(ResourceManagerImpl.java:501)
> 
> 
> ---
> 
> I've deployed a war through the manager interface.  It deploys fine, picks up
> the xml file with my context in it, datasource etc.
> First time i go to a page i get the above error.
> 
> I have unpackWARs set to false because i want to be able to reload my war
> without undeploying (I believe this possible).
> This is the Host tag in the server.xml
>   unpackWARs="false" autoDeploy="false"
> xmlValidation="false" xmlNamespaceAware="false">
> 
> Questions.
> - Am i doing something wrong
> - Is there another way i can get my war to redeploy (without having to
> undeploy
> redeploy)?
> 
> 
> Any replies or advice would be great.
> 
> Thanks,
> Owen
> 
> 
> -
> 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]



Re: Antwort: RE: How to really destroy a Session

2004-04-16 Thread Jacob Kjome
Quoting [EMAIL PROTECTED]:
> 
> I have tested some other cases:
> 
> We have a SessionListener who sets a flag of the user to logout out, when
> there is a session invalidate. Now it seems that the session.invalidate()
> don't calls the listener in Tomcat 5.0. is this possible?
> 
> Thanks,
> Marc
> 

I have seen similar behavior.  See
http://issues.apache.org/bugzilla/show_bug.cgi?id=18479

The bug is marked "resolved fixed", but look at the messages where I (Jacob
Kjome) start commenting.  I think this bug shouldn't be marked fixed until
sessionDestroyed() is called properly just as valueUnbound() is now called
properly with the current fix for this bug.  Basically, sometimes the listener
collection returned by the following code in StandardSession is null, making it
so HttpSessionAttributeListener's are not called when they should be...

Context context = (Context) manager.getContainer();
Object listeners[] = context.getApplicationEventListeners();


If you can show an alternate way or reproducing this bug, maybe the Tomcat
committers will actually give attention to the issue, because I don't see them
paying any attention to it now, even though I've shown that it is a problem.


Jake


> 
> 
> 
> 
> 
>   "Mike Curwen"
>   <[EMAIL PROTECTED] An:  "'Tomcat Users List'"
> <[EMAIL PROTECTED]>
>   m>   Kopie:
>Thema:   RE: How to really
> destroy a Session
>   16.04.04 15:56
>   Bitte antworten
>   an "Tomcat Users
>   List"
> 
> 
> 
> 
> 
> The cookie is removed when the user closes the browser, no ?
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 16, 2004 8:34 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to really destroy a Session
> >
> >
> >
> >
> >
> >
> > Hi all,
> >
> > I am using Tomcat 5.0.19.
> >
> > In my application the generated sessions are identified by a
> > cookie on the client. I only allow single sign on. Now I want
> > to destroy the session and I call in a session an
> > invalidate() and the session isn't available. Then the
> > application  redirect the request to the start page. But
> > there is still the cookie with JSESSIONID on the client and
> > there is no new session possible.
> >
> > Is there a solution to remove these cookies?
> >
> > Thanks,
> > Marc
> >
> >
> > -
> > 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]
> 
> 
> 
> 
> 
> -
> 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]



RE: Require a tomcat build with bug fix....

2004-04-12 Thread Jacob Kjome

Here's where it exists in the Tomcat5 CVS.  I haven't looked at whether the fix
is there or not, but at least you know where to check it out now...

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java


Jake

Quoting Philip Baruc <[EMAIL PROTECTED]>:

> I just tried to run tomcat 5.0.22 and i don't belive
> the bug(10469) is resolved in this build.
> I see the fix here:
>
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
> 
> This also were i got the version 1.50 that i alluded
> to in an earlier email.
> 
> from what i can see. IN the 1.50 version. there has
> been a change made to the getURL(File file) function:
> 
>/**
>  * Get URL.
>  */
> protected URL getURL(File file)
> throws MalformedURLException {
> 
> File realFile = file;
> try {
> realFile = realFile.getCanonicalFile();
> } catch (IOException e) {
> // Ignore
> }
> 
> //return new URL("file:" +
> realFile.getPath());
> URLEncoder urlEncoder = new URLEncoder();
> urlEncoder.addSafeCharacter(',');
> urlEncoder.addSafeCharacter(':');
> urlEncoder.addSafeCharacter('-');
> urlEncoder.addSafeCharacter('_');
> urlEncoder.addSafeCharacter('.');
> urlEncoder.addSafeCharacter('*');
> urlEncoder.addSafeCharacter('/');
> urlEncoder.addSafeCharacter('!');
> urlEncoder.addSafeCharacter('~');
> urlEncoder.addSafeCharacter('\'');
> urlEncoder.addSafeCharacter('(');
> urlEncoder.addSafeCharacter(')');
> 
> return new
> URL(urlEncoder.encode(realFile.toURL().toString()));
> }
> 
> 
> In the tomcat 5.0.22 version, it appears that the
> getURL(File) still looks as it did before markt made
> his feb 22 fix to the bug.
> 
> It appears that the fix is in the tomcat 4.0 branch
> but not in the tomcat 5.0 branchs. I hope i am reading
> the cvs repositories correctly. If not perhaps you can
> help me. Basially I'm looking for a build of tomcat
> (perferably a 4.0 build) that has this fix. I am
> reluctant to build the tomcat source files myself and
> distribute a custom bug fixed version of tomcat to our
> customers.
> 
> I'm running into a problem without this fix because
> i'm attempting to make an RMI call from with in
> tomcat. When tomcat attempts to resolve the remove
> interface i get an exception like:
> 
> java.rmi.UnmarshalException: error unmarshalling
> arguments; nested exception is:
>   java.net.MalformedURLException: no protocol:
> Files/Apache
> 
> I belive that this is cause WebAppClassLoader
> getURL(File) function is suffering from a bug encoding
> problem in the jdk.
> 
> http://developer.java.sun.com/developer/bugParade/bugs/4273532.html
> 
> I belive that Apache has recognized this problem and
> has implemented its fix in its cvs repositories in its
> tomcat 4.0 branch, but no in any of the builds on the
> 4.0 branch.
> 
> Please advice...
> 
> Thank You,
> P.B.
> 
> 
> --- "Shapira, Yoav" <[EMAIL PROTECTED]> wrote:
> >
> >
> http://www.apache.org/dist/jakarta/tomcat-5/v5.0.22-alpha/
> >
> > Yoav Shapira
> > Millennium Research Informatics
> >
> >
> > >-Original Message-
> > >From: Philip Baruc [mailto:[EMAIL PROTECTED]
> > >Sent: Monday, April 12, 2004 3:04 PM
> > >To: Tomcat Users List
> > >Subject: RE: Require a tomcat build with bug
> > fix
> > >
> > >Is there a place where i can download a build of
> > the
> > >5.0.22-alpha version of tomcat, or does this
> > require
> > >me pulling the 5.0.22 branch from cvs and building
> > it?
> > >
> > >philip b
> > >
> > >--- "Shapira, Yoav" <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Hi,
> > >>
> > >> >I've also downloaded
> > >> >the 4.1.30 source and noticed that the
> > >> >WebAppClassLoader is only at version 1.48 where
> > as
> > >> the
> > >> >bug fix is applied to a 1.50 version of the
> > >> >WebAppClassLoader.
> > >>
> > >> I'm not sure where you're getting your version
> > >> numbers.
> > >>
> >
> >http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/
> > s
> > >> hare/org/apache/catalina/loader/ shows that 1.31
> > is
> > >> the current CVS
> > >> version of WebAppClassLoader, so what's 1.48 and
> > >> 1.50 that you're
> > >> talking about?
> > >>
> > >> Mark marked the issue as fixed on 2004-02-22.
> > >> 4.1.30 was released on
> > >> 2004-01-25.  So what I said before was wrong:
> > 4.1.30
> > >> doesn't have your
> > >> fix.  For that matter, 5.0.19 is from 2004-02-14,
> > so
> > >> it doesn't have
> > >> your fix either.  5.0.22-alpha is from last week
> > and
> > >> should have your
> > >> fix.
> > >>
> > >> Tomcat 5 is not so different that you should be
> > >> afraid to try it.
> > >>
> > >> Yoav Shapira
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> This e-mail, including any attachments, is a
> > >> confidential 

Re: another NoClassDefFoundError question

2004-04-05 Thread Jacob Kjome
You would get more responses if you actually provided the stacktrace you are
getting.  There are a few reasons for NoClassDefFoundError such as the same
library being loaded by different classloaders and your library ending up using
some classes from one and others from the other.  Or, a class you are using is
importing a package/class that doesn't exist.  Provide more info and get more
info in return.

Jake

Quoting Umi Salbiah <[EMAIL PROTECTED]>:

> Hi.
> 
> I need help urgently with this NoClassDefFoundError issue. I was asked to
> port over my application which currently is on
> 
> Apache 1.3.23 on Madrake 9.0
> Tomcat 3.3.1
> mod_jk (for Apache 1.3.23)
> mySQL 3.23.51
> 
> to a Windows-based system.
> 
> Currently I am using
> 
> Win2000 Server
> J2Se 1.4.1
> Apache 2.0.43
> Apache Tomcat 4.1
> mod_jk 2.0.43
> mySQL 4.0.18
> 
> Any clue as to why I still get the NoClassDefFoundError?
> 
> Thank you
> 
> b
> 
> -
> 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]



Re: windows service vs. startup.bat

2004-03-22 Thread Jacob Kjome
At 04:36 PM 3/22/2004 -0800, you wrote:
I am using Log4J in my webapp. I have modified setclasspath.bat so that I
include the path to log4j.properties in my classpath. When I run
startup.bat, all is well and I get logging.
HOWEVER, when I run tomcat from my service manager (the way I wish to run
it), I get no logging, and I get an error message indicating tomcat could
not find my log4j.properties file. I then said 'OK, just put it in my
systems classpath variable. It still did not work. How do I setup Tomcat so
that when I run it as a service, it includes my classpath
First, I wouldn't use the system classpath for anything dealing with a 
webapp.  Put log4j.jar in WEB-INF/lib and log4j.properties in 
WEB-INF/classes and you will be fine.  Second, the Tomcat service wouldn't 
see your properties file on the classpath unless you set the classpath at 
service install time.  See service.bat in CATALINA_HOME/bin for info.  BTW, 
make sure Tomcat is sending Stdout to a file in the service.  If it isn't, 
that would explain a lack of Tomcat logging.  I don't know what appenders 
you are using for your webapp, though.  If it is a console appender, then 
having Tomcat log Stdout to a file is kind of important.

Jake



-
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]


Re: Login by parameters (no prompts)

2004-03-22 Thread Jacob Kjome
Well, if it were BASIC Auth, then you'd just do this (over SSL, of course, to
hide the clear text username/password)...

https://myusername:[EMAIL PROTECTED]

If the username and password are valid, there will be no prompt for username or
password.  You'll get right to the resource.

Jake

Quoting [EMAIL PROTECTED]:

> The application we are building allows file downloads from our UI.
> However, we also want users to be able to download these files using WGET
> from a command-line (perhaps as part of a script), like this:
> 
>   WGET 192.168.1.1/do/download?id=1
> 
> However, these file downloads are subject to authentication and should be
> restricted to certain user roles.
> 
> We have already implemented a JDBCRealm and everything works very well
> within the UI. The problem is that we can't figure out how to get Tomcat
> to invoke authentication without a prompt.  At first, we thought that
> adding "j_username" and "j_password" as part of the URL might do the
> trick.  No such luck.  We looked through the documentation and couldn't
> find any suggestions (unless we missed something along the way).
> 
> What we want to be able to do is have the user provide the username and
> password as part of the URL, like this:
> 
>   WGET 192.168.1.1/do/download?id=1&username=bob&password=secret
> 
> I know that we could always extend Tomcat with our own code, but I'd
> really like to avoid having to do that.  I haven't been allowing any
> platform-specific code into the product and I don't want to start now. The
> use of a JDBCRealm was a compromise that was supposed to reduce the coding
> effort.  Please tell me that there is a way around this issue that doesn't
> require coding Tomcat extensions.
> 
> Thanks for any help you guys might be able to give me.
> Jonathan.

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



Re: java.lang.OutOfMemoryError

2004-03-21 Thread Jacob Kjome
How much information do you put in servlet sessions?  How long do sessions 
last?  How many active user sessions do you have at any given time?  Do you 
start the VM up without providing -Xmx512m or something like that?   If so, 
you are starting a VM with a maximum of 64meg of memory available to 
everything running within it.  That includes the appserver itself plus any 
apps.  It is easy to use more than this, especially if your load is high 
and/or you store lots of info in the sessions.  Keep in mind that a little 
bit of data in the session can go a long way if you have lots of 
users.  Less than 1meg per/user plus, let's say, 64 users with active 
sessions (not necessarily making concurrent requests) would easily use up 
the default memory maximum of the VM.

Jake

At 01:53 PM 3/21/2004 +0100, you wrote:
Hi,

I'm running tomcat 5.0.19 & J2SDK1.4.2_03 on a suse linux 8.1. I wrote a
really simple application, just one servlet and a few jsp pages, using
dbcp/jndi. Nevertheless I got an OutOfMemoryError every 2 days and I have to
restart the tomcat to fix the problem. Here is the log entry:
2004-03-21 10:41:04 StandardWrapperValve[mapperServlet]: Servlet.service()
for servlet mapperServlet threw exception
java.lang.OutOfMemoryError
Okay, I've investigated my source code for some kind of memory leak, but
without any success. How can I found what the problem is ? Are there tools
which can help me ?
thanks in advance

Marco Poehler

---
http://www.poehlerpoehler.de


-
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]


Re: Context Descriptor File

2004-03-19 Thread Jacob Kjome
Try this...

http://marc.theaimsgroup.com/?l=tomcat-user&m=107453389016087&w=2

Jake

At 01:11 AM 3/20/2004 -0500, you wrote:
Hello Folks,

A quicky question. I've been able to get Tomcat5 to "pick up" my
context.xml files I place in META-INF when I deploy the app with the
Tomcat Deployer + Ant.
I would like to use MyEclipse for web development since it looks like a
decent IDE, but its deployer does not get Tomcat to feed off of the
context.xml file that's still in the META-INF directory...
Q: What has to be done to get Tomcat to load the context.xml into its
conf/Catalina/localhost/{appname} ?
Thanx,
Mike
-
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]


RE: Session not destroyed after server shutdown

2004-03-19 Thread Jacob Kjome
Quoting Christian Cryder <[EMAIL PROTECTED]>:

> Hi Jake!
> 
> But this means everything you put in the session needs to be serializable,
> right?
> 

Yep, a recommended best practice.  If you need to put something in the session
and it has data that isn't serializable, make it implement Serializable and
either make the member variable transient or use a static variable.

Consider another case where you are distributing sessions over multiple
appservers.  The data *must* be serializable in that case just as it must be
serializable to write it to the current server's disk upon server shutdown.  So,
the bottom line is, if it isn't serializable and you put it in the session, your
app is likely to not be compatible under certain conditions in certain environments.

> I don't think this impacts Barracuda (because I don't think its saving
> anything in the session - just creating the OR wrappers over the session),
> but we might want to check.
> 
> Of course, we can continue that conversation on the bmvc list...
> 

Sure. 

later,

Jake

> Christian
> --
> Christian Cryder
> Internet Architect, ATMReports.com
> Project Chair, BarracudaMVC - http://barracudamvc.org
> --
> "Coffee? I could quit anytime, just not today"
> 
> 
> > -Original Message-
> > From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 19, 2004 10:20 AM
> > To: Tomcat Users List
> > Subject: Re: Session not destroyed after server shutdown
> >
> >
> > Sessions aren't destroyed until the session times out.  If you
> > shut the server
> > down, existing sessions will be written to file.  If you bring
> > the server back
> > up before the timeout of those sessions, they will still exist upon server
> > restart.  If you think about it, this is usually desired
> > behavior.  I believe
> > you can turn this off on the Coyote connector, but I've forgotten
> > how.  I can't
> > imagine why you wouldn't want it to work this way.  What if you were doing
> > emergency server maintainance and had to restart the app while
> > some users were
> > connected.  Blowing away their sessions would normally be
> > undesired.  You can
> > always delete the work directory for the app if you actually do
> > desire to blow
> > away sessions as well.
> >
> > Jake
> >
> > Quoting Joao Batistella <[EMAIL PROTECTED]>:
> >
> > > Hello!
> > >
> > > I'm using Tomcat 4 and all sessions that I have when the server
> > is up are
> > > not
> > > destroyed when I shutdown te server. I've implemented a
> > > ServletContextListener
> > > to register when the app is going down and a
> > HttpSessionListener to see when
> > > a session is destroyed. When the server goes down the sessions are not
> > > destroyed and, when it comes up again, the sessions are still
> > there. If I
> > > try to get a session attribute by some key before setting the
> > same attribute
> > > I have a result different of null.
> > > Anyone knows what is this?
> > >
> > > My sofwate versions:
> > > Windows XP Professional
> > > Tomcat 4.1.29-LE
> > > J2sdk 1.4.2
> > >
> > > Thanks,
> > > JP
> >
> > -
> > 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]

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



Re: Session not destroyed after server shutdown

2004-03-19 Thread Jacob Kjome
Sessions aren't destroyed until the session times out.  If you shut the server
down, existing sessions will be written to file.  If you bring the server back
up before the timeout of those sessions, they will still exist upon server
restart.  If you think about it, this is usually desired behavior.  I believe
you can turn this off on the Coyote connector, but I've forgotten how.  I can't
imagine why you wouldn't want it to work this way.  What if you were doing
emergency server maintainance and had to restart the app while some users were
connected.  Blowing away their sessions would normally be undesired.  You can
always delete the work directory for the app if you actually do desire to blow
away sessions as well.

Jake

Quoting Joao Batistella <[EMAIL PROTECTED]>:

> Hello!
> 
> I'm using Tomcat 4 and all sessions that I have when the server is up are
> not
> destroyed when I shutdown te server. I've implemented a
> ServletContextListener
> to register when the app is going down and a HttpSessionListener to see when
> a session is destroyed. When the server goes down the sessions are not
> destroyed and, when it comes up again, the sessions are still there. If I
> try to get a session attribute by some key before setting the same attribute
> I have a result different of null.
> Anyone knows what is this?
> 
> My sofwate versions:
> Windows XP Professional
> Tomcat 4.1.29-LE
> J2sdk 1.4.2
> 
> Thanks,
> JP

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



Re: WebappClassLoader: Lifecycle error : CL stopped

2004-03-18 Thread Jacob Kjome
See my other message for the reasoning.  I would recommend not to use
commons-logging in your code.  It does nothing for you and can only cause
problems.  Just use Log4j directly.  If other apps use commons-logging such as
Struts, you'll obviously have to include commons-logging, but don't let it
influence you to use it directly.  Seriously, I've never seen it do any good and
only bad.  Check out...

http://marc.theaimsgroup.com/?l=log4j-user&m=102640868804904

http://qos.ch/logging/thinkAgain.html

Commons Logging was my fault
http://radio.weblogs.com/0122027/2003/08/15.html

Jake

Quoting Jerald Powel <[EMAIL PROTECTED]>:

> 
> I have put down to the method not found thing to I my importing
> java.util.logging.LogManager! I have since acquired the JAR from Apache.org,
> implemented:
> 
> public void contextDestroyed(ServletContextEvent event) {
> org.apache.log4j.LogManager.shutdown();
> }
> 
> in a servlet implementing ServletContextListener. So fingers crossed. I still
> dont know why this error might be thrown, and resolved by this, when I am not
> using log4j! (I am using incidentally using the org.apache.commons.logging
> stuff)
> 
> many thanks
> 
> G.
> 
> 
> -
>   Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> Download Messenger Now

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



Re: WebappClassLoader: Lifecycle error : CL stopped

2004-03-18 Thread Jacob Kjome
Quoting Jerald Powel <[EMAIL PROTECTED]>:

> 
> 
> Hello,
> 
>   Yes, I see it in the Javadoc. Here's my confusion. I am not 'using'
> Log4j-1.2.8 at all! To implement the logic you talk of, I would have to get a
> JAR from the Apache web site?

Yes, but you are using commons-logging and commons-logging, if it finds any
version of Log4j on the classpath, will use that as its logging implementation
in preference to any other logging framework by default.  Log4j is quite simply
somewhere on your classpath whether you mean to put it there or not.

 Even though I am not using Log4j whatsoever on
> my app, is this necessary? I dont know what class I was referencing before
> (my IDE is down), but I am looking on the net for a JAR that might contain
> the desired class.  Please advise if I am marking up the wrong tree!
> 

There's one clue: "my IDE is down".  Are you running Tomcat from within your
IDE?  In this case, Log4j might be being added to your classpath via the IDE
including it by default.  Or, it might be somewhere on your system classpath. 
The Tomcat startup scripts ignore the system classpath, but using the IDE to
start it up wouldn't ignore it.

Ultimately, this is a classpath issue.  Find where Log4j is being included in
the classpath and update that version to the latest 1.2.8.  Then set up the
servlet context listenter and call LogManager.shutdown().

Jake

> thanks
> 
> G.
> 
> 
> Hmm... Take another look at LogManager's source code. I absolutely, 100%
> guarantee that LogManager.shutdown() exists. You are using Log4j-1.2.8,
> right? I know it exists there and I think it has been around for a while
> anyway (but can't be sure). Anyway, the proof is in the Javadoc
> 
>
http://logging.apache.org/log4j/docs/api/org/apache/log4j/LogManager.html#shutdown()
> 
> Jake
> 
> 
> 
> >G.
> >
> >
> >This has to do with Log4j. Make sure you set up a servlet context listener
> >and do LogManager.shutdown() in the contextDestroyed() method. This will
> >take care of your troubles.
> >
> >Jake
> >
> >At 02:13 AM 3/16/2004 +, you wrote:
> >
> > >Hello all,
> > >
> > > Can anyone shed some light on the above error please? On the web, I
> > > saw it often associated with NoClassDefFoundError, and something called
> > > DOMConfigurator.
> > >
> > > May app does indeed parse XML (JDom and Nano XML). Is this message
> > > linked to an error possibly residing in my XML parsing?
> > >
> > > I also see that it is associated with the stop() method on the
> > > WebappClassLoader'. But I am not calling such a method.
> > >
> > >Any info appreciated
> > >
> > >G.
> > >
> > >
> > >
> > >
> > >-
> > > Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> > > Download Messenger Now
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >-
> > Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> > Download Messenger Now
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -
>   Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> Download Messenger Now

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



Re: Encountered exception java.lang.ThreadDeath on Starting from manager

2004-03-18 Thread Jacob Kjome
You probably have Log4j pre-1.2.x in your classpath.  Not sure what
AccessLogValve is doing to cause problems, but since it probably uses
commons-logging, and commons-logging is using Log4j as its logging
implementation, calling LogManager.shutdown() may very well solve that issue. 
And, again, it *does* exist in Log4j-1.2.x.

Find where Log4j is (possibly multiple places) and make sure your overwrite your
old version with the latest 1.2.8 version.

Jake

Quoting Mark Shifman <[EMAIL PROTECTED]>:

> HI:
> 
> I tried LogManager.shutdown() and it didn't work.
> 
> I had an AccessLogValve set up in my contexts(see below) and when I took
> it out
> everything worked as expected. I don't get it??
> 
> 
>  debug="0" reloadable="true" crossContext="true">
> 
>   prefix="chartms_log." suffix=".txt"
> timestamp="true"/>
> 
>directory="logs"
>  prefix="chartms_access." suffix=".txt"
>  pattern="common"/>
> 
> 
> Shapira, Yoav wrote:
> 
> >Hi,
> >See if adding LogManager.shutdown() (org.apache.log4j.LogManager, that
> >is) to a ServletContextListener's contextDestroyed method solves this
> >issue.
> >
> >Yoav Shapira
> >Millennium Research Informatics
> >
> >
> >
> >
> >>-Original Message-
> >>From: Mark Shifman [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, March 18, 2004 1:54 PM
> >>To: Tomcat Users List
> >>Subject: Encountered exception java.lang.ThreadDeath on Starting from
> >>manager
> >>
> >>I am using 5.0.19 and Linux,  When I stop my application via the
> >>manager, I can't start it again.  I get this message
> >>
> >>Encountered exception java.lang.ThreadDeath
> >>
> >>What am I doing wrong.
> >>catalina.out shows
> >>Mar 18, 2004 1:26:19 PM org.apache.catalina.core.StandardHostDeployer
> >>
> >>
> >stop
> >
> >
> >>INFO: standardHost.stop /chartms
> >>Mar 18, 2004 1:26:19 PM org.apache.catalina.logger.LoggerBase stop
> >>INFO: unregistering logger
> >>Catalina:type=Logger,path=/chartms,host=localhost
> >>Mar 18, 2004 1:27:19 PM org.apache.catalina.core.StandardHostDeployer
> >>
> >>
> >start
> >
> >
> >>INFO: standardHost.start /chartms
> >>Mar 18, 2004 1:27:19 PM org.apache.catalina.loader.WebappClassLoader
> >>loadClass
> >>INFO: Illegal access: this web application instance has been stopped
> >>already (the eventual following stack trace is caused by an error
> >>
> >>
> >thrown
> >
> >
> >>for debugging purposes as well as to attempt to terminate the thread
> >>which caused the illegal access, and has no functional impact)
> >>Mar 18, 2004 1:27:19 PM org.apache.catalina.loader.WebappClassLoader
> >>loadClass
> >>INFO: Illegal access: this web application instance has been stopped
> >>already (the eventual following stack trace is caused by an error
> >>
> >>
> >thrown
> >
> >
> >>for debugging purposes as well as to attempt to terminate the thread
> >>which caused the illegal access, and has no functional impact)
> >>
> >>localhost_log shows
> >>
> >>2004-03-18 13:26:19 StandardContext[/manager]HTMLManager: stop:
> >>
> >>
> >Stopping
> >
> >
> >>web application at '/chartms'
> >>2004-03-18 13:26:19 StandardContext[/manager]HTMLManager: list: Listing
> >>contexts for virtual host 'localhost'
> >>2004-03-18 13:27:14 StandardContext[/manager]HTMLManager: list: Listing
> >>contexts for virtual host 'localhost'
> >>2004-03-18 13:27:19 StandardContext[/manager]HTMLManager: start:
> >>Starting web application at '/chartms'
> >>2004-03-18 13:27:19 StandardContext[/manager]FAIL - Application at
> >>context path /chartms could not be started
> >>java.lang.ThreadDeath
> >>   at
> >>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
> >>
> >>
> >r.ja
> >
> >
> >>va:1270)
> >>   at
> >>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade
> >>
> >>
> >r.ja
> >
> >
> >>va:1230)
> >>   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> >>   at org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:145)
> >>   at org.apache.log4j.Category.forcedLog(Category.java:372)
> >>   at org.apache.log4j.Category.log(Category.java:864)
> >>   at
> >>org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:192)
> >>   at
> >>org.apache.catalina.session.StandardManager.start(StandardManager.java:
> >>
> >>
> >706)
> >
> >
> >>   at
> >>org.apache.catalina.core.StandardContext.start(StandardContext.java:422
> >>
> >>
> >6)
> >
> >
> >>   at
> >>org.apache.catalina.core.StandardHostDeployer.start(StandardHostDeploye
> >>
> >>
> >r.ja
> >
> >
> >>va:766)
> >>   at
> >>
> >>
> >org.apache.catalina.core.StandardHost.start(StandardHost.java:1000)
> >
> >
> >>   at
> >>org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:13
> >>
> >>
> >27)
> >
> >
> >>   at
> >>org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet
> >>
> >>
> >.jav
> >
> >
> >>a:578)
> >>   at
> >>org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet
> >>
> >>
> >.jav
> >
> >
> >>a

Re: DOCTYPE in web-app web.xml

2004-03-18 Thread Jacob Kjome
I'd be surprised if Tomcat wasn't using an entity resolver to load the DTD.  The
entity resolver's job would be to recognize the DTD entry and load a
corresponding one from the local server rather than downloading it from the
internet every time.  Just think, if this weren't true, Tomcat wouldn't be able
to deploy applications when the server is not connected to the network.  I've
used Tomcat offline many times and have never had any problems.  Double check
that your spelling is correct in the DTD entry.

Jake

Quoting Bob Bateman <[EMAIL PROTECTED]>:

> Hi all,
> 
> I have been working with a couple different versions and platforms of
> Tomcat, and haven't been able to determine conclusively how the DOCTYPE
> directive should be interpreted.  Until recently, I had always just put
> in the standard Sun lines (see below).
> 
> This worked fine until a few weeks ago, when java.sun.com was down for a
> day or so.  My Tomcat installation would hang briefly during
> initialization and other bad things would happen.
> 
> [digression: did anyone else experience a problem with java.sun.com?]
> 
> Figuring that this sort of problem could happen again I went looking for
> a way to configure TC to look for the .dtd file locally.  I found a nice
> summary here:
> 
>   http://www.ingenio.co.uk/xml/introdtd.html
> 
> tried this:
> 
>   
> 
> and had it work on two somewhat dissimilar systems.  So far so good.
> 
> Yesterday I tried the SYSTEM approach on another TC (4.1.30) and found
> this error in catalina.out:
> 
>   Resolve entity failednull
> file:///usr/local/jakarta/jakarta-tomcat-4.1.30-src/build/web-app_2_3.dt
> d
> 
> Apparently on this installation TC is looking somewhere other than in my
> WEB-INF directory.  In all cases (successful or not) I had installed a
> local copy of web-app_2_3.dtd in WEB-INF, i.e. in the same directory as
> the web-app web.xml.
> 
> The 2.3 Servlet spec contradicts all of this somewhat with these words
> (SRV.13.2.1):
> 
>   All valid web application deployment descriptors for version 2.3
> ofthis specification must contain the following DOCTYPE
> declaration:
> 
>  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>   "http://java.sun.com/dtd/web-app_2_3.dtd";>
> 
> This seems pretty specific, and I don't find any mention of the SYSTEM
> variation in the spec.
> 
> So what is the "correct" behavior?
> 
> What should I do on a system that may not always have Internet
> connectivity?
> 
> Is something just built or configured wrong on the misbehaving system?
> 
> 
> 
> 
> -
> 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]



Re: Tocat 5.0.19 Bug ?

2004-03-18 Thread Jacob Kjome
Are you running Tomcat as a service on Windows?  The default service 
install doesn't put tools.jar in the classpath.  You can use the 
service.bat file in CATALINA_HOME/bin to reinstall the service.  I modified 
mine to include this stuff

"%EXECUTABLE%" //IS//%SERVICE_NAME% --DisplayName "Apache Tomcat" 
--Description "Apache Tomcat Server - 
http://jakarta.apache.org/tomcat/";  --Install "%EXECUTABLE%" --ImagePath 
"%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar" 
--StartupClass org.apache.catalina.startup.Bootstrap;main;start 
--ShutdownClass org.apache.catalina.startup.Bootstrap;main;stop --Java java 
--Startup manual
rem Set extra parameters
"%EXECUTABLE%" //US//%SERVICE_NAME% --JavaOptions 
-Dcatalina.home="\"%CATALINA_HOME%\""#-Djava.endorsed.dirs="\"%CATALINA_HOME%\common\endorsed\""#-Djava.io.tmpdir="\"%CATALINA_HOME%\temp\""#-Dbuild.compiler.emacs=true#-server#-Xms32m#-Xmx512m#-Xrs 
--StdOutputFile "%CATALINA_HOME%\logs\stdout.log" --StdErrorFile 
"%CATALINA_HOME%\logs\stderr.log" --WorkingPath "%CATALINA_HOME%\bin"

Hope that helps.  I'm really not sure why they don't do that in the first 
place because JSP compilation simply will not work without my 
modifications.  I'm mentioned it to the developers, but so far the request 
has been ignored.

To remove:
service.bat remove Tomcat5
To install:
service.bat install
Jake

At 08:29 AM 3/18/2004 -0300, you wrote:
Hello,
I'm having some trouble with tomcat 5.019 running in a linux Box.
One I update any of my JSP's, without restarting Tomcat, Tomcat is 
supposed to re-compile the JSP since it has been modified.
But at some point I get an error from Tomcat telling me that it didn't 
find Java's tool.jar. And to fix this problem it tells me to put tools.jar 
in the classpath.
What I do is stop Tomcat, and start it again. Then the compiling goes fine.
Any ideas what this could be ?

Thanks a lot.
Sincerely,
John.
--
2c10baa3.gifSoftway & Softcomex

João Augusto Charnet
Computer Engineer - e-Softcomex Team
Phone/Fax: 55 19 3739-9200
E-mail: [EMAIL PROTECTED]
R. Conceicao, 233 - Cj, 609 - Centro
13010-050 - Campinas - SP - Brazil


Re: WebappClassLoader: Lifecycle error : CL stopped

2004-03-17 Thread Jacob Kjome
At 10:38 PM 3/17/2004 +, you wrote:

Hi,

Thank you for that, and excuse my delay in responding. I tried what 
you suggested, but found the LogManager class did not contain such a 
method. It did have one method to speak of - getLogManager() which 
returns an instance of LogManager, but that also has no shutdown method. 
I found reset():

LogManager.getLogManager().reset();

I am using JDK 1.4.2_03. How might I sort this hassle out please? It seems 
to be happening very infrequently, but is definately a show stopper!

thanks
Hmm...  Take another look at LogManager's source code.  I absolutely, 100% 
guarantee that LogManager.shutdown() exists.  You are using Log4j-1.2.8, 
right?  I know it exists there and I think it has been around for a while 
anyway (but can't be sure).  Anyway, the proof is in the Javadoc

http://logging.apache.org/log4j/docs/api/org/apache/log4j/LogManager.html#shutdown()

Jake



G.

This has to do with Log4j. Make sure you set up a servlet context listener
and do LogManager.shutdown() in the contextDestroyed() method. This will
take care of your troubles.
Jake

At 02:13 AM 3/16/2004 +, you wrote:

>Hello all,
>
> Can anyone shed some light on the above error please? On the web, I
> saw it often associated with NoClassDefFoundError, and something called
> DOMConfigurator.
>
> May app does indeed parse XML (JDom and Nano XML). Is this message
> linked to an error possibly residing in my XML parsing?
>
> I also see that it is associated with the stop() method on the
> WebappClassLoader'. But I am not calling such a method.
>
>Any info appreciated
>
>G.
>
>
>
>
>-
> Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> Download Messenger Now
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
  Yahoo! Messenger - Communicate instantly..."Ping" your friends today! 
Download Messenger Now


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


Re: How can I make servlets reloaded automatically ?

2004-03-15 Thread Jacob Kjome


I don't recommend that for production, but for development, it makes life 
easier.

Jake

At 11:10 AM 3/16/2004 +0800, you wrote:
Hi,
Once I change the code of a servlet, I have to restart Tomcat5 to 
make it reloaded .
Can I make the Tomcat to reload it without restarting?

Thanks


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


Re: WebappClassLoader: Lifecycle error : CL stopped

2004-03-15 Thread Jacob Kjome
This has to do with Log4j.  Make sure you set up a servlet context listener 
and do LogManager.shutdown() in the contextDestroyed() method.  This will 
take care of your troubles.

Jake

At 02:13 AM 3/16/2004 +, you wrote:

Hello all,

  Can anyone shed some light on the above error please? On the web, I 
saw it often associated with NoClassDefFoundError, and something called 
DOMConfigurator.

 May app does indeed parse XML (JDom and Nano XML). Is this message 
linked to an error possibly residing in my XML parsing?

I also see that it is associated with the stop() method on the 
WebappClassLoader'. But I am not calling such a method.

Any info appreciated

G.



-
  Yahoo! Messenger - Communicate instantly..."Ping" your friends today! 
Download Messenger Now


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


RE: Separating JVM's stdout from Tomcat's

2004-03-15 Thread Jacob Kjome
At 12:23 PM 3/15/2004 -0500, you wrote:

Hi,

>We'd like to do something similar in Tomcat but it's not clear how to
>accomplish it.  The catalina.sh startup script redirects stdout to
>catalina.out, but that file ends up capturing both JVM logging and Web
>application logging.
Only if your webapps are bad and use System.out/System.err ;)

You can add swallowOutput="true" to your context declarations to make
System.out/System.err output from the webapps go to the localhost log.
(Or the Logger defined for the Context, if you have one).  JVM stdout
messages, such as verbose GC, would still go to catalina.out.
In the long term, use a real logging framework like log4j in your
applications and you'll be happier all around ;)  Or at least the
Servlet Spec-provided logging via ServletContext#log.
Or the ServletContextLogAppender in logging-log4j-sandbox :-)
http://tinyurl.com/28van
Jake

Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

-
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]


Re: War does not unpack on deployment

2004-03-13 Thread Jacob Kjome
At 06:19 PM 3/13/2004 -0500, you wrote:
Jacob,
My hosting service is Tomcat 4.18 so I'm kind of stuck with 4.x.  Are you 
saying if I use tomcat 4.x I must not put a context for my applicaton in 
server.mxl?  Then it will be unpacked automatially?
thanks,
Phil
Yep, that's exactly what I'm saying.  Or, do this...



Now you can specify any configuration you want for your app and it will be 
deployed just fine.  It won't be unpacked.  It will run directly from the 
.war file.  Just note that you will not be able to use 
context.getRealPath("/") as it will return null if the app is deployed 
directly from the .war file and not a directory.  Of course, you should 
never depend on this anyway if you want your application to run under any 
appserver.

Also note that the above is exactly what you'd give to Tomcat5 and it will 
unpack it anyway.  The app will run from the directory, not the .war file 
even though the docBase is specified as the .war file.

Jake 

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


Re: War does not unpack on deployment

2004-03-13 Thread Jacob Kjome
Just for the record, this is how it is

Tomcat4.x.x:
If one defines the context in server.xml or in a context configuration 
file, the .war file corresponding to the webapp that it refers to will not 
be unpacked.  Why this is the behavior or Tomcat4.x.x is beyond me.

Tomcat5.x.x
One should not define the context in server.xml, but in a context 
configuration file.  And in either case, the .war file will be unpacked no 
matter what.  This is what it always should have been.

Moral of the story, move off of Tomcat4.x.x and on to Tomcat5.x.x to get 
server behavior that makes sense.

Jake

At 03:47 PM 3/13/2004 -0500, you wrote:
I don't know why the WAR file is not unpacking automatically but I'd like to
suggest a simpler alternative than creating a directory and unjarring it
manually: use the Tomcat Manager application, specifically the "Upload a WAR
file to install" section.
Rhino

- Original Message -
From: "phil campaigne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 13, 2004 3:09 PM
Subject: War does not unpack on deployment
> My application "Test.war"is not unpacking when I ftp it to the
> jakarta-tomcat/webapps directory on my host.  Even after stop and
> re-start.  If I mkdir Test and move test.war into it and jar -vxf
> Test.war then it does expand and run properly.
>
>
> This is my server.xml entries
> **
>  
>   unpackWARs="true" autoDeploy="true">
>
>
> 
> debug="100" privileged="true"/>
> 
>
> This is my web.xml
>
> 
> 
>
>  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd";>
>
> 
>   Test
>
>
> 
> Test
> Test
> com.op.test.Test
> 
>
>
>  
> Test
> /Test
> 
>
>   
> ***
> Why doesn't unpack automatically?
> Thanks,
> Phil Campaigne
>
>
> -
> 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]


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


Re: Where to store log files from packed WAR file apps

2004-03-03 Thread Jacob Kjome

You should never log to within the directory structure of your webapp if you
want your app to be portable.  Provide configuration in web.xml as to where you
want the log file to go which an admin can override via proprietary
configuration.  For instance, in Tomcat...





Then in your Log4j initialization, use value of the "log4j-log-location"
context-param and set a system property with that value to a name that you
reference in your log4j.xml file such as



..
..
..



Or, check out the logging-log4j-sandbox project and grab the alpha_2 (I think
that's the tag name) tag.  Then look into ServletContextLogAppender which will
allow you to specify this in log4j.xml








The output will be routed through your server's context.log() mechanism.  In
Tomcat, just set up





Now you don't need to configure any file to do the logging.  It will just show
up in your container's log directly which you know for a fact will exist and the
container will create it for you.

Or, use Chainsaw2...
http://logging.apache.org/log4j/docs/chainsaw.html

Jake


Quoting Harry Mantheakis <[EMAIL PROTECTED]>:

> Hello
> 
> Now that I've got my Ant build/deploy scripts working nicely, I'm tempted to
> start running my applications out of packed WAR files.
> 
> I cannot figure out if there is a *portable* way to specify paths for where
> my Log4J log files should be saved.
> 
> I assume I could use the 'catalina.home' property to save the logs under the
> Tomcat installation directory - but that's Tomcat specific.
> 
> Has anyone got around this, somehow, or is it a case of getting Ant to glue
> things with some hard-coded values at build time?
> 
> Many thanks for any contributions.
> 
> Harry Mantheakis
> London, UK
> 
> 
> -
> 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]



Re: attributes of the element web-app?

2004-02-25 Thread Jacob Kjome
At 07:15 PM 2/25/2004 -0500, you wrote:
Yeah I kind of think so too.  I believe for this to work a XSL stylesheet 
is necessary for the generated Manager html.  You know:


everything here is "optional."

Moving off this dtd issue.  Do you know if Tomacat ever intends going the 
schema route away from the dtd route?  Thanks.  Any links you could 
suggest on Tomcat's use of the dtd in its XML usage?
Huh?  This isn't up to Tomcat.  Tomcat follows the spec for web.xml.  Other 
configuration files are proprietary.  Each spec up to and including the 2.3 
spec used a dtd.  2.4 uses XML Schema.

Jake



--
George Hester
__
"Mike Curwen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> It might also be that Tomcat does not implement this part of the spec,
> as it is (after all) "optional".
>
>
> > -Original Message-
> > From: news [mailto:[EMAIL PROTECTED] On Behalf Of George Hester
> > Sent: Wednesday, February 25, 2004 4:54 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: attributes of the element web-app?
> >
> >
> > No still didn't work.  Oh well I have the icon in the root of
> > the webapp maybe what I'm expecting is not what this really
> > does.  I just assumed the icon would display in the manager
> > as display-name and description do.  One other thing I have
> > no war in this application.  At least none that I know of.  I
> > made this "virtual root" by myself under IIS Inet pub.  I
> > sort of just popped the web.xml in a WEB-INF folder I made
> > and set up all this to work on port 80.  The manager is still
> > 8080 but the web app "can" be accessed over port 80.
> >
> > --
> > George Hester

-
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]


Re: Tomcat very very slow when doing heavy XML processing

2004-02-16 Thread Jacob Kjome
It shouldn't do anything because of case sensitivity.  As I said before, it 
isn't "100M", it is "100m".  And I still think that Xss value has got to be 
a bit off, but if it works for you, who am I to say you shouldn't use it.

Jake

At 09:05 AM 2/16/2004 -0800, you wrote:
JAVA_OPTS = "-server -Xincgc -Xmx1024M -Xms1024M -Xmn100M -Xss100M"
-Xmn is the size of the younger generation heap.  Before having -Xmn my 
CPU was running at 95% while memory was at 4%.  After putting -Xmn my CPU 
and memory usage are both aroun 11 %.
-Tom

Jacob Kjome <[EMAIL PROTECTED]> wrote:

The JAVA_OPTS settings below are doing nothing whatsoever. Tom, you need
to remember that these are case sensitive. You must add "m" for Megabytes
and "k" for Kilobytes, not "M" or "K". You didn't even provide a value for
-Xmx. And why are you attempting to set -Xss to 100 Megabytes? The
default is 512k. I've never bothered setting that before, but I have to
think that 100m is just a bad idea. And I don't even think that -Xmn is an
option. I've never seen it in the docs.
Based on this, I don't think you really have a good understanding of how to
tweak JVM performance. I suggest reading the docs before posting to the
list...
http://java.sun.com/docs/hotspot/VMOptions.html

Jake

At 09:24 AM 2/15/2004 +0100, you wrote:
>Try disabling name resolution (see previous posts, I can't remember how
>this is done), just in case.
>
>How does your CPU perform? Is it idle all time, or completely busy?
>
>Antonio Fiol
>
>tom ly wrote:
>
>>I've got Tomcat set up as the middle component passing heavy XML data
>>between and client and a backend and it is very very slow. I've set a
>>filter up to log the time it takes to process a request and loadtest with
>>JMeter using 10 threads. Takes around 25,000ms to get a response from
>>looking at JMeter. But when I look at the catalina logs, the times are
>>not too bad, 700-800ms/request to receive and process a request. Seems
>>like most of the problem is with connection speed, not processing
>>speed. I've played around with my JAVA_OPTS and have got it to improve a
>>bit, but I'm always getting the really high response times. Here are my
>>JAVA_OPTS = "-server -Xincgc -Xmx1024M -Xmx1024 -Xmn100M -Xss100M" I'm
>>using Sun SDK 1.4.1. What else can I do to improve the
>>performance? What about using keepalive?
>>
>>
>>-
>>Do you Yahoo!?
>>Yahoo! Finance: Get your refund fast by filing online
>>
>
>
>
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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


Re: Configuring a Data Resource in web.xml

2004-02-16 Thread Jacob Kjome
At 10:16 AM 2/16/2004 +, you wrote:
I not think you can put the JNDI/Resource stuff in the deployment
descriptor, though I stand to be corrected (!)
Well, get ready to start standing

  
  DB Connection
  jdbc/TestDB
  javax.sql.DataSource
  Container
  
That goes in your web.xml.  Of course, you are right about the rest.   You 
need to provide the configuration for the jdbc/TestDB Datasource

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

Jake


AFAIK the JNDI/Resource stuff is placed within an application's 'Context'
element.
With Tomcat 5 you can have separate context fragments - individual XML
documents - for each application.
Context fragments are cool because you can update them without having to
touch the server's configuration file (server.xml).
Context fragments reside in $CATALINA_HOME/conf/Catalina/ directory
where  is the name of the relevant host specified in server.xml. The
default host setting is 'localhost'.
I hope that helps!

Harry Mantheakis
London, UK


> The reference book I have shows how to configure a data resource (JDBC) 
in the
> server.xml.
>
> Does anyone have a reference on how to do this in the web.xml?
>
> I'd like to be able to unpack a war and have everything run, without 
the need
> to edit the
> server.xml.
>
> Thanks for your help.
>
> Mike
>
> __
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> -
> 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]


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


Re: Tomcat 5.0.18, j2sdk1.4.2 & cocoon-2.0.4 Configuration Problem

2004-02-15 Thread Jacob Kjome
One of your jar files is bad, probaby in your webapp.  Check all jars for 
integrity and redeploy.

Jake

At 11:32 AM 2/16/2004 +0530, you wrote:

Hi

I am not sure whether the problem I'm going to narrate belongs to Tomcat
or Cocoon, but anyway I'm sending this mail to this list just in case it
is a problem for this forum.
I am trying to configure cocoon-2.0.4 on Tomcat 5.0.18 using j2sdk1.4.2.
The tomcat standalone server is running allright. But whenever I try to
deploy the cocoon.war file, I get the following error:
--- logs/catalina.out 

INFO: Processing Context configuration file URL
file:/usr/local/jakarta-tomcat-5.0.18/conf/Catalina/localhost/cocoon.xml
Feb 16, 2004 11:05:45 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in dependencyCheck
java.util.zip.ZipException: invalid entry size (expected 2472738816 but
got 48 bytes)
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
at java.util.jar.JarInputStream.read(JarInputStream.java:159)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
at java.io.BufferedInputStream.read(BufferedInputStream.java:280)
at java.util.jar.JarInputStream.getBytes(JarInputStream.java:88)
at java.util.jar.JarInputStream.(JarInputStream.java:65)
at java.util.jar.JarInputStream.(JarInputStream.java:43)
at
org.apache.catalina.util.ExtensionValidator.getManifest(ExtensionValidator.java:420)
at
org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:248)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4135)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:840)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


When I try to browse the cocoon directory of my server (in my case
(http://localhost:8085/cocoon) I get the following error:
HTTP Status 404 - /cocoon/
type Status report
message /cocoon/
description The requested resource (/cocoon/) is not available.
I've tried replacing the xalan.war, xml-api.war etc. files in
tomcat/common/endorsed directory (as directed by cocoon installation
guide) but I still get the error.
Can anyone help me out?

Regards & thanks in advance,
Prabhakar


-
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]


Re: Tomcat very very slow when doing heavy XML processing

2004-02-15 Thread Jacob Kjome
The JAVA_OPTS settings below are doing nothing whatsoever.  Tom, you need 
to remember that these are case sensitive.  You must add "m" for Megabytes 
and "k" for Kilobytes, not "M" or "K".  You didn't even provide a value for 
-Xmx.  And why are you attempting to set -Xss to 100 Megabytes?  The 
default is 512k.  I've never bothered setting that before, but I have to 
think that 100m is just a bad idea.  And I don't even think that -Xmn is an 
option.  I've never seen it in the docs.

Based on this, I don't think you really have a good understanding of how to 
tweak JVM performance.  I suggest reading the docs before posting to the 
list...

http://java.sun.com/docs/hotspot/VMOptions.html

Jake

At 09:24 AM 2/15/2004 +0100, you wrote:
Try disabling name resolution (see previous posts, I can't remember how 
this is done), just in case.

How does your CPU perform? Is it idle all time, or completely busy?

Antonio Fiol

tom ly wrote:

I've got Tomcat set up as the middle component passing heavy XML data 
between and client and a backend and it is very very slow.  I've set a 
filter up to log the time it takes to process a request and loadtest with 
JMeter using 10 threads.  Takes around 25,000ms to get a response from 
looking at JMeter.  But when I look at the catalina logs, the times are 
not too bad, 700-800ms/request to receive and process a request.  Seems 
like most of the problem is with connection speed, not processing 
speed.  I've played around with my JAVA_OPTS and have got it to improve a 
bit, but I'm always getting the really high response times.  Here are my 
JAVA_OPTS = "-server -Xincgc -Xmx1024M -Xmx1024 -Xmn100M -Xss100M"  I'm 
using Sun SDK 1.4.1.  What else can I do to improve the 
performance?  What about using keepalive?

-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online





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


shutdown hook for JNDI custom resource factories???

2004-01-26 Thread Jacob Kjome
I have implemented a custom JNDI resource factory according to the 
documentation here...
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html#Adding%20Custom%20Resource%20Factories

The Object that gets returned from this factory uses the 
JDOHelper.getPersistentManagerFactory() to return a JDO Persistence Manager 
Factory object (PMF).  The PMF is supposed to be closed and I found that 
when I was creating storing the PMF in a servlet context listener and 
creating it on startup, if I didn't shut it down upon application shutdown, 
upon application reload I would get a java.lang.ThreadDeath.

Am I going to have to grab the object from JNDI in the shutdown() method 
and then do myobj.pmf().close()?  Is there a better way to do this without 
having to use a servlet context listener?  Maybe configurable through the 
JNDI configuration?

Jake

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


Re: Being Ignored?

2004-01-25 Thread Jacob Kjome
At 08:44 AM 1/25/2004 -0600, you wrote:
Jake,

Well, I've managed to show that the  element itself isn't being 
ignored.  I modified it so that typing "ts" on the URL would execute the 
"timesheet" app in webapps.  However, the  sub-element that 
defines a custom log file name for the application still doesn't seem to 
be active.  I wonder if that was another change between 4.1 and 5.0?
Worked for me under both Tomcat-4.1.xx and 5.0.xx.

Jake


Merrill

-
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]


Re: Being Ignored?

2004-01-25 Thread Jacob Kjome
Works for me.  Are you sure you context is initializing properly?  Does it 
actually work?  Check stdout for info.

Jake

At 03:20 PM 1/24/2004 -0600, you wrote:
Below is the Context element I'm using for my application.  It was 
originally created for Tomcat 4.1.  With this Context element in 
server.xml in Tomcat 4.1, a log file of "localhost_timesheet_log.txt" 
appeared in the %CATALINA%\log directory.

   
reloadable="true" crossContext="true">
 
   prefix="localhost_timesheet_log." suffix=".txt" 
timestamp="true"/>
   

However, under 5.0.18 (and maybe under 5.0.16--I didn't notice), the only 
log I get is the (apparently) generic 
"localhost_log.2004-01-24.txt".  Does this mean that my Context element is 
being ignored, or does 5.0 not observe the Logger sub-element of the 
Context element?

Merrill

-
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]


Re: 5.0.18: Windows XP Pro vs Windows 2000

2004-01-24 Thread Jacob Kjome
At 08:47 AM 1/24/2004 -0600, you wrote:
Remy,

No, it does not. .xml files in the Host appBase will be ignored.
[Sigh...]  I thought I had it.  Checking back, I see that only the
balancer sample app has it context description file there.
No it isn't... Oh, I see what you mean.  It isn't in the appBase, but in 
the docBase of the balancer webapp.  Not sure why it is there.  Either way, 
it isn't doing anything.  Probably an oversight.  It won't cause any harm 
either way.


You need to put your Context elements in XML files next to the ones for 
the manager and admin, and it will work ok.
OK, I tried doing searches of the various *.xml files.  Here's what I found:

balancer.xml is in:
  %CATALINA_HOME%\webapps\balancer
  %CATALINA_HOME\conf\Catalina\localhost
Like I said above, the former doesn't do anything.  The latter is 
recognized, though.


jsp-examples.xml is in:
  can't find it, but it got installed according to stdout.log
Of course it did. There has never been a rule that says you *must* define a 
 for each webapp.  It is entirely optional.  If not found, Tomcat 
will load up the webapp with defaults.

servlets-examples.xml is in:
  can't find it, but it got installed according to stdout.log
ditto

admin.xml is in:
  %CATALINA_HOME%\server\webapps\admin
  %CATALINA_HOME\conf\Catalina\localhost
manager.xml is in:
  %CATALINA_HOME%\server\webapps\manager
  %CATALINA_HOME\conf\Catalina\localhost
Ok, looks like the files within the docBase directory weren't an oversight 
given that they are in those apps' docBase directories (or maybe it is just 
a big oversight?).  Possibly it is just to provide a web-accessible way to 
see how the application is configured?  Again, however, these files are not 
used by Tomcat and are completely harmless.

The %CATALINA_HOME\conf\Catalina\localhost location is mentioned in the 
Tomcat docs
For Tomcat-5.0.xx, not for Tomcat-4.1.xx

, but I thought the server.xml location was mentioned also.
To top it all off,  the book TOMCAT, THE DEFINITIVE  GUIDE (the only 
O'Reilly book I've ever been disappointed in) says the *.xml context 
descriptions (or "fragments", is it calls them) are placed in 
%CATALINA_HOME%\webapps directory.
They aren't wrong, at least not for Tomcat-4.1.xx. That is exactly where 
they go for the 4.1.xx releases.  They changed things in Tomcat5 to store 
them in CATALINA_HOME/conf/Catalina/[some host]

[signed]
Confused in Austin
Hopefully my response cleared the confusion.

Jake



-
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]


Re: [REALLY OT] CSS tag

2004-01-23 Thread Jacob Kjome
Quoting Luc Foisy <[EMAIL PROTECTED]>:

> 
> I am looking for a quick answer, I don't belong to any other list thats
> appropriate, and we should be full of web developers :)
> I appologize to the admins.
> 
> Any, I was wondering if there was a css tag that would align my text
> vertically. like in 
> 
Yep,

vertical-align: top;

Note that this only works in table cells ( and ) or inline elements
where something on the line makes that line tall such as a
taller-than-the-font-size image.  It is not inherited either, so you can just
set it on a  and expect it to propogate to inline tags inside that . 
Anyway, this should work fine for you since you are using a .

Jake

> TD.productdisplayfieldname
> {
>   color   :   Red;
>   font-size   :   16px;
>   font-family :   Arial, Helvetica, sans-serif;
>   font-style  :   normal;
>   font-weight :   bold;
>   text-decoration :   none;
>   text-align  :   right;
> }
> Anyone got a quick answer?
> 
> -
> 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]



Re: default directory for files in tomcat

2004-01-22 Thread Jacob Kjome
I don't see how an "applet" would have anything to do with where Tomcat 
starts up as they aren't even in the same JVM's.  Did you mean 
"servlet"?  Are you counting on being able to read files in a servlet via 
File IO?  Bad, bad, bad, bad, etc   Never, ever, use File IO in a 
servlet application unless you are using paths provided explicitly via 
deployment configuration or using the servlet container's temp dir.  I 
would even try to avoid using the deployment config if at all 
possible.  Use URL's and Streams to load files using the classloader or the 
servlet context.

As far as your current issue, relatives paths are relative to wherever the 
JVM started from.  If you use the CATALINA_HOME/bin startup files, the VM 
base path will be set to that directory.  If you start it via a service and 
don't set the base directory for the VM, then it will start from whatever 
the default base directory is.  For instance on WinXP or Win2k, this would 
probably be C:\winnt\system32.

Jake

At 01:07 PM 1/22/2004 +, you wrote:
I have an applet which requires a .ini file to be loaded up.  This file is
only found if I am in the directory containing it when I startup tomcat.  Is
there a default location for files, or is there a config for this?  I tried
placing them in a few places but none worked unless I started tomcat from
within that directory.
Thanks
Allan
-
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]


Re: The Tomcat(5.0.16) service does not start on Windows XP

2004-01-21 Thread Jacob Kjome
Grab the latest Tomcat-5.0.18 and use the CATALINA_HOME/bin/service.bat.  You
might need to add JAVA_HOME/lib/tools.jar to the ImagePath in order to get JSP
compiling, but otherwise it will work for you.  Just type:

service install


Jake

Quoting Tobias Eriksson <[EMAIL PROTECTED]>:

> Hi
>  I'm having a tough time here trying to figure out why the Windows
> Service for Tomcat wont start. This is what I have done:
> 
> 1) I've downloaded Tomcat 5.0.16, and unzipped the files into a
> directory, (E:\tomcat_test\).
> 
> 2) I have also installed the service according to the link:
> http://jakarta.apache.org/commons/daemon/procrun.html#Installing%20the%2
> 0service
>  20service>
> I.e. with the following arguments
> E:\tomcat_test\jakarta-tomcat-5.0.16>.\bin\tomcat //IS//Tomcat5
> --DisplayName "Tomcat 5.0.12" --Description "Tomcat 5.0.12 JDK 1.4
> http://jakarta.apache.org"; --ImagePath  E:\tomcat_test\jakarta-tomcat
> -5.0.16\bin\bootstrap.jar" --StartupClass
> org.apache.catalina.startup.Bootstrap;main;start --ShutdownClass
> org.apache.catalina.startup.Bootstrap;main;stop  --Java
> C:\j2sdk1.4.2\jre\bin\client\jvm.dll --StdOutputFile e:\log.txt
> --StdErrorFile e:\err.txt --WorkingPath
> e:\tomcat_test\jakarta-tomcat-5.0.16\
> 
> 3) Launched Windows Services tool, and started it from there, but then
> it seems to start and then it exists
> 
> 4) As an alternative I started it from the command line by using the
> command:
> E:\tomcat_test\jakarta-tomcat -5.0.16>.\bin\tomcatw
> //GT//Tomcat5
> Now this works, cause the process comes up and I am able to browse the
> http://localhost:8080   page with no trouble
> 
> 5) And then I started it by using the command:
> e:\temp>\tomcat_test\jakarta-tomcat -5.0.16\bin\tomcatw
> //GT//Tomcat5
> Now this does NOT work
> 
> I've been using both regmon and filemon to try and figure out what is
> happening.
> 
> And this is my conclusion without a solution :-(
> 
> So when I am running it from the command line, from the working
> directory it works fine. From the tools filemon and regmon I could see
> important differences between when it worked and when it did NOT work.
> The differences seems to be that the service is very dependent on the
> actual working directory, cause when it did not work it failed to find
> the entries below, whereas when it worked fine it used the proper path
> to these,
> 
> NOT WORKING
> C:\Windows\system32\conf\catalina.properties
> C:\Windows\system32\common\classes
> C:\Windows\system32\common\endorsed
> C:\Windows\system32\common\lib
> 
> WORKING
> E:\tomcat_test\jakarta-tomcat-5.0.16\catalina.properties
> E:\tomcat_test\jakarta-tomcat-5.0.16\common\classes
> E:\tomcat_test\jakarta-tomcat-5.0.16\common\endorsed
> E:\tomcat_test\jakarta-tomcat-5.0.16\common\lib
> 
> Any ideas, what is going wrong here?
> 
> Regards
>  Tobias
> 
> 
> -
> 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]



Re: Tomcat can't find log4j properties file in war file

2004-01-20 Thread Jacob Kjome
At 10:04 PM 1/20/2004 -0500, you wrote:
I have a web app served by Tomcat on a Unix system which I have been running
out the development environment.  I am trying to deploy it as a jar file.
When the log4j logging system starts up it says it cannot find the
properties file in the war file.
Do I have to specify the properties file location differently?

More detailed information is below.
Any suggestions will be greatly appreciated; I thank you in advance for your
help
Jim Cant

At startup, Tomcat loads a servlet to initialize the log4j logging system;
the name of an initialization file is given in the servlet element in the
web.xml file:
 hspLog4j.properties
The log file is located in the directory 'docBase' in server.xml, specified
with an absolute path:
   
However, when I jar up the development into HSP.war and point Tomcat at it,
the properties file is not found.
I change server.xml so docBase="HSP.war" and also set 'appbase' to point to
"webapps".
When Tomcat is restarted, the web app runs fine out of the war file but the
logging never gets initialized.  The log file has the error message
  log4j:ERROR Could not read configuration file
[hspLog4j.properties].
  java.io.FileNotFoundException: hspLog4j.properties (No
such file or directory)
 at java.io.FileInputStream.open(Native
Method)


You are attempting to use File IO on an archive.  This won't work.  In J2EE 
applications, the only place you have guaranteed file system access is in 
the server provided temp directory (provided by a system variable of which 
the name eludes me at the moment).  Use a URL or a normal InputStream to 
load the file.  You can do this via the classloader or via 
context.getResource() and context.getResourceAsStream() methods on the 
ServletContext.  This will make it so you can read the file no matter how 
it is packaged.

Jake

 .
The properties file is in the root of the war file which is the
corresponding place to the 'WebApp' directory when running from the
development environment.
When I look in $TOMCAT_HOME/work/Standalone/localhost/HSP, I see the WEB-INF
directory and subdirectories has been deployed but no other files in the war
file are there.
-
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]


Re: [RE-POST] Re: Eclipse+Ant+Tomcat 5 - problems [HELP!]

2004-01-20 Thread Jacob Kjome
At 05:16 PM 1/20/2004 -0600, you wrote:
Remy Maucherat wrote:

Brice Ruth wrote:

When you undeploy, C:\Tomcat-5.0\conf\Catalina\localhost\fiskars.com.xml 
should be removed. At least this is what's intended.
I think you should post the task sequence so that this is reproduceable.

Yet another solution: you can create a .war in the host appBase and 
overwrite it to redeploy the webapp.
Thanks, Remy. Here's what I do:

- start Tomcat 5
- deploy WAR (localWar)
- undeploy WAR
- deploy WAR
*BANG*
I've worked around this for now by having "localWar" point to my project, 
which is structured as a valid deployment (unpacked WAR) - and just using 
the "reload" action, after doing an initial install.

I've noticed, however, that the temporary context.xml files don't get 
removed when I shut-down Tomcat 5. This seems like a bug, right?
Not if you haven't undeployed it.  the "install" task from Tomcat-4.1.xx 
worked this way.  The context was deployed only in memory and server 
restart would be enough to get rid of it.  I personally like the way 
Tomcat5 works for deployment.  The only thing I wish is that when deploying 
from a local war and wanting to update that deployment, you could just do 
"deploy" with the "update" flag and it would undeploy it first if it was 
already deployed.  This works when doing a normal deployment but not which 
a local war for some reason, although I haven't tested this with 
Tomcat-5.0.18 yet.

Jake


--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
-
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]


Re: WAR file not expanded on deployment

2004-01-19 Thread Jacob Kjome
At 09:36 PM 1/19/2004 -0500, you wrote:
IIS 5.0, Tomcat 4.1.29, Windows XP and 2000

I am trying to use the Tomcat/ISAPI Redirection installer from
http://www.shiftomat.com/opensource
It looks for contexts to map by listing everything in /webapps that
is not ROOT, therefore I need my app expanded on deployment.
Currently for some readon I cannot get my WAR to be expanded. I have an
.war and an -context.xml file copied into the webapps/ directiory
on deployment, and even after I restart Tomcat it will not expand.  However
if I do not include an -context.xml in the webapps dir in does expand
the WAR.
Any clue what is going on? How can I get the behavior that I want?
Sure, upgrade to Tomcat5.  It has the behavior you want.  Tomcat 4.1.xx 
behaves exactly as you describe.  It isn't a bug, its a feature.  Tomcat5 
simply has a different feature :-)

Jake


Thanks in advance,
Frank


-
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]


Re: Question Regarding Running Tomcat 5.0.16 As A Service On Windows 2000

2004-01-14 Thread Jacob Kjome

I'm really not sure where all that output is coming from?  Have you tried just
running "service.bat"?  You should get...

ECHO is off.
Usage: service.bat install/remove [service_name]

After that, just try running "service.bat install".  You should get...

The service 'Tomcat5' has been installed

If you don't see this, then something ele is running that I'm not aware of. 
Good luck!

BTW, you do have JAVA_HOME defined, right?

Jake

Quoting Michael Duffy <[EMAIL PROTECTED]>:

> 
> Hi Jacob:
> 
> Here's the complete text that I got back.  As you can
> see from the first line, my first argument was
> install.  The second is the optional service name:
> 
> C:\Tools\Tomcat\5.0.16\bin>jakarta-tomcat-5.0.16-servicebatch.bat
> install Apache-Tomcat-5.0.16
> To install a service:
> -install service_name jvm_library
> (jvm_option)*
> -start start_class [-method start_method]
> [-params (start_parameter)+]
> [-stop start_class [-method stop_method]
> [-params (stop_parameter)+]]
> [-out out_log_file] [-err err_log_file]
> [-current current_dir]
> [-path extra_path]
> 
> To uninstall a service:
> -uninstall service_name
> 
> service_name:   The name of the service.
> jvm_library:The location of the JVM DLL under
> which to run the service.
> jvm_option: An option to use when starting the
> JVM, such as:
> "-Djava.class.path=c:\classes" or
> "-Xmx128m".
> start_class:The class to load when starting the
> service.
> start_method:   The method to call in the start_class.
> default: main
> start_parameter:A parameter to pass in to the
> start_method.
> stop_class: The class to load when stopping the
> service.
> stop_method:The method to call in the stop_class.
> default: main
> stop_parameter: A parameter to pass in to the
> stop_method.
> out_log_file:   A file to redirect System.out into.
> err_log_file:   A file to redirect System.err into.
> current_dir:The current working directory for the
> service.
> Relative paths will be relative to
> this directory.
> extra_path: Path additions, for native DLLs etc.
> To install a service:
> -install service_name jvm_library
> (jvm_option)*
> -start start_class [-method start_method]
> [-params (start_parameter)+]
> [-stop start_class [-method stop_method]
> [-params (stop_parameter)+]]
> [-out out_log_file] [-err err_log_file]
> [-current current_dir]
> [-path extra_path]
> 
> To uninstall a service:
> -uninstall service_name
> 
> service_name:   The name of the service.
> jvm_library:The location of the JVM DLL under
> which to run the service.
> jvm_option: An option to use when starting the
> JVM, such as:
> "-Djava.class.path=c:\classes" or
> "-Xmx128m".
> start_class:The class to load when starting the
> service.
> start_method:   The method to call in the start_class.
> default: main
> start_parameter:A parameter to pass in to the
> start_method.
> stop_class: The class to load when stopping the
> service.
> stop_method:The method to call in the stop_class.
> default: main
> stop_parameter: A parameter to pass in to the
> stop_method.
> out_log_file:   A file to redirect System.out into.
> err_log_file:   A file to redirect System.err into.
> current_dir:The current working directory for the
> service.
> Relative paths will be relative to
> this directory.
> extra_path: Path additions, for native DLLs etc.
> The service 'Apache-Tomcat-5.0.16' has been installed
> 
> C:\Tools\Tomcat\5.0.16\bin>netstat -a
> 
> 
> Thanks for your advice.  I'll keep digging at it and
> let you know what I come up with. - MOD
> 
> 
> 
> --- Jacob Kjome <[EMAIL PROTECTED]> wrote:
> > At 04:37 PM 1/13/2004 -0800, you wrote:
> >
> > >Nope, it was Windows 2000, SP4.  All the other
> > >versions of Apache Tomcat services I have all show
> > up
> > >under their service name, so I expected 5.0.16 to
> > do
> > >the same.
> > >
> > >Yes, I do have CATALINA_HOME as the environment
> > >variable.
> > >
> > >Still not working. - MOD
> >
> > Hmm...  How about if you just specify "service.bat
> > install"?  Does that
> > work?  I've tried the install on both Win2k and
> > WinXP and it works in both
> > places just fine.
> >
> > Before when you mentioned "several messages fl

Re: Question Regarding Running Tomcat 5.0.16 As A Service On Windows 2000

2004-01-13 Thread Jacob Kjome
At 04:37 PM 1/13/2004 -0800, you wrote:

Nope, it was Windows 2000, SP4.  All the other
versions of Apache Tomcat services I have all show up
under their service name, so I expected 5.0.16 to do
the same.
Yes, I do have CATALINA_HOME as the environment
variable.
Still not working. - MOD
Hmm...  How about if you just specify "service.bat install"?  Does that 
work?  I've tried the install on both Win2k and WinXP and it works in both 
places just fine.

Before when you mentioned "several messages flying" by about usage, the 
only way that could happen is if you provided the parameters 
incorrectly.  Specifically, if the first parameter was not "install" or 
"remove".  The second parameter is, of course, optional.  If you are 
familiar with DOS batch scripts, you can check this out 
yourself.  Otherwise, I'm not sure what the problem is.  Works for me.

Jake



--- Jacob Kjome <[EMAIL PROTECTED]> wrote:
> First, the service always reports a success.
> Probably should be updated to
> actually say if something worked or not.
>
> Second, are you using Windows XP?  In that case, the
> display name is used in the
> list of services instead of the service name you
> specified.  The service will
> show up as "Apache Tomcat".  However removal will
> require the original name that
> you passed in, not "Apache Tomcat".
>
> BTW, do you have CATALINA_HOME specified (not
> TOMCAT_HOME)?  If it is not
> specified, then this script will fail.
>
> Otherwise, it should work fine.
>
> Jake
>
> Quoting Michael Duffy <[EMAIL PROTECTED]>:
>
> >
> > Hi Jacob,
> >
> > I must have botched something here.
> >
> > I renamed the script, saved it in my
> TOMCAT_HOME/bin,
> > and executed it by typing:
> >
> > jakarta-tomcat-5.0.16-servicebatch.bat install
> > Apache-Tomcat-5.0.16
> >
> > There were several messages flying by, telling me
> how
> > to install and uninstall a service.  The last line
> > read "The service 'Apache-Tomcat-5.0.16' has been
> > installed".
> >
> > But when I open my Windows 2000 Services panel, I
> > don't see that service anywhere.  I see my
> > 'Apache-Tomcat-4.1.29' service (stopped, of
> course).
> >
> > If I type "netstat -a", I don't see a listener on
> port
> > 8080.
> >
> > What have I done wrong?  Please advise. - MOD
> >
> >
> > --- Jacob Kjome <[EMAIL PROTECTED]> wrote:
> > > There is a service.bat file in the Tomcat CVS.
> > > Here's a copy of that with a
> > > couple minor tweaks.  I've attached it before to
> > > emails in this list, but I'll
> > > attach it again since it is small.  Rename
> > > service.txt to service.bat.
> > >
> > > Jake
> > >
> > > Quoting Michael Duffy <[EMAIL PROTECTED]>:
> > >
> > > >
> > > > Hi, I've recently downloaded Tomcat 5.0.16 to
> try
> > > some
> > > > 4.1.29 Web apps against it.
> > > >
> > > > I've always installed Tomcat as a service
> using a
> > > > Windows command script like this:
> > > >
> > > > set JAVA_HOME=C:\Tools\JDKs
> > > > set CATALINA_HOME=C:\Tools\Tomcat\5.0.16
> > > > set TOMCAT_HOME=%CATALINA_HOME%
> > > >
> > > > set SERVICE_NAME=Apache-Tomcat-5.0.16
> > > > set
> > > >
> > >
> >
>
BOOTSTRAP_SERVICE=org.apache.catalina.startup.BootstrapService
> > > > set STDOUT=%TOMCAT_HOME%\logs\stdout.log
> > > > set STDERR=%TOMCAT_HOME%\logs\stderr.log
> > > >
> > > > echo Service name: %SERVICE_NAME%
> > > > echo Java HOME   : %JAVA_HOME%
> > > > echo Tomcat HOME : %TOMCAT_HOME%
> > > > echo Bootstrap   : %BOOTSTRAP_SERVICE%
> > > > echo Output log  : %STDOUT%
> > > > echo Error  log  : %STDERR%
> > > >
> > > > tomcat.exe -install %SERVICE_NAME%
> > > > %JAVA_HOME%\jre\bin\client\jvm.dll -server
> -Xms64m
> > > > -Xmx256m
> > > >
> -Djava.class.path=%TOMCAT_HOME%\bin\bootstrap.jar
> > > > -Dcatalina.home=%TOMCAT_HOME%
> > > >
> -Djava.endorsed.dirs=%TOMCAT_HOME%\common\endorsed
> > > > -start %BOOTSTRAP_SERVICE% -params start -stop
> > > > %BOOTSTRAP_SERVICE% -params stop -out %STDOUT%
> > > -err
> > > > %STDERR%
> > > >

Re: Question Regarding Running Tomcat 5.0.16 As A Service On Windows 2000

2004-01-13 Thread Jacob Kjome
At 01:42 PM 1/13/2004 -0800, you wrote:

Hi Jacob,

Just one thing wasn't clarified in the readme:

In the line commented as "Set extra parameters", are
the characters between the # symbols considered
commented out?  If I needed to change the values
associated with #-Xms32m#-Xmx256m#, should I replace
the # with a space?
It looks that way to me, but I wanted verification
from an expert.  Thank you - MOD
Heh, "expert".  That's funny.  I just happened to see an email which 
contained a reference to the service.bat, started with that, watched the 
list some more, and finally came up with what is there.  It really is only 
tweaks added to the original.

As for the # signs.  Those are actually the delimiters of the 
arguments.  Don't ask me how they came up with that syntax.  It just is 
that way.  They aren't being used for comments and shouldn't be replaced by 
anything else if you want things to work.

Jake



--- Jacob Kjome <[EMAIL PROTECTED]> wrote:
> There is a service.bat file in the Tomcat CVS.
> Here's a copy of that with a
> couple minor tweaks.  I've attached it before to
> emails in this list, but I'll
> attach it again since it is small.  Rename
> service.txt to service.bat.
>
> Jake
>
> Quoting Michael Duffy <[EMAIL PROTECTED]>:
>
> >
> > Hi, I've recently downloaded Tomcat 5.0.16 to try
> some
> > 4.1.29 Web apps against it.
> >
> > I've always installed Tomcat as a service using a
> > Windows command script like this:
> >
> > set JAVA_HOME=C:\Tools\JDKs
> > set CATALINA_HOME=C:\Tools\Tomcat\5.0.16
> > set TOMCAT_HOME=%CATALINA_HOME%
> >
> > set SERVICE_NAME=Apache-Tomcat-5.0.16
> > set
> >
>
BOOTSTRAP_SERVICE=org.apache.catalina.startup.BootstrapService
> > set STDOUT=%TOMCAT_HOME%\logs\stdout.log
> > set STDERR=%TOMCAT_HOME%\logs\stderr.log
> >
> > echo Service name: %SERVICE_NAME%
> > echo Java HOME   : %JAVA_HOME%
> > echo Tomcat HOME : %TOMCAT_HOME%
> > echo Bootstrap   : %BOOTSTRAP_SERVICE%
> > echo Output log  : %STDOUT%
> > echo Error  log  : %STDERR%
> >
> > tomcat.exe -install %SERVICE_NAME%
> > %JAVA_HOME%\jre\bin\client\jvm.dll -server -Xms64m
> > -Xmx256m
> > -Djava.class.path=%TOMCAT_HOME%\bin\bootstrap.jar
> > -Dcatalina.home=%TOMCAT_HOME%
> > -Djava.endorsed.dirs=%TOMCAT_HOME%\common\endorsed
> > -start %BOOTSTRAP_SERVICE% -params start -stop
> > %BOOTSTRAP_SERVICE% -params stop -out %STDOUT%
> -err
> > %STDERR%
> >
> > But it's not working with Tomcat 5.0.16.
> >
> > I downloaded the ZIP file, as I always do, not the
> > .exe installer.
> >
> > What is the proper idiom for setting up Tomcat
> 5.0.16
> > as a service under Windows 2000?  Thanks - MOD
> >
> >
> > __
> > Do you Yahoo!?
> > Yahoo! Hotjobs: Enter the "Signing Bonus"
> Sweepstakes
> > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
[EMAIL PROTECTED]
> ATTACHMENT part 2 application/zip
name=servicebatch.zip
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
[EMAIL PROTECTED]
__
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
-
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]


Re: org/apache/tomcat/logging/Logger

2004-01-13 Thread Jacob Kjome
Quoting Christopher Schultz <[EMAIL PROTECTED]>:

> > I got this error in one tomcat application
> > java.lang.NoClassDefFoundError: org/apache/tomcat/logging/Logger
> 
> It looks like you're missing the log4j library for that particular
> application. Check the WEB-INF/lib directory for a log4j-looking JAR
> file. It's also possible that the code was compiled with a later version
> or log4j, and deployed with an earlier version (the Logger class is
> somewhat new).
> 
> -chris
> 

Where you do you see anything about Log4j here?  This is Tomcat's Logger, not
Log4j's.  Additionally, since Tomcat doesn't have any dependencies on Log4j,
this absolutely cannot be a problem with not finding Log4j.

Not sure what the problem is, but it doesn't have anything to do with Log4j.

Jake

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



Re: Question Regarding Running Tomcat 5.0.16 As A Service On Windows 2000

2004-01-13 Thread Jacob Kjome
First, the service always reports a success.  Probably should be updated to
actually say if something worked or not.

Second, are you using Windows XP?  In that case, the display name is used in the
list of services instead of the service name you specified.  The service will
show up as "Apache Tomcat".  However removal will require the original name that
you passed in, not "Apache Tomcat".

BTW, do you have CATALINA_HOME specified (not TOMCAT_HOME)?  If it is not
specified, then this script will fail.

Otherwise, it should work fine.

Jake

Quoting Michael Duffy <[EMAIL PROTECTED]>:

> 
> Hi Jacob,
> 
> I must have botched something here.
> 
> I renamed the script, saved it in my TOMCAT_HOME/bin,
> and executed it by typing:
> 
> jakarta-tomcat-5.0.16-servicebatch.bat install
> Apache-Tomcat-5.0.16
> 
> There were several messages flying by, telling me how
> to install and uninstall a service.  The last line
> read "The service 'Apache-Tomcat-5.0.16' has been
> installed".
> 
> But when I open my Windows 2000 Services panel, I
> don't see that service anywhere.  I see my
> 'Apache-Tomcat-4.1.29' service (stopped, of course).
> 
> If I type "netstat -a", I don't see a listener on port
> 8080.
> 
> What have I done wrong?  Please advise. - MOD
> 
> 
> --- Jacob Kjome <[EMAIL PROTECTED]> wrote:
> > There is a service.bat file in the Tomcat CVS.
> > Here's a copy of that with a
> > couple minor tweaks.  I've attached it before to
> > emails in this list, but I'll
> > attach it again since it is small.  Rename
> > service.txt to service.bat.
> >
> > Jake
> >
> > Quoting Michael Duffy <[EMAIL PROTECTED]>:
> >
> > >
> > > Hi, I've recently downloaded Tomcat 5.0.16 to try
> > some
> > > 4.1.29 Web apps against it.
> > >
> > > I've always installed Tomcat as a service using a
> > > Windows command script like this:
> > >
> > > set JAVA_HOME=C:\Tools\JDKs
> > > set CATALINA_HOME=C:\Tools\Tomcat\5.0.16
> > > set TOMCAT_HOME=%CATALINA_HOME%
> > >
> > > set SERVICE_NAME=Apache-Tomcat-5.0.16
> > > set
> > >
> >
> BOOTSTRAP_SERVICE=org.apache.catalina.startup.BootstrapService
> > > set STDOUT=%TOMCAT_HOME%\logs\stdout.log
> > > set STDERR=%TOMCAT_HOME%\logs\stderr.log
> > >
> > > echo Service name: %SERVICE_NAME%
> > > echo Java HOME   : %JAVA_HOME%
> > > echo Tomcat HOME : %TOMCAT_HOME%
> > > echo Bootstrap   : %BOOTSTRAP_SERVICE%
> > > echo Output log  : %STDOUT%
> > > echo Error  log  : %STDERR%
> > >
> > > tomcat.exe -install %SERVICE_NAME%
> > > %JAVA_HOME%\jre\bin\client\jvm.dll -server -Xms64m
> > > -Xmx256m
> > > -Djava.class.path=%TOMCAT_HOME%\bin\bootstrap.jar
> > > -Dcatalina.home=%TOMCAT_HOME%
> > > -Djava.endorsed.dirs=%TOMCAT_HOME%\common\endorsed
> > > -start %BOOTSTRAP_SERVICE% -params start -stop
> > > %BOOTSTRAP_SERVICE% -params stop -out %STDOUT%
> > -err
> > > %STDERR%
> > >
> > > But it's not working with Tomcat 5.0.16.
> > >
> > > I downloaded the ZIP file, as I always do, not the
> > > .exe installer.
> > >
> > > What is the proper idiom for setting up Tomcat
> > 5.0.16
> > > as a service under Windows 2000?  Thanks - MOD
> > >
> > >
> > > __
> > > Do you Yahoo!?
> > > Yahoo! Hotjobs: Enter the "Signing Bonus"
> > Sweepstakes
> > > http://hotjobs.sweepstakes.yahoo.com/signingbonus
> > >
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> > ATTACHMENT part 2 application/zip
> name=servicebatch.zip
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> 
> -
> 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]



Re: Question Regarding Running Tomcat 5.0.16 As A Service On Windows 2000

2004-01-13 Thread Jacob Kjome
There is a service.bat file in the Tomcat CVS.  Here's a copy of that with a
couple minor tweaks.  I've attached it before to emails in this list, but I'll
attach it again since it is small.  Rename service.txt to service.bat.

Jake

Quoting Michael Duffy <[EMAIL PROTECTED]>:

> 
> Hi, I've recently downloaded Tomcat 5.0.16 to try some
> 4.1.29 Web apps against it.
> 
> I've always installed Tomcat as a service using a
> Windows command script like this:
> 
> set JAVA_HOME=C:\Tools\JDKs
> set CATALINA_HOME=C:\Tools\Tomcat\5.0.16
> set TOMCAT_HOME=%CATALINA_HOME%
> 
> set SERVICE_NAME=Apache-Tomcat-5.0.16
> set
> BOOTSTRAP_SERVICE=org.apache.catalina.startup.BootstrapService
> set STDOUT=%TOMCAT_HOME%\logs\stdout.log
> set STDERR=%TOMCAT_HOME%\logs\stderr.log
> 
> echo Service name: %SERVICE_NAME%
> echo Java HOME   : %JAVA_HOME%
> echo Tomcat HOME : %TOMCAT_HOME%
> echo Bootstrap   : %BOOTSTRAP_SERVICE%
> echo Output log  : %STDOUT%
> echo Error  log  : %STDERR%
> 
> tomcat.exe -install %SERVICE_NAME%
> %JAVA_HOME%\jre\bin\client\jvm.dll -server -Xms64m
> -Xmx256m
> -Djava.class.path=%TOMCAT_HOME%\bin\bootstrap.jar
> -Dcatalina.home=%TOMCAT_HOME%
> -Djava.endorsed.dirs=%TOMCAT_HOME%\common\endorsed
> -start %BOOTSTRAP_SERVICE% -params start -stop
> %BOOTSTRAP_SERVICE% -params stop -out %STDOUT% -err
> %STDERR%
> 
> But it's not working with Tomcat 5.0.16.
> 
> I downloaded the ZIP file, as I always do, not the
> .exe installer.
> 
> What is the proper idiom for setting up Tomcat 5.0.16
> as a service under Windows 2000?  Thanks - MOD
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

servicebatch.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Logging and Tomcat 5.0.16

2004-01-11 Thread Jacob Kjome
At 02:44 PM 1/10/2004 -0800, you wrote:
Shapira, Yoav wrote:

>1) Is there a reason why the startup.sh script that comes bundled with
>Tomcat 5.0.16 adds commons-logging-api.jar to the CLASSPATH?  As far as
>I can tell, it's the only script that uses it.
Yes, there's a good reason: tomcat internals use commons-logging to do
their logging.
Yes, but why put it in the CLASSPATH and not in /server/lib?  Doesn't this 
mean that any configuration would affect all webapps?
probably, except that Tomcat loads stuff from WEB-INF/lib and 
WEB-INF/classes before trying from the parent classloaders (opposite of 
normal Java2 classloading).  This is defined by the servlet spec and allows 
for applications to use their own libs even when the server contains its 
own duplicates.


>2) Is there a recommended way to control what gets spewed into
>catalina.out?  The fact that all the messages I'm getting have an INFO
>tag would indicate that this should be possible.
Yes, add a commons-logging configuration file to common/classes, e.g. as
suggested in this link off the tomcat FAQ:
http://jakarta.apache.org/tomcat/faq/misc.html#catalina.out
I saw that, and that has a config file for log4j, not commons-logging.
There is no way to actually filter the output through the commons-logging 
config file.  I'd like a way to only suppress catalina's output.
If I use a log4j.properties, it means I'd need to install log4j in 
/common/lib.  It also means that I have to specify all logging config info 
in /common/classes instead of on a per-webapp basis (see 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg113292.html).
Well, only if you don't put log4j.jar under WEB-INF/lib.  As stated above, 
if you do this, log4j.jar will load for your webapp even if a common one is 
available to other webapps.  Otherwise, you can also use a custom repositor 
selector
http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/AppContainerLogging


>3) In any case, why doesn't Tomcat just come with commons-logging.jar
>and log4j.jar bundled in /server/libs?
Tomcat does not want to tie you into a specific logging implementation,
e.g. log4j.  Tomcat wants to make its logging available to webapps by
default, so server/lib is not a possible location.
But doesn't this just lead to classloader hell?
Sometimes, yes.  commons-logging leads to classloader hell on its own no 
matter where you put it.  It's nothing but trouble, if you ask me.
http://www.qos.ch/logging/thinkAgain.html
http://radio.weblogs.com/0122027/2003/08/15.html


>4) Is there a FAQ or HOWTO on recommended approaches to handling
logging
>in Tomcat somewhere?
It won't hurt to search the archives of this list, there are many
answers there.  The link above also has some information.
I'm sorry, but I have searched the archives, and there just doesn't seem 
to be one conclusive answer.  I see a lot of e-mails talking about the use 
of commons-logging and how it causes all sorts of classloader wierdness.
We get it all too often on the Log4j-user list.  Users report "Log4j isn't 
working" and then proceed to provide a commons-logging config file.  There 
have been very few cases where Log4j itself was causing the problems.  I 
won't say it never does, but commons-logging seems to be the primary cause 
of issues in getting Log4j to work, not Log4j itself.

What I'm looking for is a way to specify logging configuration for 
catalina that is independent of any webapps I may have.

I don't want 1 log4j.properties for everything.  Is this possible?  If so, 
how?  I'd be more than happy to write up a HOW-TO if I could just figure 
this out, but I haven't stumbled across anything that works yet.
If you follow my advice above, you should be all set.  Separate logger 
repositories for each app, even though you provide log4j and a config file 
in a parent classloader.

Jake


Thanks,
-Mark


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


RE: Datasource - OK in app context - Fails in Global context

2004-01-09 Thread Jacob Kjome
At 03:44 PM 1/9/2004 -0600, you wrote:
Bingo!!!  That was it.

It might be a good idea to add a paragraph to the JDBC DataSources section 
of the documentation that mentions:

(a) That global datasources are defined in  of 
server.xml
(b) The need for the  in the application context .xml file

I had the mistaken impression that anything placed in the server.xml file 
was automatically applied to all application contexts.  I am sure that 
others make the same mistake.

Thanks, I have been pulling my hair on this issue for almost a month.
This is true for .  Maybe you were confusing 
 with that.  The latter lets you define things once 
and let applications link to it if they want the service whereas the former 
makes the service available for every app whether it is wanted or not.

Jake


Bruno

-Original Message-
From: ext Keshav Sarin [mailto:[EMAIL PROTECTED]
Sent: Friday, January 09, 2004 3:22 PM
To: [EMAIL PROTECTED]; Melloni Bruno (Nokia-BI/Dallas)
Subject: Re: Datasource - OK in app context - Fails in Global context
Have you defined a reference to the global resource in the
 element of the application context ?
>>> [EMAIL PROTECTED] 01/09/04 10:38AM >>>
I have an Oracle JDBC datasource that I defined in the Tomcat5 context
for an application (conf/Catalina/localhost/nwg.xml).  Works fine,
context file listed below.
But when I tried to move the datasource to the 
section of server.xml so that it would be accessible to all apps it gets
recognized in the admin console, but not by the application.
What gives?  I thought a Global resource is supposed to function
identically to an application resource.
Any help would be greatly welcomed.

nwg.xml:
  
  

  factory
  org.apache.commons.dbcp.BasicDataSourceFactory


  driverClassName
  oracle.jdbc.driver.OracleDriver


  url
jdbc:oracle:thin:@hostNameHere:portNumberHere:dbNameHere


  username
  usernameHere


  password
  userpasswordHere


  maxIdle
  10


  maxActive
  20


  maxWait
  -1


  removeAbandoned
  true


  logAbandoned
  true

  
Note: The JDBC driver is ojdbc14.jar and is present in common/lib, the
application's WEB-INF/lib and is present also in the JRE's lib/ext for
unrelated JAAS reasons.
Bruno Melloni
eBusiness Application Center, Americas
Nokia, Inc
6000 Connection Drive, Mailstop 4w223
Irving, TX  75039  USA
*Office: +1 (972)894-6120
*Cellular: +1 (469) 939-1067
* SMS: [EMAIL PROTECTED]
* e-mail: [EMAIL PROTECTED]
-
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]


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


RE: Best practices - doing code pushes

2004-01-09 Thread Jacob Kjome
At 10:28 AM 1/9/2004 -0700, you wrote:
Thanks for the information. It looks like this is for Tomcat 5. We're using
4. Is there any similar functionality in 4?
Not that I'm aware of.  I suggest moving to Tomcat5 if at all possible.  It 
is *so* much better.  I think you'll like it.

Jake


TIA,

--
Sean LeBlanc
Software Developer
insightamerica
"Those who do not understand Unix are condemned to reinvent it, poorly."
--Henry Spencer
-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 10:15 PM
To: Tomcat Users List
Subject: Re: Best practices - doing code pushes
At 03:29 PM 1/7/2004 -0700, you wrote:
>I have a question about how to load a new application w/o interruption
>of service.
>
>What do others do to remove/reduce service interruption when doing a
>new code push?
>
>I would like to be able to push new code for new Axis services w/o
>having to kill any service requests currently being serviced, and pick
>up the new code for any new incoming requests. Is this possible?
>
There's a new "pause" parameter for the manager deploy servlet which should
do what you require...
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Deploy%20
A%20New%20Application%20Remotely
Jake

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
e-Mail Notice: This communication may contain sensitive information.  If you
are not the intended recipient, or believe that you have received this
communication in error, do not print, copy, retransmit, disseminate, or
otherwise use the information contained herein for any purpose.  Please
alert the sender that you have received this message in error and delete the
copy that you received.
-
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]


RE: Retrieving the context path from a standalone class

2004-01-08 Thread Jacob Kjome
Quoting "Shapira, Yoav" <[EMAIL PROTECTED]>:

> 
> Howdy,
> 
> >One way is by taking advantage of Tomcat's naming conventions with the
> >tempdir
> >
> > String tempdir =
> >   "" + context.getAttribute("javax.servlet.context.tempdir");
> > int lastSlash = tempdir.lastIndexOf(File.separator);
> >
> > if ((tempdir.length() - 1) > lastSlash) {
> >   logHomePropName = tempdir.substring(lastSlash + 1) +
> >".log.home";
> > }
> 
> Very tomcat-specific and subject to change ;)

Yep, that's why I don't use that anymore and use the second approach.

  But the 2nd approach is
> much better, as I mentioned using ServletContext#getResource is a good
> way to go.  As I was reading the code, I could swear I'd seen it before,
> and then I realized it's a paste from the log4j repository selector you
> wrote ;)

Yes, with your help :-)  

  (BTW how come we haven't moved it from log4j-sandbox to log4j
> for 1.3 yet?)
> 

Not sure, but we will probably want to update it to work with Ceki's new 
configuration mechanism which is to replace the DOMConfigurator (what was it 
called again?) and also use the new watchdogs instead of configureAndWatch() 
(which is only used in cases where it is configured to be used *and* we detect 
that we have file system access to the configured [proposed] location of the 
log file).  However, I am unfamiliar with how these work, so any help on this 
effort would be appreciated.

For my purposes, I use a jar built off the unofficial 0.2 tagged version of the 
log4j-sandbox CVS code.  BTW, ContextJNDISelector has been moved to Log4j 
already.  I think we should also move the other optional appenders as well as 
the configuration stuff as they have been very useful (to me, at least).  I'd 
like to hear the opinions of some of the other developers on this before an 
alpha release of log4j-1.3.

Jake

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



Re: Can not include javascript using TC 4.1.29

2004-01-07 Thread Jacob Kjome
This is simply a matter of your context path being "/" or being something 
like "/mycontext".  With the former, as long as you aren't one or more 
directories deep into your webapp, then using "script/utility.js" and 
"/script/utility.js" are completely equivalent.  However, if you are a 
couple directories deep then the first one will be invalid and if you are 
using the "/mycontext" path, then the second one will be invalid.  The 
solution is to either always use relative paths and account for directory 
levels or always use paths based off the root of the web, but make sure to 
prefix the servlet context path such as...

this.getContextPath() + "/script/utility.js"

Dynamically adding the context path this way guarantees that no matter what 
context path your webapp is deployed in, the path to your file will always 
be valid.

See:
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletRequest.html#getContextPath()
Jake

At 07:39 PM 12/29/2003 +0800, you wrote:
Howdy,

I am developing a web app using win2k pro + Tomcat

In a servlet , the following code works ( file /script/utility.js can be 
get by IE)

sb.append ("\n");
sb.append ("\n");
sb.append ( getContentTypeMeta(_req) );
sb.append ("\n");

^
but when the preceding slash is deleted,  IE can not get the js file:
sb.append ("\n");
sb.append ("\n");
sb.append ( getContentTypeMeta(_req) );
sb.append ("\n");

^ no / here

BTW, both are OK under TC 4.0.1.
Because  the web app will be deployed in another servlet container which only
recognize the first format ,  I want to using the  format  with preceding 
"/ " , how should I do ?
( better not to use 4.0.1 :)

TIA




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


Re: "Silent" install of Tomcat on Windows?

2004-01-07 Thread Jacob Kjome
At 12:23 PM 1/7/2004 -0500, you wrote:
 Is there a command I can
run from the command prompt to install it as a service after
I unzip the files into a dir?
Thanks,  Mike
Yep.

Actually, this was recently discussed on the list.  See..
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/bin/service.bat
Also, I've noticed a couple of issues with that version, so here's the 
version I use (attached inside a zip file).  I've included both the latest 
unmodified 1.3 version and my updated version which should fix things such 
as JSP compilation not working because tools.jar isn't added to the 
classpath and a couple other things I forget.  There are also simple usage 
instructions (copied from an earlier message on the list).

Jake 

service.zip
Description: Zip archive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Retrieving the context path from a standalone class

2004-01-07 Thread Jacob Kjome
Just to contribute to delinquency, here's a couple ways to obtain the 
context path at runtime from the ServletContext

One way is by taking advantage of Tomcat's naming conventions with the 
tempdir

String tempdir =
  "" + context.getAttribute("javax.servlet.context.tempdir");
int lastSlash = tempdir.lastIndexOf(File.separator);
if ((tempdir.length() - 1) > lastSlash) {
  logHomePropName = tempdir.substring(lastSlash + 1) + ".log.home";
}
Another, which is more (fully?) server agnostic is...

  //use a more standard way to obtain the context path name
  //which should work across all servers.  The tmpdir technique
  //(above) depends upon the naming scheme that Tomcat uses.
  String path = context.getResource("/").getPath();
  //first remove trailing slash, then take what's left over
  //which should be the context path less the preceeding
  //slash such as "MyContext"
  contextPath = path.substring(0, path.lastIndexOf("/"));
  contextPath =
contextPath.substring(contextPath.lastIndexOf("/") + 1);
I use that to create an environment variable based on the name of the 
context because I can reference this predictable and unique name in my 
log4j properties file without having to specify it multiple places and have 
to remember to update it all the time...

 logHomePropName = contextPath + ".log.home";

Jake

At 02:34 PM 1/7/2004 -0500, you wrote:

Howdy,

>Will it's inclusion encourage programmers to
>start building bad apps (no, I think.)
FYI, aside from the issue of developer versus deployer, I strongly
disagree with the above: adding anything that encourages bad practices
is a bad idea.  It'll be like another ServletRequest#getRealPath call,
which has been a disaster for years now.  Thankfully it was deprecated
as soon as possible in version 2.1 of the spec, but still it haunts us
and it has caused many bad implementations.
Yoav Shapira



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

-
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]


Re: Best practices - doing code pushes

2004-01-07 Thread Jacob Kjome
At 03:29 PM 1/7/2004 -0700, you wrote:
I have a question about how to load a new application w/o interruption of
service.
What do others do to remove/reduce service interruption when doing a new
code push?
I would like to be able to push new code for new Axis services w/o having to
kill any service requests currently being serviced, and pick up the new code
for any new incoming requests. Is this possible?
There's a new "pause" parameter for the manager deploy servlet which should 
do what you require...
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Deploy%20A%20New%20Application%20Remotely

Jake 

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


Re: Tomcat and Apache on Separate servers

2004-01-05 Thread Jacob Kjome
At 01:36 AM 1/6/2004 -0500, you wrote:

Hi All,

I have what I hope will be a simple question.  I have 2 Win 2K boxes.  One
running Tomcat and the other Apache.
How do I deploy a web app on the Tomcat server and configure it to talk to
the Apache web server on a completely separate box.
Do I need to configure both ends?  Does it make sense to split the boxes
this way just to have Apache server static files?
Here's a copy of information from the list a while back.  I would post the 
url to the archived message, but I don't have that at the 
moment.  Attribution of this solution goes to the original poster, not 
myself...

Here it goes.

Machine  A (Apache), Machine B (tomcat)
-
httpd.conf changes...
-
Below # LoadModule foo_module modules/mod_foo.so
Add following lines
#
# Load mod_jk
#
 LoadModule jk_module libexec/mod_jk.so
#
# Configure mod_jk
#
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
Below DocumentRoot "/usr/local/apache/htdocs"

Add following lines...

JkMount /examples ajp13
JkMount /examples/* ajp13
(if you want to configure a application examples running under webapps
on tomcat, just specify  /examples, you need not sepcify the full path
of the application)
Then create workers.properties under $Apache_Home$/conf/  like this

# In Unix, we use forward slashes:
ps=/
# list the workers by name
worker.list=ajp13
#
worker.ajp13.port=8009(ajp13 port from server.xml on tomcat machine)
worker.ajp13.host=hostname(Machine B)
worker.ajp13.type=ajp13
(no need to define tomcat_home and java_home parameters here, you define
them on catalina.sh on tomcat machine)
this is all you need to do on apache machine...

server.xml changes on  Machine B(tomcat machine)
--
Set the required environment variables JAVA_HOME AND CATALINA_HOME in
$TOMCAT_HOME$/bin/catalina.sh
Commen out the Standalone HTTP port(port 8080) Connector.


Also Comment out the WARP connector

  

Change the both the  Tag and  tag defaultHost to tomcat
hostName(ex: tomcat.apache.com)
(This should match with your workers.properties host name.)

  
  

start tomcat and apache, you should be able to access examples from
apache machine
I have pretty much followed the http://www.ubeans.com/tomcat/
documentation..many many thanks to Pascal Forget.
Let me know, how it goes...

-Raj




Thanks for your time,

Regards
Tomcat-Apache "Newbie"
-
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]


Re: getRemoteUser null

2004-01-05 Thread Jacob Kjome

You have to tell Tomcat whether to get BASIC Auth remote user information from 
the connector (Apache) or from Tomcat itself.  See the following for details...

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12196

Jake

Quoting Howard Watson <[EMAIL PROTECTED]>:

> Additional Info:
> 
> Enumerate HeaderNames
> ===
> host : myServer:port
> user-agent : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5)
> Gecko/20031007 Firebird/0.7
> accept :
> 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,
video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
> accept-language : en-us,en;q=0.5
> accept-encoding : gzip,deflate
> accept-charset : ISO-8859-1,utf-8;q=0.7,*;q=0.7
> keep-alive : 300
> connection : keep-alive
> cookie : JSESSIONID=8E46392BD10C29E8DCF62E608D81DF5F
> authorization : Basic aG93YXJkdzphdXRoZW50aWNhdGVtZQ==
> cache-control : max-age=0
> content-length : 0
> =
> End Request Headers
> 
> request.getAuthType() returns null
> request.getRemoteUser() returns null
> 
> End Additional Info
> 
> >>> [EMAIL PROTECTED] 12/31/03 12:03PM >>>
> Original message reformatted to match message posted at ApacheUser.
> 
> Porting web application from Apache1.3/Tomcat3.3.
> Before stumbling on this partial fix all my JSPs and servlets returned
> getRemoteUser null. This fix works for JSPs but doesn't help much for
> servlets.
> 
> Apache2.0.48
> Tomcat4.1.29
> mod_jk1.2.5
> jvm1.4.1_02a
> 
> Does anyone have any idea why a JSP referenced by name in a url would return
> getRemoteUser = null and the same JSP referenced through DirectoryIndex in
> Apache2 would return getRemoteUser = expected user name.
> 
> Example:
> http://serverAddr/DisplayUser.jsp returns null
> 
> In Apache conf
> DirectoryIndex DisplayUser.jsp
> 
> http://serverAddr/ returns DisplayUser.jsp with user name
> 
> 
> -
> 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]

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



<    1   2   3   4   5   6   7   8   9   10   >