Re: Thread Pool

2007-06-14 Thread Andre Prasetya

I am a bit loss reading your message.

is the flow like this ?
a java program called a servlet in multi thread mode
while the request is being processed, the java program called another
process and somehow end up in calling another servlet in the same manner as
above. But then the program have to wait the 1st call to finish instead of
it running on seperate thread.

Am i true ?
if truethen the mistake is at your java program and not at tomcat. If you
need thread pooling, you can use jdk5's ExecutorService.


On 6/12/07, Siraj Haider [EMAIL PROTECTED] wrote:


I am using tomcat version:5.5.20 java version:1.6.0-b105 os version:
intel solaris 5.10
scenario is: my java program call a servlet which return to my java
program using sendData and then goes into a loop to perform other
functions.  Now after i get the control back in my java program i try to
call another servlet on the same tomcat, but it waits until the previous
servlet call (which was in a loop to perform other functions) is done.
I have these settings in my servler.xml for thread pooling:
maxThreads=1000 minSpareThreads=100 maxSpareThreads=200
acceptCount=500.  Can somebody please how to fix this problem ?



This electronic mail message and any attachments may contain information
which is privileged, sensitive and/or otherwise exempt from disclosure under
applicable law. The information is intended only for the use of the
individual or entity named as the addressee above. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution (electronic or otherwise) or forwarding of, or the taking of
any action in reliance on, the contents of this transmission is strictly
prohibited. If you have received this electronic transmission in error,
please notify us by telephone, facsimile, or e-mail as noted above to
arrange for the return of any electronic mail or attachments. Thank You.



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





--
-Andre-

People see things the way they are and say why ? I see things that never
were and say Why not ?


Failed to install Tomcat5 service

2007-06-14 Thread hezjing

Hi!

I got this error when trying to install Tomcat 5.5.23 on Windows XP:

Failed to install Tomcat5 service.
Check your settings and permissions
Ignore and continue anyway (not recommended)?

the above error occurs with these status:
..
tomcat-users.xml written
Remove folder: C:\Temp\confinstall
Using Jvm: C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll

I abort the installation at this point.

After searching the Google, I tried to set the environment variable
TEMP and TMP to C:\Temp, but that doesn't help either.

When I open the Services (Local) window, I see that there is a service
named Apache Tomcat (Apache Tomcat 5.5.23 Server -
http://tomcat.apache.org/; ...
I think this service is created but not being remove when I abort the
Tomcat installation.

Please help, thank you!


--

Hez

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



swallowOutput option in tomcat 6

2007-06-14 Thread Prabhu
How to get swallowOutput option working in tomcat 6. I am not able to get  
this from the context documentation.


--
Regards,
Prabhu

-
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: JSVC with JDK 6 on Intel Xenon x86_64

2007-06-14 Thread ben short

Thanks Bil,

I install the amd64 jdk and it all works ok now.

I was thrown my the name, thinking that it was for the amd platform only.

On 6/14/07, Bill Barker [EMAIL PROTECTED] wrote:

Easiest is to symlink amd64 to i386.

Second easiest is to edit Makefile and change the CPU variable to be i386
and recompile.  You could also edit location.c and add the right path and
recompile.

ben short [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I'm trying to compile jsvc on a RedHat 4 ES box. I have installed JDK
 6 and typing java -version at the shell prompt tells me its installed
 OK.
 I then compile jsvc with that jdk and it completes ok.
 When I try and run the following startup script I get the following
 debug output.


 #!/bin/bash
 # chkconfig: 2345 101  05
 # description: Apache Tomcat 6

 JAVA_HOME='/usr/lib/jvm/java-1.6.0-sun'
 CATALINA_HOME='/usr/local/tomcat/tomcat6'

 CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar
 CLASSPATH=${CLASSPATH}:$CATALINA_HOME/bin/commons-daemon.jar
 CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
 echo $CLASSPATH

 JAVA_OPTS='-Xms1024m -Xmx3072m -server'
 JAVA_DEBUG_OPTS= -Xdebug -Xnoagent -Djava.compiler=NONE
 -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

 # Uncomment the next line to enable java debuging
 #JAVA_OPTS=${JAVA_OPTS} ${JAVA_DEBUG_OPTS}
 echo $JAVA_OPTS


 TOMCAT_USER=daemon

 TMPDIR=/var/tmp


 RC=0

 case $1 in

  start)

   $CATALINA_HOME/bin/jsvc   \
 -debug \
 -user $TOMCAT_USER \
 -home $JAVA_HOME   \
 -jvm server \
 -Dcatalina.home=$CATALINA_HOME \
 -Xmx256m \
 -Djava.io.tmpdir=$TMPDIR \
 -Djava.awt.headless=true \
 -outfile $CATALINA_HOME/logs/catalina.out \
 -errfile $CATALINA_HOME/logs/catalina.err \
 -cp $CLASSPATH  \
 org.apache.catalina.startup.Bootstrap

RC=$?

[ $RC = 0 ]  touch /var/lock/subsys/tomcat
;;

  stop)

PID=`cat /var/run/jsvc.pid`
kill $PID

   RC=$?

[ $RC = 0 ]  rm -f /var/lock/subsys/tomcat /var/run/jsvc.pid
;;

  *)
echo Usage: $0 {start|stop}
exit 1

 esac
 exit $RC


 13/06/2007 13:28:41 10653 jsvc debug: +-- DUMPING PARSED COMMAND LINE
 ARGUMENTS --
 13/06/2007 13:28:41 10653 jsvc debug: | Detach:  True
 13/06/2007 13:28:41 10653 jsvc debug: | Show Version:No
 13/06/2007 13:28:41 10653 jsvc debug: | Show Help:   No
 13/06/2007 13:28:41 10653 jsvc debug: | Check Only:  Disabled
 13/06/2007 13:28:41 10653 jsvc debug: | Stop:False
 13/06/2007 13:28:41 10653 jsvc debug: | Wait:0
 13/06/2007 13:28:41 10653 jsvc debug: | Run as service:  No
 13/06/2007 13:28:41 10653 jsvc debug: | Install service: No
 13/06/2007 13:28:41 10653 jsvc debug: | Remove service:  No
 13/06/2007 13:28:41 10653 jsvc debug: | JVM Name:server
 13/06/2007 13:28:41 10653 jsvc debug: | Java Home:
 /usr/lib/jvm/java-1.6.0-sun
 13/06/2007 13:28:41 10653 jsvc debug: | PID File:
 /var/run/jsvc.pid
 13/06/2007 13:28:41 10653 jsvc debug: | User Name:   daemon
 13/06/2007 13:28:41 10653 jsvc debug: | Extra Options:   5
 13/06/2007 13:28:41 10653 jsvc debug: |
 -Dcatalina.home=/usr/local/tomcat/tomcat6
 13/06/2007 13:28:41 10653 jsvc debug: |   -Xmx256m
 13/06/2007 13:28:41 10653 jsvc debug: |   -Djava.io.tmpdir=/var/tmp
 13/06/2007 13:28:41 10653 jsvc debug: |   -Djava.awt.headless=true
 13/06/2007 13:28:41 10653 jsvc debug: |
 
-Djava.class.path=/usr/local/tomcat/tomcat6/bin/bootstrap.jar:/usr/local/tomcat/tomcat6/bin/commons-daemon.jar:/usr/lib/jvm/java-1.6.0-sun/lib/tools.jar
 13/06/2007 13:28:41 10653 jsvc debug: | Class Invoked:
 org.apache.catalina.startup.Bootstrap
 13/06/2007 13:28:41 10653 jsvc debug: | Class Arguments: 0
 13/06/2007 13:28:41 10653 jsvc debug:
 +---
 13/06/2007 13:28:41 10654 jsvc debug: user changed to 'daemon'
 13/06/2007 13:28:41 10653 jsvc debug: User 'daemon' validated
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate Java Home
 in /usr/lib/jvm/java-1.6.0-sun
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
 configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/jvm.cfg
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
 configuration file /usr/lib/jvm/java-1.6.0-sun/lib/jvm.cfg
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
 configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/jvm.cfg
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
 configuration file /usr/lib/jvm/java-1.6.0-sun/lib/amd64/jvm.cfg
 13/06/2007 13:28:41 10653 jsvc debug: VM configuration file not found
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
 /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/classic/libjvm.so
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
 /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/client/libjvm.so
 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
 

Fw: Problem with Session replication in Tomcat 5.5.16

2007-06-14 Thread Mahesh
Hi,

I have installed two tomcat 5.5.16 instances on different linux machines. I 
have clusttered the both machines using session replication. After configuring 
the instances and i have restarted the machines but i got the warning.as below.

IOException in replication worker, unable to drain channel. Probable cause: 
Keep alive socket closedCould you please suggest me to resolve this problem.


Please let me know for furthe information required.


Regards,
Mahesh Kumar

Re:[OT] Tomcat Server CPU utilization goes upto 400%

2007-06-14 Thread PTS

Sumit,

Since this is not a Tomcat issue I tagged it as OT.

Is the data query different for each user?

If no, setup a separate thread on startup to do the query and process it as 
far as you can. I was able to create a String that was the body of the page, 
then each request that came in simply inserted the string in a 
document.write on a jsp. It made the response ultra fast.


If yes, look at the data returned. How much are you having to process the 
data? I had to iterate through the results of three query's, create objects 
and populate the fields from other queries. Then do a sort on the object. It 
was very processor intensive. Is there anything you can do with a stored 
procedure on the database side. You need to limit the amount of work done on 
the data.


Doug

