Re: embedded tomcat, work folder wipe out issue

2010-07-12 Thread Federico Fissore

hello all

after a week of testing, I've changed the wipe out proc from wiping out 
both files and folders to just files, and since then it's worked (hope 
Murphy is not subscribed to this mailing list)


My opinion (if anyone could be interested) follows:
I still think that working with embedded tomcats sharing a common base 
work folder has some issues: one could be that in several places in the 
code I've found statements like


if (!new File(something).exists()) {
new File(something).mkdirs();
}

with the mkdirs not being checked for success.
Maybe we could switch to individual .mkdir() to create the individual 
folders, checking if they have been successfully created?


My two eurocent

Thanks everybody for your help!

Federico Fissore

-
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 André Warnier

Rainer Frey wrote:

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).


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 ?

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

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



Re: Connecting Tomcat to a database

2010-07-12 Thread Christian Bruckhoff

Hi.

Am 10.07.2010 06:15, schrieb Caldarale, Charles R:

From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
Subject: Re: Connecting Tomcat to a database

ERROR - GeronimoLog.error(108) | Failed to resolved external
DataSource at java:comp/env/jdbc/TestDB.
javax.naming.NameNotFoundException: Name jdbc is not bound
in this Context

Any idea, what's wrong?


I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was 
able to reproduce the above error.  (Contrary to popular belief, there is no 
space in the error message - that was just a figment of whatever transposition 
mechanism the OP used.  The grammar in the message is flawed, though.)

Luckily, there's an easy fix (or at least a workaround): get rid of the original .war 
file.  Once Tomcat has expanded ode.war into the ode directory, the .war file is no 
longer needed, and in fact is somehow interfering with the use of the directory.  
Deleting the .war (or changing the extension) lets the META-INF/context.xml file get 
processed, thus defining the JNDI data source.  The same effect can be achieved by 
placing theContext  element in conf/Catalina/[host]/ode.xml, which will 
override any in META-INF/context.xml (in either the .war file or the directory).

I have no idea if things are supposed to work this way, or if this is a bug in 
Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a 
context.xml file inside META-INF of the .war causes Tomcat to ignore the one in 
the expanded directory.


I tried it that way and at least it seems, as if tomcat recognizes the 
database. But now, I get another error (see end of message). Do I have 
to import the ODE schema even if I want to use the database for ODE 
external data?



As a side note, I found two problems with the ODE 2.0 beta:

1) It doesn't shut down properly.  You can't use Tomcat's shutdown.bat (or .sh) 
script to stop Tomcat, since ODE starts extra threads and fails to terminate 
them when the webapp is being stopped.  You can use a signal (CTRL-c on 
Windows) to get the JVM to shutdown cleanly.


Better then the bugs, happening with 1.x :-D


2) The ODE instructions specify the wrong name for the SQL script to initialize 
the database; it should be sql/mysql.sql, not ode_openjpa_mysql-1.3.2.sql (the 
latter appears to be some ancient name).


Can't find this location. :-( Do I have to change something there?


Greetings
Christian

---

C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-

tomcat-7.0.0-ode2DB\bincatalina run
Using CATALINA_BASE:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB
Using CATALINA_HOME:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB
Using CATALINA_TMPDIR: C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw

icklungsumgebung\apache-tomcat-7.0.0-ode2DB\temp
Using JRE_HOME:C:\Programme\Java\jdk1.6.0_20
Using CLASSPATH:   C:\Eigene Dateien\Downloads\Diplomarbeit\Evtl. 
neue Entw
icklungsumgebung\apache-tomcat-7.0.0-ode2DB\bin\bootstrap.jar;C:\Eigene 
Dateien\
Downloads\Diplomarbeit\Evtl. neue 
Entwicklungsumgebung\apache-tomcat-7.0.0-ode2D

B\bin\tomcat-juli.jar
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
12.07.2010 10:55:50 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters 
[false], ra

ndom [true].
12.07.2010 10:55:54 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5583 ms
12.07.2010 10:55:54 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
12.07.2010 10:55:54 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.0
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
12.07.2010 10:55:55 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
12.07.2010 10:55:56 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ode
DEBUG - GeronimoLog.debug(66) | Loading properties
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager
DEBUG - GeronimoLog.debug(66) | Initializing transaction manager using 
org.apach

e.ode.il.EmbeddedGeronimoFactory
DEBUG - GeronimoLog.debug(66) | Creating data source.
DEBUG - GeronimoLog.debug(66) | Starting DAO.
INFO - GeronimoLog.info(79) | Using DAO Connection Factory class 
org.apache.ode.

