RE: please help me

2002-11-22 Thread Michael Echerer
To use servlets you will need a servlet container/webserver like Tomcat. To compile 
servlets some .jar files from Tomcat are necessary. You have to add this to your 
classpath or use ant scripts whatever.

In your case I guess that servlet.jar from /tomcat/common/lib/ is missing in your 
classpath when your try to compile your servlet classes. 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: TC/Apache session tracking

2002-12-04 Thread Michael Echerer
I'm not sure if that problem is connected to mod_jk2.
There are four ways for session tracking.
SSL, hidden form fields, url rewriting or cookies.
Tomcat can use certain methods mostly transparent if necessary e.g. if cookies are 
disabled then url rewriting is in use.
I guess your session info should be lost whenever you use static html files at least 
if you don't allow cookies.
Why not take jsp pages instead as they maintain the session info. As far as I know 
there's no safe way to mix jsp/servlet sessions with static ressources. 
Only with cookies I could imagine that it stays persistent, but I guess you get into 
trouble because cookies are set in the https headers before any response is generated, 
thus they can never be set by any included page.

mech

> -Original Message-
> From: Matt Sales [mailto:[EMAIL PROTECTED]] 
> Sent: Mittwoch, 4. Dezember 2002 20:19
> To: Tomcat Users List
> Subject: TC/Apache session tracking
> 
> 
> Hello,
> I've got a problem tracking sessions from Tomcat 4.1.12/Apache 2.0.40.
> 
> I can do all of the regular session stuff within Tomcat, but 
> when I include a tomcat page in a static html page, sessions 
> are not persisted.  I'm using mod_jk2 to connect the two...
> 
> ex:
> 
> 
> I get the output from myServlet, but every pass of the
> session.isNew()
> method returns true.
> 
> The sessions don't persist even if I include two servlets 
> from the same .shtml page.  This can't be right...  Is there 
> a setting I'm missing?
> 
> Thanks in advance,
> Matt
> 
> 
> --
> To unsubscribe, e-mail:   
>  [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: 
> 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Hot (re-)deployment with .war files

2002-12-05 Thread Michael Echerer
Hello,

I use Tomcat 4.1.16 on Windows with Eclipse 2.0 and the Lomboz 0.95 J2EE plugin for 
Tomcat integration.

I have a problem with auto deployment.
When I start Tomcat from the Eclipse I can deploy the webapp. It will be packed into a 
war file and copied into Tomcat's webapps directory, will be unpacked from Tomcat and 
everythings fine.
My problem is that when I undeploy the webapp (delete the .war file) and deploy it 
again no update occurs.
First I thought I should also delete the unpacked war's directory, because it's said 
in the documentation that .wars are only unpacked if no unpacked dir exists, but it 
didn't help.
Even if I delete .war and its unpacked directory Tomcat won't redeploy the war file 
when my IDE copies the .war into /webapps. No unpacked directory is created in this 
case and thus no I get no updated pages.

So actually Tomcat neither unpacks nor autodeploys .war files that are copied into 
/webapps when I do that for the second time. Completely removing the webapp doesn't 
allow redeployment.

Is there any way to allow hot redeployment with .war?
Currently I'm using the standard server.xml setting. So liveDeploy, autoDeploy, 
unpackwars etc. is set "true".

Thx
mech





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Session timeout

2002-12-16 Thread Michael Echerer
I guess you should have a look into
javax.servlet.http.HttpSessionBindingListener and .HttpSessionEvent to
monitor if a session is created or destroyed.

> -Original Message-
> From: Lindomar [mailto:[EMAIL PROTECTED]] 
> Sent: Montag, 16. Dezember 2002 14:00
> To: Tomcat Users List
> Subject: Session timeout
> 
> 
> Hi everybody!
> 
> How can i create a process exactly after session  timeout or 
> user invalidate the session? Is it possible? I think yes, but 
> i didn't find how do it yet...
> 
> Can anybody give me any idea ?
> 
> Thanks in advanced.
> 
> 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Retrieve User - Realm

2002-12-16 Thread Michael Echerer
> 
> More specifically, he may be looking for:
> 
> request.getUserPrincipal().getName(), which returns the 
> actual user name.
> 
> I believe that request.getRemoteUser() only returns the 
> username if the 
> user is authenticated using BASIC authentication.

Actually not true, although I don't say I got the whole difference between Principal 
and RemoteUser in practical terms. What is it? ;-)

request.getRemoteUser() also works with form based authentication as it mimics basic 
auth.
Have a look for tomcat's examples app under jsp/security/protected. 
Both methods show the same user name and it is also stored in the realm like basic 
auth does as you can see if you have a look after login using the examples' snoop.jsp.






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Virtual Hosting with Tomcat

2002-12-31 Thread Michael Echerer
> address with your info.  However the other issue exists.  I 
> have tried different variations of the context path but none 
> seem to work.  Still hammering at it.
> 
Not yet struggled with virtual hosts, but...

Do you have a ROOT.WAR or ROOT directory in your webapps dir?
Maybe this could conflict with your context path setting as the ROOT application is 
mapped by default to "/".

I bet you have a ROOT already because you mentioned before to see the Tomcat intro 
pages... 

And/or try to set:



Michael

P.S. BTW you could instead of setting a context path simple rename your "webtop" 
directory to "ROOT". 






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Apache 2.0.49/mod_jk2.02 doesn't distribute load evenly to 2x Tomcat5.0.19 under high load.

2004-06-01 Thread Michael Echerer
Hello,

I stumbled upon a serious issue with the load balancing of mod_jk2. Currently
I'm doing load testing with The Grinder. My config is: 1x Apache 2.0.49
compiled with openssl (rest is default, prefork, etc.). mod_jk2.0.2 and 2x
Tomcat 5.0.19 on Solaris 2.8.

