Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 27 Jul 2010 06:31:40 -0000 Issue 9731

users-digest-help

2010-07-27


Author LoginPost Reply

users Digest 27 Jul 2010 06:31:40 -0000 Issue 9731

Topics (messages 215050 through 215064):

Re: error listener start
 215050 by: Adam Posner
 215051 by: Caldarale, Charles R
 215052 by: Adam Posner
 215053 by: Adam Posner
 215054 by: Adam Posner
 215055 by: Caldarale, Charles R
 215056 by: Adam Posner

Re: Tomcat Shutting Down by Itself?
 215057 by: AndrĂ© Warnier
 215062 by: Robinson, Eric

Re: SSL terminated at load balancer, Http11Processor sends ssl redirects to :80
 215058 by: Leinartas, Michael
 215060 by: john.ranaudo.thomsonreuters.com
 215061 by: Leinartas, Michael

Re: CGIServlet followed by a Filter that modifies the response
 215059 by: Caldarale, Charles R

httpd-2.2.3-43 + Mod_ssl + Mod_jk + tomcat-6.0.29
 215063 by: Irfan Khan

Struts App dispatcher error on Tomcat 5.5.23
 215064 by: Venkat Tanga

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_215050.ezm (zipped)
Also, its the latest JVM, j2ee, java 6. The webap is in
/use/share/apache-tomcat-6.0.28/webapps/dailtTamp-v1/WEB-INF/classes
THe class files are belsw com which is under classes
On Mon, Jul 26, 2010 at 12:18 AM, Caldarale, Charles R <
Chuck.Caldarale@(protected):

> > From: Adam Posner [mailto:cuco2772@(protected)]
> > Subject: error listener start
> >
> > This is a tough one . I have no clue.
>
> And apparently don't even know the version of Tomcat you're running... or
> at least you haven't bothered to tell us. If and when you do, report all
> three fields of the version, please. Also tell us the JVM level and
> platform you're running on, and how you installed Tomcat.
>
> > All I get in the logs is that error msg.
>
> Unlikely; show us the real logs. Look in both the catalina.*.log and
> localhost.*.log files.
>
> > <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>
> So you're /probably/ running at least Tomcat 6.0, but there's no real proof
> of that.
>
> > My context listener class is in com/listeners
>
> That by itself is ambiguous. Where precisely is your webapp, and where
> precisely is the .class file?
>
> - 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-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Attachment: users_215051.ezm (zipped)
> From: Adam Posner [mailto:cuco2772@(protected)]
> Subject: Re: error listener start
>
> Thanks for the reply and apologies for the incomplete info.

Which, unfortunately, is still incomplete.

> > Also tell us ... how you installed Tomcat.
> >
> > Look in both the catalina.*.log and localhost.*.log files.

The localhost.*.log file should have a stack trace of the error.

> > > My context listener class is in com/listeners
> >
> > That by itself is ambiguous. Where precisely is your
> > webapp, and where precisely is the .class file?

- 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.



Attachment: users_215052.ezm (zipped)
To be even more clear, the TrailContextListener.clas file is in
classes/com/listeners
On Mon, Jul 26, 2010 at 6:10 PM, Adam Posner <cuco2772@(protected):

>
> Also, its the latest JVM, j2ee, java 6. The webap is in
> /use/share/apache-tomcat-6.0.28/webapps/dailtTamp-v1/WEB-INF/classes
> THe class files are belsw com which is under classes
> On Mon, Jul 26, 2010 at 12:18 AM, Caldarale, Charles R <
> Chuck.Caldarale@(protected):
>
>> > From: Adam Posner [mailto:cuco2772@(protected)]
>> > Subject: error listener start
>> >
>> > This is a tough one . I have no clue.
>>
>> And apparently don't even know the version of Tomcat you're running... or
>> at least you haven't bothered to tell us. If and when you do, report all
>> three fields of the version, please. Also tell us the JVM level and
>> platform you're running on, and how you installed Tomcat.
>>
>> > All I get in the logs is that error msg.
>>
>> Unlikely; show us the real logs. Look in both the catalina.*.log and
>> localhost.*.log files.
>>
>> > <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>>
>> So you're /probably/ running at least Tomcat 6.0, but there's no real
>> proof of that.
>>
>> > My context listener class is in com/listeners
>>
>> That by itself is ambiguous. Where precisely is your webapp, and where
>> precisely is the .class file?
>>
>> - 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-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
>

