Re: Problem with threads in stage Service (Tomcat 7.0.14)

2011-07-28 Thread Pid
On 28/07/2011 16:09, Alejandro Henao González wrote:
 Good day.
 
 I have the following problem with my tomcat.
 
 Sometimes, some threads are keep in service stage for a long time
 (really never exit from this stage), this causes that tomcat uses a
 hight percentage of the CPU (100 % of 2 or 3 cores) thus the webapp
 executes very slow.

Take a thread dump when this is occurring.

 http://wiki.apache.org/tomcat/FAQ/Troubleshooting_and_Diagnostics


p


 I have a Tomcat 7.0.14 in a Redhat RHLE 5.5. 
 
 The partial solution is restart the service, but this is not a practical
 solution(because is a 24/7 server). is posible config a timeout for
 threads in service stage, or any solution??
 
 Thanks. Sorry for the redaction. Attached an image with the tomcat
 manager status and the CPU consuming.
 
 
 
 
 Cordial saludo.
 
 Tengo el siguiente problema con mi tomcat.
 En algunas ocasiones, algunos hilos se quedan en la etapa de servicio
 por demasiado tiempo (de hecho nunca salen de esta etapa), esto causa
 que el tomcat use un alto porcenta de la CPU (el 100 % de 2 o 3 núcluos
 incluso hasta los 8 a veces), y en consecuencia mi aplicación web
 trabaja demasiado lento.
 
 Tengo el Tomcat 7.0.14 en Redhat RHLE 5.5 
 
 La solución temporal que tengo es reiniciar el servicio, sin embargo
 esta no es una solución práctica (pues debe ser un servidor 24/7). Es
 posible configurar algún timeout para hilos en la etapa de servicio, o
 alguna solución alternativa para este problema? 
 
 Muchas Gracias. Adjunto una imagen del reporte del estado por el tomcat
 Manager, y el uso de la CPU
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: Class loading order

2011-07-27 Thread Pid
On 27/07/2011 06:19, Anne, Radhakrishna (NSN - IN/Bangalore) wrote:
 Hello,
 
 Can I use virtualWebAppLoader class to meet my requirements..?

You might be able to, but please note: 'hot fixes' and 'patches' are not
concepts that work well with compiled webapps.

If you need to update a webapp, you should release a new version.
Distributing instructions for applying updates to individual class files
is going to cause you all sorts of support problems.

Likewise, applying 'hot fixes' to plugin JARs isn't a good idea.

E.g.  If there are sequential modifications to a class, each will have
to carry all the previous changes.  Why not just update the JAR instead?

You can also enable the shared classloader in
tomcat/conf/catalina.properties.


p

 Regards 
 Krishna
 
 
 -Original Message-
 From: Anne, Radhakrishna (NSN - IN/Bangalore) 
 Sent: Tuesday, July 26, 2011 2:24 PM
 To: Tomcat Users List
 Subject: RE: Class loading order
 
 Hello,
 
 My web applications is designed to plug-in 3 rd party modules. 3rd party
 jars and my jars would placed under WEB-INF/libs.
 In case of bugs, the third party developer may provide hot fixes , which
 would be placed under WEB-INF/classes usually.
 I do not want to place their hot fixes under WEB-INF/classes, as they
 may conflict with my hot fixes and this would create some problems
 during maintenance.
 
 So I was checking the possibility of defining a new location for 3rd
 party hot fixes. Is there any way to do this..?
 
 Regards, 
 Krishna
 
 
 -Original Message-
 From: ext Pid [mailto:p...@pidster.com] 
 Sent: Tuesday, July 26, 2011 2:15 PM
 To: Tomcat Users List
 Subject: Re: Class loading order
 
 On 26/07/2011 09:38, Anne, Radhakrishna (NSN - IN/Bangalore) wrote:

 Hello,

 I would like to changes the default order look up for class loading,
 as
 I understood from the doc, the order of look up is 
 1)   WEB-INF/classes
 2)   WEB_INF/lib.

 Now I wanted to change this order and have my own order look up as
 shown
 below i.e.
 1)   /opt/shared/classes
 2)   WEB-INF/classes
 3)   WEB_INF/lib.

 Can someone help me out..? I am using tomcat 6 version.
 
 No, the only way to do this is via a custom classloader of your own
 design.  It is probably a bad idea to do this - a webapp's classloader
 is supposed to load its own classes first.
 
 Why can't you include the classes in the webapp?
 
 
 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
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: Class loading order

2011-07-27 Thread Pid
On 27/07/2011 08:55, Joseph wrote:
 I think that what Anne want is the hot swap of classes ,replace loaded
 classes with new version in hotfix jars.That might break the security of
 java,I reckon. am I right ?

If the requirement is 'live' replacement of classes already loaded by
the JVM then the OP will definitely need to build a custom classloader.

It won't break Java security per se, but it is likely to be error prone.
 OSGI has some answers for this kind of thing AFAIK, but unaugmented
Java + Tomcat won't like it at all.


p



 2011/7/27 Pid p...@pidster.com
 
 On 27/07/2011 06:19, Anne, Radhakrishna (NSN - IN/Bangalore) wrote:
 Hello,

 Can I use virtualWebAppLoader class to meet my requirements..?

 You might be able to, but please note: 'hot fixes' and 'patches' are not
 concepts that work well with compiled webapps.

 If you need to update a webapp, you should release a new version.
 Distributing instructions for applying updates to individual class files
 is going to cause you all sorts of support problems.

 Likewise, applying 'hot fixes' to plugin JARs isn't a good idea.

 E.g.  If there are sequential modifications to a class, each will have
 to carry all the previous changes.  Why not just update the JAR instead?

 You can also enable the shared classloader in
 tomcat/conf/catalina.properties.


 p

 Regards
 Krishna


 -Original Message-
 From: Anne, Radhakrishna (NSN - IN/Bangalore)
 Sent: Tuesday, July 26, 2011 2:24 PM
 To: Tomcat Users List
 Subject: RE: Class loading order

 Hello,

 My web applications is designed to plug-in 3 rd party modules. 3rd party
 jars and my jars would placed under WEB-INF/libs.
 In case of bugs, the third party developer may provide hot fixes , which
 would be placed under WEB-INF/classes usually.
 I do not want to place their hot fixes under WEB-INF/classes, as they
 may conflict with my hot fixes and this would create some problems
 during maintenance.

 So I was checking the possibility of defining a new location for 3rd
 party hot fixes. Is there any way to do this..?

 Regards,
 Krishna


 -Original Message-
 From: ext Pid [mailto:p...@pidster.com]
 Sent: Tuesday, July 26, 2011 2:15 PM
 To: Tomcat Users List
 Subject: Re: Class loading order

 On 26/07/2011 09:38, Anne, Radhakrishna (NSN - IN/Bangalore) wrote:

 Hello,

 I would like to changes the default order look up for class loading,
 as
 I understood from the doc, the order of look up is
 1)   WEB-INF/classes
 2)   WEB_INF/lib.

 Now I wanted to change this order and have my own order look up as
 shown
 below i.e.
 1)   /opt/shared/classes
 2)   WEB-INF/classes
 3)   WEB_INF/lib.

 Can someone help me out..? I am using tomcat 6 version.

 No, the only way to do this is via a custom classloader of your own
 design.  It is probably a bad idea to do this - a webapp's classloader
 is supposed to load its own classes first.

 Why can't you include the classes in the webapp?


 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


 -
 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 commands, e-mail: users-h...@tomcat.apache.org



Re: Class loading order

2011-07-26 Thread Pid
On 26/07/2011 09:38, Anne, Radhakrishna (NSN - IN/Bangalore) wrote:
 
 Hello,
 
 I would like to changes the default order look up for class loading, as
 I understood from the doc, the order of look up is 
 1)WEB-INF/classes
 2)WEB_INF/lib.
 
 Now I wanted to change this order and have my own order look up as shown
 below i.e.
 1)/opt/shared/classes
 2)WEB-INF/classes
 3)WEB_INF/lib.
 
 Can someone help me out..? I am using tomcat 6 version.

No, the only way to do this is via a custom classloader of your own
design.  It is probably a bad idea to do this - a webapp's classloader
is supposed to load its own classes first.

Why can't you include the classes in the webapp?


p



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



Re: High availability of tomcat 6

2011-07-26 Thread Pid
On 26/07/2011 11:08, Sri Lalitha wrote:
 Hi
 I am using Tomcat 6. I would like to know if instances of tomcat servers
 be made highly available?
 

Yes.

p

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



Re: JSP compile limitation 7.0.16 - 7.0.19

2011-07-24 Thread Pid
On 24/07/2011 15:48, Dan Checkoway wrote:
 In case this helps, here are some generated source specs for comparison:
 
 file sizes:
 -rw-r--r--  1 dan  staff  298619 Jul 24 10:46 7.0.16-generated-source.java
 -rw-r--r--  1 dan  staff  300421 Jul 24 10:46 7.0.19-generated-source.java
 
 line counts:
 7328 7.0.16-generated-source.java
 7331 7.0.19-generated-source.java
 
 They're roughly identical.  The diffs are essentially:
 
 3,4c3,7
   * Version: Apache Tomcat/7.0.16
   * Generated at: 2011-07-24 14:45:00 UTC
 ---
  * Version: Apache Tomcat/7.0.19
  * Generated at: 2011-07-24 14:27:53 UTC
  * Note: The last modified time of this file was set to
  *   the last modified time of the source file after
  *   generation to assist with modification tracking.
 516c519
private static java.util.Listjava.lang.String _jspx_dependants;
 ---
   private static java.util.Mapjava.lang.String,java.lang.Long
 _jspx_dependants;
 
 ...and then the list  map diffs follow.  But that's it.
 
 Dan
 
 On Sun, Jul 24, 2011 at 10:40 AM, Dan Checkoway dchecko...@gmail.comwrote:
 
 I recently upgraded from 7.0.16 to 7.0.19, and having made no other changes
 whatsoever, I've bumped into a new problem compiling long JSPs:

 java.lang.Error: Unresolved compilation problem:


 org.apache.jsp.mydir.my_005fexample_jsp._jspService(my_005fexample_jsp.java:593)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

 Granted, this JSP ends up generating java that's 7331 lines long, and 300k
 in size...but it works absolutely fine in 7.0.16.  Did some sort of jasper
 or compiler option change in 7.0.19?  I'm not sure if the generated source
 got larger, or if the new version of tomcat is more restrictive.

 I'm working on trimming my JSP down, which is something I need to do
 anyway, but I wanted to raise this issue in case there's a simple fix.  I
 remember in the past (6.0.x some time ago), tomcat used to give a more
 informative error in this circumstance, indicating that class size or method
 size was the issue.  Now the error is completely ambiguous...and it took me
 a little while to figure out (read: guess) that method size was the issue.

 Anyway, heads-up about this.  Thanks!

What is at line 593 in the compiled JSP output?

org.apache.jsp.mydir.my_005fexample_jsp._jspService(my_005fexample_jsp.java:593)

?

p




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



Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

2011-07-23 Thread Pid
On 22/07/2011 23:22, Dennis de Champeaux wrote:
 BTW I did do plenty of research on this topic

Clearly not.

The erudite Mr Eggers has elucidated a full explanation, referring
therein to the primary source of information about Tomcat - the official
documentation.


p

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



Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

2011-07-23 Thread Pid
On 22/07/2011 23:22, Dennis de Champeaux wrote:
 Your SNOTTYness is not appreciated ... 

By me either, but sadly there's no known cure for the common cold, but time.


p

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



Re: Upgrading from Tomcat 7.0.8 to 7.0.10 and higher causes Old Generation memory problems

2011-07-22 Thread Pid
On 22/07/2011 20:17, Mark Thomas wrote:
 On 22/07/2011 17:26, Ian Marsh wrote:
 Hi,

 I am in charge of running a Apache-2, Tomcat-7, Ubuntu-10.04 set up
 for which we have to be PCI Compliant. We recently upgraded to
 Apache-2.2.17 and Tomcat-7.0.8 (from Apache-2.0.x and Tomcat 5.0.28)
 in order to comply with the requirements of the PCI Compliance checks
 and ironed out any issues to get us back to a satisfactory running
 state.
 
 Hmm. I think you need some better PCI auditors. If your app was running
 on Tomcat 5.0.x and you trust the app (which seems reasonable given it
 is doing something that requires PCI compliance) then an upgrade to
 7.0.12 should be sufficient if you using the HTTP BIO connector.

Indeed.

In my experience, I'd expect a QSA/PCI Auditor to be far, far more
conservative than to promote Tomcat 7.0.x as a 'safe' version compared
to 6.0.recent.


p


 Since Tomcat appears to behind httpd then there is a strong chance you
 are using AJP (BIO or APR), in which case 7.0.2 should be sufficient.
 
 It appears your current auditors are blindly (and wrongly) assuming any
 vulnerability in Tomcat will impact your installation. Expect a demand
 to upgrade to 7.0.19 when they get around to reading the Tomcat security
 pages again.
 
 snip/
 
 It seems that the character arrays [C, java.lang.String and
 javax.servlet.jsp.tagext.TagAttributeInfo entries are considerably
 higher in Tomcat-7.0.10 than in Tomcat-7.0.8 and I am wondering if
 this could lead to an explanation for the difference.
 
 Maybe. What you really want to look at is the GC roots for those
 objects. That will tell you what is holding on to the references. Based
 on that data I'd start looking at the arrays of TagAttributeInfo but
 that might be completely the wrong place to look.
 
 I've just triggered a heap dump on the ASF Jira instance (running
 7.0.19) to see what that looks like. I'll report back what I find (once
 the 4GB heap has finished downloading - it may be some time).
 
 Would anyone know of any changes between the two versions, possibly
 linked to those memory entries, that could lead to such behaviour?
 
 Nothing jumped out at me from the changelog.
 
 Any help or suggestions is greatly appreciated! I'm sorry for a long
 post, but hopefully its got the information needed to help diagnosis.
 
 To be honest, there isn't enough info hear to diagnose the root cause
 but there is enough to demonstrate that there is probably a problem and
 maybe where to start looking. That might not seem like much but it is a
 heck of a lot better than most of the reports we get here. Thanks for
 providing such a useful problem report.
 
 Mark
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: URL/ URI/ TC(?) puzzle -- wrong non-error?

2011-07-22 Thread Pid
On 22/07/2011 22:03, Dennis de Champeaux wrote:
 Can someone  else explain what is going on ?

You have a broken configuration and you are getting double deployment.


p

 
 
 
 From: Mark Thomas ma...@apache.org
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, July 22, 2011 9:28 AM
 Subject: Re: URL/ URI/ TC(?) puzzle -- wrong non-error?
 
 On 22/07/2011 17:22, Dennis de Champeaux wrote:
 Hence the question(s):
 URL/URI semantics allow both links to succeed?
 If not, TC6 is willing to go the extra mile?
 TC (6.0.32) is wacko?
 
 Nope. You have a broken configuration and you are getting double deployment.
 
 Mark
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


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



Re: AccessLogValve %D and acceptCount tuning

2011-07-21 Thread Pid
On 21/07/2011 17:16, Dan Checkoway wrote:
 Also forgot to ask...is there an MBean attribute that I can check via JMX to
 see how many established connections are waiting to be serviced?  i.e. if
 there's a backlog in the accept queue?

Yes.  There is an attribute.
Have a nose around Tomcat using JConsole or VisualVM.


p


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



Re: tomcat and comp jndi context

