Re: database application

2008-08-14 Thread André Warnier

Brantley Hobbs wrote:
Cue Charles Caldarale hammering someone for not providing a Tomcat 
version in 3...2...1...


Actually, I think he may have missed this one as he was hammering 
someone else for using a packaged Tomcat instead of the official 
distribution.

;-)
3..2..1..

-
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: My Log4j statements going crazy in catalina.out

2008-08-14 Thread emerson cargnin
Thanks gregor. This would be to get tomcat to rotate right?

What i was testing was to have a log4j.properties (which I believe is
the same outcome as the log4j.xml) in the common/classes, and commons
logging and log4j jars in the common/lib.

This worked right I had a tomcat.log which rotates and everything. But
my catalina.log continues to get everything, not only the system.out
(which would be expected) but also all the log4j statements.

Here is the log4j.properties in the common/lib:

log4j.rootLogger=ERROR, R
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'-MM-dd
log4j.appender.R.File=/opt/resin/tomcat/logs/tomcat.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

I honestly think that tomcat main log should rotate by default. It
also should include even all system.out calls. Maybe the way the
catalina.out is done is flawed?

emerson

On 13/08/2008, Gregor Schneider [EMAIL PROTECTED] wrote:
 Well,

 I guess you should v´have a vanilla start with log4j.

 Therefore:

 1st make sure that you've got all necessary libs installed in the
 appropriate folders (guess you're fine here, otherwise no logs would
 show up)

 2nd create a file $catalina_home/common/classes/log4j.xml with the
 following content:

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE log4j:configuration SYSTEM log4j.dtd

 log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/;

  !-- Tomcat Daily Rolling File Appender TRACE, DEBUG, INFO --
  appender name=TomcatDailyFileAppenderInfo
 class=org.apache.log4j.DailyRollingFileAppender
param name=datePattern value='.'-MM-dd /
param name=Append value=true /
param name=file value=${catalina.home}/logs/tomcat.log.INFO /
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern
 value=%d{ISO8601}\t%-5p\t%X{session}\t%X{file}\t[%t]:\t%m%n /
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMax value=INFO/
param name=LevelMin value=TRACE/
param name=AcceptOnMatch value=true/
/filter
  /appender

  !-- Tomcat Daily Rolling File Appender WARNING --
  appender name=TomcatDailyFileAppenderWarning
 class=org.apache.log4j.DailyRollingFileAppender
param name=datePattern value='.'-MM-dd /
param name=Append value=true /
param name=file value=${catalina.home}/logs/tomcat.log.WARN /
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern
 value=%d{ISO8601}\t%-5p\t%X{session}\t%X{file}\t[%t]:\t%m%n /
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMax value=WARNING/
param name=LevelMin value=WARNING/
param name=AcceptOnMatch value=true/
/filter
  /appender

  !-- Tomcat Daily Rolling File Appender ERROR --
  appender name=TomcatDailyFileAppenderError
 class=org.apache.log4j.DailyRollingFileAppender
param name=datePattern value='.'-MM-dd /
param name=Append value=true /
param name=file value=${catalina.home}/logs/tomcat.log.ERROR /
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern
 value=%d{ISO8601}\t%-5p\t%X{session}\t%X{file}\t[%t]:\t%m%n /
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMax value=ERROR/
param name=LevelMin value=ERROR/
param name=AcceptOnMatch value=true/
/filter
  /appender

  !-- Tomcat Daily Rolling File Appender FATAL --
  appender name=TomcatDailyFileAppenderFatal
 class=org.apache.log4j.DailyRollingFileAppender
param name=datePattern value='.'-MM-dd /
param name=Append value=true /
param name=file value=${catalina.home}/logs/tomcat.log.FATAL /
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern
 value=%d{ISO8601}\t%-5p\t%X{session}\t%X{file}\t[%t]:\t%m%n /
/layout
filter class=org.apache.log4j.varia.LevelRangeFilter
param name=LevelMax value=FATAL/
param name=LevelMin value=FATAL/
param name=AcceptOnMatch value=true/
/filter
  /appender

  root
level value=info /
appender-ref ref=TomcatDailyFileAppenderInfo /
appender-ref ref=TomcatDailyFileAppenderWarning /
appender-ref ref=TomcatDailyFileAppenderError /
appender-ref ref=TomcatDailyFileAppenderFatal /
  /root

 /log4j:configuration

 3rd make sure you have the file log4j.dtd in $catalina_home/common/classes

 That's it.

 If you want your webapp to log, just create the webapp's log4j.xml in
 $WEBAPP/WEB-INF/classes


 HTH

 Gregor
 --
 what's puzzlin' you, is the nature of my game
 gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

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

Re: database application

2008-08-14 Thread Brantley Hobbs

LOL

Absolutely no problem.  Someone has to do it!

B.

Caldarale, Charles R wrote:

From: Brantley Hobbs [mailto:[EMAIL PROTECTED]
Subject: Re: database application

Cue Charles Caldarale hammering someone for not providing a Tomcat
version in 3...2...1...



(Sorry I'm late, our marvelous corporate e-mail server didn't let the original 
message through.)

Being precise is one of the things they taught us in Engineering at the real 
school 70 odd miles west of you... (Can't resist getting a dig in when a 
bulldog speaks :-)

  

Seriously, Eleonora...You should read here:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html



If she's using 5.5, then the config given is sadly out of date and conflicts with best 
practice (Logger elements, Context elements in server.xml, etc.).  If it's 
a 5.0 version, then it's not supported, so moving up would be in order.  What's even worse 
is the installation directory looks like one used by 3rd-party repackaged Tomcat versions, 
so getting it to work may be impossible.  Installing a real Tomcat from 
http://tomcat.apache.org should probably be the first order of business.

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

  


-
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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Johnny Kewl


- Original Message - 
From: Peter Desjardins [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Thursday, August 14, 2008 6:58 AM
Subject: Hot redeploying a WAR - HTML is not refreshed



Hi.  I have a web application that consists of an online help system.
It serves HTML content using the Eclipse user assistance system.  The
usage I need to support is that the help system WAR is running in
Tomcat, we repackage a new version of the WAR with updated content
(only new HTML pages, no new application functionality), and then hot
redeploy the new WAR file.  The hope is that users will see the new
HTML content with minimal interruption of service.

I am able to hot redeploy the new WAR files by overwriting the
versions in the webapps directory.  In the server log I can verify
that Tomcat undeploys the old version and then deploys the new
version.  However, the HTML files that are being served are not
updated.  Tomcat serves the HTML pages from the previous WAR file.

If I stop the server, replace the WAR files, delete the work
directory, and restart the server, the HTML pages are refreshed.

Is there a way to clear all the old content from the cache during a
hot redeploy?  Or is there any other way to serve the new HTML content
without stopping the server?

I am using Apache Tomcat Version 6.0.18, jdk1.5.0_14, and Windows XP.

Thanks for your help.

Peter Desjardins


Peter, it doesnt make sense to me... if the html file is changed its 
changed.
Try edit an HTML file while TC is running, then refresh the browser... it 
will show you the new one... hopefully


I dont know this eclipse framework you using, so maybe I'm not getting it...

But I think... either you have some smart software attached that is doing 
the caching... ie some kind of no so smart filter...

Or its just the browser caching...

IE tends to forget easily, but Opera has a memory like an elephant ;)

If you change the html file and refresh the browser... I think you have to 
see the change...


To stop HTML pages caching in a browser one uses various meta tags in the 
html page... then the browser gets it every time.

Google for No Cache...

I have 6.0.18 running as well... it doesnt exhibit that xstic...
If its a special client and its using some kind of RSS feed maybe there is a 
setting there...


Change a HTML file in your web app... refresh the browser... if its not 
changing then there is an issue...
Or maybe its something silly like the webapp is up to mischief... if it does 
that... open that webapp and check that the file you think are changed are 
actually changed inside... I think its a silly thing somewhere ;)


There may be some new caching in TC that I'm not aware of... some setting, 
but my TC's are not doing that ;)


Have fun...

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---






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



Tomcat Experts - Need help with Cookie support in 6.0.18

2008-08-14 Thread KalChitown

We recently upgraded from 6.0.14 to 6.0.18 due to an XSS security alert we
received.

The following code was working in 6.0.14 version but not in 6.0.18. Can
anyone explain this or a work around.


String sessionId = Our session ID;
String cookieValue = sessionId + ; Path=/; HttpOnly ;
Cookie cookie = new Cookie(sessionId, cookieValue);
cookie.setVersion(1);   
response.addCookie(cookie); 


Thanks,
Kal
-- 
View this message in context: 
http://www.nabble.com/Tomcat-Experts---Need-help-with-Cookie-support-in-6.0.18-tp18980912p18980912.html
Sent from the Tomcat - User mailing list archive at Nabble.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: database application

2008-08-14 Thread David Smith
Ok... I'm assuming you are using tomcat 5.0.x given they way you 
configured your datasource.  If this isn't true, you might want to get a 
copy of the tomcat-docs webapp for your particular version of tomcat.  
The way JDBC connections are configured changed with tomcat 5.5.x and 6.0.x.


Typically the error you are getting is the result of a mismatch between 
different parts of the config where the JNDI name is mentioned.  I don't 
see that in what you posted though so it's an interesting problem. 

- What URL did you use to get the error? 
- Did you place the mysql driver in tomcat's common/lib folder (and ONLY 
in tomcat's common/lib folder)?  That's required

- Are there any related messages in the log files?
- Is this an original package tomcat from tomcat.apache.org or some 
third party package?  If a third party package, you might want to ask on 
a forum for your distribution.


--David

[EMAIL PROTECTED] wrote:

Hi,

Please help me.

I use this introduction:
http://localhost:8180/tomcat-docs/jndi-datasource-examples-howto.html

database: mysql
A simple java application works (see PS)
[EMAIL PROTECTED]:/mnt/hda3/tyuk/dtest/java/database# java DbTableShow2
+---+---+---+
| id| foo   | bar   |
+---+---+---+
| 1 | hello | 12345 |
| 2 | hellox| 123456|
+---+---+---+


However the tomcat application fails:
--
description The server encountered an internal error () that prevented it from 
fulfilling this request.
exception
javax.servlet.ServletException: Unable to get connection, DataSource invalid: 
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' 
for connect URL 'null'

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)

org.apache.jasper.runtime.PageContextImpl.access$11(PageContextImpl.java:784)