With The Grinder I put a high load (100 threads+) on Apache using one of our
servlets (no sessions) that uses a corba connection (thus generally slow,
2sec/request if no load). With so many concurrent requests the servlet may take
1 minute to respond. :-(

Worse enough, but during loadbalance tests I figured out that mod_jk2 doesn't
distribute evenly under high load. Round-robin doesn't seem to work anymore.

ALL requests to that servlet get routed to only one Tomcat which ajp13 queue
gets filled up until Apache throws mod_jk2 errors. The other Tomcat is idle.
You can see in the Tomcat access logs that nothing is routed there.
Second I added a second page to my grinder page (the tomcat-docs/index.html)
which is definitely stateless. Result: ALL servlet requests go to one Tomcat,
ALL docu requests go to the other Tomcat.

Seems like Apache/mod_jk2 routes requests to the same Tomcat it for the previous
request instead of a true round-robin. In effect: under high load this means
that Apache doesn't balance anymore but just fills up a Tomcat's queue until
it's full while other Tomcats are idle.

It seems similar to this production issue:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg109910.html

But I didn't see a solution for it.

I could reproduce this problem in the browser, too. If you trigger this
long-running servlet with a little break the requests are evenly in both
Tomcat's access logs. If you hit the browser reload button too fast all
requests go to one Tomcat. No round-robin any more!

I don't believe it's a mod_jk2 workers2.properties or httpd.conf issue since I
played around much with it. No effect.

Anyone saw similar problems with mod_jk2 under heavy load? Any suggestions?
Is this a known bug, or should I open a new one because load balancing is
useless if it fails exactly during high load and distributes only fine while
you don't need it?

Thanks
Michael

P.S. If you need my config files please let me know, as I don't want to clutter
this mail right now.




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



Re: Using Tomcat's HTTP processor and SSL

2004-06-12 Thread Michael Echerer

Jim Kennedy wrote:
I am considering using Tomcat alone as my HTTP server as well as my servlet
container with SSL.  I know a lot of people use Apache HTTP Server instead
of Tomcat for this and Tomcat is just the servlet container only.
Is there any reason why I should not use just Tomcat alone for this.  I'm
actually using JBOSS with Tomcat, but Tomcat still handles the HTTP
requests.  I have no static pages on my site.
Seems like a hassle to configure a separate server (Apache HTTP) when I
don't have to.
In case you don't need loadbalacing, you can live without Apache in that 
scenario.
Also, are there any difficulties configuring Tomcat with SSL?
It's not more difficult than using Apache. I would say it's even easier 
to setup Tomcat than Apache for SSL.

But note: You should NOT use Tomcat+SSL, if you expect high HTTPS load. 
Standard Java&SSL is not too fast. In my load tests Apache/Tomcat is 
much faster for HTTPS than standalone Tomcat HTTPS, but it doesn't make 
a difference for HTTP (at least as long as you also have dynamic content).
Thanks for any help or suggestions.

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


Re: Stop Tomcat over non-SSL connection with Apache2/JK2

2004-06-12 Thread Michael Echerer

Gordon Ross wrote:
The problem, is that I do *NOT* want the webapp available over the
non-SSL connection.
In the  section in Apache 2 where I defined the SSL
VirtualHost, I put a JkUriSet command, but the tomcat apps were still
available over port 80 (non-SSL) - even though there was no other
mention of tomcat elsewhere in the Apache config - or anything in
workers2.properties.
I had the same problem. Guess the virtual host support is not as good in 
connection with JkUriSet as we thought.
I also tried to put some Mappings in http vhost only, some only https 
vhost. But JkUriSet seemed to ignore that.
What do I need to do to only have tomcat apps available over SSL ?
The solution is that you explicitly deny the UriMappings in your http 
vhost as Apache will block them before mod_jk comes in.
e.g. something like

Order Deny,Allow
Deny from All


but check the Apache documentation for details.

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


Re: JK2: lb_factor

2004-06-17 Thread Michael Echerer
I measured similar effects using "The Grinder".
Under maximum load with long running requests it can be even that worse 
that one Apache 2.x (default compile: prefork) with 2 Tomcats 
5.x/mod_jk2 only distributes to the first Tomcat at all.
This is true as long as Apache runs out of MaxClients because of the 
concurrent requests. Then, for some reason, Apache starts to distribute 
also some load to the second Apache.
So it might help if you lower MaxClients (this seems the only thing that 
has an direct effect, not lb_factor, not ajp13 threads or anything else) 
to force this earlier, but be aware that this might produce errors if 
you get much more requests that then can't be queued anymore.

I suppose Apache prefork and worker communication via shared memory by 
mod_jk2 don't work well together, or the don't work at all for true 
round robin. Putting more than 2 Tomcats won't help with high load. I 
once had 10 Tomcats, but in the end only the first few got most of the 
load, Tomcat No 7-10 almost nothing.

I also heard that Apache MPM may help, but didn't try yet. So either I 
forget something in my config, I have to use MPM (although nothing is 
really mentioned about those issues in the docu), or mod_jk2 is really 
not too good in this area.

Last advice: If you have that option to use a hardware router than I'd 
suggest to use more Apaches with only one Tomcat behind each of them. 
This will definitely work best as those routers do a true round robin.

Ralph Einfeldt wrote:
The quality of the distribution depends on the worker type 
of apache. (AFAIK only the 'worker' MPM will work)

Nevertheless AFAIK the load balancing in mod_jk is not 
complete in this area, so I'm not shure if you will get 
the desired distribution (but it should be closer).


-Original Message-
From: Weseloh, Nicole [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 11:48 AM
To: [EMAIL PROTECTED]
Subject: JK2: lb_factor
I've got a cluster with 2 tomcat 2.0.25 on different 
machines, on one of them also running Apache 2.0.49 with JK2 
as a loadbalancer. Requests get redirected to both tomcat instances, 
but it always ends up with around 1/3 of all requests at the local 
server and about 2/3 at the remote one, no matter what value the 
lb_factors are.

So, could anyone tell me which values I should use to make 
the lb_factor work correctly? All information I found was that 
"a lower value means more requests" (official JK2-documentation 
at jakarta.apache.org). 



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

--
Dipl.-Inf. (FH) Michael Echerer
TNG Technology Consulting GmbH, http://www.tngtech.com
Betastr. 13a, 85774 Unterföhring bei München,
Tel. +49 89 2158996-0, Fax. +49 89 2158996-9, Mobile +49 176 20088854
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JK2: lb_factor

2004-06-18 Thread Michael Echerer

Kommuru, Bhaskar wrote:
Thanks for you comments Michael, 
So mod_jk2.0.4 does not still seem to be a production quality software. It
doesnot work the way it is supposed to work as the documentation. I have
spent already a lot of time on this. 
Actually the 10 Tomcat scenario I mentioned was with mod_jk1.x.y and 
Apache 2.0.46 (also prefork). I did it merely to verify a new mod_jk2 
setup vs. an existing one. Finally I found out that the old setup with 
mod_jk1 didn't work either. ;-) Why did I start digging...
I just want to confirm one thing here that it works and no matter what your
settings are :--(
By the way... The issue with remote and local workers, can be solved.
You have to set the level attribute for each channel in your 
workers2.properties:

take for local workers:
level=0
for remote workers:
level=1
Usually you will set this for all your channels vice versa on e.g. two 
Apache machines (each with e.g. 2 local Tomcats and 2 remote Tomcats).
In front of the 2 Apaches you could have a hardware lb.

The effect is that (each) Apache will only serve its local workers 
according to its workers2.properties until (here: both!) all local 
Tomcats are offline. So in this respect to mod_jk2 docu is quite okay. 
At least this part of the config works for me. I did't that any 
lb_factor for the channels, only level to achieve this local/remote 
distribution.

If you don't like this you have to set the level equally for all your 
Tomcat channels. Guess the local/remote levels are mainly to save some 
bandwith.

Michael
P.S. Until now I still think, that the best approach would be to try the 
 MPM worker, instead prefork and check whether this has really a 
positve effect. Any volunteers for compiling Apache 2.x 
"--with-mpm=worker" and trying this?

If you know any links which tells more details on this, Please let me know.
Regards,
Bhaskar
-Original Message-----
From: Michael Echerer [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 9:08 PM
To: Tomcat Users List
Subject: Re: JK2: lb_factor
I measured similar effects using "The Grinder".
Under maximum load with long running requests it can be even that worse 
that one Apache 2.x (default compile: prefork) with 2 Tomcats 
5.x/mod_jk2 only distributes to the first Tomcat at all.
This is true as long as Apache runs out of MaxClients because of the 
concurrent requests. Then, for some reason, Apache starts to distribute 
also some load to the second Apache.
So it might help if you lower MaxClients (this seems the only thing that 
has an direct effect, not lb_factor, not ajp13 threads or anything else) 
to force this earlier, but be aware that this might produce errors if 
you get much more requests that then can't be queued anymore.

I suppose Apache prefork and worker communication via shared memory by 
mod_jk2 don't work well together, or the don't work at all for true 
round robin. Putting more than 2 Tomcats won't help with high load. I 
once had 10 Tomcats, but in the end only the first few got most of the 
load, Tomcat No 7-10 almost nothing.

I also heard that Apache MPM may help, but didn't try yet. So either I 
forget something in my config, I have to use MPM (although nothing is 
really mentioned about those issues in the docu), or mod_jk2 is really 
not too good in this area.

Last advice: If you have that option to use a hardware router than I'd 
suggest to use more Apaches with only one Tomcat behind each of them. 
This will definitely work best as those routers do a true round robin.

Ralph Einfeldt wrote:
The quality of the distribution depends on the worker type 
of apache. (AFAIK only the 'worker' MPM will work)

Nevertheless AFAIK the load balancing in mod_jk is not 
complete in this area, so I'm not shure if you will get 
the desired distribution (but it should be closer).


-Original Message-
From: Weseloh, Nicole [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 11:48 AM
To: [EMAIL PROTECTED]
Subject: JK2: lb_factor
I've got a cluster with 2 tomcat 2.0.25 on different 
machines, on one of them also running Apache 2.0.49 with JK2 
as a loadbalancer. Requests get redirected to both tomcat instances, 
but it always ends up with around 1/3 of all requests at the local 
server and about 2/3 at the remote one, no matter what value the 
lb_factors are.

So, could anyone tell me which values I should use to make 
the lb_factor work correctly? All information I found was that 
"a lower value means more requests" (official JK2-documentation 
at jakarta.apache.org). 



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


Is crossContext conform to the Servlet API?

2004-06-26 Thread Michael Echerer
Hi,
short question:
Is the crossContext attibute for contexts (or better the mechanismn 
behind) part of the Servlet API or is it a Tomcat specific feature that 
you couldn't use on other servers.

I just wondered if you would tie your application/setup to Tomcat when 
using a crosscontext webapp to by shared by several other webapps.

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


Re: question on tomcat's JSESSIONID

2004-07-03 Thread Michael Echerer

[EMAIL PROTECTED] wrote:
Hi,
I have 2 questions regarding tomcat:
1- I am wondering if it is possible to rename the JSESSIONID cookie to 
something else. I am interseted in renaming it __JSESSIONID 
this way JSESSION ids generated by webservers on the same domain 
(domain.com) will not conflict with each other. (I have a special setup 
with a portal webserver which relays cookies to other webservers in the 
same domain)
I know this can be done with WebLogic : you can customize the name of 
the JSESSIONID cookie in weblogic.xml. Is it possible to do this with 
tomcat?
Of course you could change the source. I doubt this cookie name can be 
configured.

Due to cookie domain conflict with the JSESSIONID of two servers we once 
patched the Tomcat binaries directly.
Just search in \server\lib jars for classes (as far as I remember there 
are only 2-3 .class files that need to be patched) with the string 
JSESSIONID, take a hex editor and set it to JSESS123ID for example. Put 
the patched class files back into the jars etc.
Make sure that the string has the same length as the original cookie name!

Kind of a hack, but it works!
Greetings
Michael
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat5 & Log4j "non-meaningful" thread names in loadbalanced environment vs. Tomcat4

2004-07-21 Thread Michael Echerer
Hi all,

i have been using Tomcat 4.x for quite a while and was using log4j for logging
purposes with a log4j pattern like this:

log4j.appender.logfile.layout.ConversionPattern=%-10r [%t] %d{ISO8601} %-5p %c
%x - %m%n


In Tomcat4.x with mod_jk1.x the thread names for [%t] I got looked like:

 [Ajp13Processor[9506][18]]

which is obviously quite meaningful, because you can not only see the thread
number, but also which ajp processor was used as you can see the port 9506,
too.
This is quite helpful, if you have a loadbalanced environment and all your log
messages are written to one single log file as you an see which Tomcat was
involved.

Since I'm running Tomcat 5.0.19 with mod_jk2.x, I only get for [%t]:

 [TP-Processor2]

Thus I can only see the thread number, but have not clue which Tomcat was
affected.

Is this because the naming scheme for threads changed in Tomcat 5 or is it
because I forgot to configure something in my Tomcat 5 setup?

I have no idea how to get my favorable port:thread number information back in my
logs. Anything I can do about this?

Hope you can help!

Thanks
Michael

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



Is the Tomcat5 documentation correct for this?

2004-07-24 Thread Michael Echerer
Hi,
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
says:
"Pathname to a scratch directory to be provided by this Context for 
temporary read-write use by servlets within the associated web 
application. This directory will be made visible to servlets in the web 
application by a servlet context attribute (of type java.io.File) named 
javax.servlet.context.tempdir as described in the Servlet Specification. 
If not specified, a suitable directory underneath $CATALINA_HOME/work 
will be provided."

I have a setup where I have multiple Tomcat instances using the same 
$CATALINA_HOME, but each get's a different $CATALINA_BASE set on startup.

For each Tomcat instance I have a work directory below $CATALINA_BASE, 
not a combined one for all instances in my binaries CATALINA_HOME.
I doubt it would work if \work\Catalina\localhost has e.g. the temp jsp 
class files of all Tomcat instances.

So I guess it must be:
"If not specified, a suitable directory underneath $CATALINA_BASE/work 
will be provided."

Greetings
Michael

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


Re: Is the Tomcat5 documentation correct for this?

2004-07-24 Thread Michael Echerer
Ignore this... I skipped reading this part:
"The description below uses the variable name $CATALINA_HOME to refer to 
the directory into which you have installed Tomcat 5, and is the base 
directory against which most relative paths are resolved. However, if 
you have configured Tomcat 5 for multiple instances by setting a 
CATALINA_BASE directory, you should use $CATALINA_BASE instead of 
$CATALINA_HOME for each of these references."

:)
Michael Echerer wrote:
Hi,
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html
says:
"Pathname to a scratch directory to be provided by this Context for 
temporary read-write use by servlets within the associated web 
application. This directory will be made visible to servlets in the web 
application by a servlet context attribute (of type java.io.File) named 
javax.servlet.context.tempdir as described in the Servlet Specification. 
If not specified, a suitable directory underneath $CATALINA_HOME/work 
will be provided."

I have a setup where I have multiple Tomcat instances using the same 
$CATALINA_HOME, but each get's a different $CATALINA_BASE set on startup.

For each Tomcat instance I have a work directory below $CATALINA_BASE, 
not a combined one for all instances in my binaries CATALINA_HOME.
I doubt it would work if \work\Catalina\localhost has e.g. the temp jsp 
class files of all Tomcat instances.

So I guess it must be:
"If not specified, a suitable directory underneath $CATALINA_BASE/work 
will be provided."

Greetings
Michael

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

--
Dipl.-Inf. (FH) Michael Echerer
TNG Technology Consulting GmbH, http://www.tngtech.com
Betastr. 13a, 85774 Unterföhring bei München,
Tel. +49 89 2158996-0, Fax. +49 89 2158996-9, Mobile +49 176 20088854
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to hide the JDBCRealm password from server.xml

2004-07-27 Thread Michael Echerer

QM wrote:
On Tue, Jul 27, 2004 at 05:42:51PM -0300, Claudio Carvalho wrote:
: Does anybody know how to  hide the JDBCRealm password from server.xml?
1/ This has been discussed before on the list.  (aka, check the archives.)
The quick answer is:
protect you Tomcat's server.xml from being read by unauthorized users. 
If only you as Tomcat admin are allowed to read the file, there's no 
problem in having the passwort in clear text. So this is operating 
system level security and has nothing to do with Tomcat.
2/ Please start new messages when you post to the list.  Replying to an
old message plays hell with thread-aware mailers, making such posts
harder to find (and, therefore, harder to answer).
dito
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [tomcat] Re: Understanding tomcat web administration tool.

2004-08-01 Thread Michael Echerer

And when examining  localhost_log.2004-08-01.txt
I see these errors:
2004-08-01 04:20:52 StandardHost[localhost]: Error deploying 
application at context path null
java.lang.IllegalStateException: Context path /admin is already in use

2004-08-01 04:20:52 HostConfig[localhost] Error deploying 
configuration descriptor adminsample.xml
java.io.IOException: java.lang.IllegalStateException: Context path 
/admin is already in use
This looks like the admin context was not deployed properly or you try 
to deploy it twice.
What is this adminsample.xml? You should get it removed. Check your 
conf/Catalina/localhost/ xml deployment descriptor files. Looks like you 
try to deploy something twice in the admin context.

Maybe it's also a good idea if you try to start over with a fresh tomcat 
installation and only adjust the tomcat-users.xml again.
This adminsample.xml must be something custom, so I guess you messed 
something up already that makes trouble.

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


Using a META-INF\context.xml doesn't work as expected with Manager app .war upload

2004-08-09 Thread Michael Echerer

Hi,

I use Tomcat 5.0.19.

I'm playing around with the Manager web application and want to deploy a .WAR
file that contains a META-INF\context.xml deployment descriptor.

Deploying the .WAR file using the upload feature works, and the context.xml that
I put into the META-INF\ is copied (but renamed?! to utility.xml) to
conf\Catalina\localhost as expected.

The problem is that I provide this context.xml:



So I would suggest that the .WAR file is uploaded and unpacked to
webapps/tests/utility. But it is not! It's straightforward unpacked to
/webapps/utility.
Finally the docBase in utility.xml (alias context.xml) doesn't match the real
location. :-( Thus the context is not accessible.

Is this the expected result?
Is it only possible to deploy a context directly to webapps when using the
manager application and the META-INF\context.xml? - Or am I missing something.

Hope you can help!

Thanks
Michael


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



RE: Using a META-INF\context.xml doesn't work as expected with Manager app .war upload

2004-08-09 Thread Michael Echerer
Hi!

That means, there is no point in trying to put a
docBase path into a \META-INF\context.xml of a .WAR that doesn't match the war's
filename. Correct?

That is because I just tried to name my .war file "utility2.war" an still map to
docBase "utility" that didn't work either... But would be logically considering
your statement, although it's not about "nested" docBase, but any docBase that
doesn't match the war's filename.

Will at least the rest of the context.xml  element propertly used, when
providing e.g. cookies="false" or debug=""?

Thx & Cheers,
Michael

Zitat von "Shapira, Yoav" <[EMAIL PROTECTED]>:

>
> Hi,
> I don't think we support a nested docBase when using a WAR file, such as
> tests/whatever.  The WAR itself is the docBase if packed, or the WAR's
> root directory if unpacked.
>
> Yoav Shapira
> Millennium Research Informatics
>
>
> >-Original Message-
> >From: Michael Echerer [mailto:[EMAIL PROTECTED]
> >Sent: Monday, August 09, 2004 11:59 AM
> >To: [EMAIL PROTECTED]
> >Subject: Using a META-INF\context.xml doesn't work as expected with
> Manager
> >app .war upload
> >
> >
> >Hi,
> >
> >I use Tomcat 5.0.19.
> >
> >I'm playing around with the Manager web application and want to deploy
> a
> >.WAR
> >file that contains a META-INF\context.xml deployment descriptor.
> >
> >Deploying the .WAR file using the upload feature works, and the
> context.xml
> >that
> >I put into the META-INF\ is copied (but renamed?! to utility.xml) to
> >conf\Catalina\localhost as expected.
> >
> >The problem is that I provide this context.xml:
> >
> >
> >
> >So I would suggest that the .WAR file is uploaded and unpacked to
> >webapps/tests/utility. But it is not! It's straightforward unpacked to
> >/webapps/utility.
> >Finally the docBase in utility.xml (alias context.xml) doesn't match
> the
> >real
> >location. :-( Thus the context is not accessible.
> >
> >Is this the expected result?
> >Is it only possible to deploy a context directly to webapps when using
> the
> >manager application and the META-INF\context.xml? - Or am I missing
> >something.
> >
> >Hope you can help!
> >
> >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]



Re: Tomcat clustering

2004-08-18 Thread Michael Echerer

Srinivas Rao Ch wrote:
I am getting problems in configuring my tomcat for clustering. Nodes are not
recognizing each other. "mcastAddr" has the same IP for all the nodes. Can
someone tell what this property is for. My tcpListenAddress is 127.0.0.1 for
all the nodes but port is different. In my rules.xml in the Load Balancer, I
am giving the machine names for "tcpListenAddress".
Still it is not working. Is there anything to be done. Why my nodes are not
recognizing each other. I appreciate any help.
I remember that on WindowsXP the integrated Firewall, if enabled, is a 
show stopper.
Try to - temporarily - disable it on all network interfaces and start 
your Tomcats again.

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


Re: application deploys twice

2004-08-20 Thread Michael Echerer

Jignesh Patel wrote:
Hi All,
We are using tomcat5.0.19 and struts1.1.
Whenever we deploys our application it deploys twice.
We couldn't able to identify the reason, why this is happening.
Can anybody give insight to us.
We are not deploying war file as well as we are not deploying in server
we are setting context path in server.xml.
Is autoDeploy and loadOnStartup true in your host setting in server.xml?
If yes, a context directory inside the webapps dir gets deployed by the 
loadOnStartup mechanismn aswell as the context descriptor. This can 
result in duplicated deployments.

Did you check if you have a deployment descriptor .xml file in 
conf/Catalina/localhost that is duplicated?

BTW. You should not define contexts in server.xml. Use the 
conf/Catalina/localhost directory for deployments.

Greetings
Michael
-Jignesh
-
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: Name jdbc is not bound in this Context

2004-10-09 Thread Michael Echerer
If you put the ResourceParams stuff in server.xml as GlobalResource,
you must put e.g. this into your server.xml's context respectively your 
myapp.xml context descriptor.



Of course name and global can differ, but I think this is easiest.
There's some hint in the Tomcat 5 docu that this is needed to make 
global JNDI resources visible to web apps. But it's too easy to forget...

Cheers,
Michael
Mauro Romano Trajber wrote:
I have configured the following datasource in
$TOMCAT_HOME/conf/Catalina/localhost/myapp.xml:



factoryorg.apache.commons.dbcp.BasicDataSourceFactory
driverClassNamecom.mysql.jdbc.Driver
urljdbc:mysql://localhost/myappt
...


Then in my web.xml:
...

jdbc/myapp
javax.sql.DataSource
Container

...
I'm trying to use Hibernate throung Hibernate Synchronizer Eclipse
Plugin, using JNDI. But I keep getting the error:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
What's missing ?
-
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: Rename jsessionid

2004-10-09 Thread Michael Echerer
Built Tomcat from source and change the few java class files where 
jsessionid is in.

What we once did: Patch the binary! :-)
you can grep for jsessionid in the tomcat jars somewere in server/lib 
(don't ask me which, but 1 think in 2-3 jars there was 1 class file each)

You may simple replace the string in the binaries with a different one. 
But then you must make sure that the new id string has the same length 
(otherwise you would corrupt the class file).

thus "jsessionid" could be renamed to "mycustomid" using the binary 
patching, but not to "sid". If you want this... use the source.

Cheers,
Michael
Ben wrote:
How can I use a different name for the session id?
I would like to use:
SID=27D2A9CA7006C94A9CAAE1D96D4D39BD
instead of:
jsessionid=27D2A9CA7006C94A9CAAE1D96D4D39BD
Thanks
-
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: META-INF/context.xml not overwriting Catalina/localhost/webapp.xml after redeploy.

2004-11-06 Thread Michael Echerer

Steve Kirk wrote:
Remy mentioned earlier today on another thread that the path is ignored in a
context.xml file because it is redundant, but I _think_ he was talking about
5.5 rather than 5.0.  I have deleted the post now but I think he said that
the docBase is probably also ignored.  search the archive to check me on
that.
Well, the "path" of  is ignored when deploying a .WAR file with 
META-INF/context.xml, because Tomcat 5.x (not yet tried 5.5, but I think 
 this behaviour was even in Tomcat 4.x) takes the .war's file name as 
context path. There is no way to change this, I tried it, didn't work.



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


Re: Doubts with tomcat

2004-11-07 Thread Michael Echerer

1) When I start tomcat with above server.xml , it creates 9 process with same output on shell. it is 
I configured tomcat to run with minSpareThreads="5" then why it start with 9 threads?
You configured 5 connector threads that not necessarily match OS threads 
(or whatever you saw). Check with Tomcat's manager application how many 
connector threads you really have.
2) In tomcat , port 8080 is redirected to SSL port 8443. Why NON-SSL port is redited to SSL port?
That's used, if one of your webapps has a security constraint (can be 
done in the web.xml) saying that this app (or some of its resources) may 
only be accessed using https. In that case, if Tomcat receives a http 
request it will automatically redirect the browser to the same resource, 
but using https scheme and using the mentioned redirect ports. Thus you 
won't have to do ugly port number hardcoding into your app (or other 
strange approaches), if you need to support https.
Please help me to understand these basics.
Hope I could help.
Michael
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Why JNDI ResourceLink not resolved, if .war file name doesn't match context path in Tomcat 5.0.28 ?

2004-11-10 Thread Michael Echerer


Hi,

we have an application that we deploy as .WAR file on Tomcat 5.0.28.
It has a META-INF/context.xml with this content:





If our .war file is named "foo.war" our JNDI link is properly found, db init ok.
The .war is uncompressed to /foo in webapps and the context path (as seen in
manager app is /foo)

But if we name our .war to "bar.war" our JNDI link does *not* work anymore, if
we still use path="/foo" in the context deployment descriptor in
META-INF/context.xml.

Our .WAR is uncompressed to /bar, because docBase is ignored ihmo anyway (and
the war name is taken), but the context path in the manager app is /foo as it's
set in the context.xml.

I suppose that this is a bug, because I do not see a reason why a ResourceLink
should be visible only if the .war name resp. the webapps dir name match the
deployment descriptor's path. Can anyone confirm this or explain this behaviour
to me?

---

Moreover wouldn't it be a good idea to have the 's "path" attribute
optional when using META-INF/context.xml and use the war file name as default
context path?

Of course, in some cases you might want to explicitely set a context path that
is different from the war name. But it might also be very neat, if one could
simple have an ant script that creates one single war file from the code, you
just rename it as you like, deploy it with the manager app and the whole other
setup is done automatically? Otherwise the ant script always need to replace
the context.xml file according to the war and context path. This is at least
something we would find useful for having multiple contexts for testing on one
machine that you can still simple drop in with the manager app.

Cheers,
Michael






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



Re: Mysql: Cannot create JDBC driver

2004-11-28 Thread Michael Echerer
javax.servlet.ServletException: Cannot create JDBC driver of class ''
for connect URL 'null', cause: No suitable driver
Typically this just means that the JNDI name could not be resolved. Thus 
no driver is available.
Server.xml:
(...)





factory

org.apache.commons.dbcp.BasicDataSourceFactory


maxActive
10


maxIdle
3


maxWait
20


username
tomcat


password
xxx


driverClassName
com.mysql.jdbc.Driver


url

jdbc:mysql://localhost:3306/bankapp1?autoReconnect=true

 

(...)
I usually put the Resources into the  of the server.xml
And my web.xml:
(...)

jdbc/bankApp1
javax.sql.DataSource
Container

(...)
But if you do this, you'll need a  element in the context, 
otherwise the global JNDI resource won't be visible inside the context.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Common%20Problems

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


"XXX unknowon type 0" in catalina log of Tomcat 5.0.28

2004-12-09 Thread Michael Echerer


Hi,

in our Tomcat 5.0.28 catalina log I've seen the following lines. (see below)
The first part are GC logs, that's okay as it was set in the JVM_OPTS, but the
"XXX unknowon type 0" is quite strange. What's the reason for this. Does anyone
know this kind of error message? I've just found out using google that it's
coming from some kind of Tomcat connector class.
Does it do any harm? What's the reason for this message and how to prevent it?
We have an Apache 2.x, mod_jk2, 2x Tomcat 5.0.28 setup on Solaris 2.9.

Greetings
Michael

 space 322112K, 100% used space 13696K, 99% used space 13696K, 0% used space
699072K, 0% used space 262144K, 20% used s
pace 3776K, 0% used space 332032K, 99% used space 13696K, 0% used space 699072K,
1% used space 262144K, 20% used space
3776K, 100% used space 332032K, 99% used space 13696K, 0% used space 699072K, 1%
used space 262144K, 20% used space 308
288K, 0% used space 20608K, 99% used space 20608K, 0% used space 699072K, 2%
used space 262144K, 20% usedCaused by: Cau
sed by: Caused by: XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
 space 308288K, 100% used space 20608K, 99% used space 20608K, 0% used space
699072K, 2% used space 262144K, 26% used s
pace 3584K, 0% used space 325312K, 99% used space 20608K, 0% used space 699072K,
3% used space 262144K, 26% usedXXX unk
nowon type 0
XXX unknowon type 0
 space 3584K, 100% used space 325312K, 99% used space 20608K, 0% used space
699072K, 3% used space 262144K, 26% used sp
ace 295232K, 0% used space 27136K, 98% used space 27136K, 0% used space 699072K,
3% used space 262144K, 26% usedXXX unk
nowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0
XXX unknowon type 0



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



RE: "XXX unknowon type 0" in catalina log of Tomcat 5.0.28

2004-12-09 Thread Michael Echerer
>
> Hi,
Hi,
> Even thought I don't usually support the connectors, and certainly not
> mod_jk2 (which is now unsupported in case you missed the announcement),
Read this, but currently everything runs smooth except some not really perfectly
1:1 balanced load, thus we'll "migrate back" to mod_jk1.2 later.
> the sheer fascination with this XXX message prompted me to search the
> source code.
>
> The message is from org.apache.tomcat.util.bug.C2BConverter, a utility
There's a package named "bug" in Tomcat... uh... Well, glad to see that you
developer guys concentrate all code bugs in a single package. That's really
cool, I always tried that myself... ;-)
> class used by the connectors.  It's in the jakarta-tomcat-connectors CVS
> module if you're interested.  The message is a DEBUG-level message, so
> it's not a cause for major concern, but curious nonetheless.  It's from
> the convert(MessageBytes) method and occurs when the argument is not
> null, doesn't contain raw bytes, doesn't contain a string, and doesn't
> contain characters.  Cool, huh? ;)
Thanks, then I won't mind this log entry any longer.
Cheers,
Michael
>
> Yoav Shapira http://www.yoavshapira.com
>
>
> >-Original Message-
> >From: Michael Echerer [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, December 09, 2004 9:04 AM
> >To: [EMAIL PROTECTED]
> >Subject: "XXX unknowon type 0" in catalina log of Tomcat 5.0.28
> >
> >
> >
> >Hi,
> >
> >in our Tomcat 5.0.28 catalina log I've seen the following lines. (see
> >below)
> >The first part are GC logs, that's okay as it was set in the JVM_OPTS,
> but
> >the
> >"XXX unknowon type 0" is quite strange. What's the reason for this.
> Does
> >anyone
> >know this kind of error message? I've just found out using google that
> it's
> >coming from some kind of Tomcat connector class.
> >Does it do any harm? What's the reason for this message and how to
> prevent
> >it?
> >We have an Apache 2.x, mod_jk2, 2x Tomcat 5.0.28 setup on Solaris 2.9.
> >
> >Greetings
> >Michael
> >
> > space 322112K, 100% used space 13696K, 99% used space 13696K, 0% used
> >space
> >699072K, 0% used space 262144K, 20% used s
> >pace 3776K, 0% used space 332032K, 99% used space 13696K, 0% used space
> >699072K,
> >1% used space 262144K, 20% used space
> >3776K, 100% used space 332032K, 99% used space 13696K, 0% used space
> >699072K, 1%
> >used space 262144K, 20% used space 308
> >288K, 0% used space 20608K, 99% used space 20608K, 0% used space
> 699072K,
> >2%
> >used space 262144K, 20% usedCaused by: Cau
> >sed by: Caused by: XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> > space 308288K, 100% used space 20608K, 99% used space 20608K, 0% used
> >space
> >699072K, 2% used space 262144K, 26% used s
> >pace 3584K, 0% used space 325312K, 99% used space 20608K, 0% used space
> >699072K,
> >3% used space 262144K, 26% usedXXX unk
> >nowon type 0
> >XXX unknowon type 0
> > space 3584K, 100% used space 325312K, 99% used space 20608K, 0% used
> space
> >699072K, 3% used space 262144K, 26% used sp
> >ace 295232K, 0% used space 27136K, 98% used space 27136K, 0% used space
> >699072K,
> >3% used space 262144K, 26% usedXXX unk
> >nowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >XXX unknowon type 0
> >
> >
> >
> >-
> >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]