2011-07-20 Thread Pid
On 19/07/2011 23:34, Romain Manni-Bucau wrote:
 Hi,
 
 where can i get more information on the way tomcat manage its jndi tree?
 
 Pratically i need the get java:comp context but i don't know when/where to
 look up it.
 
 I didn't find it in ContextBindings.getClassLoader() in start or after_start
 lifecycle event.
 
 any link or doc is appreciated ;)
 
 - Romain
 

How about the Tomcat docs?

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

 Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup(java:/comp/env);


p



signature.asc
Description: OpenPGP digital signature


Re: Redeployment of war File stopps suddenly

2011-07-20 Thread Pid
On 20/07/2011 07:58, Alexander Diedler wrote:
 Hello,
 
 We have a big problem with deployment over war in a Tomcat 6.0.32. If
 there is no application yet, the initial upload through the manger
 works. If we redeploy the running application again, the undeploy
 process fails and we have a half installation, in the Manager the
 application name is empty. To get free out of this situation, we have to
 click three times to “undeploy” and then all files are deleted and the
 Context Descriptor will be deleted.


 War File named ROOT.war resists in D:/tecracer/apps/apps1
 
 The deployed file in /conf/Catalina/app1/ROOT.xml contains:
 
 ?xml version=1.0 encoding=UTF-8?
 
 Context path= docBase=D:/tecracer/apps/app1/ privileged=true
 reloadable=true unpackWAR=true antiJARLocking=true

If the app is named ROOT.war, you don't need path  docBase in context.xml.


 In the Server.xml we have inside the Engine:
 
 Host name=app1  appBase=D:/tecracer/apps/app1 unpackWARs=true
 deployOnStartup=true   

You can't set docBase and appBase to the same value.

There shouldn't be a space in the Host name attribute.


p


   Valve
 className=org.apache.catalina.valves.AccessLogValve directory=logs
 
prefix=app1_access_log. suffix=.txt pattern=common
 resolveHosts=false/
 
 /Host
 
  
 
 Do we make a thinking mistake in the understanding of automatical
 deployment?
 
  
 
 Greetings
 
 Alexander Diedler
 
  
 
  
 




signature.asc
Description: OpenPGP digital signature


Re: tomcat and comp jndi context

2011-07-20 Thread Pid
On 20/07/2011 13:09, Romain Manni-Bucau wrote:
 I'm in OpenEJB modifying a lifecycle listener.
 
 The current code is:
 
 ContextBindings.getClassLoader().lookup(comp);
 
 but it fails, i wonder if i can replace it by:
 
 standardContext.getNamingContextListener();

Perhaps this is an OpenEJB* question rather than a Tomcat one?

p


* EJB!  Really!?

 - Romain
 
 2011/7/20 Pid p...@pidster.com
 
 On 19/07/2011 23:34, Romain Manni-Bucau wrote:
 Hi,

 where can i get more information on the way tomcat manage its jndi tree?

 Pratically i need the get java:comp context but i don't know when/where
 to
 look up it.

 I didn't find it in ContextBindings.getClassLoader() in start or
 after_start
 lifecycle event.

 any link or doc is appreciated ;)

 - Romain


 How about the Tomcat docs?


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

  Context initContext = new InitialContext();
  Context envContext  = (Context)initContext.lookup(java:/comp/env);


 p


 


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



Re: IIS 7.5 2008 Server

2011-07-17 Thread Pid *
On 16 Jul 2011, at 07:51, Ian Porter i...@codingfriends.com wrote:

 Hi pid

 I am using tomcat version 7.0, I have read the documentation below
 thanks, but it does not say that it is working with iis 7.5?

 I shall reinstall it again, and redo the files etc ? Is there any
 version you recommend of tomcat to work with iis 7.5 ?(with the isapi
 redirect.dll)

 Or is it because I am using iis 7.5 or something else ?

What have you tried, so far?
Post inline your configuration files.


p


 Regards
 Ian


 On Friday, July 15, 2011, Pid p...@pidster.com wrote:
 On 15/07/2011 22:21, Ian Porter wrote:
 Hi All

 I am trying to get the tomcat server to work on IIS 7.5 with 2008
 Server, I have tried many different ways and websites that say that
 they work, but when I go through there examples I am just not able to
 get it to work :(

 Which version of Tomcat?

 I have enabled the execute rights on the dll, virtual directory.

 I was wondering if there was any advice or this way works for sure or
 this website example really does work. because I am at a loss for why
 the IIS redirect is not working.

 Did you read this website?

  http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

  http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Windows

  http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html



 p




 --
 Kind regards
 Ian Porter

 www: www.codingfriends.com

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


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



Re: [JSP] List directory content within a war-file

2011-07-17 Thread Pid *
On 16 Jul 2011, at 15:46, Dark Before Dawn dark.before.d...@gmail.com wrote:

 Hi there,

 I am trying to list files and directories within an war-file i.e 
 images/summer2010 images/winter2010. The war-file is deployed on a tomcat 7 
 instance with unpackWARs=false.
 Since I have no exposed filesystem getRealPath will return null.

If you 'have no exposed file system', how do you expect to get files?


p

 So I tried to use getResourceAsStream wich works fine for files but not for 
 directories.
 My other idea was to use getResource and URL/URI to get a java.io.File via 
 JNDI. But this file is not a file nor a directory.
 Cheers
 Darky

 Code Snippet:
// null if unpackWar = false
String absolute = 
 this.getServletConfig().getServletContext().getRealPath(files);
out.write(Files:  + absolute);

// jndi
URL url = 
 this.getServletConfig().getServletContext().getResource(files);
out.write(br/ + url.toURI());

File f = new File(file: + url.toURI());

// Both null
out.write( isDir:  + f.isDirectory());
out.write( isFile:  + f.isFile());

InputStream is = 
 this.getServletConfig().getServletContext().getResourceAsStream(files/1.txt);

// NPE if directory
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line;
out.write(br/contentbr/);
while ((line = br.readLine()) != null) {
// print file content
out.write(line +br/);
}
br.close();


 -
 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 7 generated web.xml

2011-07-15 Thread Pid
On 15/07/2011 22:25, Stephen Munro wrote:
 Yeah, you may be right out it's usefulness, but on the video I watched, it
 was being pitched as a performance boost if you had a massive web app (with
 annotations and web-fragments). So the use case would be, develop the app
 with annotations enabled and in production, switch them off and use the
 master (generated) web.xml, that's what my understanding of it was. So, with
 that in mind, I'd have thought a web.xml file would have been created and
 that could be checked into version control without the user having to do
 anything.

Does the video describe an app which is rebooted frequently in production?


p


 This may not be what had been envisioned for it's primary use, it just
 struck me as a nice feature to have.
 
 On 15 July 2011 22:18, Jesse Farinacci jie...@gmail.com wrote:
 
 Greetings,

 On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
 stephen.ross.mu...@gmail.com wrote:
 Thanks for the quick reply! I've got it working, so thanks. I'm a little
 curious why the web-app structure is dumped directly to the logs rather
 than
 have it written to a .xml for convenience say...web-generated.xml?

 Great! The configuration option name has log right in it. I wouldn't
 expect it to do anything other than log the effective web.xml. Having
 this effective web.xml output to a special file seems of limited
 value, you can simply copy and paste in the rare event that you
 actually require it.

 -Jesse

 --
 There are 10 types of people in this world, those
 that can read binary and those that can not.

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


 
 




signature.asc
Description: OpenPGP digital signature


Re: How can i change JSESSIONIDSSO cookie name?

2011-07-15 Thread Pid
On 15/07/2011 13:08, Mathan Karthik wrote:
 Currently I'm running two web applications in the same machine, but using two 
 different tomcat servers. Both the applications has the same context path, 
 but port numbers are different. 

Wouldn't it be easier just to run the apps on two different IP addresses?


p



signature.asc
Description: OpenPGP digital signature


Re: IIS 7.5 2008 Server

2011-07-15 Thread Pid
On 15/07/2011 22:21, Ian Porter wrote:
 Hi All
 
 I am trying to get the tomcat server to work on IIS 7.5 with 2008
 Server, I have tried many different ways and websites that say that
 they work, but when I go through there examples I am just not able to
 get it to work :(

Which version of Tomcat?

 I have enabled the execute rights on the dll, virtual directory.
 
 I was wondering if there was any advice or this way works for sure or
 this website example really does work. because I am at a loss for why
 the IIS redirect is not working.

Did you read this website?

 http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

 http://tomcat.apache.org/tomcat-7.0-doc/setup.html#Windows

 http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html



p




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 generated web.xml

2011-07-15 Thread Pid
On 15/07/2011 22:38, Stephen Munro wrote:
 No, that wasn't the way it was pitched. The video was from springsource and
 a Mark Thomas was discussing the feature in question (
 http://www.youtube.com/watch?v=HSPo8k6DbTsfeature=related). 

Mark is a Tomcat committer.

He did say that
 this feature was good for ensuring nothing was enabled accidentally through
 web-fragments and that the log feature would help sanity check the web-app
 configuration. 

That is very true.

However, he did state it was a good way for improving performance.

Not all optimisations are aimed at production.

This was purely out of my own curiosity and I've not looked
 into Tomcat much and it seemed (to me at least) worth asking about. As you
 seemed to have implied in your comment, unless the app is rebooted on a
 regular basis, it may not be worth dumping the in memory copy to a generated
 web.xml file.

Indeed.


p


 On 15 July 2011 22:28, Pid p...@pidster.com wrote:
 
 On 15/07/2011 22:25, Stephen Munro wrote:
 Yeah, you may be right out it's usefulness, but on the video I watched,
 it
 was being pitched as a performance boost if you had a massive web app
 (with
 annotations and web-fragments). So the use case would be, develop the app
 with annotations enabled and in production, switch them off and use the
 master (generated) web.xml, that's what my understanding of it was. So,
 with
 that in mind, I'd have thought a web.xml file would have been created and
 that could be checked into version control without the user having to do
 anything.

 Does the video describe an app which is rebooted frequently in production?


 p


 This may not be what had been envisioned for it's primary use, it just
 struck me as a nice feature to have.

 On 15 July 2011 22:18, Jesse Farinacci jie...@gmail.com wrote:

 Greetings,

 On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
 stephen.ross.mu...@gmail.com wrote:
 Thanks for the quick reply! I've got it working, so thanks. I'm a
 little
 curious why the web-app structure is dumped directly to the logs rather
 than
 have it written to a .xml for convenience say...web-generated.xml?

 Great! The configuration option name has log right in it. I wouldn't
 expect it to do anything other than log the effective web.xml. Having
 this effective web.xml output to a special file seems of limited
 value, you can simply copy and paste in the rare event that you
 actually require it.

 -Jesse

 --
 There are 10 types of people in this world, those
 that can read binary and those that can not.

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







 
 




signature.asc
Description: OpenPGP digital signature


Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

2011-07-14 Thread Pid
On 13/07/2011 20:17, Christopher Schultz wrote:
 Mark,
 
 On 7/13/2011 3:12 PM, Mark Thomas wrote:
 On 13/07/2011 19:39, Lataxes, Karl wrote:
 We're not using cookies.

 Our application is not web based, but accepts HTTP PUTS via client 
 requests that enter our network from external sources.  We are not 
 URL encoding, as our clients are not configured to accept it.  If 
 we have to include URL encoding, both our client and server 
 applications will have to be modified accordingly, which may be an 
 option.
 
 No cookies and no url encoding. OK. So how are requests associated 
 with a session?
 
 +1

+1

 Sounds like the OP is Doing It Wrong.

You missed out the capitals (corrected above).  ;)


p



signature.asc
Description: OpenPGP digital signature


Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

2011-07-14 Thread Pid
On 14/07/2011 10:25, Pid wrote:
 On 13/07/2011 20:17, Christopher Schultz wrote:
 Mark,

 On 7/13/2011 3:12 PM, Mark Thomas wrote:
 On 13/07/2011 19:39, Lataxes, Karl wrote:
 We're not using cookies.

 Our application is not web based, but accepts HTTP PUTS via client 
 requests that enter our network from external sources.  We are not 
 URL encoding, as our clients are not configured to accept it.  If 
 we have to include URL encoding, both our client and server 
 applications will have to be modified accordingly, which may be an 
 option.

 No cookies and no url encoding. OK. So how are requests associated 
 with a session?

 +1
 
 +1
 
 Sounds like the OP is Doing It Wrong.
 
 You missed out the capitals (corrected above).  ;)

http://www.cafepress.com/cp/customize/product2.aspx?number=556022568


p




signature.asc
Description: OpenPGP digital signature


Re: Terminating Timer Thread Gracefully

2011-07-14 Thread Pid
On 14/07/2011 06:05, Terence M. Bandoian wrote:
  On 1:59 PM, Pid wrote:

 ATimerTask is a private instance in AServletContextListener, is this
 necessary and if so, why?

 What logic is contained in ATimerTask?

 Are you overriding TimerTask.cancel() and do you catch
 InterruptedException?


 p
 
 Hi, Pid-
 
 For the sake of clarity, I'll repeat this here:
 
 public class AServletContextListener implements ServletContextListener
 {
 private Timer timer;
 private ATimerTask timerTask;

Yes, but why is the timerTask an instance field?  Put another way, why
is there a reference to it outside of the contextInitialized() method?


 public void contextInitialized( ServletContextEvent sce )
 {
 if ( timer == null )
 {
 Calendar firstRunTime;
 
 timer = new Timer( true );
 timerTask = new ATimerTask();
 
 firstRunTime = new GregorianCalendar();
 firstRunTime.set( Calendar.HOUR_OF_DAY, 12 );
 firstRunTime.set( Calendar.MINUTE, 0 );
 firstRunTime.set( Calendar.SECOND, 0 );
 firstRunTime.set( Calendar.MILLISECOND, 0 );
 
 timer.scheduleAtFixedRate(
 timerTask, firstRunTime.getTime(), 1000 * 60 * 60 * 24 );
 }
 }
 
 public void contextDestroyed( ServletContextEvent sce )
 {
 if ( timer != null )
 {
 timer.cancel();
 timer.purge();
 
 timer = null;
 timerTask = null;
 
 try
 {
 Thread.sleep( 1000 );
 }
 catch ( InterruptedException ie )
 {
 }
 }
 }
 }
 
 It isn't absolutely necessary but why would I make the ATimerTask
 reference anything but private?

As above.

The only reason to keep a handle on the task itself is if you're calling
cancel on the task - but you aren't doing that.  Maybe you should?


 The timer tasks in the application perform some very straightforward
 database and file system maintenance when their run methods are invoked
 that might take up to half a second each.  None override the cancel
 method.  All are scheduled to execute on a daily or weekly basis and
 none at even close to the same time of day.

The timer.cancel() method doesn't interrupt or stop a running task
immediately, it just prevents it from running again.

Your timer creates as daemon threads - perhaps you could assign a name
too, and then report (just for confirmation) that it is the expected
thread name(s) Tomcat's complaining is still running?


 Also, while testing for ways to prevent the error message from being
 written to the logs, I commented out the run method bodies of the timer
 tasks so that they returned immediately and, given that I know the
 schedule, none of the timer tasks were executing when I stopped or
 restarted Tomcat.

That reads (to me) like you're saying that if you comment out the run
methods, everything is OK.  Is this correct?


p

 The InterruptedException is caught and logged if it occurs.  I've never
 seen it in the logs.
 
 Thanks.
 
 -Terence
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: response headers missing ?

2011-07-14 Thread Pid
On 14/07/2011 11:29, André Warnier wrote:
 Hi.
 
 This is a bit of a side question, or let's say a question-by-proxy.
 
 I happen to be also subscribed to a support list for mod_perl, and
 someone there made the following comment as part of a post :
 
 quote
 
 We have 100+ web servers where apache fronts a separate tomcat server
 using mod_proxy.
 
 Sadly, the tomcat dev's forgot to set any caching headers in the HTTP
 response (either Expires, Last-Modified or Cache-control) so the sites
 are largely uncacheable by browsers and the various tomcats are becoming
 overloaded.
 
 unquote

I'd ask the OP to back that up with an explanation and some proof,
contrary to the below:

Request URL:http://localhost:8081/tomcat.png
Request Method:GET
Status Code:304 Not Modified

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:localhost:8081
If-Modified-Since:Sat, 02 Jul 2011 21:38:58 GMT
If-None-Match:W/5103-1309642738000
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.803.0 Safari/535.1

Date:Thu, 14 Jul 2011 10:35:31 GMT
ETag:W/5103-1309642738000
Server:Apache-Coyote/1.1


p

 Do any of the dev's here have a comment to make ?
 
 (sadly, the mod_perl OP failed to provide any version information so far).







signature.asc
Description: OpenPGP digital signature


Re: Passing user id from web page to tomcat webapp

2011-07-14 Thread Pid
On 14/07/2011 15:04, David kerber wrote:
 On 7/14/2011 9:50 AM, André Warnier wrote:
 David kerber wrote:
 I have a situation where my users will be logging into their pages on
 an IIS 5 web server, which authenticates them with their user ID and
 password as configured in IIS. This works fine.

 Now I need to add some new functionality to the web site that will be
 using my tomcat webapp, and I don't want them to have to authenticate
 again in my app, so I'm trying to figure out how to pass the user ID
 from the web page on IIS, to my webapp. I thought
 request.getRemoteUser() would do it, but that's returning null, rather
 than the loggged-in user ID.

 You need to specify what you use to forward requests from IIS to Tomcat.
 If you are using Isapi_Redirect, then set the attribute
 tomcatAuthentication to false in the Tomcat AJP Connector (in
 server.xml).
 
 I'm not forwarding at all.  The call to tomcat from the IIS page is
 just the action parameter of the form.  The only connector is the
 standard http 1.1 connector.

If their username  password really is configured in IIS, were you
hoping that Tomcat would magically interface with that?   :s

Tomcat 7 has SPNEGO support, which might enable cross-server SSO, but
I'm speculating there.


p




signature.asc
Description: OpenPGP digital signature


Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

2011-07-14 Thread Pid
On 14/07/2011 15:11, Christopher Schultz wrote:
 Pid,
 
 On 7/14/2011 5:45 AM, Pid wrote:
 http://www.cafepress.com/cp/customize/product2.aspx?number=556022568
 
 $21? boo...

I couldn't change the price...


s



signature.asc
Description: OpenPGP digital signature


Re: Session cookie max age

2011-07-14 Thread Pid
On 14/07/2011 15:27, Christopher Schultz wrote:
 Konstantin,
 
 On 7/13/2011 8:54 PM, Konstantin Kolinko wrote:
 AFAIK, 1) Tomcat won't send Set-Cookie when session id is already
 known (either from this webapp or  from webapp on its parent path
 such as ROOT).
 
 That would sound like a bug. If the session cookie's expiration date is
 not -1, then it needs to be updated with every response, no?