Attachment: users_215053.ezm (zipped)
I downloaded the tar.gz file from the Apache site. When I do an ls in my
logs directory , localhost*.log shows up , but when I try to do
cat localhost.2010-07-25.log, for ex., I get "No such file......" Strange

On Mon, Jul 26, 2010 at 6:12 PM, Adam Posner <cuco2772@(protected):

>
> To be even more clear, the TrailContextListener.clas file is in
> classes/com/listeners
>
> On Mon, Jul 26, 2010 at 6:10 PM, Adam Posner <cuco2772@(protected):
>
>>
>> Also, its the latest JVM, j2ee, java 6. The webap is in
>> /use/share/apache-tomcat-6.0.28/webapps/dailtTamp-v1/WEB-INF/classes
>> THe class files are belsw com which is under classes
>> On Mon, Jul 26, 2010 at 12:18 AM, Caldarale, Charles R <
>> Chuck.Caldarale@(protected):
>>
>>> > From: Adam Posner [mailto:cuco2772@(protected)]
>>> > Subject: error listener start
>>> >
>>> > This is a tough one . I have no clue.
>>>
>>> And apparently don't even know the version of Tomcat you're running... or
>>> at least you haven't bothered to tell us. If and when you do, report all
>>> three fields of the version, please. Also tell us the JVM level and
>>> platform you're running on, and how you installed Tomcat.
>>>
>>> > All I get in the logs is that error msg.
>>>
>>> Unlikely; show us the real logs. Look in both the catalina.*.log and
>>> localhost.*.log files.
>>>
>>> > <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>>>
>>> So you're /probably/ running at least Tomcat 6.0, but there's no real
>>> proof of that.
>>>
>>> > My context listener class is in com/listeners
>>>
>>> That by itself is ambiguous. Where precisely is your webapp, and where
>>> precisely is the .class file?
>>>
>>> - 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-unsubscribe@(protected)
>>> For additional commands, e-mail: users-help@(protected)
>>>
>>>
>>
>

Attachment: users_215054.ezm (zipped)
Jul 25, 2010 11:23:06 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 25, 2010 11:23:06 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jul 25, 2010 11:23:06 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Error configuring application listener of class
com.listeners.TrailsContextListener
java.lang.NoClassDefFoundError: com/listeners/TrailsContextListener (wrong
name: TrailsContextListener)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond (ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:616)
    at
java.security.SecureClassLoader.defineClass (SecureClassLoader.java:141)
    at
org.apache.catalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:2722)
    at
org.apache.catalina.loader.WebappClassLoader.findClass (WebappClassLoader.java:1124)
    at
org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1612)
    at
org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1491)
    at
org.apache.catalina.core.StandardContext.listenerStart (StandardContext.java:4078)
    at
org.apache.catalina.core.StandardContext.start (StandardContext.java:4630)
    at
org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase.java:791)
    at
org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:771)
    at
org.apache.catalina.core.StandardHost.addChild (StandardHost.java:546)
    at
org.apache.catalina.startup.HostConfig.deployDirectory (HostConfig.java:1041)
    at
org.apache.catalina.startup.HostConfig.deployDirectories (HostConfig.java:964)
    at
org.apache.catalina.startup.HostConfig.deployApps (HostConfig.java:502)
    at
org.apache.catalina.startup.HostConfig.start (HostConfig.java:1277)
    at
org.apache.catalina.startup.HostConfig.lifecycleEvent (HostConfig.java:321)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (LifecycleSupport.java:119)
    at
org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1053)
    at
org.apache.catalina.core.StandardHost.start (StandardHost.java:785)
    at