- Original Message - 
From: Sumit Gaikaiwari [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 7:15 AM
Subject: RE: Tomcat Server CPU utilization goes upto 400%



Hi Doug,

The requirements of this application were as mentioned in the previous
mail. Can I have any work around on the issue? What things you tried
when you had same situation?

Regards,
Sumit Gaikaiwari


-Original Message-
From: PTS [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 14, 2007 9:23 AM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

Sumit,

Look at the design of the app. Is each session doing a query every 30
seconds? Also is the database on the same server?

I had an app that was originally designed to be for a few users that
each
session hit the database. Due to the amount of processing of the data it
had
a snowball effect that after more than a few users connected the system
began to fall behind and the system came to a crawl. Since my query was
the
same for all users, I was able to spawn a thread to do a query every few

minutes and cache the results, then each session grabbed a copy of the
cached data from memory.

I would also have to agree that it appears to be an application issue,
especially after experiencing it myself. Or more accurately doing it to
myself.

Doug


- Original Message - 
From: Sumit Gaikaiwari [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 13, 2007 11:17 PM
Subject: RE: Tomcat Server CPU utilization goes upto 400%





There is an application deployed that refreshes after every 30 seconds.
After every 30 seconds, it requeries database and fetches the data. This
was a design requirement for this application. Generally large numbers
of sessions of this application are running (450-500).

Regards,
Sumit Gaikaiwari


-Original Message-
From: Andre Prasetya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 4:22 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

i think its more to application problem instead of tomcat problem. Is
there
any application hosted inside tomcat that get infinite loop or use a
kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari [EMAIL PROTECTED] wrote:



Hello,



We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There

two

applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and

tomcat

needs to be restarted for normal operation. The output of top command

is

as below-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k

buffers


Swap:  6094824k total,0k used,  6094824k free,  1811576k

cached




  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31

migration/0






Here is the status of active threads-

Thread Status-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != S { print }'

1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath


/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/



bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a

pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args




Re: Tomcat 6, SQL Server 2005 JDBC Realm not working

2007-06-14 Thread Richard Sayre

I just tried the exact same thing with the jTDS driver and I got the same error:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
driverName=net.sourceforge.jtds.jdbc.Driver
 
connectionURL=jdbc:jtds:sqlserver://server-2006/v362;user=user;password=dbase
 connectionName=user
 connectionPassword=dbase
 digest=SHA
 userTable=PPMUser userNameCol=UserName
userCredCol=UserPassword
 userRoleTable=PPMUser roleNameCol=RoleTomcat /

14-Jun-2007 10:49:02 AM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: net.sourceforge.jtds.jdbc.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)


Did anything change in Tomcat 6 for setting up JDBC Realms?  I am
putting this in the server xml.

On 6/13/07, Richard Sayre [EMAIL PROTECTED] wrote:

I have a web app that connects to my SQL Server 2005 Database with no
trouble using this code:

  Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver);
con =
DriverManager.getConnection(jdbc:sqlserver://server-2006;databaseName=v362;user=user;password=dbase);

My application runs fine and I can see data from the database.

Now when I try to set up a Realm to do Database authentication I get an error:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
connectionURL=jdbc:sqlserver://server-2006;databaseName=v362;userName=user;password=dbase
  connectionName=user
  connectionPassword=dbase
  digest=SHA
  userTable=PPMUser userNameCol=UserName
userCredCol=UserPassword
userRoleTable=PPMUser roleNameCol=RoleTomcat /

Exception:

13-Jun-2007 3:56:00 PM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

The strange thing is, if I set up a DSN under Windows and use the Sun
ODBC driver the authentication realm works:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=sun.jdbc.odbc.JdbcOdbcDriver
  connectionURL=jdbc:odbc:v362
  connectionName=user
  connectionPassword=dbase
  digest=SHA
  userTable=User userNameCol=UserName userCredCol=UserPassword
  userRoleTable=User roleNameCol=RoleTomcat /


Does any one have this type of authentication working with MS SQL
Server 2005 JDBC driver under Tomcat 6?

Thank you,

Rich



-
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, SQL Server 2005 JDBC Realm not working

2007-06-14 Thread Richard Sayre

It turns out I had to RTFM.

Quick Start:

3. Place a copy of the JDBC driver you will be using inside the
$CATALINA_HOME/lib directory. Note that only JAR files are
recognized!

I only had it in my Web App lib folder



On 6/14/07, Richard Sayre [EMAIL PROTECTED] wrote:

I just tried the exact same thing with the jTDS driver and I got the same error:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=net.sourceforge.jtds.jdbc.Driver
  
connectionURL=jdbc:jtds:sqlserver://server-2006/v362;user=user;password=dbase
  connectionName=user
  connectionPassword=dbase
  digest=SHA
  userTable=PPMUser userNameCol=UserName
userCredCol=UserPassword
  userRoleTable=PPMUser roleNameCol=RoleTomcat /

14-Jun-2007 10:49:02 AM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: net.sourceforge.jtds.jdbc.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)


Did anything change in Tomcat 6 for setting up JDBC Realms?  I am
putting this in the server xml.

On 6/13/07, Richard Sayre [EMAIL PROTECTED] wrote:
 I have a web app that connects to my SQL Server 2005 Database with no
 trouble using this code:

   Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver);
 con =
 
DriverManager.getConnection(jdbc:sqlserver://server-2006;databaseName=v362;user=user;password=dbase);

 My application runs fine and I can see data from the database.

 Now when I try to set up a Realm to do Database authentication I get an error:

 Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
   
connectionURL=jdbc:sqlserver://server-2006;databaseName=v362;userName=user;password=dbase
   connectionName=user
   connectionPassword=dbase
   digest=SHA
   userTable=PPMUser userNameCol=UserName
 userCredCol=UserPassword
 userRoleTable=PPMUser roleNameCol=RoleTomcat /

 Exception:

 13-Jun-2007 3:56:00 PM org.apache.catalina.realm.JDBCRealm authenticate
 SEVERE: Exception performing authentication
 java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
 at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
 at 
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
 at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
 at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
 at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
 at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Unknown Source)

 The strange thing is, if I set up a DSN under Windows and use the Sun
 ODBC driver the authentication realm works:

 Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=sun.jdbc.odbc.JdbcOdbcDriver
   connectionURL=jdbc:odbc:v362
   connectionName=user
   connectionPassword=dbase
   digest=SHA
   userTable=User userNameCol=UserName 
userCredCol=UserPassword
   userRoleTable=User roleNameCol=RoleTomcat /


 Does any one have this type of authentication working with MS SQL
 Server 2005 JDBC driver under Tomcat 6?

 Thank you,

 Rich





Using shared Spring Webapp in Tomcat 6

2007-06-14 Thread Kevin Wilhelm
Hello,

I am about to finalize some early state Spring web application (just the 
persistence and logic part). I am using Hibernate to retrieve data from a 
database. I created the whole logic using the Spring framework; at the top 
there is a Session Facade providing access to all the services.

At this point I want to create JSP/JSF views in another webapp. I want to 
create a new web application that *USES* the services of the one described 
above.

For Tomcat 6 there is a folder called $CATALINAHOME/lib that is said to be 
used for that kind of stuff. But isn't this folder meant to be used for jars 
instead of complete running web apps?

1.) Does it work to create a war file from my services webapp and put it into 
the lib directory? Is this the way to go?

2.) Furthermore: Where do I start with my JSP/JSF view webapp? I assume I have 
to access the SessionFacade somehow. I will have to access the logic web app 
from within my view-webapp.

I'd appreciate some hints on that!
Thanks in advance!

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

-
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: Erratic HTTP response behavior

2007-06-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martin,

