Re: ubuntu 9.10 tomcat6 security manager blocks access to system.properties

2009-12-22 Thread Konstantin Kolinko
2009/12/23 Mike Power :
> This is not useful information I have read this.
>
> It does not  answer my specific question.
> Is it or is it no wrong for a read request via
> java.lang.System.getProperties to trigger an access request for both read
> and write permissions?
>
>
> Konstantin Kolinko wrote:
>>
>> 2009/12/23 Mike Power :
>>
>>>
>>> I am not sure if I am reading the stack trace right.  I have a war that
>>> is trying to read its configuration from the system.properties.
>>>
>>> It seems that tomcat6 is apply read write checks on calls to
>>> java.lang.System.getProperties.  Am I observing the details correctly?
>>> That seems to be the wrong permission check to make as a result the
>>> application can not initialized.
>>>
>>> Caused by: java.security.AccessControlException: access denied
>>> (java.util.PropertyPermission * read,write)
>>>      at
>>>
>>> java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
>>>      at
>>> java.security.AccessController.checkPermission(AccessController.java:553)
>>>      at
>>> java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>>>      at
>>>
>>> java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
>>>      at java.lang.System.getProperties(System.java:599)
>>>      at
>>>
>>> org.sonatype.nexus.web.PlexusContainerConfigurationUtils.buildContext(PlexusContainerConfigurationUtils.java:93)
>>>
>>>
>>
>> Start reading here:
>> http://tomcat.apache.org/tomcat-6.0-doc/security-manager-howto.html
>>
>> Also
>> http://java.sun.com/javase/technologies/security/index.jsp
>>
>> http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html
>>
>> Best regards,
>> Konstantin Kolinko
>>

1. Do not top-post
2. You are asking whether "java.lang.System.getProperties" should
check for write + read ?  That is not our code, so this it is
off-topic here.
3. My personal opinion, though, is that code that is supposed to run
under SecurityManager, should use System.getProperty(), not
System.getProperties(). Asking for read access to all properties is
certainly too much for common usage.   Also I suppose that the map
returned by getProperties() allows both reading and writing, though I
never tried the latter.

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



Re: Http session lost b/w struts actions on Linux but not in Win

2009-12-22 Thread Ron McNulty

Hi Johan

Two JSESSIONID values does look odd. I've seen problems like this when 
another server running a Java J2EE servlet container incorrectly had its 
JSESSIONID cookie scope set to the whole domain, rather than scoped to the 
server and application. In my case it was a SAP web server, and the session 
ID value was readily recognisable, and quite different to Tomcat values.


That may also explain the Linux/Windows difference if your development boxes 
are on Windows and the production/test boxes are on Linux.


Regards

Ron

- Original Message - 
From: "Johan Thorselius" 

To: "Tomcat Users List" 
Sent: Tuesday, December 22, 2009 11:38 PM
Subject: Re: Http session lost b/w struts actions on Linux but not in Win



I here add some info from Firebug which may be significant.

'GET localhost:8080/wap-app/start.action':

CookieJSESSIONID=9726CDF4A527E3D98451140AB69EFA2C;
JSESSIONID=BEED739340DDD4370C85A9D12917692A

'GET localhost:8080/webdav/images/.../1px.gif':

CookieJSESSIONID=BEED739340DDD4370C85A9D12917692A

Johan



2009/12/22 Johan Thorselius 

The issue now boils down to the following a bit strange thing. Any idea 
why

this happens ?


- request.getSession() returns an incorrect null on Linux, but on Windows
it's OK - under the following circumstances:

When using Firebug on Firefox I noted that a corporate common .css
references a 1-pixel gif which is not present and visible, hence there is 
a

'404 Not found' error for the 'GET
localhost:8080/webdav/images/.../1px.gif'. But the preceding 'GET
localhost:8080/wap-app/start.action' is fine.

In my myValve-class on Linux:

'GET localhost:8080/wap-app/start.action' => myValve.invoke() ...
request.getSession() returns a correct session object

'GET localhost:8080/webdav/images/.../1px.gif' => myValve.invoke() ...
request.getSession() and request.getSession(true) both returns null

Same code and same build, in my myValve-class on Windows:

Both GET => myValve.invoke() ... request.getSession() returns a correct
session object


The webapp is built with Struts2/Spring.

Both Linux and Windows uses Tomcat 6.0.20.


On Windows Java version 1.6.0_16 is used

On RedHat Linux Java version 1.6.0_13 is used

and..


>> In the "log incorrect event" code, do you return
>> from the valve, or do you continue processing?

The execution continues down to the bottom with
'getNext().invoke(req,resp)'

Johan


2009/12/17 Christopher Schultz 

-BEGIN PGP SIGNED MESSAGE-

Hash: SHA1

Johan,

On 12/17/2009 7:52 AM, Johan Thorselius wrote:
> request.getSession() returns an incorrect null on Linux, but on 
> Windows

it's
> OK.

That's odd... request.getSession() should never return null. This 
method:


"
Returns the current session associated with this request, or if the
request does not have a session, creates one.
"

> I have an ordinary Struts2 web app deployed on Tomcat 6.0.20, together
with
> a JAAS-solution where I have my own Valve class.
>
> The Valve repeatedly executes invoke() with the following code-snippet
(here
> very much simplified):
>   .
>   .
>   .
>   if (LOGGER.isDebugEnabled()) {
> if (request.getSession() == null) {
>   // Log incorrect event (1)
> } else {
>   // Log OK (2)
> }
> if (request.getSession(true) == null) {
>   // Log incorrect event (3)
> } else {
>   // Log OK (4)
> }
>   }
>
>   /*
>* Here a NullPointerException occurs
>*/
>   request.getSession().setAttribute("...",...);

In the "log incorrect event" code, do you return from the valve, or do
you continue processing?

> In the first request the session is not lost, everything is fine with
(2)
> and (4). In the following requests getSession() returns null (1) and
(3).

Are you storing the request object anywhere and perhaps using it after
it's been recycled?

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

iEYEARECAAYFAksqoSoACgkQ9CaO5/Lv0PDZ7QCfXwdUPAoU9EPxlEC64f11rlAa
+0oAoJG3hjVFYbeCvkrXQ14bkvlq9bJZ
=lF2t
-END PGP SIGNATURE-

-
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: ubuntu 9.10 tomcat6 security manager blocks access to system.properties

2009-12-22 Thread Mike Power

This is not useful information I have read this.

It does not  answer my specific question. 

Is it or is it no wrong for a read request via 
java.lang.System.getProperties to trigger an access request for both 
read and write permissions?



Konstantin Kolinko wrote:

