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



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

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


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

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

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: [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
  

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.



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



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

  

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

  

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

  

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


Tomcat 8.5.13

2017-04-11 Thread Flora, Norman W
I am using Tomcat 8.5.13 and am trying to setup SSL with a self-signed cert. I 
have created the keystore and edited the server.xml with the info below..
I can get to the default site via 8080 but when I go to 8443 it just spins 
(never errors). Any ideas?








Norman William Flora III
Senior Systems Administrator

Email:nfl...@aacps.org
Desk: 410-222-5260 ext.3
Mobile: 410-533-1848
Home:   410-286-3120




Please consider the environment before printing this e-mail.


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


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: Tomcat & SOAP/Rest +/- jax-ws or Axis2 or cxf ????

2015-11-01 Thread Howard W. Smith, Jr.
On Sun, Nov 1, 2015 at 2:31 AM, N.s.Karthik  wrote:

> Hi
> spec : jdk 1.7
> Container Tomcat 7.x
> O/s : Oracle Linux
>
> Question : Need a *Simple & Single Framework to support both "SOAP & Rest"*
> based  services.
>
> Which one is the best to make use of ??
>
> Jax-ws   OR   Axis2  OR  Cxf  or 
>
>
http://tomee.apache.org/apache-tomee.html


Re: Tomcat 8 reliability/performance on Windows 2008 R2 Server vs. RHEL/CentOS

2015-10-01 Thread Howard W. Smith, Jr.
On Thu, Oct 1, 2015 at 11:46 AM, Aurélien Terrestris 
wrote:

> I recommend Linux for 2 reasons :
>  - easier to install and maintain a secured Tomcat (especially when
> using different TOMCAT_HOME & TOMCAT_BASE, on Windows it's pretty
> difficult to know how to secure all directories correctly) ; if you
> have to deal with file uploading, you don't want a system which could
> launch any exe,..
>  - doesn't need to reboot every 3 days because of the memory
> fragmentation or anything else
>

Multiple tomcat/tomee instances are running well on Windows 2008 R2 Server
for me.

- does 'not' reboot every 3 days at all
- only reboots automatically at 3am when there is a Windows update for the
Windows 2008 R2 Server
- my apps shut down with no issues and restart (via Windows Service for
each tomcat/tomee instance) with no issues
- the embedded Apache Derby database is/has never corrupted due to loss of
power or restart (for Windows update)
- never had to set or maintain TOMCAT_HOME and/or TOMCAT_BASE environment
variables
- i only set/maintain JAVA_HOME and JRE_HOME environment variables
(whenever there is a Java version update)
- my 2 apps (and/or tomee instances) run under 500MB and 1GB of RAM,
respectively, and CPU seem to max out between 4 to 10% (on average)
- Java EE 6 full blown stack (JPA, JSF, JMS) running on main tomee instance
using under 1 GB of RAM
- Java EE 6 RESTful + JMS running on 2nd tomee instance using under 500MB
of RAM
- use tomcat7w.exe and tomee4restw.exe to start, stop, edit the Windows
Services for the tomcat/tomee instances
- Windows = piece of cake (for me)
- as Andre' mentioned, use Remote Desktop connection to connect to the
Windows 2008 R2 Server
- i remove default tomcat/tomee web app (ROOT folder, etc...) and deploy my
WAR to webapps folder
- i'm loving tomcat/tomee on Windows Server
- have 32 GB of RAM available, only using (approximately) 4GB because of my
java heap settings for both tomcat/tomee settings


Re: Is Container Managed Transactions possible in case of Tomcat ?

2015-08-19 Thread Howard W. Smith, Jr.
On Aug 19, 2015 3:56 PM, "Sreyan Chakravarty" 
wrote:
>
> TomEE supports Apache OpenJPA. What if I wanted to use Hibernate as my JPA
> provider ?
>

I searched Google for

tomee hibernate tutorial

And found

http://tomee.apache.org/examples-trunk/jpa-hibernate/README.html

https://rmannibucau.wordpress.com/2012/07/01/hibernate-tomee/

And many more. Please subscribe to the Apache TomEE user list, download
latest version, and ask any further questions on the tomee user list.

> On Wed, Aug 19, 2015 at 9:53 PM, Alex Soto  wrote:
>
> > Yeah in this case you should take a look at Apache TomEE which is Apache
> > Tomcat + Java EE and you will get all of these for free :).
> >
> > El dc., 19 ag. 2015 a les 18:18, Daniel Mikusa () va
> > escriure:
> >
> > > On Wed, Aug 19, 2015 at 12:03 PM, Sreyan Chakravarty <
> > > sreyan.mail...@gmail.com> wrote:
> > >
> > > > I planning to use JPA (Hibernate) in a small project that I am
> > > developing.
> > > > Now I have heard a lot about the benefits of using Container Managed
> > > > Transactions(CMT) for JPA in web apps. But most of the tutorials on
the
> > > web
> > > > use either GlassFish or JBoss, so I was wondering is CMT supported
by
> > > > Tomcat. Send me a link to the documentation for this if there is
any.
> > > > Please note that I am going to use a datasource to connect to my
> > database
> > > > and I am using persistence.xml(JPA style) to use Hibernate.
> > > >
> > >
> > > If you're referring to JTA, then no.  Tomcat doesn't implement that.
> > > Tomcat only implements a subset of the JEE spec.
> > >
> > > http://tomcat.apache.org/whichversion.html
> > >
> > > However most of the parts of the spec that Tomcat does not implement
can
> > be
> > > pulled in via libraries.  For JTA you can use a third party
> > implementation
> > > with Tomcat.  Atomikos, JOTM and Bitronix are ones that come to mind.
> > >
> > > These docs are a little dated, but should get you started.
> > >
> > > http://www.atomikos.com/Documentation/TomcatIntegration
> > > http://jotm.objectweb.org/current/jotm/doc/howto-tomcat-jotm.html
> > >
> > > Dan
> > >
> >


How to force Tomcat to use the system clock?

2015-03-06 Thread Salisbury, Richard W DLA CTR INFORMATION OPERATIONS
Greetings,

We have found a need to stop and start Tomcat once in a while to allow
Tomcat to connect via HTTPS with some other servers.  We think the
restart may be synchronizing the time Tomcat uses with the server OS
system time, and we are looking for ways to prevent having to stop/start
Tomcat.

Details:
Our instance of Tomcat 6.0.36 runs on HP-UX B11.31 ia64 with JVM Version
1.7.0.08.  It hosts a custom servlet which, when invoked, connects with
a remote server via HTTPS to retrieve some data.  However, after about a
month the timestamp Tomcat sends in the SSL handshake appears to drift
enough for the remote server's time to start rejecting requests because
the timestamp is too far off (according to our partner's remote
application logs).  

We have confirmed that our server clock is set correctly and synced with
NTP, and matches the system clock on the remote server, which also uses
NTP.  So one thing we thought might be happening is that Tomcat (or the
Java that Tomcat runs on) may be keeping an internal clock, perhaps
using a separate thread as a way to speed up the retrieval of time so
that it does not have to go to the OS system clock every time it needs
the current time.  And maybe this internal clock is not synced with the
server time until Tomcat (or the JVM) is restarted.

If this is the case, would anyone have an idea of how to force Tomcat
(or Java) to use the server's system clock every time instead of using
its own internal clock?   We do not care about the performance hit on
this because this is a low-volume application.  Or, if we are
misunderstanding Tomcat and it actually uses the system clock every time
it needs to get the current time, is there something else we should be
looking at?

We have researched on the web, checked the Apache mail archives, read
the Tomcat configuration guide, looked up the Java system options, but
have not studied the Tomcat source code yet.  We did find that there is
a Java Wrapper product out there by Tanuki Software that provides an
option to use system time or a background thread, which is what caused
us to wonder if Tomcat might be doing something similar.

For more information on what the Tanuki wrapper does, here is an excerpt
we found on their website
http://wrapper.tanukisoftware.com/doc/english/prop-use-system-time.html:
"As of Wrapper version 3.1.0, a new timer mechanism was added to the
Wrapper. This new timer was made the default in Wrapper version 3.2.0.
Rather than keeping time by querying the system clock, the Wrapper
creates a background thread which enters a light weight loop and
increments an internal "tick" counter.  Internally all timekeeping has
been modified to be based on these "ticks". (If the system time is being
used, then the tick count at any particular moment is calculated from
the system time rather than from the counter.) "

Thanks in advance for any ideas that are shared. 
Richard


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



Re: RES: Configuring limits of requests/sessions/threads in Tomcat

2014-04-01 Thread Howard W. Smith, Jr.
On Tue, Apr 1, 2014 at 9:30 PM, Frederik Nosi wrote:

> If so, just put an nginx or such in front of you'r Tomcat, you dont need
> an application server for that, it's just like using a tank to shoot a
> mosquito :P


Wow, LOL!


Re: Request for better deployment usability: should be able to specify context root inside war

2014-03-31 Thread Howard W. Smith, Jr.
On Mon, Mar 31, 2014 at 1:27 PM, Mark Eggers  wrote:

> As far as Glassfish versus Apache Tomcat goes, they address different use
> cases. Glassfish is a J2EE application server. Apache Tomcat is a servlet
> container. While you can convince Apache Tomcat to do a lot of things, at
> some point it's better to run an application server if your requirements
> dictate it. Apache TomEE is a good choice.
>

+1 TomEE is a good choice, and it makes you a Tomcat user, too. :)


>
> BTW, I like Glassfish and Apache TomEE. It just depends on my use case.
>

As one that migrated from Glassfish to TomEE, my recommendation is TomEE.


> Concerning string concatenation, I think you would be surprised. Since
> strings are immutable, concatenating strings is very expensive if you're
> doing more than a few. I believe I read somewhere that concatenating 'n'
> strings is proportional to the quadratic of n. In short, ouch. Are there
> better places to spend time on optimization? Probably, but this depends on
> your application. Is concatenating 100 strings using the concatenation
> operator needlessly expensive? Most probably.
>

In the past, i worked on a contract where I moved some string-processing
Powerbuilder logic from PowerBuilder/client to database stored proc.
Previously, the Powerbuilder client-side string-processing code took 1.5
hours to complete; after i moved the logic to database stored proc, it took
2 to 10 seconds to complete. :)


Re: [OT] timeout

2014-03-31 Thread Howard W. Smith, Jr.
On Mar 31, 2014 3:48 AM, "André Warnier"  wrote:
>
> Howard W. Smith, Jr. wrote:
>>
>> On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R <
>> chuck.caldar...@unisys.com> wrote:
>>
>>>> From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com]
>>>> Subject: Re: timeout
>>>>>
>>>>> - and if that is not the reason, then find the person responsible for
>>>
>>> the
>>>>>
>>>>> in-between equipment and ask them why their junk closes the connection
>>>>> before your application has a chance to respond
>>>>
>>>> 'junk'? please clarify the usage of the word 'junk', here. :)
>>>
>>> I think the definition "something of poor quality" would fit in this
case,
>>> if the poor quality were a result of configuring equipment without
regard
>>> to the requirements of the network users.
>>>
>>>  - Chuck
>>>
>>
>> understood, thanks Chuck. :)
>>
>
> Yes, what I meant precisely was thus : if after receiving numerous
complaints from your users and your boss that your application is
misbehaving; after an in-depth review of the Apache httpd and tomcat
on-line documentation; after a level-headed discussion of the issue with a
group of independent experts; after a thorough witnessed interview of a
significant sample of the users to ascertain their professional behaviour
in front of a browser and the absence of any problem with their mouse
buttons; after a careful and time-consuming examination of all the
evidence, including the access logs of both tomcat and httpd; if after all
that thus you would come to the inescapable conclusion that it is the
intermediate firewall/gateway that is the cause of all the trouble, then
when you talk to the people responsible for that equipment, the word that
might come to mind then, to qualify this equipment and its settings seen as
a whole, is "junk".
>
> Thank you for offering me the opportunity to clarify this section of my
previous post.
>

You're welcome, the pleasure was [almost] all mine, and thank you for the
clarification. :-)

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


Re: timeout

2014-03-30 Thread Howard W. Smith, Jr.
On Sun, Mar 30, 2014 at 9:54 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com]
> > Subject: Re: timeout
>
> > > - and if that is not the reason, then find the person responsible for
> the
> > > in-between equipment and ask them why their junk closes the connection
> > > before your application has a chance to respond
>
> > 'junk'? please clarify the usage of the word 'junk', here. :)
>
> I think the definition "something of poor quality" would fit in this case,
> if the poor quality were a result of configuring equipment without regard
> to the requirements of the network users.
>
>  - Chuck
>

understood, thanks Chuck. :)


Re: timeout

2014-03-30 Thread Howard W. Smith, Jr.
On Sun, Mar 30, 2014 at 6:30 PM, André Warnier  wrote:

> - and if that is not the reason, then find the person responsible for the
> in-between equipment and ask them why their junk closes the connection
> before your application has a chance to respond


'junk'? please clarify the usage of the word 'junk', here. :)


Re: Detecting out-of-memory condition

2014-03-24 Thread Howard W. Smith, Jr.
On Mon, Mar 24, 2014 at 1:57 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: James H. H. Lampert [mailto:jam...@touchtonecorp.com]
> > Subject: Detecting out-of-memory condition
>
> > We have noticed that after a certain amount of continuous uptime, Tomcat
> > eventually runs out of memory.
>
> Your app has a memory leak.
>

I agree. My app runs well after/during continuous uptime, but about a month
ago, a certain part of the app was used for annual reporting. Keep-alive
session is available when accessing/using that part of the app, and there
is a heck of amount of data being selected from database and/or stored in
@SessionScoped beans. A memory leak was exposed in that part of the app.
it's on my to-do list to review and refactor that part of the app to
avoid/fix the memory leak in the future.


Re: Possible Tomcat 8.0.3 issue

2014-03-17 Thread Howard W. Smith, Jr.
On Mon, Mar 17, 2014 at 4:14 PM, Felipe Jaekel  wrote:

> My Tomcat 7 was running fine with this script, but last friday morning I
> started Tomcat 8 setting only this:
> *-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m
> -Dorg.apache.el.parser.COERCE_TO_ZERO=false*
> and the applications crashed too.
>
> So I'd say that the problem is not my JVM config, but I'm interested on
> improving it. What arguments do you recommend to tune GC?
>
> Last friday afternoon I created a new Amazon EC2 instance with Tomcat 7 to
> check, and the problem is still there, so It was a damn coincidence that
> this problem started after I migrate to Tomcat 8. As I had a connection
> pool leak with Tomcat 8 it contributed for me to think that it could be
>

Was the following in your Tomcat7 config before 'and' after migrating to
tomcat8?

-Dorg.apache.el.parser.COERCE_TO_ZERO=false*


Re: Possible Tomcat 8.0.3 issue

2014-03-13 Thread Howard W. Smith, Jr.
On Thu, Mar 13, 2014 at 11:47 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Felipe,
>
> On 3/13/14, 10:57 AM, Felipe Jaekel wrote:
> > There are lots of this in catalina log: *12-Mar-2014 08:41:43.828
> > WARNING [http-nio-80-exec-28]
> > com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource
> >
> >
> JSF1064: Unable to find or serve resource, primefaces.js, from library,
> > primefaces.* *12-Mar-2014 08:41:43.829 WARNING
> > [http-nio-80-exec-28]
> > com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource
> > * * org.apache.catalina.connector.ClientAbortException:
> > java.io.IOException: Connection reset by peer*
> >
> > But these always appeared in my logs, I guess it happens when the
> > client cancel the page load.
>

Felipe,  why would a user cancel the page load? is this quite common that
user cancels page load? are there pages in your app that would
provoke/motivate user(s) to cancel page load? this/some page(s) take a long
time to load?

>
> >
> > I did found something strange in the access log. Applications
> > crashed around 2:20PM. I checked for primefaces.js at this time in
> > the access log and its all 200 status, but I noticed some very
> > small response sizes in some requests, which explains the
> > JavaScripts errors on Chrome console.
> >
> > Here are the log files and some print-screens:
> > https://dl.dropboxusercontent.com/u/66737052/logs-12-03-2014.tar.bz2
> >
> >
> >
> > Nothing changed in the system. I started to use Tomcat 8.0.3 in
> > production on February 28th and the server is restarted daily to
> > recycle PermGen space.
>
> I'm curious about this: what eats-up your PermGen space?
>

if this behavior did not occur in tomcat7, why would it (start to) occur
when using tomcat8?


>
> > I'm using Mojarra 2.2.5.
>

Mojarra 2.2.5 + tomcat8, hmmm

Felipe, which servlet in your web.xml? servlet 2.5, 3.0, 3.1?

Felipe, did you look at tomcat 8 migration guide (URL below)?

https://tomcat.apache.org/migration-8.html



> >
> > This issue started to manifest at 10AM after a parallel deploy. At
> > first only the icons disappeared from the new deployed version, but
> > it was functional. Although new and old deployed versions had
> > PrimeFaces 4.0.9, I started to think that might be something wrong
> > with it, so I deployed a new version using 4.0.10. Problem was
> > solved for some hours, but when it returned the status was what I
> > mentioned above. Tried to parallel deploy with 4.0.8 but no
> > success. After I restarted problem was solved, but in case it's
> > relevant, there was only one version of each application running.
>
> My guess is still OOME: immediately after a parallel-deployment (which
> roughly doubles the non-session resident footprint of your web
> application, which you already say has PermGen issues) things start
> going wonky, and a JVM restart fixes things? My money is on an OOME.
> Note that they don't always have stack-traces along with them, so they
> are easy to miss when eyeballing log files.
>

Felipe, can you share your java settings, similar to what I shared below?

-Xms3G
-Xmx3G
-XX:MaxPermSize=384m
-XX:+UseTLAB
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled



> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJTIdMGAAoJEBzwKT+lPKRYkkkP/31gOfqH+wxtEFTKXbNRmKPx
> 56anmEVQqDo36icLTGRrXS9bhlq5UWZQvdm24n/aA2SeBYJWxOYK0eIU9SnY+Q5w
> CurqA7KLQPw0UVTXXR3k85etGT8Uuivfnup28bPeJTtsifOzlQOHNC/MpyBzhMaR
> vwhc94cXR3HC+eoM5mgGMHiMG17jT1P0ty6kCGuDPPNM3DwVyXxmZE0oQQ+Pgoq9
> XGJEnW1uKJG0vmM4tNRWWCrWxxu0nypMml/a93IdAZNgCkoEUuHnRqS4Qtie9O/i
> sMjuJ/dBrc9qMpBfEvGUhLrO6whFbjnVqwfi6saXIcwvEUhs/w7h0dvOsgF9UxLa
> a8R3mR14QNmLR9Pmh+3OqdwVOx+m4bec5oXjWvitin9RsuaurdRqRDAmvXIWG4ab
> PLTDGaVmKPIx58uizN0WlQloj2haN7FPvlj18rlirb245KK23sYQHPWTRsOV/KXS
> wkzlSmzUoIePzCS6jQcCA+lKQ0Is/+JQvoTlBxOgCV1FlqtYR9LTd4qzTDzsTnuH
> wyhC1+ovscEZPDHlNBUu1RSJGvnB+YccWttcTeXQi3i25bitt+L3HqUyWE7VJbaL
> 9SetiKGcsJK/gx9NzSQXEwEoPXuTK3vPmW4HVgIg6X51TKORZpPsfknX/iBd1Hml
> VFCVjzEC334YBFgULc6a
> =w3Sk
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Possible Tomcat 8.0.3 issue

2014-03-13 Thread Howard W. Smith, Jr.
On Thu, Mar 13, 2014 at 9:33 AM, burghard.britzke <
b...@charmides.in-berlin.de> wrote:

> may be restarting the context would even be sufficient? May be the
> FacesServlet has an issue which implementation are you using? which
> version? which version of PrimeFaces?
>
>
earlier, in the thread, he provided the following:

Chrome console output:

> Resource interpreted as Stylesheet but transferred with MIME type
> text/plain: "
>
http://spdata-apps.net/cliente/javax.faces.resource/theme.css.jsf?ln=primefaces-redmond
".
> login.jsf:3
> Resource interpreted as Script but transferred with MIME type text/plain:
"
>
http://spdata-apps.net/cliente/javax.faces.resource/primefaces.js.jsf?ln=primefaces&v=4.0.9
".
> login.jsf:3
> Resource interpreted as Image but transferred with MIME type text/plain: "
>
http://spdata-apps.net/cliente/javax.faces.resource/loading26.gif.jsf?ln=image
".
> login.jsf:22
> GET
>
http://spdata-apps.net/cliente/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=4.0.9net::ERR_INVALID_CHUNKED_ENCODING
 login.jsf:3

primefaces&v=4.0.9

PrimeFaces Elite 4.0.9

Since I usually scour PrimeFaces forum topics, this is the first person
that I have heard/seen using tomcat 8.0.x with PrimeFaces.


Re: Tomcat7w.exe

2014-03-10 Thread Howard W. Smith, Jr.
On Mon, Mar 10, 2014 at 10:37 AM, Jeffrey Janner <
jeffrey.jan...@polydyne.com> wrote:

> > -Original Message-
> > From: Leo Donahue [mailto:donahu...@gmail.com]
> > Sent: Friday, March 07, 2014 11:10 AM
> > To: users@tomcat.apache.org
> > Subject: Tomcat7w.exe
> >
> > Did I miss something in the documentation about renaming this if one is
> > running multiple windows services of Tomcat?
> >
> > ex:
> > #Prod port 80
> > c:\apache-tomcat
> > c:\apache-tomcat\apache-tomcat-7.0.52
> > service install Tomcat7 (from bin directory here)
> >
> > #Dev port 8080
> > c:\apache-tomcat-dev
> > c:\apache-tomcat-dev\apache-tomcat-7.0.52
> > service install Tomcat7dev (from bin directory here)
> >
> > If I run the Tomcat7w.exe from #Dev, all of those settings point to
> > #Prod.
> >
> > Unless I change the name of Tomcat7w.exe in #Dev to Tomcat7devw.exe,
> > then everything is fine.
> >
> > Was that listed in the docs somewhere and I missed it?
>
> Leo,
> If you use the Windows installer that the foundation thoughtfully
> provides, you'll see that the installer actually renames the executables to
> whatever you put in the "Windows Service Name" field.  So, if you use it to
> install one instance with the service name "Prod", then in the bin
> directory, you will have Prod.exe and Prodw.exe.  If you second instance
> uses the service name "Dev", then the bin directory will have Dev.exe and
> Devw.exe.  And when you go to look for those processes using Task Manager,
> or Process Explorer, or whatever tool you use, they will actually show up
> as those names.  No more trying to figure out which Tomcat.exe is which.
> Jeff
>
>
>
+1 that's good to know, as I may have a need to have multiple tomcat/tomee
instances. Thanks!



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


Re: Tomcat7w.exe

2014-03-10 Thread Howard W. Smith, Jr.
On Sun, Mar 9, 2014 at 3:53 PM, Leo Donahue  wrote:

> On Fri, Mar 7, 2014 at 12:43 PM, Howard W. Smith, Jr. <
> smithh032...@gmail.com> wrote:
>
> >
> > Actually, i hate clicking on things... I use Windows keyboard shortcuts
> as
> > much as possible.
> >
>
> Even when you run the following command, you still get a GUI.
>
> Tomcat7w //ES/Tomcat7
>

okay/true.


>
> Do you Ctrl + Tab your way through that dialog?
>

yes.


>
> Plus, I don't know what this is supposed to edit, but it doesn't change the
> values in the Tomcat7w.exe dialog:
> Tomcat7 //ES//Tomcat7 --Startup="Auto"  (or "Automatic")
>
> Running that command still shows "Manual" in the Startup type on the
> General tab.
>

okay. i never used/tried --Startup="...", because after creating the
Windows Service, I /simply/ use tomcat7w.exe (or Windows Start button >
Administratives Tools > Services) to change the value to 'Automatic'.


Re: Tomcat7w.exe

2014-03-07 Thread Howard W. Smith, Jr.
On Fri, Mar 7, 2014 at 1:11 PM, Leo Donahue  wrote:

>  I blame my lack of command line upbringing for not catching that.
>

I love my MS-DOS command-line days/upbringing (dating back to my first
computer, 1986 Tandy 1000 SX, MS-DOS 5.0, maybe, and I don't remember using
Windows way back at that time).


> Windows people click on things.
> Bad habits.
>

Actually, i hate clicking on things... I use Windows keyboard shortcuts as
much as possible.


Re: Optimization on simple requests

2014-03-05 Thread Howard W. Smith, Jr.
On Tue, Mar 4, 2014 at 1:54 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> John,
>
> On 3/4/14, 1:17 PM, John Smith wrote:
> > Tomcat 7.0.42 on RHEL6.
> >
> > Assume that Tomcat is serving only one jsp page. Say it just
> > rewrites a parameter value from the querystring to the html within
> > the jsp.
> >
> > Also assume that there are ~200,000 users attempting to access that
> > page - say "almost simultaneously".
> >
> > What are the most relevant optimizations I can make to a single
> > instance of tomcat for this scenario?
>
> So you want the highest-performance solution to the above scenario?
>
> As for Tomcat configuration, I would use the NIO connector with a
> large number of max connections (you'll have to see what practical
> size to give it) and a large number of threads in your thread pool
> (i.e. executor).
>
> NIO gets you the benefit of not blocking waiting for a second (or
> third, etc.) keepalive request to arrive over a connection before that
> thread can be used to do some real work. If all connections are
> "Connection:close" then this is less of an issue.
>
> If you have a big, beefy CPU relative to your Internet connection's
> bandwidth, you should probably enable compression on the connector:
> that will help you push bytes back to the client faster. You'll have
> to test whether or not this actually helps you in your particular
> situation, because you are trading CPU time for I/O time.
>
> Define only one  element in your server.xml, and name it
> whatever your public hostname is: there is a slight optimization in
> the mapper that works slightly faster if you have exactly one 
> element, and if that name matches the "Host" header from the request.
> (There is an even faster case for where there are no elements in the
> host list, then the default is used, but I'm not sure how to get a
> zero-element host list and yet still have a default host).
>
> Don't add any s or s that you don't absolutely need.
>
> I would remove any intermediate proxies that don't absolutely need to
> be there (like Apache httpd, Microsoft IIS, nginx, etc.). Tomcat
> itself comes fairly well-configured for performance out of the box
> (except for the use of the BIO connector, which gets the job done and
> it very stable and reliable, but certainly does not win any speed
> contests).
>
> If you want to optimize the hell out of the experience, you'll want to
> dump JSP: there's a lot of setup that goes into creating the
> environment in which a JSP page runs, and you don't mention that you
> need any of it above.
>
> If you just need to write HEADER + some value from query string +
> FOOTER, then try to do that all in 3 I/O writes, like this would be in
> a servlet:
>
> static final String HEADER = "My Fast
> PageMy Fast PageYour parameter value
> is ";
> static final String FOOTER = "";
>
> void doGet(request, response) {
>
>   ServletOutputStream out = response.getOutputStream();
>   out.print(HEADER);
>   out.print(request.getParameter("key"));
>   out.print(FOOTER);
> }
>
> To save network bandwidth, remove any non-essential whitespace from
> your text as I have done above.
>

+1 Chris.

What about, also, a servlet/filter to set header for caching resources on
the client for some period of time (if/when applicable)? :)


>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJTFiFPAAoJEBzwKT+lPKRYR5wP/iiaEcMIFxKBE9Rr9EP6ZhA+
> +fxznQ1QED232LlhvAAcAiAjnOOv/dzLxmC62dai9EZoV0/24WcMpYaEjaRo2jZu
> jIyeGb4Dn4ommJj7aPG+yesPRRTBY6j23SIauWbnRNBCggn/YCpOnjERuUHPtjMO
> G4kDeZaHGGjfirwTuPYCKxiKlYow6C4H8HUzLH84BvuktPPCgO16qbtCSCI0st+b
> av4pza4lzKSO3YsjS3PBNa7eI9q7zvLYqTeB7TziyLq7Jf5OOWPL73qUVJUgb54A
> M6GzvsdIYWHCigGZff0iHT3oNbDEteSVK7TPLP8+XzI8x8F+xsn5G8yv5wXhStDH
> 44g2E2hZLwLhaaSiJqtxKGb2kTwoJA+CX33MnbngOkMGUO7SmRMlkx77d08GiYoA
> uvOKep8zz7R4Is8EZu5sdzUQSxPx2Y59uzQNMiBeER47d+hfu4aOl241QUrN2osO
> NsddzzXB6i9auvdhDdGUkNwbT2Iy8NtMKPBUvM+LWz2GC+8+/WyVeRjhQ5N3BUwc
> 5YHCKrHVEgZR/NO7j6HvsqXBdUnbt8JNFp0O6XtkCUtlilDabki50wIqVXn/jEmc
> rG9YJKYDFDQdxJSEnpeZEw5+iDmORkSyIOEMw5htqVCCgeBRp2jeATVWKpdcM76G
> EJD/P6bdni3Vj7kthhjs
> =ADJI
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-05 Thread Howard W. Smith, Jr.
On Mar 5, 2014 11:09 AM, "Christopher Schultz" 
wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Howard,
>
> On 3/5/14, 9:45 AM, Howard W. Smith, Jr. wrote:
> > Chris,
> >
> > On Tue, Mar 4, 2014 at 4:18 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Dmitry,
> >>
> >> On 3/4/14, 2:48 AM, Dmitry Batiyevskiy wrote:
> >>> Howard, My connector config is the following (i've already
> >>> posted that):
> >>>
> >>>  >>> maxThreads="15000" enableLookups="false"
> >>> disableUploadTimeout="true" acceptCount="100" scheme="https"
> >>> secure="true" SSLEnabled="true" compression="off"
> >>> SSLCertificateFile="/opt/tomcat/mycompany.com.crt"
> >>> SSLCertificateKeyFile="/opt/tomcat/mycompany.com.key" />
> >>>
> >>> Also -Dhttps.protocols=TLSv1 option is passed to java machine
> >>>
> >>> The reason for me to use apr connector is https performance,
> >>> isn't NIO much slower in that?
> >>
> >> I don't have any recent performance data, but using OpenSSL is
> >> apparently measurably faster than using JSSE.
> >>
> >> On the other hand, is the NIO connector does not crash, isn't
> >> that a point in its favor?
> >
> >
> > Can you please clarify your statements above? are you saying that
> > OpenSSL implies (or equals) NIO or APR?
>
> APR implies OpenSSL, and I suppose vice-versa. APR is native code and
> uses OpenSSL for its SSL engine. All of the pure-Java connectors (BIO,
> NIO, and possible a soon-to-be-available NIO2 connector) all use JSSE
> (Java Secure Sockets Extension) for SSL. For whatever reason, OpenSSL
> is measurably faster than JSSE.
>
> If you are fronting Tomcat with a web server which terminates SSL
> itself, then I see no particular reason to use the connectors over the
> NIO connectors.
>
> (Note that you can still use APR for its entropy capabilities even if
> not using it for SSL. You'll get session ids coming from OpenSSL's
> random source instead of Java's. I'm not sure that matters too much.)
>
> - -chris

Understood. Thanks Chris!

> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJTF0qNAAoJEBzwKT+lPKRYkIUQALqutaNWH1pLL1Gg89RgHyb+
> 01ORV9O6q2fwtsIgW5WPurZr6gJAcf8K2C1bAkE6WCudgLrHjaTwQtb5peWFqHr0
> IiCLa2bVxkDXDPFy5ESViPTML6UPiOHBXa707ZAK3vzRB5jy6fHbqMVvPBRx4CzD
> T0jKAqU9Odj38QBaUWvCi1BNgc0J5i4OyXBDNJmchyB0G6tN29vYo9zpaUnl972e
> 4qLzmWEGBzUnQ6y2zTga2fOZQJ4Lu5hQCLYmoCM84sU1Xl9BjHJ1Tn1mWm7jEm7V
> zMlIgFlJ/y65AUCqSRerMO5V5y4N+44CeQ2WV5v3hes4htAqRV7BFOgCfQW8e6Ng
> oqn4KLQU81rCOsN61tQIv1j17wkP6vux9WbaDScr+UVfjFZgdygaZvOLkmDs/bXG
> +b3DNsGVswOU4it2Y/cp6NAzwWDQfdfQUYDn9U/XOi9MnYSXNf+2dorTqnUhZ3Y7
> mbxrCFpwKdbgXTkvs1UPwOZVhJ8dBuno/HofKuqbd+s9SkF/eXZNdyWolRUQ8sdK
> KFWgByHW+18IM1RiBieu9/iGA1U4nUz0HvLo0UxXpN1GAXO/67/Hv2h/LiqB/tQh
> yVFbvEZV5bR64D9FoPFReGQG4as2NBfIrbFz4XhqHwps5DDYm7WsS4hK87PE7fNC
> qeyeWruqGubsZfwDrfft
> =ihsJ
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: Tomcat 7.0.52 NIO + Atmospere 1.0.18 damaged responses

2014-03-05 Thread Howard W. Smith, Jr.
On Wed, Mar 5, 2014 at 8:35 AM, Jan Dosoudil  wrote:

> Hi,
> we have application running on Tomcat 7.0.52 with Nio connector (a lot
> older versions too), it uses MyFaces (2.1.12), RichFaces (4.3.5),
> Atmosphere framework (1.0.18). Atmosphere framework is configured to use
> long-polling with Tomcat Nio comet support.
>

I searched atmosphere google groups mail list, earlier, this morning, for

tomcat nio ssl

and found,

https://groups.google.com/forum/?fromgroups#!searchin/atmosphere-framework/tomcat$20nio$20ssl/atmosphere-framework/J685km4oOvM/2qZMzo4wyfAJ

that topic mentioned something similar to what you are stating here, and i
think they were using same/similar version of atmosphere (1.0.1x).


> Sometimes simple request takes a long time to finish (correlates with
> connectionTimeout set on Connector) and response is damaged. Here is
> example of damaged response from server:
>
> 0
>
> HTTP/1.1 302 Found
> Server: Apache-Coyote/1.1
> Set-Cookie: JSESSIONID=C524EA667CA4087407A5DCDEA1712E53; Path=/app/;
> HttpOnly
> Location: http://192.168.1.156:8080/app/login
> Content-Length: 0
> Date: Tue, 28 Jan 2014 16:10:54 GMT
>
> Response packet contains exactly this data, no more data (headers) before
> "0". Example contains redirect but problem appears in JSF pages too. "0" is
> end of chunked encoded response.
>
> Problem went away by switching atmosphere from long-polling to WebSockets


+1 and this was mentioned in that thread (URL above), too.


> so I think there may be problem in Atmospere framework long polling and
> Tomcat async support. I've found workaround using socket.bufferPool="0" but
> i think it's not final solution.
>
> I don't have simple testcase to easily reproduce this problem. I've tried
> turning on Tomcat debug logs, debugging Tomcat and so on but without usable
> results. My opinion is that atmosphere framework uses NioChannel which
> doesn't own but I'm not able to confirm or reject it.
>
> Can you suggest me how to debug this problem or give me some tip to find
> final solution?
>

have you considered upgrading to latest atmosphere version, retesting your
app, and sending a mail to atmosphere list about these issues?

also, is it a requirement or preference to use long-polling instead of
websocket? usually, i think it is default or recommended to upgrade to
websocket, and fallback to long-polling. is long-polling to support target
multiple-servers/platforms and/or clients?


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


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-05 Thread Howard W. Smith, Jr.
Chris,

On Tue, Mar 4, 2014 at 4:18 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Dmitry,
>
> On 3/4/14, 2:48 AM, Dmitry Batiyevskiy wrote:
> > Howard, My connector config is the following (i've already posted
> > that):
> >
> >  > enableLookups="false" disableUploadTimeout="true" acceptCount="100"
> > scheme="https" secure="true" SSLEnabled="true" compression="off"
> > SSLCertificateFile="/opt/tomcat/mycompany.com.crt"
> > SSLCertificateKeyFile="/opt/tomcat/mycompany.com.key" />
> >
> > Also -Dhttps.protocols=TLSv1 option is passed to java machine
> >
> > The reason for me to use apr connector is https performance, isn't
> > NIO much slower in that?
>
> I don't have any recent performance data, but using OpenSSL is
> apparently measurably faster than using JSSE.
>
> On the other hand, is the NIO connector does not crash, isn't that a
> point in its favor?


Can you please clarify your statements above? are you saying that OpenSSL
implies (or equals) NIO or APR?

I'm asking, because I only use NIO connector without SSL.


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-04 Thread Howard W. Smith, Jr.
On Mar 4, 2014 2:49 AM, "Dmitry Batiyevskiy" 
wrote:
>
> Howard,
> My connector config is the following (i've already posted that):
>
> maxThreads="15000"
>  enableLookups="false" disableUploadTimeout="true"
>  acceptCount="100" scheme="https" secure="true"
>  SSLEnabled="true"
>  compression="off"
>  SSLCertificateFile="/opt/tomcat/mycompany.com.crt"
>  SSLCertificateKeyFile="/opt/tomcat/mycompany.com.key" />
>

Okay, thanks.

> Also -Dhttps.protocols=TLSv1 option is passed to java machine
>
> The reason for me to use apr connector is https performance, isn't NIO
much
> slower in that?
>

Chris recommended NIO. I'll let him answer your question.

> Regards,
>
> Dmitry Batiyevskiy
>
> Ardas Group Inc.
>
> www.ardas.dp.ua
>
>
> 2014-03-04 2:04 GMT+02:00 Howard W. Smith, Jr. :
>
> > On Mon, Mar 3, 2014 at 11:22 AM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > > Dmitry,
> > >
> > > On 3/3/14, 6:06 AM, Dmitry Batiyevskiy wrote:
> > > > Can you advice how we can find the problem in app/environment like
> > > > this? What are possible ways to debug this?
> > >
> > > Honestly, I'd try switching to the NIO connector and resume your
> > > testing. If all is well, it may point to a bug in the APR connector
> > > and/or tcnative itself. If you are having similar problems with the
> > > pure-Java connectors, then the problem is likely something you are
> > > doing in your application that is causing an invalid state. You'll
> > > probably get better information from the Java stack trace than from an
> > > assertion-failure.
> > >
> > > Give that a try and let us know how things go.
> >
> >
> > +1 Chris
> >
> > I have found much /continued/ success using NIO connector across tomcat
and
> > atmosphere versions.
> >


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Mon, Mar 3, 2014 at 11:22 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Dmitry,
>
> On 3/3/14, 6:06 AM, Dmitry Batiyevskiy wrote:
> > Can you advice how we can find the problem in app/environment like
> > this? What are possible ways to debug this?
>
> Honestly, I'd try switching to the NIO connector and resume your
> testing. If all is well, it may point to a bug in the APR connector
> and/or tcnative itself. If you are having similar problems with the
> pure-Java connectors, then the problem is likely something you are
> doing in your application that is causing an invalid state. You'll
> probably get better information from the Java stack trace than from an
> assertion-failure.
>
> Give that a try and let us know how things go.


+1 Chris

I have found much /continued/ success using NIO connector across tomcat and
atmosphere versions.


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Mon, Mar 3, 2014 at 6:41 AM, Dmitry Batiyevskiy <
dmitry.batiyevs...@ardas.dp.ua> wrote:

> 
> org.atmosphere.useNative
> true
> 
>

also, i wonder what your test results will be if you comment out the lines
above from your web.xml.


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Mon, Mar 3, 2014 at 9:52 AM, Dmitry Batiyevskiy <
dmitry.batiyevs...@ardas.dp.ua> wrote:

> Thanks, I will try updating atmosphere and/or changing maxProcessingThreads
>

may not be completely related, but what is your maxThreads value in your
 in server.xml ?

mine is below (found in tomee/conf/server.xml)





>
> Regards,
>
> Dmitry Batiyevskiy
>
> Ardas Group Inc.
>
> www.ardas.dp.ua
>
>
> 2014-03-03 16:33 GMT+02:00 Howard W. Smith, Jr. :
>
> > On Mon, Mar 3, 2014 at 6:41 AM, Dmitry Batiyevskiy <
> > dmitry.batiyevs...@ardas.dp.ua> wrote:
> >
> > > Atmosphere dependencies from pom.xml:
> > >
> > > 
> > > org.atmosphere.extensions
> > > atmosphere-gwt20-server
> > > 2.0.2
> > > 
> > >
> > > 
> > > org.atmosphere
> > > atmosphere-runtime
> > > 2.0.5
> > > 
> > >
> >
> > Looks good, but have you tried latest version (Atmosphere 2.1.0 runtime)
> ?
> > I don't know the appropriate 'gwt' version to use with Atmosphere 2.1.0
> > runtime. I think you can search the atmosphere wiki or mail list, or
> post a
> > mail there.
> >
> > I know that Atmosphere 2.0.3 had specific changes/fixes that were in-line
> > with Tomcat 7.0.42, which supports your report that 7.0.42 is working (as
> > expected).
> >
> >
> > >
> > > Dependencies are in war file
> > >
> >
> > okay.
> >
> >
> > >
> > > Atmosphere config from web.xml:
> > >
> > > 
> > > AtmosphereServlet
> > > AtmosphereServlet
> > > org.atmosphere.cpr.AtmosphereServlet
> > > 1
> > > true
> > > 
> > >
> >
> > okay, good, i was looking for the async-supported to be set, since you're
> > using servlet 3.0.
> >
> >
> > > org.atmosphere.cpr.AtmosphereInterceptor
> > >
> > >
> >
> com.mycompany.communicationengine.interceptor.SecurityContextInterceptor
> > >
> > > 
> > > 
> > > org.atmosphere.cpr.packages
> > > com.mycompany.atm
> > > 
> > > 
> > > org.atmosphere.useNative
> > > true
> > > 
> > >
> >
> > 
> >
> >
> > > 
> > >
> > >
> >
> org.atmosphere.cpr.broadcaster.maxProcessingThreads
> > > 30
> > > 
> > > 
> > >
> > >
> >
> org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads
> > > 30
> > > 
> > > 
> > >
> >
> > 
> >
> > Jeanfrancois advised me to accept the default config/settings (for
> > maxProcessingThreads and maxAsyncWriteThreads) instead of specifying low
> > values like you have (30). what happens when you comment out these
> > (atmosphere config) lines from your web.xml when using tomcat 7.0.50?
> >
> > maybe someone here on tomcat list can advise why your max threads
> settings
> > is working with tomcat 7.0.42, but not with tomcat 7.0.50.
> >
> >
> > >
> > > This is top of web.xml:
> > >
> > > http://java.sun.com/xml/ns/javaee";
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> > > http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
> > > version="3.0">
> > >
> > >
> > okay, good.
> >
> >
> > >
> > > Regards,
> > >
> > > Dmitry Batiyevskiy
> > >
> > > Ardas Group Inc.
> > >
> > > www.ardas.dp.ua
> > >
> > >
> > > 2014-03-03 13:28 GMT+02:00 Howard W. Smith, Jr. <
> smithh032...@gmail.com
> > >:
> > >
> > > > On Mon, Mar 3, 2014 at 6:26 AM, Howard W. Smith, Jr. <
> > > > smithh032...@gmail.com
> > > > > wrote:
> > > >
> > > > >
> > > > > On Thu, Feb 20, 2014 at 11:00 AM, Dmitry Batiyevskiy <
> > > > > dmitry.batiyevs...@ardas.dp.ua> wrote:
> > > > >
> > > > >> We have upgraded tomcat 7.0.42 to 7.0.50
> > > > >> We have an app which is built around atmosphere framework and uses
> > > > >> websockets
> > > > >> After upgrade tomcat instance which has only this app dies in few
> > > hours
> > > > >> after deploy (the whole java process dies)
> > > > >>
> > > > >
> > > > > How did you configure atmosphere?
> > > > >
> > > > > which version of atmosphere are you using?
> > > > >
> > > > > can you share your web.xml (atmosphere config)?
> > > > >
> > > > > which atmosphere-related dependencies?
> > > > >
> > > > > is atmosphere-related dependencies in tomcat/lib or in your WAR
> file?
> > > > >
> > > > >
> > > > also, are you specifying servlet 3.0 (or 2.5) in your web.xml? can
> you
> > > > copy/paste that config as well?
> > > >
> > >
> >
>


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Mon, Mar 3, 2014 at 6:41 AM, Dmitry Batiyevskiy <
dmitry.batiyevs...@ardas.dp.ua> wrote:

> Atmosphere dependencies from pom.xml:
>
> 
> org.atmosphere.extensions
> atmosphere-gwt20-server
> 2.0.2
> 
>
> 
> org.atmosphere
> atmosphere-runtime
> 2.0.5
> 
>

Looks good, but have you tried latest version (Atmosphere 2.1.0 runtime) ?
I don't know the appropriate 'gwt' version to use with Atmosphere 2.1.0
runtime. I think you can search the atmosphere wiki or mail list, or post a
mail there.

I know that Atmosphere 2.0.3 had specific changes/fixes that were in-line
with Tomcat 7.0.42, which supports your report that 7.0.42 is working (as
expected).


>
> Dependencies are in war file
>

okay.


>
> Atmosphere config from web.xml:
>
> 
> AtmosphereServlet
> AtmosphereServlet
> org.atmosphere.cpr.AtmosphereServlet
> 1
> true
> 
>

okay, good, i was looking for the async-supported to be set, since you're
using servlet 3.0.


> org.atmosphere.cpr.AtmosphereInterceptor
>
> com.mycompany.communicationengine.interceptor.SecurityContextInterceptor
>
> 
> 
> org.atmosphere.cpr.packages
> com.mycompany.atm
> 
> 
> org.atmosphere.useNative
> true
> 
>




> 
>
> org.atmosphere.cpr.broadcaster.maxProcessingThreads
> 30
> 
> 
>
> org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads
> 30
> 
> 
>



Jeanfrancois advised me to accept the default config/settings (for
maxProcessingThreads and maxAsyncWriteThreads) instead of specifying low
values like you have (30). what happens when you comment out these
(atmosphere config) lines from your web.xml when using tomcat 7.0.50?

maybe someone here on tomcat list can advise why your max threads settings
is working with tomcat 7.0.42, but not with tomcat 7.0.50.


>
> This is top of web.xml:
>
> http://java.sun.com/xml/ns/javaee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
> version="3.0">
>
>
okay, good.


>
> Regards,
>
> Dmitry Batiyevskiy
>
> Ardas Group Inc.
>
> www.ardas.dp.ua
>
>
> 2014-03-03 13:28 GMT+02:00 Howard W. Smith, Jr. :
>
> > On Mon, Mar 3, 2014 at 6:26 AM, Howard W. Smith, Jr. <
> > smithh032...@gmail.com
> > > wrote:
> >
> > >
> > > On Thu, Feb 20, 2014 at 11:00 AM, Dmitry Batiyevskiy <
> > > dmitry.batiyevs...@ardas.dp.ua> wrote:
> > >
> > >> We have upgraded tomcat 7.0.42 to 7.0.50
> > >> We have an app which is built around atmosphere framework and uses
> > >> websockets
> > >> After upgrade tomcat instance which has only this app dies in few
> hours
> > >> after deploy (the whole java process dies)
> > >>
> > >
> > > How did you configure atmosphere?
> > >
> > > which version of atmosphere are you using?
> > >
> > > can you share your web.xml (atmosphere config)?
> > >
> > > which atmosphere-related dependencies?
> > >
> > > is atmosphere-related dependencies in tomcat/lib or in your WAR file?
> > >
> > >
> > also, are you specifying servlet 3.0 (or 2.5) in your web.xml? can you
> > copy/paste that config as well?
> >
>


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Mon, Mar 3, 2014 at 6:26 AM, Howard W. Smith, Jr.  wrote:

>
> On Thu, Feb 20, 2014 at 11:00 AM, Dmitry Batiyevskiy <
> dmitry.batiyevs...@ardas.dp.ua> wrote:
>
>> We have upgraded tomcat 7.0.42 to 7.0.50
>> We have an app which is built around atmosphere framework and uses
>> websockets
>> After upgrade tomcat instance which has only this app dies in few hours
>> after deploy (the whole java process dies)
>>
>
> How did you configure atmosphere?
>
> which version of atmosphere are you using?
>
> can you share your web.xml (atmosphere config)?
>
> which atmosphere-related dependencies?
>
> is atmosphere-related dependencies in tomcat/lib or in your WAR file?
>
>
also, are you specifying servlet 3.0 (or 2.5) in your web.xml? can you
copy/paste that config as well?


Re: java: src/network.c:441: Java_org_apache_tomcat_jni_Socket_send: Assertion failed

2014-03-03 Thread Howard W. Smith, Jr.
On Thu, Feb 20, 2014 at 11:00 AM, Dmitry Batiyevskiy <
dmitry.batiyevs...@ardas.dp.ua> wrote:

> We have upgraded tomcat 7.0.42 to 7.0.50
> We have an app which is built around atmosphere framework and uses
> websockets
> After upgrade tomcat instance which has only this app dies in few hours
> after deploy (the whole java process dies)
>

How did you configure atmosphere?

which version of atmosphere are you using?

can you share your web.xml (atmosphere config)?

which atmosphere-related dependencies?

is atmosphere-related dependencies in tomcat/lib or in your WAR file?


Re: Newbie Help - Up and Running with Tomcat on Windows

2014-02-25 Thread Howard W. Smith, Jr.
On Tue, Feb 25, 2014 at 10:30 AM, Daniel Mikusa wrote:

> On Feb 25, 2014, at 10:13 AM, Howard W. Smith, Jr. 
> wrote:
>
> > On Tue, Feb 25, 2014 at 7:55 AM, Daniel Mikusa  >wrote:
> >
> >>>  It might be something as obvious as not having Java EE
> >> installed separately.  Perhaps Tomee+ will provide all that is needed.
> >>
> >> What specifically do you need?  Tomcat is not a full JEE container.  It
> >> implements the Servlet, JSP, EL and WebSockets specs.
> >>
> >>  http://tomcat.apache.org/whichversion.html
> >>
> >> If you need more then you could look at something like Apache Tomee or
> >> Apache Geronimo.
> >>
> >
> > +1 i agree, if you need full JEE container, my recommendation is TomEE.
>
> I don't believe Tomee is a "full JEE" container.  As I understand it, it
> targets the Web Profile.
>
>"Apache TomEE, pronounced "Tommy", is an all-Apache stack aimed at Java
> EE 6 Web Profile certification"
>
>   https://tomee.apache.org/apache-tomee.html
>
> The Web Profile is a subset of the full JEE platform.  This contrasts to
> Apache Geronimo which targets the full JEE stack.
>
> >
> > When I was trying to migrate from Glassfish to tomcat, i found it very
> > difficult to run my Java EE (JSF) web application via Tomcat 7. I had to
> > search for JARs and place them in tomcat/lib folder. Even after locating
> > some JARs and placing them in tomcat/lib folder, I failed to run my JSF
> web
> > aplication via tomcat7. I have seen (many) others have success running
> > their Java EE (JSF) web application via tomcat7.
> >
> > After multiple failed attempts in late 2012, trying to run my JSF web
> > application in tomcat 7, I downloaded tomee, emailed my questions to
> tomee
> > user list, and finally, i had success running my JSF web application via
> > tomee (which is tomcat + java EE, etc...).
> >
> > I don't recommend using Geronimo. I think Geronimo
> > effort/development/maintenance has transitioned to TomEE. Again, I
> > definitely recommend TomEE, and tomee user list is just as helpful as
> > tomcat user list. many of your tomcat-related questions can/should be
> asked
> > on tomcat list.
>
> I can't comment on the fitness of either project, as I don't use them
> personally, but my understanding is that they are not competing projects.
>  TomEE, like the JEE Web Profile, is simply a middle ground between Tomcat
> and Geronimo.
>
> Dan
>

agree on all counts, Dan. I stand corrected, thanks.

My response was not intended to show any level of competition between TomEE
and Geronimo. I think both projects share committers, or the same person as
lead for both projects. Recently, I learned/read that Geronimo targeted or
was developed for IBM.

As a TomEE user, i know that TomEE is alive and well. I don't think the
same could be said about Geronimo.


>
> >
> > FYI, I have been using NetBeans 7.2+ to start/stop TomEE via
> > NetBeans/tomcat7 plugin. I usually build WAR via NetBeans, and drop my
> WAR
> > in tomee/webapps folder. On my development PC/server, I use NetBeans to
> > start/stop TomEE server, and on my production server, I use tomcat7w.exe
> > (or the equivalent that is installed in tomee/bin folder) to
> > install/start/stop the tomcat7 (or tomee) Windows Service on my Windows
> > Server 2003/2008 server.
> >
> > My development server is Windows Server 2008 (Vista version), and my
> > production server is Windows Server 2008 (Windows 7) version. I would
> > assume that you should have no issues using Windows 8.x; i really don't
> > have any experience with Windows 8.x though.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Newbie Help - Up and Running with Tomcat on Windows

2014-02-25 Thread Howard W. Smith, Jr.
On Tue, Feb 25, 2014 at 7:55 AM, Daniel Mikusa wrote:

> >   It might be something as obvious as not having Java EE
> installed separately.  Perhaps Tomee+ will provide all that is needed.
>
> What specifically do you need?  Tomcat is not a full JEE container.  It
> implements the Servlet, JSP, EL and WebSockets specs.
>
>   http://tomcat.apache.org/whichversion.html
>
> If you need more then you could look at something like Apache Tomee or
> Apache Geronimo.
>

+1 i agree, if you need full JEE container, my recommendation is TomEE.

When I was trying to migrate from Glassfish to tomcat, i found it very
difficult to run my Java EE (JSF) web application via Tomcat 7. I had to
search for JARs and place them in tomcat/lib folder. Even after locating
some JARs and placing them in tomcat/lib folder, I failed to run my JSF web
aplication via tomcat7. I have seen (many) others have success running
their Java EE (JSF) web application via tomcat7.

After multiple failed attempts in late 2012, trying to run my JSF web
application in tomcat 7, I downloaded tomee, emailed my questions to tomee
user list, and finally, i had success running my JSF web application via
tomee (which is tomcat + java EE, etc...).

I don't recommend using Geronimo. I think Geronimo
effort/development/maintenance has transitioned to TomEE. Again, I
definitely recommend TomEE, and tomee user list is just as helpful as
tomcat user list. many of your tomcat-related questions can/should be asked
on tomcat list.

FYI, I have been using NetBeans 7.2+ to start/stop TomEE via
NetBeans/tomcat7 plugin. I usually build WAR via NetBeans, and drop my WAR
in tomee/webapps folder. On my development PC/server, I use NetBeans to
start/stop TomEE server, and on my production server, I use tomcat7w.exe
(or the equivalent that is installed in tomee/bin folder) to
install/start/stop the tomcat7 (or tomee) Windows Service on my Windows
Server 2003/2008 server.

My development server is Windows Server 2008 (Vista version), and my
production server is Windows Server 2008 (Windows 7) version. I would
assume that you should have no issues using Windows 8.x; i really don't
have any experience with Windows 8.x though.


Re: Tomcat 8 appears slow to process jsp pages

2014-02-12 Thread Howard W. Smith, Jr.
On Wed, Feb 12, 2014 at 9:57 AM,  wrote:

> Testing Tomcat 8 I watch the console and see the Java and sql processing
> complete, then wait a full minute for the webpage to appear. With Tomcat 7
> there is no wait. Just to verify, while composing this I opened a web page
> within the application and stared at a white screen for almost exactly
> sixty seconds.  I


I have used Tomcat 7.0.32+ (7.0.32, 34, 35, 37, 39, 40, 42, 47, ...) since
I use TomEE, and I experienced that some time in the past. When I
experienced that, I closed the browser with anticipation to break/cancel
the HTTP request, and reopened browser and webapp page. Eventually, as time
went on, i did not experience that anymore, and I don't see that anymore.
There was 'maybe' some app changes that I made (and/or some improvements
between Tomcat and TomEE), but it may have been caused by database
deadlock. I'm not sure. I haven't experienced that for some months now,
maybe 6+ months.

you may need to change your jdbc  settings. One of tomcat
committers, Christopher Schultz wrote a good article about tomcat jdbc[1]
and how to configure it to meet your needs. I think i read it a few times
and changed my jdbc settings sometime ago, and I think that may have solved
the tomcat-request-white-page-in-browser issue/behavior that I experienced
in the past.


[1]
http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/


Re: Clustering without Apache in the front

2014-02-07 Thread Howard W. Smith, Jr.
On Wed, Jan 29, 2014 at 10:24 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> > Now, as Chris pointed out - it would be great to design your app
> > that it saves the intermediate work to a database or some secondary
> > store that can be retrieved upon login again. Think "shopping
> > cart", you are shopping around, the instance goes down, you need to
> > login again, and a nice application would persist shopping cart for
> > you, not so nice application would not, so when logged in again -
> > the shopping cart would be available or not :)
>
> Exactly. Our strategy - for those interested - is to include enough
> information in each request / form to allow users whose work is
> interrupted by a login to resume their workflow (in progress) after an
> interrupted session. This has the added benefit of allowing users to
> go get a cup of coffee, have their session expire, and pick-up where
> they left-off after a quick re-login.


+1 just experienced this in an (on-the-job) online training that I'm
completing.

I started an online training 'session' (in a single browser) hours ago,
started multitasking on-the-job, go back to the online training, and scroll
down (via wheel on my mouse) a little and read the page, multitask, come
back to online training, scroll down (via wheel on my mouse) more and do
some more reading, and later after more multitasking, the session was
closed (maybe via AJAX), and I have a 404 error in the browser.

So, i close the browser, click the URL to begin/resume the online training,
and the online training opens in the browser to the very exact position on
the page that I was last reading. Now, that is real nice!

I don't know what they are doing, but they may have some AJAX method on the
client that updates database on server, and database update includes what
part/position of the page I last read.


Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Howard W. Smith, Jr.
On Thu, Feb 6, 2014 at 11:42 AM, Jeffrey Janner  wrote:

> > -Original Message-
> > From: André Warnier [mailto:a...@ice-sa.com]
> > Sent: Thursday, February 06, 2014 10:33 AM
> > To: Tomcat Users List
> > Subject: Re: unable to start Tomcat through the Windows Services panel
> >
> > Hi.
> >
> > javier_esp...@hna.honda.com wrote:
> > > OK, this is what I see in the Event Viewer under General tab "The
> > > tomcat7 service terminated with service-specific error Incorrect
> > > function.."
> > >
> >
> > Let's start from the beginning.
> >
> > If you don't get logfiles in the Tomcat/logs directory, then chances
> > are that Windows does not even begin to run Tomcat, and that there is
> > an error right at the start, when it tries to run it.
> >
> > So first read this : http://wiki.apache.org/tomcat/FAQ/Windows#Q11
> >
> > That will explain /what/ you are actually running, when you (try to)
> > run Tomcat as a Service in Windows, and why it is different from
> > running Tomcat in a command window.
> > Go ahead, read it, we'll wait right here.
> >
> > ... some time later :
> >
> > Now you know
> > - that tomcat7.exe is a Windows executable program
> > - it is the program which the Windows Service Manager tries to start,
> > when you start the
> > Tomcat7 Service
> > - but tomcat7.exe is not really Tomcat; it is a "wrapper" program that
> > runs the Java JVM which in turn runs Tomcat.
> >
> > And to start the Java JVM, and pass to this java JVM the appropriate
> > parameters, tomcat7.exe reads these parameters from the Windows
> > Registry somewhere.
> >
> > And to be nice, the Tomcat developers have even provided a specialised
> > GUI editor, that allows you to view, set or modify these Tomcat
> > Registry parameters that are used by tomcat7.exe.
> > And that is the program tomcat7w.exe.  So go ahead now, double-click on
> > tomcat7w.exe, and look at the information it shows in the various tabs.
> > That is probably where something is wrong.
> >
> > Or else what is wrong, is that the version of tomcat7.exe that you have
> > installed, does not match the version of Windows that you are running.
> > For example, tomcat7.exe is a 32-bit program, but your Windows PC runs
> > a 64-bit version of Windows.  Or vice-versa.
> >
> > Or that in the Service definition of the Tomcat7 Service, the path to
> > tomcat7.exe is incorrect.
> > You see that path in the first tab of the GUI.
> >
>
> André -
> Good points. I'd been following this thread out of curiosity and was just
> beginning to think that it was obviously a service configuration error.


Agreed, and I was following this thread for the same reason.


> I don't have the entire thread handy, and haven't looked at MarkMail, but
> I don't remember anyone asking the OP exactly *how* he installed the
> service.


I had the same thought.


> One would assume he used the bat file that is designed to do this, since
> he mentions running tomcat from the console using startup.bat (a clear
> giveaway that he's not using the fine Windows installer package that
> someone spent a lot of time crafting).
>

Honestly, I forgot all the specific details of how/when I installed
tomcat/tomee as a Windows service, but I found it quite intuitive...using
the .bat file approach via Windows Command Prompt. The .bat file informed
me of the proper 'usage', and I easily installed tomcat/tomee as a Windows
Service, via command line (or .bat file), accordingly.

And I do use the tomcat7w.exe to modify java options, etc... I never have
to open Windows 'Services' to start/stop tomcat/tomee.


Re: unable to start Tomcat through the Windows Services panel

2014-02-06 Thread Howard W. Smith, Jr.
On Wed, Feb 5, 2014 at 2:09 PM,  wrote:

> OK, this is what I see in the Event Viewer under General tab
> "The tomcat7 service terminated with service-specific error Incorrect
> function.."
>
> Under Details tab, I see the following in XML view
> - http://schemas.microsoft.com/win/2004/08/events/event";>
>   - 
> 
> 7024
> 0
> 2
> 0
> 0
> 0x8080
> 
> 67562
> 
> 
> System
> TORAHMLF3DTKX1.am.mds.honda.com
> 
> 
>   - 
> tomcat7
> %%1
> 
>   
>
>   Can anyone tell me what that is trying to tell me?
>
>   Thank you
>

did you see anything else in the Event Viewer that occurred around the same
time that this event occurred (in Event Viewer)?

also, i wonder if he following can help solve this issue?

  - 
tomcat7
%%1



Re: Clustering without Apache in the front

2014-01-28 Thread Howard W. Smith, Jr.
On Tue, Jan 28, 2014 at 8:59 PM, Neven Cvetkovic
wrote:

> On Tue, Jan 28, 2014 at 3:54 PM, Howard W. Smith, Jr. <
> smithh032...@gmail.com> wrote:
>
> > > Thus I will probably never have to use clustering.
> >
> > Loving your responses on this topic, Chris. I do not want to hijack this
> > thread, but i find this topic interesting, and your responses make it
> more
> > interesting!
> >
> >
> +1. Great discussion, as always :)
>
>
> > Honestly, I don't need clustering (yet) in my app, but I feel as though
> > endusers of my app will be fine in a failover situation (as you described
> > in this thread). Endusers of my app have to login a lot since I set
> session
> > expired = 15 minutes. no complaints from the endusers, because they are
> in
> > and out of the app...all day, (almost) every day.
> >
>
> Ultimately, session stickiness works great to handle load balancing
> (workload management), but it is not enough for session failover. In the
> unlikely event that the serving tomcat instance dies, the user will be sent
> over to the other tomcat instance (that doesn't know anything about you,
> i.e. doesn't have your session data), and will probably need to login
> again. Now, as Chris pointed out - it would be great to design your app
> that it saves the intermediate work to a database or some secondary store
> that can be retrieved upon login again. Think "shopping cart", you are
> shopping around, the instance goes down, you need to login again, and a
> nice application would persist shopping cart for you, not so nice
> application would not, so when logged in again - the shopping cart would be
> available or not :)
>

+1 (000,000,000,...)

wow, thanks Neven. That was a great thought/analogy right there. As someone
that uses amazon.com quite often, I do like the shopping cart feature, even
though I have not recognized if my shopping cart was saved across
sessions... oh, but you just jogged my memory, and a product that I looked
at recently, amazon.com sent that product (and similar products) to my
email... so evidently, 'interests' are persisted per user/session.

'not so nice application would not'... wow, i definitely accept that as
constructive criticism. thanks.


> Now, if your end users can live with that scenario - that's great - no need
> for session replication, clustering your instances, network chatter, etc...
> It definitely simplifies the configuration and setup.
>
> However, if your end users (i.e. your Service-Level-Agreement / SLA) do
> require a proper session failover, you will need some sort of session
> replication to successfully implement that feature. That's not trivial and
> depends on the appserver (e.g. Tomcat, JBoss, WebSphere, Weblogic). Session
> replication is not part of the official JEE/Servlet spec, but most modern
> and serious appservers would provide some way of replicating sessions and
> clustering appserver instances.
>

+1 definitely here for tomcat (a serious appserver). :)


>
> Now, if you could make you application stateless - you could possibly turn
> off the sticky sessions.  Makes things very easy to scale!
>

+1 thanks. even though my app is Java Server Faces app, I would say it is
quite stateless in nature/design, since users accomplish majority of their
daily tasks via one-page requests. of course,

1. one page is required to login
2. another/one page is required to search/filter/navigate-to target data
that already exists in the database
3. another/one page is required to add/update data, or to take some action
against that data (print data/form, email data/form to customer, etc...)

and this is normal user activity; some users let their session expire after
completing steps 1 and 2 above, or steps 1, 2, and 3 above.

In reference to the shopping cart suggestion, I would assume that you would
suggest that steps 2 and 3, above, are persisted, so users can resume
previous session.


> :))
>
> the only time I really need failover is when I 'might' want to update the
> > app's software. the app is quite stable now and not many software changes
> > right now, so again, there's not much of a need for failover. :)
> >
>
> Excellent! Keep it simple!
>

+1 thanks; that's my goal...keep it simple (for the endusers). :)


> Good luck!
> Neven
>


Re: Clustering without Apache in the front

2014-01-28 Thread Howard W. Smith, Jr.
On Tue, Jan 28, 2014 at 3:42 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Thus I will probably never have to use clustering.


Loving your responses on this topic, Chris. I do not want to hijack this
thread, but i find this topic interesting, and your responses make it more
interesting!

Honestly, I don't need clustering (yet) in my app, but I feel as though
endusers of my app will be fine in a failover situation (as you described
in this thread). Endusers of my app have to login a lot since I set session
expired = 15 minutes. no complaints from the endusers, because they are in
and out of the app...all day, (almost) every day.

the only time I really need failover is when I 'might' want to update the
app's software. the app is quite stable now and not many software changes
right now, so again, there's not much of a need for failover. :)

still listening in on this topic. :)


Re: [OT] RE: Cannot connect from outside using Tomcat 7/APR/SSL on AWS Windows system

2014-01-24 Thread Howard W. Smith, Jr.
On Fri, Jan 24, 2014 at 11:41 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Howard,
>
> On 1/23/14, 11:31 PM, Howard W. Smith, Jr. wrote:
> > Instead of downloading Linux and trying it out, on my own, I just
> > decided to stay with Windows. it just works (for me).
>
> I'm honestly glad to hear that you are having a good experience with it.
>
> Do you manage a lot of machines, or just one or two?


Just 2 servers for now.


> Until recently,
> the *NIX world didn't have great (maybe just inexpensive/free)
> cluster-management utilities like Puppet. I believe Windows had that
> capability (e.g. Tivoli) much earlier, though I think it was initially
> aimed at administering fleets of workstations, not servers. Extending
> that capability to manage servers was probably trivial.
>
> >> I hope things have changed, but everyone I ever knew that ran
> >> Windows Server OSs in production had scheduled rolling-reboots of
> >> their servers because things just tended to "work" when they did
> >> that. Otherwise, stuff would fail with some regularity (like
> >> every 3 days). It's not clear to be whether restarting the OS or
> >> restarting the application did the trick -- as we all know, most
> >> Tomcat problems are actually webapp problems. In all my time
> >> working with Linux servers, I've never had to resort to such
> >> foolishness, nor has anyone else I have known. I've had servers
> >> running for over a year without a reboot. (They usually get a
> >> reboot for certain software upgrades, so years-running servers
> >> don't really exist... or shouldn't).
> >
> >
> > I have seen posts on this list about people experiencing issues
> > with Windows updates and their tomcat/database not starting or
> > shutting down successfully (or as expected)... i do not experience
> > these things...at all. Yes, I did send several emails to the tomee
> > list, asking why did my tomee/tomcat server restart at night around
> > 3am. I, then, learned it was the automatic Windows updates that I
> > configured. So, after I learned that it was the automatic updates
> > and that my app shutdown properly and restarted automatically
> > (since I configured the tomcat/tomee service to start,
> > automatically on/after boot), and no database corruption and no
> > errors in the log. My Java EE app and tomcat/tomee shuts down and
> > restarts gracefully inspite/through-it all.
>
> Great! I wish you the best of luck.
>

Thanks. At the moment, I don't have a need for cluster management, because
the app performs really well, but I'm hoping to refactor the app (quite) a
bit, so I can market the app to other businesses. After all that, i may
need to consider cluster management, more servers etc.

Also, some day, I may consider migrating to Linux. On the to-do list when I
have bandwidth to do so.


>
> - -chris
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJS4pehAAoJEBzwKT+lPKRYrMAQAJH9Jyz6V1C2Cx913B//NdKI
> rzSZOgBDRMLwi3eORY/cE5FJ0bW+5khP9BryIJ/AeHxY4zDyMgx8ICJot/wtI1QI
> Ru2hdjr+YMjE4TZmtpI9khBgKwb5HKJ7q27RQaxgN08BzH/t0tPQOmrIxO0+Z1lO
> mxiEw7DomEG0Xbsv4u2oAlu8GlBYOMWZ5AC4a/ag1u2k65kS/JEneLYSBNepuMlJ
> aIRfd4WUE+qjoykHo9uSR6XLaJEj5igozuCCrCcIL7u5NuBzeH3Gc56GGnV0V9Ye
> Qygpr+T0j6MS+Yza92ybng7g7QcKB6lh5maMYalnj/G/bU2I1Q4mcBtZsxsrevin
> NB5QJgvbZ+wZJeWQMH5h92v//zh0c8r0WZrVTF81ZYxXYo8HAwRFagKzY6qBxBeS
> njnXim86JBooPW1JhxYalrNgKV1pK7MxfTNkfvmK18L3ALMhf5A2qhd8Q3BIsWOQ
> Yi6t4JUlOGM32/3NcYcIT6/rYdIEZLOv9VEabV5WvcMQnq++ViUHjV64hWlknvCB
> hoRHN45ipj51vC6VRY6nq/FZ+L5gIWzb9q719sVGjwfLiFkF63biVppwYO5adWD+
> pubXRs7Toxd1uYGM0bi3ruq/dL9B6m9EzIKN6nZsW4wrTWIvVNU/i0IWoNXHffJw
> ygFownq0oWKSG86riRfZ
> =6Aq+
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: [OT] RE: Cannot connect from outside using Tomcat 7/APR/SSL on AWS Windows system

2014-01-23 Thread Howard W. Smith, Jr.
On Thu, Jan 23, 2014 at 10:07 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Howard,
>
> On 1/23/14, 9:05 PM, Howard W. Smith, Jr. wrote:
> > On Wed, Jan 22, 2014 at 10:14 AM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
> >>
> >> Konstantin,
> >>
> >> On 1/22/14, 9:03 AM, Konstantin Preißer wrote:
> >>> Hi Jeffrey,
> >>>
> >>>> -Original Message- From: Jeffrey Janner
> >>>> [mailto:jeffrey.jan...@polydyne.com] Sent: Tuesday, January
> >>>> 21, 2014 10:19 PM
> >>>
> >>>> Eureka, I finally figured it out! It was a real eureka
> >>>> moment, some remembrance burned its way up from my
> >>>> subconscious and I had the answer. Ready guys?  Really
> >>>> surprised no one mentioned it. It was Windows F-ing
> >>>> Firewall!
> >>>
> >>> Good to hear that you could find and solve the problem.
> >>>
> >>> (Off topic:)
> >>>
> >>>> I HATE WINDOWS!!
> >>>
> >>> What I can't quite understand is, how one can "hate" Windows or
> >>> its "F-ing" firewall, if they just do what they were configured
> >>> to do... ;-)
> >>>
> >>> When setting up the Windows Firewall, I normally only create
> >>> rules for specific (TCP) ports, not for specific executables,
> >>> so that the firewall allows connections to a TCP port
> >>> regardless of what the name or path of the executable is.
> >>
> >> Actually, as surprising as it can sometimes be, I find that the
> >> Windows firewall is better than iptables *because* it /can/ do
> >> things like this. You can make your system a bit safer.
> >>
> >> For instance, if your server is compromised (yes, I know, once
> >> you're owned, you're owned) and the attacker installs some
> >> malware of some kind, that malware will not be able to bind to a
> >> port or even make outgoing connections, even on "standard"
> >> outgoing ports -- for instance HTTP.
> >>
> >> Lots of malware connects to external C&C servers to give
> >> instructions, and the Windows wirewall makes it easy to prevent
> >> that from happening even when ports like 80 are used -- and
> >> typically left wide-open on servers.
> >>
> >> - -chris
> >>
> >
> > +1 chris, and for these reasons/features (and more), I LOVE WINDOWS
> > (SERVER 2008)!!! :)
>
> It's firewall notwithstanding, Microsoft Windows is a really terrible
> server OS. At least Powershell gave admins the capability to do things
> without having to use a GUI for every damn thing, but there is just
> too much BS in a Windows box for me to ever consider it for a server.
>

You are definitely entitled to your opinion and OS preference. Since
majority of my experience has been Windows (and even though I love being a
keyboard user and hate to operate a mouse), the GUI does not bother me,
since I have learned to use keyboard shortcuts to help me operate Windows
apps (or GUI, as you call it), been doing those keyboard shortcuts for
almost 20 years now. :)


>
> Add to that the fact that you have to pay insane license fees, though
> you would also have to do that I suppose if you used SCO, AIX, etc.
> Solaris, BSD, and Linux are all free and have entire ecosystems that
> aren't dominated by the closed-source paradigm.
>

Actually, I have found Linux to be 'attractive', since it is 'free' and
since there is less GUI and more command-line there. I had some exposure to
Linux and Unix in the past, and I fell in love with UNIX just before I
graduated from college, and it was at that point that I made that
statement, I can see myself doing this (SPARC machine, Unix OS, and
keyboard, programming etc...) for the next 5 to 10 years (as a career)...I
was really in love with the keyboard (most of all, in the computer lab). :)

Instead of downloading Linux and trying it out, on my own, I just decided
to stay with Windows. it just works (for me). And I usually only need 1 or
2 client access licenses (CALs) per server, since I am the primary person
that remotely access the server. The servers are primarily used as file
servers, until recently, when I developed my first Java EE web application
within the last 2 years, so now 1 of the 2 Windows servers are used only as
a web (app) server.


> I hope th

Re: [OT] Out of memory exception - top posting

2014-01-23 Thread Howard W. Smith, Jr.
On Thu, Jan 23, 2014 at 2:08 PM, André Warnier  wrote:

>
> Either people don't read the rules, or they do not understand the rule, or
> they just ignore it.
>

I agree. As a tomcat/tomee user, I joined the list, primarily, to listen in
on topics (that interest me), so I learned, very quickly, that top-posting
is not preferred, here.


> Anyway, it seems that we're spending more time lately asking people to not
> top-post, than actually providing answers to their questions.
>

Actually, it seems as though (tomcat lead) Mark Thomas (and others) have
been quite tolerable of recent top-posting, and still offer advice and
responses (sometimes) without the inevitable, 'don't top post'
phrase/response.

+1 for those always and/or unconditionally providing support to tomcat
users.

Also, gmail makes it easy for me to honor the rule against top-posting.


Re: [OT] RE: Cannot connect from outside using Tomcat 7/APR/SSL on AWS Windows system

2014-01-23 Thread Howard W. Smith, Jr.
On Wed, Jan 22, 2014 at 10:14 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Konstantin,
>
> On 1/22/14, 9:03 AM, Konstantin Preißer wrote:
> > Hi Jeffrey,
> >
> >> -Original Message- From: Jeffrey Janner
> >> [mailto:jeffrey.jan...@polydyne.com] Sent: Tuesday, January 21,
> >> 2014 10:19 PM
> >
> >> Eureka, I finally figured it out! It was a real eureka moment,
> >> some remembrance burned its way up from my subconscious and I had
> >> the answer. Ready guys?  Really surprised no one mentioned it. It
> >> was Windows F-ing Firewall!
> >
> > Good to hear that you could find and solve the problem.
> >
> > (Off topic:)
> >
> >> I HATE WINDOWS!!
> >
> > What I can't quite understand is, how one can "hate" Windows or its
> > "F-ing" firewall, if they just do what they were configured to
> > do... ;-)
> >
> > When setting up the Windows Firewall, I normally only create rules
> > for specific (TCP) ports, not for specific executables, so that the
> > firewall allows connections to a TCP port regardless of what the
> > name or path of the executable is.
>
> Actually, as surprising as it can sometimes be, I find that the
> Windows firewall is better than iptables *because* it /can/ do things
> like this. You can make your system a bit safer.
>
> For instance, if your server is compromised (yes, I know, once you're
> owned, you're owned) and the attacker installs some malware of some
> kind, that malware will not be able to bind to a port or even make
> outgoing connections, even on "standard" outgoing ports -- for
> instance HTTP.
>
> Lots of malware connects to external C&C servers to give instructions,
> and the Windows wirewall makes it easy to prevent that from happening
> even when ports like 80 are used -- and typically left wide-open on
> servers.
>
> - -chris
>

+1 chris, and for these reasons/features (and more), I LOVE WINDOWS (SERVER
2008)!!! :)


Re: Notification strategy for OutOfMemoryError

2014-01-23 Thread Howard W. Smith, Jr.
On Thu, Jan 23, 2014 at 8:21 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Glad to see my thoughts were useful. If you'd care to post your code
> to either the list or onto the wiki, I'm sure it would be useful to
> someone.
>

+1 I love it when others share code, and thanks for suggesting that Chris.


Re: "exception-message" header reveals path to document root in 404 response.

2014-01-11 Thread Howard W. Smith, Jr.
On Sat, Jan 11, 2014 at 9:01 AM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com]
> > Subject: Re: "exception-message" header reveals path to document root in
> 404 response.
>
> > Wow, when I saw this last night, I shook my head and said to myself,
>
> > Server: Apache-Coyote/1.1
>
> > this may be one of the reasons why my server/web-app are subject to
> > repeat-offender attacks from certain/few IP addresses in China/Vietnam.
>
> For the truly paranoid (to quote from the docs), look at the server
> attribute of the  element:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>

+1 and LOL.

server

Overrides the Server header for the http response. If set, the value for
this attribute overrides the Tomcat default and any Server header set by a
web application. If not set, any value specified by the application is
used. If the application does not specify a value then Apache-Coyote/1.1 is
used. Unless you are paranoid, you won't need this feature.

Thanks Chuck for the response and for quoting the user guide. I have not
set 'server' on the Connector and still have no need of setting the
'server' attribute. Nice to know that that is available. :)


Re: "exception-message" header reveals path to document root in 404 response.

2014-01-11 Thread Howard W. Smith, Jr.
On Fri, Jan 10, 2014 at 7:02 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> Here's Tomcat's standard 404 response:
>
> HTTP/1.1 404 Not Found
> Server: Apache-Coyote/1.1
> Content-Type: text/html;charset=utf-8
> Content-Length: 1027
> Date: Fri, 10 Jan 2014 23:59:34 GMT
>

Wow, when I saw this last night, I shook my head and said to myself,

Server: Apache-Coyote/1.1

this may be one of the reasons why my server/web-app are subject to
repeat-offender attacks from certain/few IP addresses in China/Vietnam.

I never new that a 404 would expose the server name (apache coyote). I
guess/assume that once they see that server name in the 404 response, some
of those bots continue to try and try.


Re: Getting 404 before the container starts all servlets

2014-01-11 Thread Howard W. Smith, Jr.
On Sat, Jan 11, 2014 at 4:40 AM, Mark Thomas  wrote:

> On 10/01/2014 23:08, Adrian Tarau wrote:
> > I tried with 7.0.47 and I still get 404 regardless of the the state of
> > bindOnInit.
>
> Tomcat doesn't serve *any* requests until everything (including
> applications) has started up. bindOnInit only controls when it starts
> accepting connections.
>
> You should only see any response (including 404s) once all the
> applications have reported that they have started.
>
> From what you describe it appears that your application is continuing to
> do some initialisation after it has reported it is started.
>
> Servlets do use lazy init by default but a request to a servlet should
> not complete until after the servlet has finished initialising.
>
> All the indications are that the 404s you are seeing are a result of how
> your application is designed.


+1, and well said, Mark!


Re: Error when performing a reset of the server

2014-01-08 Thread Howard W. Smith, Jr.
Chuck,

On Wed, Jan 8, 2014 at 6:58 PM, Chuck Johnson wrote:

> I haven't had the error occur when I have had to restart the Tomcat
> server, my co-worker is the person who has experienced it and my
> understanding is that it happens when she attempts to perform a reset and
> the only way that she resolves it is to reboot the windows server.


That says it all right there.

You (and/or your user) have success.

your coworker (and/or her user (ID/acct/profile)) does not have success.

your coworker 'only' has success when she restarts windows server.

when restarting the windows server, the service must be configured to
'automatic', and a clean restart usually = clean (re)start of tomcat...I
would assume.

This answer[1] on stackoverflow may hint on a solution and/or cause of the
error that your coworker is experiencing.

I have tomcat 7.0.47 (via tomee+) running on Windows 2008 R2 64-bit with
jdk1.7.0_45, and I only login to the server with one user ID, and I use
tomcat7w.exe to start/stop service, manually, but service is configured to
start automatically when server is (re)started. The user ID that I always
use...was also responsible for adding tomcat/tomee as Windows service.

Who or what user (ID) usually has success start/stopping tomcat manually
via tomcat7w.exe or via Windows Services window/app?

Was your coworker able to start/stop tomcat in the past with no issues? if
so, what changed? new install of tomcat? new config of tomcat? different
user (ID) added tomcat as windows service? ...


[1] http://stackoverflow.com/a/19710121/933054


Re: [OT] Garbage Collectors

2013-12-18 Thread Howard W. Smith, Jr.
On Wed, Dec 18, 2013 at 6:57 PM, Leon Rosenberg wrote:

> On Thu, Dec 19, 2013 at 12:51 AM, Howard W. Smith, Jr. <
> smithh032...@gmail.com> wrote:
>
> > On Wed, Dec 18, 2013 at 6:11 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >
> > > 3. What is your total heap size?
> > >
> >
> > -Xms4096m
> > -Xmx4096m
> > -XX:MaxPermSize=384m (will share this as well, just because)
> >
> >
> > but I think I can change to -Xms/-Xmx1250m, because heap used seem to max
> > out at (+/-)1024m.
> >
> >
> Don't, GC works best if used heap is < half of allowed heap. So keep at
> least 2G (You know that you can specify 4G instead of 4096M, right? :-))


Thanks Leon. I have been considering changing it to 2048M (or 2G, as you
say). No, I didn't know I could specify '4G'. :)


Re: [OT] Garbage Collectors

2013-12-18 Thread Howard W. Smith, Jr.
On Wed, Dec 18, 2013 at 6:11 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> 1. What JVM are you using?
>
>
>

Answer: [X] Sun/Oracle/OpenJDK Java 1.7


>
>
> 2. What kind of web application are you running?
>
>
> Answer: [X] A moderately busy web site (<1M requests/mo/server)


> 3. What is your total heap size?
>

-Xms4096m
-Xmx4096m
-XX:MaxPermSize=384m (will share this as well, just because)


but I think I can change to -Xms/-Xmx1250m, because heap used seem to max
out at (+/-)1024m.


>
> 4. Are you explicitly specifying a Garbage Collector? If not, just say
> so and skip the rest of the questions.
>

-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled


>
> 5. What led you to use [GC X] instead of the JVM's default collector?
>

I've seen CMS recommended almost any/everywhere.


>
> 6. Did you do any actual performance testing to see if the switch from
> the default to [GC X] made any difference?
>

No.


>
> 6. Have you spent a lot of time tuning [GC X]?
>

A little...over time. I primarily adjusted -Xms/-Xmx a few times.


>
> 7. Did your tuning exercise yield any useful results?
>

Yes. I don't experience OutOfMemory exceptions, and app runs just fine.


>
> 8. Did your users notice any difference after you implemented [GC X],
> or just your own load-testing team?
>

No. My app has been configured to use CMS ever since the beginning of
time/production.


>
> If you think there's anything else I should know about your experience
> with [GC X], please let me know.
>

To answer #4, I searched google, and found this[1], and that helped me
answer your question. :)

I am sure that I can lower my -Xms/-Xmx4096m heap size, but with 32GB of
RAM on the server, i'm not really pressed to do so. The server is used just
for the app.


[1] http://www.cubrid.org/blog/textyle/428187


Re: What if my database is unavailable at startup?

2013-12-13 Thread Howard W. Smith, Jr.
OP,

On Fri, Dec 13, 2013 at 2:24 PM, Dames, Kristopher J <
kristopher.da...@mercy.net> wrote:

> I use tomcat 6 and have noticed if a database is not available when tomcat
> starts, tomcat will not try to connect once the database becomes available.
> Tomcat must be restarted to establish the database connection. What are
> best practices regarding this? Is there a way in tomcat to get it to
> automatically retry so I don't have to restart tomcat? I use DBCP but am
> willing to try some other pool.


Barry,

On Fri, Dec 13, 2013 at 4:59 PM, Propes, Barry L wrote:

> I use DBCP and Oracle as well, and am also on Tomcat 6 - 6.0.26. Take a
> look at mine, as I have NO trouble with it, and see if you can configure it
> similarly with success. NOTE - remove those other two parameters that Jose
> mentions in a prior email.
>
>auth="Container"
> description="mytomcatapp"
> name="jdbc/myoracle"
> type="javax.sql.DataSource"
> driverClassName="oracle.jdbc.driver.OracleDriver"
> username="username"
> password="password"
> url="jdbc:oracle:thin:@cgnrdb1p:1648:SERVNAME"
> maxIdle="30"
> maxWait="1"
> maxActive="10"
> testOnBorrow="true"
> timeBetweenEvictionRunsMillis="-1"
> minEvictableIdleTimeMillis="28800"
> poolPreparedStatements="true"
> removeAbandoned="true"
> removeAbandonedTimeout="300"
> logAbandoned="false"/>
>

are you suggesting that your (or a correct(ed))  will solve the
problem stated in OP (above)?

can/should we assume that your URL is referencing a database on a different
machine, same network/intranet/LAN?

>  url="jdbc:oracle:thin:@x.y.com:1521:x"

it seems as though OP is referencing a database somewhere on the 'internet'.


Re: Pooled Connections Lost After 10 Minutes (600 seconds)

2013-12-09 Thread Howard W. Smith, Jr.
Alec, Dan, and Chris,

On Wed, Dec 4, 2013 at 1:01 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Dan,
>
> On 12/3/13, 12:32 PM, Daniel Mikusa wrote:
> > On Dec 3, 2013, at 12:14 PM, Tomcat Random
> >  wrote:
> >
> >> I considered using a validation query but it seemed like extra
> >> overhead when the default behavior was not, um, behaving in the
> >> default way.
> >
> > The overhead is typically minimal.  Running "SELECT 1" or some
> > other very simply query is not likely to bring your database to
> > it's knees.  It might add a small amount of latency as the pool
> > will need to execute the query before it give the connection to
> > your application, but that's likely to be dwarfed by whatever your
> > application does with the connection after it gets it.
> >
> > If you are concerned you can do a couple things to make the process
> > even more lightweight.
> >
> > 1.) With MySQL and use "/* ping */ SELECT 1" as the validation
> > query.  This is a special case with the MySQL JDBC driver that uses
> > even less resources.
>
> +1
>
> We use this everywhere. I've never actually benchmarked it, but since
> it does not execute a query on the server, it pretty much has to be
> faster by any measure.
>
> > 2.) You can use the tomcat-jdbc connection pool which has a
> > validationInterval setting.  This will ensure that the validation
> > query is only executed one time during the specified time interval.
> >
> I haven't moved to tomcat-pool yet, but this was my initial reaction
> to Alec's question about usually not needing the validation query.
>
> > ...or you can go without a validation query, but it's not something
> > I would recommend and not something I see done very often.  The
> > minimal overhead is usually worth knowing that you get a valid
> > connection from the pool.
>
> +1
>
> If you don't use a validation query, you need additional try/catch
> blocks around all your "getConnection()" calls, and a loop to re-try
> just in case the first connection was bad.
>
> I think without a validationQuery, your pool will effectively dry-up
> over time.
>

+1 interesting topic and responses. Thanks!

Since I'm using TomEE, tomcat jdbc pool is default, and below is the config.


  JdbcDriver org.apache.derby.jdbc.EmbeddedDriver
  JdbcUrl jdbc:derby:X:/myPathToMyDB;create=true
  UserName 
  Password 
  JtaManaged true
  jmxEnabled true
  InitialSize 10
  MaxActive 30
  MaxIdle 20
  MaxWait 1
  minIdle 10
  suspectTimeout 60
  removeAbandoned true
  removeAbandonedTimeout 180
  timeBetweenEvictionRunsMillis 3
  jdbcInterceptors=StatementCache(max=1024)


As you can see, I am one of those rare cases that Dan mentioned...not using
validationQuery. Not so much intentional, but I'm still somewhat novice as
tomcat user.

With that said, I have not had the need to add try/catch to ensure I get a
good connection from the pool. I don't have high traffic coming to my web
app, but there are times when multiple users are using the app, and I see
absolutely 'no' connection issues (ever), and performance is quite
good/sound as well.

So, I do hear the recommendations, in this thread, about validation query,
but my app has not told me yet...that it needs the validation query. :)


Re: [OT] Symantic has a first tomcat worm ;-)

2013-11-26 Thread Howard W. Smith, Jr.
On Tue, Nov 26, 2013 at 5:53 AM, André Warnier  wrote:

> So yes, by any means, have the Manager disabled by default, even when
> subsequently enabled restrict it by default to localhost, ...


+1


Re: Java +GC question

2013-11-24 Thread Howard W. Smith, Jr.
On Sun, Nov 24, 2013 at 7:15 PM, André Warnier  wrote:

> Caldarale, Charles R wrote:
>
>> From: André Warnier [mailto:a...@ice-sa.com] Subject: Java +GC question
>>>
>>
>>  java version "1.6.0_26"
>>>
>>
>> Do we need to tell you to upgrade?
>>
>
> Whatever happened to the "Never change a running system" ?


I usually hear it said like this, if it ain't broke, then don't fix it. :)


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-11 Thread Howard W. Smith, Jr.
On Mon, Nov 11, 2013 at 10:23 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Howard,
>
>
> I might recommend using a Filter like this:
>
> filter() {
>try {
>  chain.doFilter();
>} catch (SocketTimeoutException ste) {
>  application.log("Got STE for request " + request.getRequestURI()
> + with client " + request.getHeader("User-Agent"));
>}
> }
>
> ... or something like that. It might help uncover patterns in dropped
> connections.


agreed, i decided to do this (below) yesterday evening (to prevent the
stacktrace in the log file; noted your recommendation/usage of catching
SocketTimeoutException, thanks),

try {
chain.doFilter(req, res);
} catch (org.apache.catalina.connector.ClientAbortException e) {
logger.error("caught
org.apache.catalina.connector.ClientAbortException: " + e.getMessage());
}


since I already know the culprit(s); see details/explanation, below.



> Maybe Igor is right and the problem is some browser (e.g. MSIE 8) and not
> necessarily mobile clients.
>

it is the mobile device phone/internet connection that is lost, recycled,
recovered (or however you want to explain it). see below (and saved a copy
on gist[1], too).

user1 (iPad, internal verizon wireless 4G phone/internet connection)
connects and accesses login.xhtml page

70.215.84.34 - - [09/Nov/2013:13:08:20 -0500] "GET /webapp/index.jsf
HTTP/1.1" 302 -
70.215.84.34 - - [09/Nov/2013:13:08:22 -0500] "GET /webapp/login.jsf
HTTP/1.1" 200 1445
70.215.84.34 - - [09/Nov/2013:13:08:25 -0500] "GET
/webapp/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 10036


user1 (iPad); note localhost_access_log and tomcat7-stderr log lines below;
note the request filenames, date/time, and exceptions

70.215.84.34 - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -
70.215.84.34 - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException
at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:413)

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery-plugins.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException
at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:413)


user1 (iPad, different IP address) clicks Login button on login.xhtml, POST
to server, successful login, server redirects to index.xhtml

70.208.164.166 - - [09/Nov/2013:13:09:52 -0500] "POST /webapp/login.jsf
HTTP/1.1" 302 -
70.208.164.166 - - [09/Nov/2013:13:09:52 -0500] "GET /webapp/index.jsf
HTTP/1.1" 200 7008

Nov 09, 2013 1:09:52 PM pf.ApplicationScopeBean login
INFO: sessionId = user1B4584B981555A703B8E0DA189D2294F5

Nov 09, 2013 1:09:52 PM jsf.users.pf_UsersController loginUser
INFO: user1 (iPad) logged in at 11/09/2013 01:09 PM


user1 (iPad) GET resource, user2 initiate/GET websocket, user1 initiate/GET
websocket, respectively

70.208.164.166 - - [09/Nov/2013:13:09:53 -0500] "GET
/webapp/resources/images/loading_circleThickBox.gif?pfdrid_c=true HTTP/1.1"
304 -

166.137.105.198 - - [09/Nov/2013:13:09:53 -0500] "GET
/webapp/primepush/user27BF5C51CF354C1F4926B835CB7F2083E?X-Atmosphere-Transport=close&X-Atmosphere-tracking-id=f2a3916c-62a0-477e-b226-539857827c2e
HTTP/1.1" 200 -

70.208.164.166 - - [09/Nov/2013:13:09:54 -0500] "GET
/webapp/primepush/user1B4584B981555A703B8E0DA189D2294F5?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.0.3-jquery&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&X-atmo-protocol=true
HTTP/1.1" 101 -


[1]
https://gist.github.com/smithh032772/7380812#file-2013-11-11-discussion_details-txt


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-11 Thread Howard W. Smith, Jr.
On Mon, Nov 11, 2013 at 5:41 AM, André Warnier  wrote:

> Howard W. Smith, Jr. wrote:
>
>> On Sun, Nov 10, 2013 at 9:14 AM, Howard W. Smith, Jr. <
>> smithh032...@gmail.com> wrote:
>>
>>  Caused by: java.net.SocketTimeoutException
>>> at
>>> org.apache.tomcat.util.net.NioBlockingSelector.write(
>>> NioBlockingSelector.java:127)
>>> at
>>> org.apache.tomcat.util.net.NioSelectorPool.write(
>>> NioSelectorPool.java:174)
>>>  at
>>> org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(
>>> InternalNioOutputBuffer.java:163)
>>>
>>>
>> my apologies, based on this exception (above), I decided to provide you
>> with the following from my tomee/conf/server.xml:
>>
>>
>> > protocol="org.apache.coyote.http11.Http11NioProtocol"
>>maxThreads="150" connectionTimeout="2"
>> acceptorThreadCount="2"
>>redirectPort="8443" socket.directBuffer="false"/>
>>
>>
>> I guess the answer may be the connectionTimeout="..." (above), but still
>> would like to know recommendations of others based on experience with web
>> application serving mobile clients. thanks.
>>
>>
> AFAIK, the "connectionTimeout" above applies specifically to this :
> - the client opens a TCP connection to the server
> - but then the client does not send any request over that connection
> (so the server waits and waits, until that timeout strikes).
> This is a classic way of doing a DoS attack : many clients connect and
> don't send a request (or do it very slowly), tying up server resources
> until the server is overwhelmed.
> In some Connector configurations, this does not necessarily tie up a
> Thread (only a TCP socket), but it does have the potential to tie up
> limited resources.
> The value of 2 above is in milliseconds, so after a connection is
> established, the server will wait up to 20 seconds for a request to be
> received.
> I would not expect nowadays that any client, on any type of connection,
> would take that long to send a request on an established connection.  So I
> would certainly not make it larger, and you can probably reduce it
> significantly, and save resources.
>
>
>
Great, thank you!

I left it as-is and given the situation (which I communicated earlier), I
saw no need to increase the connectionTimeout value. Noted your
recommendation about decreasing the value...for now.

thanks again!


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
On Sun, Nov 10, 2013 at 8:54 PM, Igor Cicimov  wrote:

> There is heaps of articles and questions in various forums
>

you're right... i searched google for ClientAbortException in tomcat nabble
archive, and saw many posts.


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
On Sun, Nov 10, 2013 at 8:54 PM, Igor Cicimov  wrote:

> >
>
Also you didn't say anything about any load balancer or proxy fronting your
> application. It is worth checking the timeouts there as well and align them
> with the
> connection timeout on your server (in case you do use one of course).
>

there is no load balancer or proxy fronting the web application. thanks.


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
On Sun, Nov 10, 2013 at 5:08 PM, Igor Cicimov  wrote:

> For Sun Java for example you can try the following:
>
> -Dsun.net.client.defaultReadTimeout=180
>
> which will increase the socket timeout to 30 minutes lets say if the
> default one is not enough in case or slow client. Another thing to check is
> your OS socket timeout setting, on linux systems for example:
>
> net.ipv4.tcp_keepalive_time = 300
>
> and try adjusting it according to your needs.
>
> Would love to hear some other people experiences and thoughts regarding
> this as well, this is really annoying one to troubleshoot.
>

I like the following that was mentioned in a stackoverflow answer[1]:

> It just means the client isn't sending. You don't need to worry about it.
Browser clients come and go in all sorts of strange ways.

> I wouldn't put the server read timeout too high: it ties up a thread. If
a client opens a connection to the server and doesn't send anything
immediately it is misbehaving pretty badly.

I agree with all of that and based on that, I will not modify the NIO
connectiontimeout value. I would like to prevent the stacktrace from being
logged in tomcat7-stderr log file, so I think I will catch the exception in
my servlet filter.


[1] http://stackoverflow.com/a/17079991/933054


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
On Sun, Nov 10, 2013 at 5:08 PM, Igor Cicimov  wrote:

>
> In my experience SocketTimeoutException comes up in case of misbehaving
> browser (read IE 8 and older), i.e. the client fails to send the complete
> request and the socket timeout strikes.


interesting, thanks. This error occurs when different endusers are
accessing web application via Google Chrome on Android tablet or phone, and
Google Chrome (or Safari) on iPad.


>
> You don't provide information about the Java and OS version you are running
> your app on since this might be related to one of them (or maybe I missed
> that info).


my apologies,

JVM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08, mixed mode)
Java: version 1.7.0_45, vendor Oracle Corporation
OS: Microsoft Windows Server 2008 R2 64-bit


> For Sun Java for example you can try the following:
>
> -Dsun.net.client.defaultReadTimeout=180
>
> which will increase the socket timeout to 30 minutes lets say if the
> default one is not enough in case or slow client. Another thing to check is
> your OS socket timeout setting, on linux systems for example:
>
> net.ipv4.tcp_keepalive_time = 300
>
> and try adjusting it according to your needs.
>

noted, thanks.


>
> Would love to hear some other people experiences and thoughts regarding
> this as well, this is really annoying one to troubleshoot.
>

agreed/ditto. thanks for your response.


Re: Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
On Sun, Nov 10, 2013 at 9:14 AM, Howard W. Smith, Jr. <
smithh032...@gmail.com> wrote:

> Caused by: java.net.SocketTimeoutException
> at
> org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:127)
> at
> org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
>  at
> org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)
>

my apologies, based on this exception (above), I decided to provide you
with the following from my tomee/conf/server.xml:





I guess the answer may be the connectionTimeout="..." (above), but still
would like to know recommendations of others based on experience with web
application serving mobile clients. thanks.


Avoiding/Handling SocketTimeoutException(s) when web application serving resources to mobile clients

2013-11-10 Thread Howard W. Smith, Jr.
Using Tomcat 7.0.47 via TomEE 1.6.0 along with MyFaces 2.1.13

Recently, I have been experiencing the SocketTimeoutException when web
application is serving resources to 'mobile clients'. Yesterday, user was
attempting to login from mobile iPad via an internal wireless phone
connection. Since my web application is accessed by mobile clients and
since I started using TomEE (tomcat7 and myfaces), I have seen the 'Error
trying to load resource ...' (below), but I have not seen the
SocketTimeoutException until I recently started using Tomcat 7.0.47 and
MyFaces 2.1.13.

I saved the first occurrence (Nov 8, 2013) of this exception on gist[1] and
saved Nov 9, 2013 occurrence on gist as well. I do have a web/servlet
filter in place, and I assume that I can catch the SocketTimeoutException
(when client is mobile) to prevent the stacktrace in the log, but this
exception is 'now' being logged to tomcat7-stderr, but this
SocketTimeoutException was not logged with previous versions of Tomcat
7.0.x and MyFaces 2.1.x. I assume that this is new logging behavior of
MyFaces 2.1.13 (or there is something new about Tomcat 7.0.47) but I may be
mistaking.

Please see all below, and advise how I can prevent this exception, if I can
adjust some tomcat settings to increase the socket timeout value, or
recommendations about serving resources to 'mobile clients'. I'm thinking
that I can increase the expiration of client resources from my web/servlet
filter, so this will not occur as often. This exception does not occur
everytime, but i'm sure you can understand that this 'can' happen
frequently and sporadically, depending on the connection between server and
mobile-device-via-wireless-phone-connection.


localhost_access_log shows the follow (please note the filenames and time
difference between the 1, 2, and 3rd lines below)


x.x.x.x - - [09/Nov/2013:13:08:25 -0500] "GET
/webapp/javax.faces.resource/primefaces.css.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 10036

x.x.x.x - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -

x.x.x.x - - [09/Nov/2013:13:09:00 -0500] "GET
/webapp/javax.faces.resource/jquery/jquery-plugins.js.jsf?ln=primefaces&v=4.0.3
HTTP/1.1" 200 -


tomcat7-stderr

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException
at
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:413)

Caused by: java.net.SocketTimeoutException
at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:127)
at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
at
org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)

Nov 09, 2013 1:09:00 PM org.apache.myfaces.application.ResourceHandlerImpl
handleResourceRequest
SEVERE: Error trying to load resource jquery/jquery-plugins.js with library
primefaces :null
ClientAbortException:  java.net.SocketTimeoutException

Caused by: java.net.SocketTimeoutException
at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:127)
at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
at
org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)


[1] https://gist.github.com/smithh032772/7380812


Re: how to reply

2013-11-06 Thread Howard W. Smith, Jr.
On Wed, Nov 6, 2013 at 9:42 PM, Konstantin Kolinko
wrote:

> There are too many goodies with mailing lists. The forums are lacking much.


+1

I am quite active in forum.primefaces.org, and I get email alerts to my @
hotmail.com account and have to go to the primefaces forum and read/reply,
but it is much much nicer having (Apache) tomcat/tomee/activemq mail lists
sending emails to my @gmail.com account, and I can use the nice features of
gmail from Google Chrome browser on my desktop and mobile devices and
read/reply, accordingly, if interested/necessary.

And gmail.com now groups 'forum' emails (optional, per your preference), so
emails from Apache mail lists are grouped under the Forums tab. i'm loving
all that (and more).


Re: Web Service Client Response when Old Gen is 100%

2013-11-06 Thread Howard W. Smith, Jr.
On Wed, Nov 6, 2013 at 1:43 AM, Muhammad Ali Orakzai wrote:

>
> I am using the following environment
>
> Windows Server 2003 32 bit
>

How much RAM? Also, did you configure your virtual memory (or paging file)
settings?


> Apache Tomcat 7.0.27
>

Others on the list will/may recommend you to upgrade to a newer version of
Tomcat 7.0.x for security fixes/updates and bug fixes, but should not be
necessary to fix this issue of yours.


> We have created a SOAP based web service which is calling 2 external SOAP
> services. We were getting OutOfMemoryError which was resloved by making the
> service object static.


interesting.

are you recycling or releasing memory to GC, or are you caching (or never
releasing) data from your app... every time you call 2 external SOAP
services?

i think you may need to refactor your code/app to release memory at some
point, if it's not doing that already.

at your earliest convenience, read this post below:

How to Fix Memory Leaks in Java[1]

Now whenever the server memory reaches 100% one of
> the external service response is too slow (takes about 2-3 minutes).
>

okay.


> Restarting tomcat resolves the issue but this issue is occurring 25-26
> hours interval.
>

i can definitely understand that this is not acceptable.


>
>  I am using the following jvm settings
>
> -XX:MaxPermSize=100m
> -XX:+UseConcMarkSweepGC
> -XX:+CMSClassUnloadingEnabled
>

In my app, I use the following:

-Xms1024m
-Xmx1024m
-XX:MaxPermSize=384m
-XX:+UseTLAB
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled

there are strategies on how to use -Xms and -Xmx to improve performance
(and/or prevent out of memory error). you may want to research that a bit.


[1] http://java.dzone.com/news/how-fix-memory-leaks-java


RE: Bad Gateway

2013-10-09 Thread Salisbury, Richard W DLA CTR TRANSACTION SERVICES
>You appear to be missing SSLEnabled="true" on your Tomcat connector.
>
>The start-up log messages for that connector will confirm whether that
>analysis is correct.
>
>Mark

Thank you Mark.

That was it.  

