Multiple Security Providers with Tomcat

2005-04-18 Thread Tom Bednarz
I have a customer who likes to introduce chipcards with client 
certificates for single-sign-on. I need to add support for that in a 
web-application we provided.

The problem is, that not ALL users of the application may have a 
certificate. So for all not able to present a valid certificate I should 
offer a login screen to authenticate with username / password (which is 
basically the current solution)

Is there any way of configuring multiple security providers in Tomcat 
5.0 and go through them in the authentication process?  If this is 
possible could anybody point me to a configuration exemple?

Many thanks for your help.
Tom
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat 5, Velocity and XML Parser issues

2004-04-06 Thread Tom Bednarz
Hi,

I just experienced a problem with Velocity and Tomcat 5.0.19. I use Velocity 1.3, 
Velocity Tools 1.0, Struts 1.1 and Tomcat 5.0.19.

When starting my Web-App I got the following error:

2004-04-05 16:18:02 StandardContext[/Echnaton] Velocity   [info] Velocity successfully 
started.
2004-04-05 16:18:02 StandardContext[/Echnaton] Velocity   [info] Using toolbox 
configuration file '/WEB-INF/toolbox.xml'
2004-04-05 16:18:02 StandardContext[/Echnaton] Velocity   [info] 
ServletToolboxManager: Loading toolbox...
2004-04-05 16:18:02 StandardContext[/Echnaton]StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/dom4j/io/SAXReader
 at org.apache.velocity.tools.view.XMLToolboxManager.load(XMLToolboxManager.java:205)
 at 
org.apache.velocity.tools.view.servlet.ServletToolboxManager.getInstance(ServletToolboxManager.java:211)
 at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.initToolbox(VelocityViewServlet.java:252)
 at 
org.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:219)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3959)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4284)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
 at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:320)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:727)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
 at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521)
 at org.apache.catalina.core.StandardService.start(StandardService.java:519)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)


On the Velocity-user mailinglist I was told to copy the dom4j.jar file into 
$CATALINA_HOME/common/endorsed and that solved the problem. So far (Tomcat 4.x) I put 
the dom4j.jar into the lib directory of the WEB-INF of my web app. 

Could anybody please explain me what this endorsed directory is all about? Which 
libraries do I need to put where and why is it NOT possible to put libraries such as 
dom4j.jar into my Web-Application. Or is there anything I am doing wrong when 
deploying my web app to Tomcat 5?

Any clarification, additional documentation etc is greatly appreciated.

Tom

Implementing my own Realm based on JDBCRealm

2004-04-06 Thread Tom Bednarz
Hi,

I like to implement my own Realm based on the JDBCRealm provided by Tomcat. I 
currently use Tomcat 5.0.19, Eclipse 3M7 is my IDE (together with MyEclipseIDE).

To implement my own Realm I like to derive my class from 
org.apache.catalina.realm.JDBCRealm

Eclipse throws an error saying that it cannot resolve 
javax.management.MBeanRegistration. I cannot find this class at all. Searching on 
java.sun.com showed me, that the package javax.management.* is part of J2EE 1.4.

Could anybody tell me, what I need to do to derive something from 
org.apache.catalina.realm.JDBCRealm and what I need to include to get it working in 
either my IDE and on a production Tomcat server.

The result of my compilation is a JAR file which I like to put into tomcat's 
common/lib directory.

Any help would be greatly appreciated!

Tom



Write my own Realm - HOWTO ?

2004-03-25 Thread Tom Bednarz
Im using Tomcat 5.0.19.

I need to extend the JDBC Realm a little bit, precisly I need to have my 
own implementation of authenticate(..).

In the Realm Configuration HOW-TO is a incomplete Link (FIXME) to 
information how to do this.

Could anybody please point me to that link?

Basically I want to create my own realm derived from JDBCRealm with my 
own implementation of authenticate(). How do I tell Tomcat about this 
new Realm. Where do I need to put the jar file that it is being recognised?

Thanks for your help.

Thomas

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


Java IDE for Tomcat

2004-03-25 Thread Tom Bednarz
Does anybody know if it is possible to integrate Tomcat 5 into JBuilder 
8 Enterprise?

Does anybody use Eclipse and Tomcat? Is it possible to use Tomcat 5 with 
Eclipse (debugging servlets, JSP etc)?

Many thanks for your feedback on your experience.

Tom

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


Re: Java IDE for Tomcat

2004-03-25 Thread Tom Bednarz
Thank you Guys for all that feedback!

Tom