2009/12/23 Mike Power :
  

I am not sure if I am reading the stack trace right.  I have a war that
is trying to read its configuration from the system.properties.

It seems that tomcat6 is apply read write checks on calls to
java.lang.System.getProperties.  Am I observing the details correctly?
That seems to be the wrong permission check to make as a result the
application can not initialized.

Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission * read,write)
  at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
  at
java.security.AccessController.checkPermission(AccessController.java:553)
  at
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
  at
java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
  at java.lang.System.getProperties(System.java:599)
  at
org.sonatype.nexus.web.PlexusContainerConfigurationUtils.buildContext(PlexusContainerConfigurationUtils.java:93)




Start reading here:
http://tomcat.apache.org/tomcat-6.0-doc/security-manager-howto.html

Also
http://java.sun.com/javase/technologies/security/index.jsp
http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.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: ubuntu 9.10 tomcat6 security manager blocks access to system.properties

2009-12-22 Thread Konstantin Kolinko
2009/12/23 Mike Power :
> I am not sure if I am reading the stack trace right.  I have a war that
> is trying to read its configuration from the system.properties.
>
> It seems that tomcat6 is apply read write checks on calls to
> java.lang.System.getProperties.  Am I observing the details correctly?
> That seems to be the wrong permission check to make as a result the
> application can not initialized.
>
> Caused by: java.security.AccessControlException: access denied
> (java.util.PropertyPermission * read,write)
>       at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
>       at
> java.security.AccessController.checkPermission(AccessController.java:553)
>       at
> java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>       at
> java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
>       at java.lang.System.getProperties(System.java:599)
>       at
> org.sonatype.nexus.web.PlexusContainerConfigurationUtils.buildContext(PlexusContainerConfigurationUtils.java:93)
>

Start reading here:
http://tomcat.apache.org/tomcat-6.0-doc/security-manager-howto.html

Also
http://java.sun.com/javase/technologies/security/index.jsp
http://java.sun.com/javase/6/docs/technotes/guides/security/PolicyFiles.html

Best regards,
Konstantin Kolinko

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



ubuntu 9.10 tomcat6 security manager blocks access to system.properties

2009-12-22 Thread Mike Power

I am not sure if I am reading the stack trace right.  I have a war that
is trying to read its configuration from the system.properties.

It seems that tomcat6 is apply read write checks on calls to
java.lang.System.getProperties.  Am I observing the details correctly?
That seems to be the wrong permission check to make as a result the
application can not initialized.

Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission * read,write)
   at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:342)
   at
java.security.AccessController.checkPermission(AccessController.java:553)
   at
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
   at
java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
   at java.lang.System.getProperties(System.java:599)
   at
org.sonatype.nexus.web.PlexusContainerConfigurationUtils.buildContext(PlexusContainerConfigurationUtils.java:93)

Mike Power


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



[SpotVogue.com]Nice Wedding Dresses On sale, Stunning Selection Of Styles

2009-12-22 Thread blackcookie001

