Re: Tomcat 5.17 crashes too often

2009-11-28 Thread Andre-John Mas

On 28-Nov-2009, at 10:17, Rocco Scappatura wrote:

 
 28-nov-2009 15.56.41 org.apache.catalina.startup.Catalina stopServer
 GRAVE: Catalina.stop:
 java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.init(Unknown Source)
at java.net.Socket.init(Unknown Source)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
 org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)
 

Don't worry about that one. Its just a confirmation that Tomcat is not running.
The shutdown script will attempt to contact Tomcat to shutdown, but if it is
not running, then it won't be able to connect.

If it is running, then it is possible it was using a different configuration 
when
it was started.

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



Re: Questions on Single Sign On?

2009-10-12 Thread Andre-John Mas


On 12-Oct-2009, at 10:51, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Perter,

On 10/12/2009 9:37 AM, Peter Crowther wrote:

2009/10/12 Josh Gooding josh.good...@gmail.com:
To my knowledge the Single Sign on in Tomcat is a way for all of  
your back
end applications in your VH to recognize that you have logged in  
to one

place, and all of the apps belonging to that VH will be logged into.


Correct.

What I am trying to do is restrict the login from users to one  
single
session.  (i.e. if you are logged in once, you cannot log in again  
unless

your session expires or you log out.)  Is this possible with what is
included with Tomcat or is this going to take some custom code?


You'll need custom code.

Are you sure this is an appropriate requirement?  In particular, how
do you plan to handle (say) a browser or client crash that loses the
in-memory session cookie?


Also, if the client loses their session cookie, how will the OP
uniquely identify the client in order to apply this policy?


The only solution I can think of is a non-session cookie that the web  
application
deals with itself. If it can't find it mapped to the users session-id  
in the application
context, then the user is considered logged out. The catch is if the  
user opens up
a new browser this will kill the existing session, so you would have  
to back this up
with a dialogue warning the user that they are already logged in and  
logging in again

will log out the other session.

What is important is to balance the needs of single sign on and the  
security provided

to the user of closing their browser, and thus ending their session.

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



Re: Questions on Single Sign On?

2009-10-12 Thread Andre-John Mas


On 12-Oct-2009, at 11:24, Josh Gooding wrote:


Well upon clicking logout the following occurs:

session.removeAttribute(User);
session.invalidate();
response.sendRedirect(EULA.jsp);

If I close the browser window, and reopen it without clicking the  
logout
button, I can still get back into my active session.  How would I  
invalidate

the session upon closing the browser window?


What browser are you using, and how are you reopening the window? If  
you exit

your browser the session should be invalidated, though:
  - Firefox maintains its state if you make it remember the open tabs/ 
windows
  - IE will open a separate application instance only if it is  
launched via
the desktop icon. Selecting 'New Window' form the file menu will  
simply

create a new window in the same instance.

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



Re: Questions on Single Sign On?

2009-10-12 Thread Andre-John Mas


On 12-Oct-2009, at 11:41, Josh Gooding wrote:


On Mon, Oct 12, 2009 at 11:03 AM, André Warnier a...@ice-sa.com wrote:


Josh Gooding wrote:
...



Andre, your talking about something like Active Directory for  
Windows

Domain's to use with say Communicator, Outlook, etc, across windows
environments with domain authentication?

Yes, although Windows domain authentication is not the only game in  
town.



** I know Andre, it was just the first thing that popped into my  
head.  The
shop I work for is a Microjunk shop and I am the only dinosaur who  
codes on

OS platforms here after I leave they can claim to be an all .NET shop.
However, i'm the only one working on programs that are making the  
company
money... :: shrug :: anywho.  I know there are others, WIndows is  
just one
of the most commonly recognized.  You also have raduis, NIS, and if  
I am not

mistaken even LDAP.


You can even use LDAP with ActiveDirectory, on the condition they  
provide you

the access you need.

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



Re: Default character encoding for ServletRequest

2009-10-01 Thread Andre-John Mas


On 1-Oct-2009, at 07:22, Halm Reusser wrote:


Pid wrote:

How about?
request.setCharacterEncoding(ENCODING);


I wan't do it within the application. I prefer to configure the app  
container or the app itself.


I had asked for this too a while back, but I was told the RFC  
indicates ISO-8859-1, so the developers didn't want to allow you to  
change the default encoding used by the application server, which is a  
shame. I say it is a shame, because we can already change the URL  
encoding and being able to standardise your deployment solutions on  
UTF-8 would be so much nicer, IMHO.


My solution was to use a character set filter, described here:

http://wiki.apache.org/tomcat/Tomcat/UTF-8

since the URL wasn't working at the time of posting, also described  
here:


http://tompson.wordpress.com/2007/01/29/encoding-filter-for-java-web-applications/

Bearing in mind that you're not really changing what the client  
requests, or might expect you to be setting...


Is there a possibility to force the client to use a specific encoding?



Generally what ever the client has been asked to display the page in,  
will be used for the next request. At least that is what experience  
has shown me.


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



Re: howto add a UDP Listener

2009-09-14 Thread Andre-John Mas
They are both licensed under the GPL. You can web start enable any  
Java application.


BTW Just in case I am detecting a misunderstanding, Java Web Start is  
not the same thing as a webapp. You don't need Tomcat to 'web start' a  
Java application. Apache HTTPD will do the job just fine.


André-John

On 14-Sep-2009, at 02:44, Sebastian Wagner wrote:

The problem is that Sharer  Viewer should be a Java Application  
that does
not require Installation on the client machine and it has to be  
available

for all plattforms. So Java Web Start is our choice.

The solution will be part of a GPL-Project so it cannot be based on
commercial products.

thanks,
sebastian

2009/9/13 Andre-John Mas aj...@sympatico.ca


You may want to look at the Java VNC Viewer:

http://www.realvnc.com/support/javavncviewer.html

or TightVNC:

http://www.tightvnc.com/download.html

it may save you repeating work which has already been done elsewhere.

André-John





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



Re: howto add a UDP Listener

2009-09-13 Thread Andre-John Mas


On 13-Sep-2009, at 14:19, Caldarale, Charles R wrote:


From: Sebastian Wagner [mailto:seba.wag...@gmail.com]
Subject: howto add a UDP Listener

Is there a way of telling tomcat to receive UDP Packets and forward
them to my Handlers?


No.  Tomcat is a server for HTTP requests running over TCP  
protocol.  You'll need to implement your own UDP handler.  You might  
want to look over this thread, which sounds similar to your  
situation (ignore the last message of the thread, which is a hijack):

http://marc.info/?t=11356216962r=1w=2

You might be able to make use of this within your code:
http://mina.apache.org/


I am just curious what problem the original poster is trying to address?

The approach I would probably take is to make an external proxy  
application that accepts the UDP requests and then submits the data as  
an HTTP request to the web server using a GET or POST request. The  
advantage with this is that it helps keep the webapp focused on HTTP  
and not stuff that doesn't really fit with web server.


André-John



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



Re: howto add a UDP Listener

2009-09-13 Thread Andre-John Mas


On 13-Sep-2009, at 15:04, Sebastian Wagner wrote:


Thanks for your answers.

I am working on a Desktop Sharing application that is sending the  
Desktop

Images over UDP to Tomcat. As this is quite time-critical I need to
integrate the UDP-handler into my webapp.
It seems like using MINA does solve my Issues.

thanks,
sebastian


Will you be sending images to a single host and is the solution send  
only?


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



Re: howto add a UDP Listener

2009-09-13 Thread Andre-John Mas

You may want to look at the Java VNC Viewer:

http://www.realvnc.com/support/javavncviewer.html

or TightVNC:

http://www.tightvnc.com/download.html

it may save you repeating work which has already been done elsewhere.

André-John

On 13-Sep-2009, at 16:10, Sebastian Wagner wrote:


yes it is a solution send only ... or receive only.

sebastian

2009/9/13 Andre-John Mas aj...@sympatico.ca



On 13-Sep-2009, at 15:04, Sebastian Wagner wrote:

Thanks for your answers.


I am working on a Desktop Sharing application that is sending the  
Desktop

Images over UDP to Tomcat. As this is quite time-critical I need to
integrate the UDP-handler into my webapp.
It seems like using MINA does solve my Issues.

thanks,
sebastian



Will you be sending images to a single host and is the solution  
send only?



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





--
Sebastian Wagner
http://www.webbase-design.de
http://openmeetings.googlecode.com
http://www.laszlo-forum.de
seba.wag...@gmail.com



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



Multiple data centers and redundency?

2009-08-25 Thread Andre-John Mas

Hi,

I have been asked to look into a solution that would involve a few  
different data centres each with their own set of load balanced Tomcat  
servers. The requirement is for the users not to lose their session if  
one data center goes down. I have never had to work on something this  
large and have no idea to what extent this can be achieved with Tomcat.


My initial thoughts would be for each data center to have a session  
pool, which is synced with each other, so if ever a Tomcat server or  
data center goes down they can check in the pool to see if it exists  
and then reuse that. It would mean extra communication behind the  
scene, but I see no other way go about it.


Any help would be appreciated.

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