Re: RES: JVM' sperm size always increase after hot deploy to tomcat 5.0.28

2005-04-09 Thread Michael Echerer


Paulo Alvim wrote:
> Thank you all
> 
> It's good to know that we're not alone...but since we used to have workable
> 'hot deploy' others pre-J2EE App Servers our customers will insist with
> that - maybe we'll have to reconsider other App Server as our main
> Open-Source production environment option.
> 
> Does anyone know if JBoss 4 makes improvement in this area? I really can't
> believe that it's so hard...
> 
Guess that won't help, because JBoss uses Tomcat as web container.

Check: http://issues.apache.org/bugzilla/show_bug.cgi?id=26135 and try
Tomcat 5.5x

Generally these undeploy memory leakage issues are mainly "coded" into
the webapp or in libraries. Some references won't be garbage collected
when undeploying. There seem to be problems with commons-logging and
beanutils, but could also be self-made, of course.

Cheers,
Michael


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



Custom JNDI resource and Tomcat BeanFactory seem to always return the same object instance

2005-04-12 Thread Michael Echerer


Hi,

I was testing the JNDI Resource configuration using a custom resource factory
and/or the Tomcat BeanFactory following the tutorial here with Tomcat 5.0.28:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html

For Generic Java Bean resources the documentation says:

"The resource factory will create a new instance of the appropriate bean class
every time a lookup() for this entry is made."

Same is said for a custom resource factory. But actually this is not true... :-(

When I tried the demo classes with the MyBean and MyBeanFactory i found out that
"always" the same MyBean instance is returned when calling lookup(). It doesn't
matter whether I use the Tomcat BeanFactory or the mentioned custom
MyBeanFactory.

I would say this is because the method getObjectInstance(Object obj,Name name,
Context nameCtx, Hashtable environment) is not called multiple times (each
lookup() ), but really only once! I can say this because I added a log
statement into this method of MyBeanFactory. Only appears once, so it doesn't
help to issue "new MyBean()" as the first bean ever created seems to be
remembered somehow.

When I configured the MyBeanFactory in server.xml as GlobalResource instead of
the context I could see that the getObjectInstance method is already called
upon Tomcat startup when no web application ever called InitialContext.lookup()
and wasn't even deployed.


My question: Is it simply documented wrongly that each lookup() would return a
new object, is there any chance for a config problem or is this a bug?

I'd like to implement a custom resource factory that has a "pool" behind. Hence
it makes a huge difference whether I "always" get the same object (that would
mean that the object returned needs to be the pool itself and the app can grab
the pooled objects) or if there's a chance to have any pooled object from the
pool returned each time lookup() is called.

Any ideas upon this?

Cheers,
Michael

P.S. BTW the documentation examples should be reviewed as there are a few typos
and some configuration statements that didn't work at all...




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



Re: Pass parameter to the JVM at startup

2005-05-05 Thread Michael Echerer
Acácio Furtado Costa wrote:
> Hi ALL,
>  
> Does anyone know how to pass one parameter by Tomcat 5.0.28 to the  
> starts JVM?
>  
> I need to pass the "- server" parameter to the JVM (SUN 1.4.2) but I 
> don´t know where I put this to call JVM.
>  
Use the JAVA_OPTS variable in catalina.sh or .bat
You can also increase the memory settings here, e.g. -server -Xms512m
-Xmx1024m or whatever other jvm options you need.
> Thanks
Cheers,
Michael
>  
> 
> Acacio Furtado Costa
> Pesquisa e Tecnologia
> 
> GIA - Magnesita S/A
> *  [EMAIL PROTECTED]
> 
>  
> 



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



Re: upgrading a servlet

2005-05-05 Thread Michael Echerer
Zohar Amir wrote:
> Hello,
> I'm using Tomcat 5.0.28 on Red Hat linux.
> What is the correct procedure to deploy a new version of the same servlet?
> 
Just build & redeploy the webapp containing the new servlet, if you
don't need the new and old version at the same time.
 in your web.xml could help if you need both.
> -
> 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: Loading JAR changes without redeploy.

2005-05-05 Thread Michael Echerer
Eduardo Lobo wrote:
> 
> Hi,
> 
> I have this problem: I need to make a web application that read some
> resources(xml files) from JAR files (located in the shared/lib folder),
> but I need to update constantly the JARs content, then I need that the
> web application always gets the last JAR files version without
> redeploy/restart the web application.
> 
> How can I do that, because right now when I replace the JAR file with
> the new one the web application don't get the changes from the JAR content?
> 
> In summary, there is some way to make a "JAR redeploy"?
I guess a "JAR redeployment" is not really feasible or a good solution.
You should better reconsider if it's a good idea to place files that get
modified over and over into a jar at all and especially into shared/lib.

Can't you place the xml files somewhere else?

If you really need it in this jar, you might still load it on a file
basis instead of classpath resource basis (e.g. unjar the jar file
yourself and read the xml file instead of relying on the classloader)

> 
> Any help you can provide me will be well appreciated. .
> 
> Thanks.
> 
> -
> 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: Pass parameter to the JVM at startup

2005-05-05 Thread Michael Echerer

> Shouldn't it have the "-server" in there if it is running in server mode?
> 
> How can I tell that the JVM is actually running in server mode?

well, not sure if you can. I'd try java.lang.System.getProperties() or
something...

At least on a Solaris machine you could figure out whether you are
running in 32bit or 64bit (triggered by -server) mode by checking
os.arch as it differs. Probably there are other sys properties giving a
hint (see javadoc).
Also the manager app shows this along with you memory settings. Hence
you could "assume" that it worked, if you also set -Xmx or Xms and check
this changing with the Tomcat manager app.

Cheers,
Michael


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



Re: upgrading a servlet

2005-05-05 Thread Michael Echerer
Alex Pure wrote:
> I need help with this problem
> please ..
> 
> 
> Apache Tomcat/4.0.1 - HTTP Status 404 - /servlet/utdHttpController
> 
> type Status report
> message /servlet/utdHttpController
> description The requested resource (/servlet/utdHttpController) is not
> available.
> 
Either missing servlet mapping or something went wrong with the
deployment, or similar.
Anyhow rather very "basic" problems. If you already run into trouble
here, I'd suggest books, tutorials etc. And a current Tomcat version...

Cheers,
Michael


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



Re: Pass parameter to the JVM at startup

2005-05-06 Thread Michael Echerer
Michael Echerer wrote:
>>Shouldn't it have the "-server" in there if it is running in server mode?
>>
>>How can I tell that the JVM is actually running in server mode?
> 
> 
> well, not sure if you can. I'd try java.lang.System.getProperties() or
> something...
> 
> 
Yupp... works... Just run my junitreport via ant which also dumps lots
of system properties, too:

"java.vm.name" is what you are looking for, e.g.

java.runtime.name   Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version1.4.2_05-b04
java.specification.name Java Platform API Specification
java.specification.vendor   Sun Microsystems Inc.
java.specification.version  1.4
java.util.prefs.PreferencesFactory  
java.util.prefs.WindowsPreferencesFactory
java.vendor Sun Microsystems Inc.
java.vendor.url http://java.sun.com/
java.vendor.url.bug http://java.sun.com/cgi-bin/bugreport.cgi
java.version1.4.2_05
java.vm.infomixed mode
java.vm.nameJava HotSpot(TM) Client VM
java.vm.specification.name  Java Virtual Machine Specification
java.vm.specification.vendorSun Microsystems Inc.
java.vm.specification.version   1.0
java.vm.vendor  Sun Microsystems Inc.
java.vm.version 1.4.2_05-b04


Hence you should be able to distinguish the Client VM vs. Server VM with
a simple JSP printing those properties.

Cheers,
Michael


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



Re: Common vs. Shared

2005-05-06 Thread Michael Echerer
Ron Heeb wrote:
> my understanding comes from this book i got: 'common is responsible for
> classes that are used by Tomcat and publicly available to all Web
> apps'.  shared is like common, except that 'developers can place their
> own classes and JAR files into the shared class loader domain'. 
> developers shouldn't put anything into common.  this is from
> Professional Apache Tomcat 5 from Wrox.  for what it's worth...ron
> 
You need "common/lib" e.g. for JDBC drivers. Because if you want to
configure a JNDI Datasource and use Tomcats Jakarta Commons DBCP
connection pool there's "no" other way then placing the .jar
into common/lib because Tomcat itself requires the classes already, not
only your webapps.

Moreover you should make sure that the webapps don't contain the
driver.jar in that case again.
Otherwise you'll face lot's of funny classloading issues...
E.g. if you work with driver specific data types you could face problems
like "instanceof" returning false although using the same class because
objects might be loaded by different classloaders (and instanceof and
casting only works within the same classloader).

Cheers,
Michael


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



Re: Pass parameter to the JVM at startup

2005-05-07 Thread Michael Echerer

> Looking back I was starting Tomcat from inside Eclipse with the Sysdeo
> Tomcat Plugin which apparently doesn't use the tomcat startup scripts,
> i.e., it bypasses startup.sh so it never sees -server. When I started
> tomcat manually via the cli with startup.sh with the JAVA_OPTS in
> catalina.sh it did see the -server option and it does indeed show up
> on the cli too:
> 
Nevertheless you can also configure the start options (e.g. to adjust
the memory usage) when using the Sysdeo plugin... There's a dialog for
this in Eclipse/Sysdeo as the startup scripts aren't used, as you mentioned.


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



Re: Tomcat 5 slow, it's in production, please help!

2005-05-07 Thread Michael Echerer
Oto Bossert wrote:
> Yoo,
> 
> Yes switch to jk2 is faster!
But unsupported! Development of mod_jk1.x is going on, but not jk2. I
wouldn't advise anyone to select something uncontinued.
I set the session timeout time to 5 minutes, but
>>>
>>>in
>>>
the session view of tomcat manager, I see message
>>>
>>>"30
>>>
- <40 minutes:136 sessions". How a session that is
more than 30 minutes is still there. Maybe I don't
understand this message correctly.
Check whether you session-timeout is really set correctly. You can set
the timeout in the default web.xml for all apps, but you could override
it in the webapps web.xml, too. Maybe there it's still set too high.


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



Re: [Tomcat] Web Traffic Analisys Tool

2005-05-21 Thread Michael Echerer
Omar Adobati wrote:
> Good Morning all,
>   I'm looking for a free and good web traffic analyzer to use with
> tomcat 5.x but searching on the net I can't find anything good.
> Does anyone know a good tool? (if it exists)
> 
> Thanks in advice
> 
What about analog, webalizer or awstats?
http://awstats.sourceforge.net/docs/awstats_compare.html

Cheers
Michael


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



Re: ssl traffic between apache and tomcat via mod_jk

2005-06-05 Thread Michael Echerer
Liz Donaldson wrote:
> Hi,
> 
> I have a apache https enabled webserver and tomcat server an and am
> using the mod_jk connection module. From all the documentation I have
> read, it indicates that apache handles all the SSL negotiations and that
> the traffic between apache and tomcat is clear text. How can I enable
Well in fact the traffic uses ajp13, a protocol which is not really
"clear text". It's a binary format for optimization reasons.
Nevertheless it's of course not crypted (if you know the protocol), but
it might suffice for "minor" security demands as you cannot simply read
it using sniffer tools.
> communications between apache and tomcat to be encrpypted.
For mod_jk and Tomcat I doubt you can encrypt it. I never
heard/read/seen anything in the docu, too.
You could maybe try things with an ssl tunnel like stunnel.org, but
that's just a guess...

BTW: Why is the communication between Apache and Tomcat an issue at all?
Usually/Hopefully you're already in a "secure" environment with your
Apache behind a firewall etc.

Cheers,
Michael
> 
> Thank You in advance,
> Liz
> 
> 
> -
> 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: Is Tomcat is an application server ?

2005-06-22 Thread Michael Echerer

>>There is no meaning in saying that one can plug in required
>>services to Tomcat. My question is by design is it an application
>>server ?. My opinion is that Tomcat in the shipped form is not an
>>application server. At the minimum it should provide transaction and
>>persistence services, method level security is also preferred.
>>One can add all the above mentioned features to any servlet engine
>>by deploying JAR files of the required services(JNDI,JTA,persistence
>>and even EJB). So any servlet engine becomes an application server. Am
>>I right ?
> 
> 
> I think you are getting your terms mixed up... Your arguments could be
> used in regards to a full J2EE container, which Tomcat isn't on it's
> own but an application server just needs to serve applications and
> Tomcat certainly does that.
> 

Agree. Tomcat is an application server, e.g. JBoss aswell, but JBoss is
a J2EE 1.x compliant application server as all parts of the spec are
implemented, Tomcat is not as only parts are covered.

Cheers,
Michael



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



Re: how to replace j_security_check

2005-06-26 Thread Michael Echerer
Marten Lehmann wrote:
> Hello,

> So far, this is not a problem. Looking up users through jdbc isn't a
> problem as well. But how can I inform the container about a successful
> login, so that calls to request.getRemoteUser() and
> request.isUserInRole("manager") will behave as if I logged in through
> the common j_security_check?
You can't replace j_security_check as it's part of the servlet spec. You
could e.g. try to set the security principal yourself and use
org.apache.catalina.HttpRequest to cast your HttpServletRequest and
build something custom around the declarative security.

Cheers
Michael


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



Re: Tomcat login & logout hook ?

2005-07-08 Thread Michael Echerer
Dongsheng Song wrote:
> Hello,
> 
> Can I hook a function after user login & before user logout ?

I assume that logout usually goes hand in hand with a session
invalidation, then Servlet 2.4. spec is your friend:

SRV.10.2.1 Event Types and Listener Interfaces

javax.servlet.http.HttpSessionListener


Cheers,
Michael
> 
> Dongsheng Song
> 
> -
> 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: OutOfMemory Errors

2004-12-15 Thread Michael Echerer
Hi,
another idea... try to increase the size of the perm heap with 
-XX:permSize and -XX:maxPermSize. (See the JVM and garbage collector 
tuning docus from Sun for more information and google for more). Also 
try to enable the garbage collector log to check what happens to the 
perm memory in case of GCs.
AFAIK the maxPermSize can be set fairly high, because it will be cut off 
your -Xmx setting, just when needed.
We had a similar issue because the perm size was limited to/reached 64mb 
and at some point during runtime everything broke apart as we need about 
100MB. Interesting: using the -d64 -server crashed already during Tomcat 
startup with too low perm size. Obviously the classes and all other perm 
memory code need more heap right from the beginning due to 64bit addressing.

Unfortunately having not enough perm memory here can lead to out of 
memory exceptions although you seem to have enough free heap. ;-)
Somebody at Sun forgot to offer a Java 1.4.x method to dump the free 
perm memory besides max, total and free heap that you could easily find 
out whats wrong without GC logging...