dao.jpa.BPELDAOConnectionFactoryImpl.
DEBUG - 

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 André Warnier

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]


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).


No. First, only for Linux, there are the official Tomcat downloads from the Tomcat 
website, but also umpteen pre-packaged versions for all Linux variations and versions.

Then there are packaged versions for Solaris, HPUX, AIX and whatnot.
All these pre-packaged versions have a tendency to place Tomcat-related files in various 
directories (such as /var/lib/tomcatxx, /usr/share/tomcatxx, /etc/tomcatxx, 
/opt/hpws/tomcatxx, and so on, with symlinks all over the place to reconnect the bits and 
pieces).  They also usually start/stop tomcat via platform-specific scripts in (variously) 
/etc/init.d, /etc/rc.d/init.d, /sbin/init.d, and so on.


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, in what order ?

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



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!


All this to say that, depending on your Tomcat version and origin, setenv.sh /may/ not be 
the best place to define CATALINA_BASE.  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.


-
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 André Warnier

Rainer Frey wrote:

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.


Usually, people get concerned about CATALINA_BASE when they want to run several instances 
of Tomcat.  And the whole point of running several instances of Tomcat, is to /share/ 
CATALINA_HOME/bin between these instances. (Otrherwise, one might as well install Tomcat 
several times in separate CATALINA_HOME dirs).

That's maybe why I am a bit confused now..

-
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 Konstantin Kolinko
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=markup

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.


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.


Best regards,
Konstantin Kolinko

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



RE: Connecting Tomcat to a database

2010-07-12 Thread Caldarale, Charles R
 From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
 Subject: Re: Connecting Tomcat to a database
 
 But now, I get another error (see end of message). Do I have
 to import the ODE schema even if I want to use the database
 for ODE external data?

I presume so - how else are the tables going to be created?  This doesn't seem 
to have anything to do with Tomcat, so you'll need to inquire with ODE support.

  2) The ODE instructions specify the wrong name for the SQL
  script to initialize the database; it should be sql/mysql.sql,
  not ode_openjpa_mysql-1.3.2.sql
 
 Can't find this location. :-( Do I have to change something there?

It's not in the .war file, it's in the apache-ode-war-2.0-beta2 download.  
Again, nothing to do with Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
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



Request Processing by Apache httpd for Tomcat

2010-07-12 Thread Michael Powe
Hello,

I am working on an Apache module.  The module is installed in an
Apache http server that handles requests for a Tomcat server.  When
requests come from a mobile device, the jsessionid parameter is
appended to the URI in the usual manner, e.g.

/i/n_my_page.jsp;jsessionid=123adsfadsfsadf

The above is how the URI appears in the apache server log file.

My question is, Is this how the URI is stored in the request_rec
object?  I need to apply some logic based on the value of the URI
stored in request_rec, so I want to be sure I understand how this
value is created when Apache is running in front of Tomcat.

Thanks for any help.

mp

-- 
Michael Powemich...@trollope.orgNaugatuck CT USA


 Which is worse: ignorance or apathy?  Who knows?  Who cares?


pgpdTmppkN8G1.pgp
Description: PGP signature


Re: tomcat datasource, find active connections

2010-07-12 Thread Ashish Kulkarni
Hi
Where do i specify data source factory? i have following setup

Resource name=jdbc/mydev
 auth=Container
  type=javax.sql.DataSource
  maxActive=2
  maxIdle=2
  maxWait=3000
  username=user
  password=password
  driverClassName=com.ibm.as400.access.AS400JDBCDriver
  url=jdbc:as400://myip;date format=iso;time
format=iso;errors=basic;trace=false;
  validationQuery=select * from   myschema.mytable /



On Fri, Jul 9, 2010 at 5:42 PM, Pid p...@pidster.com wrote:

 On 09/07/2010 20:03, Ashish Kulkarni wrote:
  Hi
  I have following in context.xml, and it works fine.
  But i would like to find how many active connections are there in data
  source or how many total connections are there?
  1 is it possible to do so?
 
  2 Can i change type javax.sql.DataSource
  to com.ibm.as400.access.AS400JDBCDataSource, as this has methods to find
  active connections etc?

 Nope.

 If you use an appropriate DataSourceFactory that creates a
 AS400JDBCDataSource then you can cast the DataSource that results from
 the calls to JNDI to the one you want.

 Or you can use JMX to examine the running Tomcat.


 p

  Resource name=jdbc/mydev  auth=Container
   type=javax.sql.DataSource