org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1045)
    at
org.apache.catalina.core.StandardEngine.start (StandardEngine.java:445)
    at
org.apache.catalina.core.StandardService.start (StandardService.java:519)
    at
org.apache.catalina.core.StandardServer.start (StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start (Catalina.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke (Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start (Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:414)
Jul 25, 2010 11:23:06 PM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Jul 25, 2010 11:30:07 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Jul 25, 2010 11:30:07 PM org.apache.catalina.core.ApplicationContext log



On Mon, Jul 26, 2010 at 6:19 PM, Adam Posner <cuco2772@(protected):

> I downloaded the tar.gz file from the Apache site. When I do an ls in my
> logs directory , localhost*.log shows up , but when I try to do
> cat localhost.2010-07-25.log, for ex., I get "No such file......" Strange
>
>
> On Mon, Jul 26, 2010 at 6:12 PM, Adam Posner <cuco2772@(protected):
>
>>
>> To be even more clear, the TrailContextListener.clas file is in
>> classes/com/listeners
>>
>> On Mon, Jul 26, 2010 at 6:10 PM, Adam Posner <cuco2772@(protected):
>>
>>>
>>> Also, its the latest JVM, j2ee, java 6. The webap is in
>>> /use/share/apache-tomcat-6.0.28/webapps/dailtTamp-v1/WEB-INF/classes
>>> THe class files are belsw com which is under classes
>>> On Mon, Jul 26, 2010 at 12:18 AM, Caldarale, Charles R <
>>> Chuck.Caldarale@(protected):
>>>
>>>> > From: Adam Posner [mailto:cuco2772@(protected)]
>>>> > Subject: error listener start
>>>> >
>>>> > This is a tough one . I have no clue.
>>>>
>>>> And apparently don't even know the version of Tomcat you're running...
>>>> or at least you haven't bothered to tell us. If and when you do, report all
>>>> three fields of the version, please. Also tell us the JVM level and
>>>> platform you're running on, and how you installed Tomcat.
>>>>
>>>> > All I get in the logs is that error msg.
>>>>
>>>> Unlikely; show us the real logs. Look in both the catalina.*.log and
>>>> localhost.*.log files.
>>>>
>>>> > <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>>>>
>>>> So you're /probably/ running at least Tomcat 6.0, but there's no real
>>>> proof of that.
>>>>
>>>> > My context listener class is in com/listeners
>>>>
>>>> That by itself is ambiguous. Where precisely is your webapp, and where
>>>> precisely is the .class file?
>>>>
>>>> - 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-unsubscribe@(protected)
>>>> For additional commands, e-mail: users-help@(protected)
>>>>
>>>>
>>>
>>
>

Attachment: users_215055.ezm (zipped)
> From: Adam Posner [mailto:cuco2772@(protected)]
> Subject: Re: error listener start
>
> java.lang.NoClassDefFoundError: com/listeners/TrailsContextListener
> (wrong name: TrailsContextListener)

Looks like you're missing the package statement in your Java source code.

- 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.



Attachment: users_215056.ezm (zipped)
I bet that's it, thanks a bunch !

Adam

On Mon, Jul 26, 2010 at 6:26 PM, Caldarale, Charles R <
Chuck.Caldarale@(protected):

> > From: Adam Posner [mailto:cuco2772@(protected)]
> > Subject: Re: error listener start
> >
> > java.lang.NoClassDefFoundError: com/listeners/TrailsContextListener
> > (wrong name: TrailsContextListener)
>
> Looks like you're missing the package statement in your Java source code.
>
> - 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-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

Attachment: users_215057.ezm (zipped)
Robinson, Eric wrote:
>> What I was trying to say above, in a devious but humoristic
>> way, is that there are not a lot of people on this list
>> running those versions anymore.  
>
> Fair enough. I realize it's old, but it still works great for 163 of the
> 164 instances on this server. However, an upgrade is coming soon and
> perhaps that will resolve it. Thanks.
>
You are welcome.
But you have made me curious.
What kind of machine are you running these 163/164 instances of Tomcat on, and when you
are running them, what /does/ "free" say ?
(The first 10 lines of "top" with option "m" would be ok too)



Attachment: users_215062.ezm (zipped)
> What kind of machine are you running these 163/164
> instances of Tomcat on, and when you are running them,
> what /does/ "free" say ?

I have two different servers with 164 instances of tomcat. Both servers
have 2x quad-core 2.8Ghz Xeon processors with 32GB RAM. On the first
server (app03), most instances of tomcat are configured with 64MB of
Java heap. About 20% of them have 96-256MB. I almost never reboot this
server (current uptime 61 days). Here's 'free' from app03.


[root@(protected)
        total     used     free   shared   buffers
cached
Mem:    33265832  30570260   2695572       0   296976
4562784
-/+ buffers/cache:  25710500   7555332
Swap:    2031608       0   2031608


On the other server (app04), all instances of tomcat are configured with
512MB Java heap (-ms512M -mx512M). After 4 or 5 days of uptime, the
server starts to swap a little. Then I reboot it and it is fine for
several more days. As you can see from the following, it is about time
for a reboot. If I do not reboot it tonight, by tomorrow or the next day
it may be up to 1-2GB of swap. (It actually doesn't slow the server down
much though. sar shows that it runs about 90% idle anyway, including
iowait.

[root@(protected)
        total     used     free   shared   buffers
cached
Mem:    33265832  32965812   300020       0   191248
3842092
-/+ buffers/cache:  28932472   4333360
Swap:    2031608     4288   2027320


--
Eric Robinson




Disclaimer - July 26, 2010
This email and any files transmitted with it are confidential and intended solely for Tomcat Users List. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of . Warning: Although has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
This disclaimer was added by Policy Patrol: http://www.policypatrol.com/


Attachment: users_215058.ezm (zipped)
holy. crap.

I cant believe I missed that config. It of course solves my problem, thanks
a bunch.


> From: Rainer Jung <rainer.jung@(protected)>
> Reply-To: Tomcat Users List <users@(protected)>
> Date: Mon, 26 Jul 2010 16:30:02 -0500
> To: Tomcat Users List <users@(protected)>
> Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl
> redirects to :80
>
> On 26.07.2010 21:48, Leinartas, Michael wrote:
>> So I have what appears to be an obscure issue which is a consequence of our
>> architecture and am wondering if anyone's run into anything similar and if
>> my proposed solution is valid. So here's the background of our setup: We
>> run our tomcat by starting it within a simple container using the
>> catalina.startup.Embedded class and wiring up everything manually (i.e.
>> myembedded = new Embedded(new MemoryRealm()). We add two connectors, one
>> for http and one for https. The hardware load balancers we use send http
>> traffic to the http port and terminate ssl for https traffic, sending
>> unencrypted http traffic to the https port.
>>
>> Make sense?
>>
>> The way we've been able to do this is to create an HTTP/1.1 connector and
>> then mark it as secure and with an https scheme (so that request.getScheme()
>> and request.isSecure() return correctly to the webapp):
>> Connector c = new Connector("HTTP/1.1");
>> c.setSecure(true);
>> c.setScheme("https");
>>
>> This is similar to how I've seen it done when googling around for this:
>> <Connector
>>   port="8443"
>>   protocol="HTTP/1.1"
>>   scheme="https"
>>   secure="true"
>> />
>>
>> Now this works fine *except* that when the application needs to send a
>> redirect to a relative path using
>> catalina.connector.Response.sendRedirect(String location), that method
>> converts the path to an absolute path
>> (catalina.connector.Response.toAbsolute) using the info from
>> request.getScheme(), request.getServerName(), and request.getServerPort().
>>
>> It's the request.getServerPort() that's causing a problem. getServerPort is
>> implemented in coyote's Http11.*Processor classes to return port 80 if !ssl
>> or !sslEnabled (depending on which implementation). So in this case, the
>> method always returns port 80 (unless the url already has a port in it as it
>> does in dev). To actually flip the values of those booleans would require
>> setting the SSLEnabled property on the connector which is not what we want.
>>
>> The end result is that if we have, say a secure login page that redirects
>> back to the home page on success, the user is redirected to
>> https://www.mysite.com:80/ which is invalid.
>>
>> What I'm thinking is that getServerPort() should instead be checking to see
>> whether the scheme is http or https rather than looking whether the
>> processor is *actually* handling ssl or not. Is this a valid solution (i.e.
>> should I test and submit a patch) or is there a clean (or hell, even dirty)
>> alternative?
>
> Set proxyPort on the connector?
>
> See: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
>
> Regards,
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>



Attachment: users_215060.ezm (zipped)
So I thought my solution was not good until I read you were getting the https requests on port 8443 but ssl terminated.

Our configuration terminates ssl at the load balancer but forwards to port 80! Which is why I couldn't get the normal options working for me.


John-Paul Ranaudo
Software Architect, Thomson Reuters
 - sent via Blackberry

----- Original Message -----
From: Leinartas, Michael <MICHAEL.LEINARTAS@(protected)>
To: Tomcat Users List <users@(protected)>
Sent: Mon Jul 26 21:07:05 2010
Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl redirects to :80

holy. crap.

I cant believe I missed that config. It of course solves my problem, thanks
a bunch.


> From: Rainer Jung <rainer.jung@(protected)>
> Reply-To: Tomcat Users List <users@(protected)>
> Date: Mon, 26 Jul 2010 16:30:02 -0500
> To: Tomcat Users List <users@(protected)>
> Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl
> redirects to :80
>
> On 26.07.2010 21:48, Leinartas, Michael wrote:
>> So I have what appears to be an obscure issue which is a consequence of our
>> architecture and am wondering if anyone's run into anything similar and if
>> my proposed solution is valid. So here's the background of our setup: We
>> run our tomcat by starting it within a simple container using the
>> catalina.startup.Embedded class and wiring up everything manually (i.e.
>> myembedded = new Embedded(new MemoryRealm()). We add two connectors, one
>> for http and one for https. The hardware load balancers we use send http
>> traffic to the http port and terminate ssl for https traffic, sending
>> unencrypted http traffic to the https port.
>>
>> Make sense?
>>
>> The way we've been able to do this is to create an HTTP/1.1 connector and
>> then mark it as secure and with an https scheme (so that request.getScheme()
>> and request.isSecure() return correctly to the webapp):
>> Connector c = new Connector("HTTP/1.1");
>> c.setSecure(true);
>> c.setScheme("https");
>>
>> This is similar to how I've seen it done when googling around for this:
>> <Connector
>>   port="8443"
>>   protocol="HTTP/1.1"
>>   scheme="https"
>>   secure="true"
>> />
>>
>> Now this works fine *except* that when the application needs to send a
>> redirect to a relative path using
>> catalina.connector.Response.sendRedirect(String location), that method
>> converts the path to an absolute path
>> (catalina.connector.Response.toAbsolute) using the info from
>> request.getScheme(), request.getServerName(), and request.getServerPort().
>>
>> It's the request.getServerPort() that's causing a problem. getServerPort is
>> implemented in coyote's Http11.*Processor classes to return port 80 if !ssl
>> or !sslEnabled (depending on which implementation). So in this case, the
>> method always returns port 80 (unless the url already has a port in it as it
>> does in dev). To actually flip the values of those booleans would require
>> setting the SSLEnabled property on the connector which is not what we want.
>>
>> The end result is that if we have, say a secure login page that redirects
>> back to the home page on success, the user is redirected to
>> https://www.mysite.com:80/ which is invalid.
>>
>> What I'm thinking is that getServerPort() should instead be checking to see
>> whether the scheme is http or https rather than looking whether the
>> processor is *actually* handling ssl or not. Is this a valid solution (i.e.
>> should I test and submit a patch) or is there a clean (or hell, even dirty)
>> alternative?
>
> Set proxyPort on the connector?
>
> See: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
>
> Regards,
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_215061.ezm (zipped)
Ah yeah, initially I thought this wouldn't work for me since - I'm guessing
here, haven't tested - setting proxyPort will screw up the same redirect
requests if i were to hit :8443 directly (i.e. in dev) but this isn't a
problem with this configuration since a browser cant hit
https://myserver:8443 anyway - The browser is trying to terminate ssl which
isn't enabled on the connector, and trying http on :8443 wont work either
since the connector's scheme is set to https.

Thanks again guys, it's been enlightening




> From: "john.ranaudo@(protected)>
> Reply-To: Tomcat Users List <users@(protected)>
> Date: Mon, 26 Jul 2010 20:48:19 -0500
> To: "users@(protected)>
> Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl
> redirects to :80
>
> So I thought my solution was not good until I read you were getting the https
> requests on port 8443 but ssl terminated.
>
> Our configuration terminates ssl at the load balancer but forwards to port 80!
> Which is why I couldn't get the normal options working for me.
>  
>
> John-Paul Ranaudo
> Software Architect, Thomson Reuters
>   - sent via Blackberry
>
> ----- Original Message -----
> From: Leinartas, Michael <MICHAEL.LEINARTAS@(protected)>
> To: Tomcat Users List <users@(protected)>
> Sent: Mon Jul 26 21:07:05 2010
> Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl
> redirects to :80
>
> holy. crap.
>
> I cant believe I missed that config. It of course solves my problem, thanks
> a bunch.
>
>
>> From: Rainer Jung <rainer.jung@(protected)>
>> Reply-To: Tomcat Users List <users@(protected)>
>> Date: Mon, 26 Jul 2010 16:30:02 -0500
>> To: Tomcat Users List <users@(protected)>
>> Subject: Re: SSL terminated at load balancer, Http11Processor sends ssl
>> redirects to :80
>>
>> On 26.07.2010 21:48, Leinartas, Michael wrote:
>>> So I have what appears to be an obscure issue which is a consequence of our
>>> architecture and am wondering if anyone's run into anything similar and if
>>> my proposed solution is valid. So here's the background of our setup: We
>>> run our tomcat by starting it within a simple container using the
>>> catalina.startup.Embedded class and wiring up everything manually (i.e.
>>> myembedded = new Embedded(new MemoryRealm()). We add two connectors, one
>>> for http and one for https. The hardware load balancers we use send http
>>> traffic to the http port and terminate ssl for https traffic, sending
>>> unencrypted http traffic to the https port.
>>>
>>> Make sense?
>>>
>>> The way we've been able to do this is to create an HTTP/1.1 connector and
>>> then mark it as secure and with an https scheme (so that request.getScheme()
>>> and request.isSecure() return correctly to the webapp):
>>> Connector c = new Connector("HTTP/1.1");
>>> c.setSecure(true);
>>> c.setScheme("https");
>>>
>>> This is similar to how I've seen it done when googling around for this:
>>> <Connector
>>>   port="8443"
>>>   protocol="HTTP/1.1"
>>>   scheme="https"
>>>   secure="true"
>>> />
>>>
>>> Now this works fine *except* that when the application needs to send a
>>> redirect to a relative path using
>>> catalina.connector.Response.sendRedirect(String location), that method
>>> converts the path to an absolute path
>>> (catalina.connector.Response.toAbsolute) using the info from
>>> request.getScheme(), request.getServerName(), and request.getServerPort().
>>>
>>> It's the request.getServerPort() that's causing a problem. getServerPort is
>>> implemented in coyote's Http11.*Processor classes to return port 80 if !ssl
>>> or !sslEnabled (depending on which implementation). So in this case, the
>>> method always returns port 80 (unless the url already has a port in it as it
>>> does in dev). To actually flip the values of those booleans would require
>>> setting the SSLEnabled property on the connector which is not what we want.
>>>
>>> The end result is that if we have, say a secure login page that redirects
>>> back to the home page on success, the user is redirected to
>>> https://www.mysite.com:80/ which is invalid.
>>>
>>> What I'm thinking is that getServerPort() should instead be checking to see
>>> whether the scheme is http or https rather than looking whether the
>>> processor is *actually* handling ssl or not. Is this a valid solution (i.e.
>>> should I test and submit a patch) or is there a clean (or hell, even dirty)
>>> alternative?
>>
>> Set proxyPort on the connector?
>>
>> See: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
>>
>> Regards,
>>
>> Rainer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>



Attachment: users_215059.ezm (zipped)
> From: Anthony Brew [mailto:atbrew@(protected)]
> Subject: Re: CGIServlet followed by a Filter that modifies the response
>
> > Unfortunately I am coming across the following:
> >
> > java.lang.IllegalStateException: getWriter() has already
> > been called for this response

Since the CGI servlet uses Response.getOutputStream(), your filter will have to do the same to avoid the exception. A given response can only use one or the other during its lifetime, as documented in the servlet spec.

- 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.


Attachment: users_215063.ezm (zipped)
Dear pals,



I am trying to integrate apache and tomcat by  configuring web server +
mod_jk + mod_ssl + tomcat. This configuration would allow accessing deployed
apps at tomcat from web server with https port. I did searched on archive
list and as well as Google it, perhaps couldn't able to find the solution.



My configuration works fine if I use http port. But my requirement is to use
on https.



I have tomcat running on 8080, apache on 80, mod_ssl and mod_jk installed
and configured.



Kindly help on how to configure to use with https.



Thanks in advance.



irfee














Attachment: users_215064.ezm (zipped)
Hi,

          I just migrated my application from Tomcat 5.0.18 to 5.5.23.

          On server startup Application loading is happening normally, but once I logged into the application and try to access any links, there I am facing the problem.

          The Application is being developed on :  Jdk 1.4 , Struts 1.1, Cocoon 2.0.4.

          Plz find the below mentioned Error stack trace. Can any one plz suggest  me on this. Does any of my old libraries methods are leading to this problem in the new Tomcat 5.5.23 environment in application re-direction?

Jul 27, 2010 11:45:03 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.ClassCastException
    at org.apache.catalina.core.ApplicationDispatcher.unwrapRequest(ApplicationDispatcher.java:813)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:406)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:661)
    at org.apache.jsp.jsp.qv_005fpolicies_jsp._jspService(qv_005fpolicies_jsp.java:1438)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:661)
    at org.apache.jsp.jsp.qv_005fpolicyDetails_jsp._jspService(qv_005fpolicyDetails_jsp.java:291)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.cocoon.components.jsp.ScalableJSPEngine.executeJSP(ScalableJSPEngine.java:143)
    at org.apache.cocoon.generation.JspGenerator.generate(JspGenerator.java:120)
    at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250)
    at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:399)
    at org.apache.cocoon.www.sitemap_xmap.matchN10287(C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\qv\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:2378)
    at org.apache.cocoon.www.sitemap_xmap.process(C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\qv\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1712)
    at org.apache.cocoon.www.sitemap_xmap.process(C:\Program Files\Apache Software Foundation\Tomcat 5.5\work\Catalina\localhost\qv\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1609)
    at org.apache.cocoon.sitemap.Handler.process(Handler.java:224)
    at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:179)
    at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:154)
    at org.apache.cocoon.Cocoon.process(Cocoon.java:575)
    at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at com.iit.web.filter.ContentSecurityFilter.doFilter(ContentSecurityFilter.java:70)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)
--
Regards,
Venkat

Oracle
Venkat Tanga | Staff Consultant
Phone: +918040297837 | | | Mobile: +919611012000
Oracle Fusion Middle Ware Team

ORACLE India | Prestige Tech Park | Venus Block | Phase- II |9th Floor | Survey No. 29 | Sarjapur Marthahalli Ring Road | Bangalore - 560087

Green Oracle Oracle is committed to developing practices and products that help protect the environment
©2008 junlu.com - Jax Systems, LLC, U.S.A.