Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 40437 - WebModule cannot be started if it's document-base path contains spaces
WebModule cannot be started if it's document-base path contains spaces
Product: serverplugins
Classification: Unclassified
Component: Tomcat
PC Windows ME/2000
: P2 (vote)
: 3.x
Assigned To: Martin Grebac
: 40677 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2004-02-24 20:49 UTC by clever
Modified: 2005-12-09 10:11 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description clever 2004-02-24 20:49:13 UTC
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.
(It works)
- 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.
Comment 1 Martin Grebac 2004-02-25 12:19:18 UTC
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.

Comment 2 Petr Jiricka 2004-02-25 13:20:49 UTC
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?
Comment 3 Martin Grebac 2004-02-25 13:22:41 UTC
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.
Comment 4 clever 2004-02-25 15:31:44 UTC
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
got restarted)

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.
Comment 5 Martin Grebac 2004-02-25 15:52:16 UTC
Clever, thanks for additional info. Please read a Tomcat bug I
mentioned above - the source of problem is described there.
Comment 6 Martin Grebac 2004-02-26 13:03:27 UTC
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:

http://localhost:8084/manager/start?path=/with space

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?
Comment 7 Martin Grebac 2004-02-26 15:53:31 UTC
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
deploy method?
Comment 8 Pavel Buzek 2004-02-26 18:31:03 UTC
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.
Comment 9 Martin Grebac 2004-02-26 19:24:45 UTC
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.
Comment 10 Pavel Buzek 2004-02-26 20:05:29 UTC
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
Comment 11 Martin Grebac 2004-02-27 09:33:18 UTC
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.
Comment 12 Martin Grebac 2004-03-02 13:09:07 UTC
*** Issue 40677 has been marked as a duplicate of this issue. ***
Comment 13 Jaroslav Pospisil 2005-12-09 10:11:17 UTC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo