When I try to start a debug session for a web
project where spaces are in the path to the web
root, and the web project already exists as
deployed in Tomcat, I get the following error:
Feb 24, 2004 3:44:10 PM
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
D:\Projects\Cognos\Web%20Services%20Test does not
exist or is not a readable directory
More analysis revealed the following:
- Beginning a debug session when the webapp does
not exist in Tomcat does not produce the error.
- Stopping the debug session ("finish") and
restarting doesn't cause a problem (I believe
since Tomcat is still running at the time and
netbeans already knows about the existing context)
I can provide more info if necessary.
This is a bug in Tomcat, as the content of context.xml for the
deployed webapp is like:
<Context docBase="/local/arena/with%20space/" path="/with_space"/>
but should be something like:
<Context docBase="/local/arena/with space/" path="/with_space"/>
If you edit the file manually and restart server, then it starts working.
Still, we should support applications that have space in the path. Is
there a way we could provide a workaround on our side? Also, should
this be filed as a bug against Tomcat?
Sorry, forgot to mention. I already filed:
I agree we have to support the apps, but I didn't find any workaround
to this yet.
This is interesting.. the reason is because there are situations where
the deployment works. This is the pattern:
- App deployed, tomcat not running, "execute" invoked: FAILURE
- App NOT deployed, tomcat running, "execute" involed: SUCCESS
- App NOT deployed, tomcat NOT running, "execute" invoked: SUCCESS
- App deployed, tomcat running, "debug" invoked: FAILURE
- App NOT deployed, tomcat running, "debug" invoked: SUCESS (Tomcat
So, it seems, that whatever method NB is using to deploy to an
exsiting webapp, is causing failure. If the web module is already
deployed, then the problem happens.
Clever, thanks for additional info. Please read a Tomcat bug I
mentioned above - the source of problem is described there.
OK. I was able to solve this by using just the war attribute in our
initial deploy command (not using the config, as Tomcat gets it
automatically from META-INF/context.xml).
But, after that we do have some other problems that need to be solved
- the application is listed correctly under web-modules, but attempt
to start it or stop it calls:
comamnd, so we have to convert the context in commands correctly.
Also, somewhere we get to the value 'with_space' - and we are calling
the commands with this value which is incorrect, too. So, we have to
fix these, too. I'm working on it.
Pavle, was there a specific reason for using the 'config' attribute?
Don't take my last comment seriously.
We had the same behaviour before:
deploy?path=...&war=... (and I'm able to fix this bug with it)
but becuase of 40128 we changed it to use
But, if you look at the Tomcat bug, the config problem will not be
fixed, and we're advised to stop using config parameter. So, shouldn't
we try to find better solution for 40128 (if possible) and use the old
I do not know what to take seriously and what not now :-) but have you
seen this commit I did yesterday?
I think I fixed the problem with spaces in path in context.xml.
Please let me know if you want anything else from me.
Well, I've been working with updated sources, and had no problem to
reproduce. There are more problems, though. E.g., if you convert
directory with spaces to a webmodule, your context path is '/with
space' and we are not able to handle that correctly. And, tomcat is
not able to start module when restarting the server, if it has %20
characters in docbase path.
Do not mix path and docBase, these are two separate issues.
Please do the following:
1. take new sources (ok, you already have them)
2. create a new web module in a parent folder with space in name, such as:
c:\space in name\noSpaceHere
3. execute in netbeans
let me know if you see any % in docbase in
-- this should be fix, IMO
Ahh, you're right - it's fixed. I think I didn't have the latest
sources probably. So I'll mark this as fixed.
There's still a problem that context path with spaces is a correct
context path and deployment doesn't work in such case. I'll file a new
bug for this - it can be solved quite easily - I'll attach the patch
there, so please have a look at it.
*** Issue 40677 has been marked as a duplicate of this issue. ***