The OP has plainly said that they are not using chunked encoding. :(

- -chris

Martin Gainty wrote:
 if you are setting Transfer-encoding to 'chunked' as in
 response.setHeader( Transfer-Encoding, chunked);
 then read and follow these directives
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
 
 Caveat Emptor!
 Martin-
 This email message and any files transmitted with it contain confidential
 information intended only for the person(s) to whom this email message is
 addressed.  If you have received this email message in error, please notify
 the sender immediately by telephone or email and destroy the original
 message without making a copy.  Thank you.
 
 - Original Message - From: Len Popp [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, June 13, 2007 7:38 PM
 Subject: Re: Erratic HTTP response behavior
 
 
 It's pretty obvious by now that no-one's going to be able to email you
 a solution to your problem, which seems unique or at least very
 unusual. You're going to have to dig deeply into this one yourself.

 Here's what I'd do, if it helps you any. I would track the problem
 requests from the browser to the server and back again, at several
 points, to see where it's going wrong.
 - Look at the request and response in the browser using a plug-in like
 LiveHTTPHeaders or ieHTTPHeaders.
 - Log the requests received by Tomcat (AccessLogValve or
 RequestDumperValve).
 - Put logging messages in your application, in every servlet or JSP,
 to see what piece of code is executed for each request.
 - Use a network sniffer (e.g. Wireshark) to see if the HTTP responses
 are being sent to the correct clients. You may have to log traffic at
 both the client and server ends if there's a proxy or gateway between
 them.

 Given all of those logs, you should be able to figure out where a
 particular request went astray - in Tomcat, in the application, or in
 the network. My money's on the network.
 -- 
 Len

 On 6/13/07, Matt Cosentino [EMAIL PROTECTED] wrote:
 Well that didn't last long.  After making some other changes the
 problem has returned... with a vengeance!  Seriously, it's even
 weirder than before.  Not only are some responses coming back
 chunked, but some are coming back completely wrong.  Like I try to
 open my index page and it responds with an image.  I tried reverting
 everything that I changed back to how they were before and the
 problem doesn't go away.  So strange, could really use some help.

 - Original Message 
 From: Matt Cosentino [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, June 13, 2007 2:20:24 PM
 Subject: Re: Erratic HTTP response behavior

 Ok, so I made a small change and somehow I think I fixed it.  I
 removed the following line from my page:

 link rel=icon type=image/x-icon href=/images/icon.ico

 This happened by accident, I only removed it because the icon didn't
 exist at that path.  After doing that I noticed that everything would
 always load correctly.

 I then added it back to see if that really did fix it, and sure
 enough the problem came back.  Then I just moved the line before some
 files that I often had problems loading, and the problem went away. 
 So it seems to me that when Tomcat tried to respond to that request
 it was breaking the responses of the other resources, somehow.  I
 don't understand it, but I figured I'd at least share my experience
 in case this helps anyone else.

 - Original Message 
 From: Matt Cosentino [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Monday, June 11, 2007 1:07:37 PM
 Subject: Re: Erratic HTTP response behavior

 In a previous discussion it was said that the problem was fixed in
 5.5.17, so maybe the problem was reintroduced somehow.

 - Original Message 
 From: Matt Cosentino [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, June 8, 2007 6:12:28 PM
 Subject: Re: Erratic HTTP response behavior

 I tried looking through the archive and just couldn't find any help. 
 The problem has recently reproduced itself on a new Tomcat 5.5.23
 install on one of my co-worker's machine, so it's not my PC.  I've
 also experienced it more often with random images or other resources
 not loading, and when I check the network monitor in Firebug it lists
 the transfer-encoding for them as chunked.  Luckily this problem has
 never surfaced on our production server which is version 5.5.17, but
 I don't see any configuration differences.  This is driving me nuts,
 so any help would be greatly appreciated.

 - Original Message 
 From: Matt Cosentino [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, May 25, 2007 4:09:57 PM
 Subject: Re: Erratic HTTP response behavior

 No I am on intending on using chunked responses.  Is there a way to
 disable it?

 - Original Message 
 From: Christopher 

Re: global/separate classloader for each web-app

2007-06-14 Thread Hamster

On 12/06/07, David Delbecq [EMAIL PROTECTED] wrote:
[..]

1) revise war build process to force inclusion of libs

2) have a server lifecyclelistener  that, before loading of a webapp,
copy the concerned classes to the WEB-INF/lib ?

Copy seems easier than play with classloader...


Here is my solution which I tested and it works pretty fine:
1/ in conf/context.xml I put:
   Listener className=foo.FooListener extDir=${catalina.home}/ext-lib//

2/ I put my foo.FooListener in jar and then in ./server/lib/

3/ source code:

/** FIXME polish, add logging, exception handling, etc */
public class FooListener implements LifecycleListener {

 private String extDir;

 public String getExtDir() {
   return extDir;
 }

 public void lifecycleEvent(LifecycleEvent event) {
   if (Lifecycle.START_EVENT.equals(event.getType())) {
 if (event.getSource() != null) {
   final StandardContext ctx = (StandardContext) event.getSource();
   final File dir = new File(getExtDir());
   File[] files = dir.listFiles();
   for (int i = 0; i  files.length; i++) {
 ctx.getLoader().addRepository(file:// + files[i].getAbsolutePath());
   }
 }
   }
 }

 /**
  * Required configuration parameter.
  *
  * @param extDir
  */
 public void setExtDir(String extDir) {
   this.extDir = extDir;
 }

}

That's all, it works fine, it does not affect classloader hierarchy
and it is logically equal to copy-based solution.

Thanks for your help, now let's wait what customer say ;)

Hamster,

--
GMail::Hamster
http://music-codex.com/
http://hamsterready.blogspot.com/

-
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: Comet: Unsufficiently synchronized recycling decisions

2007-06-14 Thread Reich, Matthias
Filip,

thank you for the response.  

The issue is fairly simple:

At some point in time (t1) the CoyoteAdapter.service (or the
CoyoteAdapter.event) method calls request.isComet().
If the CometEvent has not been closed at (t1), this method returns true
and request and response are not recycled.

At a later point in time (t2), after returning from the call to the
CoyoteAdapter, the Http11AprProcessor.process (or
Http11AprProcessor.event) method checks the comet flag. If the flag is
false at (t2), the processor will be recycled. 

In almost all cases the comet flag is still true at (t2) if
request.isComet() had returned true at (t1).

However, especially in heavy load situations, another thread may be
scheduled between (t1) and (t2) and call event.close() . In such a
situation, the comet falg will be false at (t2) and the processor is
recycled while request and response are not recycled. The processor will
then process the next request with non-recycled request/response
objects.

My quick and dirty fix calls the recycle methods of request and response
whenever the recycle method of the processor is called, regardless if
request and response had been recycled before or not.


It is not that easy to provide a simple example app that produces such a
behaviour reliably.
I can see that it happens in my application which runs an embedded
Tomcat and a whole bunch of additional threads when the system is under
load, but it does not happen in a simple test situation.


Regards,
Matthias




 -Original Message-
 From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 13, 2007 8:09 PM
 To: Tomcat Users List
 Subject: Re: Comet: Unsufficiently synchronized recycling decisions
 
 Reich, Matthias wrote:
   Hello,
 
  I did not get any response on my post from 2 weeks ago.
 
  Even if non-recycling of request/response objects happens only
  sporadically and only in webapps where asynchronous 
 responses may happen
  before the event processing has finished, it is definitively a bug.
 
  Should I report it as a bug to receive any reaction?

 a bug would help only if it has an example app, or enough 
 info to help 
 us truly understand the issue.
 personally, I haven't had enough time to look through it to truly 
 understand it, cause I believe the fix would probably be 
 easier than the 
 one described below
 
 Filip
 
  Regards,
  Matthias
 

  -Original Message-
  From: Reich, Matthias 
  Sent: Wednesday, May 30, 2007 2:04 PM
  To: 'Tomcat Users List'
  Subject: Comet: Unsufficiently synchronized recycling decisions
 
  Hi,
 
  as mentioned in my contribution to topic 'Web application 
  receives request parameters sent to another application on 
  Tomcat 6', I sometimes get non-recycled Request objects in a 
  BEGIN event. 
 
  A non-recycled request object appeared in a BEGIN event if 
  the previous request processed by the same request processor 
  was answered asynchronously directly after the BEGIN event.
 
  In such a situation my Servlet sometimes did not get an END 
  event, i.e. the CoyoteAdapter was not triggered again and 
  therefore could not recycle the Request object.
  Nevertheless, the request processor was recycled, i.e. 
  readded to the processor pool.
 
  As the processor was recycled, the cometEvent.close() must 
  have happened *after* CoyoteAdapter had made the decision not 
  to recycle Request/Response, but *before* Http11AprProtocol 
  had made the decision to recycle the processor.
 
  To verify this, I modified the methods 
  Http11AprProcessor.event and Http11AprProcessor.process.
 
  I replaced every occurrence of:
 
recycle();
 
  within these methods with the following lines:
 
org.apache.catalina.connector.Request req = 
  (org.apache.catalina.connector.Request) request.getNote(1);
org.apache.catalina.connector.Response res = 
  (org.apache.catalina.connector.Response) response.getNote(1);
req.recycle( );
res.recycle( );
recycle();
 
  I know that this is a hack and must be solved in a better way 
  (and also for the NIOConnector), but with these modifications 
  I enforced a single decision point for recycling of 
  Request/Response *and* the processor.
 
  When running Tomcat with these modifications, my Servlet no 
  longer received non-recycled Request objects.
 
 
  Regards,
  Matthias
 
  
 
  
 -
  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 

Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
(Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

Hello All,

I have a problem with my understanding of data sources within Tomcat.

I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
then open up Tomcat Administration and I see MRS under:

Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

I then open up Resources - Data Sources, and I 2 data source entries
have been crated (mssql  db2), however their configuration information
(url, driver class, etc..) is complete empty.  And, of course, the
application doesn't work because the JDBC calls are broken.

I go in, using the Administration tool again, configure the data
sources, providing URL, driver class, etc.. commit the changes and
everything works great.

THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
the application again.  Then the application, when deployed, just
overwrites all the data source information and I'm forced to enter it
all again for the app to work.

I,  using the Administration tool, tried putting the data source entries
in for the entire Tomcat Server (Tomcat Server - Resources - Data
Sources) versus putting them in for the specific application.  However,
the app. still dosen't work.

My question is, how do I make these data source entires 'stay put', so
that when the app is redeployed it can still make the JDBC calls?
Obviously I don't want to have to keep putting these in every time the
app is deployed.

All help is appreciated.

-jeff


-
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: Data Sources Overwritten

2007-06-14 Thread David Smith
Best bet is to configure it manually in the context.xml for the webapp.  
I've never had good luck with the administration webapp in the very few 
times I've tried to use it. 

You describe tomcat as over-writing the config submitted via the admin 
webapp.  It's more likely the admin webapp is changing the running state 
of tomcat but not persisting those changes to disk.  When you restart, 
it's as if you never made any changes at all.


--David

Jeffrey C. Baldwin wrote:


(Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

Hello All,

I have a problem with my understanding of data sources within Tomcat.

I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
then open up Tomcat Administration and I see MRS under:

Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

I then open up Resources - Data Sources, and I 2 data source entries
have been crated (mssql  db2), however their configuration information
(url, driver class, etc..) is complete empty.  And, of course, the
application doesn't work because the JDBC calls are broken.

I go in, using the Administration tool again, configure the data
sources, providing URL, driver class, etc.. commit the changes and
everything works great.

THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
the application again.  Then the application, when deployed, just
overwrites all the data source information and I'm forced to enter it
all again for the app to work.

I,  using the Administration tool, tried putting the data source entries
in for the entire Tomcat Server (Tomcat Server - Resources - Data
Sources) versus putting them in for the specific application.  However,
the app. still dosen't work.

My question is, how do I make these data source entires 'stay put', so
that when the app is redeployed it can still make the JDBC calls?
Obviously I don't want to have to keep putting these in every time the
app is deployed.

All help is appreciated.

-jeff


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



mod_jk along side mod_dir -- How to get PHP to be seen as a default page

2007-06-14 Thread Dan D.
Hello,

First, my apologies for inadvertently hijacking a previous thread.  Long time 
reader, first time poster.  Won't happen again.

Now, First the versions:
Apache : 1.3.33
Tomcat: 6.0.13
mod_jk: 1.2.23

I am currently working on upgrading our environment to a newer version of 
Tomcat and mod_jk, and seem to be running into an issue with mod_jk and 
mod_dir.  More specifically, the issue I am running into is the default file 
list.

As I understand, it is intended behavior for the Apache DirectoryIndex 
directive to be more or less ignored, and instead the welcome-file-list / 
directive in web.xml is used to determine which files are loaded and in 
which order by default.

Now, the issue I run into is that I do not know in advance what our 
customers will be loading on their site.  There is a very real possibility 
that they may have an index.php file, which we want to have load first. 
This is something that I want to have Apache load, instead of Tomcat 
attempting to parse it, since we run php in a sandbox (suPHP).

Everything I have attempted, ends up basically the same when attempting to 
view a site by the hostname only (ie., http://hostname.tld/)

If I add
welcome-fileindex.php/welcome-file
to the welcome-file-list in my web.xml, it simply asks me to download the 
php file, instead of it being parsed by Apache.

If it is not in the welcome-file-list, it simply goes to the next one that 
is (index.html) and is still parsed by Tomcat, not Apache.

The related Apache Jk settings are as follows:


In addition, after the mod_jk include, but prior to any Jk settings, I have 
the following:


LoadModule dir_module   libexec/mod_dir.so
LoadModule jk_modulelibexec/mod_jk.so

IfModule mod_dir.c
DirectoryIndex default.html default.htm index.php index.shtml index.html 
index.htm home.html home.htm welcome.html index.jsp
/IfModule
Location /
SetEnvIf REQUEST_URI ^/(.*)/*.php$ no-jk
SetEnvIf REQUEST_URI ^/(.*)/*.html$ no-jk
/Location

JkWorkersFile /web/conf/workers.properties
JkUnMount /*.php local
JkMountFile /web/conf/uriworkermap.properties
JkLogFile /web/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat %w %V %U %T

The contents of workers.properties are:

worker.list=local,jkstatus
# Set properties for worker1 (ajp13)
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009
worker.local.lbfactor=1
worker.jkstatus.type=status
worker.local.mount=/ /*



The contents of uriworkermap.properties are:
#exclude extensions
!*.html=local
!*.php=local


I understand that there are a few settings that are redundant, but I have 
tried every don't touch php, tomcat setting I can find, and it is still 
attempting to parse it.

Also a thing to note.  This only happens when attempting to view the default 
page.  If I browse directly to http://hostname.tld/index.php, it works fine.

So, my question is, how do I either prevent Tomcat from handling these 
requests, or tell it to pass them back to Apache if it doesn't know what to 
do with them?

I thank you for your time and help in this matter,

Dan D.


How do I match the database Resource in the Context depending on the development environment ?

2007-06-14 Thread Scott Marshall
Hi all

 

I'm using Tomcat 5.5, and am setting up Connection pools for the
database, using the context.xml file from the META-INF directory. 

We do / will have a multi region series of dev environments  (local,
dev, UAT, PAT, Live etc) as the code gets developed.

Each Resource will point to a different database, and need different
connection settings, e.g

 

?xml version=1.0 encoding=UTF-8?

 Context crossContext=true debug=5 path=/ipsl_app
reloadable=true

Resource

  name=jdbc/connectionPool

  auth=Container

  type=javax.sql.DataSource

  driverClassName=net.sourceforge.jtds.jdbc.Driver

  factory=org.apache.commons.dbcp.BasicDataSourceFactory 

  user=sa

  password=sandstone

  maxIdle=2

  maxWait=5000

 
url=jdbc:jtds:sqlserver://testheat.company.com:1433/test;user=sa;passwo
rd=test

  maxActive=4

  removeAbandoned=true removeAbandonedTimeout=60
logAbandoned=true/ 

   /Context

 

 

My question is how do I put multiple Resource elements within the
Context element, and ensure the correct Resource is read for the correct
environment ? 

The only real idea I have so far on how to do this is to use a different
'name' attribute values for each Resource, and determine which 'name' to
select based on the value in a properties file that would say which
environment (dev, Live) was in use.  

 

But I can't be the first one to run into this problem, and Google wasn't
any help. Can anyone give me any hints on how they've done it, or if
there's a best practice ? The Tomcat documentation wasn't any real help,
and I don't want to have to edit the file before deployment etc. If I'm
on the wrong track completely , let me know.

 

Thanks very much

 

Scott

 



This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
David,

Where do I put this context.xml file?

I noticed that when I deploy the app using manager, then configure the
data sources using the admin tool... that a file names mrs.xml (mrs is
the name of the application I am deploying) is created
(/usr/local/tomcat/conf/Catalina/localhost), it contains all of the data
source information and app works fine, long as it is there.  However,
this file gets removed when I deploy via the webapp again, and then...
the application is broken again.

So, obviously the contents of mrs.xml are right, because the app works
while it's there... so you're saying I need to put this information into
context.xml, where should I put this context.xml file in the filesystem?
 Is it odd that this mrs.xml gets deleted when I deploy the app via the
manager?

I'm pasting the contents of the mrs.xml file below, again.. as long as
this mrs2.xml is in the directory noted above, the app works... but as
soon as I re-deploy the app through the web interface, this file gets
deleted and the app no longer works...

Thanks for your assistance.
jeff

?xml version='1.0' encoding='utf-8'?
Context docBase=/usr/local/tomcat/webapps/mrs2 path=/mrs2
workDir=work/Catalina/localhost/mrs2
  Resource auth=Container description=zos DB2 Connection
name=jdbc/ZosDataSource type=javax.sql.DataSource/
  Resource auth=Container description=local DB2 Connection
name=jdbc/db2ds type=javax.sql.DataSource/
  Resource auth=Container description=msql DB Connection
name=jdbc/mssql2000ds type=javax.sql.DataSource/
  ResourceParams name=jdbc/ZosDataSource
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valueAN12RAMA/value
/parameter
parameter
  nameurl/name
  valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value
/parameter
parameter
  namedriverClassName/name
  valuecom.ibm.db2.jcc.DB2Driver/value
/parameter
parameter
  namemaxIdle/name
  value1/value
/parameter
parameter
  nameusername/name
  valuename/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/db2ds
parameter
  namedriverClassName/name
  value/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/mssql2000ds
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valuepv345ankita/value
/parameter
parameter
  nameurl/name

valuejdbc:jtds:sqlserver://123.456.789.96/mrsuat;user=name;password=pv123ankita/value
/parameter
parameter


David Smith wrote:
 Best bet is to configure it manually in the context.xml for the webapp. 
 I've never had good luck with the administration webapp in the very few
 times I've tried to use it.
 You describe tomcat as over-writing the config submitted via the admin
 webapp.  It's more likely the admin webapp is changing the running state
 of tomcat but not persisting those changes to disk.  When you restart,
 it's as if you never made any changes at all.
 
 --David
 
 Jeffrey C. Baldwin wrote:
 
 (Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

 Hello All,

 I have a problem with my understanding of data sources within Tomcat.

 I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
 then open up Tomcat Administration and I see MRS under:

 Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

 I then open up Resources - Data Sources, and I 2 data source entries
 have been crated (mssql  db2), however their configuration information
 (url, driver class, etc..) is complete empty.  And, of course, the
 application doesn't work because the JDBC calls are broken.

 I go in, using the Administration tool again, configure the data
 sources, providing URL, driver class, etc.. commit the changes and
 everything works great.

 THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
 the application again.  Then the application, when deployed, just
 overwrites all the data source information and I'm forced to enter it
 all again for the app to work.

 I,  using the Administration tool, tried putting the data source entries
 in for the entire Tomcat Server (Tomcat Server - Resources - Data
 Sources) versus putting them in for the specific application.  However,
 the app. still dosen't work.

 My question is, how do I make these data source entires 'stay put', so
 that when the app is redeployed it can still make the JDBC calls?
 Obviously I don't want to have to keep putting these in every time the
 app is deployed.

 All help is appreciated.

 -jeff


 -
 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: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
I appreciate all the input guys.  I put everything into server.xml and
the application is working great.

One small problem though... if I undeploy the app, then deploy it
again... I get the same database problem, UNTIL I restart the TomCat
service itself.  Once I restart Tomcat, all is well..

So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?

Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?

Thanks!

Johnny Kewl wrote:
 Jeff, I dont use JNDI for dbs, got my own, but its sounds like you just
 not configuring some xml somewhere...
 On your system have a look at this link...
 http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html
 
 As I said, no expert, but you can see that in the server.xml, thats
 where the pool is actually
 setup. So those setting will say create 20 dB connections. This is done
 so that your app reacts quickly.
 
 Then in Web.xml, just looks like a mapping of the pool objects to a
 database object...
 
 and then finally your application will get the context, which really
 just grabs a connection from the pool, and returns it as a
 javax.sql.DataSource to your application.
 
 Anyway have a look at that and if you think you have it all, post the
 equiv snippets of your config, and I'm sure the guru's will spot the
 problem.
 If I had to guess, I think your problem is in server.xml, because when
 you do it yourself, thats where it should have happened.
 ie when the server starts up, it will make the pool and thats
 probably why it kills the pool every time its started.
 
 good luck...
 
 
 
 - Original Message - From: Jeffrey C. Baldwin
 [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Sent: Thursday, June 14, 2007 4:46 PM
 Subject: Data Sources Overwritten
 
 
 (Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

 Hello All,

 I have a problem with my understanding of data sources within Tomcat.

 I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
 then open up Tomcat Administration and I see MRS under:

 Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

 I then open up Resources - Data Sources, and I 2 data source entries
 have been crated (mssql  db2), however their configuration information
 (url, driver class, etc..) is complete empty.  And, of course, the
 application doesn't work because the JDBC calls are broken.

 I go in, using the Administration tool again, configure the data
 sources, providing URL, driver class, etc.. commit the changes and
 everything works great.

 THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
 the application again.  Then the application, when deployed, just
 overwrites all the data source information and I'm forced to enter it
 all again for the app to work.

 I,  using the Administration tool, tried putting the data source entries
 in for the entire Tomcat Server (Tomcat Server - Resources - Data
 Sources) versus putting them in for the specific application.  However,
 the app. still dosen't work.

 My question is, how do I make these data source entires 'stay put', so
 that when the app is redeployed it can still make the JDBC calls?
 Obviously I don't want to have to keep putting these in every time the
 app is deployed.

 All help is appreciated.

 -jeff


 -
 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: Data Sources Overwritten

2007-06-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

Jeffrey C. Baldwin wrote:
 I appreciate all the input guys.  I put everything into server.xml and
 the application is working great.

You should put that setup into META-INF/context.xml in your webapp
directory (or your WAR file) instead of into server.xml. This is likely
to fix your problem.

 So, my question is, I was trying to set it up so that my developers
 could just deploy/undeploy/stop/start their apps all through the web,
 w/out needing shell access to the server.  Is there a way for them to
 restart the Tomcat service through a web interface?

Restart the entire Tomcat service? I don't think Tomcat includes this
capability. You'd have to write your own, separate utility app that can
take down and restart Tomcat.

 Is it normal that they should have to restart the entire Tomcat service
 for their app to be able to talk to the configured database connections
 in server.xml?

No, it's not. Configuring those connections in context.xml will
certainly alleviate this problem.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGcXWJ9CaO5/Lv0PARAmhvAJ0aJATm+wlRQ5vjomN7DrDqXR3GxACeJ07h
NiTcmPBAk0XsmYRUySzWPl4=
=Ek8Y
-END PGP SIGNATURE-

-
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: Data Sources Overwritten

2007-06-14 Thread Johnny Kewl

Ha, this is kinda cool.
When you use the admin manager it makes the file for you
OK, so now either go into netbeans and paste that file  mrs.xml  under 
META-INF

That will give you a pool for JUST YOUR WEB app.

OR

copy the contents and stick it in server.xml

That will give you a POOL for ALL web apps...

Magic... nice way to make them... see, getting stuck can help ;)


- Original Message - 
From: Jeffrey C. Baldwin [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 6:19 PM
Subject: Re: Data Sources Overwritten



David,

Where do I put this context.xml file?

I noticed that when I deploy the app using manager, then configure the
data sources using the admin tool... that a file names mrs.xml (mrs is
the name of the application I am deploying) is created
(/usr/local/tomcat/conf/Catalina/localhost), it contains all of the data
source information and app works fine, long as it is there.  However,
this file gets removed when I deploy via the webapp again, and then...
the application is broken again.

So, obviously the contents of mrs.xml are right, because the app works
while it's there... so you're saying I need to put this information into
context.xml, where should I put this context.xml file in the filesystem?
Is it odd that this mrs.xml gets deleted when I deploy the app via the
manager?

I'm pasting the contents of the mrs.xml file below, again.. as long as
this mrs2.xml is in the directory noted above, the app works... but as
soon as I re-deploy the app through the web interface, this file gets
deleted and the app no longer works...

Thanks for your assistance.
jeff

?xml version='1.0' encoding='utf-8'?
Context docBase=/usr/local/tomcat/webapps/mrs2 path=/mrs2
workDir=work/Catalina/localhost/mrs2
 Resource auth=Container description=zos DB2 Connection
name=jdbc/ZosDataSource type=javax.sql.DataSource/
 Resource auth=Container description=local DB2 Connection
name=jdbc/db2ds type=javax.sql.DataSource/
 Resource auth=Container description=msql DB Connection
name=jdbc/mssql2000ds type=javax.sql.DataSource/
 ResourceParams name=jdbc/ZosDataSource
   parameter
 namemaxWait/name
 value1/value
   /parameter
   parameter
 namemaxActive/name
 value2/value
   /parameter
   parameter
 namepassword/name
 valueAN12RAMA/value
   /parameter
   parameter
 nameurl/name
 valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value
   /parameter
   parameter
 namedriverClassName/name
 valuecom.ibm.db2.jcc.DB2Driver/value
   /parameter
   parameter
 namemaxIdle/name
 value1/value
   /parameter
   parameter
 nameusername/name
 valuename/value
   /parameter
 /ResourceParams
 ResourceParams name=jdbc/db2ds
   parameter
 namedriverClassName/name
 value/value
   /parameter
 /ResourceParams
 ResourceParams name=jdbc/mssql2000ds
   parameter
 namemaxWait/name
 value1/value
   /parameter
   parameter
 namemaxActive/name
 value2/value
   /parameter
   parameter
 namepassword/name
 valuepv345ankita/value
   /parameter
   parameter
 nameurl/name

valuejdbc:jtds:sqlserver://123.456.789.96/mrsuat;user=name;password=pv123ankita/value
   /parameter
   parameter


David Smith wrote:

Best bet is to configure it manually in the context.xml for the webapp.
I've never had good luck with the administration webapp in the very few
times I've tried to use it.
You describe tomcat as over-writing the config submitted via the admin
webapp.  It's more likely the admin webapp is changing the running state
of tomcat but not persisting those changes to disk.  When you restart,
it's as if you never made any changes at all.

--David

Jeffrey C. Baldwin wrote:


(Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

Hello All,

I have a problem with my understanding of data sources within Tomcat.

I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
then open up Tomcat Administration and I see MRS under:

Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

I then open up Resources - Data Sources, and I 2 data source entries
have been crated (mssql  db2), however their configuration information
(url, driver class, etc..) is complete empty.  And, of course, the
application doesn't work because the JDBC calls are broken.

I go in, using the Administration tool again, configure the data
sources, providing URL, driver class, etc.. commit the changes and
everything works great.

THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
the application again.  Then the application, when deployed, just
overwrites all the data source information and I'm forced to enter it
all again for the app to work.

I,  using the Administration tool, tried putting the data source entries
in for the entire Tomcat Server (Tomcat Server - Resources - Data
Sources) versus putting them in for the specific application.  However,
the app. still dosen't work.

My 

Re: Data Sources Overwritten

2007-06-14 Thread Johnny Kewl

Chris, the documentation
http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html
explicitly says... have a look at postgres example, that file should have 
same name as
the war, or the app maybe it can be put into context.xml, but are you 
sure?




- Original Message - 
From: Christopher Schultz [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 7:06 PM
Subject: Re: Data Sources Overwritten



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

Jeffrey C. Baldwin wrote:

I appreciate all the input guys.  I put everything into server.xml and
the application is working great.


You should put that setup into META-INF/context.xml in your webapp
directory (or your WAR file) instead of into server.xml. This is likely
to fix your problem.


So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?


Restart the entire Tomcat service? I don't think Tomcat includes this
capability. You'd have to write your own, separate utility app that can
take down and restart Tomcat.


Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?


No, it's not. Configuring those connections in context.xml will
certainly alleviate this problem.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGcXWJ9CaO5/Lv0PARAmhvAJ0aJATm+wlRQ5vjomN7DrDqXR3GxACeJ07h
NiTcmPBAk0XsmYRUySzWPl4=
=Ek8Y
-END PGP SIGNATURE-

-
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: Data Sources Overwritten

2007-06-14 Thread wxcd sxdez

 the war, or the app maybe it can be put into context.xml, but are you  
 sure?
 
Sure it should be done in this way ! So, you don't need to restart your entire 
server when you need to add/ change the datasource configuration.
 
Context.xml is part of your webapp, and not of your tomcat.
 
Neocollec.
_
Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail, plus 
sûr, plus simple et plus complet !
http://www.windowslive.fr/hotmail/default.asp

Re: Data Sources Overwritten

2007-06-14 Thread Johnny Kewl


Jeff, look I'm not sure, but it shouldnt do that.
Just make absolutely sure that the app is closing those connections, ie 
giving them back to the pool only reason I can think you get this 
behaviour.


If you dont close them properly... eventually Tomcat will break... it wont 
have another connection to hand out.


If you look at the documentation there is an eg at the bottom that shows u 
how to make sure you do it right.


- Original Message - 
From: Jeffrey C. Baldwin [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 6:53 PM
Subject: Re: Data Sources Overwritten



I appreciate all the input guys.  I put everything into server.xml and
the application is working great.

One small problem though... if I undeploy the app, then deploy it
again... I get the same database problem, UNTIL I restart the TomCat
service itself.  Once I restart Tomcat, all is well..

So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?

Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?

Thanks!

Johnny Kewl wrote:

Jeff, I dont use JNDI for dbs, got my own, but its sounds like you just
not configuring some xml somewhere...
On your system have a look at this link...
http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html

As I said, no expert, but you can see that in the server.xml, thats
where the pool is actually
setup. So those setting will say create 20 dB connections. This is done
so that your app reacts quickly.

Then in Web.xml, just looks like a mapping of the pool objects to a
database object...

and then finally your application will get the context, which really
just grabs a connection from the pool, and returns it as a
javax.sql.DataSource to your application.

Anyway have a look at that and if you think you have it all, post the
equiv snippets of your config, and I'm sure the guru's will spot the
problem.
If I had to guess, I think your problem is in server.xml, because when
you do it yourself, thats where it should have happened.
ie when the server starts up, it will make the pool and thats
probably why it kills the pool every time its started.

good luck...



- Original Message - From: Jeffrey C. Baldwin
[EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Thursday, June 14, 2007 4:46 PM
Subject: Data Sources Overwritten



(Tomcat 5.0.28 running on CentOS 4.4 using Java 1.4.2_14-b05)

Hello All,

I have a problem with my understanding of data sources within Tomcat.

I have an application (MRS).  I deploy MRS using the Tomcat Manager.  I
then open up Tomcat Administration and I see MRS under:

Tomcat Server - Service (Catalina) - Host (localhost) - Context (mrs)

I then open up Resources - Data Sources, and I 2 data source entries
have been crated (mssql  db2), however their configuration information
(url, driver class, etc..) is complete empty.  And, of course, the
application doesn't work because the JDBC calls are broken.

I go in, using the Administration tool again, configure the data
sources, providing URL, driver class, etc.. commit the changes and
everything works great.

THIS IS WHERE THE PROBLEM comes in, it all works great until we deploy
the application again.  Then the application, when deployed, just
overwrites all the data source information and I'm forced to enter it
all again for the app to work.

I,  using the Administration tool, tried putting the data source entries
in for the entire Tomcat Server (Tomcat Server - Resources - Data
Sources) versus putting them in for the specific application.  However,
the app. still dosen't work.

My question is, how do I make these data source entires 'stay put', so
that when the app is redeployed it can still make the JDBC calls?
Obviously I don't want to have to keep putting these in every time the
app is deployed.

All help is appreciated.

-jeff


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





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

Re: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
Chris,

Thank you for the time. However, I'm still not having any luck...

Again, I have the entries in server.xml, so if I restart the Tomcat
service AFTER deploying the app, all is well.  However, I want the
application developers to be able to deploy their app and not have to,
or need to contact me to, restart the Tomcat service.

Thanks again!

In:
/usr/local/tomcat/webapps/mrs2/META-INF

I have:

?xml version='1.0' encoding='utf-8'?
Context docBase=/usr/local/tomcat/webapps/mrs2 path=/mrs2
workDir=work/Catalina/localhost/mrs2
  Resource auth=Container description=zos DB2 Connection
name=jdbc/ZosDataSource type=javax.sql.DataSource/
  Resource auth=Container description=local DB2 Connection
name=jdbc/db2ds type=javax.sql.DataSource/
  Resource auth=Container description=msql DB Connection
name=jdbc/mssql2000ds type=javax.sql.DataSource/
  ResourceParams name=jdbc/ZosDataSource
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valuetest/value
/parameter
parameter
  nameurl/name
  valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value
/parameter
parameter
  namedriverClassName/name
  valuecom.ibm.db2.jcc.DB2Driver/value
/parameter
parameter
  namemaxIdle/name
  value1/value
/parameter
parameter
  nameusername/name
  valueTS59MRS/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/db2ds
parameter
  namedriverClassName/name
  value/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/mssql2000ds
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valuepassword/value
/parameter
parameter
  nameurl/name
valuejdbc:jtds:sqlserver://123.456.789.96/mrsuat;user=rreddy;password=password/value
/parameter
parameter
  namedriverClassName/name
  valuenet.sourceforge.jtds.jdbc.Driver/value
/parameter
parameter
  namemaxIdle/name
  value1/value
/parameter
parameter
  nameusername/name
  valuerreddy/value
/parameter
  /ResourceParams
/Context


Christopher Schultz wrote:
 Jeffrey,
 
 Jeffrey C. Baldwin wrote:
 I appreciate all the input guys.  I put everything into server.xml and
 the application is working great.
 
 You should put that setup into META-INF/context.xml in your webapp
 directory (or your WAR file) instead of into server.xml. This is likely
 to fix your problem.
 
 So, my question is, I was trying to set it up so that my developers
 could just deploy/undeploy/stop/start their apps all through the web,
 w/out needing shell access to the server.  Is there a way for them to
 restart the Tomcat service through a web interface?
 
 Restart the entire Tomcat service? I don't think Tomcat includes this
 capability. You'd have to write your own, separate utility app that can
 take down and restart Tomcat.
 
 Is it normal that they should have to restart the entire Tomcat service
 for their app to be able to talk to the configured database connections
 in server.xml?
 
 No, it's not. Configuring those connections in context.xml will
 certainly alleviate this problem.
 
 -chris
 

-
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: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
Also, here is a copy of my server.xml.

?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be
updated and saved name=UserDatabase
type=org.apache.catalina.UserDatabase/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
  /GlobalNamingResources
  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2
disableUploadTimeout=true port=8080 redirectPort=8443
maxSpareThreads=75 maxThreads=150
minSpareThreads=25
/Connector
Connector port=8009 protocol=AJP/1.3
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler
redirectPort=8443
/Connector
Engine defaultHost=localhost name=Catalina
Host name=localhost debug=0 appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs prefix=localhost_access_log. suffix=.txt
pattern=common resolveHosts=fal
se /
Logger className=org.apache.catalina.logger.FileLogger
directory=logs prefix=localhost_log. suffix=.txt timestamp=true /
Context debug=0 docBase=mrs2 path=/mrs2 reloadable=true
Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_mrs2_log. suffix=.txt timestamp=true/
   Resource name=jdbc/ZosDataSource auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/ZosDataSource
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value5/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valueTS59MRS/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuecom.ibm.db2.jcc.DB2Driver/value
   /parameter
   parameter
   nameurl/name

valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value  !--
production 123.456.789.120:5019/NETSNDB01 --
   /parameter
   /ResourceParams
   Resource name=jdbc/mssql2000ds auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/mssql2000ds
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value10/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valuerreddy/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuenet.sourceforge.jtds.jdbc.Driver/value
   /parameter
   parameter
   nameurl/name

valuejdbc:jtds:sqlserver://123.456.789.96/mrs;user=rreddy;password=pv123ankita/value
/parameter
   /ResourceParams
/Context
/Host
Logger className=org.apache.catalina.logger.FileLogger
prefix=catalina_log. suffix=.txt timestamp=true/
  Realm 

Re: Data Sources Overwritten

2007-06-14 Thread Pid

Johnny Kewl wrote:

Chris, the documentation
http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html
explicitly says... have a look at postgres example, that file should 
have same name as
the war, or the app maybe it can be put into context.xml, but are 
you sure?


The /deployed/ XML file can be placed in

 tomcat/service/host/appname.xml

or

 tomcat/Catalina/localhost/mrs.xml


Chris was indicating that you put a 'META-INF/context.xml' in your war 
or webapp directory - which Tomcat will then deploy to the named file above.


The deployed file may be removed or replaced during restarts, and 
overwritten by the one in your webapp.


p



- Original Message - From: Christopher Schultz 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, June 14, 2007 7:06 PM
Subject: Re: Data Sources Overwritten



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

Jeffrey C. Baldwin wrote:

I appreciate all the input guys.  I put everything into server.xml and
the application is working great.


You should put that setup into META-INF/context.xml in your webapp
directory (or your WAR file) instead of into server.xml. This is likely
to fix your problem.


So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?


Restart the entire Tomcat service? I don't think Tomcat includes this
capability. You'd have to write your own, separate utility app that can
take down and restart Tomcat.


Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?


No, it's not. Configuring those connections in context.xml will
certainly alleviate this problem.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGcXWJ9CaO5/Lv0PARAmhvAJ0aJATm+wlRQ5vjomN7DrDqXR3GxACeJ07h
NiTcmPBAk0XsmYRUySzWPl4=
=Ek8Y
-END PGP SIGNATURE-

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






smime.p7s
Description: S/MIME Cryptographic Signature


Re: Data Sources Overwritten

2007-06-14 Thread Pid

Jeffrey C. Baldwin wrote:

Chris,

Thank you for the time. However, I'm still not having any luck...


What's in your Host definition in server.xml, can you post that too?

p



Again, I have the entries in server.xml, so if I restart the Tomcat
service AFTER deploying the app, all is well.  However, I want the
application developers to be able to deploy their app and not have to,
or need to contact me to, restart the Tomcat service.

Thanks again!

In:
/usr/local/tomcat/webapps/mrs2/META-INF

I have:

?xml version='1.0' encoding='utf-8'?
Context docBase=/usr/local/tomcat/webapps/mrs2 path=/mrs2
workDir=work/Catalina/localhost/mrs2
  Resource auth=Container description=zos DB2 Connection
name=jdbc/ZosDataSource type=javax.sql.DataSource/
  Resource auth=Container description=local DB2 Connection
name=jdbc/db2ds type=javax.sql.DataSource/
  Resource auth=Container description=msql DB Connection
name=jdbc/mssql2000ds type=javax.sql.DataSource/
  ResourceParams name=jdbc/ZosDataSource
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valuetest/value
/parameter
parameter
  nameurl/name
  valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value
/parameter
parameter
  namedriverClassName/name
  valuecom.ibm.db2.jcc.DB2Driver/value
/parameter
parameter
  namemaxIdle/name
  value1/value
/parameter
parameter
  nameusername/name
  valueTS59MRS/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/db2ds
parameter
  namedriverClassName/name
  value/value
/parameter
  /ResourceParams
  ResourceParams name=jdbc/mssql2000ds
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
  namemaxActive/name
  value2/value
/parameter
parameter
  namepassword/name
  valuepassword/value
/parameter
parameter
  nameurl/name
valuejdbc:jtds:sqlserver://123.456.789.96/mrsuat;user=rreddy;password=password/value
/parameter
parameter
  namedriverClassName/name
  valuenet.sourceforge.jtds.jdbc.Driver/value
/parameter
parameter
  namemaxIdle/name
  value1/value
/parameter
parameter
  nameusername/name
  valuerreddy/value
/parameter
  /ResourceParams
/Context


Christopher Schultz wrote:

Jeffrey,

Jeffrey C. Baldwin wrote:

I appreciate all the input guys.  I put everything into server.xml and
the application is working great.

You should put that setup into META-INF/context.xml in your webapp
directory (or your WAR file) instead of into server.xml. This is likely
to fix your problem.


So, my question is, I was trying to set it up so that my developers
could just deploy/undeploy/stop/start their apps all through the web,
w/out needing shell access to the server.  Is there a way for them to
restart the Tomcat service through a web interface?

Restart the entire Tomcat service? I don't think Tomcat includes this
capability. You'd have to write your own, separate utility app that can
take down and restart Tomcat.


Is it normal that they should have to restart the entire Tomcat service
for their app to be able to talk to the configured database connections
in server.xml?

No, it's not. Configuring those connections in context.xml will
certainly alleviate this problem.

-chris



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






smime.p7s
Description: S/MIME Cryptographic Signature


deploying ant

2007-06-14 Thread bhagya jyothi
  
Hi all,

AM new to Ant build tool and was jus writing an application.am done with my 
programme and when i give ant in my present working directory at command prompt 
its fine.when i give ant deploy or ant deploywar it's saying Build 
Successfull but nothing is there under build and deploy.also when is gave ant 
list-- nothing is shown under my current directory.And giving ant install its 
saying [Install] FAIL-Failed to deploy application at context path/(my working 
directory) BUILD FAILED.

can any one tell what to do exactly so that i can run it successfully...waiting 
for a wuick reply.

Jyothi

Re: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
P,

This is everything from server.xml

?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be
updated and saved name=UserDatabase
type=org.apache.catalina.UserDatabase/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
  /GlobalNamingResources
  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2
disableUploadTimeout=true port=8080 redirectPort=8443
maxSpareThreads=75 maxThreads=150
minSpareThreads=25
/Connector
Connector port=8009 protocol=AJP/1.3
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler
redirectPort=8443
/Connector
Engine defaultHost=localhost name=Catalina
Host name=localhost debug=0 appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs prefix=localhost_access_log. suffix=.txt
pattern=common resolveHosts=fal
se /
Logger className=org.apache.catalina.logger.FileLogger
directory=logs prefix=localhost_log. suffix=.txt timestamp=true /
Context debug=0 docBase=mrs2 path=/mrs2 reloadable=true
Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_mrs2_log. suffix=.txt timestamp=true/
   Resource name=jdbc/ZosDataSource auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/ZosDataSource
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value5/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valueTS59MRS/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuecom.ibm.db2.jcc.DB2Driver/value
   /parameter
   parameter
   nameurl/name

valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value  !--
production 123.456.789.120:5019/NETSNDB01 --
   /parameter
   /ResourceParams
   Resource name=jdbc/mssql2000ds auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/mssql2000ds
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value10/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valuerreddy/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuenet.sourceforge.jtds.jdbc.Driver/value
   /parameter
   parameter
   nameurl/name

valuejdbc:jtds:sqlserver://123.456.789.96/mrs;user=rreddy;password=pv123ankita/value
/parameter
   /ResourceParams
/Context
/Host
Logger className=org.apache.catalina.logger.FileLogger
prefix=catalina_log. suffix=.txt timestamp=true/
  Realm 

Re: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin


Pid wrote:

 Chris was indicating that you put a 'META-INF/context.xml' in your war
 or webapp directory - which Tomcat will then deploy to the named file
 above.

AHH... I did misunderstand.  I will try creating the WAR with the
context file in place.

Thanks!


 
 
 
 - Original Message - From: Christopher Schultz
 [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, June 14, 2007 7:06 PM
 Subject: Re: Data Sources Overwritten


 Jeffrey,
 
 Jeffrey C. Baldwin wrote:
 I appreciate all the input guys.  I put everything into server.xml and
 the application is working great.
 
 You should put that setup into META-INF/context.xml in your webapp
 directory (or your WAR file) instead of into server.xml. This is likely
 to fix your problem.
 
 So, my question is, I was trying to set it up so that my developers
 could just deploy/undeploy/stop/start their apps all through the web,
 w/out needing shell access to the server.  Is there a way for them to
 restart the Tomcat service through a web interface?
 
 Restart the entire Tomcat service? I don't think Tomcat includes this
 capability. You'd have to write your own, separate utility app that can
 take down and restart Tomcat.
 
 Is it normal that they should have to restart the entire Tomcat service
 for their app to be able to talk to the configured database connections
 in server.xml?
 
 No, it's not. Configuring those connections in context.xml will
 certainly alleviate this problem.
 
 -chris
 

-
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: Comet: Unsufficiently synchronized recycling decisions

2007-06-14 Thread Filip Hanik - Dev Lists

The explanation is enough, thank you for the detailed info.
yes, having two different flags can make life difficult for us, I will 
look into it.


Filip

Reich, Matthias wrote:

Filip,

thank you for the response.  


The issue is fairly simple:

At some point in time (t1) the CoyoteAdapter.service (or the
CoyoteAdapter.event) method calls request.isComet().
If the CometEvent has not been closed at (t1), this method returns true
and request and response are not recycled.

At a later point in time (t2), after returning from the call to the
CoyoteAdapter, the Http11AprProcessor.process (or
Http11AprProcessor.event) method checks the comet flag. If the flag is
false at (t2), the processor will be recycled. 


In almost all cases the comet flag is still true at (t2) if
request.isComet() had returned true at (t1).

However, especially in heavy load situations, another thread may be
scheduled between (t1) and (t2) and call event.close() . In such a
situation, the comet falg will be false at (t2) and the processor is
recycled while request and response are not recycled. The processor will
then process the next request with non-recycled request/response
objects.

My quick and dirty fix calls the recycle methods of request and response
whenever the recycle method of the processor is called, regardless if
request and response had been recycled before or not.


It is not that easy to provide a simple example app that produces such a
behaviour reliably.
I can see that it happens in my application which runs an embedded
Tomcat and a whole bunch of additional threads when the system is under
load, but it does not happen in a simple test situation.


Regards,
Matthias




  

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 8:09 PM

To: Tomcat Users List
Subject: Re: Comet: Unsufficiently synchronized recycling decisions

Reich, Matthias wrote:


 Hello,

I did not get any response on my post from 2 weeks ago.

Even if non-recycling of request/response objects happens only
sporadically and only in webapps where asynchronous 
  

responses may happen


before the event processing has finished, it is definitively a bug.

Should I report it as a bug to receive any reaction?
  
  
a bug would help only if it has an example app, or enough 
info to help 
us truly understand the issue.
personally, I haven't had enough time to look through it to truly 
understand it, cause I believe the fix would probably be 
easier than the 
one described below


Filip



Regards,
Matthias

  
  

-Original Message-
From: Reich, Matthias 
Sent: Wednesday, May 30, 2007 2:04 PM

To: 'Tomcat Users List'
Subject: Comet: Unsufficiently synchronized recycling decisions

Hi,

as mentioned in my contribution to topic 'Web application 
receives request parameters sent to another application on 
Tomcat 6', I sometimes get non-recycled Request objects in a 
BEGIN event. 

A non-recycled request object appeared in a BEGIN event if 
the previous request processed by the same request processor 
was answered asynchronously directly after the BEGIN event.


In such a situation my Servlet sometimes did not get an END 
event, i.e. the CoyoteAdapter was not triggered again and 
therefore could not recycle the Request object.
Nevertheless, the request processor was recycled, i.e. 
readded to the processor pool.


As the processor was recycled, the cometEvent.close() must 
have happened *after* CoyoteAdapter had made the decision not 
to recycle Request/Response, but *before* Http11AprProtocol 
had made the decision to recycle the processor.


To verify this, I modified the methods 
Http11AprProcessor.event and Http11AprProcessor.process.


I replaced every occurrence of:

  recycle();

within these methods with the following lines:

  org.apache.catalina.connector.Request req = 
(org.apache.catalina.connector.Request) request.getNote(1);
  org.apache.catalina.connector.Response res = 
(org.apache.catalina.connector.Response) response.getNote(1);

  req.recycle( );
  res.recycle( );
  recycle();

I know that this is a hack and must be solved in a better way 
(and also for the NIOConnector), but with these modifications 
I enforced a single decision point for recycling of 
Request/Response *and* the processor.


When running Tomcat with these modifications, my Servlet no 
longer received non-recycled Request objects.



Regards,
Matthias



  

-


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 Server CPU utilization goes upto 400%

2007-06-14 Thread Filip Hanik - Dev Lists
man, I need to get a CPU like that, that can actually work 4 times its 
max capacity :)


Filip

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



sticky sessions not sticking

2007-06-14 Thread Eddie Yee

Hi,

I am not sure if this is a bug, but it appears that my sticky sessions 
configuration don't want to stick.   I am running two servers with tomcat 
5.5.20 (configured as single servers ie. no session replication) with 
standard ajp13 connector (8009) and one web server running iPlanet 6 with 
tomcat Connector 1.2.23.


The following are my configurations:

Tomcat server.xml
..
..
   Engine
   defaultHost=localhost
   jvmRoute=TCTAPP1   !-- TCTAPP2 is set for the second 
server  --

   name=Catalina
 Realm className=org.apache.catalina.realm.UserDatabaseRealm/
 Host
 appBase=webapps
 name=localhost
..
..


iPlanet workers.properties

worker.list=balancer
worker.worker1.host=ssatstapp1.xx.com#xxx'd out for privacy
worker.worker1.port=8009
worker.worker1.type=ajp13
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=90
worker.worker1.lbfactor=1
worker.worker1.domain=domain1

worker.worker2.host=ssatstapp2.xx.com
worker.worker2.port=8009
worker.worker2.type=ajp13
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=90
worker.worker2.lbfactor=1
worker.worker2.domain=domain1

worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.method=S
worker.balancer.sticky_session=1
worker.balancer.sticky_session_force=0


iPlanet magnus.conf

Init fn=load-modules funcs=jk_init,jk_service 
shlib=/spfs/iplanet/servers/plugins/lib/nsapi_redirector_1_2_23_sol9.so


Init fn=jk_init 
worker_file=/spfs/iplanet/servers/plugins/lib/workers.properties 
log_level=debug 
log_file=/spfs/iplanet/servers/plugins/lib/nsapi_redirector.log



iPlanet obj.conf
Object name=spat2 ppath=*/spat2/*
ObjectType fn=force-type type=text/html
Service fn=jk_service method=* worker=balancer
/Object


When accessing the application, it occasionally occasionally works but after 
clicking around the application it will get load balanced to the other 
server.  Sometimes it does it right away, sometimes it take a few clicks.


Do you see any problem with the configuration above?

_
Need a break? Find your escape route with Live Search Maps. 
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Parkcp=33.832922~-117.915659style=rlvl=13tilt=-90dir=0alt=-1000scene=1118863encType=1FORM=MGAC01



-
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: Data Sources Overwritten

2007-06-14 Thread Jeffrey C. Baldwin
A big THANK YOU to everyone...

I had the developer put the context.xml file into the META-INF
directory... I then uploaded the WAR file and the application ran
immediately!

Thank you again!  I don't know if this is something the developer should
have known or been doing or something I should have known... but either
way, I am excited!

-jeff

Pid wrote:
 Johnny Kewl wrote:
 Chris, the documentation
 http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html
 explicitly says... have a look at postgres example, that file should
 have same name as
 the war, or the app maybe it can be put into context.xml, but are
 you sure?
 
 The /deployed/ XML file can be placed in
 
  tomcat/service/host/appname.xml
 
 or
 
  tomcat/Catalina/localhost/mrs.xml
 
 
 Chris was indicating that you put a 'META-INF/context.xml' in your war
 or webapp directory - which Tomcat will then deploy to the named file
 above.
 
 The deployed file may be removed or replaced during restarts, and
 overwritten by the one in your webapp.
 
 p
 
 
 
 - Original Message - From: Christopher Schultz
 [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, June 14, 2007 7:06 PM
 Subject: Re: Data Sources Overwritten


 Jeffrey,
 
 Jeffrey C. Baldwin wrote:
 I appreciate all the input guys.  I put everything into server.xml and
 the application is working great.
 
 You should put that setup into META-INF/context.xml in your webapp
 directory (or your WAR file) instead of into server.xml. This is likely
 to fix your problem.
 
 So, my question is, I was trying to set it up so that my developers
 could just deploy/undeploy/stop/start their apps all through the web,
 w/out needing shell access to the server.  Is there a way for them to
 restart the Tomcat service through a web interface?
 
 Restart the entire Tomcat service? I don't think Tomcat includes this
 capability. You'd have to write your own, separate utility app that can
 take down and restart Tomcat.
 
 Is it normal that they should have to restart the entire Tomcat service
 for their app to be able to talk to the configured database connections
 in server.xml?
 
 No, it's not. Configuring those connections in context.xml will
 certainly alleviate this problem.
 
 -chris
 

-
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 Server CPU utilization goes upto 400%

2007-06-14 Thread Jayson Enriquez
rofl

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 14, 2007 12:15 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

man, I need to get a CPU like that, that can actually work 4 times its 
max capacity :)

Filip

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



SSL Tomcat and Apache.

2007-06-14 Thread Jason Lanpher
Hi all,
   
  I have a question for all of you network admins out there.  I am
wondering if it is possible to share an ssl key between both Apache 2.X and
Tomcat 5.X if they are connected via mod jk.  Is this possible or does each
server have to have its own ssl key?
   

Thanks in advance for all of you thoughts on the matter.


Jason Lanpher


RE: SSL Tomcat and Apache.

2007-06-14 Thread Nathan Hook

You should be able to use the same key for both Apache and Tomcat.

However...

If you're using Apache to forward all requests to Tomcat via mod_jk then it 
is my understanding that you do not need SSL for Tomcat.


Apache would handle all the the ssl part and then forward a normal request 
to Tomcat via AJP.



Regards.



Original Message Follows
From: Jason Lanpher [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: users users@tomcat.apache.org
Subject: SSL Tomcat and Apache.
Date: Thu, 14 Jun 2007 14:23:06 -0500

Hi all,

  I have a question for all of you network admins out there.  I am
wondering if it is possible to share an ssl key between both Apache 2.X and
Tomcat 5.X if they are connected via mod jk.  Is this possible or does each
server have to have its own ssl key?


Thanks in advance for all of you thoughts on the matter.


Jason Lanpher

_
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows 
Live Hotmail. 
http://imagine-windowslive.com/hotmail/?locale=en-usocid=TXT_TAGHM_migration_HM_mini_pcmag_0507



-
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: sticky sessions not sticking

2007-06-14 Thread Filip Hanik - Dev Lists

change your JVM route to
jvmRoute=worker1, as I believe the jvmRoute value has to match the 
name of the worker.


Filip

Eddie Yee wrote:

Hi,

I am not sure if this is a bug, but it appears that my sticky sessions 
configuration don't want to stick.   I am running two servers with 
tomcat 5.5.20 (configured as single servers ie. no session 
replication) with standard ajp13 connector (8009) and one web server 
running iPlanet 6 with tomcat Connector 1.2.23.


The following are my configurations:

Tomcat server.xml
..
..
   Engine
   defaultHost=localhost
   jvmRoute=TCTAPP1   !-- TCTAPP2 is set for the 
second server  --

   name=Catalina
 Realm className=org.apache.catalina.realm.UserDatabaseRealm/
 Host
 appBase=webapps
 name=localhost
..
..


iPlanet workers.properties

worker.list=balancer
worker.worker1.host=ssatstapp1.xx.com#xxx'd out for privacy
worker.worker1.port=8009
worker.worker1.type=ajp13
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=90
worker.worker1.lbfactor=1
worker.worker1.domain=domain1

worker.worker2.host=ssatstapp2.xx.com
worker.worker2.port=8009
worker.worker2.type=ajp13
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=90
worker.worker2.lbfactor=1
worker.worker2.domain=domain1

worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.method=S
worker.balancer.sticky_session=1
worker.balancer.sticky_session_force=0


iPlanet magnus.conf

Init fn=load-modules funcs=jk_init,jk_service 
shlib=/spfs/iplanet/servers/plugins/lib/nsapi_redirector_1_2_23_sol9.so


Init fn=jk_init 
worker_file=/spfs/iplanet/servers/plugins/lib/workers.properties 
log_level=debug 
log_file=/spfs/iplanet/servers/plugins/lib/nsapi_redirector.log



iPlanet obj.conf
Object name=spat2 ppath=*/spat2/*
ObjectType fn=force-type type=text/html
Service fn=jk_service method=* worker=balancer
/Object


When accessing the application, it occasionally occasionally works but 
after clicking around the application it will get load balanced to the 
other server.  Sometimes it does it right away, sometimes it take a 
few clicks.


Do you see any problem with the configuration above?

_
Need a break? Find your escape route with Live Search Maps. 
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Parkcp=33.832922~-117.915659style=rlvl=13tilt=-90dir=0alt=-1000scene=1118863encType=1FORM=MGAC01 




-
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: SSL Tomcat and Apache.

2007-06-14 Thread Filip Hanik - Dev Lists

Jason Lanpher wrote:

Hi all,
   
  I have a question for all of you network admins out there.  I am

wondering if it is possible to share an ssl key between both Apache 2.X and
Tomcat 5.X if they are connected via mod jk.  Is this possible or does each
server have to have its own ssl key?
  
you sure can share a key, but why do you need a SSL key for Tomcat if 
you are connecting to it using mod_jk?

mod_jk/AJP doesn't support SSL.

Filip
   


Thanks in advance for all of you thoughts on the matter.


Jason Lanpher

  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.472 / Virus Database: 269.8.15/848 - Release Date: 6/13/2007 12:50 PM
  



-
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: Data Sources Overwritten

2007-06-14 Thread Pid

Jeffrey C. Baldwin wrote:

P,


(our messages crossed, I think)

Looks like you've got the context setup in the server.xml AND the 
external file.  You only need one location, comment out the Context 
definition in server.xml and we'll work on getting the auto-deploy to 
work from the WAR/webapp.



p





This is everything from server.xml

?xml version='1.0' encoding='utf-8'?
Server
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
  Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
  GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
Resource auth=Container description=User database that can be
updated and saved name=UserDatabase
type=org.apache.catalina.UserDatabase/
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams
  /GlobalNamingResources
  Service name=Catalina
Connector acceptCount=100 connectionTimeout=2
disableUploadTimeout=true port=8080 redirectPort=8443
maxSpareThreads=75 maxThreads=150
minSpareThreads=25
/Connector
Connector port=8009 protocol=AJP/1.3
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler
redirectPort=8443
/Connector
Engine defaultHost=localhost name=Catalina
Host name=localhost debug=0 appBase=webapps unpackWARs=true
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs prefix=localhost_access_log. suffix=.txt
pattern=common resolveHosts=fal
se /
Logger className=org.apache.catalina.logger.FileLogger
directory=logs prefix=localhost_log. suffix=.txt timestamp=true /
Context debug=0 docBase=mrs2 path=/mrs2 reloadable=true
Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_mrs2_log. suffix=.txt timestamp=true/
   Resource name=jdbc/ZosDataSource auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/ZosDataSource
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value5/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valueTS59MRS/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuecom.ibm.db2.jcc.DB2Driver/value
   /parameter
   parameter
   nameurl/name

valuejdbc:db2://123.456.789.120:5019/NETSNDB01/value  !--
production 123.456.789.120:5019/NETSNDB01 --
   /parameter
   /ResourceParams
   Resource name=jdbc/mssql2000ds auth=Container
type=javax.sql.DataSource/Resource
   ResourceParams name=jdbc/mssql2000ds
   parameter
   namefactory/name

valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
   namemaxActive/name
   value10/value
   /parameter
   parameter
   namemaxIdle/name
   value1/value
   /parameter
   parameter
   namemaxWait/name
   value1/value
   /parameter
   parameter
   nameusername/name
   valuerreddy/value
   /parameter
   parameter
   namepassword/name
   valuepassword/value
   /parameter
   parameter
   namedriverClassName/name
   valuenet.sourceforge.jtds.jdbc.Driver/value
   /parameter
   parameter
   nameurl/name


Re: sticky sessions not sticking

2007-06-14 Thread Eddie Yee

Hi Filip.

It looks like that solved the problem!  Thanks for your help!

Eddie




From: Filip Hanik - Dev Lists [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: sticky sessions not sticking
Date: Thu, 14 Jun 2007 21:44:59 +0200

change your JVM route to
jvmRoute=worker1, as I believe the jvmRoute value has to match the name 
of the worker.


Filip

Eddie Yee wrote:

Hi,

I am not sure if this is a bug, but it appears that my sticky sessions 
configuration don't want to stick.   I am running two servers with tomcat 
5.5.20 (configured as single servers ie. no session replication) with 
standard ajp13 connector (8009) and one web server running iPlanet 6 with 
tomcat Connector 1.2.23.


The following are my configurations:

Tomcat server.xml
..
..
   Engine
   defaultHost=localhost
   jvmRoute=TCTAPP1   !-- TCTAPP2 is set for the 
second server  --

   name=Catalina
 Realm className=org.apache.catalina.realm.UserDatabaseRealm/
 Host
 appBase=webapps
 name=localhost
..
..


iPlanet workers.properties

worker.list=balancer
worker.worker1.host=ssatstapp1.xx.com#xxx'd out for privacy
worker.worker1.port=8009
worker.worker1.type=ajp13
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=90
worker.worker1.lbfactor=1
worker.worker1.domain=domain1

worker.worker2.host=ssatstapp2.xx.com
worker.worker2.port=8009
worker.worker2.type=ajp13
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=90
worker.worker2.lbfactor=1
worker.worker2.domain=domain1

worker.balancer.type=lb
worker.balancer.balance_workers=worker1,worker2
worker.balancer.method=S
worker.balancer.sticky_session=1
worker.balancer.sticky_session_force=0


iPlanet magnus.conf

Init fn=load-modules funcs=jk_init,jk_service 
shlib=/spfs/iplanet/servers/plugins/lib/nsapi_redirector_1_2_23_sol9.so


Init fn=jk_init 
worker_file=/spfs/iplanet/servers/plugins/lib/workers.properties 
log_level=debug 
log_file=/spfs/iplanet/servers/plugins/lib/nsapi_redirector.log



iPlanet obj.conf
Object name=spat2 ppath=*/spat2/*
ObjectType fn=force-type type=text/html
Service fn=jk_service method=* worker=balancer
/Object


When accessing the application, it occasionally occasionally works but 
after clicking around the application it will get load balanced to the 
other server.  Sometimes it does it right away, sometimes it take a few 
clicks.


Do you see any problem with the configuration above?

_
Need a break? Find your escape route with Live Search Maps. 
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Parkcp=33.832922~-117.915659style=rlvl=13tilt=-90dir=0alt=-1000scene=1118863encType=1FORM=MGAC01




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



_
Hotmail to go? Get your Hotmail, news, sports and much more! 
http://mobile.msn.com



-
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: Using shared Spring Webapp in Tomcat 6

2007-06-14 Thread Caldarale, Charles R
 From: Kevin Wilhelm [mailto:[EMAIL PROTECTED] 
 Subject: Using shared Spring Webapp in Tomcat 6
 
 For Tomcat 6 there is a folder called $CATALINAHOME/lib 
 that is said to be used for that kind of stuff.

No, the $CATALINA_HOME/lib directory is for classes common to all
webapps, not any individual webapps.  Each webapp is normally deployed
in its own directory under the Host appBase (typically
$CATALINA_HOME/webapps).

 1.) Does it work to create a war file from my services webapp 
 and put it into the lib directory? Is this the way to go?

No.

 2.) Furthermore: Where do I start with my JSP/JSF view 
 webapp? I assume I have to access the SessionFacade somehow. 
 I will have to access the logic web app from within my view-webapp.

If your logic webapp is just that - no presentation capabilities -
then it's not really a webapp, is it?  Sounds like you haven't really
thought through the application architecture here.

This may well be more of a Spring topic than a Tomcat one.

 - 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 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, SQL Server 2005 JDBC Realm not working

2007-06-14 Thread Propes, Barry L
so in one connection string you have user and in the Realm you're using 
userName?

-Original Message-
From: Richard Sayre [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 12:42 PM
To: users@tomcat.apache.org
Subject: Tomcat 6, SQL Server 2005 JDBC Realm not working


I have a web app that connects to my SQL Server 2005 Database with no
trouble using this code:

  Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver);
con =
DriverManager.getConnection(jdbc:sqlserver://server-2006;databaseName=v362;user=user;password=dbase);

My application runs fine and I can see data from the database.

Now when I try to set up a Realm to do Database authentication I get an error:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
connectionURL=jdbc:sqlserver://server-2006;databaseName=v362;userName=user;password=dbase
  connectionName=user
  connectionPassword=dbase
  digest=SHA
  userTable=PPMUser userNameCol=UserName
userCredCol=UserPassword
userRoleTable=PPMUser roleNameCol=RoleTomcat /

Exception:

13-Jun-2007 3:56:00 PM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

The strange thing is, if I set up a DSN under Windows and use the Sun
ODBC driver the authentication realm works:

Realm  className=org.apache.catalina.realm.JDBCRealm debug=99
 driverName=sun.jdbc.odbc.JdbcOdbcDriver
  connectionURL=jdbc:odbc:v362
  connectionName=user
  connectionPassword=dbase
  digest=SHA
  userTable=User userNameCol=UserName userCredCol=UserPassword
  userRoleTable=User roleNameCol=RoleTomcat /


Does any one have this type of authentication working with MS SQL
Server 2005 JDBC driver under Tomcat 6?

Thank you,

Rich

-
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: Failed to install Tomcat5 service

2007-06-14 Thread hezjing

Hi!

The problem is resolved by deleting Tomcat5 service from Windows XP
and redo the Tomcat installation:

1) Start | Run and type cmd in the Open:  Click OK.
2) Type: sc delete Tomcat5
3) Reboot the system



On 6/14/07, hezjing [EMAIL PROTECTED] wrote:

Hi!

I got this error when trying to install Tomcat 5.5.23 on Windows XP:

   Failed to install Tomcat5 service.
   Check your settings and permissions
   Ignore and continue anyway (not recommended)?

the above error occurs with these status:
   ..
   tomcat-users.xml written
   Remove folder: C:\Temp\confinstall
   Using Jvm: C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll

I abort the installation at this point.

After searching the Google, I tried to set the environment variable
TEMP and TMP to C:\Temp, but that doesn't help either.

When I open the Services (Local) window, I see that there is a service
named Apache Tomcat (Apache Tomcat 5.5.23 Server -
http://tomcat.apache.org/; ...
I think this service is created but not being remove when I abort the
Tomcat installation.

Please help, thank you!


--

Hez




--

Hez

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