Re: Multiple data centers and redundency?

2009-08-25 Thread Andre-John Mas

Hi,

I have just been given some more information. The architecture would  
involve a DNS server perodically giving out a DNS address for one DNS  
server and then an address for the other. Each data centre would have  
multiple hosts, each running multiple tomcats. The load balancer would  
take the incoming request and send it to one of the tomcat instances,  
using a cookie to send the request back to the same tomcat instance.


I see there is clustering available with Tomcat, but I don't see how  
this works across data centers, if at all.


André-John

On 25-Aug-2009, at 20:30, Andre-John Mas wrote:


Hi,

I have been asked to look into a solution that would involve a few  
different data centres each with their own set of load balanced  
Tomcat servers. The requirement is for the users not to lose their  
session if one data center goes down. I have never had to work on  
something this large and have no idea to what extent this can be  
achieved with Tomcat.


My initial thoughts would be for each data center to have a session  
pool, which is synced with each other, so if ever a Tomcat server or  
data center goes down they can check in the pool to see if it exists  
and then reuse that. It would mean extra communication behind the  
scene, but I see no other way go about it.


Any help would be appreciated.

André-John
-
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: Multiple data centers and redundency?

2009-08-25 Thread Andre-John Mas


On 25-Aug-2009, at 20:52, Hassan Schroeder wrote:

On Tue, Aug 25, 2009 at 5:38 PM, Andre-John Masaj...@sympatico.ca  
wrote:



... The architecture would involve
a DNS server perodically giving out a DNS address for one DNS  
server and

then an address for the other.


Huh?


Teaches me to proof read. The DNS server gives the IP address of the  
load

balancer of one data center, with TTL of 30 seconds, and then hands out
the IP address of the load balancer of the other data center. I don't
have the exact details, but this is what I have been told.

One thing that I wonder is how we can be sure that the browser tries the
data center that is has been previously been using if the address has  
been

purged from the local DNS cache, but the client is still meant to be in
session. Not really a Tomcat issue, though I would be curious if there  
are

any Tomcat related case studies in this vane.

I see there is clustering available with Tomcat, but I don't see  
how this

works across data centers, if at all.


You might want to research distributed load balancing -- it's been
a while since I've had to deal with it, so the hardware options have
doubtless changed. (Cisco's Remote Director was pretty much the
only game in town at the time.)


Thanks for the pointer, I will see what I can find.

André-John

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



Gzip compression and caching?

2009-08-19 Thread Andre-John Mas

Hi,

I saw the Tomcat can use Gzip compression, though I am curious to know  
whether there is any built in caching mechanism to cache static  
content that has been Gzipped, to reduce the server load?


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



Sub paths and context (migrating Tomcat 5.0 to 5.5)

2009-08-14 Thread andre John Mas

Hi,

We currently have a context configuration 
(conf/Catalina/localhost/partnerco.xml) file that contains the following :

Context debug=1 docBase=/data/webapps/enroll/agent 
path=/enroll/partnerco reloadable=true override=true
 Parameter name=redirectURL value=/agent/enroll.do?partner=PC 
override=false/
 Parameter name=partnerCode value=PC override=false/
/Context

So when a user types:

http://.../enroll/partnerco

it gets picked up by the appropriate web application. Migrating to Tomcat 5.5 
it appears to be the file name of the context file that is used and the path 
attribute is ignored. This means only:

http://.../partnerco

works. How can I get back this functionality, without having to change the 
application architecture? I have tried moving the context file to:

 conf/Catalina/localhost/enroll/partnerco.xml

but this doesn't work either.

André-John

 




RE: Sub paths and context (migrating Tomcat 5.0 to 5.5)

2009-08-14 Thread andre John Mas



 Date: Fri, 14 Aug 2009 11:44:37 -0400
 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 Subject: Re: Sub paths and context (migrating Tomcat 5.0 to 5.5)
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Andre John,
 
 On 8/14/2009 11:37 AM, andre John Mas wrote:
  How can I get back this functionality, without having to change the
 application architecture? I have tried moving the context file to:
  
   conf/Catalina/localhost/enroll/partnerco.xml
  
  but this doesn't work either.
 
 Try
 
 conf/Catalina/localhost/enroll#partnerco.xml
 
 This is covered in the Introduction section of
 http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
 

I missed that. For the benefit of others: 

in individual files (with a .xml extension) in the 
  $CATALINA_HOME/conf/[enginename]/[hostname]/ directory.
  The name of the file (less the .xml) extension will be used as the
  context path. Multi-level context paths may be defined using #, e.g.
  context#path.xml. The default web application may be defined
  by using a file called ROOT.xml.

I actually put %2F as the separator and that also appears to have worked, 
though I will changed it to what the documentation suggests.

Thanks

André-John


Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Andre-John Mas
The time stamp on the file is given by your OS. What operating system  
and version are you using? Also, what time zone are you in?


André-John

On 13-Aug-2009, at 23:38, Mon Cab wrote:



When I edit a JSP, tomcat is compiling the JSP (both java and class  
files)  in the work directory with a timestamp exactly 1 hour  
greater than the current time.


Eg. If I edit a jsp (after emptying the work directory), at 20:00,  
and then load the page from a client, class and java files will  
appear in the work directory with a timestamp of 21:00.


I thought this might be a issue with the JVM time, however, when I  
look at the tomcat logs Tomcat is gorreclt logging time in the logs,  
exactly the same as the system time.


Does anyone have any idea why this might be happening?




-
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 writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Andre-John Mas


On 13-Aug-2009, at 23:55, Mon Cab wrote:



That's what I thought.

However if I edit and reload a file at 20:00, and check the system  
time with date command I get 20:00 as the system time.

And yet the compiled Java and Class files are timestamped 21:00



What operating system and version are you using? Also, what time zone  
are you in? There is maybe some environment issue.


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



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Andre-John Mas


On 13-Aug-2009, at 23:59, Mon Cab wrote:

Sorry forgot to answer your other questions.  I'm using Fedora, and  
timezone is PDT.  Pacific.




Which Fedora version? Also what version of Java?

I am wondering whether there is a daylight saving issue. Maybe there  
is something in this article of relevance:


http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html

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



Re: Tomcat writing the wrong timestamp on compiled JSP's

2009-08-13 Thread Andre-John Mas


On 14-Aug-2009, at 00:09, Andre-John Mas wrote:



On 13-Aug-2009, at 23:59, Mon Cab wrote:

Sorry forgot to answer your other questions.  I'm using Fedora, and  
timezone is PDT.  Pacific.




Which Fedora version? Also what version of Java?

I am wondering whether there is a daylight saving issue. Maybe there  
is something in this article of relevance:


http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-time.html



There is also this post:

http://ubuntuforums.org/showthread.php?t=552053

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



Re: JSESSIONID cookie permanent?

2009-08-12 Thread Andre-John Mas
The session data is stored on the server, so if the JSESSIONID lasted  
longer
than the session on the server, it would simply map to an expired  
session.
What would happen in this case is the server would have no session  
mapping

to that ID and simply allocate a new session, with a new JSESSIONID.

There are two ways to store your cart:

  - regular browse cookie, being sure to respect maximum storage
  - store it on the server

The last appraoch is the only way to ensure the user will have access
to the cart from another machine, though this will require a user  
account.


The regular browser cookie will allow you short term storage, but has
limited storage space and is only accessible from the computer the user
last visited yoru site with.

André-John

On 12-Aug-2009, at 14:52, Mitch Claborn wrote:


I don't have any problem with the session contents (on the tomcat
server).  I'm in a tomcat cluster and the sessions are replicated
between members of the cluster.  As long as at least one member of the
cluster is running, then the sessions survive.  I don't mind if the
sessions on the server expire after a number of days. I'm just wanting
the user to be able to keep his sessionid across browser sessions.

Mitch

Hassan Schroeder wrote:
On Wed, Aug 12, 2009 at 11:35 AM, Mitch Clabornmi...@claborn.net  
wrote:



My usage is:  I store the key to the user's shopping cart in the
session.



If I understand you correctly, then you would need to serialize the
session when it ended, to be able to resurrect it and retrieve that
key, or have never-expiring sessions (probably *not* a good idea).



