Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Kees Jan Koster

On 27 dec. 2011, at 06:25, Saravanan L saravan...@te-soft.com wrote:

 Please find the server.xml attached. 
 
 The real problem is I dont know where to look at. 
 -There are no error in logs or the linux sys logs. 
 - I cannot diagnose as the connector(443) does not even connect. 
 

I saw the same with the HTTP BIO connector on Tomcat 7.0.22. It would start 
responding intermittently and then stop responding completely. This particular 
Tomcat has a second HTTP connector pool for an Apache httpd using 
mod_proxy_http. That pool kept working beautifully.

I went back to 6.0.x and now it all works beautifully, as I am used from Tomcat.

I tried reproducing it on a load test machine, but it never showed there.

I am at a loss where to start looking for this. 

Kees Jan

 On 12/24/2011 3:31 PM, Pid wrote:
 
 On 23/12/2011 14:47, Christopher Schultz wrote:
 Saravanan,
 
 On 12/23/11 7:03 AM, Saravanan L wrote:
 Please find the latest thread dump attached with mail.
 Tomcat 7 still crashes without acceptCount.  I am wrong on this
 assumption.
 The response code is 504. It takes about 2 hours for this occur.
 The last status in http-apr-443 (In Server status ) is : 
 Max threads: 5000 
 Seems high, as Chris says.
 
 Current thread count: 249
 Can you post your full server.xml please, inline and with all XML
 comments/usernames/passwords removed.
 
 Current thread busy: 2 
 Low.
 
 Keeped alive sockets count: 40 
 Hmm?  Where does that come from?
 
 Max processing time: 300477 ms
 Processing time: 8788.765 s 
 Seems low for 2 hours of operation.  Where does that number come from?
 
 Request count: 9223
 Error count: 783
 That's about 10%.  What are those errors, exactly?
 
 Bytes received: 0.22 MB
 Bytes sent: 5.43 MB
 Both of those seem low for 2 hours of operation.
 
 What is your application/server doing?
 
 
 p
 
 
 What happens if you configure your HTTPS connector with fewer max
 threads, say, 50? Does the connector lock-up more quickly? What does
 your load profile look like? Is this observable in a testing
 environment or only in production? If you could set up a simple jmeter
 test against a test webapp, that would be ideal for trying to debug
 this issue.
 
 If you switch to NIO or BIO connector, does Tomcat become more stable,
 or do you experience the same phenomenon?
 
 -chris
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -- 
 Regards 
 Saravanan.L 
 
 This message and any attachment(s) contained here are information that is 
 confidential, proprietary to TE Software and Services Pvt Ltd. and its 
 customers. Contents may be privileged or otherwise protected by law. The 
 information is solely intended for the individual or the entity it is 
 addressed to. If you are not the intended recipient of this message, you are 
 not authorized to read, forward, print, retain, copy or disseminate this 
 message or any part of it.
 server.xml
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread S B
On Tue, Dec 27, 2011 at 4:06 PM, Pid * p...@pidster.com wrote:

 On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:

  On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:
 
  On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:
 
  On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:
 
  On 23/12/2011 04:57, S B wrote:
  On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:
 
  On 22/12/2011 10:34, Konstantin Kolinko wrote:
  2011/12/20 S B sbl...@gmail.com:
  Hi,
 
  I created and deployed an MBean in my tomcat. It uses datasource
 to
  connect
  to DB.
 
  My questions is:
 
  When I create InitialContext() inside MBean's constructor and pass
  the
  envContext to DBManager class to lookup datasource it works fine.
  However
  when I create InitialContext() in DBManager  class, it fails.
 
  IIRC what InitialContext() sees as its environment highly depends
 on
  what classloader is active. That is TCCL =
  Thread.getContextClassLoader().
 
  So while it is run from within web application your TCCL = your
  webapp's classloader.
 
  When it is invoked from jconsole it might be a separate Thread, not
  related to your web application.
 
 
  Like he ^^^ said.  :)
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi Pid/Konstantin,
 
  yes you are right. I just verified it. When it is invoked from
  jconsole,
  the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
  and when it is run within a web application the clasloader is
  WebAppClassloader.
 
  So, how can I force it to use webapp classloader during new
  InitialContext() while invoking from jconsole
  One possible way is to reuse the initialContext created during server
  startup. (pass it as param during invocation from jconsole).
 
  Is there a smarter way ??
 
  I am a bit concerned about how you are registering the bean inside the
  bean's own constructor.  I am not clear on how you are subsequently
  unregistering that bean, before the reloading operation - and I am not
  at all clear what the purpose of reloading is anyway.
 
  Is there a reason that the MBean itself needs to be recreated?
 
  Bear in mind that you are attempting to re-initialise the MBean, while
  you are still using it.  This does not seem like a good idea to me.
 
  I would suggest that you either have a separate Manager MBean that
 does
  the reloading, or just have the reload method call the actual code on
  the DB, without re-initialising the bean.
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi,
 
  un-registering of mbean doesn't happen until servlet's destroy method
 is
  called.
  Actually, registration of bean happen only once, ie during server
  startup.
  This time mbean's constructor is called and it is registered with MBean
  server.
  (I was wrong earlier when I said, constructor is called on each
  invocation
  of reload() method from jconsole. sorry about that. i was lill
 confused.)
 
  MBean is never re-created. It is created only once and registered only
  once.
 
  actual flow is:
 
  click reload() on jconsole gui.
  *it causes constructor of MBeanImpl to run. (verified from logs.)*  --
  *Wrong.
  pls disregard this statement.*
  calls reload() defined in MBeanImpl.
  calls DBManager.reload()
  inside DBManager.reload() it fails at InitialContext initContext = new
  InitialContext();
  the exception is  -  javax.naming.NoInitialContextException: Cannot
  instantiate class: org.apache.naming.java.javaURLContextFactory [Root
  exception is java.lang.ClassNotFoundException:
  org.apache.naming.java.javaURLContextFactory]
 
  OK, but what is the purpose of DBManager.reload()?
 
 
  p
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
  Hi Pid, Marry Christmas !!!
  Purpose of DBManager.reload() is to load some application specific data
  from DB. Pls don't consider reload() as reload of MBean.
  reload() can better be renamed as loadData().
 
  when I invoke reload() from jconsole my application is suppose to make a
 db
  connection and load app specific data from database.

 OK, so why not retain a reference to the DataSource that you're
 getting the connection from?


 p

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


yes. thats one possible workaround. I followed similar approach and
retailed reference of Context (which i used to get datasource during
invocation from jconsole).
This approach works.
And as Konstantin earlier said it is because of different class loaders
that I can't do new InitialContext() during invocation from jconsole.
*My question is:  how can I force it to use webapp classloader during new
InitialContext() while invoking from jconsole.*

is there a way to do something like

RE: ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Denis Ivanov

It was working fine before (Tomcat 7.0.23 on my laptop and 7.0.19 on the 
server).
Is there some way to upgrade while preserving the web app configuration?

 From: p...@pidster.com
 Date: Tue, 27 Dec 2011 13:49:39 +
 Subject: Re: ClassFormatException: Invalid constant pool reference
 To: users@tomcat.apache.org
 
 On 27 Dec 2011, at 12:53, Denis Ivanov denis.iva...@live.com wrote:
 
 
  Hey, I have an Amazon Enterprise Linux (EC2) version 
  2.6.35.11-83.9.amzn1.i686 (architecture i386) with Java JM version 
  1.6.0_20-b20 (Vendor Sun Microsystems Inc.) and Apache Tomcat version 
  7.0.19 with Catalina.
  I'm trying to deploy GlobziWebApplication.war and it was working a few days 
  ago but now it gives me error 404 when I try to access the web service and 
  logs/catalina.out says
  Error deploying web application archive GlobziWebApplication.war 
  org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid 
  constant pool reference: 12034. Constant pool size is: 1486
  And then it lists a bunch of instances where this occurs, like at 
  org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).
  What is Invalid constant pool reference?
  GlobziWebApplication.war was compiled using NetBeans 7.0.1.
  Help me fix this.
 
 Please.
 
  Thanks.
 
 Are you compiling in netbeans against a different version of Tomcat?
 
 Can you use the latest version?
 
 
 p
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  

Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread Pid *
On 27 Dec 2011, at 11:16, S B sbl...@gmail.com wrote:

 On Tue, Dec 27, 2011 at 4:06 PM, Pid * p...@pidster.com wrote:

 On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:

 On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:

 On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:

 On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:

 On 23/12/2011 04:57, S B wrote:
 On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:

 On 22/12/2011 10:34, Konstantin Kolinko wrote:
 2011/12/20 S B sbl...@gmail.com:
 Hi,

 I created and deployed an MBean in my tomcat. It uses datasource
 to
 connect
 to DB.

 My questions is:

 When I create InitialContext() inside MBean's constructor and pass
 the
 envContext to DBManager class to lookup datasource it works fine.
 However
 when I create InitialContext() in DBManager  class, it fails.

 IIRC what InitialContext() sees as its environment highly depends
 on
 what classloader is active. That is TCCL =
 Thread.getContextClassLoader().

 So while it is run from within web application your TCCL = your
 webapp's classloader.

 When it is invoked from jconsole it might be a separate Thread, not
 related to your web application.


 Like he ^^^ said.  :)


 p


 --

 [key:62590808]


 Hi Pid/Konstantin,

 yes you are right. I just verified it. When it is invoked from
 jconsole,
 the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
 and when it is run within a web application the clasloader is
 WebAppClassloader.

 So, how can I force it to use webapp classloader during new
 InitialContext() while invoking from jconsole
 One possible way is to reuse the initialContext created during server
 startup. (pass it as param during invocation from jconsole).

 Is there a smarter way ??

 I am a bit concerned about how you are registering the bean inside the
 bean's own constructor.  I am not clear on how you are subsequently
 unregistering that bean, before the reloading operation - and I am not
 at all clear what the purpose of reloading is anyway.

 Is there a reason that the MBean itself needs to be recreated?

 Bear in mind that you are attempting to re-initialise the MBean, while
 you are still using it.  This does not seem like a good idea to me.

 I would suggest that you either have a separate Manager MBean that
 does
 the reloading, or just have the reload method call the actual code on
 the DB, without re-initialising the bean.


 p


 --

 [key:62590808]


 Hi,

 un-registering of mbean doesn't happen until servlet's destroy method
 is
 called.
 Actually, registration of bean happen only once, ie during server
 startup.
 This time mbean's constructor is called and it is registered with MBean
 server.
 (I was wrong earlier when I said, constructor is called on each
 invocation
 of reload() method from jconsole. sorry about that. i was lill
 confused.)

 MBean is never re-created. It is created only once and registered only
 once.

 actual flow is:

 click reload() on jconsole gui.
 *it causes constructor of MBeanImpl to run. (verified from logs.)*  --
 *Wrong.
 pls disregard this statement.*
 calls reload() defined in MBeanImpl.
 calls DBManager.reload()
 inside DBManager.reload() it fails at InitialContext initContext = new
 InitialContext();
 the exception is  -  javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.naming.java.javaURLContextFactory [Root
 exception is java.lang.ClassNotFoundException:
 org.apache.naming.java.javaURLContextFactory]

 OK, but what is the purpose of DBManager.reload()?


 p

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



 Hi Pid, Marry Christmas !!!
 Purpose of DBManager.reload() is to load some application specific data
 from DB. Pls don't consider reload() as reload of MBean.
 reload() can better be renamed as loadData().

 when I invoke reload() from jconsole my application is suppose to make a
 db
 connection and load app specific data from database.

 OK, so why not retain a reference to the DataSource that you're
 getting the connection from?


 p

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


 yes. thats one possible workaround. I followed similar approach and
 retailed reference of Context (which i used to get datasource during
 invocation from jconsole).
 This approach works.
 And as Konstantin earlier said it is because of different class loaders
 that I can't do new InitialContext() during invocation from jconsole.
 *My question is:  how can I force it to use webapp classloader during new
 InitialContext() while invoking from jconsole.*

 is there a way to do something like
 InitialContext.useClassLoader(webaappClassLoader)
 ?
 During server startup InitialContext() used 