- Original Message - 
From: Tom Bednarz [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 6:38 PM
Subject: Java IDE for Tomcat


 Does anybody know if it is possible to integrate Tomcat 5 into JBuilder 
 8 Enterprise?
 
 Does anybody use Eclipse and Tomcat? Is it possible to use Tomcat 5 with 
 Eclipse (debugging servlets, JSP etc)?
 
 Many thanks for your feedback on your experience.
 
 Tom
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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



HTTP instead of FTP downloads with Tomcat

2003-11-26 Thread Tom Bednarz
Hi,

Could anybody please give me some hints how to solve the following problem:

Some of my customers cannot use FTP from their offices due to security restrictions. I 
have to offer them the possibility to download files using the HTTP protocol.

I use TOMCAT but have the listings tag set to false in the default servlet tag of 
web.xml to deny directory listings.

The idea is, that I have a virtual directory that points to the customers directory on 
the FTP Server and shows its contents in the browser. I think it should work with a 
customer specific login. Could anybody please give me some additional pointers what I 
exactly have to configure to make this one working?

Many thanks

Tom

Re: HTTP instead of FTP downloads with Tomcat

2003-11-26 Thread Tom Bednarz
Thanks a lot for all input. I will give it a try and come back if I
experience problems.

Tom


- Original Message - 
From: Tom Bednarz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 6:45 AM
Subject: HTTP instead of FTP downloads with Tomcat


Hi,

Could anybody please give me some hints how to solve the following problem:

Some of my customers cannot use FTP from their offices due to security
restrictions. I have to offer them the possibility to download files using
the HTTP protocol.

I use TOMCAT but have the listings tag set to false in the default servlet
tag of web.xml to deny directory listings.

The idea is, that I have a virtual directory that points to the customers
directory on the FTP Server and shows its contents in the browser. I think
it should work with a customer specific login. Could anybody please give me
some additional pointers what I exactly have to configure to make this one
working?

Many thanks

Tom


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



Re: Re[4]: Where do I edit /etc/tomcat4/conf/tomcat4.conf in Windows 2000? Want to edit LANG setting

2002-05-03 Thread Tom Bednarz

Jake,

Thanks for the link! I will download the stuff. I was already looking into
that JNI stuff a couple of months ago and found it quite complicated!

Tom


- Original Message -
From: Jacob Kjome [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, May 02, 2002 8:30 PM
Subject: Re[4]: Where do I edit /etc/tomcat4/conf/tomcat4.conf in Windows
2000? Want to edit LANG setting


 Hello Tom,

 Well, how about here:
 http://www.alexandriasc.com/software/JavaService/source.html

 Tomcat.exe is simply a program called JavaService:

 JavaService is a Win32 executable that allows any Java class to be
 run as an NT service. It uses JNI's invocation API to create a Java
 Virtual Machine using any JNI compliant Java implementation.

 Also, the options being referred to have nothing specifically to do
 with Tomcat at all.  They are JVM options...specifically, Sun JVM
 options for JDK1.3 and JDK1.4.

 CATALINA_OPTS = -server -Xms8m -Xmx128m

 1. -server - use the server VM
 2. -Xms8m - Set the initial size of the Java memory allocation pool (that
is, the heap) to 8 Mbytes (The default value is 2MB)
 3. -Xmx128m - Set the maximum heap size to 128 Mbytes (The default value
is 64MB)
 4. -Xincgc - Use incremental GC, eliminate occasional garbage-collection
pauses during program execution, although 10% hit in overall GC performance


 The CATALINA_OPTS evironment variable is there as an convenience for
 you to use when running Tomcat.  If you've specified this environment
 variable, Tomcat, using the scripts to start up, will use these flags
 when starting itself up.  These flags tell the Sun JVM to behave in
 particular ways that may optimize your application running within the
 JVM.

 Does that clear things up?

 Jake

 Thursday, May 02, 2002, 1:16:48 AM, you wrote:

 TB Jake,

 
  Also, what is that -jvm_option?  I haven't seen that before?  My
  %CATALINA_OPTS% evironment var looks like: -server -Xms8m -Xmx128m.
  Should I be using -jvm_option?
 

 TB I have NO -server option. I think there is a big difference between
Tomcat
 TB 3.x and 4.x. If you type tomcat.exe /? you will see all available
options.
 TB It may also be a difference between Tomcat running as a service
(Win$ows
 TB only) or running it in a shell.

 TB Some weeks ago I tried to find out where the source code of
Tomcat.exe is,
 TB but nobody replied! It seems to be TOP SECRET open source -:)

 TB Tom



 --
 Best regards,
  Jacobmailto:[EMAIL PROTECTED]


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Re[2]: Where do I edit /etc/tomcat4/conf/tomcat4.conf in Windows 2000? Want to edit LANG setting

2002-05-01 Thread Tom Bednarz

Jake,


 Also, what is that -jvm_option?  I haven't seen that before?  My
 %CATALINA_OPTS% evironment var looks like: -server -Xms8m -Xmx128m.
 Should I be using -jvm_option?


I have NO -server option. I think there is a big difference between Tomcat
3.x and 4.x. If you type tomcat.exe /? you will see all available options.
It may also be a difference between Tomcat running as a service (Win$ows
only) or running it in a shell.

Some weeks ago I tried to find out where the source code of  Tomcat.exe is,
but nobody replied! It seems to be TOP SECRET open source -:)