I'd like the user to be able to come back a few days from now
and still find the items they have placed in their shopping cart.   
(This

is mostly for anonymous users who don't sign in until checkout.)



Why can't you just save the cart key in a persistent cookie?




-
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



Preventing access to directories?

2009-07-22 Thread Andre-John Mas

Hi,

If I create a folder in the base of my web application, for example:

  webapp/mydir

can I prevent access to it?

What I am wanting to do it create modules within my web application  
that contain the associated components:


  webapp/
 module/
   js/
   css/
   jsp/
   img/

The JSPs will be accessed via struts2, so I want to ensure that  
someone typing:


   http://../webapp/module/jsp/abc.jsp

won't be able to access the resource. I know I could put the JSPs in  
WEB-INF (it is what I do now), though I am wanting to explore another  
way of organising and grouping related resource, for easier management.


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



Re: Preventing access to directories?

2009-07-22 Thread Andre-John Mas


On 22-Jul-2009, at 22:36, Hassan Schroeder wrote:

On Wed, Jul 22, 2009 at 5:23 PM, Andre-John Masandrejohn@gmail.com 
 wrote:



 I want to ensure that someone typing:

  http://../webapp/module/jsp/abc.jsp

won't be able to access the resource. I know I could put the JSPs  
in WEB-INF

(it is what I do now), though I am wanting to explore another way of
organising and grouping related resource, for easier management.


Uh, say what? It's easier to manage put stuff in directory A versus
put stuff in directory B?

Why not make your life easy and leave it in WEB-INF???


I probably will, though I was wanting to examine the alternatives.

Andre

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



Re: Preventing access to directories?

2009-07-22 Thread Andre-John Mas


On 22-Jul-2009, at 20:23, Andre-John Mas wrote:


Hi,

If I create a folder in the base of my web application, for example:

 webapp/mydir

can I prevent access to it?

What I am wanting to do it create modules within my web application  
that contain the associated components:


 webapp/
module/
  js/
  css/
  jsp/
  img/

The JSPs will be accessed via struts2, so I want to ensure that  
someone typing:


  http://../webapp/module/jsp/abc.jsp

won't be able to access the resource. I know I could put the JSPs in  
WEB-INF (it is what I do now), though I am wanting to explore  
another way of organising and grouping related resource, for easier  
management.




Turns out I can do the following:

   security-constraint
 web-resource-collection
web-resource-nameJSP/web-resource-name
descriptionPrevents access to .jsp files/description
url-pattern*.jsp/url-pattern
  /web-resource-collection
  auth-constraint/
   /security-constraint

One other source suggested a filter. I have an answer to my question,  
now to see if it solves anything.


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



Re: Ignore or Trust any certificate

2009-07-11 Thread Andre-John Mas


On 11-Jul-2009, at 00:36, kareem_s_m wrote:



So when my site connects to a site through HTTPS protocol, tomcat  
tires to
validate the server certificate with the cacerts keystore in my JDK.  
Now if
the server certificate is signed by a trusted authority then the  
connection

is successful. But if the certificate is a test one (not signed by any
trusted authority) and when tomcat tries to validate the  
certificate, the
validation fails and the connection fails. The error I get it as  
follows:


Caught unhandled exception: javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable  
to find

valid certification path to requested target.

So to avoid this, I want to know if tomcat can ignore or trust any  
server

certificate with out validating it.


What API are you using to connect to the server? For example the default
java.net.URL or HttpClient?

If you are using HttpClient, you may want to look at this thread:

http://forums.sun.com/thread.jspa?threadID=411937messageID=1886339

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



Re: Problem of port 8080

2009-06-26 Thread Andre-John Mas


On 26-Jun-2009, at 06:18, Xia Guowen wrote:


Those three ports actually belong to the same process.
# netstat -lnutp |grep 80
tcp0  0 127.0.0.1:8005   
0.0.0.0:*   LISTEN  29907/java
tcp0  0 0.0.0.0:8009 
0.0.0.0:*   LISTEN  29907/java
tcp0  0 0.0.0.0:8080 
0.0.0.0:*   LISTEN  29907/java


ipv6 is disable.


This is not the same as what you were showing in the previous posting.  
In the previous posting you

showed:

tcp0  0 ::: 
8080 :::*LISTEN


which is I believe is indication that it bound to IPv6. Maybe you  
disactivated IPv6 and this caused

the port to be unbound?

BTW Another tool that I find useful is lsof (list open files):

lsof -pprocess id | grep TCP

or for the port:

lsof -i:port

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



Re: Best practices for switching back/forth between java 1.5/1.6

2009-06-24 Thread Andre-John Mas


On 24-Jun-2009, at 14:54, Ken Bowen wrote:


Hi all,

I failed at searching for this, even though I know it's been answered:
Setting:  Tomcat 6.0_20; Mac OS X 10.5.7;
I've been normally running against java 1.5.0_19, but I tried to  
install a war which is throwing


.UnsupportedClassVersionError: Bad version number in .class file

when it tries to load.  So clearly I need to run it under java 1.6,  
which is installed, and I know that moving to 1.6 is a good thing.
However, for a while I'm going to need to switch back and forth  
between 1.5 and 1.6, because at least one customer is stuck at 1.5  
for the present.   I made a copy of tomcat's bin/startup.sh, renamed  
it sup16.sh, and added these two lines at the top:


JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/ 
Home

export JAVA_HOME

This appears to work well enough -- the new war starts and does it's  
basic thing ok, and when I want to switch up to 1.6 in general, I  
could do the same thing creating a sup15.sh.   So I really only have  
two questions:


1) Are there hidden problems lurking with doing things this way?

2) Is there a better way of being able to switch back  forth?


If this is simply for development purposes, then I would recommend  
having two installations of Tomcat. One is configured to use JDK 1.5  
and the other JDK 1.6. Specify the JAVA_HOME in catalina.sh. There are  
other solutions, but from experience this is the simplest approach.


Andre

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



Re: Serving images from classes directory

2009-06-18 Thread Andre-John Mas


On 18-Jun-2009, at 08:26, Susan G. Conger wrote:


-- What is 'it', precisely?
It is server images from the classes directory.

I realize the correct place to put my scripts and graphics.  However  
the

tool app deploys the app it makes for me as a class under it's classes
directory.  So I want to put all of my custom scripts and graphics  
in that
class package that it creates.  I then want to be able to access my  
custom
content by editing the html and putting a url in that points to the  
custom

content inside the class that was created by the tool app.


The only way to serve images from the classes directory would be for you
to write a servlet that reads the files and then serves them up. While  
you

can do this, don't be surprised by the performance overhead.

I would recommend trying to find the least 'hackerish' approach to make
things work.

For example if it is a question of project management, then you could  
either
split things into separate webapps, or find a folder naming structure  
that

is maintainable, and enforced.

One other approach I have seen is to split the project into  
'functional areas'
that get merged at build time. There is a common project, which has  
the shared
API and the sub projects have the specific elements for their  
functional area.


Andre


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



Re: Caching rendered page - reducing hits to the backend?

2009-06-02 Thread Andre-John Mas


On 2-Jun-2009, at 04:37, Pid wrote:


Have you already measured the performance of your application and
determined that caching the rendered pages is the appropriate thing to
do - ie how have you determined that database access is the  
bottleneck?


If not, caching page content may just hide a multitude of performance
related sins.

JPA's built-in caching may already provide enough in the way of
performance improvements to make an additional caching layer  
pointless.


Is the database on a different machine or the same one and are you
clustering Tomcat?

You're probably worrying unnecessarily.



I think I may end up simply ensuring that the database has enough memory
and slowly evaluate where the bottle necks are. What I will do at the  
same
time is have a number of points to watch out for, with possible  
solutions.

I will also make sure that the last results for the search are cached
in the user session.

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



Caching rendered page - reducing hits to the backend?

2009-05-30 Thread Andre-John Mas

Hi,

Much of the content on the site which I am in the process will be semi- 
static, and I want to be able to cache the rendered pages to reduce  
database hits. To explain:


A given page will depend on dynamic data that is stored in the  
database, but that data is updated about once a month. The only true  
dynamic information will be the header where the user login state is  
shown. There will likely be a few million entries in this database and  
we are planning to support high traffic. The pages can be localised.  
The page is going to be queried as such:


  http://myhost.com/myapp.action?id=12345678

Although I am using a direct JPA access, we might change to use web  
services in the future.


Am I worrying unecessarily? At the same time are there recommended  
approaches. I am currently using struts2 and JPA for the web site, if  
it makes a difference.


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



Re: retrive Arabic data

2009-05-28 Thread Andre-John Mas


On 28-May-2009, at 09:23, abdul razack wrote:


Hi Mark,

 As you suggested, I have tested sample JSP in the FAQ as you pointed.
I could see Arabic in the output. This is OK.

I am not able to view Arabic data when tomcat application running on  
winodws 2003 server OR windows 2000 professional.


But I am surprised to see Arabic data when I run application on  
windows XP professional.


In all above scenarios data base SQL server 2005 resides on Windows  
2003 server.



Any other setting that I need to do in Tomcat.



The ability to display non-latin charactrers depends as much on the  
client operating system, as on the what the server is providing. For  
example if you have nothing on your computer that knows how to render  
arabic charcaters then you are likely to end up with junk characters  
(usually question marks).


The best character encoding to use for international data, and in  
general IMHO, is UTF-8. Most recent operating systems support UTF-8.  
With Windows 2003 server and Windows 2000, it will depend on what  
browser you are using, whether you have international language packs  
installed and whether you have the right fonts.


Linux, MS-Windows (as of Windows XP) and MacOS X all know how to deal  
with UTF-8. On Windows you should ensure that at least Internet  
Explorer 7 is being used.


Andre

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



Re: retrive Arabic data

2009-05-28 Thread Andre-John Mas


On 28-May-2009, at 10:00, Stevo Slavić wrote:


Or Tomcat installations are configured differently on each of the
environments, e.g. Connector URIEncoding attribute.



URIEncoding only effects how the query URL is interpretted, AFAIK.
It effects nothing else.

