Other connection may not see updated date immediately

2021-08-09 Thread W
Hi,I have a web application. It is a java-jsp-tomcat-mysql. It is working, but 
sometimes, it is slow. For each data update statement, it is not slow: the next 
jsp page shows promptly. But the next page does not see updated data. I wait a 
coupe seconds, refresh the page, the updated date shows. Each connection is 
from tomcat.DataSource, so I believe each jsp page may use a different database 
connection. So, mysql inside is slow. Anything I can do?
I checked server cpu and memory. Cpu is 20%, memory is lower than 50%.
Everything is running on one server machine, one tomcat, one mysql, runs on 
Ubuntu: 4.15.0-54-generic, Tomcat/9.0.16, mysql: 8.0.21.
Any information would be appreciated. Thanks in advance.



Re: [OT] Other connection may not see updated date immediately

2021-08-11 Thread W
 On Wednesday, August 11, 2021, 07:00:22 AM PDT, Christopher Schultz 
 wrote:


W,
On 8/9/21 12:04, W wrote:>> Hi,I have a web application. It is a 
java-jsp-tomcat-mysql. It is working, but sometimes, it is slow. For each data 
update statement, it is not slow: the next jsp page shows promptly. But the 
next page does not see updated data. I wait a coupe seconds, refresh the page, 
the updated date shows. Each connection is from tomcat.DataSource, so I believe 
each jsp page may use a different database connection. So, mysql inside is 
slow. Anything I can do?>> I checked server cpu and memory. Cpu is 20%, memory 
is lower than 50%.> Everything is running on one server machine, one tomcat, 
one mysql, runs on Ubuntu: 4.15.0-54-generic, Tomcat/9.0.16, mysql: 8.0.21.>> 
Any information would be appreciated. Thanks in advance.
>This is certainly an application issue, so I have marked this thread 
>as>"off-topic". That doesn't mean we can't help.
>Please confirm the following:
>1. An initial request arrives on the server which executes a SQL DML>query, 
>which changes some data in your database. The transaction is>committed. The 
>response is sent to the client.
The query is commited, otherwise I would not see updated data after I refresh 
the next page.
>2. A second request arrives *after the completion of the first request*>and 
>queries the data which was changed in #1 above. The data retrieved>from the 
>database appears to have values which are "old" -- that is, the>value that was 
>expected before #1 above occurred.
Yes.
>Some questions:
>* Are you sure that #2 happens fully after #1? How are you sure?Yes. Otherwise 
>the second page would not appear.
>* Are you absolutely sure you are querying the *same* data from 
>the>database?Yes.
>* Are you absolutely sure that there is no "step 1.5" where the data 
>are>changed *back* to their original values? How are you sure?Yes.
>* What is the "transaction isolation level" of your database>connections? Do 
>you execute your query in #2 within a transaction?I did not set, it should be 
>default. REPEATABLE READ?

I believe, correct me if I am wrong:tomcat.connection.commit() calls 
mysql.connection.commit(), Is it possible thatactually 
operating-system-file-writing not finished when the calls return? or there is a 
delay, or updating query haslower priority, either tomcat or mysql? The 
following connectioncall is a 'select' statement without delay, so 'select' 
statement executed before operating-system-file-writing finished.
It sounds that you did not hear similar issues.
Thanks.
-To 
unsubscribe, e-mail: users-unsubscribe@tomcat.apache.orgFor additional 
commands, e-mail: users-h...@tomcat.apache.org
  

Tomcat 9 can not start on windows 10 as service

2022-02-08 Thread W
Hi,
I install tomcat 9 using downloaded installation package. It was installed 
successfully. I made tomcat manager working. I deployed my application... 
Suddenly, tomcat stopped. Then I try to restart it using windows service. I got 
error 5: access denied. I uninstalled tomcat and re-installed it. The same 
thing happened. 
Now I can go to tomcat\bin directory run startup.bat. It works.
What is wrong? How can I run it automatically using windows service? Please.
Any information would be appreciated. Thanks in advance.

Re: Tomcat 9 can not start on windows 10 as service

2022-02-09 Thread W
 Thank Bill, I downloaded it and run it successfully. But when I modified 
confg/tomcat-users.xml (so I can use manager), Tomcat service stopped. Status 
became disabled. When I tried to restart the service, it told me that the 
service was marked for deletion. So I uninstalled tomcat by using "Add or 
remove program". It went through. But tomcat service is still in Service window 
and I can not remove it.
How to remove it please?Thanks.
On Wednesday, February 9, 2022, 07:03:21 AM PST, Bill Stewart 
 wrote:  
 
 On Tue, Feb 8, 2022 at 9:37 PM W wrote:

Hi,
> I install tomcat 9 using downloaded installation package. It was installed
> successfully. I made tomcat manager working. I deployed my application...
> Suddenly, tomcat stopped. Then I try to restart it using windows service. I
> got error 5: access denied. I uninstalled tomcat and re-installed it. The
> same thing happened.
> Now I can go to tomcat\bin directory run startup.bat. It works.
> What is wrong? How can I run it automatically using windows service?
> Please.
> Any information would be appreciated. Thanks in advance.


For Windows users, I provided an alternative installer that might work
better for you:

https://github.com/Bill-Stewart/ApacheTomcatSetup

It provides a means for specifying which account you want to use to run the
Tomcat service (running as local system is definitely not recommended), and
it also sets file system permissions appropriately.

HTH

Bill
  

Re: AW: Tomcat 9 cannot start on windows 10 as service

2022-02-09 Thread W
 Thank you Thomas,I downloaded procmon from microsoft website, unzipped it, 
tried to run it (as administator), but got error: access was denied.Do you know 
what was wrong? I searched internet, all search result was talking about how to 
use it to solve problems, no onetalk the error of access denied from procmon 
itself.
Thanks.
On Tuesday, February 8, 2022, 10:00:38 PM PST, Thomas Hoffmann (Speed4Trade 
GmbH)  wrote:  
 
 Hello,

you can also use procmon from Microsoft to analyse the access denied message.
You will see which user tries to access which directory and which permission 
was requested and missing.
You need to provide filters to the program in order not getting lost in all the 
messages within procmon.

Greetings,
Thomas

-Ursprüngliche Nachricht-
Von: jonmcalexan...@wellsfargo.com.INVALID 
 
Gesendet: Mittwoch, 9. Februar 2022 06:11
An: users@tomcat.apache.org; w...@yahoo.com
Betreff: RE: Tomcat 9 cannot start on windows 10 as service

> -Original Message-
> From: W 
> Sent: Tuesday, February 8, 2022 10:36 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 9 can not start on windows 10 as service
> 
> Hi,
> I install tomcat 9 using downloaded installation package. It was 
> installed successfully. I made tomcat manager working. I deployed my 
> application...
> Suddenly, tomcat stopped. Then I try to restart it using windows 
> service. I got error 5: access denied. I uninstalled tomcat and 
> re-installed it. The same thing happened. Now I can go to tomcat\bin 
> directory run startup.bat. It works.
> What is wrong? How can I run it automatically using windows service? Please.
> Any information would be appreciated. Thanks in advance.

Hi W,

Kindly check which user is setup to run the Tomcat Service and make sure that 
that user has at least read/execute permissions to your CATALINA_HOME and 
CATALINA_BASE directory structures. (Note, this may be the same location 
depending on how you have configured Tomcat.) More than likely it's the Local 
System account.

You will want to make sure that at least the webapps, work, temp, and logs 
directory have Modify permissions at a minimum for that user.

Hope this helps,

