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 76255 - Cannot compile single JSP in directory with symbolic link
Summary: Cannot compile single JSP in directory with symbolic link
Status: VERIFIED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All Unix
: P3 blocker (vote)
Assignee: Petr Jiricka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-12 09:34 UTC by Jiri Skrivanek
Modified: 2011-06-06 06:40 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Output from compile-single-jsp target with stack trace (2.21 KB, text/plain)
2006-05-12 09:35 UTC, Jiri Skrivanek
Details
Output log from solaris sparc, JDK1.6.0_02. (857 bytes, text/plain)
2007-09-10 09:52 UTC, Jiri Skrivanek
Details
Recent output log. (893 bytes, text/plain)
2007-10-26 10:09 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2006-05-12 09:34:25 UTC
It is not possible to compile single JSP if it is in directory with symbolic
link. It is high priority issue because it blocks commit validation tests on
unix build machines. To reproduce:

cd /mywork
mkdir linked
ln -s linked symlink
- start IDE and create web application in /mywork/symlink
- call Compile File action on index.jsp node and you get FileNotFoundException:
/mywork/linked/WebApplication1/build/web/mywork/symlink/WebApplication1/build/web/index.jsp
(No such file or directory)

I can reproduce it only in NB 6.0 dev builds. In NB55 it works well.
Comment 1 Jiri Skrivanek 2006-05-12 09:35:13 UTC
Created attachment 30361 [details]
Output from compile-single-jsp target with stack trace
Comment 2 Petr Pisl 2006-05-13 03:12:40 UTC
I don't want to fix it. The code in trunk (NB 6.0) is obsolete and fixing this
is wasting time for me. We will remove it and replace with code from NB 5.5
branch. Unfortunately I don't know when it will be done the replacement. I think
the latest date is after NB 5.5 FCS. So what we will do with this issue?
Comment 3 Petr Jiricka 2006-05-13 03:17:51 UTC
What changed in trunk that caused this? In 5.0 we did not have this issue, right? 
Comment 4 Michal Zlamal 2006-05-15 10:25:07 UTC
This bug shows when running the C/B on RAM disk (it uses symlink to reffer the /
tmp) to get better performance. In this case the xtests are failing and this 
prevent me to put the new fast C/B into the production. BTW one round of C/B 
takes only about 16minutes so it would be a great improvemt also for you.
Comment 5 Petr Pisl 2006-06-27 17:06:27 UTC
Changing the target milestone to dev. In release55 it works. 
Comment 6 Petr Jiricka 2007-07-26 17:41:21 UTC
The last comment is now one year old. Needs to be reevaluated -> changing milestone to TBD.
Comment 7 Petr Pisl 2007-08-03 09:56:35 UTC
This should be already fixed with the new version of the jsp parser. 
Comment 8 Jiri Skrivanek 2007-09-10 09:50:04 UTC
It is still not fixed but no more blocker for commit validation.
Comment 9 Jiri Skrivanek 2007-09-10 09:52:48 UTC
Created attachment 48474 [details]
Output log from solaris sparc, JDK1.6.0_02.
Comment 10 Tomas Mysik 2007-10-23 15:25:31 UTC
I cannot reproduce it, it works for me. Please reopen if the problem is still there. Thanks.

Ant log:
compile-single-jsp:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Created dir: /home/gapon/NetBeansProjects/symlink/WebApplication7/build/web/WEB-INF/classes
Created dir: /home/gapon/NetBeansProjects/symlink/WebApplication7/build/web/META-INF
Copying 1 file to /home/gapon/NetBeansProjects/symlink/WebApplication7/build/web/META-INF
Copying 3 files to /home/gapon/NetBeansProjects/symlink/WebApplication7/build/web
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
Created dir: /home/gapon/NetBeansProjects/symlink/WebApplication7/build/generated/src
Created dir: /home/gapon/NetBeansProjects/symlink/WebApplication7/build/generated/classes
BUILD SUCCESSFUL (total time: 0 seconds)


Product Version: NetBeans IDE Dev (Build 071023)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.23-gentoo running on i386; UTF-8; cs_CZ (nb)
Server: Tomcat 6
Comment 11 Jiri Skrivanek 2007-10-26 10:07:20 UTC
I am still able to reproduce it with GlassFish v2ur1-b06.

Product Version: NetBeans IDE Dev (Build 200710241200)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05
System: SunOS version 5.10 running on sparc; ISO646-US; en (nb)
Server: GlassFish v2ur1-b06
Comment 12 Jiri Skrivanek 2007-10-26 10:09:07 UTC
Created attachment 51759 [details]
Recent output log.
Comment 13 Jiri Prox 2008-04-11 01:09:39 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 14 Michal Zlamal 2008-04-11 09:51:55 UTC
It is open for 2 years without fix. I'm raising priority to p2.
Comment 15 Tomas Mysik 2008-06-11 14:58:45 UTC
I don't think it's P2 - why? The reporter is "not real user" (sorry Jirko :) and there's no duplicate of this issue.
Comment 16 Michal Zlamal 2008-06-24 10:34:13 UTC
Tomasi, I don't understand why it is that hard to fix it rather than talk about the priority.

It is open for 2+ years without any progress.

I didn't look at code but it seems that this is caused by inappropriate use of File.getAbsolutePath() and/or File.getCanonicalPath().

Comment 17 Tomas Mysik 2008-06-24 13:20:09 UTC
> Tomasi, I don't understand why it is that hard to fix it rather than talk about the priority.
> It is open for 2+ years without any progress.

Because we just run Ant task from GF, the code itself is not in NB.