André-John


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



Re: retrive Arabic data

2009-05-28 Thread Andre-John Mas


On 28-May-2009, at 15:59, George Sexton wrote:

The issue is the default character set for Java. I've noticed that  
at least at one point in time, the default character set for Java  
running under windows was Windows-1252. Running under Linux it  
defaults to ISO-8859-1.


A few other things to ensure:

- If you are using JSPs ensure that the content header is correct:

  %...@page contentType=text/html; charset=UTF-8   
pageEncoding=UTF-8 %


  You can specify any encoding you wish, but this is the most  
universal encoding.
  If you don't specify the character encoding in the content-type  
most browsers

  will default to ISO-8859-1 as the specification requires.

- You can over-ride the default encoding used by the VM, by passing
  the -Djava.encoding=UTF-8 option in catalina.bat

The default encoding under Linux actually depends on which  
distribution you are
using. Red Hat for example defaults to UTF-8. In general you should  
not make
any assumptions on which character encoding the OS is using. One  
assumption

you can make is that Java uses UTF-16 internally.

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



Re: mod_proxy, Tomcat and request URL

2009-05-21 Thread Andre-John Mas


On 21-May-2009, at 12:32, Rainer Jung wrote:


On 20.05.2009 17:33, Markus Schönhaber wrote:

Andre-John Mas:


this is not the ideal setup, I don't have any control over this. At
the same time I see that using mod_proxy, by way of ProxyPass, means
that the Tomcat server does not know what hostname was used to  
access

the Apache server, instead getting http://localhost:8080/ . Is there
any way, probably via configuration of Apache, that this could be
passed to the Tomcat? I looked for information on this, but I could
not find any.


Instead of mod_proxy_http, I use mod_proxy_ajp. AJP passes the  
client's

IP through.


On 20.05.2009 16:59, Caldarale, Charles R wrote:

Aren't the X-Forwarded-For and X-Forwarded-Host headers being set by

mod_proxy?  The doc indicates they should be:

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html


.. and finally there's ProxyPreserveHost.


That's one option I missed.

Is there any way to know whether Apache was contacted using HTTPS or
HTTP, on the Tomcat side?


If yo want to get an idea, which other traps are to avoid when using a
reverse proxy, you can also look at

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html


I would love to go with AJP, but due to a very conservative customer,
this is not an option we can look at. The other points on the page
with regards to URL rewriting seem of interest, though the idea is
to try to remove assumptions to what name the client is accessing
the host by. The reason is so when we move from dev to integration
to production, this is one less thing to keep track of.

André-John


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



mod_proxy, Tomcat and request URL

2009-05-20 Thread Andre-John Mas

Hi,

Where I work the production environment is using Apache HTTPD in front  
of Tomcat and the link is then made via mod_proxy. While I understand  
this is not the ideal setup, I don't have any control over this. At  
the same time I see that using mod_proxy, by way of ProxyPass, means  
that the Tomcat server does not know what hostname was used to access  
the Apache server, instead getting http://localhost:8080/ . Is there  
any way, probably via configuration of Apache, that this could be  
passed to the Tomcat? I looked for information on this, but I could  
not find any.


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



Re: tomcat no longer writing to log files

2009-05-15 Thread Andre-John Mas


On 15-May-2009, at 10:37, Michael A. Repucci wrote:

Also, tomcat does work out of the box. Incorrect administration  
of any

system will stop it
from working out of the box.



Honestly, what I'm most frustrated about isn't Tomcat, per say, but  
the

stuff written by my colleagues that should work with Tomcat. I'm a bit
baffled how the über-cross-platform Java (and its disciples Ant and  
Tomcat)

could be used to create code that is extraordinarily sensitive to the
version and platforms on which it is compiled and run. I suppose  
that's just
because the code was poorly written, and you could probably write  
platform-
and version-dependent code in any language, but it would have been  
nice if I
could have installed whatever the latest packages were on my system,  
and
compiled and run successfully the first time. Instead I'm spending  
upwards
of a week learning all the internals. I guess that's useful in the  
long run,
but I could just use some good and patient guidance. Sorry to have  
stepped

on anybody's toes, and thank you all for your help.



I hate to say it, but the best way to make Java code have issues is  
trying to
be too smart when doing something. This usually results in code that  
works
in certain narrow situations, but not the rest. What I mean by being  
'too
smart' is when someone try to make the best 'uber' code possible,  
which ends

up being convoluted and only understandable to the author when it was
written. I am not saying it is the case here, but programming is like
hand writing, in that you do yourself a favour by making sure it is  
written
well enough that someone else can read it and yourself in a month's  
time.


On the other hand, there are different version of servlet specification,
of Java, of Tomcat and each has their incompatibilities. Learning how to
make your code work in the widest range of conditions will help make
you a better programmer, IMHO.

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



Re: Page not completing loading - ideas?

2009-05-15 Thread Andre-John Mas


On 13-May-2009, at 21:14, Caldarale, Charles R wrote:


From: Andre-John Mas [mailto:andrejohn@gmail.com]
Subject: Page not completing loading - ideas?

Does anyone have any ideas of how to go about analysing the issue?


I'd start with a Wireshark capture/trace on the client workstation  
to see exactly what's going on over the network.  If you can get a  
Tomcat AccessLogValve trace from the integration server to correlate  
with it, that would help.


I was told that a day later it was back to normal.  Apparently the  
only thing that changed was the CMS content. This is resolved for now.


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



Re: [OT] Performance with many small requests

2009-05-13 Thread Andre-John Mas


On 13-May-2009, at 09:16, David kerber wrote:


Christopher Schultz wrote:

...

Since a String object is immutable, one should always use a
StringBuffer (preferably a StringBuilder, these days) when you are
constructing strings in a piecemeal fashion, then convert to String
when complete.



This advice is good when constructing a long string in a loop or  
across

a long series of statements. If you are just concatenating a bunch of
string together to make a big one in a single statement, go ahead and
use the + operator: the compiler is smart enough to convert the  
entire

thing into a StringBuilder (a non-synchronized replacement for
StringBuffer) expression that gets good performance without making  
your

code look like crap.

I was wondering about that.  It certainly seemed like a good place  
for a smart compiler to fix things up, but didn't know if it  
actually did or not.  I don't do a lot of that, but enough of it  
that it becomes a style issue.


If in doubt write a small test case and repeat it for a period of time  
and see which one had the most completions. The one with the most  
completions is likely to be the most optimal.


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



Page not completing loading - ideas?

2009-05-13 Thread Andre-John Mas

Hi,

We recently encountered an issue on one of our integration machines,  
where a fews pages will not finish loading (actually it will, but only  
after around 4 minutes), and this is not even a large page. The same  
tomcat and web application work fine on the local development  
workstation and pre-integration server. Because the integration  
machine is managed by the customer, we aren't allowed to make any  
modifications to tomcat or the webapp without their consent (which is  
not always easy politically). For this reason we need to be able work  
out what could be causing the issue.


Does anyone have any ideas of how to go about analysing the issue?

We are using Linux, Tomcat 5.5.27 and JDK 1.6. The pages are rendered  
using XSL (I suspect this issue might be here, but nothing in the logs  
help).


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



Analyzing Tomcat related VM crash?

2009-05-11 Thread Andre-John Mas

Hi,

We have recently put into production a Tomcat 5.5.27 based web site,  
using JDK 1.6 (JDK 1.6.0_12-b04 on RedHat Linux). We have spent months  
developing and testing the site, both by us and the customer, and  
experienced no VM crashes. Now that we are in production we find the  
VM is crashing from time to time. Trying to see if anyone else has  
experienced the same thing I simply find plenty of requests for help,  
but no answers.


Looking at my catalina log I see:

[2009-05-08 01:22:33,174] ERROR (StandardWrapperValve.java:260) -  
Servlet.service() for servlet action threw exception

java.lang.IllegalStateException
	at  
org 
.apache 
.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:405)
	at  
org 
.apache 
.struts.action.RequestProcessor.processMapping(RequestProcessor.java: 
658)
	at  
org 
.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 
193)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1164)

at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
269)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at com.myco.web.filter.CharsetFilter.doFilter(CharsetFilter.java:35)

I doubt this would be enough to destabilize a VM? We have a second  
filter that might be picky about the order that it is called, and we  
will look into this, but not being able to reproduce this issue in a  
non-producion environment is making it challenging. The 'uname -a'  
command gives:


Linux myco-prod01 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005  
i686 i686 i386 GNU/Linux


Can anyone suggest an approach to establish the route cause? What  
stuff should I be checking?


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



Re: Analyzing Tomcat related VM crash?

2009-05-11 Thread Andre-John Mas


On 11-May-2009, at 18:59, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André-John,

On 5/11/2009 6:48 PM, Andre-John Mas wrote:

We have recently put into production a Tomcat 5.5.27 based web site,
using JDK 1.6 (JDK 1.6.0_12-b04 on RedHat Linux). We have spent  
months

developing and testing the site, both by us and the customer, and
experienced no VM crashes. Now that we are in production we find  
the VM

is crashing from time to time.


JVM crashes are no good :(


Looking at my catalina log I see:

[2009-05-08 01:22:33,174] ERROR (StandardWrapperValve.java:260) -
Servlet.service() for servlet action threw exception
java.lang.IllegalStateException


This is unlikely to be causing any JVM crash.


I doubt this would be enough to destabilize a VM? We have a second
filter that might be picky about the order that it is called, and we
will look into this, but not being able to reproduce this issue in a
non-production environment is making it challenging.


It's pretty much impossible to crash the JVM intentionally just using
Java code. You have to go JNI to do that.

I would (as always) be suspicious of the physical hardware. Try taking
one of the servers out of service and run a memory/cpu test on it.  
I'll

bet it's got bad memory.

You didn't give any details of the crash. I'm guessing SIG11?



I have added the details to the end of this e-mail.

André-John

catalina.out:

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x06546578, pid=7456, tid=2349013936
#
# Java VM: Java HotSpot(TM) Server VM (11.2-b01 mixed mode linux-x86)
# Problematic frame:
# V  [libjvm.so+0x546578]
#
# An error report file with more information is saved as:
# /home/apache/hs_err_pid7456.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

/home/apache/hs_err_pid7456.log (certain names changed, for anonymity):

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x06546578, pid=7456, tid=2349013936
#
# Java VM: Java HotSpot(TM) Server VM (11.2-b01 mixed mode linux-x86)
# Problematic frame:
# V  [libjvm.so+0x546578]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---  T H R E A D  ---

Current thread (0x08060800):  GCTaskThread [stack:  
0x8bfb1000,0x8c032000] [id=7459]


siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR),  
si_addr=0x


Registers:
EAX=0x0001, EBX=0xa46f8520, ECX=0x, EDX=0x
ESP=0x8c0318d0, EBP=0x8c0318f8, ESI=0xb42d, EDI=0x8bd56680
EIP=0x06546578, CR2=0x, EFLAGS=0x00010246

Top of Stack: (sp=0x8c0318d0)
0x8c0318d0:   0805ee88 8bd566d8 8c0318f8 0001
0x8c0318e0:   0805eec8 0100 a46f8520 8bd56680
0x8c0318f0:   08060800 0001 8c031938 0654922b
0x8c031900:   8bd56680 0001 8bd56680 8bd56680
0x8c031910:   0805eec8  8bd56680 063488bd
0x8c031920:   0805eec8  8bd56680 8a8e6cb8
0x8c031930:   08060800 0666128c 8c0319d8 0632848b
0x8c031940:   8a8e6cb8 0805ee88 0001 

Instructions: (pc=0x06546578)
0x06546568:   f0 89 d9 83 e1 01 84 c9 0f 85 9f 00 00 00 8b 13
0x06546578:   8b 02 83 e0 03 83 f8 03 75 7e 8b 12 80 3d cd 87

Stack: [0x8bfb1000,0x8c032000],  sp=0x8c0318d0,  free space=514k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,  
C=native code)

V  [libjvm.so+0x546578]
V  [libjvm.so+0x54922b]
V  [libjvm.so+0x32848b]
V  [libjvm.so+0x506929]
C  [libpthread.so.0+0x4dec]


---  P R O C E S S  ---

Java Threads: ( = current thread )
  0x8b1d1800 JavaThread http-8085-Monitor [_thread_blocked,  
id=7498, stack(0x89de3000,0x89e34000)]
  0x8b1d JavaThread http-8085-Processor25 daemon  
[_thread_blocked, id=7497, stack(0x89e34000,0x89e85000)]
  0x8b1ae800 JavaThread http-8085-Processor24 daemon  
[_thread_blocked, id=7496, stack(0x89e85000,0x89ed6000)]
  0x8b1ad400 JavaThread http-8085-Processor23 daemon  
[_thread_blocked, id=7495, stack(0x89ed6000,0x89f27000)]
  0x8a79fc00 JavaThread http-8085-Processor22 daemon  
[_thread_in_native, id=7494, stack(0x89f27000,0x89f78000)]
  0x8a79e800 JavaThread http-8085-Processor21 daemon  
[_thread_blocked, id=7493, stack(0x89f78000,0x89fc9000)]
  0x8a6b4c00 JavaThread http-8085-Processor20 daemon  
[_thread_blocked, id=7492, stack(0x89fc9000,0x8a01a000)]
  0x8a6b3800 JavaThread http-8085-Processor19 daemon  
[_thread_blocked, id=7491, stack(0x8a01a000,0x8a06b000)]
  0x8a842400 JavaThread http-8085-Processor18 daemon  
[_thread_blocked, id=7490, stack(0x8a06b000,0x8a0bc000)]
  0x8a841000 JavaThread http-8085-Processor17 daemon  
[_thread_blocked, id=7489, stack(0x8a0bc000,0x8a10d000)]
  0x8a8cd000 JavaThread http-8085-Processor16 daemon  
[_thread_blocked, id=7488, stack(0x8a10d000,0x8a15e000)]
  0x8a8cbc00 JavaThread http-8085-Processor15 daemon  
