You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/01/05 09:55:03 UTC

DO NOT REPLY [Bug 38131] New: - WatchedResource does not work if app is outside "webapps"

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131

           Summary: WatchedResource does not work if app is outside
                    "webapps"
           Product: Tomcat 5
           Version: 5.5.12
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: gernot.pfingstl@stmk.gv.at


My webapp is placed outside CATALINA_BASE/webapps.
I put my context.xml into CATALINA_BASE/conf/Catalina/localhost.
My context.xml looks like:
<Context docBase="/somedir/mywebapp">
   <WatchedResource>WEB-INF/web.xml</WatchedResource>
   ...some other stuff...
</Context>

If I change web.xml my webapp will not be reloaded!
If insert an absolute path
<WatchedResource>/somedir/mywebapp/WEB-INF/web.xml</WatchedResource>
it works, but to use absolute paths will become unhandy - especially when I try
to put the WatchedResource stuff to defaultcontext.xml, because I have a lot of
webapps not only one.

If I put my webapp in CATALINA_BASE/webapps all works fine - but this is not a
solution for me.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From gernot.pfingstl@stmk.gv.at  2006-12-26 23:47 -------
(In reply to comment #1)
> First, I'm changing this to an enhancement, as the current code is clearly
> designed for absolute paths so what you're reporting is not a bug.

I get my infos from documentation and not from the source - and in the docs I
havn't found any info that you need absolute paths.
 
> ... 
> I'm guessing in your case the docBase is relative, not absolute, so the method
> uses appBase as the context for docBase, and since your webapp is outside
> appBase this doesn't work.  Is my guess right?  Does it work if you make your
> docBase absolute?

My docBase is absolute like 
  <Context docBase="${somedir}/appdir">
and ${somedir} is absolute like "c:/webapps".
And it doesn't work with
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
in conf/context.xml,
and it also doesn_t work with
 <WatchedResource>c:/webapps/appdir/WEB-INF/web.xml</WatchedResource>
in conf/context.xml.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From plynch@apache.org  2007-11-05 23:05 -------
Created an attachment (id=21090)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21090&action=view)
patch that fixes HostConfig to comply with the documentation regarding docBase
and watched resources

I manufactured this patch against the official
org/apache/catalina/startup/HostConfig.java file included with Tomcat 6.0.13.
it is small enough such that recreating it to work with 5.5.x series releases
should be trivial. Hope it helps.You may need to modify the patch header to
apply it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131


pr@objektpark.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From pr@objektpark.de  2008-01-21 00:43 -------
Fix added for Release 5.5.26 and 6.0.16!

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From pr@objektpark.de  2008-01-21 03:37 -------
I correct my mistake!
Sorry Peter



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131


yoavs@computer.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|NEW                         |NEEDINFO




------- Additional Comments From yoavs@computer.org  2006-12-24 17:48 -------
First, I'm changing this to an enhancement, as the current code is clearly
designed for absolute paths so what you're reporting is not a bug.

Second, the relevant code you want to look at is in
org.apache.catalina.startup.HostConfig, the addWatchedResourced method.  That
method will loop over the declared WatchedResources for the Context and try to
create a java.io.File corresponding to each WatchedResource for monitoring.  As
you can see from the code, it either wants an absolute path to the
WatchedResource, or a docBase relative to which the WatchedResource can be found.

I'm guessing in your case the docBase is relative, not absolute, so the method
uses appBase as the context for docBase, and since your webapp is outside
appBase this doesn't work.  Is my guess right?  Does it work if you make your
docBase absolute?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From pr@objektpark.de  2008-01-20 06:06 -------
Thanks for patch,

Look at http://svn.apache.org/viewvc?rev=613558&view=rev.

I hope we can at the fix to next tomcat 6/55 release

Peter

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From plynch@apache.org  2008-01-20 18:21 -------
Thanks for applying it.

I am not sure pero wants credit for the patch. I was the one who submitted the
patch but the changes to the changelog seem to indicate that pero provided it.

Changelog reads "Patch provided by Gernot Pfingstl (pero)"

If the patch is applied, should the status stay 'NEW'


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131


plynch@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




------- Additional Comments From plynch@apache.org  2007-07-03 08:34 -------
In my tests using tomcat 6.0.13, JDK 1.6, when the path in the WatchedResource
is relative path, the absolute path interpreted by the code as written for the
relative path will be an absolute path to relative to the JVM startup directory.
Obviously something is very quirky in there. Since the path will then most
likely point to an invalid resource, it will not be watched and there is no
warning give to the user either. In this case addWatchedResource is given a
'null' docBase.

The code in question is in HostConfig.deployDescriptor().

Suggested code improvements:
o for descriptors that explicitly specify an absolute docBase, pass it to the
addWatchedResource method instead of 'null'
o print warning if watched resource evaluated path points to a resource that
does not exist

I came up with a fix but I was discouraged to not find any existing unit tests
to verify regression. If there are any please tell me so I can verify the patch.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38131] - WatchedResource does not work if app is outside "webapps"

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38131>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38131





------- Additional Comments From john@sourcelabs.com  2007-10-24 15:28 -------
I would like to experiment with this patch. Do you think you can post it here
for others to review and test?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org