Re: making all pages to fo index.jsp

2014-07-31 Thread André Warnier

Aryeh Friedman wrote:

I want to make it so every page that does not have a actual .jsp file gets
sent back index.jsp.  I am doing it with error-page but that also sends a
404 I want zero clue they landed on a non-existent page


There are certainly ways to achieve what you describe above.
But I think that you should really question the basic logic of doing so.
The 404 response is there for a reason : to stop clients from repeating requests for 
something that does not exist.  If you hide that condition to the client, and return what 
appears to be a real content, then how can a client ever determine that what he requests 
does not exist, and react intelligently ?  What is there to stop this client looping 
forever, and swamping your server with useless requests ?


Imagine that the file system of your server would do the same : if some program tries to 
open a file which does not exist, the OS does not return an error, but opens some other 
file instead.  Doesn't make sense, does it ?



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



Re: How to use Jasper class?

2014-07-31 Thread Daniel Mikusa
On Wed, Jul 30, 2014 at 10:36 PM, Aaron Lewis the.warl0ck.1...@gmail.com
wrote:

 Thanks guys. I copied all jars from tomcat 7.0.55 binary, libs 
 bin/*.jar to 'lib' folder, then I start winstone like this:
 % java -jar winstone-0.9.10.jar --useJasper --commonLibFolder=lib/
 --webroot=webroot/

 When I access any JSP file (that works in tomcat), I got an exception,
 perhaps I'm missing taglib jars?

 java.lang.NoSuchMethodError:
 javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;


I would guess that you have the wrong version of the Servlet API included
with your app.  The JavaDoc says that this method was added in Servlet 3.0,
so perhaps you have an older version of the Servlet API on your class path
that doesn't have this method.


http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getClassLoader()

Dan


 at
 org.apache.jasper.compiler.TagPluginManager.init(TagPluginManager.java:73)
 at
 org.apache.jasper.compiler.TagPluginManager.apply(TagPluginManager.java:57)
 at
 org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:240)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
 at
 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
 at
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
 at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
 at
 winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
 at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
 at
 winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
 at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
 at java.lang.Thread.run(Thread.java:744)

 javax.servlet.ServletException:
 javax.servlet.ServletContext.getClassLoader()Ljava/lang/ClassLoader;
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
 at
 winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
 at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
 at
 winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
 at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
 at java.lang.Thread.run(Thread.java:744)

 On Thu, Jul 31, 2014 at 12:05 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA256
 
  Daniel,
 
  On 7/30/14, 8:16 AM, Daniel Mikusa wrote:
  On Wed, Jul 30, 2014 at 3:43 AM, Aaron Lewis
  the.warl0ck.1...@gmail.com wrote:
 
  Hi,
 
  I'm trying to build a minimal JSP container, just like winstone
  http://winstone.sourceforge.net/#commandLine
 
  But with tc 7.0.55 it doesn't seem to work, so I had to find my
  own ways around the Jasper class: Error initializing web
  application: prefix [] java.lang.NoClassDefFoundError:
  org/apache/juli/logging/LogFactory
 
 
  Not sure that I follow what you're trying to do here, but it seems
  like you're missing the JAR file for JULI, the logging library used
  by Tomcat. Maybe if you add that to your class path it'll help?
  It's in the bin directory of a normal Tomcat install
  (tomcat-juli.jar).
 
  +1
 
  Interesting that Jasper uses JULI directly instead of commons-logging.
  I think that should probably change, since Jasper is something of some
  usefulness outside of Tomcat, and JULI is really a Tomcat internal thing.
 
  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1
  Comment: GPGTools - http://gpgtools.org
  Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
 
  iQIcBAEBCAAGBQJT2RfPAAoJEBzwKT+lPKRY6IIQAL2kayaRosDE71R0N8n9UTW2
  p4Ht+/4ZF2YQEEaqfgoHPYvDNUhv1x1+ydr2QENjIui6ed/5phLtos4+Q5CmzU4I
  OCncnMgwiY/jQJ3lzO+C3yOputnYPzphmezKwMhu4nZD1MZ1JtCOv2k4cMChcNGg
  JacK9KXMjnoG+iareBEUVjLAG39mn20n26ZR/CU2m1I+TV34Ds2okhmK1xPMWst4
  r1sSoxaQXBx4qmo83tGm/L+IF0k68BHvDWMln1N4Z5fD6UXe4LrU0vq+K77NpOwS
  MpauJOI3kYysDpHTlZ+i33gcEfi3Oev7WTtfMxdQtgNjn5GLEWE21aNg3rSjMvr9
  dMKNvs79zk1O4CiT43g7hDRt4g90SO9R1xfwkKLyA789xCSibzVIeCQFpyohOxA1
  KGMrloEF9KIRR/IgnBOD1k1DrBnLqgo5ihawzJut1HXpqvhn+UnfLCjBF/3BP/Iw
  6bF6jFJxv4P4+eyZRaMLlLGzCh5kkTqWeLZyYwdjNc/KexWOwlD+3cl9Np8Smm9L
  rNSt52n+o0NVCkSZ4/ceTr/cYBY8DarTl+mWO2OXgWMiev4HJgdO8qDdpqHYSfTm
  8FVFnSdI0wckMZ75E1oQCeVDgYhIfwbXz+1GjXF3R89sAci/4p4IAbY6e4KDobeY
  MeU6mx7xl3DzbmgnAQTV
  =tjm4
  -END PGP SIGNATURE-
 
  -
  To unsubscribe, e-mail: 

overriding all other context.xml settings in conf/context.xml

2014-07-31 Thread Brandon Metcalf
I know that the load order of context settings is

$CATALINA_BASE/conf/context.xml
$CATALINA_BASE/conf/[enginename]/[hostname]/[app].xml


-- 
Brandon Metcalf | Technical Operations
brandon.metc...@logicmonitor.com
M: 1-512-917-8198

http://www.logicmonitor.com
*Cloud-based performance monitoring*


* https://www.facebook.com/LogicMonitor?ID=7014000mSeh
https://twitter.com/logicmonitor?ID=7014000mSem
https://www.linkedin.com/company/1165219?ID=7014000mSer*


Re: overriding all other context.xml settings in conf/context.xml

2014-07-31 Thread Brandon Metcalf
Sorry, I hit send a little too soon

I'm trying to figure out a way where $CATALINA_BASE/conf/context.xml takes
precedence over any other context settings.  I thought the override option
would do this, but it doesn't seem to behave the way I think it should.
 I'm using tomcat 5.5.28.

Thanks.


On Thu, Jul 31, 2014 at 10:55 AM, Brandon Metcalf 
brandon.metc...@logicmonitor.com wrote:

 I know that the load order of context settings is

 $CATALINA_BASE/conf/context.xml
 $CATALINA_BASE/conf/[enginename]/[hostname]/[app].xml


 --
 Brandon Metcalf | Technical Operations
 brandon.metc...@logicmonitor.com
 M: 1-512-917-8198

 http://www.logicmonitor.com
 *Cloud-based performance monitoring*


 * https://www.facebook.com/LogicMonitor?ID=7014000mSeh
 https://twitter.com/logicmonitor?ID=7014000mSem
 https://www.linkedin.com/company/1165219?ID=7014000mSer *




-- 
Brandon Metcalf | Technical Operations
brandon.metc...@logicmonitor.com
M: 1-512-917-8198

http://www.logicmonitor.com
*Cloud-based performance monitoring*


* https://www.facebook.com/LogicMonitor?ID=7014000mSeh
https://twitter.com/logicmonitor?ID=7014000mSem
https://www.linkedin.com/company/1165219?ID=7014000mSer*


Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Tomcat 7
Is there a way via a Java servlet to get the number of tomcat connections?


Thanks,

Lance Campbellhttp://illinois.edu/person/lance
Software Architect
Web Services at Public Affairs
217-333-0382
[University of Illinois at Urbana-Champaign logo]http://illinois.edu/




Re: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Mark Thomas
On 31/07/2014 17:06, Campbell, Lance wrote:
 Tomcat 7
 
 Is there a way via a Java servlet to get the number of tomcat connections?

Connections from what to what in what state?

With or without non-Servlet API calls?

Mark


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



RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Good question.  I would like to have a servlet that would return to me the 
number of tomcat HTTP connections.  I know you can do this via a Linux console 
command.  But I would prefer to do it via a servlet.


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Thursday, July 31, 2014 11:10 AM
To: Tomcat Users List
Subject: Re: Programmatically retrieve number of tomcat connections

On 31/07/2014 17:06, Campbell, Lance wrote:
 Tomcat 7
 
 Is there a way via a Java servlet to get the number of tomcat connections?

Connections from what to what in what state?

With or without non-Servlet API calls?

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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal Sapir
Write a simple ServletFilter
 On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:

 Good question.  I would like to have a servlet that would return to me the
 number of tomcat HTTP connections.  I know you can do this via a Linux
 console command.  But I would prefer to do it via a servlet.


 Thanks,

 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, July 31, 2014 11:10 AM
 To: Tomcat Users List
 Subject: Re: Programmatically retrieve number of tomcat connections

 On 31/07/2014 17:06, Campbell, Lance wrote:
  Tomcat 7
 
  Is there a way via a Java servlet to get the number of tomcat
 connections?

 Connections from what to what in what state?

 With or without non-Servlet API calls?

 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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Campbell, Lance
Could you elaborate a little?  How do you actually get the number of HTTP 
connections?


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382 




-Original Message-
From: Igal Sapir [mailto:i...@getrailo.org] 
Sent: Thursday, July 31, 2014 11:35 AM
To: Tomcat Users List
Subject: RE: Programmatically retrieve number of tomcat connections

Write a simple ServletFilter
 On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:

 Good question.  I would like to have a servlet that would return to me 
 the number of tomcat HTTP connections.  I know you can do this via a 
 Linux console command.  But I would prefer to do it via a servlet.


 Thanks,

 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, July 31, 2014 11:10 AM
 To: Tomcat Users List
 Subject: Re: Programmatically retrieve number of tomcat connections

 On 31/07/2014 17:06, Campbell, Lance wrote:
  Tomcat 7
 
  Is there a way via a Java servlet to get the number of tomcat
 connections?

 Connections from what to what in what state?

 With or without non-Servlet API calls?

 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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Mark Thomas
On 31/07/2014 17:56, Campbell, Lance wrote:
 Could you elaborate a little?  How do you actually get the number of HTTP 
 connections?

You can't do this with a Filter. You can determine the number of active
requests for an application but connection != active request and
application != Tomcat server.

There is no standard Servlet API for the information you want.

Mark


 
 
 Thanks,
 
 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382 
 
 
 
 
 -Original Message-
 From: Igal Sapir [mailto:i...@getrailo.org] 
 Sent: Thursday, July 31, 2014 11:35 AM
 To: Tomcat Users List
 Subject: RE: Programmatically retrieve number of tomcat connections
 
 Write a simple ServletFilter
  On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:
 
 Good question.  I would like to have a servlet that would return to me 
 the number of tomcat HTTP connections.  I know you can do this via a 
 Linux console command.  But I would prefer to do it via a servlet.


 Thanks,

 Lance Campbell
 Software Architect
 Web Services at Public Affairs
 217-333-0382



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: Thursday, July 31, 2014 11:10 AM
 To: Tomcat Users List
 Subject: Re: Programmatically retrieve number of tomcat connections

 On 31/07/2014 17:06, Campbell, Lance wrote:
 Tomcat 7

 Is there a way via a Java servlet to get the number of tomcat
 connections?

 Connections from what to what in what state?

 With or without non-Servlet API calls?

 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


 
 -
 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: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal @ getRailo.org
well -- Mark surely knows much better than I do -- so take into account 
what he wrote, but I was already writing this so I decided to send 
anyway, and for most application it should work fine IMO:


1) you create a class that implements the Filter interface and maintains 
the count in an AtomicLong object.


2) you increment the AtomicLong before the call to chain.doFilter() and 
decrement it after that call.


3) you add a way to get the value, either with a public method or by 
setting the value to a Servlet Attribute.


see more about Filters at 
http://www.oracle.com/technetwork/java/filters-137243.html


another way I can think of is to get all the threads in the JVM with 
Thread.getAllStackTraces(), loop over them, and check their names for 
example.



On 7/31/2014 10:01 AM, Mark Thomas wrote:

On 31/07/2014 17:56, Campbell, Lance wrote:

Could you elaborate a little?  How do you actually get the number of HTTP 
connections?

You can't do this with a Filter. You can determine the number of active
requests for an application but connection != active request and
application != Tomcat server.

There is no standard Servlet API for the information you want.

Mark




Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382




-Original Message-
From: Igal Sapir [mailto:i...@getrailo.org]
Sent: Thursday, July 31, 2014 11:35 AM
To: Tomcat Users List
Subject: RE: Programmatically retrieve number of tomcat connections

Write a simple ServletFilter
  On Jul 31, 2014 9:33 AM, Campbell, Lance la...@illinois.edu wrote:


Good question.  I would like to have a servlet that would return to me
the number of tomcat HTTP connections.  I know you can do this via a
Linux console command.  But I would prefer to do it via a servlet.


Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Thursday, July 31, 2014 11:10 AM
To: Tomcat Users List
Subject: Re: Programmatically retrieve number of tomcat connections

On 31/07/2014 17:06, Campbell, Lance wrote:

Tomcat 7

Is there a way via a Java servlet to get the number of tomcat

connections?

Connections from what to what in what state?

With or without non-Servlet API calls?

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



-
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



--
Igal Sapir
Railo Core Developer
http://getRailo.org/


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



RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Caldarale, Charles R
 From: Igal @ getRailo.org [mailto:i...@getrailo.org] 
 Subject: Re: Programmatically retrieve number of tomcat connections

 1) you create a class that implements the Filter interface and maintains 
 the count in an AtomicLong object.

 2) you increment the AtomicLong before the call to chain.doFilter() and 
 decrement it after that call.

This has nothing to do with the number of connections.

 another way I can think of is to get all the threads in the JVM with 
 Thread.getAllStackTraces(), loop over them, and check their names for 
 example.

Which also has little to do with the number of connections, especially when 
using NIO.

You may be able to dig the number of connections out via an internal JMX call.  
This is, of course, Tomcat specific, but avoids trying to invoke Tomcat's 
internal classes.

 - Chuck


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


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



Re: overriding all other context.xml settings in conf/context.xml

2014-07-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Brandon,

On 7/31/14, 11:57 AM, Brandon Metcalf wrote:
 Sorry, I hit send a little too soon
 
 I'm trying to figure out a way where
 $CATALINA_BASE/conf/context.xml takes precedence over any other
 context settings.  I thought the override option would do this, but
 it doesn't seem to behave the way I think it should. I'm using
 tomcat 5.5.28.

Any chance for an upgrade? That version is quite old and has several
Important security issues that have been fixed in the intervening
years. Also, the current stable version of Tomcat is 8.0.9. The oldest
supported version of Tomcat is 6.0.41.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJT2nwqAAoJEBzwKT+lPKRYSBYQAJYsA/D3wl1979p5OHpVsZMq
uBcmJb6KykOoXbtRyl+tDbCPuDZRSBzLdQ9lMj6W3zhXW2UKmPosfDKd5+6Xduej
gW3CPZjLUmcXfL/vbvYNr4lbPW8bj54ADH6RNk8B7rGsqOfrsNPGkib0/jA7B6cn
LvZNC/Hxo+gJoNgxfxw6lQuIlfwyZchJ2ecJ91W6PHk6ryGpHrMI7fJcV5OWRonE
pM0ZAfOJR5E+62EiQ2YMInqdSqAiooFGL/jPTKUU5HrmvyeFiodINE0Yv1XcU5UG
uvNGT6FwtFt1MycIostD6DMHbNNoqjNPvnzA2fiR44Hpkho2G5VgKPddCwR/fxQL
tVt38/GB7nXdk5t5XRVtQy+eu5Y38DTCRDOdCtV8sUiPNsBbBDri0RCRa+dpPVa0
/rhfsCorszIQVhMH6GpqACM6HskIHvUNjYsOFKhf7IGona1eB2dU/PnsbrPaIQpj
zHgGuq4lAdp7tvKCTALQETbkvQXGbD7s3SBI4r/Oq1gAOYMj1DUx9QUPIeAqZPLS
gxBbSEd5Z3+l+Blk1kG2rf5EX5FOLsBNa9aYzXOV6ueZU6OtsQihW+vdiL2+QIG9
9DBRiIyO+M4K618wrdDPNUkNBHydQRCBdqQmZwfrltI5qnG74MF5jw9gwNu6JWSx
D052ZyHCRwa/UnrjPmXN
=vzJ6
-END PGP SIGNATURE-

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



RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal Sapir
Isn't Filter.doFilter() called once for each incoming http request?
On Jul 31, 2014 10:24 AM, Caldarale, Charles R chuck.caldar...@unisys.com
wrote:

  From: Igal @ getRailo.org [mailto:i...@getrailo.org]
  Subject: Re: Programmatically retrieve number of tomcat connections

  1) you create a class that implements the Filter interface and maintains
  the count in an AtomicLong object.

  2) you increment the AtomicLong before the call to chain.doFilter() and
  decrement it after that call.

 This has nothing to do with the number of connections.

  another way I can think of is to get all the threads in the JVM with
  Thread.getAllStackTraces(), loop over them, and check their names for
  example.

 Which also has little to do with the number of connections, especially
 when using NIO.

 You may be able to dig the number of connections out via an internal JMX
 call.  This is, of course, Tomcat specific, but avoids trying to invoke
 Tomcat's internal classes.

  - Chuck


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


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




Re: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Chuck,

On 7/31/14, 1:22 PM, Caldarale, Charles R wrote:
 From: Igal @ getRailo.org [mailto:i...@getrailo.org] Subject: Re:
 Programmatically retrieve number of tomcat connections
 
 1) you create a class that implements the Filter interface and
 maintains the count in an AtomicLong object.
 
 2) you increment the AtomicLong before the call to
 chain.doFilter() and decrement it after that call.
 
 This has nothing to do with the number of connections.
 
 another way I can think of is to get all the threads in the JVM
 with Thread.getAllStackTraces(), loop over them, and check their
 names for example.
 
 Which also has little to do with the number of connections,
 especially when using NIO.
 
 You may be able to dig the number of connections out via an
 internal JMX call.  This is, of course, Tomcat specific, but avoids
 trying to invoke Tomcat's internal classes.

+1

IMO, this is the right way to do it. You don't have to use a JMX
connection, even: you can just query the local JMX server for the bean
object and interrogate it.

Lance, look at the source code to the JMXProxyServlet and you can see
how to fetch JMX beans from the server. Then, just write some code to
do the same thing for the bean you're looking for and grab the data
you want.

Or, you could just use the JMX proxy servlet directly to fetch the
data you want.

Why do you want this information from /inside/ the application, rather
than outside of it?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJT2nzeAAoJEBzwKT+lPKRYZqkP/0y/m6XFlb689l64rHzmH9ia
pVjtPkoTGTNFNEcYbYEM1yK2n56Ty9kbzP0svhNRJPfsBghvhXOi/qG7IQ6cxTq0
skFQ+ybCXCFuUviaTUdrzYbrB+AkKRT3K9gnjOHdRetlLGCJffmDPVHiUyQekAMF
s4jHBaEJ466rrScfQtW8hMEA+S8ra9gRDkYV2h9jjwuXohqAIc6qgnDsUBlzQzgp
JceP4PjuaDr1KAONGY+tJ7fLxHwf2GLs0D7urfIRPH9dlxk3pv2O0JzzXpk2pXsX
yxm02JSQGX1jk1EbNNqzB8+eUf7coMWseRfbRGuvB2GgB4zWGeq9qFwgsl83FT1k
RpSUf6XWrXduVw9FHev5Usus/riqP71lZjZAg1EgM/DJXdXmcfIOElQrOCI0nTra
WMuB+p1XSLPf57RffsjkMy4SyqQjcryK4Z6pjYHiezYe//7hCqpMQeFhx4tIRh6g
jWSsO0ayGmurmzX0LjteYSR9ru6tFlxqQ+2taGR0ZgdCmiVwfc4CTLj7orgRojJg
XsD5K0jnyIXbvXdgdD0qfWs4eJIDBgquRX+A97qUAtoLOqBy/s9hv/OHIYfqlbbW
KOxSm2YlJ/TYm+pZOKJlHYh7W1+tErq7C+2AqqD78bytgetCYEHihYmIGRP0HpiP
zr2jw9wnMaGJcpUTPwN9
=2Vqm
-END PGP SIGNATURE-

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



RE: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Caldarale, Charles R
 From: Igal Sapir [mailto:i...@getrailo.org] 
 Subject: RE: Programmatically retrieve number of tomcat connections

 Isn't Filter.doFilter() called once for each incoming http request?

Yes, which is why it has nothing to do with the number of _connections_.

 - Chuck


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


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



Re: overriding all other context.xml settings in conf/context.xml

2014-07-31 Thread Brandon Metcalf
No doubt we are woefully behind, but hoping there is a solution to my
question with the current version.


On Thu, Jul 31, 2014 at 12:26 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Brandon,

 On 7/31/14, 11:57 AM, Brandon Metcalf wrote:
  Sorry, I hit send a little too soon
 
  I'm trying to figure out a way where
  $CATALINA_BASE/conf/context.xml takes precedence over any other
  context settings.  I thought the override option would do this, but
  it doesn't seem to behave the way I think it should. I'm using
  tomcat 5.5.28.

 Any chance for an upgrade? That version is quite old and has several
 Important security issues that have been fixed in the intervening
 years. Also, the current stable version of Tomcat is 8.0.9. The oldest
 supported version of Tomcat is 6.0.41.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJT2nwqAAoJEBzwKT+lPKRYSBYQAJYsA/D3wl1979p5OHpVsZMq
 uBcmJb6KykOoXbtRyl+tDbCPuDZRSBzLdQ9lMj6W3zhXW2UKmPosfDKd5+6Xduej
 gW3CPZjLUmcXfL/vbvYNr4lbPW8bj54ADH6RNk8B7rGsqOfrsNPGkib0/jA7B6cn
 LvZNC/Hxo+gJoNgxfxw6lQuIlfwyZchJ2ecJ91W6PHk6ryGpHrMI7fJcV5OWRonE
 pM0ZAfOJR5E+62EiQ2YMInqdSqAiooFGL/jPTKUU5HrmvyeFiodINE0Yv1XcU5UG
 uvNGT6FwtFt1MycIostD6DMHbNNoqjNPvnzA2fiR44Hpkho2G5VgKPddCwR/fxQL
 tVt38/GB7nXdk5t5XRVtQy+eu5Y38DTCRDOdCtV8sUiPNsBbBDri0RCRa+dpPVa0
 /rhfsCorszIQVhMH6GpqACM6HskIHvUNjYsOFKhf7IGona1eB2dU/PnsbrPaIQpj
 zHgGuq4lAdp7tvKCTALQETbkvQXGbD7s3SBI4r/Oq1gAOYMj1DUx9QUPIeAqZPLS
 gxBbSEd5Z3+l+Blk1kG2rf5EX5FOLsBNa9aYzXOV6ueZU6OtsQihW+vdiL2+QIG9
 9DBRiIyO+M4K618wrdDPNUkNBHydQRCBdqQmZwfrltI5qnG74MF5jw9gwNu6JWSx
 D052ZyHCRwa/UnrjPmXN
 =vzJ6
 -END PGP SIGNATURE-

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




Re: Programmatically retrieve number of tomcat connections

2014-07-31 Thread André Warnier

Caldarale, Charles R wrote:
From: Igal Sapir [mailto:i...@getrailo.org] 
Subject: RE: Programmatically retrieve number of tomcat connections



Isn't Filter.doFilter() called once for each incoming http request?


Yes, which is why it has nothing to do with the number of _connections_.



To elaborate just a little :
Presumably when the OP wrote connections, he meant connections, and this was not just 
sloppy language.


In that case, consider keep-alive connections : a browser establishes *one* connection 
to Tomcat, and then uses that same connection to send 100 HTTP requests (and get 100 HTTP 
responses) over that same connection.
A filter would count 100 requests (assuming that they are all to that same application), 
but there would still be a single connection.
(On the other hand of course, if all the request were directed to another application 
which does not have the filter, then the filter would count 0 requests, and there would 
still be 1 connection).


Talking about fuzzy language though, review Mark's original response : which connections 
are we talking about here ? and are we talking about a snapshot, where we want to know 
how many connections with Tomcat are active at a specific moment in time, or how many 
connections with Tomcat have been established/closed over a period of time ?

Or about something else altogether ?

And if one really wanted to count connections at the Tomcat level, I would imagine that 
the sensible place to do this would be at the Connector level, no ? (all of them)


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



Re: Programmatically retrieve number of tomcat connections

2014-07-31 Thread Igal @ getRailo.org

André -- thank you for making this clear.


On 7/31/2014 2:27 PM, André Warnier wrote:

Caldarale, Charles R wrote:
From: Igal Sapir Subject: RE: Programmatically retrieve number of 
tomcat connections



Isn't Filter.doFilter() called once for each incoming http request?


Yes, which is why it has nothing to do with the number of _connections_.



To elaborate just a little :
Presumably when the OP wrote connections, he meant connections, 
and this was not just sloppy language.


In that case, consider keep-alive connections : a browser 
establishes *one* connection to Tomcat, and then uses that same 
connection to send 100 HTTP requests (and get 100 HTTP responses) over 
that same connection.
A filter would count 100 requests (assuming that they are all to that 
same application), but there would still be a single connection.
(On the other hand of course, if all the request were directed to 
another application which does not have the filter, then the filter 
would count 0 requests, and there would still be 1 connection).


Talking about fuzzy language though, review Mark's original response : 
which connections are we talking about here ? and are we talking 
about a snapshot, where we want to know how many connections with 
Tomcat are active at a specific moment in time, or how many 
connections with Tomcat have been established/closed over a period of 
time ?

Or about something else altogether ?

And if one really wanted to count connections at the Tomcat level, I 
would imagine that the sensible place to do this would be at the 
Connector level, no ? (all of them)


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



--
Igal Sapir
Railo Core Developer
http://getRailo.org/


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



NoSuchMethodError: org/apache/xml/utils/TreeWalker

2014-07-31 Thread Deme Carv
I am getting the error from subject when running the below code in
Websphere in my RAD. It is very interesting that this code doesn't cause
any error in Server. The server runs up Tomcat 6 but I must set the same
code to run in Websphere. I have searched for hours in web but I didn't
find nothing that I could at least give a try. I attached a pdf with the
libs that I found in each place. I guess that it might exist some conflict
but I have no idea why it is working in Tomcat but it is not working in
Websphere.

Error message in browser:

Error 500:
org/apache/xml/utils/TreeWalker.init(Lorg/xml/sax/ContentHandler;Lorg/apache/xpath/DOMHelperV

Error message in RAD console:
java.lang.NoSuchMethodError:
org/apache/xml/utils/TreeWalker.init(Lorg/xml/sax/ContentHandler;Lorg/apache/xpath/DOMHelperV

at org.apache.xalan.serialize.SerializerToXML.seriali
ze(SerializerToXML.java:2578)

org.apache.xalan.serialize.SerializerToXML serializertoxml = new
org.apache.xalan.serialize.SerializerToXML();

My code snippet:
java.io.FileWriter filewriter = new java.io.FileWriter(file);

serializertoxml.setWriter(filewriter);

serializertoxml.serialize(node); // the error happens here

serializertoxml.flushWriter();

filewriter.write(\n);

filewriter.close();

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