[_thread_blocked, id=7487, stack

Re: how to build an multi lingual website

2009-05-07 Thread Andre-John Mas
If Apache is handling your static content, and you are simply using  
Tomcat
to serve dynamic content, then you can use the request.getLocale()  
method
to find out what language the visitors browser is suggesting. For  
example:


   String lang = request.getLocale().getLanguage();
   if ( es.equals(lang) ) {
  
   }
   else {
  ...
   }

How to get Tomcat to mimic Apache HTTPD's approach of serving static  
HTML
pages in the right language, I am not sure. The only approach I can  
think

of is to group all language content together in the same sub folder, for
example:

  /en/...
  /es/...
  /fr/...

and then using relative paths. Using the above approach (ignoring  
language

variations), you could do:

   String lang = request.getLocale().getLanguage();
   ServletContext context = getServletConfig().getServletContext();
   if ( (new File(context.getRealPath(/ + lang)).exists() ) {
   response.sendRedirect(/ + lang);
   }
   else {
  response.sendRedirect(/en/);
   }

This assumes index.jsp within the language folder.

As a commentary on my part: if you expect to support more than European
languages, then it is worthwhile standardising on UTF-8 for content
encoding.


On 7-May-2009, at 15:35, Andrew Davidson wrote:


Hi



I do you know how I can build a multi lingual website? My main  
website is in
English. I want to have a landing page in Spanish that describes my  
website
and invites the user to click through the English version of the web  
site.
Any idea how I set this up using Tomcat? The bulk of our web site is  
static

html pages.



Some one sent me a link about how to do this using the Apache web  
server so

that it check the Accept-Language of the http header

http://developers.sun.com/dev/gadc/technicalpublications/articles/apache.htm
l



I have not been able to find a similar discussion for how to configure
Tomcat to get similar behavior



Do I have to replace index.html with a servlet that checks the value  
of
Accept-Language and generates a redirect to something like  
index.html.en or

index.html.en



Thanks



Andy



p.s. I am using Tomcat 5.5.x





 _

Music Trainer  makes it easy  to learn new songs by slowing down or  
speeding

up play back without changing the pitch!



Learn more at www.SantaCruzIntegration.com






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



Re: Performance with many small requests

2009-05-07 Thread Andre-John Mas


On 7-May-2009, at 19:05, David Kerber wrote:


Andre-John Mas wrote:


That would be my impression too. It is best to avoid making the  
synchronized scope so large, unless there is a very good reason.


David, do you have any reason for this? Beyond the counter, what  
other stuff do you synchronise? Also, it has generally been  
recommended to me to avoid hitting the disk in every request, since  
you may result with an I/O bottle neck, so if you can write the  
logs in batches you will have better performance. If you know that  
you are only going to have very few users at a time (say, less than  
10), it may not be worth the time optimising this, but if you know  
that you are going to get at least several hundred, then this is  
something to watch out for.


Thanks for the comments, Andre-John and Peter.  When I wrote that  
app, I

didn't know as much as I do now, but I'm still not very knowledgeable
about synchronized operations.

The synchronized section doesn't do a whole lot, so it doesn't take  
long

to process.  My question is, what kinds of operations need to be
synchronized?  All I do is decrypt the data from the POST, send a  
small
acknowledgement response back to the site, and write the line to the  
log

file.  Does that sound like something that would need to be
synchronized?  If not, pulling that out would be a really easy test to
see if it helps my performance issue.



I am no expert in this myself, but I know enough to help me out in  
most day to day scenarios. What you should be reading up on is  
concurrency in Java. A few useful resources:


  site: http://java.sun.com/docs/books/tutorial/essential/concurrency/
  book: 
http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601

I actually bought the book myself and find it a handy reference.

What I can say is that any time two threads are likely to access the  
same object, which has the potential to be modified by one of them,  
then you will need to synchronize access to the object. If the object  
is only going to be read during the life of the unit of work, then  
you will need not synchronize it. You shouldn't simply use the  
synchronize keyword as a magical solve all for threading issues and  
instead need to understand what the nature of the interactions are  
between the threads, if any. In certain cases it is actually better to  
duplicate the necessary resources, have each thread work on its copy  
and then synchronize the value at the end.


In the case of your code, you should ask what are the shared objects  
that are going to modified by the threads. You should also look if it  
is even necessary for the objects to be shared. Also consider whether  
for the call cycle the objects you are going to modify are only  
available on the stack, as opposed to a class or instance member.


To give you a real world analogy: consider a home that is being built  
and you have an electrician and a plumber:
  - is it better to have one wait until the other is finished (serial  
execution)?
  - is it possible for them to be working on different stuff and not  
be stepping on each other's feet? (parallel execution)
  - if you need them to work at the same time, what is the cost of  
coordinating each other so that

they do not interfere with the other? (synchronization issues)
In many ways multi-threading is not much different, and you should be  
asking yourself the same type of questions.


André-John


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



Re: Prevent Hot Linking

2009-05-04 Thread Andre-John Mas


On 19-Apr-2009, at 12:22, Graeme Kidd wrote:




Thanks André,
urlrewrite seems a suficiant solution for now as I only want to  
block people if they try and acess the file from outside my domain.  
If my understanding is correct blocking by IP although harder to  
fake would prevent them no matter what.


There is an example given in the urlrewrite guide on Blocked Inline- 
Images which I plan to adapt to my needs:

http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.2/guide.html


I have seen some site block images from being loaded if the referrer  
is not the site in question. I don't know if this is possible with  
Tomcat?


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



Re: Basic authentication without a secure connection

2009-05-03 Thread Andre-John Mas


On 3-May-2009, at 08:11, Tokajac wrote:




Now why would you want to do that ?
I want to connect applications: one is running on Tomcat (Java/ 
Struts) with

another (php).

I have an application running on Tomcat that has a link to other  
application
which is on another server. Application on another server is  
protected with:

http://en.wikipedia.org/wiki/Basic_access_authentication
http://en.wikipedia.org/wiki/Basic_access_authentication

I want to pass credentials after link is clicked, so I don't need to  
fill
the username and password informations. I see that I might need to  
add row:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
in the request header.


Is this possible to do? How?


Is your Tomcat proxying a connection, or do you an application that  
needs

information from another application, but is not exposed to the user?

If it is the latter, then you could look at using Apache HttpClient:

http://hc.apache.org/httpclient-3.x/

and then adding the header in the request.

If the user is going to be accessing the application directly, then  
there
is a reason the security is in place and you should not over-ride it,  
unless
you are sure the people who protected the resource are fine with it.  
If the
resource is requires authentication, then I would be surprised they  
would be

okay with it, but I am not going to make any assumptions.

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



Re: Database pooling prob

2009-05-03 Thread Andre-John Mas
The IP address isn't missing. What you are seeing is an IPv6 address,  
and

more specifically the localhost IP address.

For information see:

http://en.wikipedia.org/wiki/IPv6

You can try doing 'ping6 ::1' and you will get a repsonse.

André-John

On 2-May-2009, at 17:17, S Arvind wrote:


Why ip is missing???

-Arvind S
*




Many of lifes failure are people who did not realize how close they  
were to

success when they gave up.
-Thomas Edison*


On Sun, May 3, 2009 at 2:42 AM, Filip Hanik - Dev Lists
devli...@hanik.comwrote:

if the client and the server are on the same machine, you would get  
two

lines in the netstat output

TCP[::1]:80   Michael:50522  ESTABLISHED
TCP[::1]:50522Michael:http   ESTABLISHED

one line is for the server connection, and the other one is for the  
client

connection.

Filip


S Arvind wrote:

from this stack trace i can find that there is no problem in  
Tomcat or

dbcp.
But when i try my postgre from outside application its working  
fine but

when
i connect from local tomcat application it not working fine. I  
disable the

firewall and all ... but i keep on getting this stack 

AbandonedObjectPool is used
(org.apache.tomcat.dbcp.dbcp.abandonedobjectp...@d5eb7)
 LogAbandoned: true
 RemoveAbandoned: true
 RemoveAbandonedTimeout: 300
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Connection refused. Check that the  
hostname and
port are correct and that the postmaster is accepting TCP/IP  
connections.)

  at

org 
.apache 
.tomcat 
.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java: 
1225)

  at

org 
.apache 
.tomcat 
.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)



When i tried the netstat to check my vista ports , at that time i  
found

one
wierd line...

TCP[::1]:80   Michael:50522  ESTABLISHED
TCP[::1]:50522Michael:http   ESTABLISHED

As my tomcat is listening to 80, i dont know why i dont  get the ip
address
in the netstat result for port 80 alone..
It is surely my tomcat request since only when i make the request  
its

showing...

I think the problem in ip only... please any one help.. postgres and
tomcat
in same system and postgres is watchin to port 5432 only.

Arvind


*
Many of lifes failure are people who did not realize how close  
they were

to
success when they gave up.
-Thomas Edison*






-
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: Basic authentication without a secure connection

2009-05-03 Thread Andre-John Mas
The browser takes care of that, and you should not be trying to over- 
ride it.
If you don't want to retype the username/password all the time, then  
you can
tell teh browser to remember the password, or have the server in  
question not
asking for the password, understanding the consequences - this latter  
one

being more of a 'social' issue than a technical one.

If you don't want an authentication attempt without having a secure  
connection,

then you could arrange to have any http pages redirect to https.

André-John

On 3-May-2009, at 14:06, Tokajac wrote:



Thank you  for the link, André-John!


User should access the application directly (not proxying).
On
http://hc.apache.org/httpclient-3.x/tutorial.html
as I see header is created for programatic access and not via browser.

Is it possible to do this when I use browser for accessing? How?


Regards

P.S.

I opened this topic on
http://www.coderanch.com/t/442467/Security/Basic-authentication-without-secure-connection
also



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



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 09:04, Pid wrote:


David Rush wrote:
I checked my web.xml, and found no mime-mapping elements at all.  I  
tried adding one explicitly mapping the jsp extension to text/html,  
but it had no effect.  I'm still getting HTML markup in the browser  
window with Firefox.


David


Ignore that, it's a red herring, you don't need to add mime-mappings.

You say the problem occurs 'sometimes' with Firefox, can you elaborate
on which times and if there's a commonality between these requests?


The fault is usually in the AJP mapping you've configured.  Are you
using mod_jk, and if so, what is the config?

Also, try splitting your HTTP docroot and Tomcat webapps folders (a
correct mapping will mean it still works properly).  If the JSPs are  
in

another location than the HTTP docs, they can't be served as raw HTML,
by accident.


He indicated in an earlier post that it was his hosting provider who  
deployed

his application.

David, have you been able to find out how your hosting company  
deployed your
application? Also, what is there server header value in the response  
header?


If your web application is properly deployed then there is no reason  
your

web browser should see the raw JSP. This is because if everything works
correctly Tomcat will have interpreted the JSP and returned you the  
result

of that.

If in doubt, try to simulate the set up on your machine. Even if it  
doesn't
solve the hosting provider side of things, it should help you gain a  
better

understanding of how things work.

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



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 18:15, Andre-John Mas wrote:



On 27-Apr-2009, at 09:04, Pid wrote:


David Rush wrote:
I checked my web.xml, and found no mime-mapping elements at all.   
I tried adding one explicitly mapping the jsp extension to text/ 
html, but it had no effect.  I'm still getting HTML markup in the  
browser window with Firefox.


David


Ignore that, it's a red herring, you don't need to add mime-mappings.

You say the problem occurs 'sometimes' with Firefox, can you  
elaborate

on which times and if there's a commonality between these requests?


The fault is usually in the AJP mapping you've configured.  Are you
using mod_jk, and if so, what is the config?

Also, try splitting your HTTP docroot and Tomcat webapps folders (a
correct mapping will mean it still works properly).  If the JSPs  
are in
another location than the HTTP docs, they can't be served as raw  
HTML,

by accident.


He indicated in an earlier post that it was his hosting provider who  
deployed

his application.

David, have you been able to find out how your hosting company  
deployed your
application? Also, what is there server header value in the  
response header?


If your web application is properly deployed then there is no reason  
your
web browser should see the raw JSP. This is because if everything  
works
correctly Tomcat will have interpreted the JSP and returned you the  
result

of that.

If in doubt, try to simulate the set up on your machine. Even if it  
doesn't
solve the hosting provider side of things, it should help you gain a  
better

understanding of how things work.

André-John


I should have included an example of the headers to help you diagnose  
the
situation. In my case I have Tomcat sitting behind Apache HTTPD. If I  
access

Tomcat via HTTPD I see:

Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 PHP/ 
5.2.8 mod_jk/1.2.27


If I access the Tomcat server straight, I see this:

Server: Apache-Coyote/1.1

If you are using Firefox, and you have the Web Developer extension  
installed, then

in the toolbar select Information - View Response Headers.

Hopefully this should help in your analysis.

André-John




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



Tomcat and Apache HTTPD modules?

2009-04-27 Thread Andre-John Mas

Hi,

If Apache HTTPD is dropped for a pure Tomcat solution, which standard  
modules have

Tomcat equivalent solutions? For example:
  - Mod Rewrite
  - HTTPS
  - Virtual Hosts