maxActive=2
maxIdle=2
maxWait=3000
username=user
password=pass
driverClassName=com.ibm.as400.access.AS400JDBCDriver
url=jdbc:as400://1mysystem;date format=iso;time
  format=iso;errors=basic;trace=false;
validationQuery=select * from   mytable /
 
 





-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com


RE: tomcat datasource, find active connections

2010-07-12 Thread Caldarale, Charles R
 From: Ashish Kulkarni [mailto:ashish.kulkarn...@gmail.com]
 Sent: 2010 July 12, Monday 09:16
 To: Tomcat Users List; p...@pidster.com
 Subject: Re: tomcat datasource, find active connections
 
 Where do i specify data source factory?

http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#Adding_Custom_Resource_Factories

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: tomcat datasource, find active connections

2010-07-12 Thread Pid
On 12/07/2010 15:15, Ashish Kulkarni wrote:
 Hi
 Where do i specify data source factory? i have following setup
 
 Resource name=jdbc/mydev
auth=Container
  type=javax.sql.DataSource
  maxActive=2 
  maxIdle=2 
  maxWait=3000
  username=user 
  password=password
  driverClassName=com.ibm.as400.access.AS400JDBCDriver
  url=jdbc:as400://myip;date format=iso;time
 format=iso;errors=basic;trace=false;
   validationQuery=select * from   myschema.mytable /

Is that the most lightweight validation query you can use?


You need to add the 'factory=...' element.  It's default value is:

 'org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory'

N.B. the double dbcp.dbcp is intentional.
There's more documentation about configuring a DataSource here:

 
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_(DBCP)_Configurations

 http://wiki.apache.org/commons/DBCP


You will need to determine whether there is a suitable DataSource
factory class, in the com.ibm.as400.access package, or write your own
wrapper.  A quick Google search indicates someone else has done this
(AS400JDBCDataSourceFactory)


p


 On Fri, Jul 9, 2010 at 5:42 PM, Pid p...@pidster.com
 mailto:p...@pidster.com wrote:
 
 On 09/07/2010 20:03, Ashish Kulkarni wrote:
  Hi
  I have following in context.xml, and it works fine.
  But i would like to find how many active connections are there in data
  source or how many total connections are there?
  1 is it possible to do so?
 
  2 Can i change type javax.sql.DataSource
  to com.ibm.as400.access.AS400JDBCDataSource, as this has methods
 to find
  active connections etc?
 
 Nope.
 
 If you use an appropriate DataSourceFactory that creates a
 AS400JDBCDataSource then you can cast the DataSource that results from
 the calls to JNDI to the one you want.
 
 Or you can use JMX to examine the running Tomcat.
 
 
 p
 
  Resource name=jdbc/mydev  auth=Container
   type=javax.sql.DataSource
maxActive=2
maxIdle=2
maxWait=3000
username=user
password=pass
   
 driverClassName=com.ibm.as400.access.AS400JDBCDriver
url=jdbc:as400://1mysystem;date format=iso;time
  format=iso;errors=basic;trace=false;
validationQuery=select * from   mytable /
 
 
 
 
 
 
 
 -- 
 Ashish
 www.ayurwellness.com http://www.ayurwellness.com
 www.mysoftwareneeds.com http://www.mysoftwareneeds.com




signature.asc
Description: OpenPGP digital signature


Re: tomcat datasource, find active connections

2010-07-12 Thread David kerber

On 7/12/2010 10:50 AM, Pid wrote:

On 12/07/2010 15:15, Ashish Kulkarni wrote:

Hi
Where do i specify data source factory? i have following setup

Resource name=jdbc/mydev
auth=Container
  type=javax.sql.DataSource
  maxActive=2
  maxIdle=2
  maxWait=3000
  username=user
  password=password
  driverClassName=com.ibm.as400.access.AS400JDBCDriver
  url=jdbc:as400://myip;date format=iso;time
format=iso;errors=basic;trace=false;
   validationQuery=select * from   myschema.mytable /


Is that the most lightweight validation query you can use?


Yeah, you might add a WHERE true = false to it, so you don't make the 
db actually do any work.


D

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



Re: tomcat datasource, find active connections

2010-07-12 Thread Ken Bowen

Perhapsselect 1is the simplest  lightest weight.

On Jul 12, 2010, at 11:04 AM, David kerber wrote:


On 7/12/2010 10:50 AM, Pid wrote:

On 12/07/2010 15:15, Ashish Kulkarni wrote:

Hi
Where do i specify data source factory? i have following setup