org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:766)
java.security.AccessController.doPrivileged(Native Method)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:764)
org.apache.jsp.jsp.test_jsp._jspService(test_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
---

Here my configuration file (/etc/tomcat5/server.xml:

!-- Server Configuration File for Tomcat 5 on Debian
 You can find a more complete example in /usr/share/doc/tomcat5/examples/
 --
!-- Note that component elements are nested corresponding to their
 parent-child relationships with each other --
!-- A Server is a singleton element that represents the entire JVM,
 which may contain one or more Service instances.  The Server
 listens for a shutdown command on the indicated port.
 Note:  A Server is not itself a Container, so you may not
 define subcomponents such as Valves or Loggers at this level.
 --

Server port=8005 shutdown=SHUTDOWN debug=0

  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/

  !-- Global JNDI resources --
  GlobalNamingResources

!-- Test entry for demonstration purposes --
Environment name=simpleValue type=java.lang.Integer value=30/

!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users --
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
   description=User database that can be updated and saved
/Resource
ResourceParams name=UserDatabase
  parameter
namefactory/name

Re: Tomcat Experts - Need help with Cookie support in 6.0.18

2008-08-14 Thread Tim Funk
With 6.0.18 : ; Path=/; HttpOnly  [literally] becomes part of the 
cookie value. [That it worked before was sheer luck.]


-Tim

KalChitown wrote:

We recently upgraded from 6.0.14 to 6.0.18 due to an XSS security alert we
received.

The following code was working in 6.0.14 version but not in 6.0.18. Can
anyone explain this or a work around.


String sessionId = Our session ID;
String cookieValue = sessionId + ; Path=/; HttpOnly ;
Cookie cookie = new Cookie(sessionId, cookieValue);
cookie.setVersion(1);   
response.addCookie(cookie); 




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



Tomcat JConsole

2008-08-14 Thread Tokajac

How can i monitor Tomcat with JConsole?


I found sg like: 
$ CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=test-idc.internet2.edu;
$ export CATALINA_OPTS;

and i put that in catalina.but, but so far i have no success with the
configuration.

If sy has experience with this set up, please write down the step by step
process. Thx!


Regards
-- 
View this message in context: 
http://www.nabble.com/Tomcat-JConsole-tp18982597p18982597.html
Sent from the Tomcat - User mailing list archive at Nabble.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: Tomcat Experts - Need help with Cookie support in 6.0.18

2008-08-14 Thread KalChitown

Tim,

Thanks for the reply. Can you explain what you mean by becomes part of the
value. I thought I had them part of the cookieValue already?

Can point out the change I need to make in my code snippet?


-Kal


Tim Funk wrote:
 
 With 6.0.18 : ; Path=/; HttpOnly  [literally] becomes part of the 
 cookie value. [That it worked before was sheer luck.]
 
 -Tim
 
 KalChitown wrote:
 We recently upgraded from 6.0.14 to 6.0.18 due to an XSS security alert
 we
 received.
 
 The following code was working in 6.0.14 version but not in 6.0.18. Can
 anyone explain this or a work around.
 
 
 String sessionId = Our session ID;
 String cookieValue = sessionId + ; Path=/; HttpOnly ;
 Cookie cookie = new Cookie(sessionId, cookieValue);
 cookie.setVersion(1);
 response.addCookie(cookie);  
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-Experts---Need-help-with-Cookie-support-in-6.0.18-tp18980912p18982955.html
Sent from the Tomcat - User mailing list archive at Nabble.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]



Tomcat admin webapp LoginModule configuration

2008-08-14 Thread Adam Gordon
I've got the Tomcat admin webapp up and running but am seeing an error 
(when I try and log in) in catalina.out informing me that there are no 
LoginModules configured for engine_name


We use JAAS for our web app so I'm familiar with the concept of the 
LoginModule and we have a JAAS Realm defined in our context.xml file for 
our web app.  I would assume that I need to add something similar to the 
admin.xml file for the admin web app, only I have no idea what to add 
and Google searching doesn't seem to yield anything useful.


Any ideas?

--adam

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

2008-08-14 Thread Alonzo Wilson
Please explain.  How does adding a new connector restart tomcat and
activate the new ssl cert?

 Mark Thomas [EMAIL PROTECTED] 8/12/2008 5:05 PM 
Alonzo Wilson wrote:
 4.1.30 and 6.0.16

4.1.30 you should be able to use the admin app to add a new
connector. With 
6.0.16 you might be able to use JMX. Restarting Tomcat will be far
easier.

Mark



-
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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Peter Desjardins
Thanks for the information.

I know it is not the browser caching.  I've tried both IE and Firefox,
clearing all caches and refreshing.

I did look more closely at what Tomcat is doing when it hot redeploys
my WAR file.  I'm using an unmodified copy of Tomcat to test this
issue.  So Tomcat deploys the new HTML files here:

C:\apache-tomcat-6.0.18\webapps\war-file-name\

But it leaves the old HTML files here:

C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\

And the browser is getting the old HTML files.

If I shut down the server, delete C:\apache-tomcat-6.0.18\work\, and
restart the server, the browser sees the new HTML files.

Is deleting the work directory standard practice for completely
refreshing web content?  I can't do it while Tomcat is accessing the
files.  Or is there a configuration option that will cause Tomcat to
delete and recreate the work directories when redeploying?

Again, thank you.

Peter Desjardins

-
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 Experts - Need help with Cookie support in 6.0.18

2008-08-14 Thread Tim Funk

A cookie is composed of many parts such as:
name, value, path, expiration, secure

Cookie.setValue is only meant to set the value of the cookie. Your code 
had the lucky side effect of setting the path and the HttpOnly flag.


If you wish to set a cookie with the  HttpOnly flasg set - you need to 
skip using the HttpCookie object and you'll need to add your own header 
to the response. For example:


response.addHeader(Set-Cookie, v1=bar; Path=/; HttpOnly );



-Tim

KalChitown wrote:

Tim,

Thanks for the reply. Can you explain what you mean by becomes part of the
value. I thought I had them part of the cookieValue already?

Can point out the change I need to make in my code snippet?


-Kal


Tim Funk wrote:
With 6.0.18 : ; Path=/; HttpOnly  [literally] becomes part of the 
cookie value. [That it worked before was sheer luck.]


-Tim

KalChitown wrote:

We recently upgraded from 6.0.14 to 6.0.18 due to an XSS security alert
we
received.

The following code was working in 6.0.14 version but not in 6.0.18. Can
anyone explain this or a work around.


String sessionId = Our session ID;
String cookieValue = sessionId + ; Path=/; HttpOnly ;
Cookie cookie = new Cookie(sessionId, cookieValue);
cookie.setVersion(1);   
response.addCookie(cookie); 



-
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: https j_security_check apparently Solved :P

2008-08-14 Thread Julio César Chaves Fernández
Hi,
 
I was testing somethings within the login page that is configured in the 
web.xml file... and there was a piece of code doing a redirection to assure 
that the page is loaded over https... first i proved with a simple login page 
over https with no more than the login form ...and it worked as it supossed to 
... then instead of insert the code to redirect the page over https I opened it 
with a url specifying https instead of http ... it worked ... so I changed back 
the form-login param in web.xml ... removed the redirection ... an tried again 
the same way i did with the simple login form ... and it worked ... now i have 
to ask ... did the redirection had something to do with this problem or do 
anyone know of a possible problem that can be raised when this is done?TIA,
 
Julio César



 Date: Wed, 13 Aug 2008 13:44:39 -0400 From: [EMAIL PROTECTED] To: 
 users@tomcat.apache.org Subject: Re: https  j_security_check  -BEGIN 
 PGP SIGNED MESSAGE- Hash: SHA1  Julio,  Julio César Chaves Fernández 
 wrote: | The 302 sends me back to the login page ... honestly i can't 
 totally | blame https ... i tested the applicaction with https via JSSE and 
 it | works (this was done in my pc)... but when i changed the application | 
 to another server https became the main issue where before it wasn't | ... 
 so i'm trying to find what the real problem is ... it's just that | the only 
 thing different between the working and the not working | application is the 
 use of https.  If you moved the application to another server, is it 
 possible that the login itself is actually failing, and Tomcat is reacting 
 correctly?  One of my complaints about TC's authenticator is that it tends 
 to swallow errors. You might try to write a little test on the new server 
 to see if you can correctly access your user database.  - -chris 
 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: 
 Using GnuPG with Mozilla - http://enigmail.mozdev.org  
 iEYEARECAAYFAkijHYcACgkQ9CaO5/Lv0PCYpwCff97yGzzjteCe6NPrVmVV0XmP 
 8LIAoKqGTkkbfvwIorRXRlMUa5y6KkWG =PKpu -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] 
_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Re: ssl certificate

2008-08-14 Thread Mark Thomas
Alonzo Wilson wrote:
 Please explain.  How does adding a new connector restart tomcat and
 activate the new ssl cert?

It doesn't.

In 4.1.30 you can use the admin app to add a connector and start it.

In 6.0.16 the admin app doesn't exist so JMX is your only option but this
could be tricky so restarting Tomcat will be a lot simpler.

Mark

 
 Mark Thomas [EMAIL PROTECTED] 8/12/2008 5:05 PM 
 Alonzo Wilson wrote:
 4.1.30 and 6.0.16
 
 4.1.30 you should be able to use the admin app to add a new
 connector. With 
 6.0.16 you might be able to use JMX. Restarting Tomcat will be far
 easier.
 
 Mark
 
 
 
 -
 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 JConsole

2008-08-14 Thread Johnny Kewl


- Original Message - 
From: Tokajac [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Thursday, August 14, 2008 4:24 PM
Subject: Tomcat JConsole




How can i monitor Tomcat with JConsole?


I found sg like:
$ CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=test-idc.internet2.edu;
$ export CATALINA_OPTS;

and i put that in catalina.but, but so far i have no success with the
configuration.

If sy has experience with this set up, please write down the step by step
process. Thx!


Regards
--
View this message in context: 
http://www.nabble.com/Tomcat-JConsole-tp18982597p18982597.html

Sent from the Tomcat - User mailing list archive at Nabble.com.


I use the windows TC service JAVA tab console... but what you doing should 
be OK


I add...

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

Then go to the Java JRE bin... start JConsole... give it the PORT ...

and TC starts talking to me ;)

v easy ;)

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--- 



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



servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread ge
Hi,

Servlet works, jsp not. Why?

Result of servlet:

Datensätze
jdbc:mysql://localhost:3306/javatestcom.mysql.jdbc.Driver
javauserjavadude
NameVorname
1   hello
2   hellox

Result of jsp:
-
Results
${row.foo}  ${row.bar}

Servlet source code:
-
package de.akdabas.jli.j2ee.servlets;

import java.io.PrintWriter;
import java.io.IOException;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;

/** Erzeugte dynamischen Inhalt aus Datenbank-Daten */
public class DatenbankServlet extends HttpServlet {