Cheers,
Michael
Asim Alp wrote:
Hello Peter,
Sorry.  My system config is:
Windows Server 2003
Apache 2.0.49 (Win32) mod_ssl/2.0.51 OpenSSL/0.9.7d DAV/2 mod_jk/1.2.6
Tomcat 5.5.4
sun jdk 1.5.0-b64
We have a 2 node tomcat cluster each running with the -Xms128m
-Xmx1024m options.
We have a heavily loaded JDBC application running and our MySQL server
has enough max_connections to handle our load.  For now, we have
Apache, one of the Tomcats and MySQL running on the same machine (2 x
3.8 Ghz Intel with 2GB of Ram).  We're also using this server as a
file server with RAID 5.
From Task Managers performance monitor, I'm looking at the Handles (I
hope I'm looking at the correct thing).  Total number of handles is
around 30400 (almost two times 16K).  Apache is usually using about
3000, Tomcat 5000, MySQL 9000, System 2600, svchost 1000.
Do these values look normal?
Asim
On Mon, 13 Dec 2004 17:53:35 -, Peter Crowther
<[EMAIL PROTECTED]> wrote:
From: Asim Alp [mailto:[EMAIL PROTECTED]
I'm trying to solve an OOME on our Tomcat.
Tomcat version?
JVM version and settings?
Application characteristics?
Other libraries in use (eg JDBC)?

We profiled our
application using JProfiler and there are no memory leakages on our
end.  Currently, I'm focusing on some system resource problems such as
file descriptors.  Would this be a valid problem on Windows Server
2003?  And if so, how can I change the max number of file descriptors?
I suspect someone else will give a better Java solution, but I'm a
Windows hack who's a relative latecomer to Java...
You've got 16k to go at by default.  How many are you using, according
to Performance Monitor?  And how many in the JVM running Tomcat?

One last thing...  What other resources should I investigate for this
sort of OOME?
http://www.sysinternals.com/ for 'handle' and Process Explorer if you
suspect a resource problem on Windows.
   - Peter
-
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: Oracle 9i client connection to 8i database

2004-12-25 Thread Michael Echerer
How come that you need an Oracle client installation at all when you 
just want to use the Oracle thin JDBC driver? IHMO the client 
installation is only required for OCI thick drivers...

Brad Rhoads wrote:
We have an (struts) app that talks to an Oracle 8i database. Our latest
installation wants to run the app on Fedora Core 2. I couldn't get the
Oracle 8i client install, so I installed the 9i client. With the 9i client,
you have to use a service_name instead of a sid in the connection. 

Normally my connection string (in my web.xml) looks like:
jdbc:oracle:thin:@10.0.0.7:1521:test
But it seems to get a service_name instead of a sid I have to use something
like:
 
jdbc:oracle:thin:@jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROT
OCOL=TCP)(HOST=10.0.0.7)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=test)))
am-value>