I would file an issue against GF, but I'm still not able to reproduce, it works for me (I have project in path 
like '/home/tomas/NetbeansProjects/<symlink>/WebProject1')... Michale, does it work for you on Mac? Thanks.
Comment 18 Matthew Bohm 2008-11-25 23:59:19 UTC
jayashri, can you try it on Mac?
Comment 19 Matthew Bohm 2008-12-13 02:42:15 UTC
Here is the result of jayashri's attempt:

compile-single-jsp:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Created dir: /Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/web/WEB-INF/classes
Created dir: /Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/web/META-INF
Copying 1 file to /Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/web/META-INF
Copying 3 files to /Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/web
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
Created dir: /Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/generated/src
org.apache.jasper.JasperException: PWC6117: File
"/Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/build/web/index.jsp" not found
/Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/nbproject/build-impl.xml:462: The following error occurred
while executing this line:
/Users/jayashri/test_issue76255/mywork/symlink/TestJSPIssue/nbproject/build-impl.xml:440: Java returned: 1
BUILD FAILED (total time: 1 second) 
Comment 20 Matthew Bohm 2008-12-13 04:57:35 UTC
Examining jayashri's log, I think mzlamal may be correct that this could be "caused by inappropriate use of
File.getAbsolutePath() and/or File.getCanonicalPath()." But the bug would be in org.apache.jasper.JspC, since
org.netbeans.modules.web.project.ant.JspC simply catches and prints the JasperException thrown by
org.apache.jasper.JspC. So we could file an issue against Jasper.
Comment 21 Tomas Mysik 2008-12-15 08:44:02 UTC
Issue filed, https://glassfish.dev.java.net/issues/show_bug.cgi?id=6924.
(The priority of this issue could be IMHO P4, just as a reminder.)
Comment 22 Matthew Bohm 2008-12-17 22:01:59 UTC
Ok, but the bug originates in org.apache.jasper.JspC, which is apache/jasper. Just want to make sure that filing the bug
against glassfish is appropriate (rather than against jasper).
Comment 23 Vince Kraemer 2009-10-16 00:56:46 UTC
this might be relevant... http://issues.apache.org/bugzilla/show_bug.cgi?id=28147
Comment 24 Anton Chechel 2011-04-13 13:43:46 UTC
Reproducible.
If I compile whole project it works.
If I compile single JSP it fails.
If I invoke glassfish/bin/jspc -uriroot symb-folder/WebApplication1/web -d symb-folder/WebApplication1/build/generated/src -die1 without NetBeans it works.

So it seems the problem is somewhere in JspCSingle in NetBeans, not in glassfish.
Comment 25 Anton Chechel 2011-04-13 13:46:04 UTC
-do-compile-single-jsp:
Skipping /home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/generated/src because it already exists.
Executing '/home/oleksiys/apps/jdks/jdk1.6.0_23/jre/bin/java' with arguments:
'-classpath'
'/home/oleksiys/apps/jdks/jdk1.6.0_23/lib/tools.jar:/home/oleksiys/netbeans-7.0/enterprise/ant/extra/jspcompile.jar:/home/oleksiys/netbeans-7.0/java/ant/lib/ant.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/servlet3.0-jsp2.2-api.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/glassfish-jspparser-3.0.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/jsf-2_0/jsf-api.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/jstl.jar:/home/oleksiys/netbeans-7.0/java/ant/lib/ant-launcher.jar'
'org.netbeans.modules.web.project.ant.JspCSingle'
'-uriroot'
'/home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/web'
'-d'
'/home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/generated/src'
'-die1'
'-schemas /resources/schemas/'
'-dtds /resources/dtds/'
'-sysClasspath /home/oleksiys/netbeans-7.0/java/ant/lib/ant.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/servlet3.0-jsp2.2-api.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/glassfish-jspparser-3.0.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/standard.jar:/home/oleksiys/netbeans-7.0/enterprise/modules/ext/jsf-2_0/jsf-impl.jar'
'-jspc.files'
'/home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/web/index.jsp'
'-compilerSourceVM 1.6'
'-compilerTargetVM 1.6'
'-javaEncoding UTF-8'
The ' characters around the executable and arguments are
not part of the command.
org.apache.jasper.JasperException: PWC6117: File "/home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/web/index.jsp" not found
Exiting /home/oleksiys/Projects/0000/symb-folder/WebApplication1/build.xml.
/home/oleksiys/Projects/0000/symb-folder/WebApplication1/nbproject/build-impl.xml:634: The following error occurred while executing this line:
/home/oleksiys/Projects/0000/symb-folder/WebApplication1/nbproject/build-impl.xml:609: Java returned: 1
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
BUILD FAILED (total time: 0 seconds)
Comment 26 Anton Chechel 2011-04-13 14:16:57 UTC
My fault, glassfish jspc fails as well:

~/Projects/0000/symb-folder$ ~/apps/glassfish/0000/glassfish3/glassfish/bin/jspc -uriroot /home/oleksiys/Projects/0000/symb-folder/WebApplication1/web -d /home/oleksiys/Projects/0000/symb-folder/WebApplication1/build/generated/src -die1 /home/oleksiys/Projects/0000/symb-folder/WebApplication1/web/index.jsporg.apache.jasper.JasperException: PWC6117: File "/home/oleksiys/Projects/0000/symb-folder/WebApplication1/web/index.jsp" not found

Will reopen related GF bug.
Comment 27 Petr Jiricka 2011-06-03 08:59:02 UTC
Closing as WONTFIX per the latest comment in the corresponding GlassFish bug: http://java.net/jira/browse/GLASSFISH-6924
Comment 28 Jiri Skrivanek 2011-06-06 06:40:32 UTC
Verified. To allow symbolic links is forbidden by default because it is a potential security risk but it can be enabled in context.xml:

<?xml version="1.0" encoding="UTF-8"?>
    <Context path="/myapp" allowLinking="true">
</Context>