This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167139 - Can't deploy to Tomcat because path to context.xml is improperly escaped
Summary: Can't deploy to Tomcat because path to context.xml is improperly escaped
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P1 blocker with 1 vote (vote)
Assignee: Petr Hejl
URL:
Keywords: JDK_SPECIFIC
: 167190 167249 167697 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-16 04:07 UTC by nriley
Modified: 2009-06-26 13:29 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nriley 2009-06-16 04:07:11 UTC
On Mac OS X 10.5 and later, the standard temporary directory contains + characters. When generating a URL to deploy the application on Tomcat, NetBeans 
does not escape the + characters, which causes Tomcat to interpret them as spaces in the filename, thus causing deployment to fail.

For example:

NetBeans: Deploying on Tomcat 6.0
    profile mode: false
    debug mode: false
    force redeploy: true
In-place deployment at /Users/nicholas/ideals/ideals-1_x/dspace/modules/xmlui/target/xmlui-1.5.2
Deployment is in progress...
deploy?config=file:/var/folders/ba/baPca9ytH-GnVrznlTbWPE+++TM/-Tmp-/context2822837234873079397.xml&path=/ideals
FAIL - Failed to deploy application at context path /ideals

and in the Tomcat log:

java.io.FileNotFoundException: /var/folders/ba/baPca9ytH-GnVrznlTbWPE   TM/-Tmp-/context2822837234873079397.xml (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.apache.catalina.manager.ManagerServlet.copyInternal(ManagerServlet.java:1642)
        at org.apache.catalina.manager.ManagerServlet.copy(ManagerServlet.java:1603)
        at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:811)
        at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:350)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:613)

If I manually visit the manager URL escaping the +'s correctly as %2b, it works.
Comment 1 nriley 2009-06-16 04:19:22 UTC
For anyone else who runs into this problem, I was able to work around it by adding -J-Djava.io.tmpdir=/var/tmp to netbeans_default_options in 
netbeans.conf.  (Note that changing $TMPDIR does not help.)
Comment 2 jvence 2009-06-16 08:59:55 UTC
I had the same problem with NB 6.5. Problem seems to have started after I upgraded Mac Java. I can confirm that the workaround proposed above works. 
Thanks nriley for taking the time to share this.
Comment 3 Petr Hejl 2009-06-17 09:47:38 UTC
*** Issue 167190 has been marked as a duplicate of this issue. ***
Comment 4 Petr Hejl 2009-06-17 12:17:39 UTC
Fixed in web-main fb64f2fc8f43.
Comment 5 Petr Hejl 2009-06-17 12:27:35 UTC
Honzo, can you verify please? Possibly marking with 67patch-candidate...

Thanks.
Comment 6 Petr Hejl 2009-06-17 16:11:16 UTC
*** Issue 167249 has been marked as a duplicate of this issue. ***
Comment 7 Quality Engineering 2009-06-18 06:59:18 UTC
Integrated into 'main-golden', will be available in build *200906180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fb64f2fc8f43
User: phejl@netbeans.org
Log: #167139 Can't deploy to Tomcat because path to context.xml is improperly escaped
Comment 8 Petr Jiricka 2009-06-18 09:19:05 UTC
I verified that this is fixed in build 862 from http://bertram.netbeans.org/hudson/job/web-main/. Marian, should we put
this fix into 6.7, since we will be putting in a fix for issue 167240 (which is related)?
Comment 9 Marian Mirilovic 2009-06-18 09:36:36 UTC
For sure ... this needs to be fixed in NB 6.7
Comment 10 Tomas Mysik 2009-06-18 10:29:23 UTC
Patch seems to be OK for this particular case.
Comment 11 Martin Schovanek 2009-06-18 11:54:31 UTC
Verified by QE in continuous build, please transplant into release_67.
Comment 12 Petr Hejl 2009-06-18 12:37:48 UTC
Fixed in release clone 7baf8f4dbfce.
Comment 13 Martin Schovanek 2009-06-19 15:32:29 UTC
Verified in release67 build by QE.
Comment 14 ungars 2009-06-23 06:35:35 UTC
The solution is here :


http://forums.netbeans.org/post-38670.html

I've had the same problem too and fixed it by adding -J-Djava.io.tmpdir=/tmp to the netbeans_default_options line in the
netbeans.conf file.

This rolls back a change in the new OS X Java update which no longer
uses /tmp by default, but a random directory under /var/folders/ to
help security, but is anything but random on either my G5 or MBP, so
will be filing a bug report. 
Comment 15 Marian Mirilovic 2009-06-26 13:29:34 UTC
*** Issue 167697 has been marked as a duplicate of this issue. ***