[SpotVogue.com]Nice Wedding Dresses On sale, Stunning Selection Of Styles 
SpotVogue.com provides the best [url=http://www.spotvogue.com]china
products[/url] online and [url=http://www.spotvogue.com]china
wholesale[/url] service. Now  the [url=http://www.spotvogue.com]china
products[/url] offered
include:[url=http://www.spotvogue.com/wedding-apparel-c-230501.html]wedding
apparel[/url],
[url=http://www.spotvogue.com/wedding-apparel-wedding-dresses-c-230501_230503.html]wedding
dresses[/url],
[url=http://www.spotvogue.com/wedding-apparel-wedding-party-dresses-c-230501_230504.html]Wedding
Party Dresses [/url],
[url=http://www.spotvogue.com/wedding-apparel-bridesmaid-dresses-c-230501_230505.html]Bridesmaid
Dresses [/url],
[url=http://www.spotvogue.com/wedding-apparel-flower-girl-dresses-c-230501_230507.html]Flower
Girl Dresses[/url],
[url=http://www.spotvogue.com/wedding-apparel-mother-of-bride-dresses-c-230501_230508.html]Mother
of Bride Dresses [/url],
[url=http://www.spotvogue.com/wedding-apparel-plus-size-wedding-dresses-c-230501_230509.html]Plus
Size Wedding Dresses
[/url],[url=http://www.spotvogue.com/special-occasion-dresses-c-230502.html]Special
Occasion Dresses[/url],
[url=http://www.spotvogue.com/wedding-apparel-wedding-shoes-c-230501_230511.html]Wedding
Shoes [/url], [url=http://www.spotvogue.com/ski-suits-c-240549.html]ski
suits[/url],
[url=http://www.spotvogue.com/sleepwears-c-200481.html]sleepwears[/url],
[url=http://www.spotvogue.com/sleepwears-womens-sleepwears-c-200481_200485.html]womens
sleepwears [/url],
[url=http://www.spotvogue.com/womens-sleepwears-womens-pajamas-c-200481_200485_200489.html]womens
pajamas[/url],
[url=http://www.spotvogue.com/womens-sleepwears-womens-nightgowns-c-200481_200485_200488.html]womens
nightgowns[/url],
[url=http://www.spotvogue.com/womens-sleepwears-womens-robes-c-200481_200485_200490.html]womens
robes[/url],
[url=http://www.spotvogue.com/sleepwears-mens-sleepwears-c-200481_200484.html]mens
sleepwears[/url],
[url=http://www.spotvogue.com/bedding-duvet-covers-c-220495_220496.html]duvet
covers[/url],
[url=http://www.spotvogue.com/household-appliances-foot-bath-c-80348_80349.html]foot
bath basin[/url], and
[url=http://www.spotvogue.com/household-appliances-portable-dvd-player-c-80348_230500.html]portable
dvd player[/url]. Here you can enjoy the most secure shopping, best quality
and the most considerate shopping service!
With the upcoming new years shopping season,
[url=http://www.spotvogue.com/wedding-apparel-wedding-dresses-c-230501_230503.html]wedding
dresses[/url] at SpotVogue.com are on sale. If you are trying to put
together a wedding or if you are a seller of
[url=http://www.spotvogue.com/wedding-apparel-wedding-dresses-c-230501_230503.html]wedding
dresses[/url], here comes the chance for you to save more! With only $69
now, you will get a fabulous
[url=http://www.spotvogue.com/wedding-apparel-wedding-dresses-c-230501_230503.html]wedding
dress[/url].
SpotVogue.com can save you from the bank-breaking shopping risk. Shop now
you can enjoy 5% off on your first order! 
Website: http://www.spotvogue.com
http://old.nabble.com/file/p26897608/spotvogue01.jpg 
-- 
View this message in context: 
http://old.nabble.com/-SpotVogue.com-Nice-Wedding-Dresses-On-sale%2C-Stunning-Selection-Of-Styles-tp26897608p26897608.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Error running two tomcats in same cluster on same Windows box

2009-12-22 Thread John Tangney

We run two tomcats on the same Windows Server 2008 box. They have their
server.xml tweaked so that they use unique ports. Here's a diff:

$ diff server.xml /cygdrive/c/Program\ Files/Apache\ Software\
Foundation/Tomcat\ 6.0/conf/server.xml 
22c22
< 
---
> 
67c67
<  
---
>redirectPort="8443" />
88c88
< 
---
> 
100c100
< 
---
> 

If we have one of the tomcats broadcast its multicast packets on 228.0.0.0
while the second broadcasts on 224.0.0.0, everything works fine and they
each cluster with other nodes that use those multicast addresses. (Think
"staging" and "prod" clusters)

But when we want two tomcats on the same machine to join the _same_ cluster
(224.0.0.0), we get this in the log file:

SEVERE: Unable to start cluster.
org.apache.catalina.tribes.ChannelException: java.net.SocketException: An
operation was attempted on something that is not a socket; No faulty
 members identified.
at
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:169)
at
org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:97)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:147)
   
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:149)
at
org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:407)
at
org.apache.catalina.ha.tcp.SimpleTcpCluster.start(SimpleTcpCluster.java:669)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1035)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)   
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)   

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)  
 
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.SocketException: An operation was attempted on something
that is not a socket
at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)
at
java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299)
at java.net.MulticastSocket.setInterface(MulticastSocket.java:420)
at
org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket(McastServiceImpl.java:206)
at
org.apache.catalina.tribes.membership.McastServiceImpl.init(McastServiceImpl.java:173)
at
org.apache.catalina.tribes.membership.McastServiceImpl.(McastServiceImpl.java:169)
at
org.apache.catalina.tribes.membership.McastService.start(McastService.java:356) 
  
at
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:154)
   
... 18 more

Here's the juicy part of server.xml:
   

Naturally, I have googled the exception, but the only hits I have found go
on about corrupted winsock registry entries, which seems irrelevant since
everything works when the two tomcats use separate multicast addresses.

Note that 10.5.1.102 is a statically-assigned IP on this box's second NIC. 

So...
a) Is it possible to run two tomcat nodes in the same cluster on the same
windows box?
b) If so, what's the magic to keep windows happy? It _appears_ that windows
won't let the two tomcats bind to the same multicast address/port. (Same
config works fine on Linux.)

Thanks!
--johnt
-- 
View this message in context: 
http://old.nabble.com/Error-running-two-tomcats-in-same-cluster-on-same-Windows-box-tp26896489p26896489.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Every couple hours, Tomcat stops - FIXED

2009-12-22 Thread André Warnier

Bruce wrote:

Juha,

The problem is fixed. My customer's site has been up for 24 hours with 
no problems.


The problem became apparent when I went to the JVM line in 
localhost:8080/manager/status. That was showing .5 MB free memory.


I went to the configure Tomcat. I clicked on the Java tab. Set the 
"Initial memory pool" at 512. Set the maximum memory pool to 1024.


For better performance, you shoud set both to the same value (1024).
That will avoid the work for the JVM to resize it continuously.

It's the same for the virtual memory of Windows.  Set it fixed (minimum 
= maximum).


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



Re: j_security_check not working with flash

2009-12-22 Thread vpapado

Hello,

Indeed that was it!
I moved the flash into another folder that is not protected, and now it
works.

Thanks you!
Bye



vpapado wrote:
> 
> Hello,
> 
> I have a problem authenticating my users with j_security_check
> interworking with a flash on my login.jsp page.
> 
> Here is how things go:
> 
> I use j_security_check method to authenticate my users.
> As a result, I have assigned a login.jsp page where I have a login form
> and at the top of the page a menu developed with flash:
> 
> ..::1 - Login Form::..
> 
> Username:
> Password:
> 
> 
> 
> ..::2 - Menu Flash::..
> 
> 
> 
> When the user is prompt to login, then inserts the correct username -
> password.
> But after submit, the authentication method fails and the error page
> appears from Tomcat:
> 
> HTTP Status 404 - /./j_security_check
> type Status report
> message /./j_security_check
> description The requested resource (/./j_security_check) is not
> available.
> 
> 
> Then I simply remove my flash menu and the whole login procedure of the
> user is performed correctly!!
> This means that flash caused the error in this page!!
> 
> Is there a way I can have in my login.jsp page my flash menu and perform
> the login successfully?
> 
> Thanks in Advance for the answer,
> papado.
> 

-- 
View this message in context: 
http://old.nabble.com/j_security_check-not-working-with-flash-tp26880231p26891867.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Every couple hours, Tomcat stops - FIXED

2009-12-22 Thread Bruce

Juha,

The problem is fixed. My customer's site has been up for 24 hours with 
no problems.


The problem became apparent when I went to the JVM line in 
localhost:8080/manager/status. That was showing .5 MB free memory.


I went to the configure Tomcat. I clicked on the Java tab. Set the 
"Initial memory pool" at 512. Set the maximum memory pool to 1024.


The program runs fine now.

Thank you for your help and suggestions.

Bruce




Juha Laiho wrote:

Bruce wrote:

I have an installation where Tomcat stops every couple hours.

   * Tomcat 6.0.18
   * Windows XP pro 2.3GHz, 2G memory
   * The application is in a .war file.
   * This app reads and writes to a MySQL database on the same machine.

What happens is that the application will run for about 3 hours or 
so. Suddenly, it stops responding.


A thread dump of the hung Tomcat might well bring more light
to the situation. To me at least this sounds like a thread starvation
issue (for some reason, the request processing threads are not
recycled to serve future requests). The thread dump might well bring
insight as to what the reason might be.

One reason for the starvation might be some deadlock situation across
separate threads accessing the database.

Other things to check are the memory and CPU usage of the hung
Tomcat process - they might also provide some more clues.




Re: TomCat 6 performance issues

2009-12-22 Thread anthonyvierra
Is there any other hardware/software between tomcat and the checking
box? Load balancer, app firewall ?

On 12/22/09, DOrlov  wrote:
>
>
>
> anthonyvierra wrote:
>>
>> Has the issue come from a single server? Or do you have a second
>> machine producing the same result?
>>
>>
>
> I have another production box with different code, but same TomCat
> configuration. And time to time I have the same issues.
>
> TomCat server side code on another box works fast enough (<5 ms per request)
>
> --
> View this message in context:
> http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26888782.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Sent from my mobile device

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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



anthonyvierra wrote:
> 
> Has the issue come from a single server? Or do you have a second
> machine producing the same result?
> 
> 

I have another production box with different code, but same TomCat
configuration. And time to time I have the same issues.

TomCat server side code on another box works fast enough (<5 ms per request)

-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26888782.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread anthonyvierra
Has the issue come from a single server? Or do you have a second
machine producing the same result?

On 12/21/09, DOrlov  wrote:
>
> Hello.
> I have TomCat server on production and have from 80 up to 400 requests per
> second.
>
> In server.xml I have next connector description:
>
>  maxThreads="200"
>acceptCount="100"
>minSpareThreads="5"
>maxSpareThreads="75"
>enableLookups="false"
>disableUploadTimeout="true"
>connectionTimeout="1500"
>keepAliveTimeout="0"
>maxKeepAliveRequests="1"
>/>
>
> For application spesific we don't need to support keep alive and don't need
> to wait for huge requests.
> Main task is to serve responses as fast as we can.
>
> ~Time for request processing on server (I use tomcat log figures and own
> time counters for checking) is 1 ms.
>
> PROBLEM now:
> Most part of time server works fine and ~ time for request/response 300 ms
> (for external users via browser)
>
> BUT time to time request/response time is upto 5 seconds for the same users.
> How I could figure out a problem? How could I check if it is Tomcat server
> problem or not?
>
> You are very welcome with comments.
>
> Thanks,
> Denis.
>
>
>
> --
> View this message in context:
> http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26884227.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Sent from my mobile device

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



Re: TomCat 6 performance issues

2009-12-22 Thread Pid

On 22/12/2009 12:55, Rainer Jung wrote:

On 22.12.2009 13:26, DOrlov wrote:




Rainer Jung-3 wrote:




You can add "%D" to the pattern for the omcat access log, which will
output the response time in milliseconds how Tomcat determined it.

Already done for most cases values are 0,1,2 ms
Max value which I ever find in the log ~ 20 ms


So then GC, locking and similar stuff is very unlikely, because by far
most of the code executed for rquest handling is included in this time
measurement. Sounds like either your java probing app has an issue, or
the network infrastucture?

Maybe you can sniff the network traffic on the probing client, wait
until it happens and look at the data stream for this point in time.
Data trafic between service and probing server should not be that high.


It may just be a temporarily slow route to the client. [shrug]


p



Regards,

Rainer

-
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: TomCat 6 performance issues

2009-12-22 Thread Rainer Jung

On 22.12.2009 13:26, DOrlov wrote:




Rainer Jung-3 wrote:




You can add "%D" to the pattern for the omcat access log, which will
output the response time in milliseconds how Tomcat determined it.

Already done for most cases values are 0,1,2 ms
Max value which I ever find in the log ~ 20 ms


So then GC, locking and similar stuff is very unlikely, because by far 
most of the code executed for rquest handling is included in this time 
measurement. Sounds like either your java probing app has an issue, or 
the network infrastucture?


Maybe you can sniff the network traffic on the probing client, wait 
until it happens and look at the data stream for this point in time. 
Data trafic between service and probing server should not be that high.


Regards,

Rainer

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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Rainer Jung-3 wrote:
> 
> 
> 
> You can add "%D" to the pattern for the omcat access log, which will 
> output the response time in milliseconds how Tomcat determined it. 
> 
> Already done for most cases values are 0,1,2 ms
> Max value which I ever find in the log ~ 20 ms
> 
> 

-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26887542.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread Rainer Jung

On 22.12.2009 13:13, DOrlov wrote:




Pid Ster wrote:



Looks OK.

When you say the response takes 5s, how are you measuring this?

Is it sustained, or is it occasional?

Is the server heavily loaded at the time - and again how are you
measuring that?

What else could be happening?  E.g. sending mail from app.



For time measuring we have external java tool which generates http get
requests time to time.
Also I use fire bug and htt watch tools for browser testing (When I look
response/request through browser I don't see 5 sec. but time to time requsts

1 sec per request, but avarage time is 300-500 ms).


It is our main problem the issue is 'occasional' and happaned 3-4 times per
day (not enough, but I would like to fix it).

For server load level detecting I'm using tomcat access log and calculate
number of requests per second.


You can add "%D" to the pattern for the omcat access log, which will 
output the response time in milliseconds how Tomcat determined it. So 
you get a better feeling for how often it happens and with which reponse 
time distribution.


Caution: the default pattern is "common", which is just a synonym for %h 
%l %u %t "%r" %s %b. Since you can't use '"' inside an xml attribute, 
you need to use a construct like


%h %l %u %t "%r" %s %b %D

when you switch to a custom pattern. There are more interesting format 
characters, look at


http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html

Regards,

Rainer


During server work we have meta data reloading time frames ~20 sec per hour


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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Pid Ster wrote:
> 
> 
> Looks OK.
> 
> When you say the response takes 5s, how are you measuring this?
> 
> Is it sustained, or is it occasional?
> 
> Is the server heavily loaded at the time - and again how are you 
> measuring that?
> 
> What else could be happening?  E.g. sending mail from app.
> 

For time measuring we have external java tool which generates http get
requests time to time.
Also I use fire bug and htt watch tools for browser testing (When I look
response/request through browser I don't see 5 sec. but time to time requsts
> 1 sec per request, but avarage time is 300-500 ms).

It is our main problem the issue is 'occasional' and happaned 3-4 times per
day (not enough, but I would like to fix it).

For server load level detecting I'm using tomcat access log and calculate
number of requests per second.

During server work we have meta data reloading time frames ~20 sec per hour

-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26887423.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread Rainer Jung

On 22.12.2009 12:58, Pid wrote:

On 22/12/2009 11:34, DOrlov wrote:




Pid Ster wrote:


Any chance you can upgrade to the most recent Tomcat?

How much total physical RAM do you have?

Examine the heap "jmap -heap", and post the results.





I have 8Gb RAM on the machine.



PS Old Generation
47.376815763383185% used
PS Perm Generation
60.829337266299945% used


Looks OK.


To make sure the OP doesn't get confused: it looks OK at the moment the 
data was collected. It could still well be, that during the time the 
performance problem occurs, it is GC related. So proceed with activating 
the GC log, because it is the best way to analyze what happened with GC 
after something unexpected occured.


All other questions of PID are of course also valid.

Another thing you can do: if the problem lasts long enough and you have 
a chance to catch such long running requests in flight, take thread 
dumps, e.g.


kill -QUIT pid

where pid is the process id of your Tomcat Java process. Take two or 
three of them. The results will go to catalina.out.


If something in your code is waiting, you will find that in the dump. 
Those thread dumps are very different from heap dumps. Thrad dumps are 
quick, produce text output and do not disturb the application 
noticeably. Heap dumps are something much heavier which stop the 
application for quite some time.


So if you want to get acquainted with thread dumps, you can do them even 
before the problem, look at them and learn what they contain.


Regards,

Rainer

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



Re: TomCat 6 performance issues

2009-12-22 Thread Pid

On 22/12/2009 11:34, DOrlov wrote:




Pid Ster wrote:


Any chance you can upgrade to the most recent Tomcat?

How much total physical RAM do you have?

Examine the heap "jmap -heap", and post the results.





I have 8Gb RAM on the machine.



PS Old Generation
47.376815763383185% used
PS Perm Generation
60.829337266299945% used


Looks OK.

When you say the response takes 5s, how are you measuring this?

Is it sustained, or is it occasional?

Is the server heavily loaded at the time - and again how are you 
measuring that?


What else could be happening?  E.g. sending mail from app.


p

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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Pid Ster wrote:
> 
> Any chance you can upgrade to the most recent Tomcat?
> 
> How much total physical RAM do you have?
> 
> Examine the heap "jmap -heap ", and post the results.
> 
> 
> 

I have 8Gb RAM on the machine.

Jmap heap:
JVM version is 14.3-b01

using thread-local object allocation.
Parallel GC with 2 thread(s)

Heap Configuration:
   MinHeapFreeRatio = 40
   MaxHeapFreeRatio = 70
   MaxHeapSize  = 6442450944 (6144.0MB)
   NewSize  = 2686976 (2.5625MB)
   MaxNewSize   = 17592186044415 MB
   OldSize  = 5439488 (5.1875MB)
   NewRatio = 2
   SurvivorRatio= 8
   PermSize = 21757952 (20.75MB)
   MaxPermSize  = 536870912 (512.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 572194816 (545.6875MB)
   used = 433650792 (413.5616226196289MB)
   free = 138544024 (132.1258773803711MB)
   75.78726333654865% used
>From Space:
   capacity = 143327232 (136.6875MB)
   used = 109273432 (104.21126556396484MB)
   free = 34053800 (32.476234436035156MB)
   76.24052350358653% used
To Space:
   capacity = 150798336 (143.8125MB)
   used = 0 (0.0MB)
   free = 150798336 (143.8125MB)
   0.0% used
PS Old Generation
   capacity = 3721330688 (3548.9375MB)
   used = 1763047984 (1681.3735809326172MB)
   free = 1958282704 (1867.5639190673828MB)
   47.376815763383185% used
PS Perm Generation
   capacity = 121372672 (115.75MB)
   used = 73830192 (70.40995788574219MB)
   free = 47542480 (45.34004211425781MB)
   60.829337266299945% used


-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26886984.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread Pid

On 22/12/2009 10:18, DOrlov wrote:




Pid Ster wrote:


What about the exact versions of your OS, JVM and Tomcat?
Is your OS a 64bit one?



Correct, I use 64bit machine.

JVM:
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

OS:
[root@ ~]# uname -mrsn
Linux 2.6.21.7-2.fc8xen x86_64

TomCat:
apache-tomcat-6.0.14


Any chance you can upgrade to the most recent Tomcat?

How much total physical RAM do you have?

Examine the heap "jmap -heap ", and post the results.


p

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



Re: Http session lost b/w struts actions on Linux but not in Win

2009-12-22 Thread Johan Thorselius
I here add some info from Firebug which may be significant.

'GET localhost:8080/wap-app/start.action':

CookieJSESSIONID=9726CDF4A527E3D98451140AB69EFA2C;
JSESSIONID=BEED739340DDD4370C85A9D12917692A

'GET localhost:8080/webdav/images/.../1px.gif':

CookieJSESSIONID=BEED739340DDD4370C85A9D12917692A

Johan



2009/12/22 Johan Thorselius 

> The issue now boils down to the following a bit strange thing. Any idea why
> this happens ?
>
>
> - request.getSession() returns an incorrect null on Linux, but on Windows
> it's OK - under the following circumstances:
>
> When using Firebug on Firefox I noted that a corporate common .css
> references a 1-pixel gif which is not present and visible, hence there is a
> '404 Not found' error for the 'GET
> localhost:8080/webdav/images/.../1px.gif'. But the preceding 'GET
> localhost:8080/wap-app/start.action' is fine.
>
> In my myValve-class on Linux:
>
> 'GET localhost:8080/wap-app/start.action' => myValve.invoke() ...
> request.getSession() returns a correct session object
>
> 'GET localhost:8080/webdav/images/.../1px.gif' => myValve.invoke() ...
> request.getSession() and request.getSession(true) both returns null
>
> Same code and same build, in my myValve-class on Windows:
>
> Both GET => myValve.invoke() ... request.getSession() returns a correct
> session object
>
>
> The webapp is built with Struts2/Spring.
>
> Both Linux and Windows uses Tomcat 6.0.20.
>
>
> On Windows Java version 1.6.0_16 is used
>
> On RedHat Linux Java version 1.6.0_13 is used
>
> and..
>
>
> >> In the "log incorrect event" code, do you return
> >> from the valve, or do you continue processing?
>
> The execution continues down to the bottom with
> 'getNext().invoke(req,resp)'
>
> Johan
>
>
> 2009/12/17 Christopher Schultz 
>
> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Johan,
>>
>> On 12/17/2009 7:52 AM, Johan Thorselius wrote:
>> > request.getSession() returns an incorrect null on Linux, but on Windows
>> it's
>> > OK.
>>
>> That's odd... request.getSession() should never return null. This method:
>>
>> "
>> Returns the current session associated with this request, or if the
>> request does not have a session, creates one.
>> "
>>
>> > I have an ordinary Struts2 web app deployed on Tomcat 6.0.20, together
>> with
>> > a JAAS-solution where I have my own Valve class.
>> >
>> > The Valve repeatedly executes invoke() with the following code-snippet
>> (here
>> > very much simplified):
>> >   .
>> >   .
>> >   .
>> >   if (LOGGER.isDebugEnabled()) {
>> > if (request.getSession() == null) {
>> >   // Log incorrect event (1)
>> > } else {
>> >   // Log OK (2)
>> > }
>> > if (request.getSession(true) == null) {
>> >   // Log incorrect event (3)
>> > } else {
>> >   // Log OK (4)
>> > }
>> >   }
>> >
>> >   /*
>> >* Here a NullPointerException occurs
>> >*/
>> >   request.getSession().setAttribute("...",...);
>>
>> In the "log incorrect event" code, do you return from the valve, or do
>> you continue processing?
>>
>> > In the first request the session is not lost, everything is fine with
>> (2)
>> > and (4). In the following requests getSession() returns null (1) and
>> (3).
>>
>> Are you storing the request object anywhere and perhaps using it after
>> it's been recycled?
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAksqoSoACgkQ9CaO5/Lv0PDZ7QCfXwdUPAoU9EPxlEC64f11rlAa
>> +0oAoJG3hjVFYbeCvkrXQ14bkvlq9bJZ
>> =lF2t
>> -END PGP SIGNATURE-
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: Http session lost b/w struts actions on Linux but not in Win

2009-12-22 Thread Johan Thorselius
The issue now boils down to the following a bit strange thing. Any idea why
this happens ?


- request.getSession() returns an incorrect null on Linux, but on Windows
it's OK - under the following circumstances:

When using Firebug on Firefox I noted that a corporate common .css
references a 1-pixel gif which is not present and visible, hence there is a
'404 Not found' error for the 'GET
localhost:8080/webdav/images/.../1px.gif'. But the preceding 'GET
localhost:8080/wap-app/start.action' is fine.

In my myValve-class on Linux:

'GET localhost:8080/wap-app/start.action' => myValve.invoke() ...
request.getSession() returns a correct session object

'GET localhost:8080/webdav/images/.../1px.gif' => myValve.invoke() ...
request.getSession() and request.getSession(true) both returns null

Same code and same build, in my myValve-class on Windows:

Both GET => myValve.invoke() ... request.getSession() returns a correct
session object


The webapp is built with Struts2/Spring.

Both Linux and Windows uses Tomcat 6.0.20.

On Windows Java version 1.6.0_16 is used

On RedHat Linux Java version 1.6.0_13 is used

and..

>> In the "log incorrect event" code, do you return
>> from the valve, or do you continue processing?

The execution continues down to the bottom with 'getNext().invoke(req,resp)'

Johan


2009/12/17 Christopher Schultz 

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Johan,
>
> On 12/17/2009 7:52 AM, Johan Thorselius wrote:
> > request.getSession() returns an incorrect null on Linux, but on Windows
> it's
> > OK.
>
> That's odd... request.getSession() should never return null. This method:
>
> "
> Returns the current session associated with this request, or if the
> request does not have a session, creates one.
> "
>
> > I have an ordinary Struts2 web app deployed on Tomcat 6.0.20, together
> with
> > a JAAS-solution where I have my own Valve class.
> >
> > The Valve repeatedly executes invoke() with the following code-snippet
> (here
> > very much simplified):
> >   .
> >   .
> >   .
> >   if (LOGGER.isDebugEnabled()) {
> > if (request.getSession() == null) {
> >   // Log incorrect event (1)
> > } else {
> >   // Log OK (2)
> > }
> > if (request.getSession(true) == null) {
> >   // Log incorrect event (3)
> > } else {
> >   // Log OK (4)
> > }
> >   }
> >
> >   /*
> >* Here a NullPointerException occurs
> >*/
> >   request.getSession().setAttribute("...",...);
>
> In the "log incorrect event" code, do you return from the valve, or do
> you continue processing?
>
> > In the first request the session is not lost, everything is fine with (2)
> > and (4). In the following requests getSession() returns null (1) and (3).
>
> Are you storing the request object anywhere and perhaps using it after
> it's been recycled?
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAksqoSoACgkQ9CaO5/Lv0PDZ7QCfXwdUPAoU9EPxlEC64f11rlAa
> +0oAoJG3hjVFYbeCvkrXQ14bkvlq9bJZ
> =lF2t
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Pid Ster wrote:
> 
> What about the exact versions of your OS, JVM and Tomcat?
> Is your OS a 64bit one?
> 

Correct, I use 64bit machine.

JVM:
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

OS:
[root@ ~]# uname -mrsn
Linux 2.6.21.7-2.fc8xen x86_64

TomCat:
apache-tomcat-6.0.14


-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26886252.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Leon Rosenberg-3 wrote:
> 
> 
> Hello,
> 
> I have a lot of high performance sites (2000 requests per second and
> more) under my 'umbrella' but have never
> encountered any performance problems because of the gc logging (yet).
> 
> btw add
> -Xloggc: logfilename
> to move gc logs into separate file.
> 
> 

Thank you, in this case I'll re-configure server to support it

-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26886161.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: question about Tomcat5.5 getServletContext().getContext(String url);

2009-12-22 Thread Pid

On 22/12/2009 09:13, Peter Chen wrote:

Hi,

In a JSP file, there is a sentence like this:

ServletContext sc = this.getServletContext().getContext("/File");

if(sc == null){
   Logger.warn(msg,"Can't get the context of /File.");
   return;
}



What's the mean of this sentence?


Ask the author of the JSP.  Presumably they'd know what it was for.


p


Now, I run this application in Tomcat5.5, and find the log: Can't get
the context of /File.

How to solve this problem? Thanks.




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



Re: TomCat 6 performance issues

2009-12-22 Thread Leon Rosenberg
On Tue, Dec 22, 2009 at 9:10 AM, DOrlov  wrote:
>
>
>
> Leon Rosenberg-3 wrote:
>>
>> Hello,
>>
>> you should switch on GC logs and check whether the delays happen at
>> the Full GC Time.
>> You should also start with Xms = Xmx -> both 6144 (why exactly 6144? :-)
>> ).
>>
>> -verbose:gc
>> -XX:+PrintGCTimeStamps
>> -XX:+PrintGCDetails
>>
>
> Thank you for comment I will change Xmx, Xms (about 6144, it was set by our
> admin :)))
> About GC logging, I'm afraid that logging will reduce performance (I've
> written, that this is production server). Do you have any figures of
> performance lacks whith 'on' GC logging?

Hello,

I have a lot of high performance sites (2000 requests per second and
more) under my 'umbrella' but have never
encountered any performance problems because of the gc logging (yet).

btw add
-Xloggc: logfilename
to move gc logs into separate file.

regards
Leon


>
> We tried to reproduce issue by collecting production logs and reproducing
> them via tcpreplay to test server, but we weren't able to reproduce issue
> :((
>
> Thanks,
> Denis.
>
> --
> View this message in context: 
> http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26885080.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

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



Re: question about Tomcat5.5 getServletContext().getContext(String url);

2009-12-22 Thread André Warnier

Peter Chen wrote:

Hi,

In a JSP file, there is a sentence like this:

ServletContext sc = this.getServletContext().getContext("/File");

if(sc == null){

  Logger.warn(msg,"Can't get the context of /File.");

  return;

}

 


What's the mean of this sentence?

Now, I run this application in Tomcat5.5, and find the log: Can't get
the context of /File.

How to solve this problem? Thanks.



Have a look here (obtained via Google) :
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getContext%28java.lang.String%29

In other words, it is trying to get the context of a webapp which should 
be located at webapps/File.
If you do not have such a webapp, then that is the reason for the 
message above.
Why it is doing that however, and whether it is a problem, is something 
you will need to ask from the author of the application.




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



Re: Tomcat 5.5.17 - allowLinking property - symbolic links

2009-12-22 Thread Vishwa. K
Thanks Ingo, Chris,

Out of curiosity, I had tried the fake Application or fake docBases root 
approach mentioned by Ingo. It worked for me on Tomcat 5.5.17 and Windows XP.

My fakeApp.xml (context.xml) was : 



I copied this into the directory: 

TOMCAT_DIR/conf/Catalina/localhost

C:\\temp\\fakeApp is the directory containing the list of external PDF files 
that need to be served to the users. I had also created a WEB-INF directory 
with a web.xml file here.

My main web application had a page containing the href links to the external 
files that need to be downloaded to the user.

test.pdf

This approach seems to work. Upon undeployment of fakeApp using Tomcat Manager, 
only the fakeApp.xml was deleted from the TOMCAT_DIR/conf/Catalina/localhost 
directory. The directory and all the files under C:\\temp\\fakeApp remained 
intact. (unlike in the soft links approach!)

I did not bother testing on Unix, as I think it is quite likely to work on Unix 
also. The fake document base approach seems to be better than the soft links 
approach, (atleast it did not delete all the external files!) The disadvantage 
that I see is the loss of Security. Since it appears to be a seperate 
application, the security that is available in the original Application is not 
carried forward to the fake Application.
Anybody who knows the direct URL to the fake Application can download the 
external files.

In the end, we decided to write file-serving code ourselves in our servlet, in 
our original application. The directory containing the external PDF files, is 
located outside the $TOMCAT directory, is a configurable parameter to the web 
application. A few more lines of code...it doesn't look too bad! :)-




--- On Fri, 12/18/09, Ingo Gambin  wrote:

> From: Ingo Gambin 
> Subject: Re: Tomcat 5.5.17 - allowLinking property - symbolic links
> To: "Tomcat Users List" 
> Date: Friday, December 18, 2009, 10:10 AM
> Hehe,
> 
> this I learned only a few days ago. I hope you didn't loose
> valuable
> information. 
> 
> But yes, this is the expected behaviour. 
> 
> In order to solve the problem you just have to add 'fake'
> docBases ...
> see below in the answers I got from Chris.
> 
> Although i have to add, that adding the 
> directive to 
>    
> conf/Catalina/localhost/.xml
> did not work for me on Tomcat 5.5. 
> 
> Putting it into server.xml on the other hand worked
> perfectly.
> 
> Best regards,
> 
> Ingo
> 
> Am Freitag, den 18.12.2009, 02:01 -0800 schrieb Vishwa. K:
> > Tomcat 5.5.17
> > Solaris 5.10
> > 
> > Our Web Application is required to display hyperlinks
> to external files that reside outside the web application
> based on certain business rules. The users could then
> download these large PDF files.
> > 
> > We went ahead with the idea of symbolic links
> supported by Tomcat.
> > 
> > 
> > 
> > We deployed the application and created a symbolic
> link under the web application directory to point to another
> external directory on the same server. All the hyperlinks
> use the symbolic link.
> > 
> > The Application worked fine. When we undeploy the
> application, Tomcat seems to be deleting the war file, the
> exploded directory and also all 
> > the external files that are present in the directory
> pointed to by the symbolic link!
> > 
> > I was expecting tomcat to delete only the war file,
> the exploded directory including the symbolic link, but not
> the external PDF files during an undeployment!
> > 
> > I googled on the net and found that this behaviour has
> been observed on both Tomcat 5.x and Tomcat 6.x but no
> proper explanation to this issue.
> > 
> > I was wondering if this is the expected behaviour of
> Tomcat in this scenario or is it a bug?
> > 
> > 
> > 
> > 
> >       
> > 
> >
> -
> > 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: Tomcat 5.5.17 - allowLinking property - symbolic links

2009-12-22 Thread Mark Thomas
On 22/12/2009 08:58, Vishwa. K wrote:
> thanks Mark,
>But I was wondering why Tomcat did not remove the complete directory 
> itself.(softlink target directory). It removed only the nested files in it 
> during undeployment of the application.

No idea. Permissions maybe? If that isn't it you'd have to look at the
source code to find an explanation.

Mark



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



Re: j_security_check not working with flash

2009-12-22 Thread Pid

On 21/12/2009 21:50, vpapado wrote:


Hello,

I have a problem authenticating my users with j_security_check interworking
with a flash on my login.jsp page.

Here is how things go:

I use j_security_check method to authenticate my users.
As a result, I have assigned a login.jsp page where I have a login form and
at the top of the page a menu developed with flash:

..::1 - Login Form::..

Username:
Password:



..::2 - Menu Flash::..



When the user is prompt to login, then inserts the correct username -
password.
But after submit, the authentication method fails and the error page appears
from Tomcat:

HTTP Status 404 - /./j_security_check
type Status report
message /./j_security_check
description The requested resource (/./j_security_check) is not
available.


Then I simply remove my flash menu and the whole login procedure of the user
is performed correctly!!
This means that flash caused the error in this page!!

Is there a way I can have in my login.jsp page my flash menu and perform the
login successfully?


At a guess: don't put the Flash movie in a protected directory.


p



Thanks in Advance for the answer,
papado.



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



Re: TomCat 6 performance issues

2009-12-22 Thread Pid

On 22/12/2009 05:48, DOrlov wrote:




Zacheusz Siedlecki-2 wrote:


This could be problem with memmory and GC. Please show your jvm
memmory settings.
   Regards,
  Zacheusz



Thank you for reply, I use next memory and GC settings:
-Xms1024m -Xmx6144m -XX:MaxPermSize=512m
-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode



What about the exact versions of your OS, JVM and Tomcat?
Is your OS a 64bit one?


p


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



question about Tomcat5.5 getServletContext().getContext(String url);

2009-12-22 Thread Peter Chen
Hi,

In a JSP file, there is a sentence like this:

ServletContext sc = this.getServletContext().getContext("/File");

if(sc == null){

  Logger.warn(msg,"Can't get the context of /File.");

  return;

}

 

What's the mean of this sentence?

Now, I run this application in Tomcat5.5, and find the log: Can't get
the context of /File.

How to solve this problem? Thanks.



tomcat native problem 64bit linux os

2009-12-22 Thread Michele Mase'
I've successfully enabled the apr native on linux CentOS 32 bit following
some simple steps:

Install apr and openssl dev required files
yum install openssl-devel apr-devel

Install jdk, tomcat and set JAVA_HOME; accordlin to my conf JAVA_HOME is
/usr/java/latest and tomcat is in /home/tomcat/tomcat-6b
Get tomcat native (I used the 1.1.18 version)
Before compiling is useful to test that tomcat is fully working (eg. cd ~;
cd tomcat-6b/bin; sh catalina.sh run)

Native:
untarring
tar zxvf tomcat-native-version-src.tar.gz (version=1.1.18 in my env)
compiling:
./configure --with-apr=$(which apr-1-config)
--with-java-home=$JAVA_HOME --with-ssl=yes
--prefix=/home/tomcat/tomcat6-a
make && make install

Now native libs are in /home/tomcat/tomcat-6b/lib

Edit catalina.sh adding:
CATALINA_OPTS="$CATALINA_OPTS
-Djava.library.path=/home/tomcat/tomcat-6b/lib"

Restart tomcat and verify that the message complying the missing apr is gone
...

If you set CATALINA_HOME env, you can optionally use --prefix=$CATALINA_HOME
The apr will be put in $CATALINA_HOME/lib

The same procedure on linux 64bit doesn't work
The tomcat native libraries now are put under $CATALINA_HOME/lib64
ll lib64
total 2448
-rw-r--r-- 1 tomcat tomcat 1577256 Dec 18 11:11 libtcnative.a
-rwxr-xr-x 1 tomcat tomcat 865 Dec 18 11:11 libtcnative.la
lrwxrwxrwx 1 tomcat tomcat  21 Dec 18 11:11 libtcnative.so ->
libtcnative.so.0.1.18
lrwxrwxrwx 1 tomcat tomcat  21 Dec 18 11:11 libtcnative.so.0 ->
libtcnative.so.0.1.18
-rwxr-xr-x 1 tomcat tomcat  884518 Dec 18 11:11 libtcnative.so.0.1.18
drwxr-xr-x 2 tomcat tomcat4096 Dec 22 09:28 pkgconfig

I've added in the catalina.sh the following
CATALINA_OPTS="$CATALINA_OPTS
-Djava.library.path=/home/tomcat/tomcat-6b/lib64"

And again, after tomcat is started i find the missing apr messages
...
Dec 22, 2009 9:59:16 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: /home/tomcat/tomcat-6b/lib64
...

Any suggestion?


Re: Tomcat 5.5.17 - allowLinking property - symbolic links

2009-12-22 Thread Vishwa. K
thanks Mark,
   But I was wondering why Tomcat did not remove the complete directory 
itself.(softlink target directory). It removed only the nested files in it 
during undeployment of the application.


- Vishwa


--- On Fri, 12/18/09, Mark Thomas  wrote:

> From: Mark Thomas 
> Subject: Re: Tomcat 5.5.17 - allowLinking property - symbolic links
> To: "Tomcat Users List" 
> Date: Friday, December 18, 2009, 10:05 AM
> On 18/12/2009 10:01, Vishwa. K
> wrote:
> > I was wondering if this is the expected behaviour of
> Tomcat in this scenario or is it a bug?
> 
> It is expected behaviour.
> 
> 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: Tomcat shutdown automaticly after randomaly period of time

2009-12-22 Thread André Warnier

Tomcat1 wrote:

hi,
i have Tomcat 6.0.20. i config server.xml to work with SSL. the problem is
that Tomcat shutdown after randomaly period of time and doesnt restart
again.


Hi.
It is not very clear what your problem is.  You have to be a bit more 
specific in your explanation.

Also tell us on which platform this is running, and the JVM version


The log which you included, shows a problem when Tomcat *starts*.
The problem, when Tomcat starts, is that when it tries to create the 
Connector on port 8443, it finds that this port is already in use by 
another process.  That is why it says :



SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:8443


To see why that is, you need to :
- stop Tomcat
- find out if something else is using that port 8443.
Under both Unix/Linux and Windows, you can use the "netstat" command for 
that.  Look for a line that has ":8443" and "LISTEN" in it.
- if nothing else is using it, it may be that when you believed that 
Tomcat was stopped, it was not.


You have to resolve that first.

Once that issue is sorted out, then maybe we can start looking why 
"Tomcat shutdown after a random period".

That is not normal.  Tomcat does not usually shutdown by itself.
But that problem is not shown in the logfile that you copied here.



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



Re: TomCat 6 performance issues

2009-12-22 Thread DOrlov



Leon Rosenberg-3 wrote:
> 
> Hello,
> 
> you should switch on GC logs and check whether the delays happen at
> the Full GC Time.
> You should also start with Xms = Xmx -> both 6144 (why exactly 6144? :-)
> ).
> 
> -verbose:gc
> -XX:+PrintGCTimeStamps
> -XX:+PrintGCDetails
> 

Thank you for comment I will change Xmx, Xms (about 6144, it was set by our
admin :)))
About GC logging, I'm afraid that logging will reduce performance (I've
written, that this is production server). Do you have any figures of
performance lacks whith 'on' GC logging? 

We tried to reproduce issue by collecting production logs and reproducing
them via tcpreplay to test server, but we weren't able to reproduce issue
:((

Thanks,
Denis. 

-- 
View this message in context: 
http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26885080.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: TomCat 6 performance issues

2009-12-22 Thread Leon Rosenberg
Hello,

you should switch on GC logs and check whether the delays happen at
the Full GC Time.
You should also start with Xms = Xmx -> both 6144 (why exactly 6144? :-) ).

-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails

regards
Leon

On Tue, Dec 22, 2009 at 6:48 AM, DOrlov  wrote:
>
>
>
> Zacheusz Siedlecki-2 wrote:
>>
>> This could be problem with memmory and GC. Please show your jvm
>> memmory settings.
>>           Regards,
>>                  Zacheusz
>>
>
> Thank you for reply, I use next memory and GC settings:
> -Xms1024m -Xmx6144m -XX:MaxPermSize=512m
> -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode
>
> --
> View this message in context: 
> http://old.nabble.com/TomCat-6-performance-issues-tp26884227p26884294.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

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