I added SSLEnabled="true" to the Tomcat connector, restarted Tomcat and
the Bad Gateway error disappeared.
Don't know why the production system works without that setting, unless
it is because it is a different version.

Anyway, we thank you very much for your assistance.  
This is awesome.

Richard


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



Bad Gateway

2013-10-08 Thread Salisbury, Richard W DLA CTR TRANSACTION SERVICES
We are getting a "Bad Gateway" error when attempting to go to a web app
in our test environment.  As far as we know it has never worked in our
test environment, but it is working in our production environment.  I
know this appears backwards, but we inherited this system as is.  I hope
there is not too much information below, but I wanted to provide as much
as I could think of that might be relevant.  If anybody has any ideas on
what to check next, it would be very much appreciated, as we are stuck.
 
We have compared as many configuration files as we know of between the
two environments, and have found some differences and made changes so
they match, and restarted Apache or Tomcat as appropriate, but we still
get the error.   Here is the error, as displayed by Internet Explorer 8:
 
Bad Gateway
The proxy server received an invalid response from an upstream server.


Apache Server at  Port 6443
 
We're using Apache 2.2.15 and Tomcat 6.0.35, installed on different
servers (both HP-UX), which we will call server-A (Apache) and server-B
(Tomcat).  Apache is stand-alone and Tomcat is installed as part of
another application.  And here is the flow of control (the load balancer
distributes to two Apache servers, but we only show one here): 
browser ->https-> 
load balancer ->https-> 
Apache server-A (6443)-> https->
Tomcat server-B (53309)->http-> other servers 
  
The only log file that contained an error was the Apache access_log on
server-A:
[error] (502): proxy: pass request body failed to xxx.xxx.xxx.xxx:53309
(server-B's FQDN)
(where xxx.xxx.xxx.xxx is server-B's IP)
 
The Apache's ssl.conf on server-A defines a virtual host that passes
requests coming in on port 6443 to Tomcat on server-B port 53309.  Here
are a few details from the ssl.conf:
Listen 0.0.0.0:6443


SSLEngine on
SSLProtocol TLSv1
ProxyPass / https://server-B:53309/

 
We confirmed there is connectivity from server-A to port 53309 on
server-B using telnet on server-A:
[server-A]>telnet server-B 53309
Trying...
Connected to server-B.
Escape character is '^]'.
telnet> quit
Connection closed.
[server-A]>
 
We confirmed that server-B is listening on port 53309:
netstat -a | grep 53309
tcp0  0  *.53309*.*
LISTEN
 
We confirmed that Tomcat on server-B is configured to handle port 53309,
from this excerpt from its server.xml:

 
We confirmed Tomcat was started successfully on server-B and listening
on port 53309, from the application log:
2013-08-22 18:01:49,321 INFO : Succesfully started Apache Tomcat/6.0.35
@ Catalina:53309
 
Any ideas on what might be going on?
 


Re: [ANN] New committer: Konstantin Preißer

2013-09-24 Thread Howard W. Smith, Jr.
On Tue, Sep 24, 2013 at 6:20 PM, Mark Thomas  wrote:

> On behalf of the Tomcat committers I am pleased to announce that
> Konstantin Preißer has been voted in as a new Tomcat committer.
>
> In addition to a number of high quality bug reports and patches,
> Konstantin is also responsible for the makeover the Tomcat web site and
> Tomcat 8 documentation has received.
>
> Please join me in welcoming him.
>
> Regards,
>
> Mark
>

congrats Konstantin and  keep up the good work!


Re: New website skin looks great

2013-09-13 Thread Howard W. Smith, Jr.
On Thu, Sep 12, 2013 at 4:28 PM, Campbell, Lance  wrote:

>  WOW!  I love the new design of the tomcat web site.  It looks much more
> professional and refined.  It is also much easier to read.  The prior
> background colors caused the text to run together.   This is so much
> better.  I love the subtle but clear separation and grouping of information.
> 
>
> **
>

+1 me too, thanks for the post.


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


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


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?


WebappClassLoader problem

2013-07-31 Thread Edward W. Rouse
I'm losing my mind here. I finally went full standard to see if the changes
in tomcat 7 would allow me to avoid custom class loaders and contexts, but
ran into a catch-22 issue.

 

I was getting:

 

java.lang.ClassCastException:
com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer cannot
be cast to javax.servlet.ServletContainerInitializer

at
org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(Con
textConfig.java:1654)

at
org.apache.catalina.startup.ContextConfig.processServletContainerInitializer
s(ContextConfig.java:1562)

at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)

at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:
878)

at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:
376)

at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:119)

at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java
:90)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5322)

 

So I tracked down where the WSServletContainerInitializer was coming from
and removed the jar file. Now I get:

 

SEVERE: Error configuring application listener of class
org.apache.catalina.deploy.ApplicationListener@1b104d7

java.lang.ClassNotFoundException:
com.sun.xml.ws.transport.http.servlet.WSServletContextListener

at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1714)

at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1559)

at
org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceMan
ager.java:527)

at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(Def
aultInstanceManager.java:509)

at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceM
anager.java:137)

at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
4854)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5434)

at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:9
01)

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)

at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1
671)

at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)

at java.lang.Thread.run(Thread.java:662)

 

and what's in the context is:

 



  



 



  

 

 

So now what? I'm using the classes provided by apache and I'm damned if I do
and damned if I don't. Is there even a solution to this?



RE: context problem

2013-07-24 Thread Edward W. Rouse
I had tried that before but thought I'd try again. Not working and I'm not
sure why. The external files are actual additional war files that act as
modifiers to add items to menus as well as other things. There are class
files, jar files in their WEB-INF/lib dirs , html, jsp, etc... And there
could be 0..50 depending on what options are needed.

They do all reside in the same directory that we treat as an extra webapps
directory, but it doesn't merge anything. So the old process was to go to
location A, grab war files (expanded) 1,2 and 3 and merge them into the
proper locations within the base war file (apparently in memory) so that it
looks like a single code base to tomcat. Again, worked in 5.5 not in 7.0.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, July 24, 2013 12:32 PM
To: Tomcat Users List
Subject: RE: context problem

> From: Edward W. Rouse [mailto:ero...@comsquared.com]
> Subject: context problem

> IDWMClassLoader extends WebappClassLoader. 

> I have been reading to docs to try and figure out how to get both the 
> normal webapp base directories and the outside the base directories to be
found.

I suspect you could do away with your IDWMClassLoader and simply use the
VirtualWebappLoader that's packaged with Tomcat.

http://tomcat.apache.org/tomcat-7.0-doc/config/loader.html#VirtualWebappLoad
er_Implementation

 - Chuck


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


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



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



RE: context problem

2013-07-24 Thread Edward W. Rouse
Thanks for the response, let’s work backwards.

3 – yes

2 – looked at and not applicable in this case

1 – The custom classLoader is set fine and it works, except it doesn’t
loader the classes from the webapp base dir, only the outside base dir.

 

Also, if I leave out the custom classLoader by removing the contect.xml
file, the webapp works fine but doesn’t have access to the external optional
files. The whole point of the custom classLoader is to get the optional
external files in addition to the standard base files; and it used to work
for tomcat 5.5 and doesn’t for 7.0 due to changes. I am trying to figure out
which changes are core to this issue and how to work around them.

 

Maybe I should have said that the old process that worked was set up to look
outside the webapp base for additional, optional files for additional,
optional functionality (packaged as exploded war files) and allow access to
those files, treating those files as having precedence over core files. This
was an extension model implemented by a developer who is no longer here and
it worked very well. Now I have to figure out how to get that same
functionality to work in tomcat 7; but so far have only been able to get one
or the other, not both together as an integrated whole.

 

From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Wednesday, July 24, 2013 1:02 PM
To: ero...@comsquared.com
Subject: RE: context problem

 

jars require permission to access and set the classLoader 
here is an example of tomcat-juli.jar which sets ContextClassLoader
1)$CATALINA_HOME/conf/catalina.policy 
 
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.lang.RuntimePermission "setContextClassLoader";

http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html

2)
 any JAR file that contains Servlet API classes will be explicitly ignored
by the classloader 
 
 
http://tomcat.apache.org/tomcat-7.0-doc/security-manager-howto.html
 

3)
can i assume the context.xml is in webapps/WebAppName/META-INF/context.xml ?

Martin Gainty 
__ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
Vertraulichkeitanmerkung/Note de déni et de confidentialité

 

Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése
nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi
alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen
megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet
tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.



 

> From: ero...@comsquared.com
> To: users@tomcat.apache.org
> Subject: context problem
> Date: Wed, 24 Jul 2013 12:21:42 -0400
> 
> I have a web app that worked in version 5.5, not working in version 7.0.
The
> Context.xml is:
> 
> 
> 
> 
> 
>  className="com.comsquared.idw.catalina.ext.IDWMFileDirContext" />
> 
>  loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader"/>
> 
>  type="javax.sql.DataSource"
factory="com.comsquared.idwm.DataSourceFactory"
> />
> 
> 
> 
> 
> 
> IDWMFileDirContext extend FileDirContext, IDWMClassLoader extends
> WebappClassLoader. When IDWMFileDirContext is called, it is called with
the
> default (no arg) constructor, which first calls super();, then imports the
> outside the webapp base jar files. That works fine. Then the
IDWMClassLoader
> is called, which uses the (ClassLoader parent) constructor and again,
calls
> super(parent). Parent is org.apache.catalina.loader.StandardClassLoader
and
> seems to be ok.
> 
> 
> 
> But the next step, loading the DataSource from the DataSourceFactory fails
> with a ClassNotFoundException. That class is in the webapps normal
> WEB-INF/classes directory.
> 
> 
> 
> I have been reading to docs to try and figure out how to get both the
normal
> webapp base directories and the outside the base directories to be found.
> The major difference is that the Loader in 5.5 looked like this:
> 
> 
> 
>  loaderClass="co

context problem

2013-07-24 Thread Edward W. Rouse
I have a web app that worked in version 5.5, not working in version 7.0. The
Context.xml is:

 



  

  

  



 

IDWMFileDirContext extend FileDirContext, IDWMClassLoader extends
WebappClassLoader. When IDWMFileDirContext is called, it is called with the
default (no arg) constructor, which first calls super();, then imports the
outside the webapp base jar files. That works fine. Then the IDWMClassLoader
is called, which uses the (ClassLoader parent) constructor and again, calls
super(parent). Parent is org.apache.catalina.loader.StandardClassLoader and
seems to be ok.

 

But the next step, loading the DataSource from the DataSourceFactory fails
with a ClassNotFoundException. That class is in the webapps normal
WEB-INF/classes directory.

 

I have been reading to docs to try and figure out how to get both the normal
webapp base directories and the outside the base directories to be found.
The major difference is that the Loader in 5.5 looked like this:

 



 

And useSystemClassLoaderAsParent isn't recognized and delegate has no
effect.

 

Any hints as to where to look would be a big help.



Re: Local VisualVM connection to Tomcat

2013-07-22 Thread Howard W. Smith, Jr.
On Mon, Jul 22, 2013 at 3:10 PM, honyk  wrote:

> On 2013-06-28 Christopher Schultz wrote:
> > On 6/27/13 5:17 PM, honyk wrote:
> > > I realized that my tomcat runs as a service but I am logged as an
> > > user and in this case the tomcat is not visible to me. I'll test it
> > > differently tomorrow.
> >
> > Try running VisualVM as an administrator.
>
> I've found the problem, but I have no remedy for it yet.
> https://java.net/projects/visualvm/lists/users/archive/2013-07/message/2
>
> Briefly, the service uses the TMP environment variable as it is specified
> for the given user, but when that user is logged remotely, the suffix
> \ is added at the end of this path so these both do not
> match and VisualVM doesn't detect my tomcat/JVM as expected.
>
>
I know Chris bashed me for this earlier (on this list), politely, and/or
recommended or said something about not to login via administrator into my
Windows Server 2008 R2 web app server running TomEE (tomcat7), but...

in response to this thread, I login to my Windows SErver 2008 R2 web app
server, always, as administrator, and yes (confirmed as Chuck mentioned
earlier in this thread),

> The possibility of services interacting with the desktop disappeared some
time ago.

so, I just specify a JMX port in my java settings for my TomEE (tomcat7)
running as windows service, and specify the JMX port in Java Visual VM, and
voila, I think this is saved to Windows registry (or somewhere), and I
always see my TomEE (tomcat7) instance when I run Java Visual VM.

Of course, the JMX port is not opened on the firewall/router. i just login
remotely via remote desktop connection and do what I need to do (stop
tomcat7 service, update my app in tomee/webapps, and start tomcat7 service).

Others may disagree, but i have found this to be quite secure and as it was
said earlier in this thread... a piece of cake. :)


WebappClassLoader javadoc curiosity

2013-07-18 Thread Edward W. Rouse
Looking at http://tomcat.apache.org/tomcat-7.0-doc/api/index.html for more
info about org.apache.catalina.loader.WebappClassLoader and I ran up against
a bit of missing information.

 

 

The 4th implementation note mentions addJar(), which is what I wanted a bit
more info on, but addJar() is not listed as a method for this class or any
of its super classes. Any idea why this is omitted? I can select it in
eclipse with no problem.

 

Thanks, Ed.



Re: Moving Tomcat to work externally.

2013-07-12 Thread Howard W. Smith, Jr.
On Fri, Jul 12, 2013 at 11:52 AM, Terence M. Bandoian wrote:

> Really generous responses.


That's very normal on this list. I have found Apache user lists to be very
(user) friendly. :)


Re: How to handle "CONNECT ... HTTP 1.1" 400 in localhost_access_log

2013-07-09 Thread Howard W. Smith, Jr.
On Tue, Jul 9, 2013 at 8:16 AM, Mark Thomas  wrote:

> On 09/07/2013 12:54, Howard W. Smith, Jr. wrote:
> > On Tue, Jul 9, 2013 at 2:18 AM, Caldarale, Charles R <
> > chuck.caldar...@unisys.com> wrote:
> >
> >>> From: Howard W. Smith, Jr. [mailto:smithh032...@gmail.com]
> >>> Subject: Re: How to handle "CONNECT ... HTTP 1.1" 400 in
> >> localhost_access_log
> >>
> >>> why would the same IP address be hitting my server when 400 is the
> >>> response?
> >>
> >>> and they will continue attempting these "CONNECT..." requests until
> >>> they get a 404 or what?
> >>
> >> Because they're trying to break in.  Any response indicates there's
> >> something to poke around in.
> >>
> >>> The 'HTTP "Forbidden" error' returned by RemoteAddrValve would seem to
> >> fuel
> >>> future/continual attempts as well as error 400. right?
> >>
> >> True, which is why it's best just to have a firewall or the TCP/IP stack
> >> completely ignore the traffic, and not send anything back.  By the time
> the
> >> request gets to Tomcat, the TCP connection is established, so the
> >> antagonist knows there's something there.
> >>
> >
> > Done. Thanks. Will continue to monitor logs, occasionally, to see if my
> > changes, made at the firewall level, blocks the IP addresses that are
> > repeat offenders. :)
>
> fail2ban is your friend
>
> The ASF uses it pretty much everywhere.
>
> Mark
>

thanks Mark. researching that nowfor Windows Server 2008. :)


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


  1   2   3   4   >