Re: JSON Logging of Tomcat Access Log.

2016-05-30 Thread Rainer Frey (Inxmail GmbH)

> On 27.05.2016, at 19:41, Christopher Schultz  
> wrote:
> 
> AccessLogValve was written to conform to the age-old httpd log file
> format, subject to whatever "pattern" you want to apply.
> 
> You could sprinkle your pattern full of JSON stuff, but then
> JSON-escaping wouldn't actually occur, etc.
> 
> If you want JSON logging, you are going to have to write your own valve.

logback has an additional module called logback-access[1], that implements an 
access log valve for
Tomcat. You could then use a logbook appender that writes JSON, eg. the 
logstash-logback-encoder[2].

Disclaimer: I’ve never used that combination, and don’t know if there are 
incombatibilities. In theory, 
it should work.

Rainer

[1] http://logback.qos.ch/access.html
[2] https://github.com/logstash/logstash-logback-encoder



Re: rotate catalina.out without restart?

2016-02-01 Thread Rainer Frey (Inxmail GmbH)

> On 01.02.2016, at 16:42, Harald Dunkel  wrote:
> 
> Hi folks,
> 
> would it be possible to integate apache's rotatelogs
> into catalina.sh to support daily rotation of catalina.out
> without restart?

On linux, (system) logrotate ha a “copytruncate” option that could be used.
You’d need to check whether that could lose some log lines though - and if 
you could live with that.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebEx meeting invitation: Apache Tomcat: TLS key and certificate generation

2016-01-27 Thread Rainer Frey (Inxmail GmbH)
On 27.01.2016, at 13:31, Mark Thomas  wrote:
> 
> All,
> 
> The recording for this is now available on the Apache Tomcat YouTube
> channel: https://www.youtube.com/channel/UCpqpJ0-G1lYfUBQ6_36Au_g

I don’t know whether that has s.th. to do with the WebEX sound option, 
but the sound of the recording is much much better than before. Thanks!

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebEx meeting invitation: Apache Tomcat: TLS Virtual Hosting

2015-12-09 Thread Rainer Frey (Inxmail GmbH)
Hi,

> On 08.12.2015, at 11:41, Mark Thomas  wrote:
> The meetings are currently set up so you have to use a telephone to
> connect to the audio. You can either dial in or get the system to call
> you back.

I am pretty sure that I have attended webex meetings with audio in the webex 
client.
Would it be possible to set up future webinars like that? Having to use a phone 
is
quite cumbersome.

Also, audio quality of the youtube recording is really bad (at least this time).
Any improvement would be appreciated.

Thanks
Rainer



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [PROPOSAL] Tomcat Webinar series

2015-11-13 Thread Rainer Frey (Inxmail GmbH)
> On 12.11.2015, at 23:29, Mark Thomas <ma...@apache.org> wrote:
> 
> All,
> 
> I've been wondering if there would be any interest in a Tomcat Webinar
> series. I'm thinking ~10 minutes of presentation followed by Q on
> topics of interest to this community with the webinars taking place
> every 1/2/4 weeks depending on interest. The webinars would also be
> recorded and uploaded somewhere - probably youtube - and linked from
> tomcat.apache.org.

Great idea! 

> My initial thoughts on possible topics are:
> 
> - Intro to Tomcat 9 (the first milestone release is in progress as
>  I type this)
> 
> - TLS virtual hosting with Tomcat 9
> 
> - Generating TLS keys for Tomcat
> 
> - HTTP/2 and Tomcat 9
> 
> - Connector selection: BIO vs NIO vs NIO2 vs APR
> 
> - Proxy protocol choice HTTP vs AJP

Great list. I wonder though, how thoroughly these can be covered in ~10 min. 
I’d 
rather watch a longer webinar, than one that only scratches the surface.

Rainer Frey

Product Development

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 / Java 7

2014-02-05 Thread Rainer Frey (Inxmail GmbH)
On 03.02.2014, at 22:19, Singh, Ragini rsi...@central.uh.edu wrote:

 Hello,
 
 I upgraded Java 1.6.45 to Java 1.7.51 using java-1.7.0-oracle.x86_64 : Oracle 
 Java Runtime Environment on RHEL 5. Used the alternatives command to make 
 the Java 7 as Java version.
 Now in my custom startup script if I define JAVA_HOME as 
 JAVA_HOME=/usr/lib/jvm/java tomcat 7 recognizes the java as 1.6 ( the 
 previous version) and gives this message
 INFO: The APR based Apache Tomcat Native library which allows optimal 
 performance in production environments was not found on the 
 java.library.path: /usr/lib/jvm/java-1.6.0-sun-1.6.0.45
 .x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-sun-1.6.0.45.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-sun-1.6.0.45.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib
 64:/lib64:/lib:/usr/lib
 
 I modified the JAVA_HOME to JAVA_HOME=/usr/lib/jvm/jre-1.7.0-oracle.x86_64. 
 Now tomcat starts and gives the message as
 INFO: The APR based Apache Tomcat Native library which allows optimal 
 performance in production environments was not found on the 
 java.library.path: 
 /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
 
 I believe it is not recognizing the correct Java version which is 1.7. Am I 
 missing anything ?

AFAICT Java 7 has removed $JAVA_HOME/jre/lib/architecture[/vmtype] and 
$JAVA_HOME/lib/architecture from the default java.library.path - this is 
independent of Tomcat. So it is very likely that Tomcat *is* using the desired 
Java now. Others have already written how to verify for sure.

 Thank you,
 -Ragini

Rainer Frey

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Curious difference in connection behaviour on database side DBCP vs. JDBC?

2013-11-21 Thread Rainer Frey (Inxmail GmbH)
On 22.11.2013, at 02:20, Christopher Schultz ch...@christopherschultz.net 
wrote:
 I also think that this is a justifiable spec violation, and all I’m
 asking is that this fact is shown more prominently, esp. as JDBC
 pool is advertised as a drop-in replacement for DBCP.
 
 Fair enough. Care you file a documentation bug and possibly provide a
 patch?

Will do, not sure I’ll get to it before the weekend though.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Curious difference in connection behaviour on database side DBCP vs. JDBC?

2013-11-20 Thread Rainer Frey (Inxmail GmbH)

On 20.11.2013, at 14:21, Christopher Schultz ch...@christopherschultz.net 
wrote:

 Rainer,
 FWIW, Connection.close also states this:
 
 
 Releases this Connection object's database and JDBC resources
 immediately instead of waiting for them to be automatically released.
 
 
 Does that mean that all connection pools by design are in direct
 violation of the JDBC spec?

I assume you’re referring to the Releases this Connection object's database 
resources”
part, then yes, they’re in violation of the letter of the API spec. I’m not 
sure whether
the Javadoc is regarded as binding as the spec document though. And following 
the letter 
would indeed defy the very purpose of the pool.

The other pools that I know do free the JDBC resources though. And that’s the 
part of the 
behavior that is really visible to the application. (And yes, Javadoc says it 
is best practice 
to explicitly close the JDBC resources as early as possible, but it also states 
that one
can get away with not doing so).

I also think that this is a justifiable spec violation, and all I’m asking is 
that this fact
is shown more prominently, esp. as JDBC pool is advertised as a drop-in 
replacement for DBCP.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Curious difference in connection behaviour on database side DBCP vs. JDBC?

2013-11-19 Thread Rainer Frey (Inxmail GmbH)

On 19.11.2013, at 14:45, Mark Thomas ma...@apache.org wrote:

 On 19/11/2013 13:32, Carl Boberg wrote:
 
 I have here an example of the way we close from the application, (the devs
 have named it dispose). From my untrained non java dev eye we do not seem
 to be doing statement.Close(); and Im curious if that might be the issue?
 If so, why does DBCP handle it nicely and not JDBC?
 
 Commons DBCP tracks Statements and ResultSets when they are created and
 closes the associated Statements and ResultSets when the connection that
 created them is returned to the pool.
 
 Tomcat's JDBC pool does not do this. This is one of the reasons that
 Commons DBCP has a larger code base.

JDBC spec states (9.4.4):

 An application calls the method Connection.close() to indicate that it has 
 finished using a connection. All Statement objects created from a given 
 Connection 
 object will be closed when the close method for the Connection object is 
 called.

Javadoc of Connection.close() and Statement.close() at least imply that as 
well. 
ResultSet’s Javadoc explicitly states that a ResultSet is closed when the 
statement
is closed.

AFAICT the JDBC pool uses (as most connection pools) the Connection.close() as 
means 
to return a connection to the pool. While I understand that the semantics of 
completely 
closing a standalone connection and returning a pooled connection is different, 
this behavior 
is still a (presumably deliberate) violation of the spec, and makes the usage 
non-transparent
to the application code.

IMO this should be clearly stated in the JDBC pool’s docs, in an easily visible 
way.

Rainer



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] WEB-INF

2013-07-15 Thread Rainer Frey

On 11.07.2013, at 17:36, André Warnier a...@ice-sa.com wrote:

 Leo Donahue - RDSA IT wrote:
 You mention header/footers, which was in the back of my mind when I posted 
 this.  Placing headers/footers in WEB-INF doesn't allow me to re-use these 
 in different webapps, without having multiple copies of these? If I have a 
 header/footer template in \webapps\ROOT\WEB-INF\templates\, I can't 
 reference it from  \webapps\App2\WEB-INF\templates  ... or can I?
 
 There are 2 schools of thought here.
 One says that webapps should be independent of one another.

And that's the only school of thought that the servlet spec supports (for 
better or worse). At the deployed application stage (vs. development) reuse is 
not supported at all, each web app must be self-contained.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: multi-tenant web app

2013-04-19 Thread Rainer Frey