It may be interesting to get some of this into the official Tomcat  
documentation.


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



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 13:59, Leon Rosenberg wrote:



In addition to more granular security (as described above), having  
isolated the web layer from the application layer allows you to  
independently adjust the performance of each. If you are finding  
that your system serves a lot more static content than it does  
'application' functionality, you may need several web servers to  
handle the load. Likewise, if your system is application focused,  
you may need more tomcat servers (probably clustered) than web  
servers.


The short answer to that would probably be, if you have performance
concerns, you just do not use apache httpd. If you want/need to
loadbalance, a hardware loadbalancer is the weapon of choice. If you
need to server a lot of large static content (pictures) you put
reverse proxies in front of your tomcats. If you need to serve static
content (js, css etc) along with dynamic content, you let tomcat
handle it, it serves static content faster than httpd anyway.

Imho, the only valid use for httpd in front of tomcat is when you are
a one-man one-server company and need to host a lot of virtual stuff
on your box including php and such. Everything else and you are better
of without httpd :-)



If you have a large budget, then hardware anything generally makes for
better performance, since that what they are optimized for. On the other
hand when you a small startup Apache HTTPD allows you to leverage  
hardware
you already have for a much lower cost. The following article  
illustrates

this:

http://www.networkcomputing.com/channels/security/showArticle.jhtml?articleID=47204086

Long term it makes more sense to invest the right equipment, but we  
don't

all have $4000 available right off.

Are there any good articles, with performance numbers that show how  
Tomcat can
compete against Apache HTTPD? While many on this will accept what you  
have

to say, the people who make the financial choices often want something
that lays it out bare in a documented format.

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



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 22:05, David Rush wrote:


Andre-John:

Actually it was the original poster who was using a hosting  
company.  I'm using machines that I have full control of.


My problem was resolved by calling setContentType(text/html) in  
the controller servlet before it used include() to send control to  
some .jsp files.


Ah ok, I hadn't paid attention to the issue change.

BTW since you are using a JSP, you should be able to specify the  
content type in the JSP:


%@ page language=java contentType=text/html; charset=UTF-8  
pageEncoding=UTF-8%


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



Re: Browser shows source of .jsp file. Why?

2009-04-24 Thread Andre-John Mas

What does try to open the parent folder show? Chances are, if they have
set up Tomcat, the files aren't being hosted with Tomcat. Another thing
worth checking is whether you have you WEB-INF/web.xml file deployed.

If they are cooperative ask them to show you how they have set things
up. The worst they can do is deny you the request.

André-John

On 24-Apr-2009, at 19:46, dfobox wrote:



I have JSP-based website running on my own server and I want to move  
it to
hosting company. I've copied the files, they said they have enabled  
Tomcat
for me, but browser shows source of the pages, even of those which  
don't
have any script code inside - only properly formatted html. What  
could be a

problem? Thanks!
--
View this message in context: 
http://www.nabble.com/Browser-shows-source-of-.jsp-file.-Why--tp23226583p23226583.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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





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



Re: Cookies and values with ':' in them

2009-04-21 Thread Andre-John Mas


On 21-Apr-2009, at 10:15, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andre-John,

On 4/16/2009 5:48 PM, Andre-John Mas wrote:

Will this only be for writing? I depend a cookie set by a third-party
web application in the same domain, which sends me the cookies this
way. If it is only for writing, then I will have to find a way of
convincing the developers of the other application to make the  
change.


You can always try to parse the header yourself, instead of using the
Cookie part of the servlet API. Then you can allow the embedded colon
regardless of the cookie specification.


Yup, though not really elegant. We have opted to try to work with the
developers of the application for them to make the necessary changes.

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



Re: 15 second for redeployment is to much

2009-04-19 Thread Andre-John Mas


On 19-Apr-2009, at 14:57, André Warnier wrote:


Hi.

I am far from being the specialist here, but my inner application  
designer core revolts at the idea of having a thread in Tomcat busy  
at nothing else but checking 86,400 times a day, just in case you  
redeploy an application from time to time.

There must exist a more efficient mechanism for doing that.
One should probably check how the Tomcat Manager deploys an  
application on-demand, and use the same mechanism e.g.


This is one reason I would like to see a file change listener as  
standard in Java. The idea is that for systems providing a native file  
listener, such as Unix system which offer kernel notifications this  
would be used, and as a fall-back a timer task would be used. I am not  
aware of any current cross-platform implementations of this approach.



I'm curious to see Chuck's reaction to this thread.

Khlystov Alexandr wrote:

I have 10 seconds now instead of 15 with 2 of 3 options:
backgroundProcessorDelay=1
Context docBase=hello-webapp path=/hello-webapp  
reloadable=true antiJARLocking=true  
backgroundProcessorDelay=1/

and
lazy-init for all beans.
Cool! thanks again.
Now I'm going to sleep, and will implement javac direct compilation  
tomorrow.

Kees Jan Koster пишет:

Dear Khlystov,

1. 5 second (using maven) compile source ( usually it is 1 or 2  
files )

2. 0 second copy *.class file into Tomcat/webapps


Stop using Maven for simple compiles and write a small shell  
script that just calls javac with the webapp's WEB-INF/classes as  
output dir.



3. 5-7 seconds waiting while Tomcat finds that my webapp deployed
files are changed


There is a timer somewhere that you can lower for this. I forget  
precisely which one. It will slow down Tomcat a bit, but you will  
redeploy faster.



4. 1 seconds takes to undeploy my webapp
5. 3-5 seconds takes to deploy ( really initialize Wicket  Spring
Beans frameworks with my data)



Well, you chose these frameworks, so you'll have to live with  
their startup times. Lazy initialisation *may* help, if you  
initialise more than you need for a specific test.


--
Kees Jan

http://java-monitor.com/forum/
kjkos...@kjkoster.org
06-51838192

Rule 1 for being in a hole: stop digging.


-
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: Building Tomcat 5.5.27 tomcat-native

2009-04-19 Thread Andre-John Mas


On 19-Apr-2009, at 16:45, Mark Thomas wrote:


Andre-John Mas wrote:
the only thing which seems odd is the generated tar balls are  
marked as

5.5.26. Is this normal?


No :). That is a bug.


I suppose it is the wrong time to open a ticket for this, but for  
5.5.28 would it be worth opening a ticket to make sure that 5.5.28  
doesn't generate tarballs marked '5.5.27'?


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



When is 5.5.28 planned to be released?

2009-04-17 Thread Andre-John Mas

Hi,

Tomcat 5.5.28 offers us the ability to change the name of the  
JSESSIONID, something we depend on because we are operating two  
application servers behind the same HTTPD server. We currently have a  
patched version of 5.x and are in the process of moving to 5.5.x, but  
without this patch in place. We could patch our 5.5.27, but we would  
rather avoid this if possible. For this reason can anyone tell me when  
the target date for the 5.5.28 release is?


If the target date is after the target date for our project, what do  
you reckon is the simplest way to apply a patched Globals.java to a  
Tomcat instance without recompiling the whole Tomcat 5.5.27?


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



When is 5.5.28 planned to be released?

2009-04-17 Thread Andre-John Mas

Hi,

Tomcat 5.5.28 offers us the ability to change the name of the  
JSESSIONID, something we depend on because we are operating two  
application servers behind the same HTTPD server. We currently have a  
patched version of 5.x and are in the process of moving to 5.5.x, but  
without this patch in place. We could patch our 5.5.27, but we would  
rather avoid this if possible. For this reason can anyone tell me when  
the target date for the 5.5.28 release is?


If the target date is after the target date for our project, what do  
you reckon is the simplest way to apply a patched Globals.java to a  
Tomcat instance without recompiling the whole Tomcat 5.5.27?


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



Building Tomcat 5.5.27 tomcat-native

2009-04-17 Thread Andre-John Mas

Hi,

I am trying to build 5.5.27, but it is asking for tomcat-native  
1.1.12, though I see that only 1.1.16 is available. This being the  
case, a couple of questions:

  - is this a suitable replacement?
  - where do I specify to use this version instead? I will looking  
through the source in the meantime


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



Re: Building Tomcat 5.5.27 tomcat-native

2009-04-17 Thread Andre-John Mas


On 17-Apr-2009, at 14:12, Caldarale, Charles R wrote:


From: Andre-John Mas [mailto:aj...@sympatico.ca]
Subject: Building Tomcat 5.5.27  tomcat-native

I am trying to build 5.5.27, but it is asking for tomcat-native
1.1.12, though I see that only 1.1.16 is available. This being the
case, a couple of questions:
  - is this a suitable replacement?


Yes.


  - where do I specify to use this version instead?


apache-tomcat-5.5.26-src/build/build.properties.default

- Chuck


I have now sorted the tomcat-native issue, but running into another  
issue, of methods that should be over-ridden, but aren't (see a sample  
at the end of this e-mail).


I am using JDK 1.6 as my VM, should I be using JDK 1.4 or JDK 1.5 for  
my builds?


André-John


   [javac] /home/ajmas/share/java/tomcat-deps/src/java/org/apache/ 