Resource name=jdbc/mydev
   auth=Container
 type=javax.sql.DataSource
 maxActive=2
 maxIdle=2
 maxWait=3000
 username=user
 password=password
  
driverClassName=com.ibm.as400.access.AS400JDBCDriver

 url=jdbc:as400://myip;date format=iso;time
format=iso;errors=basic;trace=false;
  validationQuery=select * from
myschema.mytable /


Is that the most lightweight validation query you can use?


Yeah, you might add a WHERE true = false to it, so you don't make  
the db actually do any work.


D

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




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



Re: Request Processing by Apache httpd for Tomcat

2010-07-12 Thread André Warnier

Michael Powe wrote:

Hello,

I am working on an Apache module.  The module is installed in an
Apache http server that handles requests for a Tomcat server.  When
requests come from a mobile device, the jsessionid parameter is
appended to the URI in the usual manner, e.g.

/i/n_my_page.jsp;jsessionid=123adsfadsfsadf

The above is how the URI appears in the apache server log file.

My question is, Is this how the URI is stored in the request_rec
object?  I need to apply some logic based on the value of the URI
stored in request_rec, so I want to be sure I understand how this
value is created when Apache is running in front of Tomcat.


I think that you are in the wrong list.  You should ask this on the Apache 
httpd user's list.

But just as a generic answer : Apache httpd itself has no idea that it is acting as a 
front-end for Tomcat.  Apache receives a request, processes the request URI in some 
standard ways, and stores the result in the request_rec object.
Then, at some later stage, Apache looks for a handler to generate the response to this 
request.  If it is configured properly, it will find one of the proxy handlers 
(mod_proxy or mod_jk, depending on which one you are using), and will then pass the 
request URI (and the request_rec object) to that handler. The handler then generates a 
response, which Apache receives and passes back to the client.
That the handler, in the background, connects to a Tomcat and asks Tomcat to generate the 
response, is basically unknown to Apache.


If your module plays games with the URI, you probably have to be careful to update the 
parsed URI as well as the unparsed URI fields of the request_rec.
But again, you will get much better answers on the Apache httpd list, or you could 
probably also try the mod_perl list, where there are quite a few people knowledgeable 
about Apache httpd internals.


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



running tomcat behind an apache reverse proxy

2010-07-12 Thread Tapas Mishra
I have an application named as sakai
You can check about it here
http://sakaiproject.org/new-sakai-faq

which is running in Tomcat on LAN as
http://192.168.1.5:9090/portal

I am using Apache as front end for users to access this application on internet
as http://mydomain.com/sakai

and
ProxyPass /sakai http://192.168.1.1:9090/portal
ProxyPassReverse /sakai http://192.168.1.1:9090/portal


but the application is not generating URLs properly.I have not written
so it is not possible for me to change any thing in it.
The application is generating URLs like this:

GET /library/skin/default/portal.css
GET /portal/styles/portalstyles.css
GET /library/js/jquery.js

mod_proxy does not rewrite HTML, only a few specific headers, so your
application must generate the correct URLs, eg
/'sakai/styles/portalstyles.css'.

Is there any work around ?
 I have asked this on Sakai forum but did not got any answer.

-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

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



Re: running tomcat behind an apache reverse proxy

2010-07-12 Thread Mark Thomas
On 12/07/2010 17:53, Tapas Mishra wrote:
 but the application is not generating URLs properly.I have not written
 so it is not possible for me to change any thing in it.
 The application is generating URLs like this:
 
 GET /library/skin/default/portal.css
 GET /portal/styles/portalstyles.css
 GET /library/js/jquery.js
 
 mod_proxy does not rewrite HTML, only a few specific headers, so your
 application must generate the correct URLs, eg
 /'sakai/styles/portalstyles.css'.
 
 Is there any work around ?
  I have asked this on Sakai forum but did not got any answer.

mod_substitute

Mark



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



Re: tomcat datasource, find active connections

2010-07-12 Thread David kerber

On 7/12/2010 11:23 AM, Ken Bowen wrote:

Perhaps   select 1  is the simplest  lightest weight.


If the db will accept it (without a FROM clause), yes.

D

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



Re: running tomcat behind an apache reverse proxy

2010-07-12 Thread Rainer Jung

On 12.07.2010 19:00, Mark Thomas wrote:

On 12/07/2010 17:53, Tapas Mishra wrote:

but the application is not generating URLs properly.I have not written
so it is not possible for me to change any thing in it.
The application is generating URLs like this:

GET /library/skin/default/portal.css
GET /portal/styles/portalstyles.css
GET /library/js/jquery.js

mod_proxy does not rewrite HTML, only a few specific headers, so your
application must generate the correct URLs, eg
/'sakai/styles/portalstyles.css'.

Is there any work around ?
  I have asked this on Sakai forum but did not got any answer.


mod_substitute


... or mod_proxy_html ...

Or: you can try to fix it on the incoming side instead of the outgoing, 
i.e. rewriting /portal/styles.* to /sakai/styles/* after you received 
the request, but before forwarding to Tomcat (mod_rewrite).


Regards,

Rainer

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



Re: SSL Not working on tomcat 5.5.29

2010-07-12 Thread kareem_s_m

Hi All,

If I rename tcnative-1.dll in the bin folder then the site on SSL works. I
am not that knowledgeable on thie dll. Any comments or ideas please? I got
this suggestion from google but no specific reason.

Regards,
Kareem

Pid * wrote:
 
 On 02/07/2010 06:30, kareem_s_m wrote:
 
 Hi All,
 
 I am working on upgrading tomcat from 5.5.28 to 5.5.29 for one of the
 applications. I see that the website renders and works fine in 5.5.29 on
 port 8080 (non SSL) but with  SSL (port 8443) the website doesnot run at
 all. When I try to see what's going on in Fiddle, I see 502 error. Also
 nothing is written to the log flies. It is as if tomcat is not even
 running
 in port 8443.
 
 Under tomcat 5.5.28, the site renders fine with SSL and non SSL.
 
 Is there something I could be missing?
 
 Are the Connector definitions in server.xml files identical?
 
 You can post it inline here, if you remove the comments and any passwords.
 
 
 p
 
 
  
 

-- 
View this message in context: 
http://old.nabble.com/SSL-Not-working-on-tomcat-5.5.29-tp29052531p29137241.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: SSL Not working on tomcat 5.5.29

2010-07-12 Thread Caldarale, Charles R
 From: kareem_s_m [mailto:kareemud...@gmail.com]
 Subject: Re: SSL Not working on tomcat 5.5.29
 
 If I rename tcnative-1.dll in the bin folder then the 
 site on SSL works.

SSL handling with the APR connector is completely different from that with a 
pure Java connector.  The docs are here:
http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
http://tomcat.apache.org/tomcat-5.5-doc/apr.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



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



Re: SSL Not working on tomcat 5.5.29

2010-07-12 Thread Konstantin Kolinko
2010/7/12 kareem_s_m kareemud...@gmail.com:

 Hi All,

 If I rename tcnative-1.dll in the bin folder then the site on SSL works. I
 am not that knowledgeable on thie dll. Any comments or ideas please? I got
 this suggestion from google but no specific reason.


It was already mentioned in this very thread.
http://old.nabble.com/SSL-Not-working-on-tomcat-5.5.29-ts29052531.html#a29083748

 Regards,
 Kareem

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



Re: SSL Not working on tomcat 5.5.29

2010-07-12 Thread kareem_s_m

Yup... I guess I missed it. Thank You Konstantin.

Konstantin Kolinko wrote:
 
 2010/7/12 kareem_s_m kareemud...@gmail.com:

 Hi All,

 If I rename tcnative-1.dll in the bin folder then the site on SSL works.
 I
 am not that knowledgeable on thie dll. Any comments or ideas please? I
 got
 this suggestion from google but no specific reason.

 
 It was already mentioned in this very thread.
 http://old.nabble.com/SSL-Not-working-on-tomcat-5.5.29-ts29052531.html#a29083748
 
 Regards,
 Kareem
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/SSL-Not-working-on-tomcat-5.5.29-tp29052531p29143073.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: SSL Not working on tomcat 5.5.29

2010-07-12 Thread kareem_s_m

Thank You Chuck!!!

n828cl wrote:
 
 From: kareem_s_m [mailto:kareemud...@gmail.com]
 Subject: Re: SSL Not working on tomcat 5.5.29
 
 If I rename tcnative-1.dll in the bin folder then the 
 site on SSL works.
 
 SSL handling with the APR connector is completely different from that with
 a pure Java connector.  The docs are here:
 http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
 http://tomcat.apache.org/tomcat-5.5-doc/apr.html
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/SSL-Not-working-on-tomcat-5.5.29-tp29052531p29143076.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Test message

2010-07-12 Thread MShah

http://moshah-linux.corp.walmart.com/ip/3555301
-- 
View this message in context: 
http://old.nabble.com/Test-message-tp29143868p29143868.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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