Ahh, the ever popular cookie debate.

Servlet 2.5 doesn't list RFC 2965 as a 'relevant' specification, but
that does offer the Max-Age attribute of the Cookie header value.

 http://tools.ietf.org/html/rfc2965

If this was being written in the response, then the cookie header does
not need to be set on each request.


p


(Disclaimer, smallprint, browser support, yes, etc etc.)




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




signature.asc
Description: OpenPGP digital signature


Re: Session cookie max age

2011-07-14 Thread Pid
On 14/07/2011 15:54, André Warnier wrote:
 Konstantin Kolinko wrote:
 ...

 1) Updating it with every response sounds lame.

 2) max-age value should be consistent between all web applications
 that might share the session cookie.
 Otherwise there will be inconsistencies and breakages.

 Are you not confusing max-age with last access ?

Possibly the confusion* is that:

 http://download.oracle.com/javaee/5/api/javax/servlet/http/Cookie.html

defines setMaxAge() but one could infer that it should be persisted and
a rolling value applied on each request, but it actually maps to the
Expires attribute of the cookie.

I suppose the method name is misleading, semantically better to have
said setExpires(long) instead.


p


*  It's confused me, certainly.
** Ooh look at me doing an André, quoting HTTP specs
 The expiration of a cookie (like the expiration of a session), in my
 view should be calculated on the base of :
 last access + max-age, compared to now
 
 And then, there is the question of whether last access should be
 updated when the request is received, or when the response is sent.
 (Apparently the Servlet Spec has things to say on the matter, and some
 recently added Tomcat properties also).
 
 There was another thread recently debating similar issues, in the
 context of long file upload requests.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: Sticky Session Not Working With Apache 2.0.54 and Tomcat 7.0.8

2011-07-13 Thread Pid
On 13/07/2011 14:37, Lataxes, Karl wrote:
 We are attempting to run identical servlets under several Tomcat 7.0.8 nodes 
 behind a load balancer (Apache 2.0.54 using mod_jk), but we have been unable 
 to get sticky sessions to work.  Initial requests are forwarded to a node as 
 expected, but subsequent requests from the same client are being forwarded to 
 the second node ala round robin, which triggers session not found logic in 
 our application and causes the connection to terminate.  Due to environment 
 limitations, we cannot employ session persistence to our Tomcat instances and 
 must make use of sticky sessions.  My Tomcat instances have been properly 
 configured (HTTP connector commented out, AJP 1.3 connected uncommented, 
 jvmRoute attribute in each instance set to the workers listed in 
 workers.properties file).
 
 Here are the mod_jk entries in my httpd.conf file:
 
 LoadModule jk_module /path_to/apache/modules/mod_jk.so
 
 JkWorkersFile /path_to/apache/conf/workers.properties
 JkLogFile logs/mod_jk.log
 JkLogLevel debug
 
 JkMount /* loadbalancer
 
 Here are the entries in my workers.property file:
 
 worker.list=loadbalancer
 
 worker.tomcat7A.type=ajp13
 worker.tomcat7A.host=host_name
 worker.tomcat7A.port=4911
 worker.tomcat7A.lbfactor=1
 
 worker.tomcat7C.type=ajp13
 worker.tomcat7C.host=host_name
 worker.tomcat7C.port=4931
 worker.tomcat7C.lbfactor=1
 
 worker.loadbalancer.type=lb
 worker.loadbalancer.balance_workers=tomcat7A,tomcat7C
 worker.loadbalancer.sticky_session=1
 
 worker.jkstatus.type=status
 
 What am I doing wrong?


Are they always forwarded to the wrong node, or do some succeed?

If you monitor the response headers (look for Set-Cookie:
NN.tomcat7X) is a new session sent each time?

Is the client sending the Cookie: header with the second request?

Are you URL encoding each link in the page?


p








signature.asc
Description: OpenPGP digital signature


Re: Terminating Timer Thread Gracefully

2011-07-13 Thread Pid
On 12/07/2011 20:47, Terence M. Bandoian wrote:
  Hi, Kris-
 
 I tried using ScheduledExecutorService but ran into the same problem. 
 After awaiting termination:
 
 executorService.shutdown();
 
 try
 {
 while ( !executorService.awaitTermination(
 1, TimeUnit.SECONDS ) );
 
 Thread.sleep( 1000 );
 }
 catch ( InterruptedException ie )
 {
 }
 
 I still had to insert a call to Thread.sleep to prevent the error
 message from being written to the logs.

ATimerTask is a private instance in AServletContextListener, is this
necessary and if so, why?

What logic is contained in ATimerTask?

Are you overriding TimerTask.cancel() and do you catch InterruptedException?


p

 
 Thanks.
 
 -Terence Bandoian
 
 On 1:59 PM, Kris Schneider wrote:
 On Tue, Jul 12, 2011 at 7:59 AM, Caldarale, Charles R
 chuck.caldar...@unisys.com  wrote:
 From: Terence M. Bandoian [mailto:tere...@tmbsw.com]
 Subject: Terminating Timer Thread Gracefully
 Finally, in contextDestroyed, I inserted a call to
 Thread.sleep after canceling the timer and the error
 message disappeared.
 You should be able to do a Thread.join() using the timer's Thread
 object rather than sleeping.
 But Timer doesn't expose its thread. An alternative would be use
 something like Executors.newSingleThreadScheduledExecutor() to get a
 ScheduledExecutorService. The executor can be used to schedule a
 Runnable with a fixed rate or delay. When the context is destroyed,
 shutdown the executor and await its termination.

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




signature.asc
Description: OpenPGP digital signature


Re: Terminating Timer Thread Gracefully

2011-07-12 Thread Pid
On 12/07/2011 02:06, Terence M. Bandoian wrote:
  Hi-
 
 I've been testing a web application on:
 
 Tomcat 6.0.32 (32-bit)
 Sun/Oracle JRE 1.6.0_25 (32-bit)
 Windows Server 2008 R2
 
 The web application includes a ServletContextListener which creates a
 Timer in the contextInitialized method to perform periodic maintenance. 
 To no avail, I spent quite a bit of time trying to eliminate the The
 web application appears to have started a thread... error message from
 the logs including logging the cancellation of the timer in the
 contextDestroyed method of the ServletContextListener.  Finally, in
 contextDestroyed, I inserted a call to Thread.sleep after canceling the
 timer and the error message disappeared.
 
 Is there some other way to eliminate this message that I've missed?

Hard to know, can you post the code you used to start/stop the timer?


p


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




signature.asc
Description: OpenPGP digital signature


Re: HANDLER THREAD PROBLEM: java.io.IOException: Stream broken

2011-07-11 Thread Pid
On 11/07/2011 09:06, André Warnier wrote:
 Platform ?
 Tomcat version (x.y.z) ?
 Java version ?
 mod_jk/isapi version ?
 
 What are you/your component doing when the error happens ?
 I mean, does the error happen when a tau neutrino strikes the CPU, or
 when you pull the network cable, or when ?
 
 And, why would you be *developing* under Tomcat 5.5, which is two major
 versions behind the current Tomcat 7.x version ?

Also, is AJP1.2 really what you mean to be using?
The current version of the protocol is 1.3.

 http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html

The mod_jk/isapi versions are currently 1.2.x but this is not related.


p

 Petr Hracek wrote:
 Dear users.

 during the development of my component sometimes I am receiving
 following error:
 HANDLER THREAD PROBLEM: java.io.IOException: Stream broken
 java.io.IOException: Stream broken
  at
 org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Ajp12ConnectionHandler.java:426)

  at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:147)

  at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
  at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

  at java.lang.Thread.run(Thread.java:534)
 HANDLER THREAD PROBLEM: java.io.IOException: Stream broken
 java.io.IOException: Stream broken
  at
 org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Ajp12ConnectionHandler.java:426)

  at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:147)

  at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
  at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

  at java.lang.Thread.run(Thread.java:534)
 HANDLER THREAD PROBLEM: java.io.IOException: Stream broken
 java.io.IOException: Stream broken
  at
 org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextRequest(Ajp12ConnectionHandler.java:426)

  at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:147)

  at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
  at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

  at java.lang.Thread.run(Thread.java:534)
 HANDLER THREAD PROBLEM: java.io.IOException: Stream broken
 java.i..

 Could you please let me know how I can diagnose whether error is in
 the my application or in tomcat side (some configuration troubles?)

 I have used some debug levels In my XML file for servlet:
 http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html#where
 init-param
 param-namedebug/param-name
 param-value0/param-value
 /init-param

 but I did not found any trouble.

 Thank you in advance
 Petr



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




signature.asc
Description: OpenPGP digital signature


Re: JNA class path with tomcat

2011-07-11 Thread Pid
On 09/07/2011 00:40, charithsoori wrote:
 Hi,
 I am trying to run a web application which is which using JNA . My
 application work fins as standalone and when it configured as a web app
 tomcat it giving  error 
 
 java.lang.NoClassDefFoundError:
 com/stibocatalog/hunspell/HunspellLibrary  . It seems native library
 not loading. How I can solve this problem
 
 

try again, after reading:

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


p



signature.asc
Description: OpenPGP digital signature


Re: HANDLER THREAD PROBLEM: java.io.IOException: Stream broken

2011-07-11 Thread Pid
On 11/07/2011 14:30, Petr Hracek wrote:
 It seems that after upgrading to tomcat5.5 all is working.
 But some times ps -ef or top shown me that java process is consuming
 100% CPU usage
 Before that there was used tomcat 3.2.1 version
 JRE which was used was 1.4.2.

Right...

So again I'll point you to André's comment below...

 And, why would you be *developing* under Tomcat 5.5, which is two major
 versions behind the current Tomcat 7.x version ?


I'd really be looking at developing on Tomcat 6.0.latest at a minimum.


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat 6.0.32 stops responding

2011-07-11 Thread Pid
On 11/07/2011 15:10, PJ Delsh wrote:
 
 Konstantin,
 1- We couldn't find anything useful in the Apache logs.

Log data is useful.  Even if it doesn't /appear/ to show an error.

 2- I don't know where in the Tomcat logs or Apache config to look for the 
 connector we are using. 

Carefully remove the XML comments from your Tomcat conf/server.xml and
post the result into an email here, (after testing that it still works).

 3- How can we connect to Tomcat via the non AJP (if we are using it) to see 
 if Tomcat responds?

By enabling and/or using the HTTP connector, usually on port 8080.

 4- What can I do with the thread dumps?

Post them here.

 5- I would like to eventually setup more than one Tomcat to act as a failover.

Woah, there!  One problem at a time please...


p


 -PJ
 
 Date: Mon, 11 Jul 2011 16:35:55 +0400
 Subject: Re: Tomcat 6.0.32 stops responding
 From: knst.koli...@gmail.com
 To: users@tomcat.apache.org

 2011/7/11 PJ Delsh pjdelsh...@hotmail.com:

 Thank you Konstantin and Chris.

 I have setup Apache 2.2.19 through mod_jk 1.2.21
 To enable compression on the SSL traffic, Apache and Tomcat are setup in a 
 reverse proxy.

 1- Should I take the thread dumps now, or when Tomcat is in the 
 'non-responding' state?

 When it is in non-responding state.
 Is there anything in the Apache HTTPD logs as well?


 Regarding your configuration:
 - What connector implementation you are using? (That will be in the
 logs when Tomcat starts). Do you use Tomcat-Native aka APR
 (bin/tcnative-1.dll) ?

 - If you have an HTTP connector besides AJP one, does Tomcat responds
 if you try to connect to it?


 2- Is it a good idea to make the jump from 6.0.32 to 7.0.16?  I know our 
 app works in 7.

 That is up to you to decide. The more people use Tomcat 7, the merrier it is.


 Tomcat 7 releases come more frequently (once a month),  and changes
 between releases tend to be more risky, but it has better testsuite
 than Tomcat 6.


 There was some connector refactoring recently in Tomcat 7, to reduce
 duplicate code and simplify further development and maintenance. Next
 release will be 7.0.19.

 Regarding your issue, I do not think that the upgrade will change
 anything in diagnosing the issue.


 There should be other reasons for upgrading, like parallel deployment,
 or using Sevlet 3.0 features in applications that you will deploy on
 the same server later.

 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Parallel_deployment


 3- If I was to hire a consultant to look into this, can you recommend one?

 http://wiki.apache.org/tomcat/SupportAndTraining

 Best regards,
 Konstantin Kolinko

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

 




signature.asc
Description: OpenPGP digital signature


Re: Tomcat appears to be sending duplicate requests

2011-07-08 Thread Pid
On 08/07/2011 11:07, peterjca wrote:
 
 Yes, I do mean duplicate requests. I know they are duplicates because the
 header contains the unique (thread-safe) counter that my test harness
 increments. Each request should contain its unique request count, but some
 requests contain counts already seen before -- hence they are being
 duplicated/resent for some reason by something which is not my web app nor
 my test harness.
 
 I maintain a unique thread-safe count in the test harness. That shows the
 test is sending the correct number of requests.

I'm not sure that's a safe assumption.  It most likely only shows that
the test is sending the right number of requests, rather than that the
IO component it relies on is performing correctly.

If you're saying that Tomcat is seeing the same headers in multiple
requests it points to the client resending the request.

Tomcat doesn't arbitrarily resend a request to itself if a timeout occurs.

Can you use a network sniffer to inspect the network traffic to Tomcat?


p


 On the server-side in the Jersey resource end-point, purely for debug
 purposes, I am using a bitset to maintain the counts already seen from the
 headers of the incoming requests. That demonstrates that I am receiving
 duplicate requests on the server.
 
 Everything is standalone on my machine. Nothing else is using the web app as
 it's a greenfield project under my sole development.
 
 It's the standard standalone Tomcat configuration.
 
 My web app uses 2-legged OAuth for authentication using a Jersey
 ResourceFilter. That has always worked and is not the cause of any failures.
 
 In fact, all of my Jersey client requests from the test harness return 200
 response codes.
 
 I'll run Tomcat 7 and check the access logs.
 




signature.asc
Description: OpenPGP digital signature


Re: mod_jk restarting during uploads of large files

2011-07-07 Thread Pid
Linux OOM killer?

 http://lwn.net/Articles/317814/


p


On 07/07/2011 09:35, mar...@alt-v.co.uk wrote:
 Yeh, I've worked out what was happening, seems that tomcat was being
 killed by the system running out of memory, which was happening without
 any log messages on the system at all, which was rather unhelpful and
 left me completely stumped for a while.  However adding extra swap space
 and memory seem to fix the problem.
 
 Thanks anyway for the reply
 
 Quoting Rainer Jung rainer.j...@kippdata.de:
 
 It seems it is not a mod_jk problem. mod_jk never shuts down Tomcat, but
 obviously your Tomcat shuts down during processing the request.

 I would

 - update Tomcat *and* the service wrapper (jdvc) to the most recent
 patch update (e.g. Tomcat 5.5.33).

 - run Tomcat once without the service wrapper to decide, whether the
 problem comes from the wrapper or from Tomcat respectively your web
 application.

 Regards,

 Rainer

 On 04.07.2011 18:27, mar...@alt-v.co.uk wrote:
 Hi
 I have a problem when uploading files to tomcat through mod_jk.  When
 uploading smaller files (100kb) everything seems to work fine, but when
 uploading files of about 1.5Mb it seems as if the server is restarting
 and causing a 503 error.  I've tried modifying timeouts in both apache
 and tomcat, still i get this output on the catalina.err file: (sorry for
 long log files)


 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:31 7211 jsvc.exec error: Shutdown or reload already
 scheduled
 04/07/2011 15:19:32 7210 jsvc.exec error: Service killed by signal 9
 Jul 4, 2011 3:19:35 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:
 

Re: URI served from cache

2011-07-07 Thread Pid
On 07/07/2011 14:54, Langer Arnaud wrote:
 Hi there,
 
 My question is simple : is it possible to disable the cache of Tomcat ?
 I think I've browsed the entire web about that without finding my answer.
 As I'm developping a website under Eclipse, I would like to see modifications 
 as they are developped but here, when I change an image, for example, it's 
 always given from the Tomcat's cache : I can see, in the Console of Tomcat, 
 for each page I request, about 20 messages like this one :
 {date and hour} DEBUG [http-8080-1] lutece.cache - URI served from cache : 
 /PSP/images/logo.png

What is 'lutece.cache'?  That's not a log message Tomcat would output.

 If I modifiy the logo.png, I can't see the new one in my browser, even if I 
 stop and restart Tomcat, even if I disable my browser's cache...

Are you sure that the file is actually being updated?

If you're stopping and starting Tomcat then you are terminating the
cache (which is in-memory), so it will pick up the new version.

Assuming you're using Tomcat's cache and not a third party one.


p


 I'm using Tomcat 6.0.26 on Windows XP SP3.
 
 Thanks by advance for any way of answer.
 
 
 
 Arnaud LANGER
 Division Secteur Public
 
 Sopra group.
 
 Armor Plazza
 5  7 Impasse Claude Nougaro CS 90314
 44803 SAINT HERBLAIN CEDEX
 Phone : +33 (0)2 40 38 94 27
 alan...@sopragroup.commailto:alan...@sopragroup.com - 
 www.sopragroup.comhttp://www.sopragroup.com
 
 
 Ce message peut contenir des informations confidentielles dont la divulgation 
 est à ce titre rigoureusement interdite en l'absence d'autorisation explicite 
 de l'émetteur. Dans l'hypothèse où vous auriez reçu par erreur ce message, 
 merci de le renvoyer à l'émetteur et de détruire toute copie.
 
 P Pensez à l'environnement avant d'imprimer / Before printing, think about 
 the environment.
 
 
 
 




signature.asc
Description: OpenPGP digital signature


Re: NPE at StandardWrapperValve.invoke() in Tomcat 7.0.16

2011-07-07 Thread Pid
On 07/07/2011 01:31, eurotrans-Verlag wrote:
 Hi all,
 
 I’m using Tomcat 7.0.16 on a system with Java 1.6.0_26 on Windows Serer 2008
 and wondered about a strange NPE I got shortly after deploying a webapp to
 Tomcat:

 SCHWERWIEGEND: An exception or error occurred in the container during the
 request processing
 java.lang.NullPointerException
   at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:287)
   at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:164)
   at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
 .java:462)
   at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
 )
   at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100
 )
   at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :118)
   at
 org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionM
 anagerValve.java:172)
   at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
   at
 org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:284)
   at
 org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProt
 ocol.java:146)
   at
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:
 1730)
   at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
 va:886)
   at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
 08)
   at java.lang.Thread.run(Thread.java:662)
 
 
 From looking at Tomcat 7.0.16's source, I can see that line 287 in
 StandardWrapperValve is inside a catch block:
 
 285   } catch (Throwable e) {
 286   ExceptionUtils.handleThrowable(e);
 287   container.getLogger().error(sm.getString(
 288   standardWrapper.serviceException, wrapper.getName(),
 289   context.getName()), e);
 290   throwable = e;
 291   exception(request, response, e);
 292   }
 
 So does that mean that another Exception/Error occurred, but was suppressed
 by that NPE and therefore couldn't be logged?

What is the request for and is the config of your Tomcat instance
modified from the original download - if so, what has changed (config etc)?


p




signature.asc
Description: OpenPGP digital signature


Re: NPE at StandardWrapperValve.invoke() in Tomcat 7.0.16

2011-07-07 Thread Pid
On 07/07/2011 20:59, eurotrans-Verlag wrote:
 Hi Christopher,
 
 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Sent: Thursday, July 07, 2011 9:13 PM

 Looks like it. I would be very interested to know which of those
 objects
 is null: the container, the logger, the wrapper, or the context.

 - -chris
 
 I thought the same (I suppose only container or the logger can be null, 
 according to the stacktrace, because if the wrapper or the context were null, 
 it should have printed a different line number). Unfortunately, I don't see 
 this NPE anymore so I can't use a modified Tomcat to debug it.

Are you using parallel deployment or are you replacing the existing
application when it's redeployed.

Maybe the old context is the one throwing the error.


p



signature.asc
Description: OpenPGP digital signature


Re: Need help debugging JSP compilation failure

2011-07-06 Thread Pid
On 06/07/2011 21:54, Mike Spreitzer wrote:
 I install a fresh copy of the latest Tomcat (7.0.16), and deploy my WAR by 
 copying it into Tomcat's webapps/.  Then I startup Tomcat and direct my 
 browser to my web app's welcome page --- which is a JSP.  The compilation 
 of the JSP fails but with very little information.  All I get is the line 
 number of the JSP where something went wrong; I get that in Tomcat's 
 logs/localhost.{date}.log.  How can I get more information about what is 
 going wrong?

What else do you get a line number and what?

Did you precompile the JSPs in the app?
If not, the work directory contains the .java file from the parsed JSP.


p


 I am running Tomcat on MacOS 10.6.8 on my MacBook Pro (Intel), with 
 
 $ java -version
 java version 1.6.0_26
 Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
 Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
 
 Thanks,
 Mike Spreitzer
 




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 applet session problem

2011-07-06 Thread Pid
On 06/07/2011 21:54, S Arvind wrote:
 Hi All,
  Web application presently running in the tomcat 6 which has applet
 in it. In that applet we make a connection to server using URL class and get
 some data from the server after it loads. In this process we got error after
 updating to the tomcat 7. The problem is the session between the web
 application and the applet varies which runs in the same browser tab. Dont
 know why in tomcat 7 the applet request was considered as separate session
 but instead in tomcat 6 bot are considered as same session request. Is there
 any configuration changes for it?

Tomcat 7.0.x and later versions of 6.0.x change the session id after
authentication*.  You can't rely on the session id remaining the same,
the applet will need to check for session id changes in the cookie (or url).


p

* In order to prevent some session hijacking attacks



signature.asc
Description: OpenPGP digital signature


Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-07-04 Thread Pid
On 04/07/2011 05:23, Rohan Kadam wrote:

 I am not getting what I am supposed to do?

 
  After that Iwent to Java Tab, and added the below line in Java Option 
  Section.
  Please let me know if I am missing something.

 The line.


Chris was asking you to specify the line you refer to as being 'below',
above.  The thread had become lengthy by then and so you could be
referring to anything.  Being specific helps us help you.


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 Embedded: Manager

2011-07-03 Thread Pid
On 01/07/2011 20:49, Dark Before Dawn wrote:
 Hi Pid, hi Cuck!
 thanks for your help. Your suggestions fixed the naming issues :) thanks!
 
 But the error still occurs.
 
 FAIL - Encountered exception javax.management.InstanceNotFoundException: 
 Tomcat:type=Deployer,host=localhost

The Deployer isn't in the list of MBeans visible in your JConsole
screenshot, which is probably why you can't connect to it.

I don't know why that is, but presumably the embedded code doesn't
enable it.


 I noticed an empty javax.management.ObjectName[0] Array, when browsing 
 Servlet via jconsole. This could be in correlation to the exception above.

The two things are not related.  The empty array refers to child objects
of the servlet (should there be any? no...), not the webapp.


p

 See screenshots for further reference.
 
 If this is over we definitively need to grab some beer, I am buying :)
 
 
 
 
 Am 01.07.2011 17:54, schrieb Pid:
 On 01/07/2011 12:44, Dark Before Dawn wrote:
 Hi Pid,
 i guess the problem is that the manager-servlet's context is mounted
 at root and the ServletMapping points to /manager.

 server.addContext(, baseDirectory);
 ctx.addServletMapping(/manager/*, manager-servlet);
 So all relative paths will point to root
 That's easy to change, no?

  server.addContext(/manager, baseDirectory);
  ctx.addServletMapping(/text/*, manager-servlet);

 Note the additional '*' in the security collection:

  collection.addPattern(/text/*);

 (The role usually assigned for the text manager servlet is manager-script)


 p


 ie:

 localhost/manager/html vs localhost/html

 I don't know what I am exactly searching for at jconsole, so here is a 
 overview :)
 Thnx and cheers
 Darky




 Am 01.07.2011 12:46, schrieb Pid:
 On 01/07/2011 10:40, Dark Before Dawn wrote:
 Hi again,
 this is realy driving me nuts for weeks :)
 FAIL - Encountered exception javax.management.InstanceNotFoundException:
 Tomcat:type=Deployer,host=localhost
 1. Connect to your running instance with JConsole*.
 2. Examine the MBeans published by the instance.
 3. Confirm that you are connecting to the correct MBean.


 I wouldn't expect:

  Tomcat:type=Deployer,host=localhost

 to work.


 p


 * or VisualVM with the JConsole plugin enabled.


 




signature.asc
Description: OpenPGP digital signature


Re: webapps and TCP/UDP listening sockets

2011-07-01 Thread Pid
On 01/07/2011 04:45, Tim Judd wrote:
 Hi Christopher, all
 
 'machine' was meant to indicate one of two choices, the computer that is 
 running 
 the tomcat server, or the computer who is the client in a client-server 
 relationship.  

So you meant the client or the server.

 I don't know the intricities of webapps yet in how they run.  

Probably a good idea to read up on that if you're going to build one.

 This thread was just trying to understand if I'm barking up the wrong tree.
 
 Your second paragraph is better phrased.  which computer/'machine' is doing 
 the 
 binding?  

Whichever one the code for creating a socket is running on.  When you
create a client socket it still uses a port local to the JVM you're
running the code in.


 Writing a standalone Java desktop app is most definately going to bind 
 to it's own machine.  I don't need to delegate anything to Tomcat itself, I 
 need 
 to know if I run a webapp and it binds and listens to a socket, which machine 
 does it bind on?

Some confusion here still, it's nothing to do with a webapp and entirely
to do with the location of the code.


 Lastly, your statement about making it a webapp if http is not involved is 
 because to centrally deploy an application is often served off http; I wanted 
 to 
 get into Java/webapps so I elected this route.

You want to get into webapps, so you're build an app which has nothing
to do with webapps?


 If they are standalone protocols 
 (and they will be) to communicate between many clients to one (or a farm) of 
 servers, why can't I launch it from http?

Why would you?  What does the servlet container offer that running the
code independantly doesn't?

You're not describing an application which uses the http connectors
provided by Tomcat to operate, you're just using Tomcat as a launch
wrapper for your app.


p



  If opportunity doesn't knock, build a door.
 I can is a way of life.
 More and Bigger is not always Better.
 The road to success is always uphill.
 
 
 
 
 
 From: Christopher Schultz ch...@christopherschultz.net
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thu, June 30, 2011 8:07:55 PM
 Subject: Re: webapps and TCP/UDP listening sockets
 
 Tim,
 
 On 6/30/2011 7:14 PM, Tim Judd wrote:
 If I develop a webapp that listens for TCP/UDP sockets, which machine is 
 actually listening?
 
 When you say machine... you mean ... what, exactly?
 
 If you develop a webapp that listens for TCP/UDP sockets, where is the
 socket bind occurring? If it's your webapp, then it really has nothing
 to do with Tomcat at all: it's just like writing a non-webapp program
 that binds to a socket and listens.
 
 If you want to delegate incoming requests to threads from Tomcat's
 request processor pool, that might be a bit tricky. Is that what you'd
 like to do?
 
 Do you really need Tomcat in this situation?
 
 Is the tomcat server listening (because the webapp is 
 running on that tomcat) or is the client listening (because he is running 
 the 
 webapp on the tomcat server)!
 
 Probably both, but it depends on your answer to the above questions.
 
 My goal is to have:
   single UDP listening at tomcat server for packets, and
   multicast UDP listening at the clients that is getting resended off the 
 single 
 
 above UDP port from the webapp tomcat server
 
 Why do you want to build this as a web-based application if HTTP isn't
 really involved?
 
 -chris

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




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 Embedded: Manager

2011-07-01 Thread Pid
On 01/07/2011 10:40, Dark Before Dawn wrote:
 this is realy driving me nuts for weeks

so *does* the arbit*rary* use of *bold* for me.


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 Embedded: Manager

2011-07-01 Thread Pid
On 01/07/2011 10:40, Dark Before Dawn wrote:
 Hi again,
 this is realy driving me nuts for weeks :)


 FAIL - Encountered exception javax.management.InstanceNotFoundException:
 Tomcat:type=Deployer,host=localhost

1. Connect to your running instance with JConsole*.
2. Examine the MBeans published by the instance.
3. Confirm that you are connecting to the correct MBean.


I wouldn't expect:

 Tomcat:type=Deployer,host=localhost

to work.


p


* or VisualVM with the JConsole plugin enabled.



signature.asc
Description: OpenPGP digital signature


Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-07-01 Thread Pid
On 30/06/2011 21:57, Christopher Schultz wrote:
 Rohan,
 
 On 6/30/2011 8:01 AM, Rohan Kadam wrote:
 We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier facing
 problem that tomcat was not able to connect using Static IP address. The fix
 that we found was adding
 address = 0.0.0.0 in the Connector tag of server.xml in the conf 
 directory.
 
 This was likely because your JVM prefers an IPv6 stack, while using an
 IPv4 address (0.0.0.0) explicitly causes it to bind to an IPv4 address.
 
 When you say not able to connect, do you mean that the client couldn't
 reach Tomcat, or that Tomcat couldn't connect to some other server?
 
 After upgrading tomcat to 7.0.14, we have done the same process, but we are
 not able to connect.

Hint:  JAVA_OPTS=-Djava.net.preferIPv4Stack=true  can be set in
setenv.sh|bat


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-07-01 Thread Pid
On 01/07/2011 12:07, Rohan Kadam wrote:
 I have tries to set this java option in catalane .bat, but no success
 
 -Djava.net.preferIPv4Stack=true
 
 I am using tomcat as a service, so configures the same in Java properties as 
 well. But it is not working.

How are you setting it, exactly?


p


 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Friday, July 01, 2011 4:18 PM
 To: Tomcat Users List
 Subject: Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)
 
 On 30/06/2011 21:57, Christopher Schultz wrote:
 Rohan,

 On 6/30/2011 8:01 AM, Rohan Kadam wrote:
 We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were 
 earlier facing problem that tomcat was not able to connect using 
 Static IP address. The fix that we found was adding address = 
 0.0.0.0 in the Connector tag of server.xml in the conf directory.

 This was likely because your JVM prefers an IPv6 stack, while using an
 IPv4 address (0.0.0.0) explicitly causes it to bind to an IPv4 address.

 When you say not able to connect, do you mean that the client 
 couldn't reach Tomcat, or that Tomcat couldn't connect to some other server?

 After upgrading tomcat to 7.0.14, we have done the same process, but 
 we are not able to connect.
 
 Hint:  JAVA_OPTS=-Djava.net.preferIPv4Stack=true  can be set in 
 setenv.sh|bat
 
 
 p
 
 
 Legal Disclaimer: This electronic message and all contents contain 
 information from Cybage Software Private Limited which may be privileged, 
 confidential, or otherwise protected from disclosure. The information is 
 intended to be for the addressee(s) only. If you are not an addressee, any 
 disclosure, copy, distribution, or use of the contents of this message is 
 strictly prohibited. If you have received this electronic message in error 
 please notify the sender by reply e-mail to and destroy the original message 
 and all copies. Cybage has taken every reasonable precaution to minimize the 
 risk of malicious content in the mail, but is not liable for any damage you 
 may sustain as a result of any malicious content in this e-mail. You should 
 carry out your own malicious content checks before opening the e-mail or 
 attachment. 
 www.cybage.com




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7 Embedded: Manager

2011-07-01 Thread Pid
On 01/07/2011 12:44, Dark Before Dawn wrote:
 Hi Pid,
 i guess the problem is that the manager-servlet's context is mounted
 at root and the ServletMapping points to /manager.
 
 server.addContext(, baseDirectory);
 ctx.addServletMapping(/manager/*, manager-servlet);
 
 So all relative paths will point to root

That's easy to change, no?

 server.addContext(/manager, baseDirectory);
 ctx.addServletMapping(/text/*, manager-servlet);

Note the additional '*' in the security collection:

 collection.addPattern(/text/*);

(The role usually assigned for the text manager servlet is manager-script)


p


 ie:
 
 localhost/manager/html vs localhost/html
 
 I don't know what I am exactly searching for at jconsole, so here is a 
 overview :)
 Thnx and cheers
 Darky
 
 
 
 
 Am 01.07.2011 12:46, schrieb Pid:
 On 01/07/2011 10:40, Dark Before Dawn wrote:
 Hi again,
 this is realy driving me nuts for weeks :)

 FAIL - Encountered exception javax.management.InstanceNotFoundException:
 Tomcat:type=Deployer,host=localhost
 1. Connect to your running instance with JConsole*.
 2. Examine the MBeans published by the instance.
 3. Confirm that you are connecting to the correct MBean.


 I wouldn't expect:

  Tomcat:type=Deployer,host=localhost

 to work.


 p


 * or VisualVM with the JConsole plugin enabled.

 




signature.asc
Description: OpenPGP digital signature


Re: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-30 Thread Pid
On 30/06/2011 02:10, Bob DeRemer wrote:
 Chris,
 
 Thanks for the feedback.  I haven't come across squid yet, so I will take a 
 look.  With regard to HTTP proxying, no, I don't want to do HTTP proxying.  I 
 would like to insert a TCP-based NIO request router in place of Tomcat's 
 Connector.  Specifically, I would like to do something similar to the Netty 
 Port Unification sample, but with HTTP AND XMPP protocols.  Netty has the 
 ability to inspect the incoming request and then get outta the way - adding 
 the appropriate Channel for processing the request.  
 
 The problem I'm facing is that we're using Tomcat as our App Server and we 
 can't easily replace that with a non-servlet based solution at this point.   
 As a result, I was trying to determine if there is a way to create some type 
 of Tomcat extension that where I could do the initial request routing and 
 pass HTTP request on to the Tomcat's plumbing without running the built-in 
 HTTP connector(s).

You'd have to write your own connector implementation, or hack an
existing one - in Tomcat 7.0 there's some work being done to consolidate
the connector code, so you'd be wise to start there.

Is XMPP over HTTP a possibility, and if so could the applicable code run
inside a Servlet?


Sounds like a 'square peg, round hole' type situation...


p



 Thanks,
 Bob
 
 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Sent: Wednesday, June 29, 2011 2:51 PM
 To: Tomcat Users List
 Subject: Re: HOW TO: create custom Tomcat 6 connector to do port sharing
 
 Bob,
 
 On 6/29/2011 1:10 PM, Bob DeRemer wrote:
 I've scoured the net for information on how to do port sharing within 
 the context of a Tomcat Servlet-based web application process.
 While there's some discussion, there still doesn't appear to be any 
 solutions [YET] - that I could find yet.
 
 What I need to do is the following:
 
 * receive both HTTP and XMPP traffic on a single port [either 80 or
   443 - depending on security configuration]
 
 * route the HTTP traffic to Tomcat's HTTP Connector [or
   sub-processing component] if possible
 
 * route the XMPP to an embedded Vysper server
 
 All of the above should be doable using something like Squid. Does Squid do 
 pretty much everything?
 
 * ALL running in the context of a single Tomcat Server process
 
 Oh.
 
 You want Tomcat to do HTTP proxying? AFAIK, nobody has done that. Most people 
 who want HTTP proxying just use some other web server out in front of Tomcat 
 (like Apache httpd, Squid, Nginx, lighttpd, HTTP lb, etc.). I have to imagine 
 that at least one of those products can do content-detection to determine 
 where to route messages.
 
 Does it /have to/ be Tomcat-based?
 
 This will enable us to leverage the power/investment in our servlet 
 infrastructure and Vysper XMPP all together without having to open 
 multiple ports.
 
 If this is possible in either Tomcat 6 or Tomcat 7, please let me know 
 how I should go about this:
 
 * doing some custom extension in Tomcat (i.e. custom Tomcat
   connector that uses Netty for example)
 
 * or, some other approach ???
 
 If you want to brute-force it, you could write a servlet Filter (or, better 
 yet, a Tomcat-specific Valve that runs before the request is mapped to a 
 webapp) to intercept the messages and proxy them over to your other 
 service(s). You'll have to do the HTTP proxying yourself, though.
 
 please advise on how you would recommend achieving our goal.
 
 Honestly, I'd look for a non-Tomcat-centric solution because it's probably 
 already been built elsewhere.
 
 -chris

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





signature.asc
Description: OpenPGP digital signature


Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-06-30 Thread Pid
On 30/06/2011 13:01, Rohan Kadam wrote:
 Hi All,
 
 We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier facing
 problem that tomcat was not able to connect using Static IP address. The fix
 that we found was adding
 address = 0.0.0.0 in the Connector tag of server.xml in the conf 
 directory.
 
 
 After upgrading tomcat to  7.0.14, we have done the same process, but we are
 not able to connect.

Have you also upgraded Java?  What version (exactly) of Java are you using?


p



signature.asc
Description: OpenPGP digital signature


Re: tomcat application manager

2011-06-29 Thread Pid
On 29/06/2011 10:21, gautam wrote:
 Hi Friends,
 
 I had deployed a war file(generated through eclipse) on tomcat5.5 running on
 windows server2008. It gives me error 404 and it's running status in tomcat
 application manager shows 'false'.
 While same war file is running smooth on tomcat5.5 running on Windows xp and
 windows seven.
 
 I can't figure out the problem. Please help 

Exactly which version of Tomcat 5.5?

What do the logs say?


p



signature.asc
Description: OpenPGP digital signature


Re: DNS Netwrork address Cache

2011-06-29 Thread Pid
On 29/06/2011 08:02, Venky Vasant wrote:
 I have a configuration setting of 10 minutes (networkaddress.cache.ttl=600) o 
 n java security file 
  
 Will just a tomcat service restart help in clearing the cache or do i also 
 need to run ipconfig/flushdns.

The DNS cache in Java is independent of the OS network.


p



signature.asc
Description: OpenPGP digital signature


Re: tomcat recovery after hang

2011-06-29 Thread Pid

 In addition I found a webpage that tells how to check when tomcat falls, 
 (checking PID or Service status)
 the problem is that when my tomcat hangs it still working, Can't use that 
 methods 

Instead of trying to work around the problem, why not try to understand
why Tomcat (or more likely your application) is 'hanging'?

What do the logs say when this happens?

Is the JVM really still running?

Have you taken a thread dump?


p



signature.asc
Description: OpenPGP digital signature


Re: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-29 Thread Pid
On 29/06/2011 19:51, Christopher Schultz wrote:
 Honestly, I'd look for a non-Tomcat-centric solution because it's
 probably already been built elsewhere.
 
 -chris

Why is opening another port a problem?


p



signature.asc
Description: OpenPGP digital signature


Re: fail to download large static files in tomcat

2011-06-27 Thread Pid
On 27/06/2011 11:42, Michal Singer wrote:
 Hi, I am working with apache-tomcat-6.0.18 and I want to use it to download 
 static files.

Please post a new message to the list, rather than editing  replying to
an existing thread.


p



signature.asc
Description: OpenPGP digital signature


Re: Allow Servlet to Control 100-continue response

2011-06-19 Thread Pid
On 18/06/2011 06:53, Rehtron wrote:
 Hi
 
 Currently if a client supplies the Expect: 100-continue header on a POST
 or PUT, Tomcat appears to send the response header (100-continue) before
 passing control to the servlet.

Out of interest, are you asking to control specifically the 100
response, or all access to the servlet?

Are you currently implementing access control logic inside the servlet?


p

 I need to use the servlet  to control this response and accept/reject the
 request before receiving the request content, Is there anyone could give me
 some advice?
 
 Thanks.
 




signature.asc
Description: OpenPGP digital signature


Re: Allow Servlet to Control 100-continue response

2011-06-19 Thread Pid
On 19/06/2011 11:59, Rehtron wrote:
 I will investigate the Tomcat Valve mechanism, but one thing is for sure,
 the Valve based implementation depend on the Tomcat private implementation,
 that means I cannot use Jetty to do unit test.

Why not test with Tomcat instead?


 Can Servlet 3.0 Comet implement this?

Servlet 3.0 OR Comet.  They are not the same, in any case Async requests
are unrelated to your original inquiry.


p



signature.asc
Description: OpenPGP digital signature


Re: FW: How to configure Tomcate 7 to remove OutOfMemory permgen error

2011-06-19 Thread Pid
On 19/06/2011 20:57, Thomas Adler wrote:
 
 
 Hi!
 
 I am trying to use MyEclipse - I have simple database with 5 tables and I am 
 trying to use MyEclipse Spring 3 CURD application scaffolding to generate 
 Spring CRUD application, that uses Spring 3, Hibernat, Java Servlets 3, JSF 2 
 and Primefaces 2.1 JSF components - as I understand - Tomcat 7 support such 
 applications. My problem is that during deployment of generated application 
 Tomcat 7 reports OutOfMemory permgen error. I have experienced similar error 
 on other application servers previously (e.g. Glassfish), but I could remove 
 it then by changing server configuration.
 
 I have tried to change Tomcat 7 configuration as well - e.g. added JAVA_OPTS 
 to Catalina configuration file, added environment variable JAVA_OPTS to my 
 Microsoft Vista machine:
 -XX:PermSize=1024M -XX:MaxPermSize=1024M
 but permgen error occurs again and again (even after restarting computer and 
 so on). I am using Tomcat 7.0.14.
 So - the question is - how to configure Tomcat 7 to increase the available 
 memory?
 
 If I have tried to deploy my application on Tomcat 6 and for biggest part it 
 gone well, namely, at the end it does not work, because Tomcat 6 is not for 
 Servlet 3 (as I understand), but at least - there were not permgen errors.

If you're using Tomcat inside Eclipse, you have to find the IDEs
configuration mechanism - editing the Tomcat config won't help as it
uses separate files.

This is an IDE question, rather than a Tomcat one, it comes up
sufficiently frequently that you'll probably find similar questions and
relevant answers in the MyEclipse/Eclipse forums.


p



signature.asc
Description: OpenPGP digital signature


Re: Deploy Problem [SEC=UNCLASSIFIED]

2011-06-16 Thread Pid
On 16/06/2011 08:46, Reinhard Hnat wrote:
 Is it this what you mean with 'stacktrace'?

Yes.

The AccessControlException indicates that you have the Java Security
Manager enabled, at a guess you're probably running a repackaged version
of Tomcat on Linux - where the packager has configured the Security
Manager to be switched on.

Look in /etc/default/tomcat6 for a way to change this.


p



 16.06.2011 09:04:08 org.apache.catalina.core.ApplicationContext log
 INFO: Marking servlet ClickServlet as unavailable
 16.06.2011 09:04:08 org.apache.catalina.core.StandardContext loadOnStartup
 SEVERE: Servlet /GealogWeb threw load() exception
 javax.servlet.UnavailableException:
 java.security.AccessControlException: access denied
 (java.util.PropertyPermission click.mode read)
 at org.apache.click.ClickServlet.init(ClickServlet.java:222)
 at javax.servlet.GenericServlet.init(GenericServlet.java:212)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 
 at java.lang.reflect.Method.invoke(Method.java:616)
 at
 org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
 at
 org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
 at
 org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
 
 at
 org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115)
 
 at
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1166)
 
 at
 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
 at
 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
 
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 
 at
 org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123)
 at
 org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
 
 at java.security.AccessController.doPrivileged(Native Method)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at
 org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
 at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1231)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 
 at java.lang.reflect.Method.invoke(Method.java:616)
 at
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
 
 at
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:857)
 
 at
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:795)
 at
 org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1471)
 at
 org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:243)
 
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 
 at java.lang.reflect.Method.invoke(Method.java:616)
 at
 org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
 at
 org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
 at
 org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
 
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
 
 at
 org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
 
 at
 org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
 
 at java.security.AccessController.doPrivileged(Native Method)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
 
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 
 at
 

Re: Feature request: fullstart command

2011-06-16 Thread Pid
On 15/06/2011 21:00, Francis GALIEGUE wrote:
 Tomcat has many abilities to deploy applications at run time (war,
 tree, context, you name it). However, when used in production, these
 abilities are used cautiously, if they are used at all.
 
 In many scenarios, Tomcat just starts, spends its life, and stops,
 with a defined set of webapps, and has no automatic deployment
 capabilities configured in at all. But the builtin startup scripts,
 and in fact, the Java code itself, lack at least two critical inputs
 for such scenarios:
 
 * Bootstrap will return (and therefore the startup scripts too) before
 webapps configured at startup time are deployed, and while
 bootstrapping is fast, deploying applications at startup can be very
 long;
 * even with a hackish way (watch the log file to account for complete
 server startup) in order to wait for webapps to be deployed, there is
 no status about these deployments at all (has this and that webapp
 been deployed successfully?).

An application might report that it's started, even it hasn't finished
initialising.


 Proposal: implement a fullstart command to Bootstrap which:
 
 * does NOT return until ALL webapps configured at start time are
 (attempted to be) deployed;
 * exits with a positive error code representing the number of webapps
 NOT correctly deployed (or 1 - I don't care as long as it's not 0, but
 please not -1, think WIFSIGNALED()).

'fullstart' is an odd name, people might start using it thinking that
'start' did not fully start the server.

Returning an exit code which describes the number of apps successfully
started isn't much use unless you (or the init script) know the number
of apps configured.


p



signature.asc
Description: OpenPGP digital signature


Re: Feature request: fullstart command

2011-06-16 Thread Pid
On 16/06/2011 12:15, Francis GALIEGUE wrote:
 On Thu, Jun 16, 2011 at 12:29, Pid p...@pidster.com wrote:
 [...]

 An application might report that it's started, even it hasn't finished
 initialising.

 
 That is the application's responsibility, so not the problem at hand.

What is the value of indicating success or failure, if the answer is
only partially true?  You can't know for certain whether the answer you
have is meaningful, so it's useless.


 Furthermore, if the application reports a successful start even though
 it is not completely initialized, i consider this an application
 fault, therefore not my concern. 

That makes no sense to me.


 As the person being responsible for
 the good behavior of applications in production, I expect webapps that
 I deploy to behave correctly, ie fail to deploy in the event of an
 initialization failure. 

That seems contradictory, but it's probably my misunderstanding.


Tomcat won't provide me with this information,
 EXCEPT if I use the manager webapp (in text mode, of course) to deploy
 it, as I can parse the return message.

Yes it will, using the same mechanism that the manager webapp uses; you
can interact with Tomcat over JMX, the API gives you detailed
information about applications.



 [...]

 'fullstart' is an odd name, people might start using it thinking that
 'start' did not fully start the server.

 
 Which is the case in this particular scenario! OK, maybe not
 fullstart, but appstart, something else... As long as this command
 doesn't complete before all webapps configured at startup have
 attempted a deployment.
 
 Returning an exit code which describes the number of apps successfully
 started isn't much use unless you (or the init script) know the number
 of apps configured.

 
 No, you misread what I say. 

Ok.


p

What I want is the return code to be the
 number of webapps NOT successfully deployed. But even that, I reckon,
 is not that good an idea: the JVM will return 1 in the event of an
 uncaught exception (or thrown from main()). So, 1+n, where n is the
 number of webapps not successfully deployed. But in any case, obey the
 basic principle that 0 means success, and anything else means a
 failure.




signature.asc
Description: OpenPGP digital signature


Re: Static content not displaying

2011-06-15 Thread Pid
On 15/06/2011 13:41, Flaherty, Brennen F wrote:
 we have an application that works as expected on tomcat version 6.0.29 on a 
 windows server . If I try to copy the war to a machine running version 6.0.32 
 none of the static content will display. If I copy the war file to a 
 different machine with version 6.0.29 installed the static content displays 
 correctly. In both cases the non static content displays as it should
 
 Does anyone have any ideas why?

In future, please start a new thread rather than editing  replying to
an existing one, which is called thread-hijacking.


p



signature.asc
Description: OpenPGP digital signature


Re: One process per webapp

2011-06-15 Thread Pid
On 15/06/2011 14:20, cowwoc wrote:
 If this functionality was built into Tomcat

It wouldn't be built into Tomcat, you're asking for a management
application and/or proxy.  The first might run inside Tomcat and the
second sits in front of it - frequently implemented with Apache HTTPD
(mod_proxy, mod_jk).

Why should Tomcat duplicate this functionality, when it already exists?

What you're really asking for should be directed at Netbeans, not anyone
here.


p



signature.asc
Description: OpenPGP digital signature


Re: Need help deploying web-service to EC2 with Tomcat7

2011-06-14 Thread Pid
On 14/06/2011 08:03, Lisa and Terence Davis wrote:
 
 Hi Everyone,
 
 I have a web-service that I've developed using Tomcat7/MySQL5 using
 NetBeans 7.  In the IDE it all works fine.  For testing however, I need
 to get it onto an EC2 instance so users other than me can access it.  I
 have created an EC2 micro-instance, installed Tomcat 7 and MySQL 5 (the
 same versions as on my dev env) and deployed my .war file.  The
 deployment succeeds at least partially because I can get to the simple
 static Hello World index jsp page and because it tries to access my
 database user (which I then created).  I don't see any errors in the log
 and I've gone back-and-forth trying all sorts of desperate things to try
 and get this working.  I'm sure there must be a simple solution but I
 just don't know what it is.

What do the logs say?


p



signature.asc
Description: OpenPGP digital signature


Re: One process per webapp

2011-06-14 Thread Pid
On 13/06/2011 22:53, Christopher Schultz wrote:
 Gili,
 
 On 6/13/2011 1:07 PM, cowwoc wrote:
 I posted a RFE at https://issues.apache.org/bugzilla/show_bug.cgi?id=51366
 asking for the ability to seamlessly deploy webapps into separate JVMs.
 
 So you want Tomcat to have an option to run as a supervisor in one JVM
 and deploy webapps to separate JVMs?

You can, right now, start blank Tomcat instances and deploy apps to them
- managing the instance using JMX.

What you can't do, is seamlessly transfer request processing from one
running JVM to another - using Tomcat instances alone - because you
can't exactly determine when one instance releases a port, enabling
another to bind to it.

This is why I referred to parallel deployment, which does permit
seamless transfer to a new version of the app.


 Tomcat 7.0's parallel deployment sounds nice but it still doesn't solve the
 JNI and memory leak problems that haunt a single JVM architecture.

Tomcat has some memory leak prevention capability (since 6.0.24) but JNI
memory issues it can't prevent.  What problems are you seeing?


 Parallel deployment is at once orthogonal to and the opposite of what
 you are requesting.

Yeah, my fault, I misread what he was asking.  See above.


 Please read the proposal and let me know what you think.
 
 What single management interface are you describing in your
 enhancement comments? The Tomcat manager webapp? It's trivial to run a
 manager in each JVM and use that for deployment.
 
 If you know that your webapp needs to do things such as register a
 shared library on startup, you can do one of two things:
 
   1. Always bounce Tomcat directly instead of re-loading the webapp
   2. Fix the webapp so it doesn't bomb on startup when the library
  is already loaded
 
 Tomcat provides the manager webapp and ant tasks to access it, plus a
 toolbox of scripts to start/stop/etc. Tomcat. Your needs seem to be
 fairly specific... why not just roll your own solution?

Bouncing a JVM requires admin access to the local operating system,
which you probably wouldn't want to give to a Tomcat application.

Assuming I've understood correctly this time.


p


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





signature.asc
Description: OpenPGP digital signature


Re: user tomcat authentication

2011-06-13 Thread Pid
On 13/06/2011 07:50, Petr Hracek wrote:
 First authentication is done so that if in the browser exists relevant
 HTTP COOKIE and validation of that cookie is done then page should be
 shown.
 How to do that I do not know from the tomcat point of view.
 
 Is there any possiblity how to check valid HTTP COOKIE otherwise
 showing loging page.
 
 If HTTP COOKIE is not existing than logging has to be done over my one 
 program.
 How to do that I do not know as well.
 
 Are there any examples?

From the little information you give, you're describing container
managed security.  FORM auth as defined by the Servlet Spec can do just
that.

You configure a Realm, some elements in web.xml which define where the
login form  error pages are, and which URLs are protected.


p



 2011/6/13 Petr Hracek phrac...@gmail.com:
 First authentication is done so that if in the browser exists relevant
 HTTP COOKIE and validation of that cookie is done then page should be
 shown.


 2011/6/12 Mark Thomas ma...@apache.org:
 On 12/06/2011 20:29, Pid wrote:
 On 12/06/2011 17:12, Petr Hracek wrote:
 And what about in case that I have my own program for accessing to the
 specific
 databases where the passwords are stored as hashes?

 Are there any possibilities how to run that program for getting unhashed
 password from database?

 Why not hash the inbound password, then send  compare it against the
 one in the DB, rather than decoding it?

 The Realm implementations can handle this, if you're using a standard
 hashing method that Java recognises.

 Hopefully you've not invented your own hashing method.

 Hmm. Hash functions are meant to be one way. It should be impossible to
 retrieve an unhashed password from the database.

 I hope that the original description is inaccurate rather than an
 example of (yet another) badly broken home-grown security solution that
 needs to be thrown away.

 Mark

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





 --
 Best Regards / S pozdravem
 Petr Hracek

 
 
 




signature.asc
Description: OpenPGP digital signature


Re: user tomcat authentication

2011-06-12 Thread Pid
On 12/06/2011 17:12, Petr Hracek wrote:
 And what about in case that I have my own program for accessing to the
 specific
 databases where the passwords are stored as hashes?
 
 Are there any possibilities how to run that program for getting unhashed
 password from database?

Why not hash the inbound password, then send  compare it against the
one in the DB, rather than decoding it?

The Realm implementations can handle this, if you're using a standard
hashing method that Java recognises.

Hopefully you've not invented your own hashing method.


p


 best regards
 Petr
 Dne 10.6.2011 16:23, Pid napsal(a):
 On 10/06/2011 11:26, Petr Hracek wrote:
 Dear tomcat users,

 I would like to ask you how can I authenticate users to access tomcat
 page?
 My users are stored in standard /etc/passwd file
 I'm not sure I'd give Tomcat access to the local user authentication.


 or users which are stored in another database engine than Realm
 You can configure a DataSource  a DataSourceRealm to point at any
 database.


 p

 thank you in advance


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




signature.asc
Description: OpenPGP digital signature


Re: Classpath issue *only* when starting tomcat 6 as a service

2011-06-10 Thread Pid
On 10/06/2011 09:38, Patrick Guillot - Genigraph wrote:
 Jvm Option[8]
 -Djava.class.path=D:\tomcat\bin\tomcat-juli.jar;D:\tomcat\bin\bootstrap.jar;
 D:\tomcat\lib\annotations-api.jar;D:\tomcat\lib\catalina-ant.jar;D:\tomcat\l
 ib\catalina-ha.jar;D:\tomcat\lib\catalina-tribes.jar;D:\tomcat\lib\catalina.
 jar;D:\tomcat\lib\el-api.jar;D:\tomcat\lib\jasper-el.jar;D:\tomcat\lib\jaspe
 r-jdt.jar;D:\tomcat\lib\jasper.jar;D:\tomcat\lib\jsp-api.jar;D:\tomcat\lib\s
 ervlet-api.jar;D:\tomcat\lib\tomcat-coyote.jar;D:\tomcat\lib\tomcat-dbcp.jar
 ;D:\tomcat\lib\tomcat-i18n-es.jar;D:\tomcat\lib\tomcat-i18n-fr.jar;D:\tomcat
 \lib\tomcat-i18n-ja.jar;D:\tomcat\lib\jna.jar;D:\tomcat\lib\platform.jar;D:\
 tomcat\lib\waffle-jna.jar;D:\tomcat\lib\commons-logging-1.1.1.jar
 
 Jvm Option[9] vfprintf
 
 Jvm Option[10] -Xms256m
 
 Jvm Option[11] -Xmx512m
 
  
 
 As you can see : java.class.path do include “catalina.jar”.

Don't set the classpath.  Tomcat does that itself.


p



signature.asc
Description: OpenPGP digital signature


Re: Classpath issue *only* when starting tomcat 6 as a service

2011-06-10 Thread Pid
On 10/06/2011 09:38, Patrick Guillot - Genigraph wrote:
 Hi everybody,
 
  
 
 I’m driving mad with a classpath issue : 
 
  
 
 My environment : 
 
 -  Tomcat 6.0.29
 
 -  Windows Server 2008 R2 Standard 64 bits
 
 -  JDK 1.5.0_22
 
  
 
 My webapp is using Waffle (Windows Authentication Framework)
 (http://waffle.codeplex.com/) to benefit from transparent authentication.
 
  
 
 It is working just fine when tomcat is started in console mode. But console
 mode is not suitable for production use.
 
 Therefore, I set-up Tomcat 6 as a service
 (http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html).
 
  
 
 In this mode, tomcat does not start properly and I get a classpath error :
 
 java.lang.NoClassDefFoundError:
 org/apache/catalina/authenticator/AuthenticatorBase
 
 If not using Waffle, the service mode is working fine as well.
 
 AuthenticatorBase is used by Waffle.
 
  
 
 I found that this class is located “catalina.jar”.
 
 “Catalina.jar” is located in D:\tomcat\lib\ (catalina.home\lib).
 
 So, I do have the right jar and it contains the right class (which again is
 found by tomcat when started in console mode).
 
  
 
 My guess was I had a service configuration error : I checked everything and
 can’t find any error – which does not mean there is no error ! ;-)
 
 Here is the service configuration logged by tomcat : 
 
  
 
 Jvm Option[0]
 -Djava.class.path=D:\tomcat\bin\tomcat-juli.jar;D:\tomcat\bin\bootstrap.jar;
 D:\tomcat\lib\annotations-api.jar;D:\tomcat\lib\catalina-ant.jar;D:\tomcat\l
 ib\catalina-ha.jar;D:\tomcat\lib\catalina-tribes.jar;D:\tomcat\lib\catalina.
 jar;D:\tomcat\lib\el-api.jar;D:\tomcat\lib\jasper-el.jar;D:\tomcat\lib\jaspe
 r-jdt.jar;D:\tomcat\lib\jasper.jar;D:\tomcat\lib\jsp-api.jar;D:\tomcat\lib\s
 ervlet-api.jar;D:\tomcat\lib\tomcat-coyote.jar;D:\tomcat\lib\tomcat-dbcp.jar
 ;D:\tomcat\lib\tomcat-i18n-es.jar;D:\tomcat\lib\tomcat-i18n-fr.jar;D:\tomcat
 \lib\tomcat-i18n-ja.jar;D:\tomcat\lib\jna.jar;D:\tomcat\lib\platform.jar;D:\
 tomcat\lib\waffle-jna.jar;D:\tomcat\lib\commons-logging-1.1.1.jar


 Jvm Option[7] -XX:MaxPermSize=256M
 
 Jvm Option[8]
 -Djava.class.path=D:\tomcat\bin\tomcat-juli.jar;D:\tomcat\bin\bootstrap.jar;
 D:\tomcat\lib\annotations-api.jar;D:\tomcat\lib\catalina-ant.jar;D:\tomcat\l
 ib\catalina-ha.jar;D:\tomcat\lib\catalina-tribes.jar;D:\tomcat\lib\catalina.
 jar;D:\tomcat\lib\el-api.jar;D:\tomcat\lib\jasper-el.jar;D:\tomcat\lib\jaspe
 r-jdt.jar;D:\tomcat\lib\jasper.jar;D:\tomcat\lib\jsp-api.jar;D:\tomcat\lib\s
 ervlet-api.jar;D:\tomcat\lib\tomcat-coyote.jar;D:\tomcat\lib\tomcat-dbcp.jar
 ;D:\tomcat\lib\tomcat-i18n-es.jar;D:\tomcat\lib\tomcat-i18n-fr.jar;D:\tomcat
 \lib\tomcat-i18n-ja.jar;D:\tomcat\lib\jna.jar;D:\tomcat\lib\platform.jar;D:\
 tomcat\lib\waffle-jna.jar;D:\tomcat\lib\commons-logging-1.1.1.jar

Also you're setting classpath twice.

How did you install the service?  Did you use service.bat?


p



signature.asc
Description: OpenPGP digital signature


Re: user tomcat authentication

2011-06-10 Thread Pid
On 10/06/2011 11:26, Petr Hracek wrote:
 Dear tomcat users,
 
 I would like to ask you how can I authenticate users to access tomcat page?
 My users are stored in standard /etc/passwd file

I'm not sure I'd give Tomcat access to the local user authentication.


 or users which are stored in another database engine than Realm

You can configure a DataSource  a DataSourceRealm to point at any database.


p

 thank you in advance
 




signature.asc
Description: OpenPGP digital signature


Re: Problem regarding Hosting

2011-06-10 Thread Pid
On 10/06/2011 13:33, adityagoel123 wrote:
 
 I have succesfully deployed a application through .war file on apache server.

apache server usually refers to Apache HTTPD, http://httpd.apache.org.

This is the mailing list for Apache Tomcat, a Java Application server,
which does publish web applications in .war format.

 I am also able to access it through http://10.129.x.x/application on my
 local machine. 

Great.

 Now, I want it to hosted to a web address like www.example.com/~application

Why add the ~?  It usually indicates the path to a user:

 http://people.apache.org/~pidster

 Currently, www.example.com/~application is pointing to one of the file which
 is placed(On Server hosting this site) in the location 
 /var/www/data/index.html

Is it a shared server in which you have a user account?

Does this server have Tomcat installed on it?


 How can I make this particular URL www.example.com/~application point to my
 new web application ?
 
 please specify the way.

Follow these instructions:  http://j.mp/lfX9ya


p


 Thanks in advance.
 :working:
 
 
 aditya




signature.asc
Description: OpenPGP digital signature


Re: Classpath issue *only* when starting tomcat 6 as a service

2011-06-10 Thread Pid
On 10/06/2011 10:16, Patrick Guillot - Genigraph wrote:
 Right.
 I have used a script I made because I had several tomcat instances to set-up
 (2x8). Attached is the script I used. I'm using multiple catalina_base (one
 for each application).

Please uninstall all Tomcat services.
Now install Tomcat using service.bat - just once.

 http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html


Does Tomcat work now?


p



signature.asc
Description: OpenPGP digital signature


Re: My web application to use SSL (JSSE - RSA)

2011-06-10 Thread Pid
On 10/06/2011 14:25, Charles Van Damme wrote:
 java.security.NoSuchAlgorithmException: RSA SSLContext not available

It seems pretty clear that RSA isn't accepted by Java as a valid
algorithm.


p




signature.asc
Description: OpenPGP digital signature


Re: Tomcat shutdown issues

2011-06-10 Thread Pid
On 10/06/2011 15:36, April Easton wrote:
 Good day,
  I've been working on closing all my threads in my applications that run 
 on Tomcat.  I recently upgraded to 7.0.14 to get better messages concerning 
 why Tomcat wasn't shutting down properly.  I have stopped all my servlets and 
 threads, but I'm still having trouble.  Below is the thread dump of the most 
 recent shutdown and my catalina log.  I don't see any of my threads in there, 
 so what is keeping Tomcat alive?

Are you running Tomcat inside Eclipse?


p



signature.asc
Description: OpenPGP digital signature


Re: Concurrent Low Pause GC - Eden Space Size (Apache Tomcat/5.5.27)

2011-06-10 Thread Pid
On 10/06/2011 17:10, Martin Grotzke wrote:
 Hi,
 
 On 06/10/2011 05:05 PM, Smith, Mitchell wrote:
 Hi,

 Tomcat Version 5.5.27
 OS: Linux Red Hat Linux 5.3 Enterprise 64bit

 I have a tomcat server setup, with the following configuration added:
 -XX:+UseLargePages
 -Xms14336m
 -Xmx14336m
 -XX:NewRatio=4
 -XX:MaxPermSize=256m
 -XX:+UseConcMarkSweepGC
 -XX:CMSInitiatingOccupancyFraction=51
 -XX:+CMSIncrementalMode
 -XX:+CMSIncrementalPacing
 -XX:CMSIncrementalDutyCycle=75
 -XX:CMSIncrementalDutyCycleMin=20
 -XX:CMSIncrementalSafetyFactor=10
 -XX:CMSIncrementalOffset=0
 -XX:CMSExpAvgFactor=25

 When I check the JVM output via jConsole the Eden space only has an
 available max space of 10496kbytes, I believe that my configuration of
 -(XX:NewRatio=4) should effectively set this parameter to 20% of the
 total available heap (-Xmx14336m) - should be approx 2936000kbytes.
 
 What's your jvm version? There was a bug in the sun/oracle jvm so that
 NewRatio was not used [1].
 You can still set the new size fix with NewSize.
 
 Cheers,
 Martin
 
 [1] http://bugs.sun.com/view_bug.do?bug_id=6862534


Are you setting these values in response to some performance testing?


p





signature.asc
Description: OpenPGP digital signature


Re: How to cluster two embedded tomcat 7 instances

2011-06-10 Thread Pid
On 10/06/2011 21:23, Rüdiger Herrmann wrote:
 In case someone is interested, the code to programmatically set up a
 clustered Tomcat instance is attached.p

The list strips attachments unfortunately.  Try Pastebin/GitHub etc


p



signature.asc
Description: OpenPGP digital signature


Re: My web application to use SSL (JSSE - RSA)

2011-06-10 Thread Pid
On 10/06/2011 21:29, Patrick Flaherty wrote:
 Hi,
 
 Is APR/native Connector dramatically faster then Java Nio Blocking
 Connector or is it marginal ?

APR+SSL is a little faster, if I remember correctly, Chris?

 I'd love faster SSL but all my keys and certs are java based (keytool).
 Will APR ever support Java SSL ?

No.

 I find Java keytool to be reasonably easy to use. Is OpenSSL as easy to
 use ?

Yes.


p

 Thanks for any input.
 
 Pat
 
 On Jun 10, 2011, at 3:59 PM, Christopher Schultz wrote:
 
 Charles,
 
 On 6/10/2011 9:25 AM, Charles Van Damme wrote:
 10-jun-2011 15:14:11 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: [...]
 
 FWIW, that's just an INFO message, but if you are going to be using SSL,
 you might want to go ahead and install the APR library: your performance
 will improve measurably. Note that Connector configuration for an APR
 connector using SSL is completely different if you choose to go this
 route.
 
 If you are not going to be using APR, you can disable the APR lifecycle
 listener because you aren't using it.
 
 java.security.NoSuchAlgorithmException: RSA SSLContext not available
 
 As Pid points out, it's pretty obvious that RSA is not a valid
 algorithm in this situation:
 
 at sun.security.jca.GetInstance.getInstance(GetInstance.java:142)
 at javax.net.ssl.SSLContext.getInstance(SSLContext.java:125)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSSLContext(JSSESocketFactory.java:490)

 
 So, it's an SSL configuration problem. Let's look at your SSL
 Connector:
 
 !-- Define a non-blocking Java SSL Coyote HTTP/1.1 Connector on
 port
 443 --
 Connector protocol=org.apache.coyote.http11.Http11NioProtocol
 port=443
maxThreads=150 scheme=https secure=true
 SSLEnabled=true
keystoreFile=C:/Documents and Settings/Papa/.keystore
 keystorePass=changeit
clientAuth=false sslProtocol=RSA /
 
 SO, you have sslProtocol=RSA... seems like a good place to look. If
 you check the Connector documentation, you can see that there are only
 a few recognized protocols you can choose.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#SSL_Support
 
 Note that protocol refers to the protocol used for SSL, not for any
 specific cipher, key exchange strategy, etc. Unfortunately, the Tomcat
 documentation does not list all the available protocols, nor should it:
 the protocols available to you are determined by JVM support.
 
 The Javadoc for javax.net.ssl.SSLContext.getInstance has a pointer to
 documentation for standard names (which takes you through several hops
 to) here:
 http://download.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#SSLContext
 
 
 Those are the valid ssl protocol names you can choose.
 
 If you want use only ciphers that use the RSA algorithm (which is really
 limiting, IMO), you can look up their names here (after scrolling a bit
 downward):
 
 http://download.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#jssenames
 
 
 Just look for stuff like SSL_DH_DSS_blah_blah_blah.
 
 Of course, support for a certain algorithm might not be available in
 your environment. It's best to find out what your JVM supports and use
 that.
 
 I wrote a short bit of code a while back to determine the supported
 algorithms and the default cipher suite for an SSLSocketFactory. I'll
 try to dig it up and post it.
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 /
 
 If you aren't using AJP, then disable the extra connector.
 
 Hoping you are not overwhelmed. Anything else ?
 
 You had other errors in the log file. After you get SSL working
 properly, stop Tomcat, delete all your logs and re-launch it. Anything
 that looks like an error should be investigated and fixed.
 
 Feel free to come back to the list for help on those additional issues:
 just remember start a new thread if you do.
 
 -chris

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


 Patrick Flaherty   

 Rampage Systems Inc.   
 411 Waverley Oaks Rd.   
 Suite 138
 Waltham, MA. 02452-8405
 781-891-9400 x239   







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





signature.asc
Description: OpenPGP digital signature


Re: how to correct stop a thread and avoid leaks

2011-06-09 Thread Pid
On 07/06/2011 16:33, Bill Miller wrote:
 If you want to work with threads in tomcat you need to know about the Tomcat
 org.apache.catalina.LifecycleListener interface.

Eh?  Why would you need to put Tomcat specific dependencies in a spec
compliant Servlet container?  The above is simply not true.

The OP use of a ServletContextListener is perfectly valid, (even if the
rest of the code is a little odd).


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat 7.0.14 / 6.0.32 session gets obviously invalid after request / JSESSIONID changes

2011-06-09 Thread Pid
On 08/06/2011 10:18, Sascha Hesse wrote:
 Hello all,
 
 I'm hosting our spring mvc 3.0.5 application in tomcat 7.0.14 and also
 tried 6.0.32
 
 The server is hosting two webapps.
 
 The frontend: http://localhost:50012/frontend
 The backend: http://localhost:50012/backend
 
 The Request-Flow looks as following:
 
 User: http://localhost:50012/frontend/index.htm
 AJAX Frontend:
 http://localhost:50012/frontend/setFilter.htm
 AJAX Backend:
 http://localhost:50012/backend/setFilter.htm
 User: onClick()
  AJAX Frontend: http://localhost:50012/frontend/setFilter.htm
  AJAX Backend: http://localhost:50012/backend/setFilter.htm
 
 
 The corresponding request-pairs to frontend and backend should be
 identified via the sessionID.
 
 Tomcat is doing that via Cookie JSESSIONID. I configured Tomcat
 according to https://issues.apache.org/bugzilla/show_bug.cgi?id=48379
 Context sessionCookiePath=/ sessionCookieDomain=.localhost
 
 If I look into the cookies in request and response the following
 happens (note I shortened the sessionIds)
 
 
  User: http://localhost:50012/frontend/index.htm
  ResponseHeader: -
  RequestHeader: JSESSIONID=1
 AJAX Frontend: http://localhost:50012/frontend/setFilter.htm
  ResponseHeader: -
  RequestHeader: JSESSIONID=1
 AJAX Backend: http://localhost:50012/backend/setFilter.htm
  ResponseHeader: set JSESSIONID=2
  RequestHeader: JSESSIONID=1
 User: onClick()
 AJAX Frontend: http://localhost:50012/frontend/setFilter.htm
  ResponseHeader: setJSESSIONID=3
  RequestHeader: JSESSIONID=2
 AJAX Backend: http://localhost:50012/backend/setFilter.htm
  ResponseHeader: -
  RequestHeader: JSESSIONID=2
 
 ...the sessionID alsways changes when I'm requesting the other
 context. Has anyone a hint according to this?

Does the AJAX javascript set the session id in a cookie header, or
append it as a path attribute?

You can't rely on the browser to do this automagically for you in most
AJAX libs.


p




signature.asc
Description: OpenPGP digital signature


Re: serving pre-compressed files

2011-06-09 Thread Pid
On 08/06/2011 16:03, Jesse Farinacci wrote:
 Greetings,
 
 I'm using Tomcat 7.0.14 and IBM Java 6. As part of my web
 application's bundling mechanism (via Maven) I have the ability to
 pre-gzip compress static resources. I'd like Tomcat to detect that a
 request for /path/to/resource has /path/to/resource.gz available, and
 serve the gzip'd content instead, if the user agent supports it.
 
 Is there anything like this available? If not, what suggestions do you
 have? Thanks,

Not quite the same, but similar, is the following:

If you're using Tomcat 7, you have Servlet 3 compatibility, which means
you can serve resources out of a specially* constructed jar.


p

* Put resources in: myresource.jar:/META-INF/resources and they will
appear as from the root of the webapp.

e.g.  /META-INF/resources/logo.gif - /logo.gif



signature.asc
Description: OpenPGP digital signature


Re: Static resource mapping in web.xml

2011-06-09 Thread Pid
On 08/06/2011 17:48, falva...@geocom.com.uy wrote:
 Currently we do not have this kind of attacks because the app runs in an
 intranet. But I know that in this closed scenario we should beware of the
 users.

But if your network is penetrated, your server will be vulnerable and
therefore a resource which can be compromised  further used to launch
attacks.


p



signature.asc
Description: OpenPGP digital signature


Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7

2011-06-09 Thread Pid
On 09/06/2011 06:52, Caldarale, Charles R wrote:
 From: Jocelyn Ireson-Paine [mailto:p...@j-paine.org] 
 Subject: Null-pointer exception from response.encodeUrl under Windows Tomcat 
 7
 
 I'm getting sporadic null-pointer exceptions from 
 'response.encodeUrl'. 
 
 First off, let me say that it's an unexpected pleasure to read such a 
 complete (and literate) problem description; this is a model of what we'd 
 like to see in all enquiries.

Shame it was a thread-hijack (from 'war file deployment...').

Please start a new email, rather than replying to an existing on in future.


p



signature.asc
Description: OpenPGP digital signature


Re: serving pre-compressed files

2011-06-09 Thread Pid
On 09/06/2011 13:34, Jesse Farinacci wrote:
 Hello,
 
 On Thu, Jun 9, 2011 at 4:27 AM, Pid p...@pidster.com wrote:

 Not quite the same, but similar, is the following:
 If you're using Tomcat 7, you have Servlet 3 compatibility, which means
 you can serve resources out of a specially* constructed jar.

 * Put resources in: myresource.jar:/META-INF/resources and they will
 appear as from the root of the webapp.
 e.g.  /META-INF/resources/logo.gif - /logo.gif
 
 That is pretty cool! Thanks for sharing that tip.
 
 I did not find anything with tuckey urlrewrite, so I just wrote a
 quick javax.servlet.Filter. It sanity checks: 1) no ?gzip=false
 parameter (a la Tomcat's compression filter), and 2) Accept-Encoding:
 {,x-}gzip in any of the headers, and 3)  that  new
 File(request.getContextPath().substring(1) +
 DEFAULT_GZIP_FILE_EXTENSION)  exists.

You don't need to use the File object:

 ServletContext.getResourceAsStream(/path/to/resource.ext)

which has the additional benefit that the container should prevent
access to resources outside of the context, as the path is relative to
the context.


p


 On any FNFE / IOE, silently discard the exception and run the rest of
 the chain; otherwise setting response header Content-Encoding: gzip
 and copying the compressed version directly to the
 response.outputStream before closing it.
 
 It seems to work alright. My only concerns lay with: 1) malicious
 contextPaths with ../../-style navigation, and 2) unpacked WARs which
 contain the gzipped resource will take FNFE and not serve the
 pre-compressed output as expected, and last and least 3) Accept-Range
 is completely ignored.
 
 For # 1: Is there some better way I should be obtaining the resource?
 For # 2-3: Would it be better for me to just issue response.sendRedirect()?
 
 Thanks,
 
 -Jesse
 




signature.asc
Description: OpenPGP digital signature


Re: Tomcat 5.5 Clustering

2011-06-09 Thread Pid
On 09/06/2011 15:02, Tauqir Akhtar wrote:
 Hi 
 
 I am running two Tomcat (5.5.27) Instances on two different machines 
 deploying the same Java Application.

If this is a new request for help, rather than a reply to Tomcat 6
Clustering vs. Tomcat 5.5 clustering please start a new thread, rather
than replying to an existing email  just editing the subject  body.

This is called thread hijacking.


p



signature.asc
Description: OpenPGP digital signature


Re: Tomact 5.5 Clustering

2011-06-09 Thread Pid
On 09/06/2011 15:30, Tauqir Akhtar wrote:
 Hi
 
 I am running two Tomcat (5.5.27) Instances on two different machines 
 deploying the same Java Application.
 
 I have made changes in server.xml to specify the Port on which Tomcat should 
 run on the two machines.
 
 On Machine 1 : Connector port=8001
 
 On Machine 2 : Connector port=8002
 
 Both the Instances are running fine.
 
 What other configuration changes (In which files) do I need to make to run 
 these two Tomcat Instances in one Cluster?
 
 I have following variables set in the machine environment:
 
 CATALINA_OPTS : -Xms512m -Xmx1024m
 JAVA_OPTS  : -Xmx768m
 JAVA_HOME  : C:\Program Files\Java\jdk1.5.0_11
 
 What other changes I need to make to run more Tomcat Instances from the same 
 Installation on each machine?
 
 For Example:
 On Machine 1 :Connector port=8001
   Connector port=8003
 
 On Machine 2 :Connector port=8002
   Connector port=8004
 
 I want to run all these instances in a cluster.
 
 Your help will be highly appreciated.

Have you added/enabled the Cluster element to/in your server.xml?

 http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html


p



signature.asc
Description: OpenPGP digital signature


Re: how to correct stop a thread and avoid leaks

2011-06-09 Thread Pid
On 09/06/2011 18:44, Calum wrote:
 On 9 June 2011 09:11, Pid p...@pidster.com wrote:
 Eh?  Why would you need to put Tomcat specific dependencies in a spec
 compliant Servlet container?  The above is simply not true.

 The OP use of a ServletContextListener is perfectly valid, (even if the
 rest of the code is a little odd).
 
 Is it better to have a separate class that implements the Listener,
 and sets running = false in the Threads, or just have the thread class
 implement the listener itself?

If we're talking abstractly, rather than in reference to the OPs code,
then for most cases I'd suggest that a ServletContextListener would be
best implemented as a thread controller, rather than as a thread.

See java.util.concurrent, e.g. Executors.class, ExecutorService.class.

The contextInitialized() method of the SCL would create  start the
service, configuring threads etc  contextDestroyed() would shut the
service down - it's a thread pool manager, so takes care of stopping the
threads, if you've implemented them correctly.


Remember to catch InterruptedException in each threads run() method and
take care to clean up properly  stop the work it does.

If you implement a ThreadFactory you can name threads  make your life
easier when/if Tomcat complains they don't shutdown properly.


p


 Or are there not really any pros or cons either way?
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: specifying the content-type

2011-06-03 Thread Pid
On 01/06/2011 13:13, Lentes, Bernd wrote:
 Andre Warnier wrote:
 

 Your configuration of mod_jk below looks correct (except a
 small detail, see JkMount).
 But I must say that it is difficult to believe that the
 request is actually forwarded to Tomcat, and that Tomcat then
 fails to recognise the file as a JSP page, and returns it as
 text/plain source.
 
 The content is dynamically delivered by a servlet, not a jsp-file.

And is that Servlet setting the Content-type header to text/html ?


p



signature.asc
Description: OpenPGP digital signature


Re: error-page for http 500 error code does not work

2011-06-03 Thread Pid
On 02/06/2011 21:45, Kevin Claver wrote:
 Two things I would like to note:
 
 1.  When I invoke the Java HMAExceptionHandlerServlet configured to be used 
 in the error-page block in the application specific web.xml directly from the 
 URL in the browser, it works.
 
 2.  Tomcat 5.5.33 does correctly redirect to the error-page when running on a 
 Windows 7 machine.  The only time I have an issue is on the Linux 
 configuration above.

The first things I'd check is whether there's something different about
your Tomcat installation on Linux.

You can ZIP the whole Tomcat install (including the app(s), if they're
in tomcat/webapps) and transfer the file  unzip on your Linux install.
 Start it up  see if the same thing happens.


Also: what error do you see, when the custom error servlet/page fails to
display?  Is it the same error as you expect or a different one?

- if an NPE occurs in your app, do you see a 500 + NPE stacktrace?
- or if a 500 occurs, do you see a 404?


p



signature.asc
Description: OpenPGP digital signature


Re: Inconsistency in user documentation

2011-06-03 Thread Pid
On 03/06/2011 14:50, Ivo Kammerath wrote:

 Is this something I can do myself, If yes how can I do this? Is there
 some kind of content management behind the general web pages or is this
 simply static content? Am I even allowed to make this change myself?

The docs are stored in xml, in the Tomcat subversion repository.

You can download the repo (it's open source after all), but you can't
update it unless you're a committer.  Being able to download it does
mean you can edit files  create patches, which can be submitted as
attachments to bugzilla entries.


p



signature.asc
Description: OpenPGP digital signature


Re: specifying the content-type

2011-06-03 Thread Pid
On 03/06/2011 10:22, André Warnier wrote:
 Pid wrote:
 On 01/06/2011 13:13, Lentes, Bernd wrote:
 Andre Warnier wrote:

 Your configuration of mod_jk below looks correct (except a
 small detail, see JkMount).
 But I must say that it is difficult to believe that the
 request is actually forwarded to Tomcat, and that Tomcat then
 fails to recognise the file as a JSP page, and returns it as
 text/plain source.
 The content is dynamically delivered by a servlet, not a jsp-file.

 And is that Servlet setting the Content-type header to text/html ?

 No, it doesn't, and that is the source of the problem. See my previous
 post.


Yeah, I saw it after I'd posted...


p



signature.asc
Description: OpenPGP digital signature


Re: Two instances of Tomcat 5.5.17

2011-06-03 Thread Pid
On 03/06/2011 16:49, telebabbo wrote:
 
 Hi.
 
 I have this problem:
 I use a web-application running on a tomcat servlet through the 8108 port.

To clarify: a servlet runs inside an application, which runs inside
Tomcat, which runs inside a Java virtual machine (JVM).

How is this application/Tomcat instance started?

What OS are you using?  Which version of Java?  (exact versions matter)

 I have to run a second web-application, provided by the same developers team
 of the first one, but obviously the second web-app breaks because 8108 port
 is already in use.

See below.

 I had never worked with a tomcat server and I don't know Java.
 
 I have noticed that there is NO config file (as server.xml, httpd.conf, or
 similar stuff), the unique reference to the string 8108 I've found (after
 unpacking all .jar files) is stored in a .class file (PropertyReader.class).

That sounds pretty strange, unless you've got a Tomcat embedded in
another application.  If this is the case and your developers are
sending you unconfigurable apps which run on the same port, then you
need to ask them to fix it.


 I tried to edit the file with a java class editor (ClassEditor Version
 2.23), changing the port to 8109 and the endport to 8110 (previously 8109)
 and then I have recompiled the directory.

Really really bad idea.


p

 Unfortunately, I get this error: 
 
 Exception in thread main java.lang.NoClassDefFoundError:
 net/genaud/vicaya/launch/Launcher
 
 What can I do? 




signature.asc
Description: OpenPGP digital signature


Re: specifying the content-type

2011-06-01 Thread Pid
On 01/06/2011 11:04, André Warnier wrote:
 JkMount  /mouseidgenes/* appl01
 
 This will forward a request like /mouseidgenes/index.jsp, but will not
 forward the URL /mouseidgenes. You may want to add
  JkMount  /mouseidgenes appl01

There is a syntax method to address this situation:

 JkMount  /mouseidgenes/|* appl01


p



signature.asc
Description: OpenPGP digital signature


Re: specifying the content-type

2011-06-01 Thread Pid
On 01/06/2011 10:55, Lentes, Bernd wrote:
 lrwxrwxrwx   1 root root   20 Apr 18 16:33 webapps - /srv/tomcat6/webapps/

What is in the webapps dir?  A directory called 'mouseidgenes'?

If so, what is the file tree in that directory?

What is /mouseidgenes/InputData? Is it a servlet or a JSP?


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat with Cisco ACE Load Balancer

2011-06-01 Thread Pid
On 31/05/2011 21:10, Tauqir Akhtar wrote:
 Hi
 
 We have been using Weblogic Clusters with Cisco ACE Load Balancer
 We have 8 managed servers in the weblogic Cluster distributed evenly over two 
 Machines.
 Load Balancer distributes the load in Robin Round fashion across these 8 
 managed servers using the concept of Stickiness.
 
 Now we need to replace Weblogic with Tomcat.
 I am looking for a document that would help me replicate this existing 
 architecture in Tomcat environments.
 
 Questions that I have:
 
 
  *   How many tomcat Installation would be required?

Impossible to say, we don't know anything about your application, server
spec, environment, current performance, etc etc etc

  *   Or it would be single Installation on each machines and then copying of 
 directory for each port?

Impossible to say, we don't know anything about your application, server
spec, environment, current performance, etc etc etc

Also: I don't know what 'copying of directory for each port' means.

  *   Will load Balancer see any difference if the request is from a Tomcat or 
 Weblogic?

The app server make requests to the load balancer?  Or the load balancer
directs requests to each app server?

  *   If yes, then what are changes required in Load Balancer configuration?

Impossible to say, we don't know anything about your application, server
spec, environment, current performance, etc etc etc

 Pease help me with your suggestions.

Please provide some meaningful information.


p


 Thanks
 
 Tauqir Akhtar
 
 
 
 ##
 
 NOTICE:
 The contents of this e-mail and any attachments to it may contain privileged 
 and confidential information from The Jones Group Inc. or its affiliates.  
 This information is only for the viewing or use of the intended recipient.  
 If you are not the intended recipient, you are hereby notified that any 
 disclosure, copying, distribution or use of, or the taking of any action in 
 reliance upon, the information contained in this e-mail, or any of the 
 attachments to this e-mail, is strictly prohibited.  If you have received 
 this e-mail in error, please immediately notify the sender by replying to 
 this message and delete it from your system.
 
 ###
 
 




signature.asc
Description: OpenPGP digital signature


Re: Switching native Tomcat logging system

2011-05-31 Thread Pid
On 31/05/2011 19:49, Francis GALIEGUE wrote:
 Hello,
 
 For some obscure reasons, Tomcat insists on having its own native
 implementation of a logging system, namely juli.
 
 This is beyond my understanding. Log4j has existed for years, is much
 better than even the native Sun's JDK logging API of today, and Tomcat
 hasn't switched to it, even to the expense of requiring, or even
 bundling (licenses are not incompatible after all) it with its
 distributions. WHY?
 
 And today, there is slf4j, which is even better. Especially combined
 with logback. I don't even want to HEAR about the JDK's logging API,
 it is miserable.
 
 When will Tomcat's logging account at last for 21st century logging
 systems? I am surprised log4j didn't even become the default for
 6.0.x, and 7.0.x still doesn't make it the default...
 

Yawn.  Have you read the docs?

 http://tomcat.apache.org/tomcat-6.0-doc/logging.html


p



signature.asc
Description: OpenPGP digital signature


Re: Tomcat reset connection before completing the request

2011-05-31 Thread Pid
On 31/05/2011 15:03, Chaminda Divitotawela wrote:
 I am using two tomcat 6.0.13 servers loadblanced by a apache httpd-2.2.4

You really, really need to upgrade Tomcat.  That version is old  many
problems have been fixed since then.


p



signature.asc
Description: OpenPGP digital signature


Re: Issues with getRemoteAddress

2011-05-26 Thread Pid
On 26/05/2011 15:43, Filippo Machi wrote:
 Ciao Christopher,
 we don't trust 85.18.x.x., it doesn't belong to us, that's why I posted my
 question.
 We're not able to explain how is possible that a request from localhost to
 localhost
 appear to be issued from a different ip.

If it's not one of your IPs why do you think that the request is
definitely from an internal system, rather than an external one?


p

 Anyway, I'm going deeper following your hint about the rewrite.
 May we assume that a redirect will cause the same symptom?
 thanks
 Fil
 
 
 On Thu, May 26, 2011 at 4:04 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:
 
 Filippo,
 
 On 5/26/2011 8:22 AM, Filippo Machi wrote:
 The service I was talking about is a php script we put in the crontab and
 it
 accesses directly to the tomcat asking the url  (127.0.0.1:8080/...)
 
 Okay: when you use 127.0.0.1, you should always be using the loopback
 address. That's good. If you were using a non-localhost hostname (like
 myserver.mydomain.it) then your remote address would likely appear to
 be the external IP address of the server because, well, that's just how
 TCP/IP works.
 
 I'm omitting the final part of the ip just for privacy. There are
 just a little set of ips that seem to be involved in the scenario I
 described and they don't change.
 
 Okay. Since they don't change, what is the relationship between the IP
 address you are observing and the network setup you have? Is 85.18.x.x
 the external IP address of the server?
 
 I wonder if your server is re-writing URLs in an HTTP response that are
 fully-qualified. So, instead of the URL being relative like /foo/bar
 it's being sent as http://myserver.mydomain.it/foo/bar; and so your
 client is therefore appearing to come from the server's external IP
 address.
 
 Simple question: do you trust 85.18.x.x? If so, why not just add it to
 the list of trusted IP addresses in your filter?
 
 -chris

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






signature.asc
Description: OpenPGP digital signature


Re: Monitoring memory usage of JVM

2011-05-26 Thread Pid
On 26/05/2011 20:16, Caldarale, Charles R wrote:
 From: André Warnier [mailto:a...@ice-sa.com] 
 Subject: Monitoring memory usage of JVM
 
 I am thinking of a couple of command-line options for the JVM,
 to dump for example some information each time a GC happens,
 
 Try -verbose:gc and -Xloggc:file_path_of_your_choice

The jmap  jstat commands shipped with the JDK are also useful.


p



signature.asc
Description: OpenPGP digital signature


<    5   6   7   8   9   10   11   12   13   14   >