Re: tomcat7 maven plugin (frustration) - probably a simple question

2011-12-27 Thread Olivier Lamy
Hello,

Does your current project have war packaging ? If yes, I think there
are some issues with that and btw use exec-war-only goal to prevent to
run an other full lifecycle in your war project.
What I recommend is to have an other project with packaging pom and
construct the exec war.
I have pushed samples here: https://github.com/olamy/translate-puzzle .

2011/12/27 PS M. transparentpolit...@gmail.com:
 Hi there --

 I am frustrated with the tomcat7 maven plugin. I am trying to create an
 executable jar from my war project. The problem is that none of the war's
 dependencies are included in the executable jar even though the
 corresponding war created at the same time is complete.

 In the pom.xml file:

 project
 
            plugin
                groupIdorg.apache.tomcat.maven/groupId
                artifactIdtomcat7-maven-plugin/artifactId
                executions
                    execution
                        idtomcat-run/id
                        goals
                            goalexec-war/goal
                        /goals
                        phasepackage/phase
                        configuration
                            path//path
                            attachArtifactClassifier
                                exec-war!-- default --
                            /attachArtifactClassifier
                            attachArtifactClassifierType
                                jar!-- default value is jar --
                            /attachArtifactClassifierType
                            warRunDependencies
                                warRunDependency
                                    dependency
                                        groupIdcom.my-company/groupId
                                        artifactIdwireservice/artifactId

 version${project.version}/version
                                        typewar/type
                                    /dependency
                                    contextPath//contextPath
                                /warRunDependency
                            /warRunDependencies
                            !-- naming is disable by default so use true
 to enable it --
                            enableNamingtrue/enableNaming
                        /configuration
                    /execution
                /executions
            /plugin

 The generated executable has a this structure:
 820944 Mon Dec 26 18:28:42 PST 2011 .war
    183 Mon Dec 26 18:28:42 PST 2011 tomcat.standalone.properties
     0 Mon Dec 26 18:28:44 PST 2011 META-INF/
   394 Mon Dec 26 18:28:44 PST 2011 META-INF/MANIFEST.MF
     0 Mon Dec 26 18:28:44 PST 2011 javax/
     0 Mon Dec 26 18:28:44 PST 2011 javax/annotation/
     0 Mon Dec 26 18:28:44 PST 2011 javax/annotation/security/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/annotation/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/descriptor/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/http/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/jsp/
     0 Mon Dec 26 18:28:44 PST 2011 javax/servlet/resources/
     0 Mon Dec 26 18:28:44 PST 2011 org/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/authenticator/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/comet/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/connector/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/core/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/deploy/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/filters/
     0 Mon Dec 26 18:28:44 PST 2011 org/apache/catalina/loader/
  ( tomcat 7 exploded into classes )

 The .war file has just the the classes in the current project included.
 No dependencies are included as jars or exploded in any other form.

 java -jar .jar starts tomcat but the war servlet is does not respond on
 http://localhost:8080/ and in any event it would not be able to run because
 of the missing dependencies.

 So 2 questions:

   1. How to get the tomcat7-maven-plugin to include the war's
   dependencies. ( fyi the dependencies in question have the default scope )
   2. How to get the path correctly so that http://localhost:8080/ is
   responded to?

 Thanks!

 Pat



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Edwards, Dominic


Platform Details:
-
Tomcat 5.5.28 
Operating System: RedHat Enterprise 5


Problem
---

Tomcat appears to be mismanaging my web contexts after a restart. It happens 
only sometimes and not others.

I have the following context records in my server.xml:

Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com 
unpackWARs=true autoDeploy=true xmlValidation=false 
xmlNamespaceAware=false 

deployOnStartup=true
 Aliaswww.mysite.com/Alias
 
 Context path= reloadable=true 
docBase=/home/myaccount/public_html/mysite.com crossContext=true 
 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context

 Context path=/cms reloadable=true 
docBase=/home/myaccount/public_html/mysite.com crossContext=true
 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context
 /Host
 
This represents my website and a CMS for the website, the cms being in a 
subdirectory of the main website's root directory. Before you ask the 
configuration was originally 

designed to enable the sharing of session object data between the two contexts. 

The problem is that sometimes when Tomcat is restarted these contexts are 
confused. At other times the restart does not encounter the problem which is 
why the cause remains a 

mystery to me that I hope someone can help with.



Symptoms


If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp) 

I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

I see the main site just as I would expect so it appears sometimes both 
contexts are pointing to the same URL.




Has anyone ever experienced this kind of irregular behaviour or know what might 
be the cause? As I say this happens from time to time - sometimes and not 
others even though 

Tomcat starts up with the same configuration.

Thanks in advance.

Dominic.  



Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread S B
On Tue, Dec 27, 2011 at 6:55 PM, Konstantin Kolinko
knst.koli...@gmail.comwrote:

 2011/12/27 S B sbl...@gmail.com:
  On Tue, Dec 27, 2011 at 4:53 PM, Pid * p...@pidster.com wrote:
 
  On 27 Dec 2011, at 11:16, S B sbl...@gmail.com wrote:
 
   On Tue, Dec 27, 2011 at 4:06 PM, Pid * p...@pidster.com wrote:
  
   On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:
  
   On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:
  
   On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:
  
   On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:
  
   On 23/12/2011 04:57, S B wrote:
   On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:
  
   On 22/12/2011 10:34, Konstantin Kolinko wrote:
   2011/12/20 S B sbl...@gmail.com:
   Hi,
  
   I created and deployed an MBean in my tomcat. It uses
 datasource
   to
   connect
   to DB.
  
   My questions is:
  
   When I create InitialContext() inside MBean's constructor and
  pass
   the
   envContext to DBManager class to lookup datasource it works
  fine.
   However
   when I create InitialContext() in DBManager  class, it fails.
  
   IIRC what InitialContext() sees as its environment highly
 depends
   on
   what classloader is active. That is TCCL =
   Thread.getContextClassLoader().
  
   So while it is run from within web application your TCCL =
 your
   webapp's classloader.
  
   When it is invoked from jconsole it might be a separate
 Thread,
  not
   related to your web application.
  
  
   Like he ^^^ said.  :)
  
  
   p
  
  
   --
  
   [key:62590808]
  
  
   Hi Pid/Konstantin,
  
   yes you are right. I just verified it. When it is invoked from
   jconsole,
   the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
   and when it is run within a web application the clasloader is
   WebAppClassloader.
  
   So, how can I force it to use webapp classloader during new
   InitialContext() while invoking from jconsole
   One possible way is to reuse the initialContext created during
  server
   startup. (pass it as param during invocation from jconsole).
  
   Is there a smarter way ??
  
   I am a bit concerned about how you are registering the bean
 inside
  the
   bean's own constructor.  I am not clear on how you are
 subsequently
   unregistering that bean, before the reloading operation - and I
 am
  not
   at all clear what the purpose of reloading is anyway.
  
   Is there a reason that the MBean itself needs to be recreated?
  
   Bear in mind that you are attempting to re-initialise the MBean,
  while
   you are still using it.  This does not seem like a good idea to
 me.
  
   I would suggest that you either have a separate Manager MBean
 that
   does
   the reloading, or just have the reload method call the actual
 code
  on
   the DB, without re-initialising the bean.
  
  
   p
  
  
   --
  
   [key:62590808]
  
  
   Hi,
  
   un-registering of mbean doesn't happen until servlet's destroy
 method
   is
   called.
   Actually, registration of bean happen only once, ie during server
   startup.
   This time mbean's constructor is called and it is registered with
  MBean
   server.
   (I was wrong earlier when I said, constructor is called on each
   invocation
   of reload() method from jconsole. sorry about that. i was lill
   confused.)
  
   MBean is never re-created. It is created only once and registered
  only
   once.
  
   actual flow is:
  
   click reload() on jconsole gui.
   *it causes constructor of MBeanImpl to run. (verified from logs.)*
   --
   *Wrong.
   pls disregard this statement.*
   calls reload() defined in MBeanImpl.
   calls DBManager.reload()
   inside DBManager.reload() it fails at InitialContext initContext =
  new
   InitialContext();
   the exception is  -  javax.naming.NoInitialContextException:
 Cannot
   instantiate class: org.apache.naming.java.javaURLContextFactory
 [Root
   exception is java.lang.ClassNotFoundException:
   org.apache.naming.java.javaURLContextFactory]
  
   OK, but what is the purpose of DBManager.reload()?
  
  
   p
  
  
 -
   To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
   For additional commands, e-mail: users-h...@tomcat.apache.org
  
  
  
   Hi Pid, Marry Christmas !!!
   Purpose of DBManager.reload() is to load some application specific
 data
   from DB. Pls don't consider reload() as reload of MBean.
   reload() can better be renamed as loadData().
  
   when I invoke reload() from jconsole my application is suppose to
 make
  a
   db
   connection and load app specific data from database.
  
   OK, so why not retain a reference to the DataSource that you're
   getting the connection from?
  
  
   p
  
   -
   To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
   For additional commands, e-mail: users-h...@tomcat.apache.org
  
  
   yes. thats one possible workaround. I followed similar 

Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Saravanan L

3. A 504 response code is a gateway timeout. Tomcat does not issue this
on its own. Either you have a proxy in front of Tomcat or your
application is returning this value.

A. Yes the proxy relayed this message,  it seems the tomcat did not 
respond with any message at all.


looks like 200 idle threads to me.

In comet idle threads are fine rights. Thats how comet/nio works right. Please 
correct me on this.


On 12/27/2011 4:03 PM, Mark Thomas wrote:

On 27/12/2011 08:55, Saravanan L wrote:

Tried netstat. 443 is listening, but I cannot connect to it.

I assume it shows no open connections either.


Secondly Thread dump - I could not find any signs of problem or anything
relative to the current issue in the threaddump [Please find the
threaddump in my previous post].

Yep, that looks like 200 idle threads to me.


Looking back through this thread I see a number of most likely unrelated
issues being treated as the same problem.

Reviewing the thread:

1. acceptCount=1 is a crazily high number. That you see odd effects
with this does not surprise me. acceptCount is only for handling
infrequent, short, very high spikes in load.

2. maxThreads=5000 is very high. Given that you handled ~10k requests in
2 hours it appears that maxThreads should be reduced by several orders
of magnitude.

3. A 504 response code is a gateway timeout. Tomcat does not issue this
on its own. Either you have a proxy in front of Tomcat or your
application is returning this value.

4. There are settings in your server.xml that were dropped a couple of
versions ago.


I suggest the following:
- restore the threadpool and acceptcount defaults
- remove the old settings


Run your tests and then diagnose the fault that appears. If you need
pointers, ask here.


Mark

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





--
Regards
*Saravanan.L*

This message and any attachment(s) contained here are information that is 
confidential, proprietary to TE Software Services and its customers. Contents 
may be privileged or otherwise protected by law. The information is solely 
intended for the individual or the entity it is addressed to. If you are not 
the intended recipient of this message, you are not authorized to read, 
forward, print, retain, copy or disseminate this message or any part of it. If 
you have received this e-mail in error, please notify the sender immediately by 
return e-mail and delete it from your computer.

Re: Security Constraints With URL Rewrite filter

2011-12-27 Thread Pid *
On 26 Dec 2011, at 22:27, Jerry Malcolm 2ndgenfi...@gmail.com wrote:

 Half of the site is protected, and the other half is not, and some pages
 have moved from unprotected to protected at the whim of the client.