   /** Globale Variable: Die geöffnete Datenbank-Verbindung */
   private Connection connection;
   private String driver;
   private String dbURL;
   private String dbUser; 
   private String dbPass; 
   /** Initialisieren der Datenbank-Verbindung */
   public void init(javax.servlet.ServletConfig config)
  throws ServletException {

  // Init der Superklasse aufrufen !
  super.init(config);

  // Parameter aus web.xml auslesen
 // String
  driver = config.getInitParameter(jdbcClass);
  dbURL =  config.getInitParameter(dbURL);
  dbUser = config.getInitParameter(username);
  dbPass = config.getInitParameter(password);

  // Aufbau der Datenbank-Verbindung
  try {
 Class.forName(driver);
 connection =
DriverManager.getConnection(dbURL, dbUser, dbPass);
  } catch(Exception exc) {
 throw new ServletException(SQL-Exception in init(), exc);
  }

   }


   /** Bearbeiten von POST-Requests analog zu GET */
   public void doPost(HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  // Weiterleiten des Request an die Methode doGet()
  doGet(request, response);
   }

   /** Service-Methode zur Verarbeitung von GET-Requests */
   public void doGet(HttpServletRequest request,
 HttpServletResponse response)
 throws IOException, ServletException {

  // Binden der (in JSPs vordefinierten) Variable out
  PrintWriter out = response.getWriter();

  // Erzeugen von HTML-Code ...
  out.println(htmlbodycenterDatensätze/center);
  out.println(tabletrtd+dbURL+/tdtd+driver+/td/tr);
  out.println(tabletrtd+dbUser+/tdtd+dbPass+/td/tr);
  out.println(tabletrtdName/tdtdVorname/td/tr);
  // Aufbau der Datenbank-Verbindung

  try {
 Class.forName(driver);
 connection =
DriverManager.getConnection(dbURL, dbUser, dbPass);
  } catch(Exception exc) {
 out.println(centerDatensätze2/center);
 throw new ServletException(SQL-Exception in init(), exc);
  }

  // ... und Einbinden von dynamischem Inhalt
  try {
 ResultSet rs = null;
 try {
Statement stmt = connection.createStatement();
rs = stmt.executeQuery
(Select * from testdata);

while(rs.next() == true) {
   out.println(trtd + rs.getString(1) + /td);
   out.println(td + rs.getString(2) + /td/tr);
}

 } finally {
rs.close();
 }

  } catch(SQLException exc) {
 out.println(htmlbodycenterDatensätze3/center);
 throw new ServletException(SQL-Exception, exc);
  }

  out.println(/table/body/html);
   }

   /** Wird verwendet um belegte Ressourcen freizugeben */
   public void destroy() {
  try {
 // Freigeben von Datenbank-Ressourcen
 connection.close();
  } catch(SQLException exc) {
 log(SQL-Exception in destroy(), exc);
  }
   }
}


jsp code:
-
%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

sql:query var=rs 
dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
select id, foo, bar from testdata
/sql:query

html
  head
titleDB Test/title
  /head
  body

  h2Results/h2
  

table
c:forEach var=row items=${rs.rows}
tr
   td c:out value=${row.foo}//td
   td c:out value=${row.bar}//td
/tr
/c:forEach
/table
  /body
/html
---
jsp's servlet code:
---
package org.apache.jsp.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class test_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  private org.apache.jasper.runtime.TagHandlerPool 
_jspx_tagPool_sql_query_var_dataSource;
  private org.apache.jasper.runtime.TagHandlerPool 

Re: Tomcat JConsole

2008-08-14 Thread Sam Wun
Hi,

I m using Eclipse 3.4 (in Vista) and Tomcat 5.5 (in linux) as J2EE
development environment.
I want to build a online order form to interact with backend database in linux.
I know I can use dreamweaver to create web page (html template), but I
don't know how to use it and dont' have the time to learn it.
Is there any standard jsp package or library I can use from Eclipse or
Tomcat to build an online order form? How about Struts or Springs
library?

Your suggestion is highly appreciated.

Thanks

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

2008-08-14 Thread Tokajac

I appreciate Your answer a lot, Johnny!

Can U provide me more details about configuring? 
Which file should be edited? 
Where is the right place to put  
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false 
?
Which .exe or .java file needs to be started?


Regards
-- 
View this message in context: 
http://www.nabble.com/Tomcat-JConsole-tp18982597p18985026.html
Sent from the Tomcat - User mailing list archive at Nabble.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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Johnny Kewl


- Original Message - 
From: Peter Desjardins [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 14, 2008 5:00 PM
Subject: Re: Hot redeploying a WAR - HTML is not refreshed



Thanks for the information.

I know it is not the browser caching.  I've tried both IE and Firefox,
clearing all caches and refreshing.

I did look more closely at what Tomcat is doing when it hot redeploys
my WAR file.  I'm using an unmodified copy of Tomcat to test this
issue.  So Tomcat deploys the new HTML files here:

C:\apache-tomcat-6.0.18\webapps\war-file-name\

But it leaves the old HTML files here:

C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\

And the browser is getting the old HTML files.

If I shut down the server, delete C:\apache-tomcat-6.0.18\work\, and
restart the server, the browser sees the new HTML files.

Is deleting the work directory standard practice for completely
refreshing web content?  I can't do it while Tomcat is accessing the
files.  Or is there a configuration option that will cause Tomcat to
delete and recreate the work directories when redeploying?

Again, thank you.

Peter Desjardins


Peter... I dont know... I cant get it to do anything like that...

Try with something that isnt your application, like the examples that come 
with TC...


For example view a JSP or an HTML example...
Then open the unpacked webapp cal1.jsp example... change the title, and 
refresh the browser..
Note I have not even told TC to reinstall the webapp and it changes 
it knows the html or web app has changed...


I've never had to touch a work file ever... imagine if we did have to delete 
it on a deploy, ouch!


No there is something else going on... I'm wondering if its not worth trying 
a diff version of TC just to elim that as well, maybe we got a diff build...


You see... if say a servlet is busy... and you drop a new webapp in what 
TC will do is make sure all the busy stuff finishes, and then it will only 
change (redeploy the web app)


The other thing is that I cant actually recall ever seeing an HTML file in 
the work folder...

I see stuff like...
basic_002darithmetic_jsp.class
basic_002darithmetic_jsp.java

which is what it is used for... ie to hold the compiled JSP's...
if you using HTML to describe JSP's then we already have crossed lines...

I dont know if you ever noticed, but for example if you cchange tomcats 
default root index.jsp... it aslo doesnt change, but thats because its 
precompiled into the app...


Done guessing... I cant make it do it on my apps... best of luck ;(

Ah just had another brain wave... it happen, albeit seldomly ;)
Next time it happens... check the
conf\Catalina\localhost   THE WEBAPP CONTEXT FILE...

I bet its still pointing at your dev environment delete that, then drop 
the webapp in...


You see TC almost may be saying... the idiot (just kidding) has dropped a 
webapp into me... but the one I'm actually using in the IDE, is still cool, 
so I'll just ignore the other one


When you done developing from an IDE... esp Netbeans... you must undeploy 
it... else it still uses the webapp in the build folder of NB...


Ok now I really am done guessing...

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---







-
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: https j_security_check apparently Solved :P

2008-08-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio César Chaves Fernández wrote:
 I was testing somethings within the login page that is configured in
 the web.xml file... and there was a piece of code doing a redirection
 to assure that the page is loaded over https... first i proved with a
 simple login page over https with no more than the login form ...and
 it worked as it supossed to ... then instead of insert the code to
 redirect the page over https I opened it with a url specifying https
 instead of http ... it worked ... so I changed back the form-login
 param in web.xml ... removed the redirection ... an tried again the
 same way i did with the simple login form ... and it worked ... now i
 have to ask ... did the redirection had something to do with this
 problem or do anyone know of a possible problem that can be raised
 when this is done?TIA,

Honestly, I'm having a hard time understanding what you are doing. What
is the additional redirection for? Why not simply use
transport-guarantee in web.xml and let the container handle any HTTPS
requirements?

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

iEYEARECAAYFAkikXXIACgkQ9CaO5/Lv0PC1wgCgtUNuWDBsTqIPIjAfH64OPgv+
wf4An1rHKW4HmO15pAwckdz0msxOmLd2
=LSxR
-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]



Form design or framework from Eclipse or Tomcat.

2008-08-14 Thread Sam Wun
Hi,

I m using Eclipse 3.4 (in Vista) and Tomcat 5.5 (in linux) as J2EE
development environment.
I want to build a online order form to interact with backend database in linux.
I know I can use dreamweaver to create web page (html template), but I
don't know how to use it and dont' have the time to learn it.
Is there any standard jsp package or library I can use from Eclipse or
Tomcat to build an online order form? How about Struts or Springs
library?

Your suggestion is highly appreciated.

Thanks

-
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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Elanora,

ge wrote:
 sql:query var=rs
 dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
  select id, foo, bar from testdata /sql:query

I think you want to use the name of the dataSourced, here, not the URL.
You want something like jdbc/MyDataSource -- it should match whatever
you have in your server.xml (or context.xml) to configure the
datasource's name.

- -chris

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

iEYEARECAAYFAkikYDUACgkQ9CaO5/Lv0PBWJwCePl5KLbCAY0djo3Rvf9n8T1Hz
iy4AoKyf2ImJY0EIBmG0oyuaXdZHuC6t
=e1Ms
-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: Tomcat JConsole