On 18.04.2013, at 15:37, Jeffrey Janner jeffrey.jan...@polydyne.com wrote:
 Here's a real world example of doing this, by JFRog regarding their
 Artifactory SAAS. Spoiler: the crucial point is putting as many
 dependencies as possible into the shared classloader (where possible
 is not as easy as it sounds:
 
 http://www.youtube.com/watch?v=tE3eo0CuQCc
 
 Rainer
 
 Rainer, 
 That's a very long video to sit through, but it looks interesting.  Any 
 chance someone's summarized it somewhere?

It was a JavaOne session, don't know if the slides are available for public.
The interesting part w.r.t this thread starts at about 18:00 in the video. 
Before that, the discuss multi tenancy and SAAS in general and why they chose 
the strategy of one web app per tenant.

Summary of the core part is: in-depth review every used library for any kind of 
shared state:
* static references in the classes
* specifically global (static) registries
* caches
* thread pools
* loggers
Work with the developers to remove them or run own forks if that doesn't work 
out. And review again on new releases.
They show some specific examples in libraries they use.

Later (from around 35:00) they discuss how this approach changed their 
development and release process, and the last minutes are QA (don't remember 
if that was relevant). 

Rainer





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: multi-tenant web app

2013-04-17 Thread Rainer Frey

On 12.04.2013, at 13:08, Jamie ja...@mailarchiva.com wrote:

 Greetings!
 
 I would like some advice with regards to deploying a web app in a 
 multi-tenant scenario. A while back, we had a few cloud service providers ask 
 us if they could host our web app as a service. Under pressure to come with a 
 quick solution, we responded by implementing a manager like application (much 
 like the Tomcat manager app), that could deploy additional web apps by 
 copying the contents of our WAR file to a new directory under web apps .

Here's a real world example of doing this, by JFRog regarding their Artifactory 
SAAS. Spoiler: the crucial point is putting as many dependencies as possible 
into the shared classloader (where possible is not as easy as it sounds:

http://www.youtube.com/watch?v=tE3eo0CuQCc

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat jmx disabled by default ?

2013-04-08 Thread Rainer Frey
On 07.04.2013, at 11:58, Jakub 1983 jjaku...@gmail.com wrote:

 why do I have to enable jmx with command
 
 *set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=%my.jmx.port% \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false*
 
 
 http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html


Do you have the remote JMX lifecycle listener activated 
(from 
http://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#JMX_Remote_Lifecycle_Listener_-_org.apache.catalina.mbeans.JmxRemoteLifecycleListener)

This will IIRC disable the default JMX initialization.

Rainer


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat jdbc pool connection failover

2013-03-13 Thread Rainer Frey
On 12.03.2013, at 17:14, Christopher Schultz ch...@christopherschultz.net 
wrote:
 On 3/12/13 7:54 AM, amit shah wrote:
 I am using Oracle. Oracle JDBC Driver provides the Oracle
 Universal Connection Pool (UCP) which includes this 
 featurehttp://docs.oracle.com/cd/E11882_01/java.112/e16548/fstconfo.htmof
 
 
 connection failover but since we use tomcat jdbc connection pool we
 cannot use UCP.
 
 Why not?

Because it would be two-level pooling?

 Also UCP has lot of synchronized code which leads to blocking
 threads and less concurrency support.
 
 Let me know your suggestions/thoughts.
 
 I'm thinking that a low-performance fail-over is preferable to a
 zero-performance non-fail-over.

Well, low overall performance, but possibility of failover in the hopefully 
rare case,
may not be acceptable compared to high(er) overall performance and a search for 
other ways
to perform failover.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat and Sun/Oracle Java 7

2013-02-11 Thread Rainer Frey

On 04.02.2013, at 19:40, Christopher Schultz ch...@christopherschultz.net 
wrote:
 It's a maybe. If you use -target 1.6 and you make sure not to use
 any APIs that are Java 1.7+ (not sure if the compiler actually checks
 when you use -target 1.6)

It does not. -target only sets the class file format. There's an option to set 
the 
compiler's boot classpath though, where you could point at another rt.jar, but 
I 
never used that (yet).

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: New Library folder

2012-12-27 Thread Rainer Frey
On 27.12.2012, at 11:40, N.s.Karthik nskarthi...@gmail.com wrote:

 Hi
 
 I have multiple web applications  working perfectly on Tomcat 7.0.30
 I know that jar files of similar can be moved to  Tomcat /lib folder  so the
 same could be shared 
 by multiple applications.

You know that *your specific jar files* can be moved to tomcat/lib? You'll 
wanna be really sure of that.
Static references used within these jar files can lead to permgen memory leaks 
and/or misbehavior (to put it in a grossly simplified way). See various 
conference talks and presentations by Mark Thomas, and part of following 
JavaOne session:
https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=7905

I think this is only worth the effort in very specific use cases, most commonly 
a multi tenant service with an instance of (almost) identical web apps per 
tenant. Just to save a few MB of permgen memory or disk space: don't do it. 

 This helps in clear separation of mixing Tomcat/lib/*.jars with application
 specific jars.

For that purpose, I would not nest your own lib folder within tomcat's lib 
folder. Place your folder next to the original lib folder, or even outside the 
tomcat directory.

As Daniel Mikusa already said, you can configure such a folder in 
conf/catalina.properties by modifying the common.loader property, if you really 
are determined to do that.

 with regards
 N.s.Karthik

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 manager quirk?

2012-10-29 Thread Rainer Frey

On 27.10.2012, at 11:31, Pid p...@pidster.com wrote:
 I don't like the idea of .war uploads via the Manager app to a
 production server, myself...

Out of interest: how do you do deployment to production?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: FAIL - Application at context path /test could not be started

2012-10-17 Thread Rainer Frey

On 16.10.2012, at 15:26, majin_clo...@t-online.de wrote:

 Thanks for your reply. :) 
 
   my web.xml looks like this: 
 
   ?xml version=1.0 encoding=UTF-8?
 web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 
  listener
 
 listener-classorg.test.web.servlets.BigBangServletContextListener/listener-class
  /listener
 
 Oct 16, 2012 12:46:47 PM org.apache.catalina.startup.HostConfig
 deployWAR
 INFO: Deploying web application archive test.war
 Oct 16, 2012 12:46:47 PM
 org.apache.catalina.loader.WebappClassLoader
 validateJarFile
 INFO:
 validateJarFile(/var/lib/tomcat6/webapps/test/WEB-INF/lib/servlet-api-2.5-6.1.14.jar)
 - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
 class: javax/servlet/Servlet.class

You must not include the servlet API as .jar in your web app. It is provided by 
the container. Remove this file. This is not your problem though - as the 
message says, it is not loaded.
 SEVERE: Error listenerStart

This means the listener defined above 
(org.test.web.servlets.BigBangServletContextListener) does not start. Either 
that class is not found, it does not implement the ServletContextListener 
interface or it fails to initialize internally.
Maybe other log files have more info, or s.o. else knows more details on how 
these cases are distinguished - or even better just verify all three 
possibilities yourself

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context variation problems -- localhost versus VPS

2012-08-06 Thread Rainer Frey
On 28.07.2012, at 00:01, Caldarale, Charles R wrote:

 From: David Woosley [mailto:dwoos...@appnation.com] 
 Please note that I am not using any webapps or ROOT folders.
 
 You *must* have a webapp named ROOT - no exceptions.

Excuse me, but where's that requirement coming from? I usually don't have any 
root web app, and requests that are not mapped to any existing web app are 
intended to fail. Is there any problem with that?

Thanks
Rainer 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat7 OutOFMemoryError

2012-03-05 Thread Rainer Frey
On 05.03.2012, at 11:30, Philippe ROUXEL wrote:

 When I set JAVA_OPTS= -Xmx1024m -Xss75m

That means: each thread get a stack of 75MB. One of the following applies:
* the operating system has a limit on thread stack size
* the per process memory limit is reached before all initial tomcat threads are 
started
* the system runs out of total memory before all initial tomcat threads are 
started

75MB thread stack size seems quite insane, the default is around 1-2MB. Perhaps 
you meant to set -Xms (which sets the initial Java heap size)?

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Rainer Frey

On 05.03.2012, at 14:14, Philippe ROUXEL wrote:

 When I set JAVA_OPTS= -Xmx1024m -Xss75m
 
 That means: each thread get a stack of 75MB. One of the following applies:
 * the operating system has a limit on thread stack size
 * the per process memory limit is reached before all initial tomcat threads 
 are started
 * the system runs out of total memory before all initial tomcat threads are 
 started
 
 75MB thread stack size seems quite insane, the default is around 1-2MB. 
 Perhaps you meant to set -Xms (which sets the initial Java heap size)?
 75MB of stack is needed by hibenate to save the data aka a graph.

I haven't used hibernate personally, but I never heard anything like that. So 
please elaborate. Where did you get that information?
Also what do you mean with graph? The graph of associated objects that are 
updated by one hibernate call, or is your data actually graph data?
If so, how is that mapped? do you have any self-referential associations?
Is it really stack that you are talking about?

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Overriding web.xml parameters

2011-09-27 Thread Rainer Frey
On 27.09.2011, at 11:00, Romaric wrote:

 Hi,
 
 The problem is that the values in web.xml override those in context.xml when 
 it should be the other way around.
 Do you have any idea what the problem might be ?

Which exact version? The behavior sounds like a bug that was present from 
(AFAIK) 6.0.30-6.0.32.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Overriding web.xml parameters

2011-09-27 Thread Rainer Frey
On 27.09.2011, at 11:38, Romaric wrote:

 Le 27/09/2011 11:33, Rainer Frey a écrit :
 On 27.09.2011, at 11:00, Romaric wrote:
 
 Hi,
 
 The problem is that the values in web.xml override those in context.xml 
 when it should be the other way around.
 Do you have any idea what the problem might be ?
 Which exact version? The behavior sounds like a bug that was present from 
 (AFAIK) 6.0.30-6.0.32.
 6.0.32.
 That might be the issue.
 Is there a way to work this around other than removing the parameters from 
 web.xml ?

Not that I know of (other than up- or downgrading).

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6 not working with JDBC driver for MySQL

2011-07-26 Thread Rainer Frey

On 25.07.2011, at 22:40, A Df wrote:

 Dear All:
 
 I have read numerous posts and documentation and now I really need help.
 
 
 I am using the following:
 
 Product Version: NetBeans IDE 7.0 (Build 20110408)
 
 I performed the steps below as follows:
 
 I have added the MySQL Connector/J JDBC Driver to the $CATALINA_HOME/lib 
 directory
 However, it gives the error:
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
 OR
 java.sql.SQLException: No suitable driver

Are you launching Tomcat from within Netbeans? Then I'd suspect that Netbeans 
sets it 
up with its own configuration, and esp. with a project specific class path. 
Most instructions
out there imply that you launch Tomcat with the supplied scripts or service 
utilities, and not with 
an IDE plugin.

Try
* launching Tomcat manually, by shell/batch scripts OR
* add the JDBC driver also to your Netbeans project class path

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6 not working with JDBC driver for MySQL

2011-07-26 Thread Rainer Frey
Please stop top posting.

On 26.07.2011, at 12:02, A Df wrote:
 On 25.07.2011, at 22:40, A Df wrote:
 
 Dear All:
 
 I have read numerous posts and documentation and now I really need help.
 
 
 I am using the following:
 
 Product Version: NetBeans IDE 7.0 (Build 20110408)
 
 I performed the steps below as follows:
 
 I have added the MySQL Connector/J JDBC Driver to the $CATALINA_HOME/lib 
 directory
 However, it gives the error:
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver
 OR
 java.sql.SQLException: No suitable driver
 
 Are you launching Tomcat from within Netbeans? Then I'd suspect that 
 Netbeans sets it 
 up with its own configuration, and esp. with a project specific class path. 
 Most instructions
 out there imply that you launch Tomcat with the supplied scripts or service 
 utilities, and not with 
 an IDE plugin.
 
 Try
 * launching Tomcat manually, by shell/batch scripts OR
 * add the JDBC driver also to your Netbeans project class path

 Hi Rainer:
 
 I had already added the JDBC driver to my Netbeans project class path and 
 that worked for awhile then stopped.

Well sorry, no idea, as I don't use Netbeans. Maybe ask on a Netbeans 
list/forum.
 
 I will have to do some reading on launching Tomcat manually by shell/batch 
 scripts but I don't have much time as I have a deadline to meet which is my 
 major concern.

Not much to read. See RUNNING.txt in a tomcat distribution. $CATALINA_HOME/lib 
is the correct place for the driver.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with SSL certificate

2011-06-30 Thread Rainer Frey

On 29.06.2011, at 20:09, D'Anna, Rich (PHH) wrote:

 I'm guessing
 we are using the native APR connector based on the configuration we
 selected for the server.xml.
 
 When I looked in the logs I did find this entry:
 
 Jun 29, 2011 1:56:31 PM org.apache.catalina.core.AprLifecycleListener
 init
 INFO: The APR based Apache Tomcat Native library which allows optimal
^^

 performance in production environments was not found on the
 java.library.path: 
 
 I'm guessing from the error message we need to install the APR based
 Tomcat Native Library?  Is that correct?

Not entirely. It is an Info message, no error, and always occurs in the default 
configuration. Your configuration means auto-detection of APR, and the message 
says APR is not detected. Therefore the Java (BIO) connector is used, and you
need to use the Java SSL configuration directives.
You *can* however install APR, if you want, as it is supposed to have better 
SSL 
performance, and then use the APR configuration directives. It is unclear 
though 
if the difference is actually noticeable for your users, and it is not 
/necessary/ 
just to get SSL to work.

Rainer
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Trouble with jdbc drivers in TC 7

2011-04-08 Thread Rainer Frey
On Thursday 07 April 2011 22:17:22 Christopher Schultz wrote:

  Could you be missing a shared
  library from your java.library.path? Sometimes, missing shared libs can
  cause CNFEs.
  
  The folder where the .dlls are located is on the windows %path%.  Is
  that part of the java.library.path?  If not, where is the best place to
  put them?  JRE\lib\ext\x86?
 
 Are you running Tomcat as a service? If so, the Windows %PATH% might not
 be applying. Can you try inspecting your Tomcat 5.5 configuration to see
 where those .dll files might be, or if the java.library.path is being
 specified somewhere?

The OP should be able to inspect the actually applied value with JMX (e.g. 
(j)visualvm). 

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with overriding parameters via context.xml

2011-02-28 Thread Rainer Frey
On Friday 25 February 2011 17:21:07 Mark Thomas wrote:
 On 25/02/2011 16:14, chris derham wrote:
  Oliver said that the defect I was asking about was 50700. This appears to
  have been fixed now. So when is the next release of tomcat scheduled? I
  searched the tomcat pages, but can't see a page listing anticipated
  launch dates. I know open source projects don't tend to be so rigid, but
  is there a date penciled in?
 
 7.0.9 probably in the next few weeks. I have been trying to stick to a
 release every month or so.
 
 6.0.33 is likely to be several months away. I don't see anything in the
 change log that is likely to prompt an earlier release.

Ouch. 50700 is an absolute blocker for me. I'm stuck with 6.0.29 because of 
this, and having a useable release with the numerous fixes from 6.0.30 would 
be good.

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with overriding parameters via context.xml

2011-02-28 Thread Rainer Frey
On Monday 28 February 2011 16:53:00 Mark Thomas wrote:
 On 28/02/2011 14:51, Rainer Frey wrote:
  On Friday 25 February 2011 17:21:07 Mark Thomas wrote:
  6.0.33 is likely to be several months away. I don't see anything in the
  change log that is likely to prompt an earlier release.
  
  Ouch. 50700 is an absolute blocker for me. I'm stuck with 6.0.29 because
  of this, and having a useable release with the numerous fixes from
  6.0.30 would be good.
 
 What's wrong with 7.0.9? I am in the processing of uploading the files
 for the release vote now. The ASF Jira instance has been happily running
 7.0.x since 7.0.6 was announced as stable.

I plan to test with Tomcat 7, but some apps did not work well with the beta 
versions (IIRC because of using incorrect URL mappings that did work in Tomcat 
6).

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to serve .net and java websites on Windows 2008 with IIS7 and Tomcat

2011-02-02 Thread Rainer Frey
On Wednesday 02 February 2011 01:51:51 Jordan Michaels wrote:

Please don't top post.

 On 02/01/2011 04:38 PM, Conway Liu wrote:
  It seems like the Tomcat service only serves applications from one
  location ($CATALINA_HOME)

No. you can have
* webapps with a document path outside $CATALINA_HOME/$CATALINA_BASE
* (virtual) hosts with an appBase (base directory of all webapps of this host) 
outside $CATALINA_HOME/$CATALINA_BASE
* multiple tomcat instances with their webapps,configuration,logs ... in their 
own $CATALINA_BASE (and have their appBase/docPath outside this one 
$CATALINA_BASE)

  Instead, we need to run them as
  www.website1.com
  www.website2.com
  which is why we have created multiple IP addresses on the server.
  
  And the jsp websites will sit in seperate physical folders on the server,
  for example:
  C:\website1\
  C:\website2\

 A simple answer to your question is to create additional Host entries
 to your Tomcat server.xml file. 

That's the way to go.

 While I know that there are some on this
 list who disagree with this method, I personally find that configuring
 hosts and contexts in the server.xml file very simple as it makes adding
 new hosts to Tomcat similar to adding new hosts in Apache.

Hosts are usually configured in server.xml (unless you use some kind  of 
dynamic/programmatic configuration).

With contexts, it's not  some on this list who disagree, it is Tomcat 
developers discourage this method in the official documentation. It still 
works as of Tomcat 6 and 7 though.

  Host name=ourserver.com appBase=webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Context path= docBase=C:\website1\ /
   Aliaswww.ourserver.com/Alias
  /Host

You can achieve the same with:
tomcat/conf/server.xml:
  Host name=example.com appBase=example.com-webapps
   unpackWARs=true autoDeploy=true
   xmlValidation=false xmlNamespaceAware=false
   Aliaswww.example.com/Alias
  /Host

tomcat/conf/Catalina/example.com/ROOT.xml:
Context docBase=C:\website1\ /

Notes:
* appBase must be different for every host. Better take care of that even if 
you mean to deploy outside the appBase. appBase can also refer to a  path 
outside the tomcat directory structure.
* if you need/want the Tomcat manager app, you need to deploy it in each host
* if you have no specific reasons for your directory structure (like existing 
backup or fileserver infrastructure), you can as well deploy into appBase, 
with your webbapp in a directory named appBase/ROOT or in a .war file named 
appBase/ROOT.war and discard above mentioned ROOT.xml. It will more closely 
match what other tomcat users/admins are used to and function the same way.

 And Tomcat will now know how to resolve each domain to it's own
 directory rather then inside the ROOT webapp.
 
 There are other ways to configure contexts, which I'm sure folks will
 post about subsequently, but I've found this works quite well and
 whether it's the proper way to do it or not, it will solve your problem.

The/one major drawback is: you need to restart Tomcat completely for any 
webapp context that's added/deleted/reconfigured.
I also don't see that much of an advantage compared to context.xml config 
files.

  I think there's something to do with $CATALINA_BASE that I need to
  configure, but I don't know how.

You need to do that only if you want to run a separate tomcat instance for 
each webapp. Each instance has its own Tomcat configuration, and its own JVM. 
Use it only if you need/want that.

  Regards and thanks
  Conway
 -Jordan

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Any tools to detect tomcat services failure, and start it again automatically?

2010-11-05 Thread Rainer Frey
On Friday 05 November 2010 12:51:25 Bill Wang wrote:
 Hi All,
 
 I am searching the tool (or script) to be used for my tomcat env, that it
 can keep running as daemon in background, detect the tomcat services
 (several versions of tomcat). If it found the services don't run, or have
 failure, it will start it again automatically.
 
 I think I can put the script in cronjob, and run every 5 minutes, or by
 other way, please recommend.
 
  My env is: Solaris 10 with Apache-tomcat 6.0.29 or Jakarta-tomcat 6.0.18

Doesn't the Solaris 10 Service Management Framework provide that feature? 
You'd have to create an appropriate service script for tomcat though. 
Unforunately I only heard about the SMF from advertising, never used it 
myself.

 Regards,
 Bill

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: running tomcat6 under a different user than root (debian)

2010-10-29 Thread Rainer Frey
On Friday 29 October 2010 15:34:29 Mark Thomas wrote:
 If Tomcat has access to a database and the attacker has access to a
 shell prompt (or similar) with the same privileges as Tomcat then the
 attacker has access to the database and there is absolutely nothing you
 can do to prevent that.

In theory, there is a way Tomcat could implement. You could interactively ask 
for all needed passwords when starting Tomcat and keep them only in memory. 
httpd does that by default for encrypted SSL primary keys. But in practice the 
userbase that would accept the inconvenience and the impossibility to 
automatically start tomcat would be too small to spend time for that. And the 
practical security gain is small.

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: SSL Certificate : Unable to configure Tomcat server.xml

2010-10-26 Thread Rainer Frey
On Tuesday 26 October 2010 08:24:53 Richard da Silva wrote:
 (a) Exists in certificate store 'cacerts' (bad idea btw).
 
 Yes it does exist.
 
 But, I took your advice, and created a separate keystore. Then imported the
 certificate there

Did you create a new private key and request a new certificate? You need 
*both* private key and certificate in one keystore entry.
(AFAIK keytool can not import and export private keys, so you can't easily get 
the existing private key out of cacerts and and into the new keystore).

If you did, show your matching tomcat configuration (full server.xml with 
comments stripped) AND unmodified log lines that show the error.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Best practice to upgrade (redeploy) .war files

2010-09-09 Thread Rainer Frey
On Wednesday 08 September 2010 22:49:20 Christopher Schultz wrote:
 Rainer,
 
 On 9/3/2010 2:53 AM, Rainer Frey wrote:
  And if you use cold deployment only, how do you avoid downtime for other
  apps? Do you really use one Tomcat  instance per app?
 
 I use one Tomcat instance per webapp, and I use cold deployment only.

I think this is the best way if you have the resources. But I need to host a 
growing number of rather small, new webapps, and have only one server ATM. 
Getting the memory config right that it is enough heap even in unexpected 
activity bursts, and still be able to run the required number of apps within 
the available RAM seems tricky.
 
  I'd really like to hear some input / experiences about production use
  with several applications with independent release/deploy cycles.
 
 I haven't done it, but Tomcat should be able to do hot re-deployment by
 simply copying the new WAR file over the old one. Is that not an option
 for you?

No, a simple copy triggers no redeployment, as I use autoDeploy=false. I 
want to trigger the redeployment with the tomcat manager.
As I stated in the first mail, that works, but is quite cumbersome:

1. undeploy current webapp with manager. This deletes war file, expanded 
directory, and conf/Engine/Host/app.xml
2. copy war file and (if needed) app.xml of new version to conf and appBase 
directory
3. deploy with manager, by specifying .war or .xml and the context path (that 
was already known to tomcat)

What I was looking for is:
1. copy new .war and .xml
2. tell tomcat (manager) to update (redeploy) the already known application 
context with the new files (where redeploy includes updating/replacing the 
expanded directory) 


 -chris

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Best practice to upgrade (redeploy) .war files

2010-09-03 Thread Rainer Frey
On Monday 30 August 2010 12:55:19 Rainer Frey wrote:
 Hi,

It's not normally my style, but is there really no feedback on this topic?
Does anyone use explicit hot deployment with Tomcat Manager in production? How 
do you actually upgrade deployed applications? 
 
And if you use cold deployment only, how do you avoid downtime for other apps? 
Do you really use one Tomcat  instance per app?

I'd really like to hear some input / experiences about production use with 
several applications with independent release/deploy cycles.

Thanks again
Rainer

 what is the best practice to replace a webapp with a newer version in
 production?
 
 I'm using Tomcat 6.0.29, with unpackWARs=true autoDeploy=false. All
 Webapps reside in appBase, some have a machine-specific context descriptor,
 that I manually copy to conf/Catalina/localhost.
 
 I use the Tomcat Manager (via HTML-Interface) to deploy applications. What
 is the recommended way to upgrade a webapp to a newer version (same war
 name, same desired context path)?
 
 The HTML manager has no redeploy option. deploy is not possible as the
 context already exists. I tried to put the new war file into appBase, and
 use reload, but that won't update the expanded directory to the new war
 file.
 
 What I did is:
  * undeploy
  * copy new war file
  * deploy
 
 This is cumbersome as I have to switch forth and back between manager and
 file operations.
 
 Is there a better way?
 
 Thanks
 Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: multiple instances on a server

2010-08-30 Thread Rainer Frey
On Saturday 28 August 2010 00:11:11 Rainer Jung wrote:
 On 27.08.2010 21:58, Wesley Acheson wrote:
  On Fri, Aug 27, 2010 at 9:41 PM, Pidp...@pidster.com  wrote:
  On 27/08/2010 18:51, Wesley Acheson wrote:
  I think the reason for doing this in ruby is that ruby is single
  threaded, I've been told. The JVM isn't.

 Adding unqualified rumors: Ruby is not single-threaded, 

Right - the language has a thread concept that can be explored as true multi-
threading by interpreters. But the original C-based ruby interpreters for do 
have a global interpreter lock that causes only one native thread to be 
running within one ruby process. This makes these interpreters effectively 
single threaded. (Ruby up to 1.8 only used 1 native thread at all, Ruby 1.9 
maps ruby threads to multiple native threads, but still has the global 
interpreter lock.)

 but the Rails
 framework has a huge lock that effectively make the biggest part of
 request handling serialized. Usually Ruby webapps are based on Rails. So
 yes, Ruby on Rails needs multiple server processes in parallel to
 effectively scale. That might be an outdated rumor though.

It is in so far outdated that Rails from 2.3 on has a threadsafe configuration 
option that enables multi-threaded request processing. This needs a multi-
threaded runtime though to make any sense. JRuby is (of course) multi-
threaded, I'm not sure if there is any other Ruby interpreter that is multi-
threaded.

 Regards,
 
 Rainer

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Best practice to upgrade .war files

2010-08-30 Thread Rainer Frey
Hi,

what is the best practice to replace a webapp with a newer version in 
production?

I'm using Tomcat 6.0.29, with unpackWARs=true autoDeploy=false. All 
Webapps reside in appBase, some have a machine-specific context descriptor, 
that I manually copy to conf/Catalina/localhost.

I use the Tomcat Manager (via HTML-Interface) to deploy applications. What is 
the recommended way to upgrade a webapp to a newer version (same war name, 
same desired context path)?

The HTML manager has no redeploy option. deploy is not possible as the 
context already exists. I tried to put the new war file into appBase, and use 
reload, but that won't update the expanded directory to the new war file.

What I did is:
 * undeploy
 * copy new war file
 * deploy

This is cumbersome as I have to switch forth and back between manager and file 
operations.

Is there a better way?

Thanks
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Best practice to upgrade .war files

2010-08-30 Thread Rainer Frey
On Monday 30 August 2010 13:13:03 Ozgur Ozdemircili wrote:
 On Mon, Aug 30, 2010 at 12:55 PM, Rainer Frey rainer.f...@inxmail.dewrote:
  Hi,
  
  what is the best practice to replace a webapp with a newer version in
  production?
  
  I'm using Tomcat 6.0.29, with unpackWARs=true autoDeploy=false. All
  Webapps reside in appBase, some have a machine-specific context
  descriptor, that I manually copy to conf/Catalina/localhost.
  
  I use the Tomcat Manager (via HTML-Interface) to deploy applications.
  What is
  the recommended way to upgrade a webapp to a newer version (same war
  name, same desired context path)?
  
  The HTML manager has no redeploy option. deploy is not possible as
  the context already exists. I tried to put the new war file into
  appBase, and use
  reload, but that won't update the expanded directory to the new war file.
  
  What I did is:
   * undeploy
   * copy new war file
   * deploy
  
  This is cumbersome as I have to switch forth and back between manager and
  file
  operations.
  
  Is there a better way?

 After trying all sorts of deploy types I have found the best, simplest and
 pain-free deploy in :
 
 - Stop tomcat

I refine myself: what is best practice to *hot* deploy upgraded war file? I 
don't want to influence other webapps.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JMX access with SSL

2010-07-26 Thread Rainer Frey
Hi,

per Java SE Monitoring and Management Guide, JMX access with SSL needs a 
keystore with certificate which is configured with the Java System property 
javax.net.ssl.keyStore. Is it safe to set this property for Tomcat (current 
6.0) to use SSL for JMX, or might this interfere with the SSL configuration of 
a HTTP connector?

Thanks
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh and CATALINA_BASE

2010-07-20 Thread Rainer Frey
On Thursday 15 July 2010 20:26:14 Christopher Schultz wrote:
 Rainer,

Hi, and sorry for the late reply.

[I changed the order of some parts of your mail to reply 

 On 7/12/2010 9:14 AM, Rainer Frey wrote:
  I understand that, but would it be possible/good/not causing problems to
  change this to do CATALINA_BASE=$CATALINA_HOME first, so a setenv.sh can
  rely on CATALINA_BASE being set?
 
 I think I understand the source of the confusion, here:
 
 1. you want CATALINA_BASE to be set before CATALINA_HOME/bin/setenv.sh
is invoked

yes.

 2. CATALINA_BASE must be set to something other than CATALINA_BASE
in order for CATALINA_BASE/bin/setenv.sh to be invoked /at all/

Detecting the right setenv.sh works fine, so I don't care about that.

 3. case here is that CATALINA_HOME/bin/setenv.sh is being used,
but you want to use CATALINA_BASE/[something] in your generic scripts

Exactly.

 if [ -n ${CATALINA_BASE} ] ; then
   THE_BASE_DIR=${CATALINA_BASE}
 else
   THE_BASE_DIR=${CATALINA_HOME}
 fi
[...]
 CONF_DIR=${THE_BASE_DIR}/conf

Thanks for the hint, I'm doing exactly that now.

 I'm not sure a patch is necessary, since the script has all the
 information it needs. Perhaps your script will have to be a bit more
 verbose (for instance, by explicitly testing for CATALINA_BASE), but it
 is certainly not prohibited from doing it's own work.

That's absolutely right. A patch certainly is not necessary. My thought behind 
the question was just: would it be better to solve this once for everybody by 
changing catalina.sh, instead of let everybody handle that in their own 
script?

 if a user is going to use CATALINA_BASE, it
 must be set before any scripts are called, otherwise CATALINA_BASE
 doesn't get used at all (and CATALINA_HOME is the appropriate location
 of whatever configuration files you want to use).
 
 There will be cases where CATALINA_BASE is not set at all, and therefore
 essentially defaults to CATALINA_HOME. 

Well, actually, from a few lines down in catalina.sh, CATALINA_BASE *is* 
always set (to the value of CATALINA_HOME if not set to anything else). The 
rest of the script *does* use CATALINA_BASE unconditionally, and it is used to 
set the catalina.base system property which *is* always used by Tomcat 
internally. 

 It's probably a good thing for setenv.sh to be able to determine whether
 CATALINA_BASE is explicitly set

I did not think I'd ever need this, that's why I asked for other opinions. In 
that case my proposed change is undesirable.

 Does your setenv.sh script expect to use a default file
 (CATALINA_HOME/conf/whatever.jmx) and allow it to be overridden in
 CATALINA_BASE/conf/whatever.jmx? 

No, though it might be a good idea after all. My original plan was to use one 
separate file per instance, no matter whether that instance is standalone or 
part of a multi-instance setup.

 If so, then your script will have to
 test both locations, anyway, because you'll have to check to see if the
 (optional) override file exists in CATALINA_BASE and then check for it
 again under CATALINA_HOME.
 
 Having a blank CATALINA_BASE seems to be helpful in this situation.

Well, then there *is* reason to leave it as is. That is a helpful answer to my 
question.

 Is there a situation that you think doesn't work given the current
 script behavior?

No, and I didn't want to imply that. But in general, one can change something 
that already works to make it work a little bit better :-)

Thanks for your time.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



setenv.sh and CATALINA_BASE

2010-07-12 Thread Rainer Frey
Hi,

in the default case (just one instance, supplied start scripts), CATALINA_BASE 
is set to CATALINA_HOME. But this assignment,

if [ -z $CATALINA_BASE ] ; then
  CATALINA_BASE=$CATALINA_HOME
fi

is done *after* reading setenv.sh. Is this for a specific reason, or just 
accidently?

The reason why I ask is: I want to put some custom config files (specifically: 
jmxremote access and password files) in the conf directory, and setup system 
properties with the path to these files in setenv.sh., but I can't use 
$CATALINA_BASE/conf unconditinally because it is not set at that point by the 
default scripts.

(I don't want to  use $CATALINA_HOME/conf uncontitionally either, as I'll use 
this setenv.sh also in a multi-instance setup).

Rainer


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh and CATALINA_BASE

2010-07-12 Thread Rainer Frey
On Monday 12 July 2010 10:56:19 André Warnier wrote:

 Rainer Frey wrote:
  Hi,
  
  in the default case (just one instance, supplied start scripts),
  CATALINA_BASE is set to CATALINA_HOME. But this assignment,

in catalina.sh

  if [ -z $CATALINA_BASE ] ; then
  
CATALINA_BASE=$CATALINA_HOME
  
  fi
  
  is done *after* reading setenv.sh. Is this for a specific reason, or just
  accidently?

[reason: using CATALINA_BASE in setenv.sh]

 To make clear what you mean and what you are asking, can you indicate
 exactly what version of Tomcat you are talking about, on which platform,
 and where you got it from ? 

Tomcat 6.0.28 and 7.0.0, tar.gz downloads on Linux (I assumed at least the 
platform was obvious when talking about .sh).

I assume this is the same situation in all Tomcat 6 and trunk versions.

 Also indicate in which script you find the
 assignment above, please.

Arggh. I was sure that I have typed catalina.sh somewhere! Must have deleted 
it when reformulating the mail. Thanks for the quick reply!

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh and CATALINA_BASE

2010-07-12 Thread Rainer Frey
On Monday 12 July 2010 12:17:40 André Warnier wrote:
 Rainer Frey wrote:
  On Monday 12 July 2010 10:56:19 André Warnier wrote:
  Rainer Frey wrote:
  Hi,
  
  in the default case (just one instance, supplied start scripts),
  CATALINA_BASE is set to CATALINA_HOME. But this assignment,
  
  in catalina.sh
  
  if [ -z $CATALINA_BASE ] ; then
  
CATALINA_BASE=$CATALINA_HOME
  
  fi
  
  is done *after* reading setenv.sh. Is this for a specific reason, or
  just accidently?
  
  [reason: using CATALINA_BASE in setenv.sh]
  
 So the question was in order to make sure that we were talking about one of
 the official Tomcat scripts, and trying to figure out when it is
 invoked.
 
 This is still not so certain in your case : how do you start Tomcat, and do
 you know exactly which non-Tomcat and yes-Tomcat scripts are being called,

I thought that tar.gz-Download was clear enough. Yes this is the official 
download from tomcat.apache.org. Nothing else  is involved.

 in what order ? (under Linux, probably start with /etc/init.d/tomcatxx,
 and see what it does).

As I didn't mention anything apart the quotesupplied scripts/quote, there 
is no non-Tomcat script. (A reason that I didn't mention Linux in the first 
mail: people start to assume unmentioned things like init scripts or 
distribution packages ... ;) )

 All this to say that, depending on your Tomcat version and origin,
 setenv.sh /may/ not be the best place to define CATALINA_BASE.  

No! I want to *USE* CATALINA_BASE in my setenv.sh, not define it. I'll try to 
explain again:
catalina.sh
 * tests if CATALINA_BASE/bin/setenv.sh exists and sources it
 * otherwise tests if CATALINA_HOME/bin/setenv.sh exists and sources it
 * then tests if CATALINA_BASE is empty and, if so, sets 
CATALINA_BASE=$CATALINA_HOME

I want to know the config directory of the Tomcat instance in my setenv.sh. 
The way things are I need to check whether CATALINA_BASE is set, and if not, 
use CATALINA_HOME as base directory.

If catalina.sh would first set CATALINA_BASE to CATALINA_HOME if not set to 
anything else, I could always sue CATALINA_BASE in setenv.sh.

So my question is: are things done the way theyare for a reason, or is this an 
oversight that can be fixed? (in which case I could make a patch and open an 
issue to change that)
 
 I have not
 verified, but if catalina.sh looks for setenv.sh in $CATALINA_HOME/bin,
 then obviously it isn't, if your intention is to run several instances of
 Tomcat sharing the same bin directory.

No idea how you could imply that from my question. My intention is to have a 
common way to refer to the config directory in setenv.sh in single- and 
multiple-instance (with separate bin-directories) setups.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh and CATALINA_BASE

2010-07-12 Thread Rainer Frey
On Monday 12 July 2010 14:44:19 Konstantin Kolinko wrote:
 2010/7/12 Rainer Frey rainer.f...@inxmail.de:
  Hi,
  
  in the default case (just one instance, supplied start scripts),
  CATALINA_BASE is set to CATALINA_HOME. But this assignment,
  
  if [ -z $CATALINA_BASE ] ; then
   CATALINA_BASE=$CATALINA_HOME
  fi
  
  is done *after* reading setenv.sh. Is this for a specific reason, or just
  accidently?
 
 I think that in the following lines of
 http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/bin/catalina.sh?view=mark
 up
 
 120   if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
 121   . $CATALINA_BASE/bin/setenv.sh
 122   elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
 123   . $CATALINA_HOME/bin/setenv.sh
 124   fi
 
 the line 120 should be something like
 if [ -n $CATALINA_BASE ]  [ -r $CATALINA_BASE/bin/setenv.sh ]; then
 
 (that is already fixed in trunk in a different way).
 
 
 In any case, if CATALINA_BASE is not set,
 $CATALINA_BASE/bin/setenv.sh cannot be read (chicken vs. egg), and in
 that case $CATALINA_HOME/bin/setenv.sh is read.
 
 That is nearly the same result as if there was assignment
 CATALINA_BASE=$CATALINA_HOME before.

I understand that, but would it be possible/good/not causing problems to 
change this to do CATALINA_BASE=$CATALINA_HOME first, so a setenv.sh can rely 
on CATALINA_BASE being set?

 So, what is your problem?
 You must set CATALINA_BASE before calling the standard scripts, if you
 need this feature of distinct CATALINA_HOME vs. CATALINA_BASE. This
 feature is not enabled by default.

I want to know the path to the conf directory in setenv.sh, and I prefer to do 
that in a manner that does not depend on whether this setenv.sh is used 
in a standard installation with CATALINA_BASE=$CATALINA_HOME or in a multi-
instance setup with 
distinct CATALINA_BASE and CATALINA_HOME.

If catalina.sh would do CATALINA_BASE=$CATALINA_HOME before sourcing 
setenv.sh, I could always use $CATALINA_BASE/conf in setenv.sh, and would not 
need to take care of this distinction again.

So my question essentially is: would you be interested in a patch that changes 
catalina.sh, or is there a good reason to leave it as is, and let everybody  
sort this out themselves in their setenv.sh?

 Best regards,
 Konstantin Kolinko

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk file not found

2010-05-17 Thread Rainer Frey
On Sunday 16 May 2010 19:18:47 Caldarale, Charles R wrote:
  From: Markus Mehrwald [mailto:mmehrw...@gmx.at]

[...]

  Additionally we can use mod_security to precheck requests
  delivered to tomcat to remove use- and sensless requests
  and minimise the risk of attacks.
 
 Why do you think httpd is less susceptible to attacks than Tomcat is? 
 Adding complexity usually increases risk, not the other way around.

Do you actually know mod_security? This is not randomly adding complexity. 
mod_security checks requests according to rules that can be site- or 
application-specific, and therefore try to prevent attacks on the application 
rather than on Tomcat or httpd. This is real additional functionality and so 
an absolutely valid reason to put httpd in front of Tomcat.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HttpServletRequest.getParameter() inside a valve

2010-03-04 Thread Rainer Frey
On Thursday 04 March 2010 17:41:17 Christopher Schultz wrote:
 It does: calling request.getParameter will consume the request body if
 the following are true:
 
 1. The protocol is HTTP or HTTPS
 2. The method is POST
 3. The Content-Type is application/x-www-form-urlencoded
 [4. A call to request.getParameter*, which you're already doing]
 
  Those cases are a java.io.IOException: Connection reset by peer:
  Amount read didn't match content-length   for the WebObject servlet,
  and a EOFException in the invoker servlet in Jboss).
 
 That seems fairly straightforward: the client is sending a
 Content-Length that doesn't match the amount of data sent: too few bytes
 or too many. Can you post the whole stack trace?

Could this be because the input stream of the body is already consumed and the 
servlet can't read Content-Length number of bytes anymore, even when the 
Content-Length header was originally correct?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [Fwd: Re: Parameters disappear from PUTs]

2010-02-08 Thread Rainer Frey (Inxmail GmbH)
On Saturday 06 February 2010 03:27:23 c...@munat.com wrote:
 Are you serious?

[...]

 I'm certain you're not suggesting that browsers be forced to insert a name
 before the parameter string in every POST request.
[...]
 What does *any* of this have to do with a simple
 post to the list explaining that parameters passed with a PUT request seem
 to be stripped out by Tomcat
[...]
 It's a mystery to me.

If you had properly formatted your message in a way that request headers, 
request body and response could be distinguished, you would've gotten a useful 
response sooner. I also misread this several times before I noticed, because 
it all looked like a big block of headers (quote characters intentionally 
removed):

PUT /json/members/1b35d32f-714d-4393-b8c2-b4805e0c7a13 HTTP/1.1
Host: localhost:12344
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
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
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost:12344/
Content-Length: 297
Cookie: JSESSIONID=dexcmg3b1r45
emailAddress=bozo%40clown.comtitle=Head%20ClownnameGiven=BozonamesMiddle=ThenameFamily=ClownnamePreferred=Bozogender=Malepassword=passwordConfirm=id=1b35d32f-714d-4393-
b8c2-
b4805e0c7a13facebookName=bozo.the.clowntwitterName=i.am.bozoflickrName=bozos.circuslinkedinName=mr.clown.to.you
HTTP/1.x 201 Created
Content-Length: 82
Content-Type: text/plain; charset=UTF-8
X-Lift-Version: 1.1-M4
Server: Jetty(6.1.22)

 Chas.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to solve the problem java.lang.OutOfMemoryError: unable to create new native thread in Tomcat5.5.26

2009-11-30 Thread Rainer Frey (Inxmail GmbH)
On Monday 30 November 2009 10:57:04 Peter Chen wrote:
 Hi,

 I meet one problem of OutOfMemoryError when I am running the
 Tomcat5.5.26. The OS is Solaris 10 sparc, and the JVM version is
 1.5.0.12, and following is the detail of stack information.

 Nov 29, 2009 12:41:16 AM

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run

 SEVERE: Caught exception (java.lang.OutOfMemoryError: unable to create
 new native thread) executing
 org.apache.tomcat.util.net.leaderfollowerworkerthr...@958b36,

While Andre is right that system memory size and JVM parameters are important, 
this is not the usual OOM that heap space is full. Java is not able to create 
a OS level thread for a new Java thread. 

The most common cause seems to be that there is not enough memory to allocate 
for the thread stack, either because there is not enough system memory 
available, or the memory limit for the java process is reached.

You might be able to increase the memory limit for the process, if OS permits 
that and you  have enough physical memory. If the limit is indeed physical 
memory, cou can of course increase that or try to move other processes away 
from the machine.

Otherwise you need to provide java with enough memory for the new thread.

One approach is to reduce the stack size. There is  a -Xss switch to java, but 
I don't know Solaris, so I'm not sure this works or is sufficient. Possibly 
the OS has also to be configured to use/allow a smaller stack size.

Another approach is to reduce the other memory usage of the java process, by 
reducing heap (or perhaps permgen) size, so java can use more of its 
permitted memory for thread stacks instead of heap. See 
http://www.egilh.com/blog/archive/2006/06/09/2811.aspx and the links in the 
article.

A completely different cause might be that Solaris imposes a limit of the 
number of threads, regardless of the memory/stack size, per process. Perhaps 
a Solaris expert has more info.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Deployment specific configuration - best practice

2009-11-17 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 17 November 2009 01:15:52 Mark Thomas wrote:
 Rainer Frey wrote:
   * settings in /META-INF/context.xml

 This one please.

 Tomcat will extract it on first deployment. OK that will fail but we can
 then edit the extracted version and Tomcat will use that from then on.

Thanks for the info, will do that. The actual problem is described in 
Message-Id: 200911161424.38011.rainer.f...@inxmail.de (Webapp reload and 
DriverManager in Tomcat 6.0 trunk).

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-17 Thread Rainer Frey
On Monday 16 November 2009 14:24:37 Rainer Frey wrote:
 Hi,

 The error originally occured in a much more complicated application with a
 home-grown DB connection pool, but the servlet I mentioned above exhibits
 this behavior. For anyone willing to test: here is a  .war file with this
 servlet, please edit web.xml to fill in your DB connection details.
 http://download.inxmail.com/data/user/rfy/testdb.war

As requested, I changed the demo app to use a META-INF/context.xml, so please 
download again from http://download.inxmail.com/data/user/rfy/testdb.war and, 
after deploying, edit conf/engine/host/testdb.xml

I also uploaded the changed servlet source to 
http://download.inxmail.de/data/user/rfy/DBTestServlet.java

Thanks for any help
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-17 Thread Rainer Frey
On Monday 16 November 2009 14:24:37 Rainer Frey wrote:
 Hi,

 I found a problem when using DriverManager.getConnection() with a build
 from current 6.0 SVN 

[...]

As requested, added a bugzilla entry:
https://issues.apache.org/bugzilla/show_bug.cgi?id=48214

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Deployment specific configuration - best practice

2009-11-17 Thread Rainer Frey
On Tuesday 17 November 2009 16:04:48 Mark Thomas wrote:
 Rainer Frey (Inxmail GmbH) wrote:
  On Tuesday 17 November 2009 01:15:52 Mark Thomas wrote:
  Rainer Frey wrote:
  Thanks for the info, will do that. The actual problem is described in
  Message-Id: 200911161424.38011.rainer.f...@inxmail.de (Webapp reload
  and DriverManager in Tomcat 6.0 trunk).

 Should have said this before - create a Bugzilla entry for this and
 attach your demo app there. 

Done: https://issues.apache.org/bugzilla/show_bug.cgi?id=48214

Thanks
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Deployment specific configuration - best practice

2009-11-16 Thread Rainer Frey
Hi,

I'm preparing a sample webapp for this list to illustrate a problem that I 
have with JDBC driver loading in a servlet. Anyone who'd try this would need 
to edit the jdbc connection data to test with a local DB. What is the easiest 
method for you to configure a webapp that I'll provide?

 * settings as init params in web.xml
 * settings in /META-INF/context.xml (both ways you'd need to upack, edit, 
repack and deploy)
 * a separate context file along with the war file
 * any other idea?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-16 Thread Rainer Frey

Hi,

I found a problem when using DriverManager.getConnection() with a build from 
current 6.0 SVN (this morning). Basically I have a Servlet that's loaded on 
startup and does following in its init() method:

try
{
Class.forName( driver );
}
catch( ClassNotFoundException x )
{
log( x.toString(), x );
}
Connection con = null;
try
{
con = DriverManager.getConnection( url, user, pass );
log( connection established:  + con.toString() );
}
catch( SQLException x )
{
log( x.toString(), x );
throw new ServletException( x.toString(), x );
}

After starting Tomcat, I get the following expected output:

Nov 16, 2009 1:56:11 PM org.apache.catalina.core.ApplicationContext log
INFO: DBTestServlet: connection established: 
org.postgresql.jdbc4.jdbc4connect...@17ec9f7
Nov 16, 2009 1:56:12 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()

But when reloading the context (by touching web.xml), I get the following 
exception:

Nov 16, 2009 1:56:32 PM org.apache.catalina.core.ApplicationContext log
SEVERE: DBTestServlet: java.sql.SQLException: No suitable driver found for 
jdbc:postgresql://127.0.0.1/inxmail
java.sql.SQLException: No suitable driver found for 
jdbc:postgresql://127.0.0.1/inxmail
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.inxmail.test.DBTestServlet.init(DBTestServlet.java:49)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at 
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1192)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1290)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Nov 16, 2009 1:56:32 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /testdb threw load() exception

I tested with Java 6 (1.6.0_17) and JDBC 3 and 4 Drivers for Oracle 
(ojdbc1.4.jar from Oracle 10, ojdbc6 from Oracle 11) as well as PostgreSQL.

Everything works fine with Tomcat 6.0.20.

The error originally occured in a much more complicated application with a 
home-grown DB connection pool, but the servlet I mentioned above exhibits 
this behavior. For anyone willing to test: here is a  .war file with this 
servlet, please edit web.xml to fill in your DB connection details.
http://download.inxmail.com/data/user/rfy/testdb.war

I'm testing our application for compatibility with the upcoming 6.0.21 
release, so I'd be grateful if s.o. could try to verify whether this is a 
Bug, so it has a chance to be addressed before 6.0.21

Thanks, and sorry for the lengthy message
Rainer




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-16 Thread Rainer Frey
On Monday 16 November 2009 14:32:41 Mikolaj Rydzewski wrote:
 Rainer Frey wrote:
  I found a problem when using DriverManager.getConnection() with a build
  from current 6.0 SVN (this morning). Basically I have a Servlet that's
  loaded on startup and does following in its init() method:

 You should really use JNDI to obtain DataSource.

That's generally right. This is about a legcy application, and I want to make 
sure it still works after a minor version update of tomcat. So lets please 
leave such discussion out of this thread.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-16 Thread Rainer Frey
On Monday 16 November 2009 14:24:37 Rainer Frey wrote:
 Hi,

 I found a problem when using DriverManager.getConnection() with a build
 from current 6.0 SVN (this morning). 
[...]
 Everything works fine with Tomcat 6.0.20.

I forgot a very important information: the JDBC driver is in tomcat/lib  
because our server usually runs several instances of the same webapp, and the 
customers have to add the JDBC driver themselves because we can't supply them 
due to licensing issues.

Rainer 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Webapp reload and DriverManager in Tomcat 6.0 trunk

2009-11-16 Thread Rainer Frey (Inxmail GmbH)
On Monday 16 November 2009 15:00:32 Pid wrote:
 On 16/11/2009 13:54, Rainer Frey wrote:
  I forgot a very important information: the JDBC driver is in tomcat/lib
  because our server usually runs several instances of the same webapp, and
  the customers have to add the JDBC driver themselves because we can't
  supply them due to licensing issues.

 In your test servlet, can you add some logging to see which classloader
 the successfully loaded driver class has, the first time you start the app?

It is (as expected), the tomcat common classloader, also at reload.

INFO: DBTestServlet: Class org.postgresql.Driver loaded by 
org.apache.catalina.loader.standardclassloa...@184ec44
   ^^^
Tomcat start

Nov 16, 2009 3:12:11 PM org.apache.catalina.core.ApplicationContext log
INFO: DBTestServlet: connection established: 
org.postgresql.jdbc4.jdbc4connect...@121177e
Nov 16, 2009 3:12:11 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Nov 16, 2009 3:12:11 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Nov 16, 2009 3:12:41 PM org.apache.catalina.core.ApplicationContext log
INFO: DBTestServlet: Class org.postgresql.Driver loaded by 
org.apache.catalina.loader.standardclassloa...@184ec44
   ^^^
Context reload

Nov 16, 2009 3:12:41 PM org.apache.catalina.core.ApplicationContext log
SEVERE: DBTestServlet: java.sql.SQLException: No suitable driver found for 
jdbc:postgresql://127.0.0.1/inxmail
java.sql.SQLException: No suitable driver found for 
jdbc:postgresql://127.0.0.1/inxmail
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.inxmail.test.DBTestServlet.init(DBTestServlet.java:50)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 

I uploaded the webapp again with this logging, and also uploaded the full 
servlet source file to 
http://download.inxmail.de/data/user/rfy/DBTestServlet.java

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat6 does not shutdown

2009-10-22 Thread Rainer Frey
On Thursday 22 October 2009 12:07:29 NabiL wrote:
 Hi,

 I use tomcat 6 installed on Linux RedHat5. I enabled JMX as follows
 JAVA_OPTS=$JAVA_OPTS -Djava.rmi.server.hostname=10.97.242.177
 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=2099
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false

Add those options to CATALINA_OPTS, instead of JAVA_OPTS. CATALINA_OPTS is 
used only for starting tomcat.

 After starting tomcat, i can successfully connect to remote process using
 Jconsole.

 When i tried to stop tomcat from comand line using ./shutdown.sh i got the
 following errors.

 Error: Exception thrown by the agent : java.rmi.server.ExportException:
 Port already in use: 2099; nested exception is:
 java.net.BindException: Address already in use

These options cause Java to listen on port 2099. If tomcat is running, it 
listens on this port. The Java program that shuts down tomcat wants also to 
listen on this port, but it is already in use. Of course it is not necessary 
for this short-living program to open an RMI server, above solution avoids 
this.

 Any help !!

 Thanks in adavance.
 Nabil

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat behind Apache reverse proxy

2009-08-11 Thread Rainer Frey
We develop an application that is heavily using different kind of web services 
(SOAP, Hessian) and only has few JSPs that are used with a browser. We bundle 
Tomcat (6.0.20) as server runtime.

Some customers (with varying degree of experience) want to use this behind 
Apache HTTPD as reverse proxy and ask us for instructions. 
What would you recommend to describe in a general instruction document without 
knowing more details of the customers environment, mod_proxy_http or 
mod_proxy_ajp? (I think mod_jk is an option mostly for knowledgable customers 
who have specific reasons to consider it).

I also try to keep the need for a customer to edit server.xml as a minimum, 
and put as much of the customizable values into catalina.properties.

What is the effect of not setting proxyName and proxyPort on the connector in 
either case? Would that lead to invalid redirects? (Our application doesn't 
use ServletRequest#getServerName() or #getServerPort() directly.) With AJP, 
isn't that information also available in the protocol request and set 
automatically by the AJP connector?

I also have an ideo for a (maybe dirty) hack: if I always put the proxyName 
and proxyPort attributes in server.xml, and use properties that expand to 
empty values by default, will this work in case there is no proxy in the 
setup?

e.g. in server.xml:
Connector  proxyName=${proxy.name} proxyPort=${proxy.port} .../

and in catalina.properties:
proxy.name=
proxy.port=

Thanks for any input
Rainer 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat behind Apache reverse proxy

2009-08-11 Thread Rainer Frey
On Tuesday 11 August 2009 10:40:48 Mark Thomas wrote:
 Rainer Frey wrote:
  Some customers (with varying degree of experience) want to use this
  behind Apache HTTPD as reverse proxy and ask us for instructions.
  What would you recommend to describe in a general instruction document
  without knowing more details of the customers environment, mod_proxy_http
  or mod_proxy_ajp? (I think mod_jk is an option mostly for knowledgable
  customers who have specific reasons to consider it).

 If the customer has done this before, whatever they are familiar with.
 If I had a free choice mod_proxy_http.

Thanks for this input. Do you have any technical reasons, or is it more about 
maturity of the module?

  With AJP,
  isn't that information also available in the protocol request and set
  automatically by the AJP connector?

 I believe so.

I tried, and it works. Does it make sense to set these attributes at all on an 
APR connector then?

  I also have an idea for a (maybe dirty) hack: if I always put the
  proxyName and proxyPort attributes in server.xml, and use properties that
  expand to empty values by default, will this work in case there is no
  proxy in the setup?

 Have you tried it?

I did now, and it does work. I noticed that property expansion in server.xml 
seems not to be documented at all. Is this intentionally left out, or just 
missing?

Also, properties from catalina.properties and from Java System Properties are 
expanded, but it seems that catalina.properties takes precedence. I find this 
surprising, because system properties are in my perception more dynamic and 
runtime/individual start specific than values in a config file. Is this 
intentional behavior? If not, should I report a bug?

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat behind Apache reverse proxy

2009-08-11 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 11 August 2009 15:37:54 Rainer Frey wrote:

 Also, properties from catalina.properties and from Java System Properties
 are expanded, but it seems that catalina.properties takes precedence. I
 find this surprising, because system properties are in my perception more
 dynamic and runtime/individual start specific than values in a config file.
 Is this intentional behavior? If not, should I report a bug?

Out of curiosity: does anyone know where in the source  the expansion of 
catalina.properties in server.xml is implemented?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat behind Apache reverse proxy

2009-08-11 Thread Rainer Frey
On Tuesday 11 August 2009 16:10:07 Mark Thomas wrote:
 Rainer Frey wrote:
[...]
Mark, thanks for your patient help with my questions. I really appreciate 
this.

  Also, properties from catalina.properties and from Java System Properties
  are expanded, but it seems that catalina.properties takes precedence. I
  find this surprising, because system properties are in my perception more
  dynamic and runtime/individual start specific than values in a config
  file. Is this intentional behavior? If not, should I report a bug?

 It isn't documented so there can't be a bug :)

Touch. That is indeed right ;-)

But seriously, how is it intended to work? I saw that in 
CatalinaProperties.loadProperties(), all properties from catalina.properties 
are added to the system properties, overwriting any previous values. This 
could be easily fixed. I'd write a patch myself if desired.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Setting maxThreads from outside tomcat

2009-07-31 Thread Rainer Frey
On Thursday 30 July 2009 22:44:47 Roger Powers wrote:

 --- On Thu, 7/30/09, Roger Powers prog...@yahoo.com wrote:
  From: Roger Powers prog...@yahoo.com
  Subject: Setting maxThreads from outside tomcat
  To: users@tomcat.apache.org
  Date: Thursday, July 30, 2009, 4:35 PM
  Hi,
 
  I am making tomcat 6 work on different platforms that need
  different values for maxThreads in the Connector in
  server.xml.
 
  Ideally, I would set an environment variable and/or
  property that could be used when server.xml is read - is
  something like this supported?
 
  Or, worse case, it looks like I could put a value onto the
  command line and look for it in Bootstrap.main() and then
  consult that value as the connectors are made, but that's
  pretty ugly.
 
  Any ideas?
  RP
 Sorry, I just discovered that catalina.properties can
 be used to set variables that can be used in server.xml -
 problem solved!

Java System properties can also be used - you can set them in the environment 
variables CATALINA_OPTS or JAVA_OPTS, eg. in $CATALINA_BASE/bin/setenv.sh

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml not updating dataSource

2009-07-21 Thread Rainer Frey
On Monday 20 July 2009 17:08:15 Mike Frohme wrote:

Edit the copy of the context.xml file and all will work as you
expect.
  
   1. In production, the operations folks don't have to unpack the app,
   edit the context file and re-pack the app to edit the configuration.
  
   2. When a new version of the app is installed, the environment specific
   configuration isn't lost.
  
   If you want to remove the old configuration, undeploy the app first
   which will remove the old configuration file.
 
  A an aside, wouldn't it be nice if it were configurable whether tomcat
  copies the context.xml to $CATALINA_BASE/conf?  Then administrators could
  decide to never have local configuration and always rely on the config
  within the war?
 Sorry for the late reply, Rainer.

 There is, in principle.  Set deployXML to false in the Host declaration in
 your server.xml and it will do exactly what you want.  On the flip side,
 tomcat will remove the configuration when the app is undeployed, so you
 need a little care in your deployment process.

Thanks for the response. Actually, doesn't this do the exact oposite of what I 
want?

What I want (as option): I know that developer/packager did it right and I 
never want to have local configuration. Always use the context.xml within the 
currently deployed application, updated every time I redeploy the app.

deployXML=false seems to do: Never trust the developer, don't even copy their 
context configuration to local configuration if there is no local one yet. 
Only use a configuration I manually put on the server.

Could anyone please comment whether I understand that right?

 Mike

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'

2009-07-14 Thread Rainer Frey
On Tuesday 14 July 2009 14:31:06 Caldarale, Charles R wrote:
  From: Neil Youngman [mailto:neil.young...@wirefast.com]
  Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
  URL 'null'
 
  That's $CATALINA_BASE/conf, not $CATALINA_HOME/conf

 Regardless, the lack of an [engine] subdirectory is an indication that you
 may not be running Tomcat from where you think you are.

Maybe 'WSAM' is the engine name. Maybe the OP should post his complete 
server.xml.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'

2009-07-14 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 14 July 2009 10:42:19 Neil Youngman wrote:
 I'm having trouble getting Oracle access from Axis2 to work under
 Tomcat 6. I've spent a lot of time Googling and prodding and poking
 the application and I haven't found a solution that works for me.

 Oddly the configuration I'm using seems to work for another
 application.

 Let's start with the configuration in axis2/META-INF/context.xml,
 which is:

 ?xml version='1.0' encoding='utf-8'?

 Context
 Resource name=jdbc/AppDatabase
   auth=Container
   type=javax.sql.DataSource
   factory=org.apache.commons.dbcp.BasicDataSourceFactory

You are explicitly specifying the original DBCP factory 
class org.apache.commons.dbcp.BasicDataSourceFactory here. Is this for 
specific reason, and is the jar file available (I believe it needs to be in 
tomcat's lib dir, though I'm not sure if the resource is application 
specific)? What happens if you leave out the factory attribute?

 Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
 JDBC driver of class '' for connect URL 'null' at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:1150) at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourceja
va:880) at

Obviously the packaged and renamed tomcat DBCP factory is used. Maybe a tomcat 
fallback if the specified factory is not found? Also might there be a 
fallback for the JDBC driver if the driver is not found?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [ERROR] Cannot create JDBC driver of class '' for connect URL 'null'

2009-07-14 Thread Rainer Frey
On Tuesday 14 July 2009 15:56:07 Caldarale, Charles R wrote:
  From: Neil Youngman [mailto:neil.young...@wirefast.com]
  Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
  URL 'null'
 
  As an experiment I removed the WSAM directory and several restarts have
  not recreated it.

 Tomcat won't create the [engine]/[host] directory until it needs to, such
 as when copying a Context element from a META-INF/context.xml file. 

Has Tomcat 6 done that since initial release? I vaguely remember reading s.th. 
related in 6.0.20 change log.

To the OP: what exact version are you using?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml not updating dataSource

2009-06-23 Thread Rainer Frey
On Monday 22 June 2009 13:53:47 Mark Thomas wrote:
  Edit the copy of the context.xml file and all will work as you expect.
 
 1. In production, the operations folks don't have to unpack the app,
 edit the context file and re-pack the app to edit the configuration.

 2. When a new version of the app is installed, the environment specific
 configuration isn't lost.

 If you want to remove the old configuration, undeploy the app first
 which will remove the old configuration file.

A an aside, wouldn't it be nice if it were configurable whether tomcat copies 
the context.xml to $CATALINA_BASE/conf?  Then administrators could decide to 
never have local configuration and always rely on the config within the war?

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml not updating dataSource

2009-06-22 Thread Rainer Frey
On Monday 22 June 2009 12:02:49 Mark Thomas wrote:

 You are editing the wrong file. When a web application is first
 deployed, any META-INF/context.xml is copied to
 CATALINA_BASE/conf/enginename/hostname (usually
 CATALINA_BASE/conf/Catalina/localhost) and renamed to appName.xml. Eg
 for a war file named myapp.war a META-INF/context.xml would be renamed
 to myapp.xml#

 Edit the copy of the context.xml file and all will work as you expect.

What is the reason for this behavior? It seems quite counterintuitive. If I 
package a new version of my application with updated configuration, I usually 
expect that this configuration is used when I deploy this application, esp. 
with the manager deployment functionality. 

If I want to deploy the application on different tomcat installations, I have 
to delete the file from CATALINA_BASE/conf on each one, and it even might 
have a different path on each. So this behavior causes more work for my use 
case, and I have to do s.th. in addition to the standard deployment call. Is 
there a benefit from it?

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Context.xml not updating dataSource

2009-06-22 Thread Rainer Frey
On Monday 22 June 2009 13:53:47 Mark Thomas wrote:
 Rainer Frey wrote:
  On Monday 22 June 2009 12:02:49 Mark Thomas wrote:
  You are editing the wrong file. When a web application is first
  deployed, any META-INF/context.xml is copied to
  CATALINA_BASE/conf/enginename/hostname (usually
  CATALINA_BASE/conf/Catalina/localhost) and renamed to appName.xml. Eg
  for a war file named myapp.war a META-INF/context.xml would be renamed
  to myapp.xml#
 
  Edit the copy of the context.xml file and all will work as you expect.
 
  If I want to deploy the application on different tomcat installations, I
  have to delete the file from CATALINA_BASE/conf on each one, and it even
  might have a different path on each. 
 
 If you want to remove the old configuration, undeploy the app first
 which will remove the old configuration file.

Thanks, this was the point I missed.

 Mark

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JMX remote access in Tomcat 5.0

2009-05-20 Thread Rainer Frey (Inxmail GmbH)
Hi,

[Disclaimer: I know well that Tomcat 5.0 is obsolete, an update is planned but 
not possible until later this year, and I don't want to leave the monitoring 
issues unaddressed until then.]

I use Tomcat 5.0 with Java 6. In Java 6, local JMX access with jconsole is 
active by default. But when I connect, I only see the VM default MBeans. If I 
enable remote access (with System property 
com.sun.management.jmxremote.port=), but still connect localy via the 
Pid, I also see the Catalina and User trees in the MBeans page. Can anyone 
explain what the difference is?

Also, I want to adapt the JmxRemoteLifecycleListener, that is in Tomcat Trunk 
(http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java),
 
for Tomcat 5. This code has undergone a few changes over time, regarding the 
usage of a seperate MBeanServer by Tomcat. First version did not account for 
that at all, intermediate versions configured Ports for both the platform and 
the separate tomcat MBeanServer. The newest revision then removed this again, 
with the  remark that tomcat uses the platform MBeanServer.

Could anyone help me understand this? Has there been a previous code change in 
Tomcat, that this change in the listener reflects? Or does this cause tomcat 
to use the platform MBeanServer? And what is the situation in Tomcat 5.0? 
Which revision of the lifecycle listener is the best one to base a backport 
for 5.0 on?

One more question: the  JmxRemoteLifecycleListener seems to be in trunk only, 
what is the state regarding inclusion in Tomcat 6.0?

Thanks for any information
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Change thread name of HTTP worker threads at Runtime

2009-05-18 Thread Rainer Frey (Inxmail GmbH)
On Friday 15 May 2009 16:58:55 Caldarale, Charles R wrote:
  From: Rainer Frey (Inxmail GmbH) [mailto:rainer.f...@inxmail.de]
  Subject: Re: Change thread name of HTTP worker threads at Runtime
 
  I just read this up. It says should ensure. How strong this is
  sepends on whether this has RFC SHOULD characteristics, or is
  merely a recommendation.

 It's not a recommendation, it's a requirement.  The Tomcat committers are
 extremely careful about implementing the spec precisely.  There's only one
 thread that processes a request from start to finish.

  - Chuck

Thanks for confirming. I didn't ever look at this aspect of servlet spec 
before.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Change thread name of HTTP worker threads at Runtime

2009-05-15 Thread Rainer Frey (Inxmail GmbH)
On Wednesday 06 May 2009 12:42:09 Ronald Klop wrote:
 Op woensdag, 6 mei 2009 11:58 schreef Rainer Frey (Inxmail GmbH)  :

  Hi,
 
  I occassionally have to analyse thread dumps of tomcat servers which
  serve up to 25 instances of the same (quite complex) web service
  application. All custom threads have names that contain the instance id,
  but it is impossible to see which HTTP processor threads serve which
  application instance.
 
  Now we came up with the idea to rename the threads at the beginning of
  the request processing (to current-name + application-id), and rename
  them back totheir base name after the request is processed. As these
  threads are managed by Tomcat, I am wondering: is this a bad idea?
  Anything in Tomcat (or Java) that could cause a problem if we do that?

 At the company I work we are doing this for a couple of years already with
 Tomcat 4, 5 and now 6. Works very well. And makes threaddumps more easy to
 read.

 Ronald.

Thanks for confirming, I implemented this and it works fine. I wonder though:
is the assumption that one request is processed by one thread (and never 
passed to another during processing) true for all connectors, including NIO?

Regards
Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Change thread name of HTTP worker threads at Runtime

2009-05-15 Thread Rainer Frey (Inxmail GmbH)
On Friday 15 May 2009 16:07:11 Christopher Schultz wrote:
 Rainer,

 On 5/15/2009 2:37 AM, Rainer Frey (Inxmail GmbH) wrote:
  is the assumption that one request is processed by one thread (and never
  passed to another during processing) true for all connectors, including
  NIO?

 Are you asking if the request is passed to another thread at any point
 for processing? 

Exactly, in my case I'm interested in the span between entering the 
application's filter chain and returning from it in the outmost filter.

 Not likely, since Java doesn't support continuations. 
 The request handler thread should handle the request from start to finish.

Is this explicitly stated somewhere? There could theoretically be a queue of 
Request/Response pairs, and different threads could pick one up, execute one 
element in the filter chain, and put the pair back for the next thread.

 The servlet spec goes on to require (in section 8.2) that the container
 dispatches sub-requests (includes or forwards) using the same thread
 that was originally chosen to handle the primary request.

I just read this up. It says should ensure. How strong this is sepends on 
whether this has RFC SHOULD characteristics, or is merely a recommendation.

 I think you're safe.

I guess so too, but it's nice to hear opinions of people with insightinto 
internals.

 -chris

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Change thread name of HTTP worker threads at Runtime

2009-05-06 Thread Rainer Frey (Inxmail GmbH)
Hi,

I occassionally have to analyse thread dumps of tomcat servers which serve up 
to 25 instances of the same (quite complex) web service application. All 
custom threads have names that contain the instance id, but it is impossible 
to see which HTTP processor threads serve which application instance.

Now we came up with the idea to rename the threads at the beginning of the 
request processing (to current-name + application-id), and rename them back 
totheir base name after the request is processed. As these threads are 
managed by Tomcat, I am wondering: is this a bad idea? Anything in Tomcat (or 
Java) that could cause a problem if we do that?

Also, is this better implemented in the servlets (almost all our relevant 
requests go to servlets, the are hardly any JSP) or as a filter? Filter seems  
a better idea, but I never developed one, so I might overlook some 
characteristic that makes this unsuitable to do in a filter.

We want to implement this first on Tomcat 5.0, but migrate to Tomcat 6.0 later 
this year. Any notable differences in this regard?

TIA for any thoughts on this.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: StandardServer.await: Invalid command 'GET / HTTP/1.1' received

2009-05-05 Thread Rainer Frey
On Tuesday 05 May 2009 12:01:24 balachandra maddina wrote:
 Hi All,
   5 May, 2009 3:24:11 PM org.apache.catalina.core.StandardServer await
   WARNING: StandardServer.await: Invalid command 'GET / HTTP/1.1' received

 im using eclipse ganymede and the the server configuration is set to use
 tomcat6 installation and both http/1.1 and admin port values are set to
 8080. not sure whats causing the issue. any help would be appreciated.

Exactly that *is* the issue! The admin port is for receiving admin commands, 
and the HTTP port is for receiving HTTP requests. You must use different 
ports. What happened is: the HTTP connector could not start, because the 
server already opened that port. Your browser/client/whatever sent the 
request to the admin port , the server does not understand HTTP and logs  
this error.

 Thank you,
 bala.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Surprising auto-(un)deploy behavior

2009-03-31 Thread Rainer Frey (Inxmail GmbH)
Hi,

I just noticed a surprising behavior change between Tomcat 5.0 and Tomcat 
6.0.18 regarding auto-undeployment of war files. I use both versions in 
default configuration, which means autoDeploy and unpackWARs are both true.

(I don't think this matters much, but I tried this with Mac OS X and Java 5 as 
well as Linux and Java 6).

In Tomcat 5.0, I copy the war file to the webapps directory, it is unpacked 
and deployed. Then I can delete the war file, and the web application runs 
and will be deployed on next start from the unpacked directory. 

In Tomcat 6.0 deployment works the same, but when I delete the war file, the 
application is undeployed and the expanded directory is deleted. Is this 
change documented somewhere, and is there a way to get the old behavior with 
tomcat 6.0?

Also I think that in Tomcat 5, it was *necessary* to delete the war file to be 
able to edit the web.xml ofthe deployed application, otherwise it was 
overwritten from the war file at least at the next server start. What will 
Tomcat 6 do on startup in this case (a .war file *and* an expanded directory 
of the same webapp exist, with a newer web.xml in the expanded directory?

My question regards development, so there is no need to convince me that 
autodeployment should not be used in production :-)

Regards
Rainer Frey

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Surprising auto-(un)deploy behavior

2009-03-31 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 31 March 2009 09:42:58 Mark Thomas wrote:
 Rainer Frey (Inxmail GmbH) wrote:
  In Tomcat 6.0 deployment works the same, but when I delete the war file,
  the application is undeployed and the expanded directory is deleted. Is
  this change documented somewhere,

 Doesn't look like it

Then, is this intended behavior, or a bug?

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: not valid Tomcat installation

2009-03-23 Thread Rainer Frey (Inxmail GmbH)
On Monday 23 March 2009 03:22:05 Martin Gainty wrote:
 you'll need to install the sysdeo tomcat plugin available from
 http://www.eclipsetotale.com/tomcatPlugin.html

 (step by step instructions available at the site)

sigh. development of the sysdeo plugin has stopped, the last release is for 
Eclipse 3.2, as is clearly visible from your link. To the OP: ignore this 
advice, unless yopu really use an old Eclipse release w/o the Web Tools 
feature.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Vmware Server 2 web interface uses tomcat but hogs 8005 and 8009

2009-03-17 Thread Rainer Frey (Inxmail GmbH)
On Monday 16 March 2009 22:42:27 Christopher Schultz wrote:
  I spent some time looking to see whether these were configurable, but I
  found nothing, apart from a rather snotty message on the vmware bulletin
  boards stating that they didn't think that you should run a server on
  the same platform as a vmware setup

 Wait, what?

 They said don't run Tomcat on a VMWare instance? or don't run Tomcat
 on the VMWare manager instance?. 

 Can you clarify this a bit?

There is no special management instance. VMWare Server is an application that 
runs on a regular host operating system instance (it installs linux kernel 
modules though, and probably also Windows drivers). They (meaning this user 
on the VMWare community, who might or might not be associated with VMWare) 
say  not to run server software on that host operating system. I take that as 
a recommendation to dedicate a machine to one purpose only  (VM hosting in 
that case), which is  common practice in many production environments, but no 
strict requirement.

  it stops working unless you can edit the 'other end' as it were and that
  doesn't appear possible. I hunted through all the available
  configuration files but the values must be hard-coded.

What do you mean with the other end? I use VMWare Server 2 on Ubuntu 
(original tar.gz install from vmware.com), also found that it blocks the said 
ports, and simply changed the server.xml of the VMWare Tomcat. I don't find 
any problems with my VMWare installation, it works fine this way, including 
the start and stop scripts. Maybe the RPMs are different. To the OP: how did 
you install VMWare?

 That's obnoxious. :(

I think they should have configured other ports themselves, or at least put 
the  configuration file for their tomcat in a more accessible place (on my 
system, it is in /usr/lib/vmware/webAccess/tomcat/apache-tomcat-6.0.16/),
but  it's more an inconvenience than a real problem, and might not affect that 
many VMWare users.

 A good question to the VMWare team would be hey, why did you use
 heavy-ass Java for web interface when you're using virtualized hardware?
 ever heard of lighttpd/php or whatever everybody embeds in their
 routers?. Sheesh...

Their web interface runs on the regular, non-virtualized host OS and provides 
a not too simple web application to configure, manage  and monitor the VMWare 
server and the virtual machines. I wouldn't think that Java and Tomcat would 
be considered unsuitable for such a task on this list :-)

 -chris

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



[OT] Re: Vmware Server 2 web interface uses tomcat but hogs 8005 and 8009

2009-03-17 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 17 March 2009 14:46:35 Christopher Schultz wrote:
 Rainer,

  There is no special management instance. VMWare Server is an application
  that runs on a regular host operating system instance (it installs linux
  kernel modules though, and probably also Windows drivers).

 Interesting. This used to be called VMWare Workstation.

Different product. Workstation costs money, has support for 3D acceleration in 
guests, and host-guest integration stuff like shared folders. A reduced free 
variation is VMWare Player.

VMWare Server is free of charge, optimized on running several VMs and being 
accessed from remote (Server Console in V1, web console plugin in V2). It is 
actually the successor of VMWare GSX Server.

  What do you mean with the other end? I use VMWare Server 2 on Ubuntu
  (original tar.gz install from vmware.com), also found that it blocks the
  said ports, and simply changed the server.xml of the VMWare Tomcat.

 He still wants the web manager to work, and the /client/ expects to
 connect on a certain port. If you change VMWare's server-side ports, the
 client can no longer connect.

What client or web manager do you talk about? VMWare Server 2.0 has a browser 
interface, and the browser does not care about the Tomcat shutdown port or 
the (AFAIK totally unused) AJP connector port. As I wrote (and you did not 
quote) this browser interface works just fine on my system.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



[OT] Re: Vmware Server 2 web interface uses tomcat but hogs 8005 and 8009

2009-03-17 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 17 March 2009 15:44:19 Alan Chaney wrote:
  What do you mean with the other end? I use VMWare Server 2 on Ubuntu
  (original tar.gz install from vmware.com), also found that it blocks the
  said ports, and simply changed the server.xml of the VMWare Tomcat.

 And how did the client find it? If I missed how to do it, I apologize
 for wasting everybody's time but there is no mention in the docs, I
 could find nothing on Google and my experiments indicated that you need
 to change both client and server and I could only find the server
 configuration.

  He still wants the web manager to work, and the /client/ expects to
  connect on a certain port. If you change VMWare's server-side ports, the
  client can no longer connect.

Again: what client or web manager? And what it? The only client I know 
is my web browser. It connects to the HTTP or HTTPS connector port. 

I still can't see what would fail after changing the tomcat shutdown port, and 
the AJP connector port. I couldn't find anything that uses the AJP connector, 
so one could probably even disable the AJP connector.

If you want help on that (which might be considered off-topic here), please 
answer this question, and also the question how you installed VMWare server.

 Correct. I still don't understand why Vmware didn't make this configurable.

Well, one can configure the tomcat for the web access like any other tomcat. 
The tomcat installation is difficut to find though and changes might be 
overwritten by an update.  Apart from that, I don't understand what keeps you 
from configuring it.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Re: Vmware Server 2 web interface uses tomcat but hogs 8005 and 8009

2009-03-17 Thread Rainer Frey (Inxmail GmbH)
On Tuesday 17 March 2009 15:23:03 André Warnier wrote:
 +1 (confirming what Rainer says above).

[...]

 I also do not really see the interest in running a separate Tomcat on
 the physical Linux server, since one can easily define a Virtual host
 and run a Tomcat in there. 

To avoid misunderstandings: I see no problem in running tomcat on the host for 
use cases like mine. I'm a developer for a tomcat-based client/server 
application, and I run several instances of tomcat and VMWare server on my 
linux workstation. I use a Windows VM for our CRM tool and to test the 
windows version of or Java Swing UI.  I also sometimes use additional linux 
VMs for other tests. It makes no sense  for me to virtualize my development 
environment with tomcat, just to not run anything on the host out of 
principle.

 This interface is sufficiently graphic and complex to deserve a Tomcat
 to manage it.  There is also a console applet, which you download and
 install in the browser, and which allows, through the server, to obtain
 a system tty console on each Virtual machine.

Since we're offtopic anyway, some details for whoever might be interested (not 
trying to nitpick, just additional info): the console is no Java Applet, but 
a browser plugin, and is integrated into the server/vm management web UI. One 
can also create shortcuts to launch it standalone, after it has been 
installed in the browser. It does not only provide tty access, but also a 
VNC-like graphical interface if the guest has a GUI.

Rainer

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Recurrent OutOfMemoryError during Eclipse publish operation to test environment

2008-12-18 Thread Rainer Frey
On Thursday 18 December 2008 11:38:12 bemmi wrote:
 Hi,

 I'm using Tomcat 6.0.18, Eclipse 3.3.2 and JDK 1.5.0_14.  I've created a
 test server using my Tomcat installation and
 provide these VM args in my launch configuration -Xms512m -Xmx768m
 -XX:PermSize=128m.  Whenever I publish a web project to it I get the
 following error:

 !ENTRY org.eclipse.core.jobs 4 2 2008-12-17 14:32:52.110
 !MESSAGE An internal error occurred during: Publishing to Tomcat v6.0
 Server at localhost
 !STACK 0
 java.lang.OutOfMemoryError: Requested array size exceeds VM limit

Searching for this error message brought me to:

http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html#gbyvi

In short: an array larger than the entire heap is requested.

HTH
Rainer Frey

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6 and javamail

2008-11-27 Thread Rainer Frey
On Thursday 27 November 2008 12:52:56 Lyallex wrote:


(It would be easier to answer if you'd stop top quoting - but I won't correct 
this whole mail)

 OK, firstly thanks for the feedback so far

 Let me be quite clear about one thing.
 I am using the same mail server in both cases. Tomcat and Eclipse are
 running on the same physical device with the same IP address.
 The mail server does not require authentication when accessed from the
 office subnet. The server guys have confirmed this.

So the problem is certainly on Java side.

 If I configure a JavaMail session as described in the following resource

 http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
 (JavaMail section)

 and set auth to false in context.xml everything works perfectly when
 sending mail from the web application.

It then should not be anything related to Javamail or Java version, 
incompatible jar files ...

 I am using the same mail server for the standalone test, the test
 where the mail component is configured to use the JNDI resource
 configured in context.xml and the test where the mail component uses
 the same configuration mechanism as the standlone test. The only test
 that fails is the last one.

 Something has changed since Tomcat 5.  I have exactly the same
 component running in several webapps on Tomcat 5 servers without any
 need to configure JNDI resources/Mail sessions etc

In such a setup, a javamail session is no managed resource for tomcat. I can't 
imagine how the tomcat version could have any influence on that. There must 
be any other difference between your eclipse runtime and this failing tomcat.  

 JAVA_OPTS and CATALINA_OPTS have not been modified by me and do not
 contain anything other that the default settings (none of which appear
 to have anything to do with mail config settings).

Is there any other webapp that might set system properties with mail related 
content? I'd make sure and use an empty Properties object for your test. the 
only reason to use System.getProperties() is the ability to pass JavaMail 
configuration to the JVM command line. I'm not sure what static variables and 
Singletons Javamail has, so I'd test without the resource configuration (even 
if you don't use it anyway) and the Javamail jars in WEB-INF/lib. If this is 
not successful, I guess it's impossible to help unless you post more code, 
complete exception messages and perhaps the output of Javamail with 
mail.debug=true. As I think it is not directly related to tomcat, I'd 
recommend asking on the Javamail list though, they might know more details.

Rainer


 Any ideas much appreciated.

 lyallex

 2008/11/26 Rainer Frey [EMAIL PROTECTED]:
  On Wednesday 26 November 2008 08:37:14 Rainer Frey wrote:
   In the MailServer constructor I do the following
  
   properties = System.getProperties();
   ...
   properties.put(mail.smtp.auth, false);
  
   so it looks like a different properties bundle is being used when I
   run this in Tomcat ... does any of this make sense ??
 
  Argh, I overlooked that you use System.getProperties() here. If you
  specify any JavaMail related Properties in JAVA_OPTS or CATALINA_OPTS
  environment variables, this will be different indeed. You might want to
  check your tomcat start script.
 
  Rainer
 
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6 and javamail

2008-11-26 Thread Rainer Frey
On Wednesday 26 November 2008 08:37:14 Rainer Frey wrote:
  In the MailServer constructor I do the following
 
  properties = System.getProperties();
  ...
  properties.put(mail.smtp.auth, false);
 
  so it looks like a different properties bundle is being used when I
  run this in Tomcat ... does any of this make sense ??

Argh, I overlooked that you use System.getProperties() here. If you specify 
any JavaMail related Properties in JAVA_OPTS or CATALINA_OPTS environment 
variables, this will be different indeed. You might want to check your tomcat 
start script.

Rainer


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: All threads are busy

2008-11-25 Thread Rainer Frey
On Monday 24 November 2008 16:15:19 Martin Spinassi wrote:
 Hi to all again!

 Nov 24, 2008 1:51:54 PM org.apache.tomcat.util.threads.ThreadPool
 logFull
 SEVERE: All threads (200) are currently busy, waiting. Increase
 maxThreads (200) or check the servlet status

 Executor name=tomcatThreadPool namePrefix=catalina-exec-
 maxThreads=400 minSpareThreads=4 maxSpareThreads=100/


 Connector executor=tomcatThreadPool
port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443 /


 Connector executor= tomcatThreadPool port=8009 protocol=AJP/1.3
 redirectPort=8443 /

Does the AJP connector support the executor? I thought not. You probably have 
to set the maxThreads attribute of the AJP connector element.

 Thanks to all.
 Martín

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6 and javamail

2008-11-25 Thread Rainer Frey
On Tuesday 25 November 2008 15:09:54 Lyallex wrote:
 Hello again

 2008/11/19 Don Millhofer [EMAIL PROTECTED]:
  Are you sure that the mail server, serving the host you are deploying to
  does not require authentication?  I got this same error trying to go
  through the Google Mail Server without proper authentication.

 I am absolutely sure that the mail server I am using for the
 standalone test is the same one that I am using for the tomcat server.

This is no answer to above question.

 I tried setting mail.smtp.auth = true and the send failed in Eclipse,
 the debug output was exactly the same as when I run the code
 in Tomcat Authentication failure

Are you running Tomcat on the same machine as Eclipse? The mail server may 
require authentication for some machines, but not for others


 I then hardcoded properties.put(mail.smtp.auth, false); in the
 MailServer constructor  and ran the Eclipse test, it worked, so I ran
 it in Tomcat and it failed with Authentication exception 

 In the MailServer constructor I do the following

 properties = System.getProperties();
 ...
 properties.put(mail.smtp.auth, false);

 so it looks like a different properties bundle is being used when I
 run this in Tomcat ... does any of this make sense ??

Tomcat does not automagically change your code. If this is passed in your 
code, it is used.

  You say in Eclipse you use -  (mail.smtp.auth = false) and sends the
  email.  Try sending authentication.
 
 private class SMTPAuthenticator extends javax.mail.Authenticator {
 @ Override
 public PasswordAuthentication getPasswordAuthentication() {
 return new PasswordAuthentication(d_email, d_password);
 }
 }

Did you try that? If the mail server says it wants authentication, it's no use 
forcing JavaMail to not authenticate.


 Thanks
 lyallex

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Question regarding Tomcat memory

2008-11-18 Thread Rainer Frey (Inxmail GmbH)
On Friday 14 November 2008 21:01:40 Caldarale, Charles R wrote:
  $CATALINA_OPTS -Xms8192M -Xmx8192M -Xss1024K

 Setting -Xss is usually not useful, unless your application is very, very
 strange.

AFAIK the default stack size of the JVM on 64bit linux is 2M. This is very 
large, and most apps don't need this much, unless they use deeply recursive 
algorithms. Setting Xss to a lower value reduces memory footprint of a single 
thread, and thus allows for more threads and/or larger heap with same amount 
of physical memory.

Regards
Rainer Frey
-- 
Software Developer

--

Inxmail GmbH
Wentzingerstr. 21, 79106 Freiburg, Germany
Tel: +49 761 296979-0, Fax: -9
[EMAIL PROTECTED], www.inxmail.de

Handelsregister Freiburg, HRB 5870
Ust.-ID: DE198371679
Geschäftsleitung: Martin Bucher, Peter Ziras 

--

Inxmail Professional kostenlos testen:
http://www.inxmail.de/jetzt-testen

Tipps und Tricks für E-Mail-Marketers:
http://www.inxmail.de/newsletter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSP compile error - required library in tomcat/shared/lib

2007-08-16 Thread Rainer Frey
Hi all,

after moving a jar file from tomcat/common/lib to tomcat/shared/lib, JSPs
that use that library don't compile anymore, it says package does not
exist. It is a library from my company, used by all webapps in the server
installation. It used to be in tomcat/common/lib as it was used by a 
tomcat
valve that exists no longer. As it now needs other libraries in
tomcat/shared/lib, we want to move it.

Now, the classloader howto says:

 Common - This class loader contains additional classes that are made
 visible
 to both Tomcat internal classes and to all web applications. Normally,
 application classes should NOT be placed here.

 Shared - This class loader is the place to put classes and resources
 that you wish to share across ALL web applications (unless Tomcat
 internal classes also need access, in which case you should put them in
 the Common class loader instead)

This library is only used in our application code, mostly in servlets, but
also in some JSP, which can use it after being compiled. Only compiling
doesn't work. Logically, this is thus no code that tomcat internal classes
need.

One can argue, however, that the JSP compiler is a tomcat internal class,
and that using a library as compile class path means that this internal
class needs it, and it thus needs to be in tomcat/common/lib.

For me, this is not intuive, though, and I couldn't find any explicit
documentation about it. My question is now:
Must all libraries that contain classes used in JSPs be in 
tomcat/common/lib
(or WEB-INF/lib), or is this a bug in tomcat, or is this an error in our
installation/configuration?

Thanks,
Rainer Frey

P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything in
classpath:

SEVERE: Javac exception
Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
at
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:287)
at
org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:84)
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.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.authenticator.SingleSignOn.invoke(SingleSignOn.java:417)
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

Re: JSP compile error - required library in tomcat/shared/lib

2007-08-16 Thread Rainer Frey
Hi David,

thanks for your answer. What I forgot to say is that I use Tomcat 5.0.28. 
I'll comment inline to your options.

On Thursday 16 August 2007 10:41:30 David Delbecq wrote:
 As you guessed would be intuitive, yes, the JSP compiler include
 classes in shared/lib (and also classes in webapp itself).

Good to know.

 The shared/lib is the same as if you copy it's content to the
 WEB-INF/lib folder. As your compiler does not include the shared/lib in
 it's classpath, there can be various reason

 1) You did not copy your jar to shared/lib. Considering the path of
 your tomcat, it's not unreasonnable to think be you copied it to
 another to tomcat :)

This installation is a nightly build of our application tomcat bundle, 
that contained the library in question in shared/lib.

 2) You did copy, but after startup of tomcat. Restart tomcat.

It was already there before the first start.

 3) Your jar is broken (not ending with .jar, corrupted) and classloader
 ignored it. Sun JAR classloader, from my experience, tend to load what
 is availabe from truncated .jar without warning of truncation. As a
 consequence only half of jar content is used.

It worked after moving it to common/lib.

 4) You use a non tomcat provided webappClassloader that forgets to load
 shared/lib. If that's the case, you are probably already aware of that
 fact :)

Never used any custom classloader at all. On a previous installation, it 
worked with the library in shared/lib for servlets and already compiled 
JSPs.

 5) A Cosmic ray did randomly swap a bit in your memory. That's how
 experts explained an incorrect pooling result with electronic voting
 device a few years ago in Belgium :D.

Sounds most plausibe then. Problem is, it happened with two installations 
on two machines at different times. So - probably also not the case :-)

So: how does the building of the classpath for JSP compilation work? 
Shouldn't all available libraries be on it? or only libraries that the 
JSP tries to use? There are many more libraries in shared/lib, and none 
is listed in the classpath of the error message.

Rainer

 En l'instant précis du 16/08/07 09:44, Rainer Frey s'exprimait en ces

 termes:
  Hi all,
 
  after moving a jar file from tomcat/common/lib to tomcat/shared/lib,
  JSPs that use that library don't compile anymore, it says package
  does not exist. It is a library from my company, used by all webapps
  in the server installation. It used to be in tomcat/common/lib as it
  was used by a tomcat
  valve that exists no longer. As it now needs other libraries in
  tomcat/shared/lib, we want to move it.
 
  Now, the classloader howto says:
  Common - This class loader contains additional classes that are made
  visible
  to both Tomcat internal classes and to all web applications.
  Normally, application classes should NOT be placed here.
 
  Shared - This class loader is the place to put classes and resources
  that you wish to share across ALL web applications (unless Tomcat
  internal classes also need access, in which case you should put them
  in the Common class loader instead)
 
  This library is only used in our application code, mostly in
  servlets, but also in some JSP, which can use it after being
  compiled. Only compiling doesn't work. Logically, this is thus no
  code that tomcat internal classes need.
 
  One can argue, however, that the JSP compiler is a tomcat internal
  class, and that using a library as compile class path means that this
  internal class needs it, and it thus needs to be in
  tomcat/common/lib.
 
  For me, this is not intuive, though, and I couldn't find any explicit
  documentation about it. My question is now:
  Must all libraries that contain classes used in JSPs be in
  tomcat/common/lib
  (or WEB-INF/lib), or is this a bug in tomcat, or is this an error in
  our installation/configuration?
 
  Thanks,
  Rainer Frey
 
  P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything
  in classpath:
 
  SEVERE: Javac exception
  Compile failed; see the compiler error output for details.
  at
  org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at
  org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at
  org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
  at
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:441) at
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:422) at
  org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
 .java:507) at
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
 .java:274) at
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
 92) 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(Appl
 icationFilterChain.java:237) at
  org.apache.catalina.core.ApplicationFilterChain.doFilter

HTTPS client connection from JSP

2006-06-23 Thread Rainer Frey
Hi all,

I have following problem: a JSP opens a HTTPS connection to read a web 
page's content. On one server this fails with:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at 
sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA12275)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA12275)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA12275)
at
org.apache.jsp.test_005fmrf_jsp._jspService(test_005fmrf_jsp.java:181)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

The target site has a valid Equifax Global Secure eBusiness CA 
certificate. The root certificate is included in JDK's cacert keystore. 
Confusing is: on another server it works, with same versions of Tomcat 
(5.0.24) and Java (1.4.2_10). Main difference is, that the non-working 
server has a HTTPS connector itself, with a Thawte SSL certificate. The 
JSP in question isn't accessed with HTTPS though. The working test 
server had no HTTPS defined, but I added one and created a self-signed 
certificate, and it still worked.

Configuration of non-working server:
Connector port=443
   maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=100 debug=0 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   keystoreFile=${catalina.home}/../webapps/.keystore
   keystorePass=$$ /

${catalina.home}/../webapps/.keystore only contains the server 
certificate, not trusted certificate entries. As you see, a 
trustStoreFiel is not set, so the JDK default cacerts should be used. 
The CA root certificate of our own server certificate is also not 
included in the keystore, but is by default in cacerts. HTTPS to this 
server works.

Configuration of working server:
Connector port=8443
   maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
   enableLookups=false disableUploadTimeout=true
   acceptCount=100 debug=0 scheme=https secure=true
   clientAuth=false sslProtocol=TLS
   keystoreFile=${catalina.home}/../webapps/.keystore
   keystorePass=$$ /
${catalina.home}/../webapps/.keystore only contains the self-signed 
certificate. Difference is AFAIS only self-signed vs. CA signed 
certificate. My collegue did additional tests with the result: it works 
on server that have no HTTPS configured, and on server that do HTTPS 
with self-signed certificates. But it does not work on server with CA 
signed SSL certificates.

Any ideas what the problem might be?

Rainer Frey
-- 
Software Development
--
Inxmail GmbH
Kaiser-Joseph-Str. 274, 79098 Freiburg, Germany
Web http://www.inxmail.de

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]