B CB [  X  
ܚX KK[XZ[
 \ \  ][  X  ܚX P X ]
 \X K ܙ B  ܈Y][ۘ[  [X[ K[XZ[
 \ \  Z[ X ]
 \X K ܙ B 

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

  

Re: Tomcat 9 cannot start on windows 10 as service

2022-02-09 Thread W
 Thanks for your reply.This is a laptop, not many users. I checked tomcat 
installed directory, all users have full access to that directory and 
subdirectories.I also changed the owner of that directory/subdirectory from 
admin to me. I still get "access denied" when I run tomcat service.
Thanks.
On Tuesday, February 8, 2022, 09:10:47 PM PST, 
jonmcalexan...@wellsfargo.com.INVALID  
wrote:  
 
 > -Original Message-----
> From: W 
> Sent: Tuesday, February 8, 2022 10:36 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 9 can not start on windows 10 as service
> 
> Hi,
> I install tomcat 9 using downloaded installation package. It was installed
> successfully. I made tomcat manager working. I deployed my application...
> Suddenly, tomcat stopped. Then I try to restart it using windows service. I 
> got
> error 5: access denied. I uninstalled tomcat and re-installed it. The same 
> thing
> happened. Now I can go to tomcat\bin directory run startup.bat. It works.
> What is wrong? How can I run it automatically using windows service? Please.
> Any information would be appreciated. Thanks in advance.

Hi W,

Kindly check which user is setup to run the Tomcat Service and make sure that 
that user has at least read/execute permissions to your CATALINA_HOME and 
CATALINA_BASE directory structures. (Note, this may be the same location 
depending on how you have configured Tomcat.) More than likely it's the Local 
System account.

You will want to make sure that at least the webapps, work, temp, and logs 
directory have Modify permissions at a minimum for that user.

Hope this helps,


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

  

Re: AW: AW: Tomcat 9 cannot start on windows 10 as service

2022-02-09 Thread W
 Hi everyone,
I cleaned up my laptop and reboot it. .I use tomcat installation package from 
apache, I did not do anything extra. everything is okay now.It looks that there 
some corrupted files
Thanks.

On Wednesday, February 9, 2022, 12:15:04 PM PST, Thomas Hoffmann 
(Speed4Trade GmbH)  wrote:  
 
 Hello,

if it runs with service.bat, can you configure the service to use the same 
account?
Just to compare if the service runs with the same credentials.

Is the service currently running under system account?

Greetings,
Thomas


-Ursprüngliche Nachricht-
Von: Orendt, John  
Gesendet: Mittwoch, 9. Februar 2022 20:51
An: Tomcat Users List 
Betreff: RE: AW: Tomcat 9 cannot start on windows 10 as service

Hi

I used service.bat with Tomcat 9 & 10. Works well when run as admin

John Orendt
john.p.ore...@medtronic.com

-Original Message-
From: Thomas Hoffmann (Speed4Trade GmbH) 

Sent: Wednesday, February 9, 2022 12:58 PM
To: Tomcat Users List ; W 
Subject: AW: AW: Tomcat 9 cannot start on windows 10 as service

Hello,

it seems you have a quite rare configuration of your windows system if even 
procmon is not running.
It sounds like the issue might not be Tomcat related.
Is any group policy, like Software Restriction Policies in place in your 
company?

Greetings,
Thomas

-Ursprüngliche Nachricht-
Von: W 
Gesendet: Mittwoch, 9. Februar 2022 18:51
An: Tomcat Users List 
Betreff: Re: AW: Tomcat 9 cannot start on windows 10 as service

 Thank you Thomas,I downloaded procmon from microsoft website, unzipped it, 
tried to run it (as administator), but got error: access was denied.Do you know 
what was wrong? I searched internet, all search result was talking about how to 
use it to solve problems, no onetalk the error of access denied from procmon 
itself.
Thanks.
    On Tuesday, February 8, 2022, 10:00:38 PM PST, Thomas Hoffmann (Speed4Trade 
GmbH)  wrote:

 Hello,

you can also use procmon from Microsoft to analyse the access denied message.
You will see which user tries to access which directory and which permission 
was requested and missing.
You need to provide filters to the program in order not getting lost in all the 
messages within procmon.

Greetings,
Thomas

-Ursprüngliche Nachricht-
Von: jonmcalexan...@wellsfargo.com.INVALID 

Gesendet: Mittwoch, 9. Februar 2022 06:11
An: users@tomcat.apache.org; w...@yahoo.com
Betreff: RE: Tomcat 9 cannot start on windows 10 as service

> -Original Message-
> From: W 
> Sent: Tuesday, February 8, 2022 10:36 PM
> To: users@tomcat.apache.org
> Subject: Tomcat 9 can not start on windows 10 as service
>
> Hi,
> I install tomcat 9 using downloaded installation package. It was 
> installed successfully. I made tomcat manager working. I deployed my 
> application...
> Suddenly, tomcat stopped. Then I try to restart it using windows 
> service. I got error 5: access denied. I uninstalled tomcat and 
> re-installed it. The same thing happened. Now I can go to tomcat\bin 
> directory run startup.bat. It works.
> What is wrong? How can I run it automatically using windows service? Please.
> Any information would be appreciated. Thanks in advance.

Hi W,

Kindly check which user is setup to run the Tomcat Service and make sure that 
that user has at least read/execute permissions to your CATALINA_HOME and 
CATALINA_BASE directory structures. (Note, this may be the same location 
depending on how you have configured Tomcat.) More than likely it's the Local 
System account.

You will want to make sure that at least the webapps, work, temp, and logs 
directory have Modify permissions at a minimum for that user.

Hope this helps,

B CB [  X  
ܚX KK[XZ[  \ \  ][  X  ܚX P X ]  \X K ܙ B  ܈Y][ۘ[  [X[ K[XZ[  \ \  Z[ X ]  \X K 
ܙ B

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


[CONFIDENTIALITY AND PRIVACY NOTICE] Information transmitted by this email is 
proprietary to Medtronic and is intended for use only by the individual or 
entity to which it is addressed, and may contain information that is private, 
privileged, confidential or exempt from disclosure under applicable law. If you 
are not the intended recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly prohibited. In such cases, please 
delete this mail from your records. To view this notice in other languages you 
can either select the following link or manually copy and paste the link into 
the address bar of a web browser: http://emaildisclaimer.medtronic.com

-
To unsubscribe, e-mail: users-unsubscr...@t

Ho to upgrade to newest version in tomcat 9

2021-07-27 Thread W
Hi,
I am on Ubuntu with tomcat 9.0.16I tried    sudo apt-get update    sudo apt-get 
upgradeBut did not work. How to do it?
Any information would be appreciated. Thanks in advance..



migrate to tomcat 9: application can not write files on system filder

2019-07-01 Thread W
Hi,I am migrate from ubuntu 16.04 (server), mysql 5.7 and tomcat 8 to ubuntu 
18.04(server), mysql 8 and tomcat 9.
My application works on old system. Now when my application tries to write a 
file on
a directory (permission allowed), there is an 
error:java.nio.file.FileSystemException: /photoLogos/PERSON/-_~x: Read-only 
file system
Exception: java.nio.file.FileSystemException: /photoLogos/PERSON/-_~x: 
Read-only file system
java.nio.file.FileSystemException: /photoLogos/PERSON/-_~x: Read-only file 
system
 at 
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
 at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
 at 
java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
 at java.base/sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:248)
 at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:493)
 at 
java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:263)
 at java.base/java.nio.file.Files.move(Files.java:1421)I can ssh to the server, 
manually write/read files on that directory. The directory
is set (for debug) as every one can write/read. So I belief that the error is 
due to settings
of tomcat 9.I need help. Any information would be appreciated. Thanks in 
advance.
Wayne


Re: migrate to tomcat 9: application can not write files on system filder

2019-07-01 Thread W
 Thanks for all people who replied to my question. I took Emmanuel Bourg's 
advice that did the trick. It works!

On Monday, July 1, 2019, 02:53:11 PM PDT, Emmanuel Bourg 
 wrote:  
 
 Le 01/07/2019 à 19:55, W a écrit :
> Hi,I am migrate from ubuntu 16.04 (server), mysql 5.7 and tomcat 8 to ubuntu 
> 18.04(server), mysql 8 and tomcat 9.
> My application works on old system. Now when my application tries to write a 
> file on
> a directory (permission allowed), there is an 
> error:java.nio.file.FileSystemException: /photoLogos/PERSON/-_~x: Read-only 
> file system

The tomcat9 package on Debian/Ubuntu uses systemd and leverages its
sandboxing feature to limit the write access to the conf, log, work and
webapps directories by default. If you look at the package's README file
(/usr/share/doc/tomcat9/README.Debian) you'll find the instructions to
grant Tomcat write access to other directories:

https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian

  If write access to other directories is required the service settings
  have to be overridden. This is done by creating an override.conf file
  in /etc/systemd/system/tomcat9.service.d/ containing:

    [Service]
    ReadWritePaths=/path/to/the/directory/

  The service has to be restarted afterward with:

    systemctl daemon-reload
    systemctl restart tomcat9

Emmanuel Bourg

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

  

Tomcat starts very slow

2019-07-02 Thread W
 Hi,I have Tomcat 9 on Ubuntu 18.04. Tomcat stars very slow, sometimes 15 
minute.
I checked catalina.2019-xxx.log and found some issues below.
What should I do?
Any information would be appreciated. Thanks in advance.
02-Jul-2019 03:07:25.360 WARNING [main] 
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of 
SecureRandom instance for session ID generation using [SHA1PRNG] took [570,408] 
milliseconds.

02-Jul-2019 03:07:28.676 INFO [main] org.apache.catalina.startup.Catalina.start 
Server startup in [576,742] milliseconds


  

Re: Tomcat starts very slow

2019-07-03 Thread W
 Thanks  Emmanuel.
The document you pointed is very good. It solved my problem. 
For the people who are facing similar issues, I would like to tell my 
experience.First I tried list jars which do not need to scan. The situation did 
not improve much (maybe my app is small). Then I tried entropy. It 
significantly improved. Problem solved.
On Tuesday, July 2, 2019, 04:33:31 PM PDT, Emmanuel Bourg 
 wrote:  
 
 Le 03/07/2019 à 01:23, W a écrit :
>  Hi,I have Tomcat 9 on Ubuntu 18.04. Tomcat stars very slow, sometimes 15 
>minute.
> I checked catalina.2019-xxx.log and found some issues below.
> What should I do?
> Any information would be appreciated. Thanks in advance.

Your server lacks entropy, see:

https://cwiki.apache.org/confluence/display/TOMCAT/HowTo+FasterStartUp#HowToFasterStartUp-EntropySource

Emmanuel Bourg

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

  

How to find war file name programmatically?

2019-08-12 Thread W
Hi,
I would like to find the war file name (for example, 
ROOT##2019-08-12-10-44.war) inside  ServletContextListener.contextInitialized() 
and ServletContextListener.contextDestroyed(). So I can send email to admins 
warn them which app is up and down. 
Is there a way to do it?
Any information would be appreciated. Thanks in advance. 

Re: How to find war file name programmatically?

2019-08-17 Thread W
 ServletContext.getRealPath("/") works for me.Thanks.
On Tuesday, August 13, 2019, 01:43:35 AM PDT, Mark Thomas 
 wrote:  
 
 On 12/08/2019 23:18, W wrote:
> Hi,
> I would like to find the war file name (for example, 
> ROOT##2019-08-12-10-44.war) inside  
> ServletContextListener.contextInitialized() and 
> ServletContextListener.contextDestroyed(). So I can send email to admins warn 
> them which app is up and down. 
> Is there a way to do it?

It isn't guaranteed to work in all circumstances but try:

ServletContext.getRealPath("/")

If that doesn't work then - assuming you can use reflection - something
along these lines:

Obtain the ServletConext.
Cast it to org.apache.catalina.core.ApplicationContext

Use reflection to read the context field or call getContext() which will
return a StandardContext instance.

Then you have various options:
- call getDocbase()
- call getPath() and getWebappVersion()

and there are probably plenty of other similar approaches that would work.

Mark

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

  

Re: Tomcat Service(s) on Windows, Procmon question

2024-11-07 Thread david w




Sent: Thursday, November 7, 2024 8:53 PM
To: Tomcat Users List 
Subject: RE: Tomcat Service(s) on Windows, Procmon question

Sorry to top-reply, but does this regression exist in 10.1.31 as well, or only 
9.0.96?

From: Christopher Schultz 
Sent: Thursday, November 7, 2024 1:16 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat Service(s) on Windows, Procmon question

Jon, On 11/7/24 13: 08, Mcalexander, Jon J. wrote: > Happy Thursday everybody, 
> > I have a question around starting a Tomcat Service Instance on Windows 
servers. Is there a way to have the Tomcat Startup kick off a script before 
starting


Jon,



On 11/7/24 13:08, Mcalexander, Jon J. wrote:

> Happy Thursday everybody,

>

> I have a question around starting a Tomcat Service Instance on Windows 
> servers. Is there a way to have the Tomcat Startup kick off a script before 
> starting that will clear the contents of the workDir (Clear the cache so to 
> say)?

>

> We have run into some issues after upgrading our binaries to Tomcat 9.0.96 
> where applications start throwing some unknown method errors when starting. 
> The fix for this was to clear the workDir contents before startup and let 
> Tomcat do it's recompile steps. Note, the app didn't change, but the binaries 
> did.



Please note that there is a regression in 9.0.96 that you need to be

aware of that affects JSPs. It will affect you, since you are reporting

(a) missing method errors and (b) you want to clear your work directory,

presumably to remove .jsp -> .java -> .class files to trigger

recompilation of all of those.



I would pause and NOT deploy 9.0.96 because recompilation will stop the

app from throwing those missing-method errors, but some tags might

actually not behave properly.



> We separate our CATALINA_HOME from our CATALINA_BASE, so app teams just need 
> to restart their instance after the upgrade.

>

> Doing this in Linux/Unix/MAC, is easier as we can do this with the setenv.sh 
> script or in the startup or shutdown scripts. However Windows is more 
> difficult as the instance runs as a service.

>

> Any help here would be much appreciated.



As to your question about procrun running a script before it launches

Tomcat, I think the short answer is "no" but I do have an idea for you.



Create a new service called Tomcat-cleanup, make it a simply BAT/PS

script that cleans-out that directory, and make it a startup dependency

of the real Tomcat service.



-chris





You can also create a scheduled task that starts every time a Windows service 
starts and this task could run your script for you.
this script would require possibly administrator rights in order to actually 
perform any file operations that your script would need to do, but this is your 
call and it wouldn’t compromise the tomcat service or service account so could 
be an alternative.
David

-

To unsubscribe, e-mail: 
users-unsubscr...@tomcat.apache.org

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




Tomcat on Windows : new keystore possibilities

2024-04-08 Thread david w
Hello
Referring to the documentation on Apache Tomcat 9 Configuration Reference 
(9.0.87) - The HTTP 
Connector
 keystore types, i wanted to get mentioned that a new set of possibilities is 
available with newer java builds, when using Tomcat in a Windows environment.


As mentioned on the OpenJDK bug tracker: 
https://bugs.openjdk.org/browse/JDK-8286790


The Windows KeyStore support in the SunMSCAPI provider has been expanded to 
include access to the local machine location. The new keystore types are:



Windows-MY-LOCALMACHINE

Windows-ROOT-LOCALMACHINE



The following keystore types were also added, allowing developers to make it 
clear they map to the current user:

 Windows-MY-CURRENTUSER (same as "Windows-MY")

Windows-ROOT-CURRENTUSER (same as "Windows-ROOT")


Alongside other configurations possible on the server side, web certificates 
can be automatically published, renewed and managed with a company's internal 
Active Directory CA. The account running the Tomcat Windows Service needs local 
Administrator rights to be able to refernce these certificate stores.

With this enabled, and setting the server.xml Connector like shown below can 
make certificate management a lot easier.



the use of a predefined Environment Variable for the system name, possible when 
using also this setting  in catalina.properties:
#GPO Managed restricted file: TESTING
#allow_System ENVVar Usage
org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.util.digester.Digester$EnvironmentPropertySource

 makes it easier to maintain a common server.xml file through tools like GPO.

Could it be useful to somehow document this, as it does make our WIndows admin 
life easier!!


Re: Tomcat on Windows : new keystore possibilities

2024-04-08 Thread david w
If you can share a way for this to not be necessary, I'm all ears...😁

David Wooffindin

From: Bill Stewart 
Sent: Monday, April 8, 2024 4:22:37 PM
To: Tomcat Users List 
Subject: Re: Tomcat on Windows : new keystore possibilities

On Mon, Apr 8, 2024 at 3:49 AM david w wrote:

The account running the Tomcat Windows Service needs local Administrator
> rights to be able to refernce these certificate stores.
>

Fortunately, this statement is not correct.

I would definitely not recommend running the Tomcat service using a
privileged account.

Bill


Re: Tomcat on Windows : new keystore possibilities

2024-04-08 Thread david w
I understand, but am not looking for troubleshooting but trying to raise 
awareness of the new sunmscapi capabilities.
I'm testing using the private key in the windows machine store to simplify tls 
implementation.
For this it requires local admin rights but I am also looking how to not need 
this...

David Wooffindin

From: Bill Stewart 
Sent: Monday, April 8, 2024 5:36:47 PM
To: Tomcat Users List 
Subject: Re: Tomcat on Windows : new keystore possibilities

On Mon, Apr 8, 2024 at 8:27 AM david w wrote:

If you can share a way for this to not be necessary, I'm all ears...
>

I can read computer certificates from non-privileged accounts on Windows.
(How would a user application such as a browser work otherwise?)

I'm not sure what's different on your system or why you think a privileged
account is required.

In any case, this would not be a Tomcat-specific issue but rather some kind
of configuration issue. (What I am saying is that troubleshooting this
issue on your machine is really outside the scope of this specific mailing
list.)

I would repeat my recommendation not to run a web server of any kind
(Tomcat or otherwise) using a privileged account.

Bill


Re: How to configure Tomcat with a Managed Service Account when using LocalMachine certificates for TLS

2024-06-25 Thread david w
I've had the same experience, but with a regular AD service account, not an MSA.
The account needs to have local administrator rights for the certificate to be 
found and used; setting ACL on the keystores is not enough.


David

From: Gavioto 🕵 
Sent: Tuesday, June 25, 2024 3:27:12 PM
To: users@tomcat.apache.org 
Subject: RE: How to configure Tomcat with a Managed Service Account when using 
LocalMachine certificates for TLS

- how are are starting Tomcat?
  Tomcat is starting as a service with "Domain\account1$" (Managed Service 
Account)

- is Tomcat installed as a Windows service?
  Yes

- which account is Tomcat running under?
  "Domain\account1$" (Managed Service Account) It is not a normal domain 
account used for the service.  Secure group managed service accounts - 
Microsoft Entra | Microsoft 
Learn

Regarding the mean of "user" I'm referring to the user who is running the 
Tomcat Service. In this case, the Managed Service Account.


De: Mark Thomas 
Enviado: martes, 25 de junio de 2024 12:51
Para: users@tomcat.apache.org 
Asunto: Re: How to configure Tomcat with a Managed Service Account when using 
LocalMachine certificates for TLS

A few questions:

- how are are starting Tomcat?

- is Tomcat installed as a Windows service?

- which account is Tomcat running under?

There are a few references to "user" in your question. It is not clear
if this is:
- the user administering a Tomcat service
- a user that is starting Tomcat from the command line
- the user that the Tomcat service is running as
- something else

Mark


On 25/06/2024 11:30, Alberto Corral wrote:
> Hello!
>
> After some research, docs, and test, I didn't found an answer to my issue.
>
> I'm writing to the list  because I have to configure a probably not very 
> common Tomcat configuration and didn't found correct configuration of if it 
> is posible to do it.
> Also I didn't find previous information or examples on internet and the wiki.
>
> There is a similar question in Server Fault 
> https://serverfault.com/questions/1161457/can-i-use-certificates-in-the-local-machine-from-a-managed-service-account,
>  but not solved yet.
>
> The configuration has been also involved with a JDK recent bug-fix (but 10 
> years old), but this part is fixed using latest available JDK versions.
> So I think it would be valuable to document an Use Case based on real 
> experience that can be both, tested in future versions, and also useful for 
> future users, available in the wiki or official docs :-)
>
> May be what's I'm trying to do is not really possible, but need to know if 
> this is a Tomcat limitation or a Windows one.
>
> My actual configuration
>
> Server version name:   Apache Tomcat/9.0.65
> Server version number: 9.0.65.0
> Server built:  Jul 14 2022 12:28:53 UTC
> Architecture:  amd64
> OS Version:10.0
> OS Name:   Windows Server 2019
> JVM Vendor:Eclipse Adoptium
> JVM Version:   11.0.23+9
> Java Home: 
> C:\OpenJDK11U-jdk_x64_windows_hotspot_11.0.23_9\jdk-11.0.23+9
>
> Actual secure configuration used:
>
>  server="Unknown"
> maxThreads="150" scheme="https" secure="true"
>   enableLookups="true"
>   KeystoreType="Windows-MY-LOCALMACHINE"
> clientAuth="false" sslProtocol="TLS"
> KeystoreFile=""
> KeyAlias="tomcat" />
>
>
> Configuration:
> - The certificate is in the LOCALMACHINE Windows Storage and allows read 
> access to the user "account1$" which is an AD Managed Service Account.
> -
>
> Facts:
> - If the user have read access but not local admin, then the previous stack 
> trace is generated.
> - If I give local Admin rights to the service account, it seems can access to 
> the Certificate Storage, in other case, the previous Stack Trace is generated.
> - Unless I gave local Admin rights, apache opens port 8443, but doesn't 
> respond to requests on 8443 when testing and no error in logs appears.
>
> What is the question is "How to configure Tomcat with a Managed Service 
> Account when using LocalMachine certificates for TLS"
>
> Notes:
> - JDK 11.0.20+ is required due a well known bug that has been backported from 
> JDK 21  [JDK-6782021] It is not possible to read local computer certificates 
> with the SunMSCAPI provider - Java Bug System 
> (openjdk.org) 
> (https://bugs.openjdk.org/browse/JDK-6782021) and [JDK-8303520] It is not 
> possible to read local computer certificates with the SunMSCAPI provider - 
> Java Bug System (openjdk.org) 
> (https://bugs.openjdk.org/browse/JDK-8303520)
>
> Next program can help to check different configurations, and it works when 
> the certificate has read permission for the user who is running it.
>
> // JDK8313367test.java - Simple test case to demonstrate OpenJDK defect 
> JDK-8313367
> //

issue

2024-09-08 Thread Lucas W
(Tomcat v 11.0.0, java v 22.0.2)

Hi,

System.out.println(..) works just after tomcat startup to
catalina.out. But at some point later on, souts fail to be logged to
catalina.out or anywhere. I am also experiencing something weird with
File.mkdirs(..); I have it in two different static functions in a
utility class, but it only works in one of them (I would give you some
sort of exception, but it seems exceptions arent logged to
catalina.out either, after the same point where sout stops working).

I will note that *sometimes* I get the following SEVEREs in
catalina.out on tomcat startup/deploy of my webapp:

SEVERE [Catalina-utility-2]
org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing
docBase for context [] - java.util.zip.ZipException: zip END header
not found
SEVERE [Catalina-utility-2]
org.apache.catalina.startup.HostConfig.deployWAR Error deploying web
application archive
[/home/user/apache-tomcat-11.0.0-M24/webapps/ROOT.war] -
java.lang.IllegalStateException: Error starting child

(I am using maven with the build plugin maven-war-plugin to build the
war; this is the only maven build plugin I have) but otherwise, my
webapp runs smooth.

Any obvious potential causes?

Thanks

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



How to measure queueing time: from tomcat recieving request to axis web service

2005-10-25 Thread Pim W.
Hi,

I want to measure the queueing time starting from when Tomcat recieve the
request from a client until the request reach my process.
I am writing a web service application hosted under axis engine.
I want to
- Get the time stamp when the request arrive at Tomcat

And I then want to find the distance between the timestamp when Tomcat
recieves the request and the time stamp when my web service starts working.
But I dont know where or how should I modify tomcat to get the time stamp
when the request comes.
I tried to read the architecture of Tomcat but I dont really understand
where the request arrives.

I'm not sure if I should post this in user mailing list or developer mailing
list.
Can somebody please point me the way?


Hiding JSP Pages

2008-06-13 Thread W Strater
I am trying to hide the JSP so they can only be accessed via a forward. I have 
been able to put them in a subdirectory of WEB-INF using other containers but 
have not been able to do that with Tomcat 5.5.

We are not using Struts but it is the same approach where our business
logic is servlet/action based and we only use JSP for presentation.

A common practice would be to put the JSP page in the root directory of the WAR 
like following:

/HelloWorld.jsp
/WEB-INF/web.xml
/WEB-INF/classes/HelloWorld.class

This would allow the user to access the JSP page through the servlet with 
http://localhost:8080/app/HelloWorld or directly with 
http://localhost:8080/app/HelloWorld.jsp.

I want to use to only be able to access the JSP page through the servlet and 
the directory of the WAR would like the following:

/WEB-INF/web.xml
/WEB-INF/classes/HelloWorld.class
/WEB-INF/jsp/HelloWorld.jsp

The HelloWorld servlet would use the JSP for presentation by forwarding to it 
using code like the fllowing:

RequestDispatcher dispatcher = request.getRequestDispatcher("
/WEB-INF/jsp/HelloWorld.jsp");

I get the following errors:

09:22:57,253 [[/app].log 636] INFO  - Marking servlet 
org.apache.catalina.INVOKER.WEB-INF as unavailable
09:22:57,269 [[/app].log 665] ERROR - Error loading WebappClassLoader
  delegate: false
  repositories:
/WEB-INF/classes/
--> Parent Classloader:
[EMAIL PROTECTED]
 WEB-INF
java.lang.ClassNotFoundException: WEB-INF
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1027)
at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
at 
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
at 
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)

09:22:57,269 [[/app].log 665] ERROR - invoker: Cannot allocate servlet instance 
for path /app/WEB-INF/jsp/HelloWorld.jsp
javax.servlet.ServletException: Wrapper cannot find servlet class WEB-INF or a 
class it depends on
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1035)
at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:750)
at 
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
at 
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
... 

Most of the discussions I have read are either old or pertaining to securing 
them via authentication/authorization but I do not want a user to be able to 
enter a URL containing a JSP page under any conditions. 

Any suggestions on how I can hide my JSP pages? 

Thanks,
Wes.


Virtual Hosts or Multiple Instances

2007-11-14 Thread D W
Hi all,

I run multiple servers, and have experimented with both virtual hosting
within in a single server.xml and CATALINA, and have also tried setting up
separate Tomcat instances each with their own CATALINA_BASE.

Both have worked in my experiments.

Does anybody have an opinion as to which approach is better?

Resource-wise?

Management-wise?

I can see pros and cons to both, but am curious what veterans think.

Thanks,
DW


Invoker Not Invoking in 5.5.9

2007-07-26 Thread W Strater
I know that the servlet invoker is not popular but that is what I have to deal 
with.

All of the servlets are invoked as 
http://localhost:8080/servlets/com.domain.servlets.ServletName where the 
/servlets is the web app name.

I would like to acheive to things.

1) Ensure that only servlets within a package get invoked.
2) Provide a catch all servlet.

Here are my servlet mappings:




invoker

/com.domain.servlets.*









catchAll

/*






The problem is that the catchAll is getting every request despite being defined 
after the invoker. I have even defined a new servlet name, , with the 
invoker class, org.apache.catalina.servlets.InvokerServlet, still the catchAll 
gets all requests.

Any suggestions?


Wes.



Single WAR to update multiple contexts

2009-01-07 Thread Sean W

Greetings!

I have a single war packaged application that needs to have about 200 unique
context paths running (200 copies of the application running - each uses a
different database based on the context name).

I know how to deploy 1 context at a time, but how can I do this so that if I
want to update all these contexts to the "next version", I can update them
all at the same time easily?

Any suggests are much appreciated. Thanks!
-Sean W



-- 
View this message in context: 
http://www.nabble.com/Single-WAR-to-update-multiple-contexts-tp21338593p21338593.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Single WAR to update multiple contexts

2009-01-08 Thread Sean W

Using a single webapp sounds like a nice idea, and hopefully feasible, I will
look into this more since I think that solution would be the most efficient.
However, the reason why this would be difficult is:

I am using Apache Wicket's WicketServlet, which is mapped to a single Wicket
Application class. The Application class initializes many in-memory
variables that depend on which database it is initialized with. Recall the
database loaded depends on the context name.

I could try to create multiple WicketServlets within a single web-app, but I
rather avoid hard-coding the "list of 200 sites" into the WAR. Ideally using
the 1 web-app method I'd like to create a filter that will make:

"/ctx1/wicket/homepage" construct the wicket application using a config file
called ctx1 and 
"/ctx2/wicket/homepage" construct the wicket application using a config file
called ctx2 (if it exists) etc...

That way I'd only have to add/remove config files that contain database
connection info to add/remove "sites".

I will try to see if I can bend the functionality of WicketServlet to do
this. I'm not sure I can easily. Thanks!



Alan Chaney wrote:
> 
> Wouldn't it be easier to have ONE webapp and determine the database 
> from, for example, the URL its invoked with?
> 
> Its a little difficult to know exactly how you are doing things but 
> instead of having /ctx1 /ctx2 /ctx3 and mapping each one to ctx1.war
> why not have a filter in your setup which determines that its invoked 
> with /ctx1 and passes a parameter to the actual servlet which selects 
> the database you require? You could have one web app as ROOT and do it
> that way.
> 
> Maybe you could explain further why you need 200 separate versions where 
> the only difference is the name of the database?
> 

-- 
View this message in context: 
http://www.nabble.com/Single-WAR-to-update-multiple-contexts-tp21338593p21353649.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Is it possible to delay HTTP port opening?

2009-01-18 Thread Jesper W
At server startup, is it possible to configure tomcat to not open it's 
http ports so early?


By default the server starts to receive http requests quite long before 
initialization is complete. These requests are held open until the 
server is ready to respond, and then the response is sent.


In my case this behavior is not desirable, I would like the server to be 
fully ready and warmed up before the http port is actually opened for 
requests.


The reason is the server is part of a load balanced pool, and if the 
load balancer detects a just-started server too early, users will 
experience unacceptably long response times.


Cheers,
/j

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



Re: Is it possible to delay HTTP port opening?

2009-01-18 Thread Jesper W

Mladen Turk wrote:

Jesper W wrote:
At server startup, is it possible to configure tomcat to not open 
it's http ports so early?



No mater when you initialize the http port there will be always
some potential initial startup period depending on you application,
so this is completely useless.
Thanks for your kind words. However I would consider improving the 
situation totally useful, even if it doesn't solve it to 100.0%.


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



Re: Symlinks inside WEB-INF/classes not working for me

2009-07-13 Thread John W
> Tomcat 6.0.16
> Linux 2.6.18
> JDK 1.6.0_05
>
> Imagine a webapp like this:
> /index.jsp
> /WEB-INF
> -web.xml (of course)
> -/classes
> --ConfigFile.txt
> -/lib
> --MyConfigLoader.class

... and imagine that .class file is inside a .jar file :) Sorry about that.

John





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



Re: Symlinks inside WEB-INF/classes not working for me

2009-07-14 Thread John W
> Again, wrong. allowLinking applies to any web-app resources. Only internal
> Tomcat file access (bin, lib, logs etc) goes directly to the file system.

And for what it's worth, allowLinking appears to have fixed it :)

It manifested itself really silently and I didn't see anything about it in
WebAppClassLoader.java so it never occurred to me it was possibly
configurable. Now I can see the DirContext object that's used in there and
everything makes sense.

Thanks!

John


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



trouble starting tomcat: "error 0" on Windows 64bit

2009-05-15 Thread w...@serensoft.com
We're having a heck of a time getting tomcat running on windows server
2003 enterprise x64 -- it barely gets started, and instantly quits. We
installed java from jdk-1_5_0_18-windows-amd64.exe  which seems to be
the only 64-bit version available? Our processor is intel, tho... Is
there an intel-not-amd version we missed?


All we get is "error 0x0"...?

This is on Windows Server 2003 R2 Enterprise x64 (SP2) -- Yes, this is
a 64-bit machine

Tried tomcat from both apache-tomcat-5.5.27.exe installer and from straight ZIP

Java is 1.5.0_18

Java has no spaces in its path: C:\Java\jdk1.5.0_18 (from
jdk-1_5_0_18-windows-amd64.exe installer)

No port conflicts (we're asking for port 80 instead of 8080) according
to netstat -an


yes, we're listening on port 80 instead of 8080 (via server.xml);
Tomcat has no spaces in its path: C:\Tomcat55

Executing "tomcat5.exe" from the command line shows only a blank line,
then the command prompt pops up again (no text-to-console logged).

Executing "startup.bat" shows
Using CATALINA_BASE:   C:\Tomcat55
Using CATALINA_HOME:   C:\Tomcat55
Using CATALINA_TMPDIR: C:\Tomcat55\temp
Using JRE_HOME:C:\Java\jdk1.5.0_18

We've tried running it as a service (setting it up via 'service.bat'), too:

The start>admin>componentServices>event viewer shows only:
"""
The Apache Tomcat service terminated with service-specific error 0 (0x0).

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
"""

C:\Tomcat55\logs>type jakarta_service_20090515.log
[2009-05-15 15:03:59] [info] Procrun (2.0.4.0) started
[2009-05-15 15:03:59] [info] Service sakai name Apache Tomcat sakai
[2009-05-15 15:04:00] [info] Service sakai installed
[2009-05-15 15:04:00] [info] Procrun finished.
[2009-05-15 15:04:00] [info] Procrun (2.0.4.0) started
[2009-05-15 15:04:00] [info] Updating service...
[2009-05-15 15:04:00] [info] Service sakai updated
[2009-05-15 15:04:00] [info] Update service finished.
[2009-05-15 15:04:00] [info] Procrun finished.
[2009-05-15 15:04:00] [info] Procrun (2.0.4.0) started
[2009-05-15 15:04:00] [info] Updating service...
[2009-05-15 15:04:00] [info] Service sakai updated
[2009-05-15 15:04:00] [info] Update service finished.
[2009-05-15 15:04:00] [info] Procrun finished.
[2009-05-15 15:05:19] [info] Procrun (2.0.4.0) started
[2009-05-15 15:05:19] [info] Running Service...
[2009-05-15 15:05:19] [info] Starting service...
[2009-05-15 15:05:19] [174  javajni.c] [error] %1 is not a valid Win32
application.
[2009-05-15 15:05:19] [994  prunsrv.c] [error] Failed creating java
C:\Java\jdk1.5.0_18\jre\bin\server\jvm.dll
[2009-05-15 15:05:19] [1269 prunsrv.c] [error] ServiceStart returned 1
[2009-05-15 15:05:19] [info] Run service finished.
[2009-05-15 15:05:19] [info] Procrun finished.

Both stderr and stdout logs are empty.

We did find a thread online that recommended "copy the file
msvcr71.dll from the bin dir of your java installation, to the bin dir
of the tomcat installation." Of course, we don't have a msvcr71 (tho
we did find a msvcrt.dll which didn't do the trick.)

Any pointers would be great!


-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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



Re: trouble starting tomcat: "error 0" on Windows 64bit

2009-05-16 Thread w...@serensoft.com
On Sat, May 16, 2009 at 9:15 AM, Martin Gainty  wrote:
> Will-
>
> uninstall current java
> uninstall current jre
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6747473

We're not having any problem with "Internal Error 2318.
C:\Windows\system32\java.exe"...?

There are some interesting steps here but not sure how they apply to
our situation. (Probably just me being dense, of course.)


> reinstall 64bit JRE
> https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/viewproductdetail-start?productref=jre-6u13-oth-...@cds-cds_developer

We can't use 1.6 -- the system we're installing is only confirmed to
work on Java v1.5


> reinstall 64bit JDK which matches the exact version JRE you just installed
> http://java.sun.com/javase/downloads/index.jsp

We've got the JDK and JRE from the same installer
(jdk-1_5_0_18-windows-amd64.exe) so in theory they should be
compatible, no?


>> Date: Sat, 16 May 2009 00:17:39 -0500
>> Subject: trouble starting tomcat: "error 0" on Windows 64bit
>> From: w...@serensoft.com
>> To: users@tomcat.apache.org
>>
>> We're having a heck of a time getting tomcat running on windows server
>> 2003 enterprise x64 -- it barely gets started, and instantly quits. We
>> installed java from jdk-1_5_0_18-windows-amd64.exe which seems to be
>> the only 64-bit version available? Our processor is intel, tho... Is
>> there an intel-not-amd version we missed?
>>
>>
>> All we get is "error 0x0"...?
>>
>> This is on Windows Server 2003 R2 Enterprise x64 (SP2) -- Yes, this is
>> a 64-bit machine
>>
>> Tried tomcat from both apache-tomcat-5.5.27.exe installer and from
>> straight ZIP
>>
>> Java is 1.5.0_18
>>
>> Java has no spaces in its path: C:\Java\jdk1.5.0_18 (from
>> jdk-1_5_0_18-windows-amd64.exe installer)
>>
>> No port conflicts (we're asking for port 80 instead of 8080) according
>> to netstat -an
>>
>>
>> yes, we're listening on port 80 instead of 8080 (via server.xml);
>> Tomcat has no spaces in its path: C:\Tomcat55
>>
>> Executing "tomcat5.exe" from the command line shows only a blank line,
>> then the command prompt pops up again (no text-to-console logged).
>>
>> Executing "startup.bat" shows
>> Using CATALINA_BASE: C:\Tomcat55
>> Using CATALINA_HOME: C:\Tomcat55
>> Using CATALINA_TMPDIR: C:\Tomcat55\temp
>> Using JRE_HOME: C:\Java\jdk1.5.0_18
>>
>> We've tried running it as a service (setting it up via 'service.bat'),
>> too:
>>
>> The start>admin>componentServices>event viewer shows only:
>> """
>> The Apache Tomcat service terminated with service-specific error 0 (0x0).
>>
>> For more information, see Help and Support Center at
>> http://go.microsoft.com/fwlink/events.asp.
>> """
>>
>> C:\Tomcat55\logs>type jakarta_service_20090515.log
>> [2009-05-15 15:03:59] [info] Procrun (2.0.4.0) started
>> [2009-05-15 15:03:59] [info] Service sakai name Apache Tomcat sakai
>> [2009-05-15 15:04:00] [info] Service sakai installed
>> [2009-05-15 15:04:00] [info] Procrun finished.
>> [2009-05-15 15:04:00] [info] Procrun (2.0.4.0) started
>> [2009-05-15 15:04:00] [info] Updating service...
>> [2009-05-15 15:04:00] [info] Service sakai updated
>> [2009-05-15 15:04:00] [info] Update service finished.
>> [2009-05-15 15:04:00] [info] Procrun finished.
>> [2009-05-15 15:04:00] [info] Procrun (2.0.4.0) started
>> [2009-05-15 15:04:00] [info] Updating service...
>> [2009-05-15 15:04:00] [info] Service sakai updated
>> [2009-05-15 15:04:00] [info] Update service finished.
>> [2009-05-15 15:04:00] [info] Procrun finished.
>> [2009-05-15 15:05:19] [info] Procrun (2.0.4.0) started
>> [2009-05-15 15:05:19] [info] Running Service...
>> [2009-05-15 15:05:19] [info] Starting service...
>> [2009-05-15 15:05:19] [174 javajni.c] [error] %1 is not a valid Win32
>> application.
>> [2009-05-15 15:05:19] [994 prunsrv.c] [error] Failed creating java
>> C:\Java\jdk1.5.0_18\jre\bin\server\jvm.dll
>> [2009-05-15 15:05:19] [1269 prunsrv.c] [error] ServiceStart returned 1
>> [2009-05-15 15:05:19] [info] Run service finished.
>> [2009-05-15 15:05:19] [info] Procrun finished.
>>
>> Both stderr and stdout logs are empty.
>>
>> We did find a thread online that recommended "copy the file
>> msvcr71.dll from the bin dir of your java installation, to the bin dir
>> of the tomcat installation." Of course, we 

startup.bat and catalina.bat -> NoClassDefFoundError: server

2009-05-16 Thread w...@serensoft.com
First, I appreciate your responses and your help. Thanks! Here's my
new question:


Short version:
We find what the launch-tomcat command is from the startup.bat and
catalina.bat files, and paste that in directly at the command line,
only to get:
"Exception in thread "main" java.lang.NoClassDefFoundError: server"

It it naive to think this is our problem? (E.g. the batch file may be
setting other variables...) Ideas?


Long version:

Okay, so we're trying to get Tomcat to run under 64-bit Windows 2003
Enterprise... Java is fine, but tomcat won't even begin to start.
Blip, the console window shows up and instantly goes away again, no
files open, no ports open, no tomcat/java process at all.

When we "rem" the "@echo off" statements in the Tomcat batch files to
see what's going on, we can see that the final command to execute
tomcat is:

start "Tomcat" "C:\Java\jdk1.5.0_18\bin\java" server -Xms768m -Xmx768m
-XX:PermSize=128m -XX:MaxPermSize=256m -XX:NewSize=192m
-XX:MaxNewSize=384m -XX:+UseParallelGC
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file="C:\Tomcat55\conf\logging.properties"
 -Djava.endorsed.dirs="C:\Tomcat55\common\endorsed" -classpath
"C:\Java\jdk1.5.0_18\lib\tools.jar;C:\Tomcat55\bin\bootstrap.jar"
-Dcatalina.base="C:\Tomcat55" -Dcatalina.home="C:\Tomcat55"
-Djava.io.tmpdir="C:\Tomcat55\temp"
org.apache.catalina.startup.Bootstrap  start

Meaning that we're just basically calling java, with the tomcat
bootstrap.jar of course. So we try pasting that command (without the
'start "[arg]"') and we get:
Exception in thread "main" java.lang.NoClassDefFoundError: server

Is this error misleading? Bootstrap.jar is indeed where it's expected...

Is there something else in the batch file that would set up a more
reasonable environment so that the 'server' class would be found? If
not, is there something obvious here that we've missed in order to get
tomcat off the ground?


C:\Tomcat55>java -version
java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_18-b02, mixed mode)

Java runs hello-world just fine.


Ancillary question:

tomcat connector, tomcat native, and 64-bit windows

tomcat.apache.org offers a ZIP download of tomcat, plus a "tomcat
connector" and a "tomcat native". There's documentation for each, but
the intended audience seems to be folks who already know what each of
those is for.

What would the "tomcat connector" be for, or what's the "native"
instance all about. At tomcat.apache.org there are 64-bit downloads in
those categories, but how do they relate to the normal ZIP downloads?





-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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



running tomcat5 -- as a service under 64-bit windows?

2009-05-18 Thread w...@serensoft.com
Hi folks --

Short version: how to get Tomcat5 to run as a service under 64-bit Windows 2003?

Long version:

Okay, we've got Tomcat5 running from the command-line within 64-bit
Windows 2003 Enterprise (and cannot use tomcat 6/java 6 for our
project) -- and now we're working to get it running as a service...

We've replaced the original tomcat5.exe and tomcat5w.exe with the ones at
http://svn.apache.org/viewvc/tomcat/connectors/trunk/procrun/bin/amd64/
as directed from
http://www.nabble.com/running-tomcat-5.5-as-a-service-on-64bit-windows-td6821449.html

And then command line 'service install' appears to work (it shows up
in admin tools > services) but the service won't start: it tries for a
while (netstat -nab shows it's running for a spell), but it quietly
gives up. tomcat/logs/stderr* does contain some text, but there's no
catalina.out, and start > admin tools > component services > events
doesn't give up any evidence either.

Plus, the mofidied/64-bit-savvy tomcat5w.exe which is supposed to set
parameters for the service, complains that 'tomcat5' doesn't exist.

Ideas?

-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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



never mind :)

2009-05-18 Thread w...@serensoft.com
We just got Tomcat 5 to work as a service on windows 64-bit, woo hoo!
(see email with subject "running tomcat5 -- as a service under 64-bit
windows? SOLVED".)

We thought we had another new snag, but there's just a firewall or
network issue.

We now return you to your regularly scheduled email. :)

-- 
will trillich
"Our only real economic security lies in our power to meet human
needs." -- S.Covey, the 8th Habit

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



"The Apache Tomcat service terminated with service-specific error 0 (0x0)." on Windows again... argh!

2009-06-06 Thread w...@serensoft.com
Okay -- wWe CAN start Tomcat via the command line, no problem.

But when trying to start it as a SERVICE, no luck -- we look in the
event logs and find
"The Apache Tomcat service terminated with service-specific error 0
(0x0)." again

In JAVA_OPTS we've got "-server -XX:+UseParallelGC -Xmx1200m
-XX:PermSize=120m -XX:MaxPermSize=240m -Djava.awt.headless=true" which
is what DOES work from the command line.

In the java tab via tomcat5w, where we can NOT start the service:
-Dcatalina.base=C:\tomcat55
-Dcatalina.home=C:\tomcat55
-Djava.endorsed.dirs=C:\tomcat55\common\endorsed
-Djava.io.tmpdir=C:\tomcat55\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\tomcat55\conf\logging.properties
-Xmx1200m
-Xms1200m
-XX:PermSize=120m
-XX:MaxPermSize=240m
-server
-Djava.awt.headless=true

When we try to start the service we see "Invalid maximum heap size:
-Xmx1200m " in the stderr*.log output.
And the jakarta_service*.log contains
[2009-06-06 13:08:37] [395  javajni.c] [error] CreateJavaVM Failed
[2009-06-06 13:08:37] [1000 prunsrv.c] [error] Failed initializing
java C:\tomcat55\bin\bootstrap.jar
[2009-06-06 13:08:37] [1269 prunsrv.c] [error] ServiceStart returned 2


Pointers welcome :(


System is (different from previous thread):
- windows server 2003 std edition sp2
- intel xeon cpu 3070 @ 2.66ghz
- 4gb ram (physical address extension)

Java is
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)

Tomcat is
Server version: Apache Tomcat/5.5.27
Server built:   Aug 28 2008 10:08:26
Server number:  5.5.27.0
OS Name:Windows 2003
OS Version: 5.2
Architecture:   x86
JVM Version:1.5.0_19-b02
JVM Vendor: Sun Microsystems Inc.

--
will trillich
"Tis the set of the sails / And not the gales / That tells the way we
go." -- Ella Wheeler Wilcox

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



Migrating from GlassFish to Tomcat 7

2013-08-22 Thread B W
 I have a GWT application which currently is running on GlassFish 3.x. I
want to migrate to Tomcat 7. Previously, I would store properties that the
GWT application could retrieve by
org.apache.commons.configuration.SystemConfiguration. I would put these
settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
tried putting settings under my WEB-INF\web.xml file as
context-paramsection. However, my GWT application cannot see them
still.

Where should I put settings that can be read by calling
org.apache.commons.configuration.SystemConfiguration from my GWT app from
Tomcat?


Re: Migrating from GlassFish to Tomcat 7

2013-08-22 Thread B W
Thank you - it's working!




On Thu, Aug 22, 2013 at 9:04 AM, Daniel Mikusa wrote:

> On Aug 22, 2013, at 8:48 AM, B W  wrote:
>
> > I have a GWT application which currently is running on GlassFish 3.x. I
> > want to migrate to Tomcat 7. Previously, I would store properties that
> the
> > GWT application could retrieve by
> > org.apache.commons.configuration.SystemConfiguration.
>
> Looks like this class is loading items from system properties.
>
> > I would put these
> > settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
> > tried putting settings under my WEB-INF\web.xml file as
> > context-paramsection. However, my GWT application cannot see them
> > still.
> >
> > Where should I put settings that can be read by calling
> > org.apache.commons.configuration.SystemConfiguration from my GWT app from
> > Tomcat?
>
> Based on that, you'd want to add system properties in
> "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default,
> you'll need to create it.
>
> Ex:
>
>CATALINA_OPTs="-Dmy.property.1=xyz -Dmy.property.2=abc"
>
> Dan
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Migrating from GlassFish to Tomcat 7

2013-08-22 Thread B W
What is the advantage to using catalina.properties vs setenv.sh?


On Thu, Aug 22, 2013 at 11:37 AM, Konstantin Kolinko  wrote:

> 2013/8/22 Daniel Mikusa :
> > On Aug 22, 2013, at 8:48 AM, B W  wrote:
> >
> >> I have a GWT application which currently is running on GlassFish 3.x. I
> >> want to migrate to Tomcat 7. Previously, I would store properties that
> the
> >> GWT application could retrieve by
> >> org.apache.commons.configuration.SystemConfiguration.
> >
> > Looks like this class is loading items from system properties.
> >
> >> I would put these
> >> settings in my domain.xml for GlassFish. What is the Tomcat equivalent?
> I
> >> tried putting settings under my WEB-INF\web.xml file as
> >> context-paramsection. However, my GWT application cannot see them
> >> still.
> >>
> >> Where should I put settings that can be read by calling
> >> org.apache.commons.configuration.SystemConfiguration from my GWT app
> from
> >> Tomcat?
> >
> > Based on that, you'd want to add system properties in
> "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default,
> you'll need to create it.
> >
> > Ex:
> >
> >CATALINA_OPTS="-Dmy.property.1=xyz -Dmy.property.2=abc"
> >
>
> Properties that are used by a web application (and not by Java itself
> during its startup) can also be added to conf/catalina.properties
> file.
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/index.html
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Migrating from GlassFish to Tomcat 7

2013-08-26 Thread B W
Looks like catalina.properties it is !


On Thu, Aug 22, 2013 at 6:30 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> B W,
>
> On 8/22/13 4:30 PM, B W wrote:
> > What is the advantage to using catalina.properties vs setenv.sh?
>
> If you use setenv.sh, then those system properties will only be
> available if you use the Tomcat scripts to launch. If you use jsvc or
> the Microsoft Windows Service Wrapper, they will not be available.
>
> Using catalina.properties should allow you to set system properties
> that will be loaded regardless of how you launch Tomcat.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.14 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJSFpD/AAoJEBzwKT+lPKRYvbEQALWOa8chxGNMyDTb7032vnnX
> iMgD0bdTyfXKHQUpseCikP185gksIXdBajxHKNyKH6lDEJLyl4udHg8dtAAPPlmZ
> FvveRHCuyxlcZXg3qAe7Zsnd83fPVMa5F/ysGDUHUbNIKSAq8YiQtFsnujLRQrKY
> Y+LZdoDMFbS6wNohBaxIQZtsjiOWu+/JblUAcqwOZ6JV0ZhCl6vhtGgp10UFxsjx
> BRz5hE6K8vZcYt2zvVGqB9+Kjy7APIPBB1TJTnp8ieA5Y6+Va/6wCtI6ve1FsH83
> aj4aEzOejHx5x7shGvz8yr8LfbGGBfRBvHVwVteicffAiBvEPx+5C/t29nR0xJcn
> wvojyA5oSD5/O+W24mrgf27fmsY8JrgivZsnaSPyx2dHp31bbhkfQz7+FI0Hoh02
> jNzNRoRKECOtmxWH/qI9zd9igOa3Merve1e6x0JWtoT9UOY7YFZRRl0jwDoTM75a
> Ogs0c/kKOlpb57/8iXpffMl9LHD54tCD+XgVb+Dlln7+aSic56eCx+edGqm241fe
> bWtB9o8nOsjzERjwwlkFFyZsXo1cfJza2LOlNSrsJjx+10KT+3cGxwBt+ywn5Q5j
> AhYX/YO8WkdCxei2DcZleFYzuuUyInmHnezoxDHvPfZSOzoPvbXfzyZQP8flSvgQ
> /Q2Pj4X4p65yhV/7s4bj
> =h6mX
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Class loading locking threads

2016-02-24 Thread Wayne W
Hi,

we are using a third party JAR which is about 35MB in size but is packed
with many many obfuscated classes. Due to the nature of the functionality
it loads classes all the time from the JAR file . I'm finding that will it
loads the class the other threads which want to load classes get blocked.
This is a typical stack trace:

   java.lang.Thread.State: RUNNABLE
at java.util.Hashtable.hash(Hashtable.java:239)
at java.util.Hashtable.get(Hashtable.java:434)
- locked <0x0007b0a61108> (a java.util.Hashtable)
at
sun.security.util.SignatureFileVerifier.updateSigners(SignatureFileVerifier.java:670)
at
sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:259)
at
sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:307)
at java.util.jar.JarVerifier.update(JarVerifier.java:218)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
at java.util.jar.JarFile.getInputStream(JarFile.java:412)
- locked <0x0007af3475b0> (a java.util.jar.JarFile)
at
org.apache.catalina.webresources.JarResource.getJarInputStreamWrapper(JarResource.java:50)
at
org.apache.catalina.webresources.AbstractArchiveResource.getContent(AbstractArchiveResource.java:175)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:2579)
at
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2405)
at
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:854)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274)
- locked <0x0007af33f8e8> (a java.lang.Object)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
at com.aspose.slides.p2cbca448.knx.for(Unknown Source)
at com.aspose.slides.p2cbca448.knx.do(Unknown Source)


It seems all the time is spent in the SignatureFileVerifier part - is there
any way to stop the class loader doing this and thus speed up the class
loading?

I also tried configuring the ParallelWebappClassLoader which is configured
but doesn't seem to come into play for this. I tested by doing:

conf/Catalina/localhost/test.xml:

   


and webapps/test/index.jsp:
ClassLoader: <%= this.getClass().getClassLoader().getParent() %>

which gives me (when accessed at test/index.jsp):
ClassLoader: ParallelWebappClassLoader context: test delegate: false
--> Parent Classloader: java.net.URLClassLoader@264a1535


(Tomcat 8.0.18)


Re: Class loading locking threads

2016-02-25 Thread Wayne W
Thanks Mark,

unfortunately its not our jar - I don't believe there is a way we can
remove the signature as all the class files are encoded.

On Wed, Feb 24, 2016 at 6:31 PM, Mark Thomas  wrote:

> On 24/02/2016 17:49, Wayne W wrote:
> > Hi,
> >
> > we are using a third party JAR which is about 35MB in size but is packed
> > with many many obfuscated classes. Due to the nature of the functionality
> > it loads classes all the time from the JAR file . I'm finding that will
> it
> > loads the class the other threads which want to load classes get blocked.
> > This is a typical stack trace:
>
> 
>
> > It seems all the time is spent in the SignatureFileVerifier part - is
> there
> > any way to stop the class loader doing this and thus speed up the class
> > loading?
>
> Remove the signature from the JAR.
>
> > I also tried configuring the ParallelWebappClassLoader which is
> configured
> > but doesn't seem to come into play for this. I tested by doing:
>
> The lock on the JarFile where all the classes are is going to be the
> bottleneck. The parallel class loader won't help.
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Class loading locking threads

2016-02-26 Thread Wayne W
eer thx chris.

I have tired that already and does;t work. The classes won't load

On Thu, Feb 25, 2016 at 2:53 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Wayne,
>
> On 2/25/16 7:49 AM, Wayne W wrote:
> > unfortunately its not our jar - I don't believe there is a way we can
> > remove the signature as all the class files are encoded.
>
> http://lmgtfy.com/?q=java+jar+remove+signature
>
> -chris
>
> > On Wed, Feb 24, 2016 at 6:31 PM, Mark Thomas  wrote:
> >
> >> On 24/02/2016 17:49, Wayne W wrote:
> >>> Hi,
> >>>
> >>> we are using a third party JAR which is about 35MB in size but is
> packed
> >>> with many many obfuscated classes. Due to the nature of the
> functionality
> >>> it loads classes all the time from the JAR file . I'm finding that will
> >> it
> >>> loads the class the other threads which want to load classes get
> blocked.
> >>> This is a typical stack trace:
> >>
> >> 
> >>
> >>> It seems all the time is spent in the SignatureFileVerifier part - is
> >> there
> >>> any way to stop the class loader doing this and thus speed up the class
> >>> loading?
> >>
> >> Remove the signature from the JAR.
> >>
> >>> I also tried configuring the ParallelWebappClassLoader which is
> >> configured
> >>> but doesn't seem to come into play for this. I tested by doing:
> >>
> >> The lock on the JarFile where all the classes are is going to be the
> >> bottleneck. The parallel class loader won't help.
> >>
> >> Mark
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Class loading locking threads

2016-02-26 Thread Wayne W
ugh ignore me, doing on a linux box works, but not my mac for some silly
reason. cheers

On Fri, Feb 26, 2016 at 11:52 AM, Wayne W 
wrote:

> eer thx chris.
>
> I have tired that already and does;t work. The classes won't load
>
> On Thu, Feb 25, 2016 at 2:53 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Wayne,
>>
>> On 2/25/16 7:49 AM, Wayne W wrote:
>> > unfortunately its not our jar - I don't believe there is a way we can
>> > remove the signature as all the class files are encoded.
>>
>> http://lmgtfy.com/?q=java+jar+remove+signature
>>
>> -chris
>>
>> > On Wed, Feb 24, 2016 at 6:31 PM, Mark Thomas  wrote:
>> >
>> >> On 24/02/2016 17:49, Wayne W wrote:
>> >>> Hi,
>> >>>
>> >>> we are using a third party JAR which is about 35MB in size but is
>> packed
>> >>> with many many obfuscated classes. Due to the nature of the
>> functionality
>> >>> it loads classes all the time from the JAR file . I'm finding that
>> will
>> >> it
>> >>> loads the class the other threads which want to load classes get
>> blocked.
>> >>> This is a typical stack trace:
>> >>
>> >> 
>> >>
>> >>> It seems all the time is spent in the SignatureFileVerifier part - is
>> >> there
>> >>> any way to stop the class loader doing this and thus speed up the
>> class
>> >>> loading?
>> >>
>> >> Remove the signature from the JAR.
>> >>
>> >>> I also tried configuring the ParallelWebappClassLoader which is
>> >> configured
>> >>> but doesn't seem to come into play for this. I tested by doing:
>> >>
>> >> The lock on the JarFile where all the classes are is going to be the
>> >> bottleneck. The parallel class loader won't help.
>> >>
>> >> Mark
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> >> For additional commands, e-mail: users-h...@tomcat.apache.org
>> >>
>> >>
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: [EXTERNAL] Re: Archive localhost_access_log

2025-03-18 Thread david w
There are other ways to capture or store logs... Tools or toolsets like 
Telegraf.
OT but could be of help




Thank you Mr. Funk.

My request is two-folds a) archive the log files elsewhere (not the "logs" 
folder) based on some policy b) clean up (delete) the archived files based on 
some policy.

If I'm not mistaken, your suggestion may address the latter but nothing on the 
former?

Thanks and regards,
-
Quoc

-Original Message-
From: Tim Funk 
Sent: Tuesday, March 18, 2025 1:10 PM
To: Tomcat Users List 
Subject: [EXTERNAL] Re: Archive localhost_access_log

Personally. I rely on a daily cron with a find by time and the -delete flag. 
Where the time to keeps is based on policy.

-Tim

On Tue, Mar 18, 2025 at 9:52 AM Nguyen, Quoc A. (QUANTUM MANAGEMENT, LLC) 
 wrote:

> Hello,
>
> Tomcat server version: 9.0.98.
>
> server.xml configuration for AccessLogValve:
>
>  directory="logs" prefix="localhost_access_log" suffix=".log" maxDays="7"
> pattern="%h %{X-Forwarded-For}i %t %I "%m %U" %{local}p %s %b %D"
> resolveHosts="false" />
>
> Everything works fine.  Now, I have a requirement to archive these log
> files similar to log4j  (pattern is already taken care of
> in the valve) with  (archive when the file size reaches
> certain
> size) and  (cleanup archived files).
>
> Is there a way to archive these logs via the configuration in the valve?
> If not, what the best way to go about it: a custom class that
> implements ValveBase or extends AccessLogValve or do something else entirely?
>
>
>
B�CB��[��X��ܚX�KK[XZ[�\�\��][��X��ܚX�P�X�]
 �\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\��Z[�X�] �\X�K�ܙ�B�


[ANN] Java Web Parts Beta 5

2006-07-02 Thread Frank W. Zammetti
After a few months off, the Java Web Parts (JWP) team is proud to 
announce the release of beta 5!


The most notable change is that the taglib formerly known as AjaxTags is 
now known as the AjaxParts Taglib, or APT for short.  Not only is the 
name different, but the taglib has been essentially rewritten and is now 
easier and yet more powerful than ever...  If a declarative approach to 
AJAX that doesn't require you to know a bit of Javascript (unless you 
want to get into it) sounds good to you, now is a great time to check 
out what APT has to offer!


There are other additions as well, and as always, JWP provides a number 
of useful parts, such as servlets, filters, taglibs, utility classes, 
and so forth.  Things like getting the size of a session object, a 
powerful CoR implementation, filters to limit concurrent sessions, guard 
against XSS exploits and disallow app access during defined time 
windows, a class to make application configuration simple, a servlet to 
dynamically render a text of string as an image, a taglib that renders 
very handy Javascript functions, some GUI widgets... all of this can be 
found in JWP, and plenty more!


If this sounds interesting to you, have a look:

http://javawebparts.sourceforge.net

And for you Maven folks, JWP can now be found in the iBiblio repo! 
(beta4 at this point only though)


Thanks, and have a great day!

Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



[ANNOUNCE] New article: The AjaxParts Taglib from Java Web Parts: AJAX for Java Developers the Easy (yet powerful) Way!

2006-07-26 Thread Frank W. Zammetti

Hi everyone,

I've gotten a number of requests for an article on AjaxParts Taglib, and 
I finally got around to writing it :)  You can check it out here:


http://www.omnytex.com/articles

If you have never heard of AjaxParts Taglib before, in brief, AjaxParts 
Taglib, a component of the Java Web Parts Project 
(http://javawebparts.sourceforge.net), is a taglib that allows for easy, 
declarative, event-driven AJAX, allowing a developer to add AJAX 
capabilities to existing or new webapps without the need to write ANY 
JavaScript at all!  This article demonstrates how it works, explains the 
benefits, and goes into some details about the capabilities it offers 
out-of-the-box, as well as the ways in which it can be extended to 
fulfill far more advanced users.


Hope it is helpful, and take care!

Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
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: [ANNOUNCE] New article: The AjaxParts Taglib from Java Web Parts: AJAX for Java Developers the Easy (yet powerful) Way!

2006-07-26 Thread Frank W. Zammetti

Thanks Michael, I appreciate you taking the time to look!

Excellent question... the answer is that the code that APT writes into 
the onClick handler for the button will append itself onto whatever is 
there already, it WILL NOT overwrite your existing code.  This wasn't 
always true, but is as of a couple of versions ago :)


FYI, if you were going where I think you might have been going... you 
can't use this to abort the request.  For instance, you might expect that...


if (!shouldAJAXRequestFire())) { return; }

...would stop the request form firing, since the APT code would follow 
this.  But, it doesn't work.  I'm actually a little surprised by that, I 
had to go try it to be sure... I guess the JS interpreter doesn't treat 
what's in onClick like a function, it's instead just a collection of 
statements that it interprets, return not aborting that interpretation.


However, it is already on our to-do list to provide this ability... we 
already have the preProc that gets called before the request, we'll 
probably examine the return from that and if false, abort the request. 
We also were thinking of adding an  child element under the  
element where you could put a Javascript snippet, and if it returns 
false, that aborts the request.  Not sure which way we'll go yet (maybe 
both)... there is a feature request on the SF site, if anyone has an 
opinion, I'd love to have it recorded :)


Frank

Michael Jouravlev wrote:

On 7/26/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:

Hi everyone,

I've gotten a number of requests for an article on AjaxParts Taglib, and
I finally got around to writing it :)  You can check it out here:

http://www.omnytex.com/articles

If you have never heard of AjaxParts Taglib before, in brief, AjaxParts
Taglib, a component of the Java Web Parts Project
(http://javawebparts.sourceforge.net), is a taglib that allows for easy,
declarative, event-driven AJAX, allowing a developer to add AJAX
capabilities to existing or new webapps without the need to write ANY
JavaScript at all!  This article demonstrates how it works, explains the
benefits, and goes into some details about the capabilities it offers
out-of-the-box, as well as the ways in which it can be extended to
fulfill far more advanced users.

Hope it is helpful, and take care!

Frank


Frank,

great stuff! I haven't read the whole article yet :-) so just a quick 
question:


say I have this button:



and I defined the "onclick" event in .

What will happen if I define another onclick handler right in the
"input" element like



Basically, how do you handle custom Javascript?

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

-
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: Problem while submiting the page

2006-07-28 Thread Frank W. Zammetti

Hi,

I think you might be running into a timing issue.  I would suggest 
this... onClick of the button, first, disable the button, and then set a 
timeout, set for like 1 millisecond (which is probably a lower 
resolution than is available, but it will basically fire immediately, 
that's what you want).  Do the submission to the first action.  Then, in 
that timeout function, start another timeout for maybe 500 millisecond. 
 When it fires, make the second submission.  I'm guessing that the 
first request doesn't begin before the code starting the second one 
fires.  This timeout scheme should avoid that.


Alternatively, have another form on the page with ll the same elements, 
but hidden.  Then just have a bit of Javascript to iterate over the 
elements of the real form and transfer them to the second form.  Then 
just submit both forms, each one targeting a different action.


One other option, and probably the one I'd go for myself, is instead of 
submitting the form at all, make two AJAX requests, one to each action. 
 The submit button would be an ordinary button to avoid its own submit 
getting in the way.  It would be a little more work on your part, since 
you have to handle the response, but any of the libraries available 
today will make it childs' play.


Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

Prafulla Nawale wrote:

Hi,
I am facing one problem on submit of jsp.
I think its most probably an issue related to javascript. Can you please help 
me in figuring out it.

There is a button on the screen, on click of that button i invoke the 
javascript function and in that function i submit the form two times, to two 
different actions.

So what happens mostly in this case is only the second action is executed. I can see the log corresponding to second action only. 


Can anyone please help me in solving this.

the code snippet in js is like this

var win = window.open("", "checklist", features);
document.formMain.target = "checklist";
document.formMain.action = '../..' + actionPath + '/' + link + '?uniqeId='+uniqeId 
+ '&ref=' + refName;
document.formMain.submit();
document.formMain.target = "checklist";
document.formMain.action = '../../PrintOut/Polling/Polling.do?uniqeId='+uniqeId + 
'&ref=' + refName;
document.formMain.submit();

-
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: decompiling classes

2006-09-07 Thread Frank W. Zammetti

Umm, the "command" to decompile Tomcat's classes is this:

http://tomcat.apache.org/svn.html

;)

Frank

Nicholas Irving wrote:
I know the software you mean, it is completely free, but I have a guide 
that

I can sell to you for $19.95 that tells you where to download it from and
contains commonly available documentation convert into a PDF for you to
read.

So you want my PayPal account so that you can deposit the money and then
enjoy the world of decompiling java classes.

NIrving

On 08/09/06, Propes, Barry L <[EMAIL PROTECTED]> wrote:


what's the command again for decompiling Tomcat's classes? Or was there
special software needed to do so?






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

-
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: how to forward user to a page after container manager authntication ?

2006-09-10 Thread Frank W. Zammetti
Container-managed authentication works by intercepting a request for a 
protected (constrained) resource and redirecting to the page with the 
logon form.  Once the user authenticated, the request for the 
constrained resource continues, in effect, the user is "forwarded" to 
what they requested in the first place.  Therefore, to do what you want, 
the request that results in the logon page being shown should be for 
login_done (JSP? .do?)  Make that the default document in web.xml if 
that's what you need.


Frank

legolas wrote:

Hi
Thank you for reading my post
how i can forward user to an specefic page after he/she successfully
authenticated using form based authentication?
if user fail to provide a wrong user/pass then he/she will be forwarded to
login_error page , what if i need user to be forwarded to login_done after
he/she logged in suggessfully ?

thanks.


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

-
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: Need Help w. Servlets And The JDBC.

2006-09-20 Thread Frank W. Zammetti

Google is your friend... here's a quick hit:

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/cjvjdbas.htm

...and another (although slightly older, still looks to be valid)...

http://www.cs.bham.ac.uk/~aps/syllabi/2004_2005/issws/h01/jdbc.html

...and yet another...

http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html

This last one might be the best, but all three should do the trick. 
There is no fundamental difference between using JDBC from a servlet vs. 
a straight Java app.


Frank

Steve R Burrus wrote:
Hi all. I am an admitted newbie when it comes to using a database 
connection for a servlet to access. So can someone please tell me the 
basics about how exactly I should go about doing this?? I have been very 
much "stumped" about how I should do this for quite a long time now! I 
just know that I should use 1 of 3 getConnection( ) methods to start to 
do this and create a Connection object but little else.




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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

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



problems with unpacking ROOT.war

2006-10-13 Thread andrew . w . cooke

Hi there,

We have been finding it difficult to persuade tomcat (5.5.12 and 5.5.17) to
unpack a ROOT.war file, either when starting up tomcat from scratch, or
hot-deploying.

We *were* able to get tomcat to expand the war file if it contains a
META-INF directory containing a context.xml file.  However if this
directory is missing from the war, and instead a ROOT.xml context file is
present in conf/Catalina/localhost before starting tomcat - the war file
*isn't* expanded.

Our server.xml file contains the default settings (unpackWARs="true"
autoDeploy="true").

Any ideas?  We would rather not include context.xml files in the war, as
the same war file will be deployed on different servers, which require
different JNDI resources.

thanks

Andy Cooke


-
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.


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



Re: Servlet in a .jar file? AJAX access?

2006-10-14 Thread Frank W. Zammetti
Yes, certainly you can put a servlet in a JAR... after all, Struts is 
based on a servlet, and you generally just drop the Struts JAR into your 
webapp... accessing a servlet via AJAX is, in simplest terms, just a 
plain old HTTP request like any non-AJAX request, so yes, you can do 
that too.


If your servlet is in a JAR, and that JAR is in the classpath, then all 
you need to do is put the appropriate entries in web.xml and your off to 
the races... if you want to call it via AJAX, that works just fine too, 
if you just pass simple name/value pair parameters.


Does that answer your question, or did I misunderstand?

Frank


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

Jon Yeargers wrote:
Is it possible to put a servlet in a .jar file and be able to access it 
via AJAX?


I have some support servlets that I want to share via a common library. 
To this point Ive only been putting session beans in there. Its easy to 
point to those using 'do something similar to a servlet such that I can get to it via an 
XMLHttpRequest object?


Jon

-
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: problems with unpacking ROOT.war

2006-10-17 Thread andrew . w . cooke
Hi again,

OK - here are some steps you can try out to reproduce the problem I am
experiencing - I'm hoping this will tempt someone into taking a look :-).

The problem we have is that tomcat 5.5.x (I tried 5.5.12 and 5.5.17) won't
unpack ROOT.war when it is started up, if a file called ROOT.xml is present
in conf/Catalina/localhost.

(1) Build a simple webapp, for example containing:

success.html
WEB-INF/web.xml

and place these into a war file called ROOT.war.

(2) Place a ROOT.xml context file into conf/Catalina/localhost with:






The server.xml file can stick to the defaults that you get with tomcat
5.5.17 (or 5.5.12):

  

(3) Delete any directory under webapps called ROOT, and drop the war file
into webapps.

(4) Start tomcat.

--> doesn't unpack war.

(5) delete ROOT.xml from conf/Catalina/localhost, and restart tomcat

--> does unpack the war file.

Similarly, a war file containing META-INF/context.xml will be deployed, as
long as there isn't a file called ROOT.xml inside conf/Catalina/localhost.
The problem for us is that we would like to deploy the war on different
servers, offering different JNDI resources.  So shipping a war file
containing a context.xml isn't an option for us.

I have searched the mailing lists for a solution to this problem, but so
far without luck.  There was a useful mail trail last year that resulted in
a document being placed in bugzilla containing instructions on how to
deploy a root app using tomcat's manager (
http://issues.apache.org/bugzilla/show_bug.cgi?id=35063).  However our
production environments don't support the manager app.

I have tried tweaking some of the parameters.  For example, if I set a
docBase of ${CATALINA_HOME}/webapps/ROOT, I'll see a warning in the logs
saying that "a docBase [...] inside the host appBase has been specified,
and will be ignored" - which at least shows that ROOT.xml is being parsed.
Likewise, changing the the docBase to point to a directory outside of
${CATALINA_HOME} doesn't solve the problem.

(Am I right in thinking docBase *isn't* a required attribute?  If I leave
this out of ROOT.xml, and expand the war file manually, the ROOT app will
pick up JNDI resources correctly).

I've also played with some of the  attributes in server.xml, e.g.
adding deployOnStartup="true" to server.xml (it is true by default), or
setting autoDeploy="false", but none of these tweaks helped.

So - is it a bug (or a feature?!) that ROOT.war won't unpack if ROOT.xml is
already present in conf/Catalina/localhost?

Thanks for any help,

Andy Cooke



Hi there,

We have been finding it difficult to persuade tomcat (5.5.12 and 5.5.17) to
unpack a ROOT.war file, either when starting up tomcat from scratch, or
hot-deploying.

We *were* able to get tomcat to expand the war file if it contains a
META-INF directory containing a context.xml file.  However if this
directory is missing from the war, and instead a ROOT.xml context file is
present in conf/Catalina/localhost before starting tomcat - the war file
*isn't* expanded.

Our server.xml file contains the default settings (unpackWARs="true"
autoDeploy="true").

Any ideas?  We would rather not include context.xml files in the war, as
the same war file will be deployed on different servers, which require
different JNDI resources.

thanks

Andy Cooke


-
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.


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



-
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: problems with unpacking ROOT.war

2006-10-17 Thread andrew . w . cooke
Hi Michael,

thanks for the response.

I tried this - but no luck.  In any case, I'm pretty sure for the default
web app (ROOT), you should set a path of "":

"If you specify a context path of an empty string (""), you are defining
the default web application for this Host, which will process all requests
not assigned to other Contexts."

(from: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html)

cheers,

Andy




   
 Michael Courcy
 <[EMAIL PROTECTED] 
 mail.com>  To
   Tomcat Users List   
 17/10/2006 11:23 
cc
   
 Please respond to Subject
   "Tomcat Users   Re: problems with unpacking 
   List"   ROOT.war
 <[EMAIL PROTECTED] 
 che.org>  
   
   
   
   




Maybe a stupid clue but instead of





What happen if u try






[EMAIL PROTECTED] a écrit :
> Hi again,
>
> OK - here are some steps you can try out to reproduce the problem I am
> experiencing - I'm hoping this will tempt someone into taking a look :-).
>
> The problem we have is that tomcat 5.5.x (I tried 5.5.12 and 5.5.17)
won't
> unpack ROOT.war when it is started up, if a file called ROOT.xml is
present
> in conf/Catalina/localhost.
>
> (1) Build a simple webapp, for example containing:
>
> success.html
> WEB-INF/web.xml
>
> and place these into a war file called ROOT.war.
>
> (2) Place a ROOT.xml context file into conf/Catalina/localhost with:
>
> 
>
> 
> 
>
> The server.xml file can stick to the defaults that you get with tomcat
> 5.5.17 (or 5.5.12):
>
>   unpackWARs="true" autoDeploy="true"
>xmlValidation="false" xmlNamespaceAware="false">
>
> (3) Delete any directory under webapps called ROOT, and drop the war file
> into webapps.
>
> (4) Start tomcat.
>
> --> doesn't unpack war.
>
> (5) delete ROOT.xml from conf/Catalina/localhost, and restart tomcat
>
> --> does unpack the war file.
>
> Similarly, a war file containing META-INF/context.xml will be deployed,
as
> long as there isn't a file called ROOT.xml inside
conf/Catalina/localhost.
> The problem for us is that we would like to deploy the war on different
> servers, offering different JNDI resources.  So shipping a war file
> containing a context.xml isn't an option for us.
>
> I have searched the mailing lists for a solution to this problem, but so
> far without luck.  There was a useful mail trail last year that resulted
in
> a document being placed in bugzilla containing instructions on how to
> deploy a root app using tomcat's manager (
> http://issues.apache.org/bugzilla/show_bug.cgi?id=35063).  However our
> production environments don't support the manager app.
>
> I have tried tweaking some of the parameters.  For example, if I set a
> docBase of ${CATALINA_HOME}/webapps/ROOT, I'll see a warning in the logs
> saying that "a docBase [...] inside the host appBase has been specified,
> and will be ignored" - which at least shows that ROOT.xml is being
parsed.
> Likewise, changing the the docBase to point to a directory outside of
> ${CATALINA_HOME} doesn't solve the problem.
>
> (Am I right in thinking docBase *isn't* a required attribute?  If I leave
> this out of ROOT.xml, and expand the war file manually, the ROOT app will
> pick up JNDI resources correctly).
>
> I've also played with some of the  attributes in server.xml, e.g.
> adding deployOnStartup="true" to server.xml (it is true by default), or
> setting autoDeploy="false", but none of these tweaks helped.
>
> So - is it a bug (or a feature?!) that ROOT.war won't unpack if ROOT.xml
is
> already present in conf/Catalina/localhost?
>
> Thanks for any help,
>
> Andy Cooke
>
>
> 
> Hi there,
>
> We have been finding it difficult to persuade tomcat (5.5.12 and 5.5.17)
to
> unpack a ROOT.war file, either when starting up tomcat from scratch, or
> hot-deploying.
>
> We *were* able to get tomcat to expand the war file if it contains a
> META-INF directory containing a context.xml file.  However if this
> directory is missing from the war, and instead a ROOT.xml context file is
> present in conf/Catalina/localhost before starting tomcat - 

RE: problems with unpacking ROOT.war

2006-10-18 Thread andrew . w . cooke
Hi Charles,

> Neither one is correct.  You must NOT use the path attribute in a
>  element unless the  is defined in server.xml.  The
> URI path to the app is determined from the name of the .xml file in the
> conf/[engine]/[host] directory.

Thanks for the feedback and the correction.  OK - I have a very simple war
file named ROOT.war - it doesn't a META-INF directory.  I have placed a
file called ROOT.xml into conf/Catalina/localhost with:

  
  
  

Server.xml has the defaults that come with tomcat 5.5.17:

  

I put ROOT.war into the webapps directory and start tomcat --> ROOT.war
isn't expanded.

Any other suggestions?  Or might this be a bug?

thanks for your help,

Andy




   
 "Caldarale,   
 Charles R"
"Tomcat Users List" 
  
 17/10/2006 14:58   cc 
   
   Subject 
 Please respond to RE: problems with unpacking 
   "Tomcat Users   ROOT.war
   List"   
 <[EMAIL PROTECTED] 
 che.org>  
   
   
   




> From: Michael Courcy [mailto:[EMAIL PROTECTED]
> Subject: Re: problems with unpacking ROOT.war
>
> Maybe a stupid clue but instead of
> 
> 
>
> What happen if u try
> 
> 

Neither one is correct.  You must NOT use the path attribute in a
 element unless the  is defined in server.xml.  The
URI path to the app is determined from the name of the .xml file in the
conf/[engine]/[host] directory.

 - 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: Can a "return" statement cause a problem?

2005-11-04 Thread Frank W. Zammetti
It might be interesting to look at the class file generated from your
JSP... many times things like this become fairly obvious when you see the
code that is actually being executed.

Also, if your using a JSP 2.0 container, you may be interested in playing
with tag files:

http://today.java.net/pub/a/today/2003/11/14/tagfiles.html

Kind of a good first step for playing with custom tags without quite as
much work.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Fri, November 4, 2005 3:00 pm, Dola Woolfe said:
>
>
> --- Bob Bateman <[EMAIL PROTECTED]> wrote:
>
>> On Fri, 4 Nov 2005 11:14:19 -0800 (PST)
>>   Dola Woolfe <[EMAIL PROTECTED]> wrote:
>> > Hi,
>> >
>> > In one of my JSP pages (ErrorPage.jsp) I have the
>> > following code.
>> >
>> > <%
>> > if (display-nothing-only-forward) {
>> >  out.println("> 0
>> > seconds>");
>> >  // return;
>> > }
>> >
>> > //Lot's more code
>> > %>
>> >
>> > It works, but prints out unnecessary html before
>> it
>> > forwards. But if I uncomment "return" it stops
>> > working. I get
>> > HTTP 500 - Internal server error
>> >
>> > What could that be? In the tomcat console window,
>> I
>> > get no indication that something is not right.
>>
>> I would postulate that you are executing unnecessary
>> code.
>>
>> *Disclaimer: The following is NOT compliant with MVC
>> best
>> practices...
>>
>> In your JSP page, you *probably* want your "if
>> (display-nothing-only-forward)" statement to execute
>> if
>> there is nothing to do.  If that is true, then after
>> your
>> closing brace with the META info in it, you probably
>> want
>> to use an 'else' clause and enclose the rest of your
>> code
>> in a set of braces.
>>
>> In effect, what you've done is to tell the system to
>> put
>> the META statement out ONLY when there is nothing
>> else to
>> do - but the rest of your code runs all the time.
>>
>> If you have sufficient experience, I would suggest
>> removing all of the java code from your JSP page and
>>
>> putting the code into a Tag.  Tags are really easy
>> to use
>> and keep your business logic seperate from your JSP
>> presentation.  Of course, you'll still have to
>> generate
>> HTML in the Tag, but that's partly what tags are
>> for.
>>
>> Bob
>>
> Hi Bob,
>
> I have not used Tags and plan to take a look at them
> soon.
>
> Concerning the rest of your suggestion, having a big
> "else" clause is precisely something I'm trying to
> avoid. I always prefer
>
> if (short_clause) {
>   //...
>   return;
> }
>
> //rest of code
>
> to
>
> if (short_clause) {
>   //...
>   return;
> }
> else {
> //rest of code
> }
>
> Also, what I'm curious about is this; what I do may
> not be a good coding practice, but what is causing the
> error?
>
> Thanks!
>
> Dola
>
>
>>
> -
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>>
>>
>
>
>
>
> __
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
>
> -
> 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]



Re: disabling sessions in certain parts of a webapp

2005-11-09 Thread Frank W. Zammetti
I can't think of any drawbacks to the filter, and tha's what I would have
suggested.  Although, it probably doesn't even have to be as complicated
as a wrapper... simply check for an existing session for the paths you do
want a session created for, and if none is present go ahead and create it.
 I *think* that would do the trick.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, November 9, 2005 1:54 pm, Brian Moseley said:
> my web application has three separate interfaces: an html ui, webdav,
> and a custom http/xml protocol. clients of the latter two interfaces are
> unaware of the http session, so i'd prefer that sessions not even be
> constructed when requests come in through those interfaces.
>
> i see that StandardManager and PersistentManager have maxActiveSessions
> attributes, which i could potentially set to 0, but that isn't a
> solution since i *do* want to have sessions for the html ui.
>
> short of writing a new implementation of Manager, is there a way for me
> to specify that sessions should not be created for, say, all requests to
> /foo/*?
>
> one idea was a filter that wraps the request with a class that overrides
> getSession. are there any drawbacks to that approach?
>
>
> -
> 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]



Re: disabling sessions in certain parts of a webapp

2005-11-09 Thread Frank W. Zammetti
That's weird... I actually had a part in my reply at the end that said
something like "this should work until some code after the filter tries to
access session" :)

Yep, absolutely, if there's a possibility of that then the wrapper is
definitely the way to go.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, November 9, 2005 2:24 pm, Brian Moseley said:
> Frank W. Zammetti wrote:
>> I can't think of any drawbacks to the filter, and tha's what I would
>> have
>> suggested.  Although, it probably doesn't even have to be as complicated
>> as a wrapper... simply check for an existing session for the paths you
>> do
>> want a session created for, and if none is present go ahead and create
>> it.
>>  I *think* that would do the trick.
>
> well, i'm concerned about code executing further down the filter chain
> that calls request.getSession(). i don't own all of the code that i'm
> running :)
>
> that's why i thought of the wrapper. i can intercept calls to
> getSession() and always return null for the requests that should never
> get sessions, letting the calls through for the requests to the html ui.
>
> thanks for the feedback!
>
> -
> 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]



Re: advice on auto logout servlet

2005-11-16 Thread Frank W. Zammetti
You can do this strictly client-side, if requiring Javascript isn't a 
problem (which of course an AJAX-based solution does anyway).  Just 
start a timer from the onLoad event on each page.  When 20 minutes has 
elapsed, you can either pop an alert which is followed by a redirect to 
some appropriate page, or just do the redirect straight away, whatever 
you prefer.


The down-side is that a user could disable Javascript after the timer 
has begun but before the timeout occurs.  But, of course the session 
will still expire on the server, so it's probably not a big problem. 
And you'll need to keep your session timeout and client-side timeout 
values in sync, but that's pretty minor.


Frank

Jon Wingfield wrote:

I did an AJAX version of this a couple of months ago.
The slight gotcha is that the AJAX request prolongs the life of the 
session (you can't, it seems, override the cookie for AJAX requests) so 
the interval has to be slightly longer than the expiry time for the 
session.


Reynir Hubner wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,
I would suggest that you do this by using somethinglike JSON or AJAX.
See jasonspec: http://www.crockford.com/JSON/index.html

You could make the client query your server, in some interval and check
the session state.

hope it helps
- -reynir



Mark wrote:

Is there any way to allow servlets to auto-logout a user when the 
timeout

has been reached. Right now, I have tomcat configured for a 20 minute
session timeout. When the session times out, the user gets no 
notification
of this event. Is there any way to show the user that they have 
logged out?


Thank you.



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

iD8DBQFDeeqn19KgIQihNwgRAqT8AJ9ijf9kZZlldgjRTcAEtua+89enKQCgnqjm
iuCZACbq4A/JkmtB5yiIc8M=
=HSCq
-END PGP SIGNATURE-

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: JSP processing other than .jsp?

2005-11-16 Thread Frank W. Zammetti
FYI, I had a case once where I needed to make my CSS files JSP's because 
I was using HTC's and for some reason I couldn't get the path mappings 
to work right unless I used request.getContextPath() to prefix the HTC 
names... more than likely just my mistake somewhere, but making it a JSP 
(as Yaakov says, just renaming it to .jsp) did the trick.


I would personally prefer that approach because should you ever need to 
move to another app server, or even a hosted environment like I moved to 
a few months back, this way you won't have to mess with server settings, 
or getting some grumpy old admin to do it :)


Frank

Yaakov Chaikin wrote:

I assume you need this because you want to place some JSP code inside
your stylesheet

Two approaches:
1) If you know that ALL of your .css files will need to include JSP
code in them, then go to tomcat_dir/conf/web.xml and add another
 like so:

  jsp
   *.css


2) If you need to place JSP code in just one or two .css files, I
would not start messing with server specific configurations and just
rename those .css files to have extension of .jsp. So, now you will
have a stylesheet file with .jsp. It seems weird and unusual, but
really doesn't make any difference as far as your HTML/JSP page is
concerned. Just point the link to the .jsp page instead in your
HTML/JSP page:


Hope that helps.

Yaakov.

On 11/16/05, Marten Lehmann <[EMAIL PROTECTED]> wrote:


Hello,

how can I define, that e.g. the extension .css shall be processed by
tomcat same as a .jsp-file?

Regards
Marten

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



JDBC/MySQL user login goes stale

2005-11-29 Thread David W. Brown
Hello TC dev and Gurus, I have a webapp comprised of several Servlets and JSP 
pages. The webapp is functioning very well but after a few hours of no 
connections or interaction the TC webapp loses its connection with the MySQL 
DB. We are using the server.xml defined JDBC/MySQL security model using the 
users and user_roles tables DB structure. The logins work perfectly until a few 
hours of (like overnight) in attendance. Even thought the TC Servlet server is 
still up and running logins all fail. After restarting TC the login mechanism 
works perfectly. Particulars follow. Please advise.

TC Servlet server 5.5.7
MySQL 4.1

OS Windows XP (whistler).

David Brown
IT/Systems
USM-I KBR-Central
APO AE 09316

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



Re: making a singleton servlet

2005-12-06 Thread Frank W. Zammetti
The problem you are trying to solve is not propely solved by trying to 
limit the container to a single servlet instance (which you probably 
cannot control anyway, unless your container allows some sort of 
proprietary setting).


The way you should be thinking to solve this problem is a connection pool.

Your servlet needs to be written in a thread-safe manner anyway, and 
that allows the same servlet instance to handle multiple requests at the 
same time.  Having a connection pool underneath that will allow you to 
share your database connections efficiently.


There are numerous options for connection pooling... the first thing 
you'll probably want to look into is what your container itself offers 
in this area.  Most containers have some sort of pooling facility 
available.  Another option is to build on top of a persistance framework 
like Hibernate or iBATIS, both of which offer some degree of pooling 
support.  There are libraries for doing it as well, DBCP (a Jakarta 
Commons package) for instance.  You could always write your own, it 
isn't too tough, but for something that has been done to death you are 
definitely better off not bothering.


Of course, since your posting to the Tomcat list, I can tell you that 
Tomcat offers such support:


http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

Frank


James Black wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Caldarale, Charles R wrote:

From: James Black [mailto:[EMAIL PROTECTED] 
Subject: re: making a singleton servlet


I am going to make my servlet be static, with the hope that 
it will only have one instance running, regardless of how 
many clients connect to it.



What do you mean by "servlet be static"?  What syntactical construct are
you employing?

If you mean using static fields in your servlet class, then you will
have to make use of synchronization clauses to insure concurrent
requests are serialized.  It's my understanding that the container
(Tomcat or whatever) is free to process as many requests in parallel as
needed, as well as create multiple servlet instances - see the servlet
spec.

What problem are you trying to solve?



  My plan is to try:
public static class SomeServlet extends HttpServlet {  ... }

  That way there should only be one servlet.

  I am writing a servlet to save grades to a database, but,
unfortunately, instructors will procrastinate like students do. So, I
expect that 2000+ instructors will submit their grades in the last hour
or so, before the deadline.  If each instructor had their own db
connection then the system will be useless, as students won't be able to
get connections, since all the connections will be used up.

  For the first test I want to limit them to only one connection that
will read from an input queue, and just process all the grades. Later it
may be bumped up to 20-50 connections, to speed it up.

  That is the basic problem I am trying to solve.

  I am actually using XmlHttpRequest to connect to the servlet so it
doesn't lock up the browser.

- --
Corruptisima republica plurimae leges. [The more corrupt a republic, the
more laws.]
Tacitus from Annals III, 116AD
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFDlkneJ/zyYkX46joRAlfpAJ0cdiTxXrSSdLfZ3znd63dSJesvJACgiFes
PfU+fddjZNUPTT1gq0Ft69g=
=tKjO
-END PGP SIGNATURE-

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Frank W. Zammetti
Tim is right, you can't do it directly.  You *might* be able to construct
it in a roundabout way though...

Let's assumg you know the method, http vs. https, and its always one or
the other.  Let's also assume that the  element in web.xml
names the application context (i.e., if the URL is http://myserver/myapp,
then myapp.  I believe the following (without
actually trying it) would work...

String s = "http://";;
s += new InetAddress.getHostName();
s += "/" + servletContext.getServletContextName();

Kind of hack solution, but it might be OK for your application (assuming
it actually works!)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, December 21, 2005 6:22 am, Tim Funk said:
> There is no way to detect the contextPath on servletInit. It can only be
> done
> after the first request. (Using HttpServletRequest.getContextPath())
>
>
> -Tim
>
> [EMAIL PROTECTED] wrote:
>> Hi,
>>
>> Apols for a newbie question, I didn't have much luck with the archives
>> or in Google.
>>
>> In my ServletContextListener.contextInitialized method, I need to detect
>> the public http path of my web app.
>> i.e. http://servername/approot/
>>
>> How can I do this?
>> event.getServletContext().getResource("/") gives me "jndi:/localhost/",
>> not very helpful.
>>
>
> -
> 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]



RE: ServletContextListener - how to detect http path of web application?

2005-12-21 Thread Frank W. Zammetti
On Wed, December 21, 2005 1:10 pm, [EMAIL PROTECTED] said:
> Frank, your solution (using the ServletContext) does work. Thanks.

Good news (sigh of relief!)

> Martin, I can't get a HttpServletRequest from Filter.init.
> I can get a ServletContext... but I can also get that from a
> ServletContextListener.
> So I can throw away this silly Filter now.

One reason a filter would be better is you can fully construct the URL
dynamically, including the method and all that.  Could you possibly map it
to just the initial entry point of your app so that it doesn't fire with
each request?

Another even more hack-ey solution might be to have a servlet that runs on
startup, and from it fire off a request to a specific URL that goes
through your filter.  Your filter then calculates the app's URL and sticks
it in application scope.  The servlet is no longer needed, nor is the
filter, and shouldn't affect anything after that.

Seems like a lot of trouble for what your after though :)

Frank

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



Re: ServletContextListener - how to detect http path of web application?

2005-12-22 Thread Frank W. Zammetti

[EMAIL PROTECTED] wrote:
One reason a filter would be better is you can fully 
construct the URL dynamically, including the method and all 
that.  Could you possibly map it to just the initial entry 
point of your app so that it doesn't fire with each request?



Yeah I thought about that... unfortunately I can't be sure that the
users will enter from the homepage or any other particular point.


Yeah, I thought you might say that :)

Another even more hack-ey solution might be to have a servlet 
that runs on startup, and from it fire off a request to a 
specific URL that goes through your filter.  Your filter then 
calculates the app's URL and sticks it in application scope.  
The servlet is no longer needed, nor is the filter, and 
shouldn't affect anything after that.


Seems like a lot of trouble for what your after though :)



Although, how would the startup servlet know what the magic URL is? I
guess it would have to start with the full URL of the app. Which is
where we came in :)


The startup servlet wouldn't, the filter would.  The servlet just
requests a resource in your webapp, and the filter calculates the URL
and sticks it in application scope.


Doesn't matter anyhow, it's working ok... Thanks a lot for your help.


Your right, and I'm glad its working.  The other suggestion is just a
curiosity at this point :)  Take care!


Iain


Frank


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



Re: login

2006-01-07 Thread Frank W. Zammetti
What you describe is referred to as container-managed security, or J2EE 
Security.  Here is a link I think may help you:


http://www.onjava.com/pub/a/onjava/2002/06/12/form.html

The actual configuration of the security constraints is J2EE-standard 
and pretty easy.  The configuration of roles and groups and such is 
container-specific and while not usually difficult in any way, will vary 
from container to container.  That link discusses Tomcat specifically 
though, so it should get you heading in the right direction.


Frank

Claudio Veas wrote:

Hello group!! I wanted to make an authentication page for my web site and
after some attemps I read that there was a way to configure the server so it
could take care of it automaticaly so I want it to ask you if you could tell
me how this is done because I havent being able to find any information
about it. Thanks a lot

Claudio Veas


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: Frames in JSP.

2006-01-11 Thread Frank W. Zammetti
On Wed, January 11, 2006 11:19 am, [EMAIL PROTECTED] said:
>
> Dear All,
>
> I have a JSP like the following
>
> 
> 
> .
> .
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> .
> 
> 
>
> where .. is for html code.
>
> If I try to access html elements under the jsp "a.jsp", it returns me a
> null. Why?

How are you trying to access the elements and from where?  You will need
to properly traverse the DOM to get at the elements you want (I usually
use window.top. where  is the name assigned to the frame, which I
notice you don't have).

Remember that frames are separate documents entirely, it is not like doing
an include.  Based on the structure you show here, which is somewhat
atypical, I suspect your thinking of it as an include, and hence the
problem your seeing.

> Thanks in advance.
>
> Regards,
> Ashish A.

Frank

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



Re: Accessing Files outside of WebApp

2006-01-11 Thread Frank W. Zammetti
You may want to have a look at the ResourceServerServlet in Java Web Parts:

http://javawebparts.sourceforge.net/javadocs/javawebparts/servlet/ResourceServerServlet.html

That may give you what you want.  It allows you to serve any resource from
a variety of sources (currently file system from any location, a URL or a
JAR file).  It is also extensible if you would like to serve from another
location.

The main JWP page, if you should want to download:

http://javawebparts.sourceforge.net

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, January 11, 2006 2:15 pm, Zach Moazeni said:
> Hello,
>
> In our current application I need to link to a file that resides
> outside of the webapp directory. On another application we allowed the
> users upload files and stored them in the webapp directory, which made
> deployment a royal pain. This time we are storing the files in a
> location external to Tomcat, however I need to let the users click a
> link so they can download and open the file. I'd rather not "copy over"
> the file to a tmp directory from which they download.
>
> In Apache there was something like , is there something
> like that in Tomcat?
>
> Thanks for any input.
> -Zach
>
> -
> 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]



Re: Image Scaling Code

2006-01-12 Thread Frank W. Zammetti

I don't quite see how this is Tomcat-related, but...

Your code can't connect to your X server, which is necessary for many 
Java graphics-related functions to work on a *nix system.  I dealt with 
this at one point when getting DataVision working on Linux, and I recall 
the solution being something to do with an environment variable, but the 
exact answer eludes me.


Actually, it looks like you *have* defined the environment variable 
(DISPLAY in the stack trace rings a bell).  Is X running?  I believe it 
has to be for this to work.


Frank

Justin Jaynes wrote:

Hello all,
 
 I've written a java class to scale jpeg images.  But I can't seem to get it to work.  Can anyone point me in the right direction?
 
 Here is my code:
 
   
package com.everybuddystree;


import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;

public class ImageScaler {

 public ImageScaler() {
 }

 public boolean scaleImageByWidth(String fileName, int newWidth) {

  File originalImage = new File(fileName);
  try {
   BufferedImage workingBufferedImage = ImageIO.read(originalImage);
   int width = workingBufferedImage.getWidth();
   int height = workingBufferedImage.getHeight();
   Image workingImage = workingBufferedImage;
   workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
   BufferedImage finalImage = (BufferedImage)workingImage;
   ImageIO.write(finalImage, "jpg", originalImage);

   return true;

  } catch (IOException ex){

   return false;

  }

 }

}

When I run the pass an image to the class using a jsp I get the 
following errors from Tomcat:



 HTTP Status 500 -  
-

 type Exception report
 message 
 description The server encountered an internal error () that prevented it from fulfilling this request.
 exception 
 javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.  org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)  org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:158)  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause 
 java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.  sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)  sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)  sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142)  java.security.AccessController.doPrivileged(Native Method)  sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:131)  java.lang.Class.forName0(Native Method)  java.lang.Class.forName(Class.java:164)  java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)  sun.awt.X11.XToolkit.(XToolkit.java:96)  java.lang.Class.forName0(Native Method)  java.lang.Class.forName(Class.java:164)  java.awt.Toolkit$2.run(Toolkit.java:821)  java.security.AccessController.doPrivileged(Native Method)  java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)  java.awt.Image.getScaledInstance(Image.java:158) 
 com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21)  org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114)  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)  javax.servlet.http.HttpServlet.service(HttpServlet.java:802)  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)  javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
 
-
 Apache Tomcat/5.5.12 



 
 



-
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: Image Scaling Code

2006-01-12 Thread Frank W. Zammetti

D'oh!  Now *THAT* rings a bell :)

Mark Hagger wrote:

You need to have:

-Djava.awt.headless=true

in your java start up args, this will prevent it from trying to talk to an X 
server.  Obviously some image related stuff has to talk to an X server, but 
just ImageIO stuff is fine.


Mark


On Thursday 12 January 2006 19:31, Frank W. Zammetti wrote:


I don't quite see how this is Tomcat-related, but...

Your code can't connect to your X server, which is necessary for many
Java graphics-related functions to work on a *nix system.  I dealt with
this at one point when getting DataVision working on Linux, and I recall
the solution being something to do with an environment variable, but the
exact answer eludes me.

Actually, it looks like you *have* defined the environment variable
(DISPLAY in the stack trace rings a bell).  Is X running?  I believe it
has to be for this to work.

Frank

Justin Jaynes wrote:


Hello all,

I've written a java class to scale jpeg images.  But I can't seem to get
it to work.  Can anyone point me in the right direction?

Here is my code:


package com.everybuddystree;

import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;

public class ImageScaler {

public ImageScaler() {
}

public boolean scaleImageByWidth(String fileName, int newWidth) {

 File originalImage = new File(fileName);
 try {
  BufferedImage workingBufferedImage = ImageIO.read(originalImage);
  int width = workingBufferedImage.getWidth();
  int height = workingBufferedImage.getHeight();
  Image workingImage = workingBufferedImage;
  workingImage = (Image)workingImage.getScaledInstance(newWidth,-1,1);
  BufferedImage finalImage = (BufferedImage)workingImage;
  ImageIO.write(finalImage, "jpg", originalImage);

  return true;

 } catch (IOException ex){

  return false;

 }

}

}

When I run the pass an image to the class using a jsp I get the
following errors from Tomcat:


HTTP Status 500 -
-
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request. exception
javax.servlet.ServletException: Can't connect to X11 window server using
':0.0' as the value of the DISPLAY variable. 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageConte
xtImpl.java:848) 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContext
Impl.java:781) 
org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:158) 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.jav
a:322) 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause

java.lang.InternalError: Can't connect to X11 window server using ':0.0'
as the value of the DISPLAY variable. 
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) 
sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)
sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142) 
java.security.AccessController.doPrivileged(Native Method) 
sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:131) 
java.lang.Class.forName0(Native Method) 
java.lang.Class.forName(Class.java:164) 
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironm
ent.java:68)  sun.awt.X11.XToolkit.(XToolkit.java:96) 
java.lang.Class.forName0(Native Method) 
java.lang.Class.forName(Class.java:164) 
java.awt.Toolkit$2.run(Toolkit.java:821) 
java.security.AccessController.doPrivileged(Native Method) 
java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804) 
java.awt.Image.getScaledInstance(Image.java:158)
com.everybuddystree.ImageScaler.scaleImageByWidth(ImageScaler.java:21) 
org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:114) 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.jav
a:322) 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The

full stack trace of the root cause is available in the Apache
Tomcat/5.5.12 logs.

-
Apache Tomcat/5.5.12






-
Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!



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






--
Frank W. Zammetti
Founder and Chief Software Architect

Re: Size of session bean

2006-01-14 Thread Frank W. Zammetti
That's an interesting question... looking at the code I wrote in Java 
Web Parts for the getSessionSize() method, I'm only taking into 
consideration the fields of the objects in session.  I think this is OK 
because IIRC, when an object is serialized, only the non-transient 
values are considered.  The methods don't factor into it because you 
aren't serializing the class definition, just the state of the object. 
If anyone knows differently I'd like to hear about it, but I believe how 
that method works yields an accurate result.


If you want to see how I've done it, check out:

http://javawebparts.sourceforge.net

If you look at the javadocs, in the session package, there is a class 
called SessionSize that is used to get the size of a session object. 
You can grab the code and see how it's done, or just use it if that's 
your ultimate goal :)


Frank

Robert Palmer wrote:
When calculating the size of a session bean to determine memory usage, 
what should be included and how is this done? Do the number of methods 
matter? The size of the code? Just the variables? I've read much about 
limiting the size of the session information but not how to do it. I 
have some fairly large classes in session context but they don't store 
very much.


Thanks.

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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: Spawning a thread

2006-01-14 Thread Frank W. Zammetti
Most of the time people will tell you "don't do it", but don't get any 
more specific than that.  Generally-speaking, spawning a thread to 
process a request is somewhat of a bad idea because the container is not 
responsible for managing the thread and therefore you run some extra 
risks.  But, if you have something like a background process that isn't 
tied to a request, with the caveat the other poster made about daemon 
status in mind, I've never had a problem, and I've done it quite a bit.


I think the prudent advice is "be careful".  And, if you can do what you 
need to without spawning a thread, you might be saving yourself some 
trouble down the road.  But, if you are careful and do it smartly, there 
isn't any definitive rule (that I am aware of) that says you can't do it.


Thom Hehl wrote:

Isn't there a caveat about spawning a new thread inside of a servlet?

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: Spawning a thread

2006-01-14 Thread Frank W. Zammetti
Just to clarify, George wasn't talking about a "context listener 
thread".  I suppose there *technically* is such a thing, but what he was 
referring to is spawning a thread *from* a context listener.  Subtle 
semantic difference, but it completely changes the meaning :)


Frank

Thom Hehl wrote:
Can you point me to some documentation about context listener threads? I 
have no idea what you're talking about.


Thanks.

George Sexton wrote:

 

 


-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Saturday, 
January 14, 2006 1:20 PM

To: Tomcat Users List
Subject: Re: Spawning a thread
  


 

risks.  But, if you have something like a background process that 
isn't tied to a request, with the caveat the other poster made about 
daemon   


A good way of starting threads not tied to a request is to have a context
listener class start the threads and handle any required shutdown.

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585


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


 




Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: data file access for servlet

2006-01-18 Thread Frank W. Zammetti
Hi Neha,

You can basically put it wherever you want because your servlet can get
direct file system access (I'm not sure this is true if deployed in an
EAR, but I guess that's not an option here anyway).

Where it *makes sense* to put it is up to you... if it's something
specific to the webapp then it probably makes sense to put it somewhere in
the webapp's directory structure, but if it's more a shared data type
thing, it might make sense outside the webapp.

Take a look here:

http://cvs.sourceforge.net/viewcvs.py/javawebparts/javawebparts/WEB-INF/src/javawebparts/servlet/TextReturnerServlet.java?view=markup

Scroll down to the init() method and see how it gets an InputStream to the
itemsFile.  This is how you can do it context-relative.  If you want to go
to something outside the webapp, take a look at
ServletContest.getRealPath().

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, January 18, 2006 12:40 pm, Neha Narkhede said:
> Hi..
>I am running a servlet which requires some data files.
> But I dont know where to paste those data files so that the servlet can
> find it.
> I have a servlet "Indexer" and so a folder 'Indexer" in webapps.
>
> Please help..
>
> Thank you.
>
> -
> 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]



Re: data file access for servlet

2006-01-18 Thread Frank W. Zammetti
Take a look at getRealPath() as I suggested earlier... you should be able
to get at the home directory of that other software using it (assuming all
the security that might be in place doesn't get in the way).  You will
probably want to make the path a config parameter so you don't have to go
changing code when that home directory inevitably moves later on :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Wed, January 18, 2006 1:25 pm, Neha Narkhede said:
> Hi..
>   Thank you for the reply..
> but could not open that url.
> My problem is that my servlet uses the function of another software.
> When I run that software code from the terminal, I have to go till
> that software's home directory so that it has access to the required
> files.
> But when I include that code in the servlet, it cannot access the
> required files. I want to know where exactly should I place them so
> that the servlet can access it?
>
> Please help..
>
> Thank you
>
> -
> 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]



Re: How can I take a webapp "temporarily out of service" using mod_jk?

2006-01-23 Thread Frank W. Zammetti
Hi John,

A filter should do the trick for you.  Have it interrogate some value
somewhere (context value? static class? database?) and when it sees a
particular value, redirect to your out of service page.

Since your in a cluster, you have the problem of replicating this "out of
service" flag to all the nodes... a database would be the obvious answer,
but clearly that has performance implications.  You may need some special
URL in your app that sets the flag, properly secured of course, and make
yourself a quick little page that fires it to all nodes.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Mon, January 23, 2006 4:56 pm, Prout John - jprout said:
> Hi
>
>
>
> I am running a JBoss cluster, using tomcat as the Servlet engine. Apache
> and mod_jk provide load-balancing of requests over the machines in the
> cluster
>
>
>
> I need to be able to replace all the URLs in the webapp with a
> "Temporarily out of service" page during maintenance, and I need to do
> this without making any permanent Apache configuration changes and
> without restarting Apache (Operations is very reluctant to restart
> Apache).
>
>
>
> Does anyone know a way to do this?
>
>
>
> I think there may be a way to use the controls on the mod_jk status page
> to redirect all requests for a webapp to a different URL ( the "Route
> Redirect" input) but this is probably wishful thinking - even if does
> allow me to redirect requests, it would probably apply to all the
> webapps in the cluster, which wouldn't meet the requirement. The status
> page teases me by listing all the JkMounts and JkUnmounts, but doesn't
> allow me to change them; adding a JkUnmount dynamically would be a good
> solution.
>
>
>
> Any Ideas?
>
>
>
> John
>
> *
> The information contained in this communication is confidential, is
> intended only for the use of the recipient named above, and may be
> legally privileged.
>
> If the reader of this message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited.
>
> If you have received this communication in error, please resend this
> communication to the sender and delete the original message or any copy
> of it from your computer system.
>
> Thank you.
> *
>


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



RE: How can I take a webapp "temporarily out of service" using mod_jk?

2006-01-23 Thread Frank W. Zammetti
Ah, sorry, didn't get that.  I was suggesting servlet filters.  I don't
frankly know anything about Apache filters... if it's like a servlet
filter but before the request hits the app server, it sounds like it could
do the trick in the same basic way though.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Mon, January 23, 2006 5:06 pm, Prout John - jprout said:
> The problem with this solution is that the webapp really is out of
> service and unable to serve any pages - it's Apache that will have to
> serve the "Out of service" page; that's why I'm looking at mod_jk.
>
> Or were you thinking of an Apache filter, rather than a servlets filter?
> I don't know much about Apache filters
>
> Thanks - John
>
> -Original Message-
> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 23, 2006 2:00 PM
> To: Tomcat Users List
> Cc: users@tomcat.apache.org
> Subject: Re: How can I take a webapp "temporarily out of service" using
> mod_jk?
>
> Hi John,
>
> A filter should do the trick for you.  Have it interrogate some value
> somewhere (context value? static class? database?) and when it sees a
> particular value, redirect to your out of service page.
>
> Since your in a cluster, you have the problem of replicating this "out
> of
> service" flag to all the nodes... a database would be the obvious
> answer,
> but clearly that has performance implications.  You may need some
> special
> URL in your app that sets the flag, properly secured of course, and make
> yourself a quick little page that fires it to all nodes.
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
>
> On Mon, January 23, 2006 4:56 pm, Prout John - jprout said:
>> Hi
>>
>>
>>
>> I am running a JBoss cluster, using tomcat as the Servlet engine.
> Apache
>> and mod_jk provide load-balancing of requests over the machines in the
>> cluster
>>
>>
>>
>> I need to be able to replace all the URLs in the webapp with a
>> "Temporarily out of service" page during maintenance, and I need to do
>> this without making any permanent Apache configuration changes and
>> without restarting Apache (Operations is very reluctant to restart
>> Apache).
>>
>>
>>
>> Does anyone know a way to do this?
>>
>>
>>
>> I think there may be a way to use the controls on the mod_jk status
> page
>> to redirect all requests for a webapp to a different URL ( the "Route
>> Redirect" input) but this is probably wishful thinking - even if does
>> allow me to redirect requests, it would probably apply to all the
>> webapps in the cluster, which wouldn't meet the requirement. The
> status
>> page teases me by listing all the JkMounts and JkUnmounts, but doesn't
>> allow me to change them; adding a JkUnmount dynamically would be a
> good
>> solution.
>>
>>
>>
>> Any Ideas?
>>
>>
>>
>> John
>>
>>
> 
> *
>> The information contained in this communication is confidential, is
>> intended only for the use of the recipient named above, and may be
>> legally privileged.
>>
>> If the reader of this message is not the intended recipient, you are
>> hereby notified that any dissemination, distribution or copying of
> this
>> communication is strictly prohibited.
>>
>> If you have received this communication in error, please resend this
>> communication to the sender and delete the original message or any
> copy
>> of it from your computer system.
>>
>> Thank you.
>>
> 
> *
>>
>
>
> -
> 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]
>
>


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



[OT-ANN] Java Web Parts v1.0 beta3

2006-01-23 Thread Frank W. Zammetti
Hi all... I haven't been posting JWP release announcements here lately, 
and generally I will refrain from doing so, but the team just put out a 
new release last night and I think it has some features that might be of 
interest to many of you...


* AjaxTags now has some new capabilities, including the ability to have 
multiple config files, the ability to have static parameters on the 
target URLs, a built-in debugging facility and an implicit passing in of 
the ajaxRef with each request, so now you can always determine which 
element fired the event.


* The Chain implementation now supports loading config files from JAR 
files, and there is now a SimpleCommand that you can extend (instead of 
implementing Command) that has default implementations of all three 
Command methods (init(), execute() and destroy()), so you can only worry 
about the ones that interest you.


* A new popup calendar widget has been added to the UIWidgets taglib.

* JSDigester was added to the JSTags taglib.  JSDigester, as you may be 
able to guess, is a client-side implementation of our beloved Commons 
Digester.  It is not as full-featured as it's big brother, but it can 
come in *very* handy, just like the full-fledged Digester.


Take care!

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Re: Do idle servlets get unloaded/reloaded?

2006-01-24 Thread Frank W. Zammetti
Hi Blair,

On Tue, January 24, 2006 2:41 pm, Blair Cooper said:
> I have a servlet running on Tomcat 5.5. If it sits idle for a while and
> then
> I hit it, the init() method gets called again. "autoDeploy" is set to
> false.
> Is this expected behavior?

As per the servlet spec, the container can unload and reload a servlet as
needed.  It is an expected *potential* behavior.  My own personal
experience would indicate it's rare, but you have to design for it.

> If this is expected, shouldn't destroy() get called at some point prior to
> the init()?

I would expect destroy() to get called at some point before init() does a
second time, but I'm not sure if that is a guarantee of the spec.  Seems
like it probably would be though.

> The problem I'm having is that the init() method ends up try to recreate
> objects that where created by a previous call to init(). My destroy()
> method
> would have cleaned up the earlier instances if it had been called. I have
> logging in the destroy() method so I know that it didn't get called.


Implement some sort of check in init() to determine if it has fired
already or not.  A simple static boolean field on the servlet should do
the trick.  So, maybe you have:

private static boolean isInitialized;

Then in init(), you do:

synchronized (isInitialized) {
  if (!isInitialized) {
// Do initialization tasks.
isInitialized = true;
  }
}

> Thanks,
>
> Blair

Frank

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



Re: From Java to C#, ASP.NET [Off Topic]

2006-01-27 Thread Frank W. Zammetti
On Fri, January 27, 2006 8:11 am, David Smith said:
> I will say I have used their products to develop solutions in the past
> and it's ... well ... interesting.  The stuff works well when you know
> how to use it.  Unfortunately I found their docs no where near the
> quality of Tomcat or Java which prolonged development on something that
> should have been extremely simple.

Wow, I've had just the opposite experience with their stuff.  Especially
in terms of documentation, I've always found MSDN to be some of the best
documentation around, generally far superior to most open-source
documentation (my guess is they have some generally non-technical editors
looking it over... I can't imagine that quality of writing came from
techies!)  I will say though that they do tend to be a little short on
examples, something open-source tends to have a lot more of.

I think it's a difference in culture behind it... MS is coming from a more
"professional", business-like approach, and in that mindset writing
documentation takes on more importance.  In the open-source world, there's
much more of the "here's an example, go look at it and learn" kind of
mentality.  I'm not making a judgment on which is better, I think they
both have their pluses and minuses, just pointing out what I see as a
difference.

> Also the whole C#/aspx design is
> centered around events just like Windows itself which I find just a
> little disconcerting.  Not a problem if you're already familiar with
> programming in Access.  I would prefer a cleaner, more visible flow.

I'm not sure where the Access analogy comes in, but I do agree in that if
you haven't done much with the event-driven model before then it can be a
little disconcerting.  I think we're seeing the same thing in the Java
space with JSF right now... it's a basically event-driven model (they call
it component-oriented, but it's in many ways the same thing), and this is
somewhat new to many... ASP.Net is like bringing Windows programming to
the web, whereas JSF is like bringing Swing to the web... imperfect
analogies I suppose, but close enough :)

Frank

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



Re: From Java to C#, ASP.NET [Off Topic]

2006-01-29 Thread Frank W. Zammetti



Martin Gainty wrote:

we just inherited some vb code that accomplishes a cryptography algorithm
just to get this to run under windoze took me 4 hours..the lack of VB 
doc was the blocking factor

or maybe its probably because Im not a VB guy and never will be
btw that same functionality can be accomplished with java libraries in 
under 1 hour


Doesn't sound like a fair comparison to me... give me someone who's not 
a "Java guy", like your not a VB guy, and ask them to do the same 
thing... it may well take the same amount of time.  Your right in that 
the functionality is easier in Java, but would someone who isn't versed 
in Java know that, or be able to figure it out quite as fast?  I doubt it.



why?
there are opensource sites located world-wide in other words
A little digging and some hard work on anyone's part will always get you 
an answer

I cannot say the same thing for VB


Are you talking VB or VB.Net?  If your talking VB, you aren't looking in 
the right places.  There is *plenty* of readily-available knowledge out 
there about VB.


VB.Net is a different story... it's newer, and the resources haven't had 
time to build up to the same level (true in general for .Net).  Give it 
another year or two and see what's out there.  I think it'll be comparable.


BTW: (VB).Net is an example of market forces pushing a company MS to 
develop a product (.NET) that meets marketplace need

I for one welcome MS into the OOA/OOD world


I agree.  And, this is one of the rare times that MS got it closer to 
right than wrong the very first time.  It's not perfect, I don't think 
anyone is claiming it is (no one worth listening to anyway), but 1.0 
wasn't bad at all, and 2.0 improves things from everything I've heard 
(I'm only a casual .Net user myself).


Frank

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



Re: From Java to C#, ASP.NET [Off Topic]

2006-01-29 Thread Frank W. Zammetti

Martin Gainty wrote:
On the subject of doc ..I find any specifics about VB quite difficult to 
locate and blogs are not nearly as numerous as java


Interesting.  Although I don't consider blogs a source of worthwild 
information on anything (and yes, that includes my own!), I've always 
found a wealth of VB knowledge on the web.  Probably not quite as much 
as Java, but still.


I would strongly encourage every academic institution to replace their 
VB offerings with .NET to prepare their students for current as well as 
future markets (in general)

and the OOD world (specifically)


I'd agree with that.  Although, considering the difficulty we are 
currently having at my company finding VB experts (I long since ceased 
being an expert myself), perhaps colleges *are* preparing their students 
for the work world ;)  I know a COBOL programmer that just landed 
himself a job making more than I am!  I wouldn't be surprised if VB is 
the next COBOL in that regard :)

Frank


Thanks Frank,
M-

- Original Message - From: "Frank W. Zammetti" 
<[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Sunday, January 29, 2006 12:09 PM
Subject: Re: From Java to C#, ASP.NET [Off Topic]





Martin Gainty wrote:
we just inherited some vb code that accomplishes a cryptography 
algorithm
just to get this to run under windoze took me 4 hours..the lack of VB 
doc was the blocking factor

or maybe its probably because Im not a VB guy and never will be
btw that same functionality can be accomplished with java libraries 
in under 1 hour


Doesn't sound like a fair comparison to me... give me someone who's 
not a "Java guy", like your not a VB guy, and ask them to do the same 
thing... it may well take the same amount of time.  Your right in that 
the functionality is easier in Java, but would someone who isn't 
versed in Java know that, or be able to figure it out quite as fast?  
I doubt it.



why?
there are opensource sites located world-wide in other words
A little digging and some hard work on anyone's part will always get 
you an answer

I cannot say the same thing for VB


Are you talking VB or VB.Net?  If your talking VB, you aren't looking 
in the right places.  There is *plenty* of readily-available knowledge 
out there about VB.


VB.Net is a different story... it's newer, and the resources haven't 
had time to build up to the same level (true in general for .Net).  
Give it another year or two and see what's out there.  I think it'll 
be comparable.


BTW: (VB).Net is an example of market forces pushing a company MS to 
develop a product (.NET) that meets marketplace need

I for one welcome MS into the OOA/OOD world


I agree.  And, this is one of the rare times that MS got it closer to 
right than wrong the very first time.  It's not perfect, I don't think 
anyone is claiming it is (no one worth listening to anyway), but 1.0 
wasn't bad at all, and 2.0 improves things from everything I've heard 
(I'm only a casual .Net user myself).


Frank

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







--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

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



Context Path

2006-01-31 Thread Antonio W. Lagnada
Hi Everyone,

Is there an assumption or some unwritten rule on what the context path
should be when deploying a web application in Tomcat (or any other standard
J2EE Web Server)?

Should an application context like this be allowed?

   # Context 1
   context = "/myapp/app1"

   # Context 2
   context = "/myapp/app2"

I double checked the current Servlet Specification (2.4) and the document
was not very specific on what the rules are on the context path.  All it
noted was that the web application context path must be unique.

We have a lead architect that insists on deploying applications this way.
The problems where running into now is that the Tomcat deployer (/manager)
app fails to deploy the second application that has a similar appcontext
pattern (/myapp).  It's probably obvious to most of you why.

Deploy app1.war to context /myapp/app1 (using /manager)  ---> SUCCESS
Deploy app2.war to context /myapp/app2 (using /manager)  > FAILED

The only issue I see with this is that when Tomcat extracts the contents to
${catalina.home}/webapps directory it super imposes the /myapp/app1
directory when deploying /myapp/app2.

Anyways, you're worthy insights will be appreciated.


APR in Tomcat 5.5

2006-02-02 Thread Antonio W. Lagnada
Hi All,

Once I have apr installed, what is the configuration change that I need to
do to let tomcat know to use apr?

Thanks


Re: APR in Tomcat 5.5

2006-02-02 Thread Antonio W. Lagnada
Thanks.  I'm assuming I need to append it to LD_LIBRARY_PATH as such:

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/apr

What about in WindowsXP? Do the dlls just need to be in C:\Windows\system32?

On 2/2/06, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
>
> > From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
> > Subject: RE: APR in Tomcat 5.5
> >
> > None, assuming the APR native library is installed in the
> > proper place.
>
> Should have mentioned that the proper place is normally specified by the
> LD_LIBRARY_PATH environment variable or the java.library.path system
> property.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Antonio W. Lagnada
[EMAIL PROTECTED]


SSL on Virtual Hosts

2006-02-02 Thread Antonio W. Lagnada
Hi All,

As far as I know there's only one place to set the keystore in tomcat (
server.xml).



Will tomcat support https on virtual domains?

If I have placed "www.host1.com" and "www.host2.com" on my keystore, will
tomcat map the correct domain entry?  Right now I think the first entry gets
used all the time no matter what host name is being used.

https://www.host1.com  -> mapped to www.host1.com keystore entry
https://www.host2.com  -> ALSO mapped to www.host1.com keystore entry

--

Thanks


Re: Servlet filter on j_security_check

2006-02-02 Thread Frank W. Zammetti
Yes, it is generically possible... I have the following mapping in one of
my apps:

  
InitialLoginFilter
/j_security_check
  

This runs on Websphere though, so maybe there is some limitation with
Tomcat.  In general though, it appears it is possible.

One suggestion: change to a servlet mapping for the filter.  IIRC,
j_security_check is just a servlet that is set up by the container, so
that might work.  I kind of doubt it, but for the 30 seconds it'll take to
try, worth a shot.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Thu, February 2, 2006 2:51 pm, Martin Dubuc said:
>  I am using form based authentication in my  application. I would like to
> know if it is possible to install a  Servlet filter on j_security_check.
>
>   I have tried to install one, but it never gets invoked. Here is my
> filter definition in application web.xml:
>
>   
>   LoginFilter
>   LoginFilter
>   Performs pre-login and post-login
> operation
>   
>
>   
>   LoginFilter
>   /j_security_check
>   
>
>   I have some logs in the doFilter function. It seems like doFilter never
> gets called. However, if I set the url-pattern property to /*, doFilter
> gets called while rendering pages, but doesn't seem to be invoked from
> j_security_check.
>
>   Comments? Suggestions?
>
>   Martin
>
>
>
> -
> Bring words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.


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



Re: Servlet filter on j_security_check

2006-02-02 Thread Frank W. Zammetti
Well, there you go Martin :)

Tim, is this something peculiar to Tomcat that doesn't allow it?  As I
mentioned in my previous post, I in fact do this in an app running on
Websphere.  Or, maybe its a case of Websphere letting me do something it
really shouldn't?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Thu, February 2, 2006 2:53 pm, Tim Funk said:
> You can't install a filter on j_security_check
>
> -Tim
>
> Martin Dubuc wrote:
>
>>  I am using form based authentication in my  application. I would like
>> to know if it is possible to install a  Servlet filter on
>> j_security_check.
>>
>>   I have tried to install one, but it never gets invoked. Here is my
>> filter definition in application web.xml:
>>
>>   
>>   LoginFilter
>>   LoginFilter
>>   Performs pre-login and post-login
>> operation
>>   
>>
>>   
>>   LoginFilter
>>   /j_security_check
>>   
>>
>>   I have some logs in the doFilter function. It seems like doFilter
>> never  gets called. However, if I set the url-pattern property to /*,
>> doFilter  gets called while rendering pages, but doesn't seem to be
>> invoked from  j_security_check.
>>
>
> -
> 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]



Re: Servlet filter on j_security_check

2006-02-02 Thread Frank W. Zammetti
Interesting.  Thanks for that info!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Thu, February 2, 2006 3:04 pm, Tim Funk said:
> If you want to be spec compliant. There is a bugzilla entry with respect
> to
> this and confirmation by the expert group that Tomcat's behavior is
> correct.
>
> -Tim
>
> Frank W. Zammetti wrote:
>
>> Well, there you go Martin :)
>>
>> Tim, is this something peculiar to Tomcat that doesn't allow it?  As I
>> mentioned in my previous post, I in fact do this in an app running on
>> Websphere.  Or, maybe its a case of Websphere letting me do something it
>> really shouldn't?
>>
>
> -
> 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]



RE: [Friday] - finding the Mavens in the Java world

2006-02-03 Thread Frank W. Zammetti
If one were being sarcastic and jaded (although a bit realistic at the
same time unfortunately):

select count(first_name) as c from [postings on tomcat.apache.org] where
unemployed='T' and not_married='T' and no_kids='T'

Since most of us with regular jobs don't generally have time to play with
all the things we'd like to.

(P.S., never do a count on *, it's less efficient :) )

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Fri, February 3, 2006 1:18 pm, Daniel Blumenthal said:
> - "select count(*) as c from [postings on tomcat.apache.org] group by
> email
> order by c desc", and then figure out which are the clued-in, and which
> are
> the clueless
> - repeat, with other listservs
>
>
>> -Original Message-
>> From: David Thielen [mailto:[EMAIL PROTECTED]
>> Sent: Friday, February 03, 2006 12:59 PM
>> To: tomcat-user@jakarta.apache.org
>> Subject: [Friday] - finding the Mavens in the Java world
>>
>> Hi all;
>>
>>
>>
>> For those of you that have read The
>> <http://www.amazon.com/gp/product/0316346624/sr=1-1/qid=113858
>> 9404/ref=pd_bb
>> s_1/002-3569767-9990453?%5Fencoding=UTF8>  Tipping Point,
>> this will make sense (I think). For those that haven't, a
>> maven is a person that trys just about every interesting
>> program they see, and then tells others what they think about
>> it. They're the ones the rest of us depend on to tell us what
>> is worth trying and what new programs we should just skip.
>>
>>
>>
>> We want to give a free copy of Windward
>> <http://www.windwardreports.com/> Reports to all mavens in
>> the Java (and .NET) programming world (value $1,134.00). No
>> conditions or requirements or anything like that. A free
>> regular copy with no limitations except that they cannot resell it.
>>
>>
>>
>> Why?
>>
>>
>>
>> We figure if we give them a copy, they might use it. And if
>> they use it, we figure they'll probably post or write about
>> it. So we're not asking them to do anything - but we figure
>> our odds are pretty good they will. (Yes, we believe that
>> much in our reporting engine.)
>>
>>
>>
>> So. Any ideas on how to find these people and make the offer to them?
>>
>>
>>
>> Thanks - dave
>>
>>
>>
>>
>>
>> David Thielen
>>
>>  <http://www.windwardreports.com> www.windwardreports.com
>>
>> 303-499-2544
>>
>>
>>
>>
>>
>>
>
>
>
> -
> 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]



Re: Help with detecting session timeout

2006-02-18 Thread Frank W. Zammetti
From an applet?  There probably is no easy answer... any solution would 
involve either polling the server from the servlet, or pushing the 
status out to the servlet... the later should be doable from a 
SessionListener... record the remote IP when the session is created, and 
send a ping to it when the session expires.  The problem with that 
though is when NAT and other address translation techniques get 
involved, there's a good chance it won't work.  That's why polling is 
the more usual solution in situations like this.


Frank

Klotz Jr, Dennis wrote:

Is there an easy way to detect that a session has timed out from within
an applet?

Regards,

-Dennis

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



Re: Container Managed Security

2006-03-03 Thread Frank W. Zammetti
The best book I've seen that discusses this is Head First Servlets & JSP
(ISBN 0-596-00540-7).  Overall it's a pretty good book, but the section on
CMS was especially concise and easy to understand... my experience, since
I learned it myself and then had to teach a number of other people, is
that CMS is a little... mmm, weird I guess... but then when you have that
Eureka! moment, you feeel *really* stupid for not getting it quicker :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Fri, March 3, 2006 1:27 pm, James Reynolds said:
>
> I'm just starting out with Container Managed Security with Shale/JSF and
> Tomcat 5.1.15.  I've successfully created a JNDI DataSource and a Realm,
> now I want to define form based authentication and security constraints
> in my web.xml.
>
>  I began my study with the J2EE 1.4 Tutorial,
> but most of that info seems to pertain specifically to Sun's App Server
> - referencing utilities on it's admin page.  I've also found a ton of
> information in the mailing list and the web, although they're mostly
> snippets of information.  I'm having a difficult time putting the whole
> picture together and, as a result, my initial attempts are failing.
>
> Can you recommend a book or link that provides a good "getting started"
> approach for the newbie?
>
>
> -
> 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]



Re: Disappointed

2006-03-09 Thread Frank W. Zammetti
The Tomcat mailing list, like Tomcat itself, and like most open-source 
projects in general, are volunteer efforts.  People will answer what 
they feel they can, when they can.  You should start by having no 
expectation of getting an answer because you in fact may not, because no 
one knows the answer, because no one has the time to answer, or yes, 
because your question was silly (I don't know what your question was, so 
I cannot judge) or just because no one felt like answering.  If people 
deem your question to be something you should be able to answer yourself 
without much trouble, you may not get an answer (or you may get a simple 
RTFM answer).


As a volunteer endeavor, all of these are perfectly valid response, or 
non-responses, as the case may be.


One thing to keep in mind is that the open-source community is sometimes 
not the friendliest place.  Being nice is not valued as much as 
technical prowess is.  Between you and me, it personally took me a good 
deal of time to come to this understanding too.  I value people being 
cordial and helpful with each other, and I personally strive to bring 
those qualities to any post I make (sometimes I succeed and sometimes I 
don't!) but that is not a primary driver of a mailing list like this, 
technical discussion is.


I think the de facto standard to go by is codified here:

http://www.catb.org/~esr/faqs/smart-questions.html

Read this and you will understand the community-driven projects like 
Tomcat a lot better I think and be able to interact better with them 
with the proper expectations.


Frank

Mike Sabroff wrote:
I have read and sometimes participated in these postings and answers in 
hopes of either finding answers to problems I am having or might have in 
the future and found it a well organized and contained group.
I am disappointed though, in that I have posted a question in hopes of 
help with a problem I am experiencing and notta zilch zap. No response 
of any kind. So I posted it again and whappo,  forget you. No answer. Is 
it common to have to post several times before getting a response? Is 
there a time delay because of the numerous amounts of threads? Is it 
something I did?
I see a lot of really dumb things going through the postings and most of 
the time I try to remember that I once new nothing of Tomcat too, and 
that I still don't know very much and that no question is too dumb. Is 
my question too dumb?
Have I been Black-Listed because I had a cruel response on one of those 
days that I just couldn't hold it back anymore?


WASSUP???

Mike



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



Re: Disappointed

2006-03-09 Thread Frank W. Zammetti

Hehe, thanks for boiling my response down to a single line Leon! :) LOL

Frank

Leon Rosenberg wrote:

http://www.catb.org/~esr/faqs/smart-questions.html

:-)
Leon

On 3/9/06, Mike Sabroff <[EMAIL PROTECTED]> wrote:

I have read and sometimes participated in these postings and answers in
hopes of either finding answers to problems I am having or might have in
the future and found it a well organized and contained group.
I am disappointed though, in that I have posted a question in hopes of
help with a problem I am experiencing and notta zilch zap. No response
of any kind. So I posted it again and whappo,  forget you. No answer. Is
it common to have to post several times before getting a response? Is
there a time delay because of the numerous amounts of threads? Is it
something I did?
I see a lot of really dumb things going through the postings and most of
the time I try to remember that I once new nothing of Tomcat too, and
that I still don't know very much and that no question is too dumb. Is
my question too dumb?
Have I been Black-Listed because I had a cruel response on one of those
days that I just couldn't hold it back anymore?

WASSUP???

Mike

--
Mike Sabroff
Web Services
Developer
[EMAIL PROTECTED]
920-568-8379


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






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



Somewhat OT: Multiple auth methods in one webapp?

2006-03-16 Thread Frank W. Zammetti
Hello... I marked this Somewhat OT because what I'm trying to accomplish
would ultimately be running in Websphere.  However, I would like to
develop it under Tomcat as I've always done, and it's also a general
webapp question...

I have an existing webapp that uses form-based authentication.  Now I'm
being asked to expose some Web Services from it, and I'm thinking of using
AXIS.  However, one of our requirements is that HTTP be secured with basic
auth.

Ideally I would like to add AXIS to my existing webapp, but it doesn't
seem possible to use both auth forms in a single webapp.  In a perfect
world I could continue to secure the user-accessible app with form-based
auth, but secure just the path to the AXIS-based services via basic auth. 
I'm thinking the only way is to have a second webapp, but can anyone think
of another solution?  Thanks!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

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



RE: Somewhat OT: Multiple auth methods in one webapp?

2006-03-16 Thread Frank W. Zammetti
On Thu, March 16, 2006 12:48 pm, Jay Burgess said:
> I pursued a very similar exercise last week. I have a webapp using BASIC
> authentication and wanted to add in an RSS interface that used DIGEST
> authentication.  Unfortunately, I never could figure out how to do this in
> a
> single webapp.  I figured I'd chime in, though, as I think it'd be a nice
> feature if it's not already possible.

Thanks Jay, I appreciate knowing at least that I'm not alone :)

Do you know, or does anyone else know, where the server looks for the
credentials when the challenge box has been submitted?  In other words,
does the entered username and password get passed as a specific header or
a request parameter?  Obviously 5 minutes of Googling would find me the
answer, but since we're already here... :)

I'm thinking that it shouldn't be at all difficult to write a
BasicAuthFilter (assuming one doesn't already exist) for doing this, which
would allow both of us to do what we want.  Should be a simple matter of
(a) sending back a 401 if no credentials are supplied, or (b) calling on
the security provider to authenticate if they are.  I would add such a
filter to Java Web Parts, and with the expanded mapping capabilities we
provide with those filters, it should do the trick nicely.

> Jay

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!


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



RE: Somewhat OT: Multiple auth methods in one webapp?

2006-03-16 Thread Frank W. Zammetti
On Thu, March 16, 2006 2:26 pm, Caldarale, Charles R said:
>> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
>> Subject: RE: Somewhat OT: Multiple auth methods in one webapp?
>>
>> Do you know, or does anyone else know, where the server
>> looks for the credentials when the challenge box has
>> been submitted?
>
> See section 12.5 of the Servlet spec (you probably have that memorized
> by now) and RFC 2617, which covers both Basic and Digest authentication
> for HTTP.

Thanks Chuck, saves me the time to find it.

But no, I'm not the guy that memorizes specs, that is very clearly Craig
McClanahan's title :)  The man's instant recall of spec is astounding!

>  - Chuck

Frank

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



Re: Converting characters to "ascii" value

2006-03-19 Thread Frank W. Zammetti
The first 127 characters of Unicode are in fact ASCII (might be the 
first 255, I'm not sure, but the first 127 for sure).  In other words, 
it you do:


int i = (int)'A';

will result in i=65, the ASCII value for A.  char is a numeric type 
remember, so you don't really have to cast to int, I just did it that 
way to better illustrate what was happening.


To go the other way, it's just:

int i = 65;
char c = (char)i;

That assumes i<127.

Frank

David Kerber wrote:
I know "Ascii value" isn't quite the correct term, but it's the only one 
I could come up with.


What Im trying to come up with is the simplest way of coming up with the 
numeric value associated with a given character, and to go back the 
other direction as well.  In VB, these are the ASC() and chr() 
functions.  I know how to get these values by going through a Byte type, 
but is there a quicker way to get (for example):


Starting with "B", return 66, or starting with " " (one space), return 32?
Going the other way, 66 should return "B", and 32 should return " ".

Thanks for any suggestions!
DAve



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



  1   2   3   4   >