Tom


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




server.xml - context parameter question

2002-04-30 Thread Tom Bednarz

Hi

I have a problem in initializing my web application. The application stores
all of its configuration parameters in a database table. My application has
an initialization servlet which loads beside other things the configuration.
Initially this is done in the init method, over time it is periodically done
in a separate thread.

The problem is, that I need to compose a JDBC connect URL. One of the
components of this URL is the name or IP address of the database server.
This information cannot be put in the web.xml of the web application since
it depends on the runtime environment and cannot be pre-defined at
development time. To access the configuration information in the database I
need this JDBC connect URL. So I was looking for a possibility to define
parameters OUTSIDE my web application.

I found a context tag under the host tag in the server.xml file. The TOMCAT
documentation says:

   snip 
You can configure named values that will be made visible to the web
application as servlet context initialization parameters by nesting
Parameter elements inside this element. For example, you can create an
initialization parameter like this:

Context ...
  ...
  Parameter name=companyName value=My Company, Incorporated
 override=false/
  ...
/Context



This is equivalent to the inclusion of the following element in the web
application deployment descriptor (/WEB-INF/web.xml):

context-param
  param-namecompanyName/param-name
  param-valueMy Company, Incorporated/param-value
/context-param



but does not require modification of the deployment descriptor to customize
this value.

-- end --

So I did the following:

Context path=/MyWebapp docBase=MyWebapp debug=0 privileged=true
 Parameter name=DBServer value=MyDatabaseServer override=false/
/Context

In the init() method of my initialization servlet (preload=1) I did the
following:

for (java.util.Enumeration e = config.getInitParameterNames();
e.hasMoreElements();)
mAppLog.debug(\t+(String)e.nextElement());

where config is the ServletConfig object which is a parameter of the
HttpServlet.init(..) method. I expected to find the name DBServer as a
parameter name but it does NOT appear. Only those parameters defined in the
web applications web.xml file appear!

Could anybody explain me what I am doing wrong? What happens to context
entries in the server.xml file if the named context is NOT YET installed
e.g. is in the webapps directory as .war file?

Any help would be greatly appreciated.

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: server.xml - context parameter question

2002-04-30 Thread Tom Bednarz

Abe,

Thanks for the input. It is not that easy since I run TOMCAT on W2K as a
system service. There is a batch file which allows settings of environment
variables. However I think it would be better to set application specific
variables in an application context and environment variables for container
configuration only. But thanks for the input anyway.

Tom