My problem is I'm getting this error:
NVFactory: _readNVPair expected
It doesn't seem to make any difference if I use the 8i or the 9i drivers. 

I've also tried

jdbc:oracle:thin:@//10.0.0.7:1521/test
But that just gave me a format error.
I can connect fine using sqlplus. 

What am I doing wrong?
Thanks for the help. Merry Christmas!

-
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 is too sticky

2005-01-16 Thread Michael Echerer
Hi!
What you could do is to give Apache a hint where to direct a request to.
E.g. you could not simply invalidate the session, but also redirect to 
your start page again with a little "trick".

Add a ;jsessionid= string to the URL.
Assume your Tomcat JVM routes are called e.g. tomcatA, tomcatB, tomcatC, 
etc. you will have noticed that the ;jsessionid look like 
http://someurl;jsessionid=someid.tomcatA or 
http://someurl;jsessionid=someid.tomcatB etc.

It get's interesting when you pass an URL like:
http://someurl;jsessionid=.tomcatC
Obviously because of the missing sessionid "someid" this can not be or 
create a valid session on one of your Tomcats, but for your Apache this 
"flag" is "sticky" enough to direct to that specific Tomcat "tomcatC" 
(which should be an instance that has enough connections left. In case 
you don't know which of your Tomcats has connection left, you might 
randomly add .jsessionid=.tomcat? and redirect until you found a Tomcat 
you can use.

Thus by simple adding an incomplete ;jessionid=. you can force 
Apache to direct to that instance, Tomcat will detect the broken 
session, create a new one (but since you're already on the correct 
Tomcat, that's fine). Note: In case one Tomcat is down, Apache will know 
this in advance and eventhough you specify ;jessionid=.tomcatB you will 
go to tomcatA or tomcatC, if tomcatB was down. So now problems with 
failover.

I use this mechanism/trick to have an enhanced Tomcat manager 
application.  One frame with all my Tomcat instances that are linked 
with this ;sessionid=. and one frame with the manager html 
page itself. With some more "magic" I can now deliberately switch 
between my instances and deploy/start on the instance I want, although 
Apache would otherwise pop up any manager app due to loadbalancing.

2xApache 2.x, 4xTomcat 5.x, modjk2
Hope that helps!
Cheers,
Michael
Srinivas Rao Ch wrote:
Hi,
 

I am implementing clustering with Apache + Tomcat + mod_jk2. And, I
enabled Sticky Session. Sticky behavior is happening as expected.
 

I have a specific requirement. My DB connections for each cluster member
are limited. Once the cluster member's DB connections are exhausted it
has to redirect the request to other cluster members. I am doing this by
redirecting the request to LB again after invalidating the Http Session
(which is used by apache to provide the sticky behavior). I called
invalidate() on session and I am sure session is invalidated.
 

Still, the session is going to the same cluster member all the time. I
appreciate if somebody can direct me how to solve this problem.
 

Regards,
Srinivas


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


Re: What is it mean that "Java code does not belong in well designed JSP pages"?

2005-01-23 Thread Michael Echerer
provides.  Some logic does belong in JSP.  However, the logic that
appears within pages should be limited to display logic.  I've found
that Struts and JSTL are a great combination to accomplish such
separation.
IMHO this is basically the essence of "Java code does no belong in well 
designed JSP pages"

Keep the MVC separation in order not to clutter your view (e.g. JSP) 
with business logic. That can be achieved with various frameworks like 
Struts. Whenever you "need" code, think of Struts Taglibs or JSTL first. 
Usually this is sufficient for all the "legal code" in JSPs.
That is "display logic" like reformating values for displayment that 
were calculated in your business logic elsewhere. E.g. iteration over 
lists, colorize things, whatever. This will reduce your JSP's Java code 
to "snippets" of just a few lines. Of course, with custom taglibs even 
that could be reduced to zero, but that's usually not worth the effort 
(if not reusable).

Or don't use JSP at all (but if so, bundle with Struts)... Tapestry is 
also good to separate view and business logic, at least if you don't put 
to much OGNL in your html templates ;-) That's as worse as too much Java 
code and EL in JSPs.

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


Re: moving all classes to shared

2005-02-20 Thread Michael Echerer

Dale, Matt wrote:
I'm not sure what you're getting at here. The number of users are irrelevant to 
the classes. You should only use shared/classes if the classes have to be 
shared across web apps. Although this is not usually advised as it is good 
practice to keep web apps self contained.
WEB-INF/classes would take precedence over shared/classes but I still don't see 
what you are trying to achieve.
My understanding (I'm sure someone will correct me if i'm wrong) of the shared is that each class will be loaded into the classloader of each webapp so no memory would be saved, if you chose to use this area for sharing classes accross webapps.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html
I doubt that classes in shared lib are existing multiple times per 
webapp. I'm quite sure the exist per tomcat instance...
The difference is that common lib is available to both Tomcat and the 
webapps. Shared lib is not available to the Tomcat classes.

Typically one places the jdbc driver into common lib, because Tomcat 
needs that when using the JNDI pooling. If you just use old JDBC style 
it should work in shared lib or even web-inf/lib.

The interesting part is that shared lib is relative to catalina base, 
not catalina home, unlike common lib...

Cheers,
Michael

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


Re: how to harden tomcat?

2005-02-25 Thread Michael Echerer
Hi,
One thing to look out for would be the use of JNI i.e. native calls. I'm 
not sure if there is a way of preventing someone from packaging a .so in 
a WAR and then loading it in to the app via code to bypass the lack of 
LD_LIBRARY_PATH (on *nix).
didn't try it myself, but I guess
/tomcat/conf/catalina.policy and it's java.security settings are the 
right place to look for these remaining problems.

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