You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Sand <rs...@vgalleries.com> on 2001/12/16 15:55:24 UTC

Problem with mod_jk ajp13 talking to Tomcat 4, authentication always fails

Hi all- I've encountered a potential bug in mod_jk.  I have a default
installtion of Apache 1.3.14, mod_jk, and Tomcat 4.0.1 on Windows 2000.
mod_jk is talking to Tomcat via ajp13.  Tomcat is (as default) listening on
8080 for its HTTP interface and on 8009 for ajp13.

The problem is this: when I access to Tomcat manager application, i.e.
http://myserver/manager/list, I get properly challenged to log in, but my
username and password never work, and Tomcat eventually says I am
unauthorized.  If I then access the same resource directly through Tomcat,
i.e. http://myserver:8080/manager/list, I get access with no problem.

The problem could be in mod_jk, although I suspect it may lie in Tomcat's
ajp13 listener (simply because mod_jk is older and more widely used, whereas
Tomcat 4 is newer).

Has anyone else seen this problem, or can someone else reproduce it?

Thanks!

Best regards,

Richard


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


classloader caching resources in 4.0?

Posted by Richard Sand <rs...@vgalleries.com>.
Hi all,

Has anyone seen this problem I describe below?  Tomcat 4 seems to be caching
resouce files the way it caches classes, requiring a restart of the
application every time I change a properties file.  Tomcat 3 (and other
servlet engines) did not behave this way- every time I did a
getResourceAsStream it would re-open the file.  Is this new behavior correct
or a bug?

Thanks for any help!

-Richard

----- Original Message -----
> I have a .properties file that I use for my application configuration that
I
> keep in WEB-INF/classes.  I use
> getClass().getResourceAsStream("/myfile.properties") from within a bean to
> load the properties into a static hashtable, and I have a control servlet
> that can tell the bean to reload the file.  This just allows me to edit
the
> properties without having to start and stop the application (which was a
> more painful process pre-Catalina).
>
> Now that I've switched from 3.2.3 to 4.0.1, what I'm seeing is that my
> changes to the properties file are not being picked up when I reset my
bean.
> I've traced through everything, and determined that my subsequent calls to
> getResourceAsStream are still opening the original file, even though I've
> modified and saved it.  Its as if the classloader is treating the resource
> as a class, and it is loading it once and keeping it around, so I need to
> reload the application to reload the resource.
>
> This was not the behavior under 3.x, so my question is, is this proper
> behavior in 4.x, and if so, is there a workaround?
>
> Thanks for any replies!
>
> Best regards,
>
> Richard


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


classloader caching resources in 4.0?

Posted by Richard Sand <rs...@vgalleries.com>.
Hi all,

I have a .properties file that I use for my application configuration that I
keep in WEB-INF/classes.  I use
getClass().getResourceAsStream("/myfile.properties") from within a bean to
load the properties into a static hashtable, and I have a control servlet
that can tell the bean to reload the file.  This just allows me to edit the
properties without having to start and stop the application (which was a
more painful process pre-Catalina).

Now that I've switched from 3.2.3 to 4.0.1, what I'm seeing is that my
changes to the properties file are not being picked up when I reset my bean.
I've traced through everything, and determined that my subsequent calls to
getResourceAsStream are still opening the original file, even though I've
modified and saved it.  Its as if the classloader is treating the resource
as a class, and it is loading it once and keeping it around, so I need to
reload the application to reload the resource.

This was not the behavior under 3.x, so my question is, is this proper
behavior in 4.x, and if so, is there a workaround?

Thanks for any replies!

Best regards,

Richard




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: is it possible to access files not under webapps/ using mod_webapp

Posted by David Smith <dn...@cornell.edu>.
If you have a recent build of mod_webapp, you should be able to specify the 
full path in the WebAppDeply directive.  Pier added this after version 1.0, 
so you definitely need a recent build.

Example:
WebAppDeploy d:/data/tomcat/root  conn  /root (or whatever)

--David

On Monday 17 December 2001 06:43 am, you wrote:
> Hi all- in my TC4 installation i've changed the path for my document base
> to outside of my webapps directory, with the result that I cannot find a
> way to map to that webapp from mod_webapp.  I.e. in my server.xml I have:
> <Context path="" docBase="d:/data/tomcat/root" debug="0"/>
>
> While the other webapps are in "d:/jakarta-tomcat-4.0.1/webapp".  Does
> anyone know if there is a way (without symbolic link trickery!) to do this?
> Both for the root context and further down the line if other webapps have a
> context-path added to move them outside of webapp/?
>
> In the meanwhile I'm using ajp13, but that combination won't let me log in
> to the /manager application (something I posted about yesterday).
>
> Thanks for any help!
>
> Best regards,
>
> Richard
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


is it possible to access files not under webapps/ using mod_webapp

Posted by Richard Sand <rs...@vgalleries.com>.
Hi all- in my TC4 installation i've changed the path for my document base to
outside of my webapps directory, with the result that I cannot find a way to
map to that webapp from mod_webapp.  I.e. in my server.xml I have:
<Context path="" docBase="d:/data/tomcat/root" debug="0"/>

While the other webapps are in "d:/jakarta-tomcat-4.0.1/webapp".  Does
anyone know if there is a way (without symbolic link trickery!) to do this?
Both for the root context and further down the line if other webapps have a
context-path added to move them outside of webapp/?

In the meanwhile I'm using ajp13, but that combination won't let me log in
to the /manager application (something I posted about yesterday).

Thanks for any help!

Best regards,

Richard


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Problems getting webapp module to work with apache 1.3 on windows

Posted by Carlos Ferreira <ca...@gilem.com>.
there's an error in your server.xml:

<Context path="site" docBase="/" debug="0"/>

should be:

<Context path="site" docBase="site_dir_located_under_webapps" debug="0"/>



----- Original Message -----
From: "Pritpal Dhaliwal" <ps...@ucdavis.edu>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, September 14, 2001 6:49 AM
Subject: Problems getting webapp module to work with apache 1.3 on windows


> Hi,
>
> My environment is:
> Win2k advanced server
> apache 1.3.20
> tomcat 4.0.1
> webapp module
>
> I am trying to do the following:
>
> In httpd.conf:
> WebAppConnection conn      warp  localhost:8008
> <VirtualHost IP>
>     ServerName myhost
>     ......
> WebAppDeploy     site  conn  /
> ......
>
> </VirtualHost>
>
> In server.xml I have:
>
> blah ......
>
>
>  <!-- Define the default virtual host -->
>       <Host name="myhost" debug="1"
appBase="C:/www/desiest.bachansoft.com"
> unpackWARs="true">
>         <!-- I just want a root web app right now -->
>           <Context path="site" docBase="/" debug="0"/>
>       </Host>
>
> blah ......
>
>
> My log file says apache_log in tomcat logs
> ( size: 54MB, yes 54 MB in less than a minute):
> 2001-12-15 13:10:48
> [org.apache.catalina.connector.warp.WarpConfigurationHandler] Cannot find
> "C:\Programs\Tomcat4.0\webapps\site" for appl. "site" host
> "desiest.bachansoft.com"
> #this line was repeated few thousand times
> 2001-12-15 13:10:48
> [org.apache.catalina.connector.warp.WarpConfigurationHandler] Error
> deploying web application "site" under <http://myhost:80/>
>
> my web.xml is:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app>
> <error-page>
> <error-code>404</error-code>
> <location>/index.jsp</location>
> </error-page>
> </web-app>
>
>
> What am i doing wrong here?
>
> any help will be appreciated.
>
> Regards,
> Pritpal Dhaliwal
>
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Problems getting webapp module to work with apache 1.3 on windows

Posted by Pritpal Dhaliwal <ps...@ucdavis.edu>.
Hi,

My environment is:
Win2k advanced server
apache 1.3.20
tomcat 4.0.1
webapp module

I am trying to do the following:

In httpd.conf:
WebAppConnection conn      warp  localhost:8008
<VirtualHost IP>
    ServerName myhost
    ......
	WebAppDeploy     site  conn  /
	......

</VirtualHost>

In server.xml I have:

blah ......


 <!-- Define the default virtual host -->
      <Host name="myhost" debug="1" appBase="C:/www/desiest.bachansoft.com"
unpackWARs="true">
        <!-- I just want a root web app right now -->
          <Context path="site" docBase="/" debug="0"/>
      </Host>

blah ......


My log file says apache_log in tomcat logs
( size: 54MB, yes 54 MB in less than a minute):
2001-12-15 13:10:48
[org.apache.catalina.connector.warp.WarpConfigurationHandler] Cannot find
"C:\Programs\Tomcat4.0\webapps\site" for appl. "site" host
"desiest.bachansoft.com"
#this line was repeated few thousand times
2001-12-15 13:10:48
[org.apache.catalina.connector.warp.WarpConfigurationHandler] Error
deploying web application "site" under <http://myhost:80/>

my web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
	<error-page>
		<error-code>404</error-code>
		<location>/index.jsp</location>
	</error-page>
</web-app>


What am i doing wrong here?

any help will be appreciated.

Regards,
Pritpal Dhaliwal





--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>