- Original Message -
From: Abraham Fathman [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 9:31 AM
Subject: RE: server.xml - context parameter question


 Tom,

 I haven't done this before but I thought that it might help you out.

 Instead of using the server.xml you could try adding your variables as
 system properties. I believe you can do this by creating a setenv.sh/bat
 file in your bin directory. Here you can set an environmental variable
 JAVA_OPTS=-Ddbserer=dbserver.

 The catalina scripts should call this setenv script which will set the
 JAVA_OPTS env variable. Then your code should be able to get this
 property from the System.getProperty(dbserver) line.

 Just a thought. Hope it helps,

 Abe

 -Original Message-
 From: Tom Bednarz [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 30, 2002 3:18 AM
 To: Tomcat User List
 Subject: server.xml - context parameter question


 Hi

 I have a problem in initializing my web application. The application
 stores all of its configuration parameters in a database table. My
 application has an initialization servlet which loads beside other
 things the configuration. Initially this is done in the init method,
 over time it is periodically done in a separate thread.

 The problem is, that I need to compose a JDBC connect URL. One of the
 components of this URL is the name or IP address of the database server.
 This information cannot be put in the web.xml of the web application
 since it depends on the runtime environment and cannot be pre-defined at
 development time. To access the configuration information in the
 database I need this JDBC connect URL. So I was looking for a
 possibility to define parameters OUTSIDE my web application.

 I found a context tag under the host tag in the server.xml file. The
 TOMCAT documentation says:

    snip 
 You can configure named values that will be made visible to the web
 application as servlet context initialization parameters by nesting
 Parameter elements inside this element. For example, you can create an
 initialization parameter like this:

 Context ...
   ...
   Parameter name=companyName value=My Company, Incorporated
  override=false/
   ...
 /Context



 This is equivalent to the inclusion of the following element in the web
 application deployment descriptor (/WEB-INF/web.xml):

 context-param
   param-namecompanyName/param-name
   param-valueMy Company, Incorporated/param-value /context-param



 but does not require modification of the deployment descriptor to
 customize this value.

 -- end --

 So I did the following:

 Context path=/MyWebapp docBase=MyWebapp debug=0
 privileged=true
  Parameter name=DBServer value=MyDatabaseServer
 override=false/ /Context

 In the init() method of my initialization servlet (preload=1) I did the
 following:

 for (java.util.Enumeration e = config.getInitParameterNames();
 e.hasMoreElements();)
 mAppLog.debug(\t+(String)e.nextElement());

 where config is the ServletConfig object which is a parameter of the
 HttpServlet.init(..) method. I expected to find the name DBServer as a
 parameter name but it does NOT appear. Only those parameters defined in
 the web applications web.xml file appear!

 Could anybody explain me what I am doing wrong? What happens to context
 entries in the server.xml file if the named context is NOT YET installed
 e.g. is in the webapps directory as .war file?

 Any help would be greatly appreciated.

 Thomas


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Where do I edit /etc/tomcat4/conf/tomcat4.conf in Windows 2000? Want to edit LANG setting

2002-04-30 Thread Tom Bednarz

Tony,

There is no such file on Windows. Usually you install Tomcat as service on
NT/W2K. You have to pass all parameters to the TOMCAT.exe file.

Type Tomcat /? and you will get command line help. The whole thing is not so
easy and it took me quite a while to figure it out! So I have written a
small batch file to install the service and one to remove the service. Here
is the code for those who are interested:

 snip install ---
@echo off
d:
cd \Tomcat4.0\bin

tomcat.exe -install Apache Tomcat
C:\JavaSoft\jdk1.3.1_01\jre\bin\hotspot\jvm.dll -jvm_option -Djava.class.pat
h=D:\Tomcat4.0\bin\bootstrap.jar -jvm_option -Dcatalina.home=d:\tomcat4.0 -j
vm_option -Xms128M -jvm_option -Xmx256M -start
org.apache.catalina.startup.BootstrapService -params start -stop
org.apache.catalina.startup.BootstrapService -params stop -out
d:\tomcat4.0\logs\service.out -err d:\tomcat4.0\logs\service.err

- snip remove service ---
@echo off
d:
cd \Tomcat4.0\bin
tomcat -uninstall Apache Tomcat


Please note that you have to write tomcat.exe command on ONE SINGLE line!

You can also use regedit.exe and edit the keys
HKEY_LOKAL_MACHINE\SYSTEM\CurrentControlSet\Services\Your apache service
name. Be careful when modifying the registry using regedit. If you do
something wrong it can destroy your system!

Good look!

Tom

- Original Message -
From: Tony [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 9:59 AM
Subject: Where do I edit /etc/tomcat4/conf/tomcat4.conf in Windows 2000?
Want to edit LANG setting


 Hi Folks

 Where is the

 /etc/tomcat4/conf/tomcat4.conf

 file which is found on a Linux tomcat install found in a Windows install.
I want to edit
 the LANG setting

 Cheers

 Tony

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Bug in implementation of HttpSessionAttributeListener with Tomcat 4.0.1 ??

2002-04-11 Thread Tom Bednarz

Hi,

I have a very funny behaviour when using the HttpSessionAttributeListener interface.

I have derived a class from HttpSessionAttributeListener and implemented the two 
methods

- public void attributeAdded(HttpSessionBindingEvent se)
- public void attributeRemoved(HttpSessionBindingEvent se)

Both worked fine until I have disabled cookie support!

When cookie support is disabled in a browser TOMCAT usually performs automatically URL 
rewriting (this assumes that the application also makes use of 
HttpServletResponse.encodeURL(...) whenever URL's are hardcoded for a tags or form 
action=. tags. I have done this in my application and was just tesing all my 
stuff when I noticed that this does not work anymore.

OK now back to the HttpSessionAttributeListener implementation. The method 
attributeAdded() is still called correctly when using URL rewriting. The method 
attributeRemoved() gets NEVER called when URL rewriting is used (cookies are not 
allowed in the browser)

I am still using Tomcat 4.0.1 and I can reproduce this behaviour anytime. I have not 
yet upgraded to 4.0.3 yet and therefore cannot say whether it is working there 
correctly.

Does anybody else have the same problem? Could someone give me advice what I have to 
do? Can I somehow help to track down the problem?

Thomas


Re: Question about Catalina.bat

2002-02-12 Thread Tom Bednarz

Irene,

 Please explain the following code in catalina.bat :

 %_STARTJAVA%

%CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA
 _HOME% org.apache.catalina.startup.Bootstrap %2 %3%9 start

 for example,  -Dcatalina.home=%CATALINA_HOME%
 My only guess is that %CATALINA_HOME% would be D:\jakarta-tomcat-4.0.1
 in my computer, but what is -Dcatalina.home= and  other %CATALINA_xxx%
 mean? how could I find out?


These parameters here are parameters passed to the JVM and define where your
JDK or JRE is and where the TOMCAT classes are. On Windows the JVM is an
executable called java.exe or javaw.exe. Have a look at
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/java.html for the different
meanings of these parameters.

The variables are all explained at the beginning of the batch file. These
are mainly paths and if you just download the distribution you usually have
nothing to change. But if you have multiple versions of a JDK's on you
machine and you like to use one explicitly it if required that you set the
paths correctly.

For a production installation it is anyway recommendet to install Tomcat as
a service which runs permanently independent of the fact who is logged into
the machine.

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




reloading templates

2002-02-05 Thread Tom Bednarz

Hello,

What possibilities do I have to reload and quickly test changed templates?
Do I need to reload an application in TOMCAT using the manager app or is
there anything shorter? (JSP just recompile, quite handy for testing)

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: reloading templates

2002-02-05 Thread Tom Bednarz

FORGET THIS, I postet to the wrong list!!! SORRY!

Thomas

- Original Message -
From: Tom Bednarz [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, February 05, 2002 2:28 PM
Subject: reloading templates


 Hello,

 What possibilities do I have to reload and quickly test changed templates?
 Do I need to reload an application in TOMCAT using the manager app or is
 there anything shorter? (JSP just recompile, quite handy for testing)

 Thomas


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Help giving Tomcat more memory

2002-02-01 Thread Tom Bednarz

Michael,

 I then start the program with
 java -Xms145M -Xmx160M test

 If I understand this correctly, the initial heap size should be 145 megs.
 However, looking at my processes, there is only about 7200K allocated for
the
 program. Why doesn't it start out at 145? That is the same behaviour I'm
 seeing on the Win2K machine with Tomcat. It ignores the initial heap size
I'm
 specifying and starts around 16MB, and then dies around 78.

 Am I misunderstanding how the -Xms and -Xmx flags work?


No, but when looking at the task manager you should not look at Mem Usage
but at VM Size. (You can select the columns at View | Select Columns...)
NT/W2K/XP allocate Memory usually as virtual memory (using LocalAlloc() or
GlobalAlloc() API functions in C/C++). The OS decides when it will swap
unused data and program code to the page file and give more fast memory to
a process. So if you specify -Xmsn and -Xmxn the OS will not immediately
take away all memory when the process starts. You just made sort of a
reservation. If you look at VMSize you will see, that you got your 145
MB.

HTH

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Problems with .exe install for NT

2002-01-31 Thread Tom Bednarz

Hello Anton,


 I've found a link at tomcat-dev
 (JavaService -
http://www.alexandriasc.com/software/JavaService/index.html)
 I posted it here couple of days ago in that old thread you asked for it
last time.
 Mayby I should have posted it to you directly, sorry.


Many thanks for that link! Unfortunately it seems the site is not up. I get
an under construction if I look at http://www.alexandriasc.com or I get the
photo of a baby! Probably the site belongs to a happy new daddy which has no
time to write software anymore!

Tom


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Session Timeout

2002-01-30 Thread Tom Bednarz

It works for me on TC 4.0.1. I have implemented a servlet that monitors all
sessions currently active on my application (using the new
HttpSessionListener interface) and I can see expired sessions.

Maybe a problem of previous TC versions

Thomas

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 5:42 PM
Subject: Session Timeout


 Hi,
 I tried setting session timeout to 5 mins using web.xml (please see
 the following code), but it does not seem to be working. In my jsp I
 displayed getMaxInactiveInterval() and it shows 1800 (30 mins). Can anyone
 please let me know if I can use web.xml for session timeout in jsp pages
or
 not.
 session-config
 session-timeout
 5
 /session-timeout
 /session-config


 Sumit.
 The information contained in this e-mail and any files transmitted with it
 may be privileged and confidential.  If the reader of this message,
 regardless of the address or routing, is not an intended recipient, you
are
 hereby notified that you have received this transmittal in error and any
 review, use, distribution, dissemination or copying is strictly
prohibited.
 If you have received this message in error, please delete this e-mail and
 all files transmitted with it from your system and notify the sender by
 reply e-mail or by calling 1-888-338-6076.

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Problems with .exe install for NT

2002-01-30 Thread Tom Bednarz

John,

Type tomcat.exe /? for a help screen.

I have written some batch files to install and uninstall it as service with
apropriate settings for the VM. Here the exemples (all on one line please)

 snip 
@echo on
d:
cd \Tomcat4.0\bin

tomcat.exe -install Apache Tomcat
C:\JavaSoft\JRE\1.3.1_02\bin\hotspot\jvm.dll -jvm_option -Djava.class.path=D
:\Tomcat4.0\bin\bootstrap.jar -jvm_option -Dcatalina.home=d:\tomcat4.0 -jvm_
option -Xms64M -jvm_option -Xmx256M -start
org.apache.catalina.startup.BootstrapService -params start -stop
org.apache.catalina.startup.BootstrapService -params stop -out
d:\tomcat4.0\logs\service.out -err d:\tomcat4.0\logs\service.err

- snip --

d:
cd \Tomcat4.0\bin
tomcat -uninstall Apache Tomcat



I'm still looking for the source code of the tomcat.exe and the installation
script. This seems to be a top secret issue since nobody answers my request
either here nor on the dev list Is this one not OPEN SOURCE ??

Thomas



- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 7:31 PM
Subject: RE: Problems with .exe install for NT


 Have you set JAVA_HOME to d:\java\JDK1.4 (assuming that's where your JDK
 is installed)?  Just a thought.

 Dennis

 -Original Message-
 From: jmh.tomcat [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 30, 2002 9:13 AM
 To: tomcat-user
 Subject: Re: Problems with .exe install for NT


 or does anyone have suggestions on how to get around this problem?

 
  From: [EMAIL PROTECTED]
  Date: 2002/01/30 Wed AM 11:10:59 EST
  To: [EMAIL PROTECTED]
  Subject: Problems with .exe install for NT
 
  I can't get my .exe to install on my NT system.  It says that the path
 of the JDK can't be found.  My JDK is under D:\java\JDK1.4.
 
  Is there anyway that an optional argument can be added to the
 installer to allow for a different path for the JDK than the default?
 
  Thanks
 
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 
 


 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]




--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




TOMCAT 4.0.1 and Cookies / URL Rewriting

2002-01-28 Thread Tom Bednarz

Hi,

Is it correct, that session tracking with TOMCAT is only possible if 
Cookies are allowed in the browser. Or is there any configuration 
possibility to use URL rewriting if a browser has cookies disabled?

Thanks,

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: TOMCAT 4.0.1 and Cookies / URL Rewriting

2002-01-28 Thread Tom Bednarz

Hi Mike,

At 28.01.2002 11:05, you wrote:
No, that's not exactly correct. Tomcat performs URL rewriting in its default
configuration. So sessions are not 'only' possible if cookies are enabled.

As a first line of defense, your JSP/servlets should be using the encodeURL
or encodeRedirectURL methods to ensure that any user that has cookies
disabled can use your application.

Ah..., this sems to be the problem. I have proted an older Web Application 
from JRun to Tomcat 4.0.1. When I turned of cookie support in my browser, a 
session was created on TOMCAT but my app allways falls back to the logon 
screen. I'll have a look at the code of my servlets and JSP's.

Many thanks!

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Binary Dist. tomcat 4.01 Win32 can't find jdk on installation

2002-01-28 Thread Tom Bednarz

Michael,

It seems very likely that your environment variables exceed the maximum 
allowed bytes. I am not sure but I think it is 4 or 8 KB. Since changing 
the environment variables (such as path, classpath etc) requires a reboot 
for system variables, many software vendors do not properly uninstall 
software and after a while you have a lot of crap in your path variable. 
Clean it up manually (in Control Panel, System Icon, Advanced Tab, 
Environment Variables Button),  reboot your box and it is most likely that 
your JDK is recognised by TOMCAT.

Thomas


At 28.01.2002 18:46, you wrote:
Why would this happen?

When I try to install jakarta-tomcat-4_0_1.exe on my server I receive this
error message:

Couldn't find a Java Development Kit installed on this computer. Please
download on from http://java.sun.com;

This is strange, because there is a jdk installed (how else could JRun be
running on the server)?

The same happened on my development machine. First I thought, that might be
because I have JDK 1.4.0 on my dev machine. But obviously the reason is
something else.

Can anybody help me?

What is the installation procedure's criteria for a jdk?

Michael Kastner


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Sources for Tomcat 4.0.1 Win32 Service

2002-01-25 Thread Tom Bednarz

Hello Anton,


Name of start class for me is org.apache.catalina.startup.BootstrapService,
it also a stop class too.
Here is me inst.bat for installing Tomcat as a service:
(all at one line)

@tomcat.exe -install Tom C:\jdk1.3\jre\bin\hotspot\jvm.dll
-jvm_option -Djava.class.path=C:\tomcat.402b2\bin\bootstrap.jar
-jvm_option -Dcatalina.home=C:\tomcat.402b2 -start 
org.apache.catalina.startup.BootstrapService
-params start -stop org.apache.catalina.startup.BootstrapService
-params stop -out C:\tomcat.402b2\logs\service.out -err 
C:\tomcat.402b2\logs\service.err


Many thanks for this info. This works for me too.

You still can add -X or -server options but they should be after -jvm_option.

I tried to add -X parameters, but somehow tomcat.exe does not accept my input.

Am I correct in assuming that -X params are jvm params and therefore need 
-jvm_option in front? I tried the following (which does not work):

tomcat.exe -install Apache Tomcat 
C:\JavaSoft\JRE\1.3.1_02\bin\hotspot\jvm.dll -jvm_option 
-Djava.class.path=D:\Tomcat4.0\bin\bootstrap.jar -jvm_option 
-Dcatalina.home=d:\tomcat4.0 -start 
org.apache.catalina.startup.BootstrapService -jvm_option -Xms128M 
-jvm_option -Xmx256M -params start -stop 
org.apache.catalina.startup.BootstrapService -params stop -out 
d:\tomcat4.0\logs\service.out -err d:\tomcat4.0\logs\service.err

I put everything in a batch file all on one line (very readable!! but 
Windoof does not recognise \ as a line continue char like a C 
pre-processor). Do you see whats wrong with my command above?

Thanks again!

Thomas

By the way: I try to subscribe to the dev mailing list to get more 
information about the sources of this tomcat.exe program! If I get any info 
I will post it here.


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: web.xml Question

2002-01-22 Thread Tom Bednarz

OK, I just wanted to know how this works. My development environment is not 
the same as an environment in a large company which usually has a lot of 
restrictions regarding accessing the internet.

I have made a simple test and unplugged the network cable of my 
workstation. TOMCAT still started without a problem. So it seems that the 
DTD's are somehow embedded in the source code.

Thanks for your information.

Thomas

At 22.01.2002 16:44, you wrote:
i think in the same way...
there should be a necessary reason to do so, that we are missing, otherwise
it seems illogical

- Original Message -
From: Nikola Milutinovic [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, January 22, 2002 3:56 PM
Subject: Re: web.xml Question


   Usually the web.xml file of a web application starts with the following:
  
   !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
   2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
  
   This URL referst to the dtd file on SUN's server. I think most XML
parsers
   like SAX need to read the dtd file to be able to parse the XML file.
 
  That would be a big problem. I'm no expert on the mnatter, but since
web-app DTD is something no Servlet container can work without, couldn't the
the container provide it to the parser? That URL is just an identifier,
saying yes, I'm build upon Sun's public DTD for web.xml. So, the container
could tell the parser look, here is that DTD, don't go fetching it.
 
  Maybe it's naive of me, but that's how I would do it. I've been using
Tomcat for some time now and it never complained on web.xml. I'm behind a
firewall and Tomcat is not even aware of that.
 
  Nix.
 



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: How to give tomcat's JVM more heap space ?

2002-01-22 Thread Tom Bednarz

In the catalina.bat or catalina.sh set the variable CATALINA_OPTS

On Windows I would do:

set CATALINA_OPTS=-Xms64M -Xmx256M

to set a minimum of 64 MB and a maximum of 256 MB RAM. You should do this 
at the beginning of the file.

HTH

Thomas

At 22.01.2002 15:50, you wrote:


I have a server for runnig Tomcat 4.0.1, and sometimes it's catalina.out
said printed java.lang.OutOfMemoryError.

And i know from java manual pages, we can set the memory allocation for
JVM with option -Xmsn -Xmxn etc.

The problem is, where we put this option in Tomcat 4.0.1 configuration
file ?

Thank you.



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Tomcat Win32 Service question

2002-01-21 Thread Tom Bednarz

Hi,

I run Tomcat 4.0.1 on a Win2000 box as System Service. Is there any way to 
modify startup parameters? I like to define the memory settings of the VM 
by setting the following options:

-Xms64M -Xmx256M

wich will start Tomcat with a minimum of 64 MB and a maximum of 256 MB RAM.

When starting from the command line I guess modifying the catalina.bat as 
follows would do the job:

set CATALINA_OPTS=-Xms64M -Xmx256M

What do I need to do make this change in the service mode? How is this 
service implemented? Is this a real service using the JNI API? If so where 
can I find the source for this?

Many thanks for your help!

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Tomcat Win32 Service question

2002-01-21 Thread Tom Bednarz

Hello Randy,

My installation has no file called wrapper.properties! Where should this 
file be??

Thomas

At 21.01.2002 13:44, you wrote:

 Open up wrapper.properties, scroll all the way to the bottom of the
file where java.cmdline is defined and insert the arguments as appropriate.
(It should be pretty straight forward)

 Randy

  -Original Message-
  From: Tom Bednarz [mailto:[EMAIL PROTECTED]]
  Sent: Monday, January 21, 2002 3:03 AM
  To: [EMAIL PROTECTED]
  Subject: Tomcat Win32 Service question
 
 
  Hi,
 
  I run Tomcat 4.0.1 on a Win2000 box as System Service. Is
  there any way to
  modify startup parameters? I like to define the memory
  settings of the VM
  by setting the following options:
 
  -Xms64M -Xmx256M
 
  wich will start Tomcat with a minimum of 64 MB and a maximum
  of 256 MB RAM.
 
  When starting from the command line I guess modifying the
  catalina.bat as
  follows would do the job:
 
  set CATALINA_OPTS=-Xms64M -Xmx256M
 
  What do I need to do make this change in the service mode?
  How is this
  service implemented? Is this a real service using the JNI
  API? If so where
  can I find the source for this?
 
  Many thanks for your help!
 
  Thomas
 
 
  --
  To unsubscribe:   mailto:[EMAIL PROTECTED]
  For additional commands: mailto:[EMAIL PROTECTED]
  Troubles with the list: mailto:[EMAIL PROTECTED]
 

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




web.xml Question

2002-01-21 Thread Tom Bednarz

Hi everybody,

Usually the web.xml file of a web application starts with the following:

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

This URL referst to the dtd file on SUN's server. I think most XML parsers 
like SAX need to read the dtd file to be able to parse the XML file.

Questions:

What happens if I deploy an application on an Intranet which allows access 
to the internet only through a proxy server (with username / password 
authentication)? The dtd cannot be accessed and must be someware on the 
local disk.

I found that TOMCAT has a web.xml in its conf directory. Could anybody 
explain me, which XML files I need to change and where do I need to put the 
downloaded web-app_2_3.dtd file?  Is the web.xml in the conf directory like 
a parent to all web.xml files found under webapps\application\WEB-INF? 
(Something like the defaults for all web apps)?

Could anybody help me out of this XML jungle?

Many thanks!

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




JSP Escape character problem - PLEASE HELP

2002-01-10 Thread Tom Bednarz

Hi,

I have a problem that could be a bug somewhere inside the JSP compiler. I have ported 
an application from JRun 3.0 to TOMCAT. The following code inside a JSP causes an 
Exception:

 snip 
SCRIPT LANGUAGE=JavaScript1.2 TYPE=text/javascript
!--
if (isMenu) 
{
% 
if (UserRole.compareTo(Echnaton Administrator) == 0) // 
Administrators with full access
out.print(document.write(\SCRIPT LANGUAGE='JavaScript1.2' 
SRC='/Echnaton/Scripts/hierArrays_Admin.js'\/SCRIPT\););
else if (UserRole.compareTo(Echnaton Technician) == 0) // Technical 
Users
out.print(document.write(\SCRIPT LANGUAGE='JavaScript1.2' 
SRC='/Echnaton/Scripts/hierArrays_Tech.js'\/SCRIPT\););
else
out.print(document.write(\SCRIPT LANGUAGE='JavaScript1.2' 
SRC='/Echnaton/Scripts/hierArrays_User.js'\/SCRIPT\););
%
}
//--
/SCRIPT

 snip 


Jasper reports the following exception:


org.apache.jasper.JasperException: Unable to compile class for JSP

An error occured between lines: 141 and 148 in the jsp file: /Header.jsp

Generated servlet error:
C:\JavaSoft\Tomcat4.0\work\localhost\Echnaton\Header$jsp.java:209: Invalid escape 
character.
out.print(document.write(\SCRIPT 
LANGUAGE='JavaScript1.2' SRC='/Echnaton/Scripts/hierArrays_Admin.js'\/SCRIPT\););


Exactly this code works perfectly fine in JRun! It seems like the parser could not 
handle the escaped quotation mark in the document.write() method. Could anybody help? 
I am currently working with Tomcat 4.0.1. I have downloaded the binaries only (for M$ 
Windows).

Many thanks!!

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JSP Escape character problem - PLEASE HELP

2002-01-10 Thread Tom Bednarz

At 10.01.2002 10:44, you wrote:

The escaped double quotes should be fine.  I would think that it's the escaped
forward slash (in \/SCRIPT), which shouldn't need to be escaped at all.



 


Thats correct! It works fine when removing the '\' character. I don't 
remember why I had put it there. Probably JRun had a bug and required it or 
it is a reserved word for JRun since it has some non standard extensions.

Many thanks Jeff!

Thomas


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]