2008-08-14 Thread Caldarale, Charles R
 From: Tokajac [mailto:[EMAIL PROTECTED]
 Subject: Tomcat JConsole

 $ CATALINA_OPTS=-Dcom.sun.management.jmxremote
 -Dcom.sun.management.jmxremote.port=8999
 -Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false
 -Djava.rmi.server.hostname=test-idc.internet2.edu;
 $ export CATALINA_OPTS;

 and i put that in catalina.but

What platform are you on?  The first part of your settings is for Linux/UNIX, 
but catalina.bat is for Windows.  How are you starting Tomcat?

If Tomcat and JConsole are running on the same box, all you need is the 
-Dcom.sun.management.jmxremote; the other parts are for remote monitoring only. 
 You do not need the java.rmi setting at all.

To monitor a Tomcat on Linux, I do the following before running startup.sh:

export CATALINA_OPTS=-Dcom.sun.management.jmxremote.port=8999 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false

(All of the above is on one line, of course.)

Once Tomcat is running, I start JConsole on my Windows box, and simply enter 
host:8999 in the Remote Process slot of the New Connection dialog box.

 - 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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread David Smith
I'm going to guess the servlet spec version in your web.xml isn't up to 
a level that supported the JSTL expression language.  What's your 
web.xml look like?


--David

ge wrote:

Hi,

Servlet works, jsp not. Why?

Result of servlet:

Datensätze
jdbc:mysql://localhost:3306/javatestcom.mysql.jdbc.Driver
javauserjavadude
NameVorname
1   hello
2   hellox

Result of jsp:
-
Results
${row.foo}  ${row.bar}

Servlet source code:
-
package de.akdabas.jli.j2ee.servlets;

import java.io.PrintWriter;
import java.io.IOException;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;

/** Erzeugte dynamischen Inhalt aus Datenbank-Daten */
public class DatenbankServlet extends HttpServlet {

   /** Globale Variable: Die geöffnete Datenbank-Verbindung */
   private Connection connection;
   private String driver;
   private String dbURL;
   private String dbUser; 
   private String dbPass; 
   /** Initialisieren der Datenbank-Verbindung */

   public void init(javax.servlet.ServletConfig config)
  throws ServletException {

  // Init der Superklasse aufrufen !
  super.init(config);

  // Parameter aus web.xml auslesen
 // String
  driver = config.getInitParameter(jdbcClass);
  dbURL =  config.getInitParameter(dbURL);
  dbUser = config.getInitParameter(username);
  dbPass = config.getInitParameter(password);

  // Aufbau der Datenbank-Verbindung
  try {
 Class.forName(driver);
 connection =
DriverManager.getConnection(dbURL, dbUser, dbPass);
  } catch(Exception exc) {
 throw new ServletException(SQL-Exception in init(), exc);
  }

   }


   /** Bearbeiten von POST-Requests analog zu GET */
   public void doPost(HttpServletRequest request,
  HttpServletResponse response)
  throws IOException, ServletException {

  // Weiterleiten des Request an die Methode doGet()
  doGet(request, response);
   }

   /** Service-Methode zur Verarbeitung von GET-Requests */
   public void doGet(HttpServletRequest request,
 HttpServletResponse response)
 throws IOException, ServletException {

  // Binden der (in JSPs vordefinierten) Variable out
  PrintWriter out = response.getWriter();

  // Erzeugen von HTML-Code ...
  out.println(htmlbodycenterDatensätze/center);
  out.println(tabletrtd+dbURL+/tdtd+driver+/td/tr);
  out.println(tabletrtd+dbUser+/tdtd+dbPass+/td/tr);
  out.println(tabletrtdName/tdtdVorname/td/tr);
  // Aufbau der Datenbank-Verbindung

  try {
 Class.forName(driver);
 connection =
DriverManager.getConnection(dbURL, dbUser, dbPass);
  } catch(Exception exc) {
 out.println(centerDatensätze2/center);
 throw new ServletException(SQL-Exception in init(), exc);
  }

  // ... und Einbinden von dynamischem Inhalt
  try {
 ResultSet rs = null;
 try {
Statement stmt = connection.createStatement();
rs = stmt.executeQuery
(Select * from testdata);

while(rs.next() == true) {
   out.println(trtd + rs.getString(1) + /td);
   out.println(td + rs.getString(2) + /td/tr);
}

 } finally {
rs.close();
 }

  } catch(SQLException exc) {
 out.println(htmlbodycenterDatensätze3/center);
 throw new ServletException(SQL-Exception, exc);
  }

  out.println(/table/body/html);
   }

   /** Wird verwendet um belegte Ressourcen freizugeben */
   public void destroy() {
  try {
 // Freigeben von Datenbank-Ressourcen
 connection.close();
  } catch(SQLException exc) {
 log(SQL-Exception in destroy(), exc);
  }
   }
}


jsp code:
-
%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

sql:query var=rs 
dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
select id, foo, bar from testdata
/sql:query

html
  head
titleDB Test/title
  /head
  body

  h2Results/h2
  


table
c:forEach var=row items=${rs.rows}
tr
   td c:out value=${row.foo}//td
   td c:out value=${row.bar}//td
/tr
/c:forEach
/table
  /body
/html
---
jsp's servlet code:
---
package org.apache.jsp.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class test_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {

  private static 

RE: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Caldarale, Charles R
 From: Peter Desjardins [mailto:[EMAIL PROTECTED]
 Subject: Re: Hot redeploying a WAR - HTML is not refreshed

 I did look more closely at what Tomcat is doing when it hot
 redeploys my WAR file.

Exactly how are you accomplishing this hot redeployment?  Does Tomcat really 
shut down the application and reload it?  Since you're on a Windows box, you 
may want to experiment with the antiResourceLocking attribute of your webapp's 
Context element - but watch out for the caveats mentioned in the doc:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Standard%20Implementation

 - 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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Peter Desjardins
Those are excellent suggestions.  Thanks.

 The other thing is that I cant actually recall ever seeing an HTML file in
 the work folder...
 I see stuff like...
 basic_002darithmetic_jsp.class
 basic_002darithmetic_jsp.java

 which is what it is used for... ie to hold the compiled JSP's...
 if you using HTML to describe JSP's then we already have crossed lines...

Maybe this is causing the problem: the HTML files are wrapped up in
JAR files.  This is functionality of the Eclipse help system.  You can
wrap up all of your documentation content (HTML files, image files,
tables of contents, ...) in a JAR file.  This becomes a documentation
plugin that the Eclipse application knows how to unpack and serve.

So my HTML content is actually in here:

C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar
C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar

Does the fact that my content is in a JAR file make a difference?  Is
there a different way that Tomcat handles redeploying JAR files?

Also, there is no development environment on my computer.  I am taking
the WAR files from a separate build server and just trying to deploy
and redeploy locally.

Thank you.

Peter Desjardins

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

2008-08-14 Thread Tokajac

Finally i started with monitoring 


I was trying to start a remote monitoring with IP address:port
Instead of that now i'm using the local monitoring of
org.apache.catalina.startup.Bootstrap start


Details which regard the discussion: 

Windows XP; apache-tomcat-5.5.26; jdk1.6.0_07; jre1.6.0_07;

There is default configuration for Tomcat server (i unzipped it only) + copy
the necessary .jar files to 
{TomcatHome}\common\lib\folder

I started Tomcat via {TomcatHome}\bin\startup.bat, i go to Program
Files\Java\jdk1.6.0_07\bin\ and 
type: jconsole 

and now chose Local process!


Regards











What platform are you on?  The first part of your settings is for
Linux/UNIX, but catalina.bat is for Windows.  How are you starting Tomcat?

If Tomcat and JConsole are running on the same box, all you need is the
-Dcom.sun.management.jmxremote; the other parts are for remote monitoring
only.  You do not need the java.rmi setting at all.

To monitor a Tomcat on Linux, I do the following before running startup.sh:

export CATALINA_OPTS=-Dcom.sun.management.jmxremote.port=8999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

(All of the above is on one line, of course.)

Once Tomcat is running, I start JConsole on my Windows box, and simply enter
host:8999 in the Remote Process slot of the New Connection dialog box.

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




-- 
View this message in context: 
http://www.nabble.com/Tomcat-JConsole-tp18982597p18985903.html
Sent from the Tomcat - User mailing list archive at Nabble.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]



tomcat default page

2008-08-14 Thread Zico
Hi,

I am working on the dspace of BRAC University. Here is our site:
http://dspace.bracu.ac.bd
Here, you can see that, the *main page of dspace* takes a longer time to
load; in the mean time, the main page of tomcat halts for some seconds.
Though i put *CONTENT=0 *in the html tagging,but tomcat pages shows for some
seconds. This is not so much comfortable! I want to make my dspace very
quick here that, the tomcat page will not show it`s face to the audiance.

How can i do that?

-- 
Best,
Z


Re: tomcat default page

2008-08-14 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Zico,

Zico wrote:
 Here, you can see that, the *main page of dspace* takes a longer time to
 load; in the mean time, the main page of tomcat halts for some seconds.
 Though i put *CONTENT=0 *in the html tagging,but tomcat pages shows for some
 seconds.

The client (browser) cannot display content that has not yet been
loaded. If you want the screen to clear ASAP, you'll have to do
something stupid like using javascript to delete the current document
before you do a refresh.

 This is not so much comfortable! I want to make my dspace very
 quick here that, the tomcat page will not show it`s face to the audience.

Why not just make dspace the ROOT application?

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

iEYEARECAAYFAkikbLIACgkQ9CaO5/Lv0PDd7ACfdepxs5pHA5JwOs/TP2mmEO8b
CUcAn07CFubc8fGcTmuy+/ygi5sizzk8
=Op1S
-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]



where to place context configuration

2008-08-14 Thread Robert Dietrick
Hi,

I just noticed that I had a Context definition in both
$CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
$CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
these context definitions, I define a JNDI database connection pool
with the same name and identical parameters.  This was working fine,
but it is confusing, redundant, and runs contrary to the
recommendations in the official documentation.

However, if i remove either one of these files, I get the dreaded
Cannot create JDBC driver of class '' for connect URL 'null' error.
Can anyone offer any advice?  None of the recommended solutions seem
to work.

Thanks.

-rob

-
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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread eleonora46
 I'm going to guess the servlet spec version in your web.xml isn't up to 
 a level that supported the JSTL expression language.  What's your 
 web.xml look like?

web.xml looks:
--
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app PUBLIC
   -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;

web-app
   display-nameEine Web - Applikation/display-name

   !-- Definition eines symbolischen Servlet-Namens --
   servlet
  servlet-nameHelloWorldServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.HelloWorld
  /servlet-class
   /servlet

   !-- Beispiel-Konfiguration des Datenbank-Servlets --
   servlet
  servlet-nameDatabaseServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.DatenbankServlet
  /servlet-class
  init-param
 param-namejdbcClass/param-name
 param-valuecom.mysql.jdbc.Driver/param-value
  /init-param
  init-param
 param-namedbURL/param-name
 param-valuejdbc:mysql://localhost:3306/javatest/param-value
  /init-param
  init-param
 param-nameusername/param-name
 param-valuejavauser/param-value
  /init-param
  init-param
 param-namepassword/param-name
 param-valuejavadude/param-value
  /init-param
   /servlet

   !-- Konfiguration des ImageServlets --
   servlet
  servlet-nameImageServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.ImageServlet
  /servlet-class
   /servlet

   !-- Binden des symbolischen Namens an eine URL --
   servlet-mapping
  servlet-nameHelloWorldServlet/servlet-name
  url-pattern/servlets/HelloWorld/url-pattern
   /servlet-mapping

   !-- Binden des Datenbank-Servlets an eine URL --
   servlet-mapping
  servlet-nameDatabaseServlet/servlet-name
  url-pattern/servlets/DatenbankServlet/url-pattern
   /servlet-mapping

   !-- Binden des Image-Servlets an eine URL --
   servlet-mapping
  servlet-nameImageServlet/servlet-name
  url-pattern/servlets/DynamicImage/url-pattern
   /servlet-mapping

/web-app
--

 
 --David
 
 ge wrote:
  Hi,
 
  Servlet works, jsp not. Why?
 
  Result of servlet:
  
  Datensätze
  jdbc:mysql://localhost:3306/javatestcom.mysql.jdbc.Driver
  javauserjavadude
  NameVorname
  1   hello
  2   hellox
 
  Result of jsp:
  -
  Results
  ${row.foo}  ${row.bar}
 
  Servlet source code:
  -
  package de.akdabas.jli.j2ee.servlets;
 
  import java.io.PrintWriter;
  import java.io.IOException;
  import java.sql.Statement;
  import java.sql.ResultSet;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.SQLException;
 
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.ServletException;
 
  /** Erzeugte dynamischen Inhalt aus Datenbank-Daten */
  public class DatenbankServlet extends HttpServlet {
 
 /** Globale Variable: Die geöffnete Datenbank-Verbindung */
 private Connection connection;
 private String driver;
 private String dbURL;
 private String dbUser; 
 private String dbPass; 
 /** Initialisieren der Datenbank-Verbindung */
 public void init(javax.servlet.ServletConfig config)
throws ServletException {
 
// Init der Superklasse aufrufen !
super.init(config);
 
// Parameter aus web.xml auslesen
   // String
driver = config.getInitParameter(jdbcClass);
dbURL =  config.getInitParameter(dbURL);
dbUser = config.getInitParameter(username);
dbPass = config.getInitParameter(password);
 
// Aufbau der Datenbank-Verbindung
try {
   Class.forName(driver);
   connection =
  DriverManager.getConnection(dbURL, dbUser, dbPass);
} catch(Exception exc) {
   throw new ServletException(SQL-Exception in init(), exc);
}
 
 }
 
 
 /** Bearbeiten von POST-Requests analog zu GET */
 public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
 
// Weiterleiten des Request an die Methode doGet()
doGet(request, response);
 }
 
 /** Service-Methode zur Verarbeitung von GET-Requests */
 public void doGet(HttpServletRequest request,
   HttpServletResponse response)
   throws IOException, ServletException {
 
// Binden der (in JSPs vordefinierten) Variable out
PrintWriter out = response.getWriter();
 
// Erzeugen von HTML-Code ...
out.println(htmlbodycenterDatensätze/center);
   
 out.println(tabletrtd+dbURL+/tdtd+driver+/td/tr);
   
 

Re: where to place context configuration

2008-08-14 Thread Mark Thomas
Robert Dietrick wrote:
 Hi,
 
 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.
 
 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

Just leave it as is?

The one in conf will take priority.

Mark


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



Fwd: Re: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread eleonora46
Please see in text my answer.

ge wrote:
 sql:query var=rs
 dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
  select id, foo, bar from testdata /sql:query

I think you want to use the name of the dataSourced, here, not the URL.
You want something like jdbc/MyDataSource -- it should match whatever
you have in your server.xml (or context.xml) to configure the
datasource's name.

- -chris

When I use 
sql:query var=rs dataSource=jdbc/TestDB
I get:
javax.servlet.ServletException: Unable to get connection, DataSource invalid: 
java.sql.SQLException: No suitable driver found for jdbc/TestDB

my  server.xml loks:
---
!-- Server Configuration File for Tomcat 5 on Debian
 You can find a more complete example in /usr/share/doc/tomcat5/examples/
 --

!-- Note that component elements are nested corresponding to their
 parent-child relationships with each other --

!-- A Server is a singleton element that represents the entire JVM,
 which may contain one or more Service instances.  The Server
 listens for a shutdown command on the indicated port.

 Note:  A Server is not itself a Container, so you may not
 define subcomponents such as Valves or Loggers at this level.
 --

Server port=8005 shutdown=SHUTDOWN debug=0

  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
debug=0/
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/

  !-- Global JNDI resources --
  GlobalNamingResources

!-- Test entry for demonstration purposes --
Environment name=simpleValue type=java.lang.Integer value=30/

!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users --
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
   description=User database that can be updated and saved
/Resource
ResourceParams name=UserDatabase
  parameter
namefactory/name
valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
namepathname/name
valueconf/tomcat-users.xml/value
  /parameter
/ResourceParams

  /GlobalNamingResources

  !-- A Service is a collection of one or more Connectors that share
   a single Container (and therefore the web applications visible
   within that Container).  Normally, that Container is an Engine,
   but this is not required.

   Note:  A Service is not itself a Container, so you may not
   define subcomponents such as Valves or Loggers at this level.
   --

  !-- Define the Tomcat Stand-Alone Service --
  Service name=Tomcat-Standalone

!-- A Connector represents an endpoint by which requests are received
 and responses are returned.  Each Connector passes requests on to the
 associated Container (normally an Engine) for processing.
--

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8180 --
Connector className=org.apache.coyote.tomcat5.CoyoteConnector
   port=8180 minProcessors=5 maxProcessors=75
   enableLookups=true acceptCount=10 debug=0
   connectionTimeout=2 useURIValidationHack=false /

!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
Connector className=org.apache.coyote.tomcat5.CoyoteConnector
   port=8009 minProcessors=5 maxProcessors=75
   enableLookups=true acceptCount=10 debug=0
   connectionTimeout=2 useURIValidationHack=false
   protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/

!-- An Engine represents the entry point (within Catalina) that processes
 every request.  The Engine implementation for Tomcat stand alone
 analyzes the HTTP headers included with the request, and passes them
 on to the appropriate Host (virtual host). --

!-- Define the top level container in our container hierarchy 
 The name must be Catalina for correct function of the admin webapp --
Engine name=Catalina defaultHost=localhost debug=0

  !-- Global logger unless overridden at lower levels --
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=catalina_ suffix=.log timestamp=true/

  !-- Because this Realm is here, an instance will be shared globally --
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 debug=0 resourceName=UserDatabase/

  !-- Define the default virtual host --
  Host name=localhost debug=0 appBase=webapps 
unpackWARs=true autoDeploy=true

!-- Logger shared by all Contexts related to this virtual host. --
Logger className=org.apache.catalina.logger.FileLogger
directory=logs prefix=localhost_ suffix=.log
timestamp=true/   

Context path=/jli/Q2_JSPs
 docBase=/home/en/public_html/jsp/Beispiele
 

Re: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Johnny Kewl


- Original Message - 
From: Peter Desjardins [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, August 14, 2008 7:00 PM
Subject: Re: Hot redeploying a WAR - HTML is not refreshed



Those are excellent suggestions.  Thanks.

The other thing is that I cant actually recall ever seeing an HTML file 
in

the work folder...
I see stuff like...
basic_002darithmetic_jsp.class
basic_002darithmetic_jsp.java

which is what it is used for... ie to hold the compiled JSP's...
if you using HTML to describe JSP's then we already have crossed lines...


Maybe this is causing the problem: the HTML files are wrapped up in
JAR files.  This is functionality of the Eclipse help system.  You can
wrap up all of your documentation content (HTML files, image files,
tables of contents, ...) in a JAR file.  This becomes a documentation
plugin that the Eclipse application knows how to unpack and serve.

So my HTML content is actually in here:

C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar
C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar

Does the fact that my content is in a JAR file make a difference?  Is
there a different way that Tomcat handles redeploying JAR files?

Also, there is no development environment on my computer.  I am taking
the WAR files from a separate build server and just trying to deploy
and redeploy locally.

Thank you.

Peter Desjardins


My best guess is that the framework is not letting go... ie that plugin is 
running in a thread or something... and TC cant dump the thing out of its 
classloaders.

No it shouldnt make any diff... the webapp should replace everything...
But it is possible that a help system is doing some form of caching, running 
singletons and never ending threads...
You have to (I guess) find someway of telling that system to die... its 
staying alive somehow..


---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---


-
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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Martin Gainty

quiesce the container *look for shutdownbat/sh*
clean off everything under %TOMCAT_HOME%/work
clean off everything under %TOMCAT_HOME%/logs
clean off everything under %TEMP%

start tc

Martin -
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 From: [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Subject: Re: Hot redeploying a WAR - HTML is not refreshed
 Date: Thu, 14 Aug 2008 20:01:52 +0200
 
 
 - Original Message - 
 From: Peter Desjardins [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, August 14, 2008 7:00 PM
 Subject: Re: Hot redeploying a WAR - HTML is not refreshed
 
 
  Those are excellent suggestions.  Thanks.
 
  The other thing is that I cant actually recall ever seeing an HTML file 
  in
  the work folder...
  I see stuff like...
  basic_002darithmetic_jsp.class
  basic_002darithmetic_jsp.java
 
  which is what it is used for... ie to hold the compiled JSP's...
  if you using HTML to describe JSP's then we already have crossed lines...
 
  Maybe this is causing the problem: the HTML files are wrapped up in
  JAR files.  This is functionality of the Eclipse help system.  You can
  wrap up all of your documentation content (HTML files, image files,
  tables of contents, ...) in a JAR file.  This becomes a documentation
  plugin that the Eclipse application knows how to unpack and serve.
 
  So my HTML content is actually in here:
 
  C:\apache-tomcat-6.0.18\webapps\war-file-name\WEB-INF\eclipse\plugins\com.my.doc.plugin.name.jar
  C:\apache-tomcat-6.0.18\work\Catalina\localhost\war-file-name\eclipse\plugins\com.my.doc.plugin.name.jar
 
  Does the fact that my content is in a JAR file make a difference?  Is
  there a different way that Tomcat handles redeploying JAR files?
 
  Also, there is no development environment on my computer.  I am taking
  the WAR files from a separate build server and just trying to deploy
  and redeploy locally.
 
  Thank you.
 
  Peter Desjardins
 
 My best guess is that the framework is not letting go... ie that plugin is 
 running in a thread or something... and TC cant dump the thing out of its 
 classloaders.
 No it shouldnt make any diff... the webapp should replace everything...
 But it is possible that a help system is doing some form of caching, running 
 singletons and never ending threads...
 You have to (I guess) find someway of telling that system to die... its 
 staying alive somehow..
 
 ---
 HARBOR : http://www.kewlstuff.co.za/index.htm
 The most powerful application server on earth.
 The only real POJO Application Server.
 See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
 ---
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Get more from your digital life.  Find out how.
http://www.windowslive.com/default.html?ocid=TXT_TAGLM_WL_Home2_082008

Re: where to place context configuration

2008-08-14 Thread Robert Dietrick
I would very much prefer to use only the one in
mywebapp/META-INF/contex.xml, as this is much less invasive (does not
require changing/adding anything to tomcat's global config
directories).  But this doesn't seem to work.

I can leave it as is (and am becoming resigned to the fact that this
is my only option), but this is sort of a maintenance nightmare since
the two files need to be kept in sync.  Plus, it just seems idiotic to
need to declare the context and its resources in two locations.

Does either of these files need a 'docBase' or 'path' parameter?  It
doesn't seem to make a difference either way.

-rob

On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
 Robert Dietrick wrote:
 Hi,

 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.

 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

 Just leave it as is?

 The one in conf will take priority.

 Mark


 -
 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: where to place context configuration

2008-08-14 Thread Angus Mezick
Am I the only one that is REALLY disturbed about that idea of REQUIRING
two identical files to run an app?  One in the war file and one in the
conf directory?  If the only in the conf directory takes priority, why
the one in the war file needed at all?  I am just hoping this isn't in
tomcat 6.0..  The idea of relying on the server to use the correct
version of possibly different files in a production server makes me VERY
nervous.

--Angus Mezick

-Original Message-
From: Robert Dietrick [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2008 2:22 PM
To: Tomcat Users List
Subject: Re: where to place context configuration

I would very much prefer to use only the one in
mywebapp/META-INF/contex.xml, as this is much less invasive (does not
require changing/adding anything to tomcat's global config
directories).  But this doesn't seem to work.

I can leave it as is (and am becoming resigned to the fact that this
is my only option), but this is sort of a maintenance nightmare since
the two files need to be kept in sync.  Plus, it just seems idiotic to
need to declare the context and its resources in two locations.

Does either of these files need a 'docBase' or 'path' parameter?  It
doesn't seem to make a difference either way.

-rob

On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
 Robert Dietrick wrote:
 Hi,

 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.

 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

 Just leave it as is?

 The one in conf will take priority.

 Mark


 -
 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: where to place context configuration

2008-08-14 Thread Robert Dietrick
You are definitely not alone, Angus.  For the record, I'm using Tomcat 5.5.

-rob

On Thu, Aug 14, 2008 at 11:30 AM, Angus Mezick
[EMAIL PROTECTED] wrote:
 Am I the only one that is REALLY disturbed about that idea of REQUIRING
 two identical files to run an app?  One in the war file and one in the
 conf directory?  If the only in the conf directory takes priority, why
 the one in the war file needed at all?  I am just hoping this isn't in
 tomcat 6.0..  The idea of relying on the server to use the correct
 version of possibly different files in a production server makes me VERY
 nervous.

 --Angus Mezick

 -Original Message-
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2008 2:22 PM
 To: Tomcat Users List
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml, as this is much less invasive (does not
 require changing/adding anything to tomcat's global config
 directories).  But this doesn't seem to work.

 I can leave it as is (and am becoming resigned to the fact that this
 is my only option), but this is sort of a maintenance nightmare since
 the two files need to be kept in sync.  Plus, it just seems idiotic to
 need to declare the context and its resources in two locations.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

 -rob

 On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
 Robert Dietrick wrote:
 Hi,

 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.

 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

 Just leave it as is?

 The one in conf will take priority.

 Mark


 -
 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 additional commands, e-mail: [EMAIL PROTECTED]



Re: where to place context configuration

2008-08-14 Thread Guojun Zhu
I am not sure about the second case.  But I don't have context.xml in the
war (META-INF/ directory)  and the application works fine for me.

On Thu, Aug 14, 2008 at 1:30 PM, Angus Mezick [EMAIL PROTECTED]
 wrote:

 Am I the only one that is REALLY disturbed about that idea of REQUIRING
 two identical files to run an app?  One in the war file and one in the
 conf directory?  If the only in the conf directory takes priority, why
 the one in the war file needed at all?  I am just hoping this isn't in
 tomcat 6.0..  The idea of relying on the server to use the correct
 version of possibly different files in a production server makes me VERY
 nervous.

 --Angus Mezick

 -Original Message-
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2008 2:22 PM
 To: Tomcat Users List
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml, as this is much less invasive (does not
 require changing/adding anything to tomcat's global config
 directories).  But this doesn't seem to work.

 I can leave it as is (and am becoming resigned to the fact that this
 is my only option), but this is sort of a maintenance nightmare since
 the two files need to be kept in sync.  Plus, it just seems idiotic to
 need to declare the context and its resources in two locations.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

 -rob

 On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
  Robert Dietrick wrote:
  Hi,
 
  I just noticed that I had a Context definition in both
  $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
  $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
  these context definitions, I define a JNDI database connection pool
  with the same name and identical parameters.  This was working fine,
  but it is confusing, redundant, and runs contrary to the
  recommendations in the official documentation.
 
  However, if i remove either one of these files, I get the dreaded
  Cannot create JDBC driver of class '' for connect URL 'null' error.
  Can anyone offer any advice?
 
  Just leave it as is?
 
  The one in conf will take priority.
 
  Mark
 
 
  -
  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: where to place context configuration

2008-08-14 Thread Mark Thomas
Robert Dietrick wrote:
 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml, as this is much less invasive (does not
 require changing/adding anything to tomcat's global config
 directories).  But this doesn't seem to work.

That isn't the way it is designed.
 
 I can leave it as is (and am becoming resigned to the fact that this
 is my only option), but this is sort of a maintenance nightmare since
 the two files need to be kept in sync.  Plus, it just seems idiotic to
 need to declare the context and its resources in two locations.

The way it works (ignoring
https://issues.apache.org/bugzilla/show_bug.cgi?id=42747) is:

- drop in war
- if META-INF/context.xml exists, it is copied to conf
- the version in conf then always takes priority
- edit version in conf if you need to change the config
- war automatically reloads
- drop in new war
- war automatically reloads
- any META-INF/context.xml is ignored
- undeploy war, file in conf is deleted.

The reason it is designed this was is so that you can edit context.xml to
non-default settings without them getting trashed every time you update the
war.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

No. They should be ignored if present but it is better not to specify them.
The name of the war determines the context path.

Mark



-
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: where to place context configuration

2008-08-14 Thread Caldarale, Charles R
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml

I hope the above is a typo, because if it's really in contex.xml Tomcat won't 
look at it.

 But this doesn't seem to work.

It works fine for me; I put the Context element in one location or the other, 
not both.  Note that Tomcat will sometimes copy the one from 
META-INF/context.xml into conf/Catalina/[host]/[appName].xml during a 
deployment, and that's likely what you're seeing.

 Plus, it just seems idiotic to need to declare the context
 and its resources in two locations.

Never had to do that.  Suggest that you stop Tomcat, remove the one in 
conf/Catalina/[host], clean out the work directory for the webapp, clean out 
the expanded webapp so all you have left is the .war file, and restart Tomcat.  
You will likely see the one in conf/Catalina/[host] recreated from the 
META-INF/context.xml, since Tomcat wants to be able to read the file directly.  
A real undeployment of the webapp should delete the one in 
conf/Catalina/[host]; if you're updating the .war without doing an undeployment 
first, you're breaking the rules, and all bets are off.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

You may not use path or docBase in either location; if you're lucky, they'll 
just be ignored - don't chance it.

 - 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: where to place context configuration

2008-08-14 Thread Len Popp
What you're missing is how Tomcat copies the META-INF/context.xml file
to conf/localhost/Catalina/mywebapp.xml under some circumstances. (Not
surprising that you missed this, since it doesn't seem to be mentioned
in the Tomcat docs.)

One guess is that context.xml is copied into the conf directory if it
doesn't already exist there, but I'm not sure about that.
-- 
Len



On Thu, Aug 14, 2008 at 14:35, Robert Dietrick [EMAIL PROTECTED] wrote:
 You are definitely not alone, Angus.  For the record, I'm using Tomcat 5.5.

 -rob

 On Thu, Aug 14, 2008 at 11:30 AM, Angus Mezick
 [EMAIL PROTECTED] wrote:
 Am I the only one that is REALLY disturbed about that idea of REQUIRING
 two identical files to run an app?  One in the war file and one in the
 conf directory?  If the only in the conf directory takes priority, why
 the one in the war file needed at all?  I am just hoping this isn't in
 tomcat 6.0..  The idea of relying on the server to use the correct
 version of possibly different files in a production server makes me VERY
 nervous.

 --Angus Mezick

 -Original Message-
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2008 2:22 PM
 To: Tomcat Users List
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml, as this is much less invasive (does not
 require changing/adding anything to tomcat's global config
 directories).  But this doesn't seem to work.

 I can leave it as is (and am becoming resigned to the fact that this
 is my only option), but this is sort of a maintenance nightmare since
 the two files need to be kept in sync.  Plus, it just seems idiotic to
 need to declare the context and its resources in two locations.

 Does either of these files need a 'docBase' or 'path' parameter?  It
 doesn't seem to make a difference either way.

 -rob

 On Thu, Aug 14, 2008 at 11:00 AM, Mark Thomas [EMAIL PROTECTED] wrote:
 Robert Dietrick wrote:
 Hi,

 I just noticed that I had a Context definition in both
 $CATALINA_HOME/conf/Catalina/localhost/mywebapp.xml and in
 $CATALINA_HOME/webapps/mywebapp.war/META-INF/context.xml.  In both of
 these context definitions, I define a JNDI database connection pool
 with the same name and identical parameters.  This was working fine,
 but it is confusing, redundant, and runs contrary to the
 recommendations in the official documentation.

 However, if i remove either one of these files, I get the dreaded
 Cannot create JDBC driver of class '' for connect URL 'null' error.
 Can anyone offer any advice?

 Just leave it as is?

 The one in conf will take priority.

 Mark


 -
 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 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: where to place context configuration

2008-08-14 Thread Caldarale, Charles R
 From: Angus Mezick [mailto:[EMAIL PROTECTED]
 Subject: RE: where to place context configuration

 Am I the only one that is REALLY disturbed about that idea of
 REQUIRING two identical files to run an app?

Probably, because Tomcat does not require that.  You may place the Context 
element in either location, but Tomcat *may* copy the one from 
META-INF/context.xml to conf/Catalina/[host] so it can access it directly.  
Proper undeployment will remove the copy.  If you're doing a brute force 
replacement of a .war rather than a real undeployment, you deserve what you get.

You have the option of placing the webapp's Context element in 
conf/Catalina/[host]/[appName].xml so that you can override the one packaged in 
the .war file - often necessary with prepackaged apps that might require 
special configuration for a particular site.

 - 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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread David Smith
This thread may be very helpful to you: 
http://forums.sun.com/thread.jspa?messageID=3335080


Essentially you've declared your tags for jstl 1.1, which requires 
servlet spec 2.4, not 2.3.  Replace the DOCTYPE and web-app with this 
in your web.xml:


web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

version=2.4

Also the others are right on the datasource in your sql tags.  The error 
you got using the JNDI name suggests you don't have the right jdbc 
driver in tomcat's common/lib directory for the database you are trying 
to connect to.  Put your mysql-connector-java-[whaever vesion].jar file 
in tomcat's common/lib directory.  Be sure you do not have another copy 
in your webapp's WEB-INF/lib directory.  If it exists in common/lib, it 
cannot be in the webapp's WEB-INF/lib directory.



--David

[EMAIL PROTECTED] wrote:
I'm going to guess the servlet spec version in your web.xml isn't up to 
a level that supported the JSTL expression language.  What's your 
web.xml look like?



web.xml looks:
--
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app PUBLIC
   -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;

web-app
   display-nameEine Web - Applikation/display-name

   !-- Definition eines symbolischen Servlet-Namens --
   servlet
  servlet-nameHelloWorldServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.HelloWorld
  /servlet-class
   /servlet

   !-- Beispiel-Konfiguration des Datenbank-Servlets --
   servlet
  servlet-nameDatabaseServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.DatenbankServlet
  /servlet-class
  init-param
 param-namejdbcClass/param-name
 param-valuecom.mysql.jdbc.Driver/param-value
  /init-param
  init-param
 param-namedbURL/param-name
 param-valuejdbc:mysql://localhost:3306/javatest/param-value
  /init-param
  init-param
 param-nameusername/param-name
 param-valuejavauser/param-value
  /init-param
  init-param
 param-namepassword/param-name
 param-valuejavadude/param-value
  /init-param
   /servlet

   !-- Konfiguration des ImageServlets --
   servlet
  servlet-nameImageServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.ImageServlet
  /servlet-class
   /servlet

   !-- Binden des symbolischen Namens an eine URL --
   servlet-mapping
  servlet-nameHelloWorldServlet/servlet-name
  url-pattern/servlets/HelloWorld/url-pattern
   /servlet-mapping

   !-- Binden des Datenbank-Servlets an eine URL --
   servlet-mapping
  servlet-nameDatabaseServlet/servlet-name
  url-pattern/servlets/DatenbankServlet/url-pattern
   /servlet-mapping

   !-- Binden des Image-Servlets an eine URL --
   servlet-mapping
  servlet-nameImageServlet/servlet-name
  url-pattern/servlets/DynamicImage/url-pattern
   /servlet-mapping

/web-app
--

  

--David

ge wrote:


Hi,

Servlet works, jsp not. Why?

Result of servlet:

Datensätze
jdbc:mysql://localhost:3306/javatestcom.mysql.jdbc.Driver
javauserjavadude
NameVorname
1   hello
2   hellox

Result of jsp:
-
Results
${row.foo}  ${row.bar}


  

snipUnimportant stuff/snip


jsp code:
-
%@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

sql:query var=rs
  

dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude


select id, foo, bar from testdata
/sql:query

html
  head
titleDB Test/title
  /head
  body

  h2Results/h2
  


table
c:forEach var=row items=${rs.rows}
tr
   td c:out value=${row.foo}//td
   td c:out value=${row.bar}//td
/tr
/c:forEach
/table
  /body
/html

  

snippUnimportant stuff/snip



Thanks in advance for any help: Eleonora
  


-
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: where to place context configuration

2008-08-14 Thread Len Popp
So, the server admin can configure the DB server etc. by editing the
file under the conf dir, but every time they deploy a new version of
the app the settings are auto-wiped?

Setting aside for the moment what you think I deserve...
That's far from ideal in an environment where the developers and the
server admins are not within shouting distance. (Such as where I
work.)
-- 
Len

On Thu, Aug 14, 2008 at 14:57, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 From: Angus Mezick [mailto:[EMAIL PROTECTED]
 Subject: RE: where to place context configuration

 Am I the only one that is REALLY disturbed about that idea of
 REQUIRING two identical files to run an app?

 Probably, because Tomcat does not require that.  You may place the Context 
 element in either location, but Tomcat *may* copy the one from 
 META-INF/context.xml to conf/Catalina/[host] so it can access it directly.  
 Proper undeployment will remove the copy.  If you're doing a brute force 
 replacement of a .war rather than a real undeployment, you deserve what you 
 get.

 You have the option of placing the webapp's Context element in 
 conf/Catalina/[host]/[appName].xml so that you can override the one packaged 
 in the .war file - often necessary with prepackaged apps that might require 
 special configuration for a particular site.

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



-
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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread eleonora46
Please see in text
 This thread may be very helpful to you: 
 http://forums.sun.com/thread.jspa?messageID=3335080

The thread is about EL- I do not use xpression Language.

 Essentially you've declared your tags for jstl 1.1, which requires 
 servlet spec 2.4, not 2.3.  Replace the DOCTYPE and web-app with this 
 in your web.xml:
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
  version=2.4

Replaced, no change in display

 
 Also the others are right on the datasource in your sql tags.  The error 
 you got using the JNDI name suggests you don't have the right jdbc 
 driver in tomcat's common/lib directory for the database you are trying 
 to connect to.  Put your mysql-connector-java-[whaever vesion].jar file 
 in tomcat's common/lib directory.  Be sure you do not have another copy 
 in your webapp's WEB-INF/lib directory.  If it exists in common/lib, it 
 cannot be in the webapp's WEB-INF/lib directory.

As soon as I copy  mysql-connector-java-5.1.5-bin.jar
into /usr/share/tomcat5/common/lib, and try test.jsp, I get this:
javax.servlet.ServletException: Unable to get connection, DataSource invalid: 
java.sql.SQLException: No suitable driver found for 
jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude

Also please consider, servlet works, just jsp does not.
Driver and web.xml are common for both, aren't they?
Please advise, thanks, Eleonora
 
 --David
 
 [EMAIL PROTECTED] wrote:
  I'm going to guess the servlet spec version in your web.xml isn't up to
  a level that supported the JSTL expression language.  What's your 
  web.xml look like?
  
 
  web.xml looks:
  --
  ?xml version=1.0 encoding=ISO-8859-1?
 
  !DOCTYPE web-app PUBLIC
 -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
 
  web-app
 display-nameEine Web - Applikation/display-name
 
 !-- Definition eines symbolischen Servlet-Namens --
 servlet
servlet-nameHelloWorldServlet/servlet-name
servlet-class
   de.akdabas.jli.j2ee.servlets.HelloWorld
/servlet-class
 /servlet
 
 !-- Beispiel-Konfiguration des Datenbank-Servlets --
 servlet
servlet-nameDatabaseServlet/servlet-name
servlet-class
   de.akdabas.jli.j2ee.servlets.DatenbankServlet
/servlet-class
init-param
   param-namejdbcClass/param-name
   param-valuecom.mysql.jdbc.Driver/param-value
/init-param
init-param
   param-namedbURL/param-name
   param-valuejdbc:mysql://localhost:3306/javatest/param-value
/init-param
init-param
   param-nameusername/param-name
   param-valuejavauser/param-value
/init-param
init-param
   param-namepassword/param-name
   param-valuejavadude/param-value
/init-param
 /servlet
 
 !-- Konfiguration des ImageServlets --
 servlet
servlet-nameImageServlet/servlet-name
servlet-class
   de.akdabas.jli.j2ee.servlets.ImageServlet
/servlet-class
 /servlet
 
 !-- Binden des symbolischen Namens an eine URL --
 servlet-mapping
servlet-nameHelloWorldServlet/servlet-name
url-pattern/servlets/HelloWorld/url-pattern
 /servlet-mapping
 
 !-- Binden des Datenbank-Servlets an eine URL --
 servlet-mapping
servlet-nameDatabaseServlet/servlet-name
url-pattern/servlets/DatenbankServlet/url-pattern
 /servlet-mapping
 
 !-- Binden des Image-Servlets an eine URL --
 servlet-mapping
servlet-nameImageServlet/servlet-name
url-pattern/servlets/DynamicImage/url-pattern
 /servlet-mapping
 
  /web-app
  --
 

  --David
 
  ge wrote:
  
  Hi,
 
  Servlet works, jsp not. Why?
 
  Result of servlet:
  
  Datensätze
  jdbc:mysql://localhost:3306/javatest  com.mysql.jdbc.Driver
  javauser  javadude
  Name  Vorname
  1 hello
  2 hellox
 
  Result of jsp:
  -
  Results
  ${row.foo}${row.bar}
 
 

 snipUnimportant stuff/snip
 
  jsp code:
  -
  %@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql %
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
 
  sql:query var=rs

 
 dataSource=jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
  
  select id, foo, bar from testdata
  /sql:query
 
  html
head
  titleDB Test/title
/head
body
 
h2Results/h2

 
  table
  c:forEach var=row items=${rs.rows}
  tr
 td c:out value=${row.foo}//td
 td c:out value=${row.bar}//td
  /tr
  /c:forEach
  /table
/body
  /html
 

 snippUnimportant stuff/snip

Re: where to place context configuration

2008-08-14 Thread Mark H. Wood
On Thu, Aug 14, 2008 at 01:57:22PM -0500, Caldarale, Charles R wrote:
 You may place the Context element in either location, but Tomcat
 *may* copy the one from META-INF/context.xml to conf/Catalina/[host]
 so it can access it directly.  Proper undeployment will remove the
 copy.

Is there a page somewhere which documents this?

 If you're doing a brute force replacement of a .war rather than a
 real undeployment, you deserve what you get.

Is there a page somewhere which explains how to distinguish the two cases?

 You have the option of placing the webapp's Context element in
 conf/Catalina/[host]/[appName].xml so that you can override the one
 packaged in the .war file - often necessary with prepackaged apps
 that might require special configuration for a particular site.

But then an undeployment (whatever that may be) will destroy my
carefully handcrafted Context, right?  This behavior has been driving
me crazy for years.  I keep /conf/Catalina/[host] full of
foo.xml.saved files so I can quickly recover when Tomcat blows foo.xml
away, seemingly at random.  Half the time, when I copy a new .war in,
the Context is destroyed; the other half, it Just Works.

Currently on Tomcat 6.0.16, but I've had this frustration with 6.0,
5.5, and I believe 5.0.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgpQTeCbpaS7X.pgp
Description: PGP signature


Re: where to place context configuration

2008-08-14 Thread Robert Dietrick
On Thu, Aug 14, 2008 at 11:52 AM, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 From: Robert Dietrick [mailto:[EMAIL PROTECTED]
 Subject: Re: where to place context configuration

 I would very much prefer to use only the one in
 mywebapp/META-INF/contex.xml

 I hope the above is a typo, because if it's really in contex.xml Tomcat 
 won't look at it.

Yes, it was a typo.


 But this doesn't seem to work.

 It works fine for me; I put the Context element in one location or the 
 other, not both.  Note that Tomcat will sometimes copy the one from 
 META-INF/context.xml into conf/Catalina/[host]/[appName].xml during a 
 deployment, and that's likely what you're seeing.

 Plus, it just seems idiotic to need to declare the context
 and its resources in two locations.

 Never had to do that.  Suggest that you stop Tomcat, remove the one in 
 conf/Catalina/[host], clean out the work directory for the webapp, clean out 
 the expanded webapp so all you have left is the .war file, and restart 
 Tomcat.  You will likely see the one in conf/Catalina/[host] recreated from 
 the META-INF/context.xml, since Tomcat wants to be able to read the file 
 directly.  A real undeployment of the webapp should delete the one in 
 conf/Catalina/[host]; if you're updating the .war without doing an 
 undeployment first, you're breaking the rules, and all bets are off.

That did it.  I've never seen it documented anywhere that tomcat
copies context files from META-INF/ to /conf/[Engine]/[host]/.  Plus,
I was deploying as a directory named '[myapp].war' rather than as an
actual .war file, so I guess I get what I deserve.

Thanks for the help.

-rob

-
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: Hot redeploying a WAR - HTML is not refreshed

2008-08-14 Thread Peter Desjardins
 Exactly how are you accomplishing this hot redeployment?  Does Tomcat really 
 shut down the application and reload it?

I copy the new version of the WAR file into
C:\apache-tomcat-6.0.18\webapps\, overwriting the old copy.

Here's the log:
Aug 14, 2008 3:45:05 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 14, 2008 3:45:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 559 ms
Aug 14, 2008 3:45:05 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 14, 2008 3:45:05 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Aug 14, 2008 3:45:05 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-admin.war
Aug 14, 2008 3:45:22 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-eped.war
Aug 14, 2008 3:45:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-ps-mon.war
Aug 14, 2008 3:45:42 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 14, 2008 3:45:42 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 14, 2008 3:45:42 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/32  config=null
Aug 14, 2008 3:45:42 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 36795 ms

* New versions of WAR files copied into C:\apache-tomcat-6.0.18\webapps

Aug 14, 2008 3:46:42 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/nexus-5-0-ps-mon]
Aug 14, 2008 3:46:50 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/nexus-5-0-admin]
Aug 14, 2008 3:46:58 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/nexus-5-0-eped]
Aug 14, 2008 3:47:05 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-admin.war
Aug 14, 2008 3:47:16 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-eped.war
Aug 14, 2008 3:47:25 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus-5-0-ps-mon.war

 Since you're on a Windows box, you may want to experiment with the 
 antiResourceLocking attribute of your webapp's Context element - but watch 
 out for the caveats mentioned in the doc:

This problem is occurring on two type of Linux server also.  I'm just
troubleshooting the problem on my Windows computer.

Thanks!

Peter

-
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: servlet works, jsp not, why? (Tomcat 5.0)

2008-08-14 Thread David Smith


The thread is about EL- I do not use xpression Language.
What do you think ${row.foo} is?  It's the expression language which 
isn't being interpreted by your jsp page.  Also did you reload your 
webapp or tomcat afterwards so it pick's up the change?



As soon as I copy  mysql-connector-java-5.1.5-bin.jar
into /usr/share/tomcat5/common/lib, and try test.jsp, I get this:
javax.servlet.ServletException: Unable to get connection, DataSource invalid: 
java.sql.SQLException: No suitable driver found for 
jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude
Did you restart tomcat after the move?  It's required when you change 
the contents of common/lib.



Also please consider, servlet works, just jsp does not.
Driver and web.xml are common for both, aren't they?
Please advise, thanks, Eleonora
Because your servlet was going straight for the driver, not using the 
JNDI database pool provided by tomcat at all.


--David

[EMAIL PROTECTED] wrote:

Please see in text
  
This thread may be very helpful to you: 
http://forums.sun.com/thread.jspa?messageID=3335080



The thread is about EL- I do not use xpression Language.

  
Essentially you've declared your tags for jstl 1.1, which requires 
servlet spec 2.4, not 2.3.  Replace the DOCTYPE and web-app with this 
in your web.xml:


web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

 version=2.4



Replaced, no change in display

 
  
Also the others are right on the datasource in your sql tags.  The error 
you got using the JNDI name suggests you don't have the right jdbc 
driver in tomcat's common/lib directory for the database you are trying 
to connect to.  Put your mysql-connector-java-[whaever vesion].jar file 
in tomcat's common/lib directory.  Be sure you do not have another copy 
in your webapp's WEB-INF/lib directory.  If it exists in common/lib, it 
cannot be in the webapp's WEB-INF/lib directory.



As soon as I copy  mysql-connector-java-5.1.5-bin.jar
into /usr/share/tomcat5/common/lib, and try test.jsp, I get this:
javax.servlet.ServletException: Unable to get connection, DataSource invalid: 
java.sql.SQLException: No suitable driver found for 
jdbc:mysql://localhost:3306/javatest?user=javauserpassword=javadude

Also please consider, servlet works, just jsp does not.
Driver and web.xml are common for both, aren't they?
Please advise, thanks, Eleonora
 
  

--David

[EMAIL PROTECTED] wrote:


I'm going to guess the servlet spec version in your web.xml isn't up to
a level that supported the JSTL expression language.  What's your 
web.xml look like?



web.xml looks:
--
?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app PUBLIC
   -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;

web-app
   display-nameEine Web - Applikation/display-name

   !-- Definition eines symbolischen Servlet-Namens --
   servlet
  servlet-nameHelloWorldServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.HelloWorld
  /servlet-class
   /servlet

   !-- Beispiel-Konfiguration des Datenbank-Servlets --
   servlet
  servlet-nameDatabaseServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.DatenbankServlet
  /servlet-class
  init-param
 param-namejdbcClass/param-name
 param-valuecom.mysql.jdbc.Driver/param-value
  /init-param
  init-param
 param-namedbURL/param-name
 param-valuejdbc:mysql://localhost:3306/javatest/param-value
  /init-param
  init-param
 param-nameusername/param-name
 param-valuejavauser/param-value
  /init-param
  init-param
 param-namepassword/param-name
 param-valuejavadude/param-value
  /init-param
   /servlet

   !-- Konfiguration des ImageServlets --
   servlet
  servlet-nameImageServlet/servlet-name
  servlet-class
 de.akdabas.jli.j2ee.servlets.ImageServlet
  /servlet-class
   /servlet

   !-- Binden des symbolischen Namens an eine URL --
   servlet-mapping
  servlet-nameHelloWorldServlet/servlet-name
  url-pattern/servlets/HelloWorld/url-pattern
   /servlet-mapping

   !-- Binden des Datenbank-Servlets an eine URL --
   servlet-mapping
  servlet-nameDatabaseServlet/servlet-name
  url-pattern/servlets/DatenbankServlet/url-pattern
   /servlet-mapping

   !-- Binden des Image-Servlets an eine URL --
   servlet-mapping
  servlet-nameImageServlet/servlet-name
  url-pattern/servlets/DynamicImage/url-pattern
   /servlet-mapping

/web-app
--

  
  

--David

ge wrote:



Hi,

Servlet works, jsp not. Why?

Result of servlet:

Datensätze

RE: where to place context configuration

2008-08-14 Thread Caldarale, Charles R
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Subject: Re: where to place context configuration

 So, the server admin can configure the DB server etc. by editing the
 file under the conf dir, but every time they deploy a new version of
 the app the settings are auto-wiped?

Depends on how the redeployment is done.  If the webapp is specifically 
undeployed, then all traces of it are removed, including the 
conf/Catalina/[host]/[appName].xml file; see Mark T's message for details:
http://marc.info/?l=tomcat-userm=121873999115208w=2

If you just want to replace the webapp, then dropping in a new .war file will 
not lose the element in conf/Catalina/[host]/[appName].xml file, but things may 
not be cleaned up properly, especially on Windows systems where the 
anti-locking mechanisms are employed.

 - 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: where to place context configuration

2008-08-14 Thread Caldarale, Charles R
 From: Mark H. Wood [mailto:[EMAIL PROTECTED]
 Subject: Re: where to place context configuration

 Is there a page somewhere which documents this?

I don't think so, at least not in sufficient detail.  Mark T's recent message 
covers the steps:
http://marc.info/?l=tomcat-userm=121873999115208w=2

 - 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: Reading environment variable from Tomcat

2008-08-14 Thread André Warnier

David kerber wrote:

Sureka, Sushil wrote:

Hi,

 


I have run into an issue related to starting tomcat as a service. When
we were starting tomcat from the command line, we were able to just say
System.getProperty(user.name ) to retrieve the logged in user id. But
now that we start tomcat using a service, the get property call returns
SYSTEM. 
 
I saw all the other answers, but I would just like to point out clearky 
that what you mention above is *normal*.
System.getProperty(user.name) will return SYSTEM when you start 
Tomcat as a service under Windows, because SYSTEM is the user name 
under which Tomcat then starts.
Right-click on the My computer icon, then Manage.. then services 
and applications, then services.
Locate the Tomcat service in the list on the right, and right-click on 
it, choose Properties.  The second tab shows under which user-id the 
Tomcat Service is started.  By default, it will say something like 
LocalSystem (which is an alias for SYSTEM).  That is the user-id 
under which the service is running.

In the same tab, you can change it, and set it to the user-id you want.

Now, if you want to run Tomcat as a different user each time someone 
logs on to the laptop, that's a different story, for which you already 
got tips from other people.




-
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: where to place context configuration

2008-08-14 Thread Len Popp
On Thu, Aug 14, 2008 at 15:55, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 If you just want to replace the webapp, then dropping in a new .war file will 
 not lose the element in conf/Catalina/[host]/[appName].xml file, but things 
 may not be cleaned up properly, especially on Windows systems where the 
 anti-locking mechanisms are employed.

But earlier you said:

 if you're updating the .war without doing an undeployment
 first, you're breaking the rules, and all bets are off.

So that doesn't sound like a reasonable alternative for a server that
anyone cares about.

Is there someone who knows for sure how it was *designed* to work?
-- 
Len

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

2008-08-14 Thread Kees Jan Koster

Dear Tokajac,


I want to monitor performance of Tomcat server when I'm running an
application.

Memory usage, threads, objects, user sessions, sql queries and as
much as
possible of other information on server.


JMX is the way to go. JConsole was already suggested. If you want to
really monitor the performance of an application you also need
information from the actual host (disk I/O load, network load,
processor load, RAM fill level.

You should consider that tools such as JConsole only show data that is
gathered as long as JConsole is running. External monitoring tools
also allow you to gather information continuously, across reboots and
new software versions. That gives you the ability to 1) do long term
resource requirements prediction and 2) see what version of your
application introduced or solved the memory leak. :)

There are loads of tools out there that can do this. Personally, I use 
http://www.zabbix.com
, combined with the Zapcat JMX to Zabbix bridge 
(http://www.kjkoster.org/zapcat/Tomcat_How_To.html
).
--
Kees Jan

http://java-monitor.com/forum/
[EMAIL PROTECTED]
06-51838192

Human beings make life so interesting. Do you know that in a universe
so full of wonders,
they have managed to invent boredom. Quite astonishing... -- Terry
Partchett


RE: where to place context configuration

2008-08-14 Thread Caldarale, Charles R
 From: Len Popp [mailto:[EMAIL PROTECTED]
 Subject: Re: where to place context configuration

 But earlier you said:
  if you're updating the .war without doing an undeployment
  first, you're breaking the rules, and all bets are off.

Yes, that was probably a bit excessive.

 Is there someone who knows for sure how it was *designed* to work?

Again, I think Mark T's message documents it fairly clearly:
http://marc.info/?l=tomcat-userm=121873999115208w=2

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

2008-08-14 Thread Tokajac

Thanks for your answer Jan!


As far as I see  http://www.zabbix.com http://www.zabbix.com  is not
available for WinXP (that's my platform).
I downloaded Zapcat. Can Zapcat be useful without zabbix?

Any more advice for this situation?


Regards



-- 
View this message in context: 
http://www.nabble.com/Tomcat-monitoring-tp18963920p18992437.html
Sent from the Tomcat - User mailing list archive at Nabble.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]