tomcat/dbcp/dbcp/BasicDataSource.java:44:  
org.apache.tomcat.dbcp.dbcp.BasicDataSource is not abstract and does  
not override abstract method isWrapperFor(java.lang.Class) in  
java.sql.Wrapper

[javac] public class BasicDataSource implements DataSource {
[javac]^
[javac] /home/ajmas/share/java/tomcat-deps/src/java/org/apache/ 
tomcat/dbcp/dbcp/DelegatingStatement.java:46:  
org.apache.tomcat.dbcp.dbcp.DelegatingStatement is not abstract and  
does not override abstract method isPoolable() in java.sql.Statement
[javac] public class DelegatingStatement extends AbandonedTrace  
implements Statement {

[javac]^
[javac] /home/ajmas/share/java/tomcat-deps/src/java/org/apache/ 
tomcat/dbcp/dbcp/DelegatingStatement.java:131: isClosed() in  
org.apache.tomcat.dbcp.dbcp.DelegatingStatement cannot implement  
isClosed() in java.sql.Statement; attempting to assign weaker access  
privileges; was public

[javac] protected boolean isClosed() {
[javac]   ^
[javac] /home/ajmas/share/java/tomcat-deps/src/java/org/apache/ 
tomcat/dbcp/dbcp/DelegatingPreparedStatement.java:50:  
org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement is not  
abstract and does not override abstract method  
setNClob(int,java.io.Reader) in java.sql.PreparedStatement
[javac] public class DelegatingPreparedStatement extends  
DelegatingStatement

[javac]^
 
-

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



Re: Building Tomcat 5.5.27 tomcat-native

2009-04-17 Thread Andre-John Mas


On 17-Apr-2009, at 15:30, Andre-John Mas wrote:



On 17-Apr-2009, at 14:12, Caldarale, Charles R wrote:


From: Andre-John Mas [mailto:aj...@sympatico.ca]
Subject: Building Tomcat 5.5.27  tomcat-native

I am trying to build 5.5.27, but it is asking for tomcat-native
1.1.12, though I see that only 1.1.16 is available. This being the
case, a couple of questions:
 - is this a suitable replacement?


Yes.


 - where do I specify to use this version instead?


apache-tomcat-5.5.26-src/build/build.properties.default

- Chuck


I have now sorted the tomcat-native issue, but running into another  
issue, of methods that should be over-ridden, but aren't (see a  
sample at the end of this e-mail).


I am using JDK 1.6 as my VM, should I be using JDK 1.4 or JDK 1.5  
for my builds?


Building with JDK1.5 resolves the issue - thanks

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



Re: Building Tomcat 5.5.27 tomcat-native

2009-04-17 Thread Andre-John Mas


On 17-Apr-2009, at 15:34, Caldarale, Charles R wrote:


From: Andre-John Mas [mailto:aj...@sympatico.ca]
Subject: Re: Building Tomcat 5.5.27  tomcat-native

should I be using JDK 1.4 or JDK 1.5 for my builds?


Use 1.5.

Sun enhanced the SQL interfaces in 1.6 in a way that made them  
incompatible with implementations based on older versions.  The only  
workaround at the moment is to build Tomcat with 1.5; you may run  
the resulting classes on 1.6.




That works. Now everything builds when I use the build.xml in the  
build directory, using:


ant release

the only thing which seems odd is the generated tar balls are marked  
as 5.5.26. Is this normal?


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



Cookies and values with ':' in them

2009-04-16 Thread Andre-John Mas

Hi,

The company I am working for is in the process of migrating from  
Tomcat 5.x.x to Tomcat5.5.27. In doing so we noticed that the any  
cookie value containing a colon will have the value trimmed up to  
before that character. This is new. A work around is to add quotes  
around the value, but we were hoping to avoid such changes:


To write:

Cookie cookie = new  
Cookie(PROFILE_UPDATE_TS_X,2009-04-16T23:34:19Z);

cookie.setSecure(true);
cookie.setPath(/);
response.addCookie(cookie);

To read:

/**
  * This is a convenience method for getting a cookie by name. If  
the
  * cookie is not present in the request, a null value will be  
returned.

  */
 protected Cookie getCookie ( String cookieName,  
HttpServletRequest request ) {

 Cookie[] cookies = request.getCookies();
 for ( int i=0; icookies.length; i++ ) {
 if ( cookies[i].getName().equals(cookieName) ) {
 return cookies[i];
 }
 }
 return null;
 }

This is certainly a regression.

André-John 
-

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



Re: Cookies and values with ':' in them

2009-04-16 Thread Andre-John Mas


On 16-Apr-2009, at 17:08, Mark Thomas wrote:


Using a ':' in a v0 cookie is not legal. You have to use a v1 cookie
which is as simple as using:
cookie.setVersion(1);

5.5.28 will (hopefully - if it gets enough votes) an feature  
(enabled by

default) to automatically switch invalid v0 cookies to v1 cookies and
quote them.



Will this only be for writing? I depend a cookie set by a third-party
web application in the same domain, which sends me the cookies this
way. If it is only for writing, then I will have to find a way of
convincing the developers of the other application to make the change.

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



Session timeout related fixes between Tomcat 5.0 and Tomcat 5.5.x?

2008-12-03 Thread andre John Mas

Hi,

We are currently experiencing session issues with our customer's Tomcat 
server, in a production environment. Basically what is happening is that, 
despite the idle time-out being set for 20 minutes we are seeing sessions 
that have been idle (have not been accessed) for over 3 hours. The net 
result is that the Tomcat server needs to get restarted.


We are currently investigating the reason why, but are currently in the dark 
on how we should continue our analysis. If anyone has any ideas they would 
be much appreciated.


One parallel line of analysis is to find out if there were any fixes between 
5.0.x and 5.5.x, that are related to sessions not timing out. The customer 
is resisting an upgrade, but if we can show that there have been session 
related fixes, then this could help our case. If there have been none, then 
we will simply have to focus purely on the web application.


Any help would be appreciated.

André-John



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Session timeout related fixes between Tomcat 5.0 and Tomcat 5.5.x?

2008-12-03 Thread andre John Mas

From: Caldarale, Charles R [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Subject: RE: Session timeout related fixes between Tomcat 5.0 and Tomcat 
5.5.x?


 From: andre John Mas [mailto:[EMAIL PROTECTED]
 Subject: Session timeout related fixes between Tomcat 5.0 and
 Tomcat 5.5.x?

 Basically what is happening is that, despite the idle
 time-out being set for 20 minutes we are seeing sessions
 that have been idle (have not been accessed) for over
 3 hours.

Do you have keep alives enabled?  Look at the maxKeepAliveRequests 
attribute:

http://tomcat.apache.org/tomcat-5.5-doc/config/http.html#Standard%20Implementation

Is your webapp caching sessions for any reason?  Can you implement a 
SessionListener to see if expiration events are occurring?


 The net result is that the Tomcat server needs to get restarted.

Why?  Are you running out of heap space?  Do you have a memory leak 
elsewhere as well?


 One parallel line of analysis is to find out if there were
 any fixes between 5.0.x and 5.5.x, that are related to
 sessions not timing out.

The changelog is here for your perusal:
http://tomcat.apache.org/tomcat-5.5-doc/changelog.html



I have implemented a session listener and also activated access logs. The 
session listener adds a list with sessionCreated() and removes them with 
sessionDestroyed(). I then have a JSP that displays the list, along with 
when the session was created, using getCreationTime(), and when the session 
was last accessed, using getLastAccessedTime(). If a session has already 
been invalidated by the container I will get a IllegalStateException when I 
call  getCreationTime() on the session I am getting the information from. An 
example output of my tool is:


sessioninfo count=581 maxLife=657.410  maxIdle=636.710 
   session id=54D57E020A2791CDDDE6307E7565C328 life=657.410 
idle=632.789 /
   session id=6EE000B43250CC6CEDCD3B2D95A5A79B life=657.039 
idle=616.064 /
   session id=8CE0C68E1098C291D69F70FEB4EFC631 life=641.774 
idle=636.710 /
   session id=10C182293F0CBA68291AF2C439E6058A life=104.579 
idle=65.900 /
   session id=F62A60B0037D09D44B7F27E549A4D6B1 life=104.336 
idle=74.971 /
   session id=CAC0CA3066737D8316CBABB7E960EDBC life=104.195 
idle=98.052 /
   session id=FD8CCFF63428DE1C50A668DF27C2865D life=103.911 
idle=64.812 /
   session id=874032F034F3E12C911C9152632C5D7D life=101.407 
idle=99.031 /

/sessioninfo

- life is current time - creation time.
- idle is current time - last accessed time.

When I speak to our operations team they tell me that the server crashes 
because it is unable to create any more sessions, so it is possible we are 
out of heap space. The logs show me that at least half of the sessions are 
idle for more than 30min. I could probably add more information to the tool 
to display memory usage.


The other issue is that we are having trouble reproducing this in a 
development environment, so it is making our life just a bit harder.


The changelog that you pointed me to only seems to cover changes from 5.5 
onwards. There is nothing there covering 5.x previous to that. Are there any 
older logs available anywhere?


Andre



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]