How on earth are you supposed to meet all of these requirements?

If you want to have a sane security scheme then you will have to make
it clear to your client that all things are not possible at the same
time and they will have to choose from a list of compromises.

Right now you are up against limitations that you are imposing on
yourself. We can't fix that.

If you can't simplify the requirement then you will need a more
complex security layer. You can either write this yourself, or use an
existing component like Spring Security*.

It is not too hard to write a Filter based controller/router with
integrated security. If you were to embark on this, I would recommend
you take a thorough look at what you have already and consider what
you can reuse and what you can't - you are effectively working to a
whole new requirement.


p

* Disclaimer: I work for SpringSource.



 The
 client has simply stated clean URLs.  I have argued that point, and
 lost.  So independent of valid substantiation for the requirement, it is
 what it is, and I'm not getting paid for arguing that point.

 I know I could protect all of the inbound URL aliases.  But first of all,
 it defeats the whole modularity design for my system.  Roles are webapp
 specific and definitions are contained in the web.xml file, and are folder
 based.  If I protect the inbound urls, I now have to have an entry for
 every page in every web context all listed in the router filter web app
 that sits at / instead of contained with the webapp web.xml.  This is a
 maintenance nightmare and a recipe for disaster when one page is
 accidentally omitted from protection.

 I know there are solutions. But every one ends up being baling wire and
 duct tape.  All I want to do is take URL-A and change it to URL-B and have
 it look to all of Tomcat like it came in as URL-B from the user.  I know
 that is basically httpd mod_rewrite.  But as I stated earlier, I have some
 dynamic database-related mappings.  I know little about mod_rewrite.  Is
 there any way to do Apache mod_rewrite with a java application?

 Thanks.

 Jerry

 On Mon, Dec 26, 2011 at 3:16 PM, Terence M. Bandoian tere...@tmbsw.comwrote:

 On 1:59 PM, Pid * wrote:

 On 25 Dec 2011, at 22:03, Jerry Malcolm2ndgenfi...@gmail.com wrote:

 Thanks for the input.  This has turned into something really ugly.  Let
 me
 go back and summarize the situation:

 I have an established large application made up of about 10 separate
 webapps (contexts) to keep it modular.  Within each context there are 3-5
 user roles with varying authority.  I organize the jsps in each webapp
 based on roles and then set the security constraint to be, for example,

   -- for webapp ABC
  -- 'ABCadmin' role for /jsp/admin/*.jsp,
  --'ABCoperator' role for /jsp/operator/*.jsp in the ABC webapp.

 Likewise, for webapp XYZ
  -- 'XYZadmin' role for /jsp/admin/*.jsp in the XYZ webapp,
  -- etc, etc

 This has worked fine for years and I have sold this to the client as
 being
 highly secure.  No problems.

 Now, the client's SEO advisor has told them that they have to get rid of
 the 'geeky stuff' like /ABC/jsp/guest/aa.jsp in the URLs and replace
 them with SEO-friendly 1-word URLs.

 Argh. 99% of SEO types = snake oil salesmen.

 Next they'll be organising back link swaps with entirely unrelated
 other websites (who happen to be their clients).


 So that requirement has officially
 flowed downstream to me

 May I inquire as to why public, indexable URLs are also protected with
 various types of admin access?

 If they need a login to access them, no search engine will be able to
 index them anyway...


 p


 So... I wrote a filter (implements javax.servlet.Filter) that takes
 SEO-friendly words in the URL and map them to a particular context and
 path
 to the appropriate JSP and uses a RequestDispatcher to forward the
 request.  I have the filter installed in a special webapp that is mapped
 to
 / and therefore will receive all requests to the host.  In the filter I
 look up the mappings and then use cross-context functionality to route to
 the appropriate context/path.  No problems with the filter routing as far
 as getting the request to the intended target.

 Example:  /showPlasmaTVs  =
 /webAppContext1/jsp/user/**products.jsp?productSearch=**plasma

 I understand from this discussion that I now have zero security role
 protection.  I understand why.  But that doesn't solve the problem.

 It appears that I have no really good options now:

 1) make SEO happy and discard security
 2) make security happy and discard SEO requirements
 3) make everything a redirect which probably is the same as #2 since
 URLs are now exposed
 4) write code myself to basically re-implement the entire 

ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Denis Ivanov

Hey, I have an Amazon Enterprise Linux (EC2) version 2.6.35.11-83.9.amzn1.i686 
(architecture i386) with Java JM version 1.6.0_20-b20 (Vendor Sun Microsystems 
Inc.) and Apache Tomcat version 7.0.19 with Catalina.
I'm trying to deploy GlobziWebApplication.war and it was working a few days ago 
but now it gives me error 404 when I try to access the web service and 
logs/catalina.out says 
Error deploying web application archive GlobziWebApplication.war 
org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid constant 
pool reference: 12034. Constant pool size is: 1486
And then it lists a bunch of instances where this occurs, like at 
org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).
What is Invalid constant pool reference?
GlobziWebApplication.war was compiled using NetBeans 7.0.1.
Help me fix this. Thanks. 

Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread Pid *
On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:

 On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:

 On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:

 On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:

 On 23/12/2011 04:57, S B wrote:
 On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:

 On 22/12/2011 10:34, Konstantin Kolinko wrote:
 2011/12/20 S B sbl...@gmail.com:
 Hi,

 I created and deployed an MBean in my tomcat. It uses datasource to
 connect
 to DB.

 My questions is:

 When I create InitialContext() inside MBean's constructor and pass
 the
 envContext to DBManager class to lookup datasource it works fine.
 However
 when I create InitialContext() in DBManager  class, it fails.

 IIRC what InitialContext() sees as its environment highly depends on
 what classloader is active. That is TCCL =
 Thread.getContextClassLoader().

 So while it is run from within web application your TCCL = your
 webapp's classloader.

 When it is invoked from jconsole it might be a separate Thread, not
 related to your web application.


 Like he ^^^ said.  :)


 p


 --

 [key:62590808]


 Hi Pid/Konstantin,

 yes you are right. I just verified it. When it is invoked from
 jconsole,
 the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
 and when it is run within a web application the clasloader is
 WebAppClassloader.

 So, how can I force it to use webapp classloader during new
 InitialContext() while invoking from jconsole
 One possible way is to reuse the initialContext created during server
 startup. (pass it as param during invocation from jconsole).

 Is there a smarter way ??

 I am a bit concerned about how you are registering the bean inside the
 bean's own constructor.  I am not clear on how you are subsequently
 unregistering that bean, before the reloading operation - and I am not
 at all clear what the purpose of reloading is anyway.

 Is there a reason that the MBean itself needs to be recreated?

 Bear in mind that you are attempting to re-initialise the MBean, while
 you are still using it.  This does not seem like a good idea to me.

 I would suggest that you either have a separate Manager MBean that does
 the reloading, or just have the reload method call the actual code on
 the DB, without re-initialising the bean.


 p


 --

 [key:62590808]


 Hi,

 un-registering of mbean doesn't happen until servlet's destroy method is
 called.
 Actually, registration of bean happen only once, ie during server
 startup.
 This time mbean's constructor is called and it is registered with MBean
 server.
 (I was wrong earlier when I said, constructor is called on each
 invocation
 of reload() method from jconsole. sorry about that. i was lill confused.)

 MBean is never re-created. It is created only once and registered only
 once.

 actual flow is:

 click reload() on jconsole gui.
 *it causes constructor of MBeanImpl to run. (verified from logs.)*  --
 *Wrong.
 pls disregard this statement.*
 calls reload() defined in MBeanImpl.
 calls DBManager.reload()
 inside DBManager.reload() it fails at InitialContext initContext = new
 InitialContext();
 the exception is  -  javax.naming.NoInitialContextException: Cannot
 instantiate class: org.apache.naming.java.javaURLContextFactory [Root
 exception is java.lang.ClassNotFoundException:
 org.apache.naming.java.javaURLContextFactory]

 OK, but what is the purpose of DBManager.reload()?


 p

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



 Hi Pid, Marry Christmas !!!
 Purpose of DBManager.reload() is to load some application specific data
 from DB. Pls don't consider reload() as reload of MBean.
 reload() can better be renamed as loadData().

 when I invoke reload() from jconsole my application is suppose to make a db
 connection and load app specific data from database.

OK, so why not retain a reference to the DataSource that you're
getting the connection from?


p

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



404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread David Hoffer
I just installed Tomcat 7.0.23 using Windows 64 bit installer and
deployed a couple apps via the manager application, however when I run
them I get HTTP Status 404 errors.  However I see that I get the same
error for the standard default apps, docs, examples, etc.  The only
URL that works is http://IP:8080/manager/html.

In the log I see:
Dec 27, 2011 3:28:29 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[errorCode=404,
location=/WEB-INF/jsp/404.jsp]
java.lang.NullPointerException
at 
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)
at 
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:324)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:193)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown 
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

What do I have to do to enable the apps?

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



Re: High memory consumption caused by BLOCKED Threads

2011-12-27 Thread Violeta Georgieva
Thanks to all of you!

I'm profiling the application now.

Happy New Year
Violeta

2011/12/23 Christopher Schultz ch...@christopherschultz.net

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Rainer,

 On 12/22/11 2:00 PM, Rainer Jung wrote:
  Hmmm, actually I had a short look at the code of
 
  sun.util.resources.TimeZoneNames.getContents(TimeZoneNames.java:185)
 
   and i don't unerstand why it is waiting for a monitor entry. The
  method should quickly return an array of objects which is
  explicitely defined in the class and that's it. No idea what's
  happening here.
 
  @Violeta: is anything wrong with your system, e.g. did you get an
  OutOfMemoryError somewhere? It looks your JVM is in a strange
  state. Are you doing frequent redeployments without stopping
  Tomcat?

 +1

 Looks like something horrible has happened in the JVM.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk7zskQACgkQ9CaO5/Lv0PDv2gCfUtQObYXhqNKH8LxEMT3rBuU5
 O0wAoKoCNwYv6a50LMTmv6y+cGRu+fAc
 =M07c
 -END PGP SIGNATURE-

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




Re: Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Konstantin Kolinko
2011/12/27 Edwards, Dominic dominic.edwa...@logica.com:


 Platform Details:
 -
 Tomcat 5.5.28

Old..
And 5.5.x branch as a whole is EOL in less than a year.

 Operating System: RedHat Enterprise 5


 Problem
 ---

 Tomcat appears to be mismanaging my web contexts after a restart. It happens 
 only sometimes and not others.

 I have the following context records in my server.xml:

 Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com 
 unpackWARs=true autoDeploy=true xmlValidation=false 
 xmlNamespaceAware=false

 deployOnStartup=true
         Aliaswww.mysite.com/Alias

         Context path= reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

Context elements in server.xml are explicitly discouraged. The
recommended practice is to place them into separate XML files.

         context-param
                  param-nameSharedSessiondataContext/param-name
                  param-value/cms/param-value
                /context-param
                /Context

         Context path=/cms reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

If you configure a docBase explicitly, it MUST be outside of appBase.
Your configuration is broken because of it.

         context-param
                  param-nameSharedSessiondataContext/param-name
                  param-value/cms/param-value
                /context-param
                /Context
     /Host

 This represents my website and a CMS for the website, the cms being in a 
 subdirectory of the main website's root directory. Before you ask the 
 configuration was originally

 designed to enable the sharing of session object data between the two 
 contexts.

 The problem is that sometimes when Tomcat is restarted these contexts are 
 confused. At other times the restart does not encounter the problem which is 
 why the cause remains a

 mystery to me that I hope someone can help with.



 Symptoms
 

 If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp)

 I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 I see the main site just as I would expect so it appears sometimes both 
 contexts are pointing to the same URL.




 Has anyone ever experienced this kind of irregular behaviour or know what 
 might be the cause? As I say this happens from time to time - sometimes and 
 not others even though

 Tomcat starts up with the same configuration.


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



Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread Konstantin Kolinko
2011/12/27 S B sbl...@gmail.com:
 On Tue, Dec 27, 2011 at 4:53 PM, Pid * p...@pidster.com wrote:

 On 27 Dec 2011, at 11:16, S B sbl...@gmail.com wrote:

  On Tue, Dec 27, 2011 at 4:06 PM, Pid * p...@pidster.com wrote:
 
  On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:
 
  On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:
 
  On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:
 
  On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:
 
  On 23/12/2011 04:57, S B wrote:
  On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:
 
  On 22/12/2011 10:34, Konstantin Kolinko wrote:
  2011/12/20 S B sbl...@gmail.com:
  Hi,
 
  I created and deployed an MBean in my tomcat. It uses datasource
  to
  connect
  to DB.
 
  My questions is:
 
  When I create InitialContext() inside MBean's constructor and
 pass
  the
  envContext to DBManager class to lookup datasource it works
 fine.
  However
  when I create InitialContext() in DBManager  class, it fails.
 
  IIRC what InitialContext() sees as its environment highly depends
  on
  what classloader is active. That is TCCL =
  Thread.getContextClassLoader().
 
  So while it is run from within web application your TCCL = your
  webapp's classloader.
 
  When it is invoked from jconsole it might be a separate Thread,
 not
  related to your web application.
 
 
  Like he ^^^ said.  :)
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi Pid/Konstantin,
 
  yes you are right. I just verified it. When it is invoked from
  jconsole,
  the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
  and when it is run within a web application the clasloader is
  WebAppClassloader.
 
  So, how can I force it to use webapp classloader during new
  InitialContext() while invoking from jconsole
  One possible way is to reuse the initialContext created during
 server
  startup. (pass it as param during invocation from jconsole).
 
  Is there a smarter way ??
 
  I am a bit concerned about how you are registering the bean inside
 the
  bean's own constructor.  I am not clear on how you are subsequently
  unregistering that bean, before the reloading operation - and I am
 not
  at all clear what the purpose of reloading is anyway.
 
  Is there a reason that the MBean itself needs to be recreated?
 
  Bear in mind that you are attempting to re-initialise the MBean,
 while
  you are still using it.  This does not seem like a good idea to me.
 
  I would suggest that you either have a separate Manager MBean that
  does
  the reloading, or just have the reload method call the actual code
 on
  the DB, without re-initialising the bean.
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi,
 
  un-registering of mbean doesn't happen until servlet's destroy method
  is
  called.
  Actually, registration of bean happen only once, ie during server
  startup.
  This time mbean's constructor is called and it is registered with
 MBean
  server.
  (I was wrong earlier when I said, constructor is called on each
  invocation
  of reload() method from jconsole. sorry about that. i was lill
  confused.)
 
  MBean is never re-created. It is created only once and registered
 only
  once.
 
  actual flow is:
 
  click reload() on jconsole gui.
  *it causes constructor of MBeanImpl to run. (verified from logs.)*
  --
  *Wrong.
  pls disregard this statement.*
  calls reload() defined in MBeanImpl.
  calls DBManager.reload()
  inside DBManager.reload() it fails at InitialContext initContext =
 new
  InitialContext();
  the exception is  -  javax.naming.NoInitialContextException: Cannot
  instantiate class: org.apache.naming.java.javaURLContextFactory [Root
  exception is java.lang.ClassNotFoundException:
  org.apache.naming.java.javaURLContextFactory]
 
  OK, but what is the purpose of DBManager.reload()?
 
 
  p
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
  Hi Pid, Marry Christmas !!!
  Purpose of DBManager.reload() is to load some application specific data
  from DB. Pls don't consider reload() as reload of MBean.
  reload() can better be renamed as loadData().
 
  when I invoke reload() from jconsole my application is suppose to make
 a
  db
  connection and load app specific data from database.
 
  OK, so why not retain a reference to the DataSource that you're
  getting the connection from?
 
 
  p
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
  yes. thats one possible workaround. I followed similar approach and
  retailed reference of Context (which i used to get datasource during
  invocation from jconsole).
  This approach works.
  And as Konstantin earlier said it is because of different class loaders
  that I can't do new InitialContext() during invocation from 

Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread markt
Saravanan L saravan...@te-soft.com wrote:

Please find the server.xml attached.

The real problem is I dont know where to look at.
 -There are no error in logs or the linux sys logs.
 - I cannot diagnose as the connector(443) does not even connect.

Of course you can diagnose this further. netstat and a thread dump would be a 
good place to start.

Mark


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



Re: High memory consumption caused by BLOCKED Threads

2011-12-27 Thread Antonio Vidal Ferrer

Violeta:

We had issues once with date objects (same behavior you describe), and 
was caused because one of the objects is working as serialized. If your 
app has a lot of requests, then all of them will have to wait 
serialization, generating a lot of memory and resources consumption. May 
be this is not your case, but I recommend you to double check that, may 
be you can save a lot of profiling time.


Best,

Antonio Vidal Ferrer
Responsable Departamento Middleware
Globalia Sistemas y Comunicaciones SLU
T. 971.178.464
M. 647.995.481
mailto:antonio.vi...@globalia-sistemas.com


On 12/22/2011 10:05 AM, Violeta Georgieva wrote:

Hi,

I am using Tomcat 6.0.29 and SUN JVM.
I experience high memory consumption caused by BLOCKED Threads.

I would appreciate any help or suggestion how to solve the problem.

I can see the following in the thread dump:


http-8080-73 daemon prio=10 tid=0x7ff9a4586000 nid=0x7d3 waiting for
monitor entry [0x7ff9996d4000]

java.lang.Thread.State: BLOCKED (on object monitor)

at
sun.util.resources.TimeZoneNames.getContents(TimeZoneNames.java:185)

at
sun.util.resources.OpenListResourceBundle.loadLookup(OpenListResourceBundle.java:109)

- locked0x0006f95a49b8  (a
sun.util.resources.TimeZoneNames)

at
sun.util.resources.OpenListResourceBundle.loadLookupTablesIfNecessary(OpenListResourceBundle.java:97)

at
sun.util.resources.OpenListResourceBundle.handleGetObject(OpenListResourceBundle.java:58)

at
sun.util.resources.TimeZoneNamesBundle.handleGetObject(TimeZoneNamesBundle.java:59)

at
java.util.ResourceBundle.getObject(ResourceBundle.java:368)

at
java.util.ResourceBundle.getObject(ResourceBundle.java:371)

at
java.util.ResourceBundle.getStringArray(ResourceBundle.java:351)

at
sun.util.TimeZoneNameUtility.retrieveDisplayNames(TimeZoneNameUtility.java:100)

at
sun.util.TimeZoneNameUtility.retrieveDisplayNames(TimeZoneNameUtility.java:81)

at java.util.TimeZone.getDisplayNames(TimeZone.java:399)

at java.util.TimeZone.getDisplayName(TimeZone.java:350)

at
java.text.SimpleDateFormat.subFormat(SimpleDateFormat.java:1110)

at
java.text.SimpleDateFormat.format(SimpleDateFormat.java:899)

at
java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)

at java.text.DateFormat.format(DateFormat.java:316)

at
org.apache.tomcat.util.http.FastHttpDateFormat.getCurrentDate(FastHttpDateFormat.java:115)

- locked0x0006fbd04ee8  (a java.text.SimpleDateFormat)

at
org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Processor.java:1606)

at
org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:956)

at org.apache.coyote.Response.action(Response.java:183)

at org.apache.coyote.Response.sendHeaders(Response.java:379)

at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)

at
org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273)

at
org.apache.catalina.connector.Response.finishResponse(Response.java:493)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:322)

at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

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



Line 2485 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2536 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2625 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2660 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2703 :  - locked0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2741 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2758 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2775 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2792 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2848 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2865 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2891 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2908 :  - waiting to lock0x0006fbd04ee8  (a
java.text.SimpleDateFormat)

Line 2925 :  

Re: ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Pid *
On 27 Dec 2011, at 12:53, Denis Ivanov denis.iva...@live.com wrote:


 Hey, I have an Amazon Enterprise Linux (EC2) version 
 2.6.35.11-83.9.amzn1.i686 (architecture i386) with Java JM version 
 1.6.0_20-b20 (Vendor Sun Microsystems Inc.) and Apache Tomcat version 7.0.19 
 with Catalina.
 I'm trying to deploy GlobziWebApplication.war and it was working a few days 
 ago but now it gives me error 404 when I try to access the web service and 
 logs/catalina.out says
 Error deploying web application archive GlobziWebApplication.war 
 org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid constant 
 pool reference: 12034. Constant pool size is: 1486
 And then it lists a bunch of instances where this occurs, like at 
 org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).
 What is Invalid constant pool reference?
 GlobziWebApplication.war was compiled using NetBeans 7.0.1.
 Help me fix this.

Please.

 Thanks.

Are you compiling in netbeans against a different version of Tomcat?

Can you use the latest version?


p

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



Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Mark Thomas
On 27/12/2011 08:55, Saravanan L wrote:
 Tried netstat. 443 is listening, but I cannot connect to it.

I assume it shows no open connections either.

 Secondly Thread dump - I could not find any signs of problem or anything
 relative to the current issue in the threaddump [Please find the
 threaddump in my previous post].

Yep, that looks like 200 idle threads to me.


Looking back through this thread I see a number of most likely unrelated
issues being treated as the same problem.

Reviewing the thread:

1. acceptCount=1 is a crazily high number. That you see odd effects
with this does not surprise me. acceptCount is only for handling
infrequent, short, very high spikes in load.

2. maxThreads=5000 is very high. Given that you handled ~10k requests in
2 hours it appears that maxThreads should be reduced by several orders
of magnitude.

3. A 504 response code is a gateway timeout. Tomcat does not issue this
on its own. Either you have a proxy in front of Tomcat or your
application is returning this value.

4. There are settings in your server.xml that were dropped a couple of
versions ago.


I suggest the following:
- restore the threadpool and acceptcount defaults
- remove the old settings


Run your tests and then diagnose the fault that appears. If you need
pointers, ask here.


Mark

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



Re: MBean InitialContext() Tomcat query- pls help

2011-12-27 Thread S B
On Tue, Dec 27, 2011 at 4:53 PM, Pid * p...@pidster.com wrote:

 On 27 Dec 2011, at 11:16, S B sbl...@gmail.com wrote:

  On Tue, Dec 27, 2011 at 4:06 PM, Pid * p...@pidster.com wrote:
 
  On 27 Dec 2011, at 01:33, S B sbl...@gmail.com wrote:
 
  On Mon, Dec 26, 2011 at 3:28 PM, Pid * p...@pidster.com wrote:
 
  On 26 Dec 2011, at 09:50, S B sbl...@gmail.com wrote:
 
  On Sat, Dec 24, 2011 at 6:29 PM, Pid p...@pidster.com wrote:
 
  On 23/12/2011 04:57, S B wrote:
  On Thu, Dec 22, 2011 at 8:49 PM, Pid p...@pidster.com wrote:
 
  On 22/12/2011 10:34, Konstantin Kolinko wrote:
  2011/12/20 S B sbl...@gmail.com:
  Hi,
 
  I created and deployed an MBean in my tomcat. It uses datasource
  to
  connect
  to DB.
 
  My questions is:
 
  When I create InitialContext() inside MBean's constructor and
 pass
  the
  envContext to DBManager class to lookup datasource it works
 fine.
  However
  when I create InitialContext() in DBManager  class, it fails.
 
  IIRC what InitialContext() sees as its environment highly depends
  on
  what classloader is active. That is TCCL =
  Thread.getContextClassLoader().
 
  So while it is run from within web application your TCCL = your
  webapp's classloader.
 
  When it is invoked from jconsole it might be a separate Thread,
 not
  related to your web application.
 
 
  Like he ^^^ said.  :)
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi Pid/Konstantin,
 
  yes you are right. I just verified it. When it is invoked from
  jconsole,
  the classloader is: sun.misc.Launcher$AppClassLoader@61e63e3d
  and when it is run within a web application the clasloader is
  WebAppClassloader.
 
  So, how can I force it to use webapp classloader during new
  InitialContext() while invoking from jconsole
  One possible way is to reuse the initialContext created during
 server
  startup. (pass it as param during invocation from jconsole).
 
  Is there a smarter way ??
 
  I am a bit concerned about how you are registering the bean inside
 the
  bean's own constructor.  I am not clear on how you are subsequently
  unregistering that bean, before the reloading operation - and I am
 not
  at all clear what the purpose of reloading is anyway.
 
  Is there a reason that the MBean itself needs to be recreated?
 
  Bear in mind that you are attempting to re-initialise the MBean,
 while
  you are still using it.  This does not seem like a good idea to me.
 
  I would suggest that you either have a separate Manager MBean that
  does
  the reloading, or just have the reload method call the actual code
 on
  the DB, without re-initialising the bean.
 
 
  p
 
 
  --
 
  [key:62590808]
 
 
  Hi,
 
  un-registering of mbean doesn't happen until servlet's destroy method
  is
  called.
  Actually, registration of bean happen only once, ie during server
  startup.
  This time mbean's constructor is called and it is registered with
 MBean
  server.
  (I was wrong earlier when I said, constructor is called on each
  invocation
  of reload() method from jconsole. sorry about that. i was lill
  confused.)
 
  MBean is never re-created. It is created only once and registered
 only
  once.
 
  actual flow is:
 
  click reload() on jconsole gui.
  *it causes constructor of MBeanImpl to run. (verified from logs.)*
  --
  *Wrong.
  pls disregard this statement.*
  calls reload() defined in MBeanImpl.
  calls DBManager.reload()
  inside DBManager.reload() it fails at InitialContext initContext =
 new
  InitialContext();
  the exception is  -  javax.naming.NoInitialContextException: Cannot
  instantiate class: org.apache.naming.java.javaURLContextFactory [Root
  exception is java.lang.ClassNotFoundException:
  org.apache.naming.java.javaURLContextFactory]
 
  OK, but what is the purpose of DBManager.reload()?
 
 
  p
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
  Hi Pid, Marry Christmas !!!
  Purpose of DBManager.reload() is to load some application specific data
  from DB. Pls don't consider reload() as reload of MBean.
  reload() can better be renamed as loadData().
 
  when I invoke reload() from jconsole my application is suppose to make
 a
  db
  connection and load app specific data from database.
 
  OK, so why not retain a reference to the DataSource that you're
  getting the connection from?
 
 
  p
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
  yes. thats one possible workaround. I followed similar approach and
  retailed reference of Context (which i used to get datasource during
  invocation from jconsole).
  This approach works.
  And as Konstantin earlier said it is because of different class loaders
  that I can't do new InitialContext() during invocation from jconsole.
  *My question is:  how 

Re: Tomcat 6.0.35 : Cluster and new node

2011-12-27 Thread Cédric SAMSON

Ok thanks for the informations :D

Le 27/12/2011 14:39, Pid * a écrit :

On 27 Dec 2011, at 12:07, Cédric SAMSONcedric.sam...@adeuxi.com  wrote:


Yes I tried and it works fine, but I just want all is automatic.

FarmWarDeployer doesn't do that.
It is a push mechanism rather than a repository of applications queued
for deployment.


p



I mean, a machine crash, we have to change it.
The new machine has :

1. the same IP
2. the same name
3. the same tomcat configuration (but without the war files already
   deployed)

as the previous machine (in order to not restart the load balancer and
not interrupt the service).

The best for me is that all the war in the watchdir of the master node
(the one with watchEnabled=true ) are deployed in this new machine
because the contexts don't yet exist on this node.
It's only for machine replacement purpose.

For a real new node, we are force to reboot the cluster after
declaring the new node in the balancer.

Thanks for helping

Le 27/12/2011 12:09, Pid * a écrit :

On 26 Dec 2011, at 14:33, Cédric SAMSONcedric.sam...@adeuxi.com   wrote:


Hi all,


Context :
  I have a cluster with 2 nodes (both on linux).

  * The master node is configured as below : *

Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/

Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
channelSendOptions=8

Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

Channel className=org.apache.catalina.tribes.group.GroupChannel

Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.51
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport 
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/
/Channel
Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= 
statistics=true/
Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/

Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
tempDir=/usr/local/tomcat/webapps/tempdir
deployDir=/usr/local/tomcat/webapps/
watchDir=/usr/local/tomcat/watchdir/
watchEnabled=true/

ClusterListener 
className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
ClusterListener 
className=org.apache.catalina.ha.session.ClusterSessionListener/

/Cluster

/Host
/Engine

  * The slave node is configured as below : *

The term 'slave' is an odd one to use here.



Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/

Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
channelSendOptions=8

Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

Channel className=org.apache.catalina.tribes.group.GroupChannel

Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.54
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport 
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/

Re: Tomcat 6.0.35 : Cluster and new node

2011-12-27 Thread Pid *
On 26 Dec 2011, at 14:33, Cédric SAMSON cedric.sam...@adeuxi.com wrote:

 Hi all,


 Context :
  I have a cluster with 2 nodes (both on linux).

  * The master node is configured as below : *

 Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
 Realm className=org.apache.catalina.realm.UserDatabaseRealm 
 resourceName=UserDatabase/

 Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
 channelSendOptions=8

 Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

 Channel className=org.apache.catalina.tribes.group.GroupChannel

 Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
 Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.51
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

 Sender 
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
 Transport 
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
 /Sender
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/
 /Channel
 Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= 
 statistics=true/
 Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/

 Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
tempDir=/usr/local/tomcat/webapps/tempdir
deployDir=/usr/local/tomcat/webapps/
watchDir=/usr/local/tomcat/watchdir/
watchEnabled=true/

 ClusterListener 
 className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
 ClusterListener 
 className=org.apache.catalina.ha.session.ClusterSessionListener/

 /Cluster

 /Host
 /Engine

  * The slave node is configured as below : *

The term 'slave' is an odd one to use here.


 Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
 Realm className=org.apache.catalina.realm.UserDatabaseRealm 
 resourceName=UserDatabase/

 Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
 channelSendOptions=8

 Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

 Channel className=org.apache.catalina.tribes.group.GroupChannel

 Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
 Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.54
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

 Sender 
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
 Transport 
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
 /Sender
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/
 /Channel
 Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= 
 statistics=true/
 Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/

 Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
tempDir=/usr/local/tomcat/webapps/tempdir
deployDir=/usr/local/tomcat/webapps/
watchDir=/usr/local/tomcat/watchdir/
watchEnabled=false/

 ClusterListener 
 className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
 ClusterListener 
 className=org.apache.catalina.ha.session.ClusterSessionListener/

 /Cluster

 /Host
 /Engine

 All works fine.

 I try 

Re: Multiple contexts within a single host not being loaded correctly upon Tomcat restart.?

2011-12-27 Thread Pid *
On 27 Dec 2011, at 13:19, Konstantin Kolinko knst.koli...@gmail.com wrote:

 2011/12/27 Edwards, Dominic dominic.edwa...@logica.com:


 Platform Details:
 -
 Tomcat 5.5.28

 Old..
 And 5.5.x branch as a whole is EOL in less than a year.

 Operating System: RedHat Enterprise 5


 Problem
 ---

 Tomcat appears to be mismanaging my web contexts after a restart. It happens 
 only sometimes and not others.

 I have the following context records in my server.xml:

 Host name=mysite.com appBase=/home/myaccount/public_html/mysite.com

This appBase path, above...


 unpackWARs=true autoDeploy=true xmlValidation=false 
 xmlNamespaceAware=false

 deployOnStartup=true
 Aliaswww.mysite.com/Alias

 Context path= reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

... is the same as the docBase path, above and...



 Context elements in server.xml are explicitly discouraged. The
 recommended practice is to place them into separate XML files.

 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context

 Context path=/cms reloadable=true 
 docBase=/home/myaccount/public_html/mysite.com crossContext=true

... Is the same as this docBase path here too.

Is this exactly as you have it, or is it a typo?

If it is accurate it is a thoroughly broken configuration and will
mean that every directory in there is deployed as an application.


p


 If you configure a docBase explicitly, it MUST be outside of appBase.
 Your configuration is broken because of it.

 context-param
  param-nameSharedSessiondataContext/param-name
  param-value/cms/param-value
/context-param
/Context
 /Host

 This represents my website and a CMS for the website, the cms being in a 
 subdirectory of the main website's root directory. Before you ask the 
 configuration was originally

 designed to enable the sharing of session object data between the two 
 contexts.

 The problem is that sometimes when Tomcat is restarted these contexts are 
 confused. At other times the restart does not encounter the problem which is 
 why the cause remains a

 mystery to me that I hope someone can help with.



 Symptoms
 

 If I visit the CMS URL

 http://www.mysite.com/cms/ (web page is /www/mysite.com/cms/index.jsp)

 I see the webpage I would expect to see when I visit

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 If I visit the main URL

 http://www.mysite.com/ (web page is /www/mysite.com/index.jsp)

 I see the main site just as I would expect so it appears sometimes both 
 contexts are pointing to the same URL.




 Has anyone ever experienced this kind of irregular behaviour or know what 
 might be the cause? As I say this happens from time to time - sometimes and 
 not others even though

 Tomcat starts up with the same configuration.


 -
 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 HTTPS Connector Stops working after an hour

2011-12-27 Thread Pid *
On 27 Dec 2011, at 10:48, Saravanan L saravan...@te-soft.com wrote:

 3. A 504 response code is a gateway timeout. Tomcat does not issue this
 on its own. Either you have a proxy in front of Tomcat or your
 application is returning this value.

 A. Yes the proxy relayed this message,  it seems the tomcat did not respond 
 with any message at all.

 looks like 200 idle threads to me.

 In comet idle threads are fine rights.

Idle threads do not inherently represent a problem with any of the
Connectors. It just means they have no work to do.


 Thats how comet/nio works right. Please correct me on this.

I don't know what you mean by this.

When you stop getting responses are you still connecting via a proxy
or directly to Tomcat?

Is the previous thread dump taken shortly after Tomcat stopped
responding, or before?


p


 On 12/27/2011 4:03 PM, Mark Thomas wrote:
 On 27/12/2011 08:55, Saravanan L wrote:
 Tried netstat. 443 is listening, but I cannot connect to it.
 I assume it shows no open connections either.

 Secondly Thread dump - I could not find any signs of problem or anything
 relative to the current issue in the threaddump [Please find the
 threaddump in my previous post].
 Yep, that looks like 200 idle threads to me.


 Looking back through this thread I see a number of most likely unrelated
 issues being treated as the same problem.

 Reviewing the thread:

 1. acceptCount=1 is a crazily high number. That you see odd effects
 with this does not surprise me. acceptCount is only for handling
 infrequent, short, very high spikes in load.

 2. maxThreads=5000 is very high. Given that you handled ~10k requests in
 2 hours it appears that maxThreads should be reduced by several orders
 of magnitude.

 3. A 504 response code is a gateway timeout. Tomcat does not issue this
 on its own. Either you have a proxy in front of Tomcat or your
 application is returning this value.

 4. There are settings in your server.xml that were dropped a couple of
 versions ago.


 I suggest the following:
 - restore the threadpool and acceptcount defaults
 - remove the old settings


 Run your tests and then diagnose the fault that appears. If you need
 pointers, ask here.


 Mark

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




 --
 Regards
 *Saravanan.L*

 This message and any attachment(s) contained here are information that is 
 confidential, proprietary to TE Software Services and its customers. Contents 
 may be privileged or otherwise protected by law. The information is solely 
 intended for the individual or the entity it is addressed to. If you are not 
 the intended recipient of this message, you are not authorized to read, 
 forward, print, retain, copy or disseminate this message or any part of it. 
 If you have received this e-mail in error, please notify the sender 
 immediately by return e-mail and delete it from your computer.

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



Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Saravanan L

Tried netstat. 443 is listening, but I cannot connect to it.

Secondly Thread dump - I could not find any signs of problem or anything 
relative to the current issue in the threaddump [Please find the 
threaddump in my previous post].


On 12/27/2011 2:11 PM, ma...@apache.org wrote:

Saravanan Lsaravan...@te-soft.com  wrote:


Please find the server.xml attached.

The real problem is I dont know where to look at.
 -There are no error in logs or the linux sys logs.
 - I cannot diagnose as the connector(443) does not even connect.

Of course you can diagnose this further. netstat and a thread dump would be a 
good place to start.

Mark


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





--
Regards
*Saravanan.L*

This message and any attachment(s) contained here are information that is 
confidential, proprietary to TE Software Services and its customers. Contents 
may be privileged or otherwise protected by law. The information is solely 
intended for the individual or the entity it is addressed to. If you are not 
the intended recipient of this message, you are not authorized to read, 
forward, print, retain, copy or disseminate this message or any part of it. If 
you have received this e-mail in error, please notify the sender immediately by 
return e-mail and delete it from your computer.

Re: Tomcat 6.0.35 : Cluster and new node

2011-12-27 Thread Pid *
On 27 Dec 2011, at 12:07, Cédric SAMSON cedric.sam...@adeuxi.com wrote:

 Yes I tried and it works fine, but I just want all is automatic.

FarmWarDeployer doesn't do that.
It is a push mechanism rather than a repository of applications queued
for deployment.


p


 I mean, a machine crash, we have to change it.
 The new machine has :

 1. the same IP
 2. the same name
 3. the same tomcat configuration (but without the war files already
   deployed)

 as the previous machine (in order to not restart the load balancer and
 not interrupt the service).

 The best for me is that all the war in the watchdir of the master node
 (the one with watchEnabled=true ) are deployed in this new machine
 because the contexts don't yet exist on this node.
 It's only for machine replacement purpose.

 For a real new node, we are force to reboot the cluster after
 declaring the new node in the balancer.

 Thanks for helping

 Le 27/12/2011 12:09, Pid * a écrit :
 On 26 Dec 2011, at 14:33, Cédric SAMSONcedric.sam...@adeuxi.com  wrote:

 Hi all,


 Context :
  I have a cluster with 2 nodes (both on linux).

  * The master node is configured as below : *

 Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
 Realm className=org.apache.catalina.realm.UserDatabaseRealm 
 resourceName=UserDatabase/

 Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
 channelSendOptions=8

 Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

 Channel className=org.apache.catalina.tribes.group.GroupChannel

 Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
 Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.51
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

 Sender 
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
 Transport 
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
 /Sender
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
 Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/
 /Channel
 Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= 
 statistics=true/
 Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/

 Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
tempDir=/usr/local/tomcat/webapps/tempdir
deployDir=/usr/local/tomcat/webapps/
watchDir=/usr/local/tomcat/watchdir/
watchEnabled=true/

 ClusterListener 
 className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
 ClusterListener 
 className=org.apache.catalina.ha.session.ClusterSessionListener/

 /Cluster

 /Host
 /Engine

  * The slave node is configured as below : *
 The term 'slave' is an odd one to use here.


 Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
 Realm className=org.apache.catalina.realm.UserDatabaseRealm 
 resourceName=UserDatabase/

 Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
 channelSendOptions=8

 Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

 Channel className=org.apache.catalina.tribes.group.GroupChannel

 Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
 Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.54
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

 Sender 
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
 Transport 
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
 /Sender
 

Re: Tomcat 6.0.35 : Cluster and new node

2011-12-27 Thread Cédric SAMSON

Yes I tried and it works fine, but I just want all is automatic.

I mean, a machine crash, we have to change it.
The new machine has :

1. the same IP
2. the same name
3. the same tomcat configuration (but without the war files already
   deployed)

as the previous machine (in order to not restart the load balancer and 
not interrupt the service).


The best for me is that all the war in the watchdir of the master node 
(the one with watchEnabled=true ) are deployed in this new machine 
because the contexts don't yet exist on this node.

It's only for machine replacement purpose.

For a real new node, we are force to reboot the cluster after 
declaring the new node in the balancer.


Thanks for helping

Le 27/12/2011 12:09, Pid * a écrit :

On 26 Dec 2011, at 14:33, Cédric SAMSONcedric.sam...@adeuxi.com  wrote:


Hi all,


Context :
  I have a cluster with 2 nodes (both on linux).

  * The master node is configured as below : *

Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/

Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
channelSendOptions=8

Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

Channel className=org.apache.catalina.tribes.group.GroupChannel

Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.51
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport 
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/
/Channel
Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter= 
statistics=true/
Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve/

Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
tempDir=/usr/local/tomcat/webapps/tempdir
deployDir=/usr/local/tomcat/webapps/
watchDir=/usr/local/tomcat/watchdir/
watchEnabled=true/

ClusterListener 
className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
ClusterListener 
className=org.apache.catalina.ha.session.ClusterSessionListener/

/Cluster

/Host
/Engine

  * The slave node is configured as below : *

The term 'slave' is an odd one to use here.



Engine name=Catalina defaultHost=localhost jvmRoute=Tomcat-1
Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/

Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster 
channelSendOptions=8

Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyContainerListenersOnReplication=true
   notifySessionListenersOnReplication=true
   notifyListenersOnReplication=true/

Channel className=org.apache.catalina.tribes.group.GroupChannel

Membership className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.3
port=45566
frequency=500
dropTime=3000/
Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver
  address=192.168.30.54
  port=3100
  autoBind=100
  selectorTimeout=5000
  maxThreads=6/

Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport 
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
Interceptor 

Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Mark Thomas
On 27/12/2011 10:47, Saravanan L wrote:
 3. A 504 response code is a gateway timeout. Tomcat does not issue this
 on its own. Either you have a proxy in front of Tomcat or your
 application is returning this value.
 
 A. Yes the proxy relayed this message,  it seems the tomcat did not
 respond with any message at all.

Which is the first mention in this thread that you are accessing Tomcat
via a proxy which makes most of the previous contents of this thread
null and void.

I think you need to start again with a more complete description of how
your system is configured. This is look less and less like a Tomcat
issue and more and more like a poorly configured proxy.

Mark

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



Re: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread Pid *
On 27 Dec 2011, at 15:43, David Hoffer dhoff...@gmail.com wrote:

 I just installed Tomcat 7.0.23 using Windows 64 bit installer and
 deployed a couple apps via the manager application, however when I run
 them I get HTTP Status 404 errors.  However I see that I get the same
 error for the standard default apps, docs, examples, etc.  The only
 URL that works is http://IP:8080/manager/html.

 In the log I see:
 Dec 27, 2011 3:28:29 PM org.apache.catalina.core.StandardHostValve custom
 SEVERE: Exception Processing ErrorPage[errorCode=404,
 location=/WEB-INF/jsp/404.jsp]
 java.lang.NullPointerException

What about before that during startup?


p



at 
 org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)
at 
 org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:324)
at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:193)
at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at 
 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

 What do I have to do to enable the apps?

 -
 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: ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Pid *
On 27 Dec 2011, at 14:15, Denis Ivanov denis.iva...@live.com wrote:


 It was working fine before (Tomcat 7.0.23 on my laptop and 7.0.19 on the 
 server).
 Is there some way to upgrade while preserving the web app configuration?

 From: p...@pidster.com
 Date: Tue, 27 Dec 2011 13:49:39 +
 Subject: Re: ClassFormatException: Invalid constant pool reference
 To: users@tomcat.apache.org

 On 27 Dec 2011, at 12:53, Denis Ivanov denis.iva...@live.com wrote:


 Hey, I have an Amazon Enterprise Linux (EC2) version 
 2.6.35.11-83.9.amzn1.i686 (architecture i386) with Java JM version 
 1.6.0_20-b20 (Vendor Sun Microsystems Inc.) and Apache Tomcat version 
 7.0.19 with Catalina.
 I'm trying to deploy GlobziWebApplication.war and it was working a few days 
 ago but now it gives me error 404 when I try to access the web service and 
 logs/catalina.out says
 Error deploying web application archive GlobziWebApplication.war 
 org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid 
 constant pool reference: 12034. Constant pool size is: 1486
 And then it lists a bunch of instances where this occurs, like at 
 org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).
 What is Invalid constant pool reference?
 GlobziWebApplication.war was compiled using NetBeans 7.0.1.
 Help me fix this.

 Please.

 Thanks.

 Are you compiling in netbeans against a different version of Tomcat?

 Can you use the latest version?

Please post your answers below the questions to maintain the order of
the conversation.

It was working fine before what?

Are you compiling the JSPs?


p





 p

 -
 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: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread David Hoffer
No errors are reported at start up, here is the catalina log.

2011-12-27 17:57:07 Commons Daemon procrun stderr initialized
Dec 27, 2011 5:57:08 PM 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: C:\Program Files (x86)\Apache Software
Foundation\Tomcat
7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;;.
Dec 27, 2011 5:57:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [http-bio-8080]
Dec 27, 2011 5:57:08 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [ajp-bio-8009]
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 426 ms
Dec 27, 2011 5:57:08 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 27, 2011 5:57:08 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files
(x86)\Apache Software Foundation\Tomcat 7.0\webapps\docs
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.ContextConfig
getDefaultWebXmlFragment
INFO: No global web.xml found
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files
(x86)\Apache Software Foundation\Tomcat 7.0\webapps\examples
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files
(x86)\Apache Software Foundation\Tomcat 7.0\webapps\host-manager
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files
(x86)\Apache Software Foundation\Tomcat 7.0\webapps\manager
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files
(x86)\Apache Software Foundation\Tomcat 7.0\webapps\ROOT
Dec 27, 2011 5:57:08 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-bio-8080]
Dec 27, 2011 5:57:08 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-bio-8009]
Dec 27, 2011 5:57:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 416 ms

-Dave



On Tue, Dec 27, 2011 at 10:29 AM, Pid * p...@pidster.com wrote:
 On 27 Dec 2011, at 15:43, David Hoffer dhoff...@gmail.com wrote:

 I just installed Tomcat 7.0.23 using Windows 64 bit installer and
 deployed a couple apps via the manager application, however when I run
 them I get HTTP Status 404 errors.  However I see that I get the same
 error for the standard default apps, docs, examples, etc.  The only
 URL that works is http://IP:8080/manager/html.

 In the log I see:
 Dec 27, 2011 3:28:29 PM org.apache.catalina.core.StandardHostValve custom
 SEVERE: Exception Processing ErrorPage[errorCode=404,
 location=/WEB-INF/jsp/404.jsp]
 java.lang.NullPointerException

 What about before that during startup?


 p



    at 
 org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)
    at 
 org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:324)
    at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:193)
    at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
    at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at 
 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 What do I have to do to enable the apps?

 -
 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


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

Re: tomcat7 maven plugin (frustration) - probably a simple question

2011-12-27 Thread Patrick Moore
O.k. I will try today


Re: Odd NIO connector behavior

2011-12-27 Thread Mark Thomas
On 25/12/2011 02:17, Matthew Tyson wrote:

 INFO  2011-12-24 10:25:35,578 COMET  REQUEST: 75.149.42.46  POST  null |
 TRACE:
 java.lang.Throwable
 at org.cometd.server.CometdServlet.service(CometdServlet.java:149)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at
 com.company.util.filter.MonitoringFilter.doFilter(MonitoringFilter.java:47)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
 at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
 at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at
 com.company.util.tomcat.SecureProxyValve.invoke(SecureProxyValve.java:57)
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 at
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
 at
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
 at
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1571)
  at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)

That all looks pretty normal. What I am wondering now, is what is
calling NioEndpoint.processSocket()

I'd suggest if at all possible, setting up your Tomcat instance to allow
remote debugging and then once the instance gets into this state check
what is calling that code. It gets called far too often to output a
stack trace every call during normal operation.

 2. How comfortable are you patching Tomcat and building it from source?
 I have some debug logging sat in a git branch that I use for debugging
 similar issues that will generate a lot of logging but show exactly what
 is happening. I can either provide you with the patch or an updated JAR
 (or JARs) that you can drop into a 7.0.23 instance.

 Does the stack trace shed any light?  If not, I can try the JAR or the git
 branch.

I'm not sure my debug code is in the right place for this. If the
debugging above isn't possible then patching Tomcat may be the only
option. It sounds like you know enough of what you are doing to just
patch it if required (noting that any such patch will generate a lot of
output in normal running) but feel free to ask here if I have misjudged
things.


 I noticed in the stack trace our custom valve.  Its a very simple valve
 that just checks what port a request came in on and sets a flag on the
 request object:
 
  public void invoke(Request req, Response resp) throws IOException,
 ServletException {
 
 if (req.getLocalPort() == secureProxyPort) {
 req.setSecure(true);
 req.setServerPort(serverPort);
 }
 
 if (getNext() != null) {
 getNext().invoke(req, resp);
 }
 }
 
 I disabled the valve, and so far, the repeating requests have stopped.  (I
 should mention that asyncSupported is true on this valve).
 
 Any thoughts on why this would cause this problem?

Strange. I don't see anything wrong with that but if there is a
threading problem at the bottom of this, the timing change this creates
may be enough to trigger whatever the problem is.

Mark

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



Re: Security Constraints With URL Rewrite filter

2011-12-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jerry,

On 12/26/11 5:26 PM, Jerry Malcolm wrote:
 Half of the site is protected, and the other half is not, and some
 pages have moved from unprotected to protected at the whim of the
 client.  The client has simply stated clean URLs.  I have argued
 that point, and lost.  So independent of valid substantiation for
 the requirement, it is what it is, and I'm not getting paid for
 arguing that point.

But you will be paid for making these changes. Why not tell the client
that this SEO optimization is going to cost them a whole bunch of
money to actually perform?

You may just have to suck it up and do the painful work of either
mapping everything or re-jiggering everything to read REST-looking
URLs instead of ones with complex query strings.

 I know there are solutions. But every one ends up being baling wire
 and duct tape.  All I want to do is take URL-A and change it to
 URL-B and have it look to all of Tomcat like it came in as URL-B
 from the user.  I know that is basically httpd mod_rewrite.  But as
 I stated earlier, I have some dynamic database-related mappings.  I
 know little about mod_rewrite.  Is there any way to do Apache
 mod_rewrite with a java application?

There is a url-rewrite tool, but it's filter-based and will have the
same shortcomings of your own solutions up till this point. The
dynamic database-related mappings are going to kill you, here.

Occasionally, people ask about using Tomcat as an httpd proxy, the the
response has always been other tools do it quite well, so Tomcat
doesn't have to and the issue generally drops. On-the-fly
programmable rewrites aren't something I'm aware of.

You might find that mod_proxy_http can be configured to follow
(certain) redirects internally, so you can have your redirection-logic
in your Tomcat-based webapp, but the client never actually sees the
redirect. That would be very convenient.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk76HuwACgkQ9CaO5/Lv0PCwKgCeNLen0L4WRKmO3JYZpcX2s+Lm
mR0AnR+WXGLgBnf4naOWZhhf2yRsm8Zd
=482h
-END PGP SIGNATURE-

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



RE: ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Denis Ivanov



 From: p...@pidster.com
 Date: Tue, 27 Dec 2011 17:34:16 +
 Subject: Re: ClassFormatException: Invalid constant pool reference
 To: users@tomcat.apache.org
 
 On 27 Dec 2011, at 14:15, Denis Ivanov denis.iva...@live.com wrote:
 
 
  It was working fine before (Tomcat 7.0.23 on my laptop and 7.0.19 on the 
  server).
  Is there some way to upgrade while preserving the web app configuration?
 
  From: p...@pidster.com
  Date: Tue, 27 Dec 2011 13:49:39 +
  Subject: Re: ClassFormatException: Invalid constant pool reference
  To: users@tomcat.apache.org
 
  On 27 Dec 2011, at 12:53, Denis Ivanov denis.iva...@live.com wrote:
 
 
  Hey, I have an Amazon Enterprise Linux (EC2) version 
  2.6.35.11-83.9.amzn1.i686 (architecture i386) with Java JM version 
  1.6.0_20-b20 (Vendor Sun Microsystems Inc.) and Apache Tomcat version 
  7.0.19 with Catalina.
  I'm trying to deploy GlobziWebApplication.war and it was working a few 
  days ago but now it gives me error 404 when I try to access the web 
  service and logs/catalina.out says
  Error deploying web application archive GlobziWebApplication.war 
  org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid 
  constant pool reference: 12034. Constant pool size is: 1486
  And then it lists a bunch of instances where this occurs, like at 
  org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).
  What is Invalid constant pool reference?
  GlobziWebApplication.war was compiled using NetBeans 7.0.1.
  Help me fix this.
 
  Please.
 
  Thanks.
 
  Are you compiling in netbeans against a different version of Tomcat?
 
  Can you use the latest version?
 
 Please post your answers below the questions to maintain the order of
 the conversation.
 
 It was working fine before what?
It was working fine a few days ago. I don't know what changed.
My laptop has Tomcat 7.0.23 and the server has 7.0.19.
 
 Are you compiling the JSPs?
JSPs? I'm compiling .java files into a .war.
 
 
 p
 
 
 
 
 
  p
 
  -
  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: Odd NIO connector behavior

2011-12-27 Thread Matthew Tyson
On Tue, Dec 27, 2011 at 11:11 AM, Mark Thomas ma...@apache.org wrote:

 On 25/12/2011 02:17, Matthew Tyson wrote:

  INFO  2011-12-24 10:25:35,578 COMET  REQUEST: 75.149.42.46  POST  null |
  TRACE:
  java.lang.Throwable
  at
 org.cometd.server.CometdServlet.service(CometdServlet.java:149)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 
 com.company.util.filter.MonitoringFilter.doFilter(MonitoringFilter.java:47)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
  at
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
  at
 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
  at
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
  at
 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
  at
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at
 
 com.company.util.tomcat.SecureProxyValve.invoke(SecureProxyValve.java:57)
  at
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
  at
 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
  at
 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
  at
 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1571)
   at
 
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
  at
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
  at java.lang.Thread.run(Thread.java:662)

 That all looks pretty normal. What I am wondering now, is what is
 calling NioEndpoint.processSocket()

 I'd suggest if at all possible, setting up your Tomcat instance to allow
 remote debugging and then once the instance gets into this state check
 what is calling that code. It gets called far too often to output a
 stack trace every call during normal operation.

  2. How comfortable are you patching Tomcat and building it from source?
  I have some debug logging sat in a git branch that I use for debugging
  similar issues that will generate a lot of logging but show exactly
 what
  is happening. I can either provide you with the patch or an updated JAR
  (or JARs) that you can drop into a 7.0.23 instance.
 
  Does the stack trace shed any light?  If not, I can try the JAR or the
 git
  branch.

 I'm not sure my debug code is in the right place for this. If the
 debugging above isn't possible then patching Tomcat may be the only
 option. It sounds like you know enough of what you are doing to just
 patch it if required (noting that any such patch will generate a lot of
 output in normal running) but feel free to ask here if I have misjudged
 things.


  I noticed in the stack trace our custom valve.  Its a very simple valve
  that just checks what port a request came in on and sets a flag on the
  request object:
 
   public void invoke(Request req, Response resp) throws IOException,
  ServletException {
 
  if (req.getLocalPort() == secureProxyPort) {
  req.setSecure(true);
  req.setServerPort(serverPort);
  }
 
  if (getNext() != null) {
  getNext().invoke(req, resp);
  }
  }
 
  I disabled the valve, and so far, the repeating requests have stopped.
  (I
  should mention that asyncSupported is true on this valve).
 
  Any thoughts on why this would cause this problem?

 Strange. I don't see anything wrong with that but if there is a
 threading problem at the bottom of this, the timing change this creates
 may be enough to trigger whatever the problem is.

 Mark

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



Although removing the Valve seems to have prevented the ghost requests, I
still see issues.  I often see requests come in that then get an empty 200
response sent back, but the service method is never executed in the servlet
(the logging statement never outputs).

For instance, here is output from ngrep:

T clientIP:33517 - serverIP:8080 [A]
  GET

Re: [OT] ClassFormatException: Invalid constant pool reference

2011-12-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Denis,

On 12/27/11 7:53 AM, Denis Ivanov wrote:
 Hey, I have an Amazon Enterprise Linux (EC2) version 
 2.6.35.11-83.9.amzn1.i686 (architecture i386) with Java JM version 
 1.6.0_20-b20 (Vendor Sun Microsystems Inc.) and Apache Tomcat
 version 7.0.19 with Catalina.
 
 I'm trying to deploy GlobziWebApplication.war and it was working a 
 few days ago but now it gives me error 404 when I try to access
 the web service and logs/catalina.out says
 
 Error deploying web application archive GlobziWebApplication.war 
 org.apache.tomcat.util/.bcel.classfile.ClassFormatException:Invalid

 
constant pool reference: 12034. Constant pool size is: 1486

I wouldn't expect a ClassFormatException to return a 404. Are you sure
that the two are related?

Also, the above has a / in the package name which is illegal. Are
you sure you copy/pasted that properly?

 And then it lists a bunch of instances where this occurs, like at 
 org.apache.tomcat.util.bcel.classfile.ConstantPool.getConstant(ConstantPool.java:184).

This
 
is called a stack trace, and isn't a bunch of instances where it
occurs: it's a specific call trace that describes what the thread was
doing at the time the exception was thrown.

Can you post the full stack trace?

 What is Invalid constant pool reference?

It usually means that your class file is broken, but I can see that
you are using BCEL which probably means that you poking-around in a
class structure without using the usual Java reflection or
ClassLoading libraries. That can introduce all kinds of problems if
you aren't careful.

A stack trace will help narrow-down where this is happening. It's
possible that some of the annotation-processing that Tomcat does is
incorrect and that's why it's blowing up.

 GlobziWebApplication.war was compiled using NetBeans 7.0.1.

Were the classes in GlobizWebApplication.war compiled using NetBeans,
or only JARred-together using NetBeans?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk76PxkACgkQ9CaO5/Lv0PDvjQCePkbar+zEiv8H0cIBVY4z6PvJ
5oAAoLLXOxt7UX2Iuop0EUNLIDFBhGSc
=n8TZ
-END PGP SIGNATURE-

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



Re: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 12/27/11 10:42 AM, David Hoffer wrote:
 I just installed Tomcat 7.0.23 using Windows 64 bit installer and 
 deployed a couple apps via the manager application, however when I
 run them I get HTTP Status 404 errors.  However I see that I get
 the same error for the standard default apps, docs, examples, etc.
 The only URL that works is http://IP:8080/manager/html.
 
 In the log I see: Dec 27, 2011 3:28:29 PM
 org.apache.catalina.core.StandardHostValve custom SEVERE: Exception
 Processing ErrorPage[errorCode=404, location=/WEB-INF/jsp/404.jsp] 
 java.lang.NullPointerException at
 org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)

Is
 
that stack trace complete? It seems to indicate that
/WEB-INF/jsp/404.jsp is being invoked, but that JSP isn't actually
executing. The only thing I can think of is that the JSP can't be
found while processing an error (404?) and do you get this error as well.

Have you made any modifications to Tomcat other than enabling the
manager webapp and deploying some webapps onto it?

 What do I have to do to enable the apps?

Deployment ought to enable the apps. What does the manager show in
the list of deployed webapps?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk76R7QACgkQ9CaO5/Lv0PBjiQCgjCT7wt2tDxFEbJr0bgXTLRvu
zHkAnRMrr52g8R+Ggu3MAljah1i4dooK
=BW8D
-END PGP SIGNATURE-

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



Re: Odd NIO connector behavior

2011-12-27 Thread Matthew Tyson
On Tue, Dec 27, 2011 at 1:31 PM, Stefan Mayr ste...@mayr-stefan.de wrote:

 Am 24.12.2011 00:39, schrieb Matthew Tyson:

  Hello,

 We have been having quite a few problems with using long-polling
 connections in Tomcat, via the NIO connector.  Upgrading to Tomcat 7.0.23
 definitely improved things, but we are still seeing major issues.

 The problems only crop up after a couple minutes under some load (modest
 load, around 2-3 connections per second).

 One very clear problem I am looking at right now is that the service
 method
 on a servlet is continually being called, although there is no traffic
 coming into tomcat from that remote IP (we verified this at the ethernet
 device).

 The logging statement at the beginning of the service method is being
 executed every so often, like so:

 logger.info(REQUEST:  + request.getRemoteAddr() ++
 request.getMethod() ++ request.getQueryString());

 INFO  2011-12-23 15:30:50,860 org.cometd.server.**CometdServlet REQUEST:
 75.149.42.46  POST  null
 INFO  2011-12-23 15:31:02,484 org.cometd.server.**CometdServlet REQUEST:
 75.149.42.46  GET
  message=%5B%7B%22channel%22%**3A%22%2Fmeta%2Fconnect%22%2C%**
 22connectionType%22%3A%**22callback-polling%22%2C%**
 22advice%22%3A%7B%22timeout%**22%3A0%7D%2C%22id%22%3A%22354%**
 22%2C%22clientId%22%3A%**222b611tiekwk6p2mfh5bye3bm6y7l**%22%7D%5Djsonp=
 dojo.io.**script.jsonp_dojoIoScript135._**jsonpCallback
 INFO  2011-12-23 15:31:28,512 org.cometd.server.**CometdServlet REQUEST:
 75.149.42.46  POST  null
 INFO  2011-12-23 15:31:36,571 org.cometd.server.**CometdServlet REQUEST:
 75.149.42.46  POST  null

 But again, there is no traffic from that IP.  I'm not sure if this is some
 sort of loop, a very long delay, or other connections being mixed up.
  Probably the last, since I don't see any loop pattern, and it has
 continued without any traffic for almost a half an hour now.


 Your Valves code makes me suspicious: the proxy port looks like there
 could be something between your client and your tomcat. A loadbalancer with
 some kind of TCP multiplexing maybe?


That's right, there is an f5 load balancer.  The valve is used to keep
track of whether the request was via HTTPS or not.



 Have you already tried a tcpdump to crosscheck?


tcpdump seems to confirm the same.  What are you thinking?


Stefan



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


Thanks,

Matt Tyson


Re: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread David Hoffer
Yes that was a full log of that file.

The only change I made was in the Manager App's config I increased the
size of the max file size because one of my apps is bigger than 50MB,
so I just made a change to the web.xml in the manager app.

The http://IP:8080/manger/html page shows the correct list of apps but
if you click on any of the applications (path) I get the 404
error...and I have undeployed all my apps so the problem exists with
the standard sample apps too.

Should I try a different Tomcat version?

-Dave

On Tue, Dec 27, 2011 at 3:33 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 David,

 On 12/27/11 10:42 AM, David Hoffer wrote:
 I just installed Tomcat 7.0.23 using Windows 64 bit installer and
 deployed a couple apps via the manager application, however when I
 run them I get HTTP Status 404 errors.  However I see that I get
 the same error for the standard default apps, docs, examples, etc.
 The only URL that works is http://IP:8080/manager/html.

 In the log I see: Dec 27, 2011 3:28:29 PM
 org.apache.catalina.core.StandardHostValve custom SEVERE: Exception
 Processing ErrorPage[errorCode=404, location=/WEB-INF/jsp/404.jsp]
 java.lang.NullPointerException at
 org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:455)

 Is

 that stack trace complete? It seems to indicate that
 /WEB-INF/jsp/404.jsp is being invoked, but that JSP isn't actually
 executing. The only thing I can think of is that the JSP can't be
 found while processing an error (404?) and do you get this error as well.

 Have you made any modifications to Tomcat other than enabling the
 manager webapp and deploying some webapps onto it?

 What do I have to do to enable the apps?

 Deployment ought to enable the apps. What does the manager show in
 the list of deployed webapps?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk76R7QACgkQ9CaO5/Lv0PBjiQCgjCT7wt2tDxFEbJr0bgXTLRvu
 zHkAnRMrr52g8R+Ggu3MAljah1i4dooK
 =BW8D
 -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: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread Konstantin Kolinko
2011/12/28 David Hoffer dhoff...@gmail.com:
 Yes that was a full log of that file.

 The only change I made was in the Manager App's config I increased the
 size of the max file size because one of my apps is bigger than 50MB,
 so I just made a change to the web.xml in the manager app.

 The http://IP:8080/manger/html page shows the correct list of apps but
 if you click on any of the applications (path) I get the 404
 error...and I have undeployed all my apps so the problem exists with
 the standard sample apps too.


You cited only one of log files. What is in other log files? What is
in localhost*.log? What is in access log?

Try to stop Tomcat and delete everything from the work directory. (I
wonder whether *.class files for the JSPs are there. That is, whether
the directory is writable.)

The same with logs directory. Clear it, move old logs somewhere.

What Java version are you using? (It is a bit odd that the path shown
in the log is C:\Windows\Sun\Java\bin).

Best regards,
Konstantin Kolinko

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



Re: 404 Errors for all apps in Tomcat 7.0.23

2011-12-27 Thread David Hoffer
Localhost.log:
Dec 28, 2011 2:19:18 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 28, 2011 2:19:18 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

localhost_access.log is empty at startup until I click on one of the
apps in the manager page, then it has:
172.31.255.154 - admin [28/Dec/2011:02:37:27 +] GET /manager/html
HTTP/1.1 200 15821
172.31.255.154 - - [28/Dec/2011:02:37:27 +] GET
/manager/images/asf-logo.gif HTTP/1.1 404 952
172.31.255.154 - - [28/Dec/2011:02:37:27 +] GET
/manager/images/tomcat.gif HTTP/1.1 404 952
172.31.255.154 - - [28/Dec/2011:02:37:27 +] GET /favicon.ico
HTTP/1.1 404 952
172.31.255.154 - - [28/Dec/2011:02:37:31 +] GET /docs HTTP/1.1 302 -
172.31.255.154 - - [28/Dec/2011:02:37:31 +] GET /docs/ HTTP/1.1 404 952
172.31.255.154 - - [28/Dec/2011:02:37:31 +] GET /favicon.ico
HTTP/1.1 404 952


I don't know why the one log references Java in the Windows
folder...that folder does not exist.  I have added Java to the system
path (it wasn't there before) so now that log file has this line:
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Program Files (x86)\Apache Software
Foundation\Tomcat
7.0\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\Java\jre6\bin;.

My Java version is 1.6.0_30

I did stop Tomcat and was able to manually delete the logs and work
folders and then I restarted.  Windows lets me delete these files but
does prompt me asking that I will need to be an administrator which it
allows me to do.  Tomcat is running as a service, could it be that it
doesn't have enough rights to do something?  It is creating contents
in both the log and work folders...

This is running on OS - Windows 7 64bit Enterprise VM.

Thanks,
-Dave


On Tue, Dec 27, 2011 at 5:43 PM, Konstantin Kolinko
knst.koli...@gmail.com wrote:
 2011/12/28 David Hoffer dhoff...@gmail.com:
 Yes that was a full log of that file.

 The only change I made was in the Manager App's config I increased the
 size of the max file size because one of my apps is bigger than 50MB,
 so I just made a change to the web.xml in the manager app.

 The http://IP:8080/manger/html page shows the correct list of apps but
 if you click on any of the applications (path) I get the 404
 error...and I have undeployed all my apps so the problem exists with
 the standard sample apps too.


 You cited only one of log files. What is in other log files? What is
 in localhost*.log? What is in access log?

 Try to stop Tomcat and delete everything from the work directory. (I
 wonder whether *.class files for the JSPs are there. That is, whether
 the directory is writable.)

 The same with logs directory. Clear it, move old logs somewhere.

 What Java version are you using? (It is a bit odd that the path shown
 in the log is C:\Windows\Sun\Java\bin).

 Best regards,
 Konstantin Kolinko

 -
 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



Breadcrumbs Tomcat 7.0.11

2011-12-27 Thread Kiran Badi

Hi ,

Just wanted to check if Tomcat has any packages that can be used for 
building Breadcrumbs.I think some j2ee servers provide some inbuilt 
packages which can be used for building breadcrumbs.
I would be helpful if someone can give some suggestions here.I am 
working on plain JSP/Servlets and having hard time implementing breadcrumbs.


- Kiran

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



Re: Tomcat HTTPS Connector Stops working after an hour

2011-12-27 Thread Saravanan L
Tomcat does not pass through any proxy. My firefox browser has a proxy plugin 
configured which RELAYED this message. 

I enabled this plugin because, I wanted to be sure of whats happening. (I guess 
I should made it clear)

So the end line is tomcat does not responds to the request at all. 
Firefox says- Connection reset by peer.
Chrome says - Same as above but in a different manner
Firefox with Proxy - 504 

Q. how your system is configured

A. Just tomcat running in linux box (Fedora) with APR and Native compiled. 
 

 3. A 504 response code is a gateway timeout. Tomcat does not issue this
 on its own. Either you have a proxy in front of Tomcat or your
 application is returning this value.
 
 A. Yes the proxy relayed this message,  it seems the tomcat did not
 respond with any message at all.

- Original Message -
From: Mark Thomas ma...@apache.org
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, December 27, 2011 10:58:29 PM
Subject: Re: Tomcat HTTPS Connector Stops working after an hour

On 27/12/2011 10:47, Saravanan L wrote:
 3. A 504 response code is a gateway timeout. Tomcat does not issue this
 on its own. Either you have a proxy in front of Tomcat or your
 application is returning this value.
 
 A. Yes the proxy relayed this message,  it seems the tomcat did not
 respond with any message at all.

Which is the first mention in this thread that you are accessing Tomcat
via a proxy which makes most of the previous contents of this thread
null and void.

I think you need to start again with a more complete description of how
your system is configured. This is look less and less like a Tomcat
issue and more and more like a poorly configured proxy.

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



Downloading an entire website from a specific URL?

2011-12-27 Thread Craig Burlock
 Hello smart-people,

This isn't strictly a Tomcat question, however I thought you were the
people to ask:

*Can anyone recommend a utility for downloading an entire website
(including links and child pages) from a specific URL?*

I need to get a copy of a specific section of a wiki. I'm using Windows XP,
so a Windows
or DOS based utility would be awesome.

I have found a few utilities using Google, however I was wanting to know
what the Tomcat community
thought...

Any suggestions?