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 201414 - nb701/java 7 -- cannot compile jsp pages
Summary: nb701/java 7 -- cannot compile jsp pages
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.0.1
Hardware: All All
: P2 normal (vote)
Assignee: Martin Fousek
URL:
Keywords: RELNOTE
: 202250 208120 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-29 20:31 UTC by emiddio
Modified: 2012-05-31 07:58 UTC (History)
6 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 emiddio 2011-08-29 20:31:54 UTC
Created dir: C:\Users\garbello\Documents\NetBeansProjects\ForSale_11\build\generated\src
Exception in thread "main" java.lang.IllegalArgumentException: PWC6309: Illegal compilerSourceVM: 1.7
	at org.apache.jasper.JspC.setCompilerSourceVM(JspC.java:708)
	at org.netbeans.modules.web.project.ant.JspC.main(JspC.java:80)
C:\Users\garbello\Documents\NetBeansProjects\ForSale_11\nbproject\build-impl.xml:585: Java returned: 1
BUILD FAILED (total time: 1 second)


Product Version: NetBeans IDE 7.0.1 (Build 201107282000)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Userdir: C:\Users\garbello\.netbeans\7.0

can attach a project if required . easy to reproduce,

create initial java Web application; choose ee6, java7, source version java 7, JSF2;

modify project properties to turn off compile on save, and turn on
compile JSP pages

try to clean, build the default project described above; will get the error
posted here.
Comment 1 Jiri Skrivanek 2011-08-30 06:55:27 UTC
Similar to bug 135568.
Comment 2 Jiri Skrivanek 2011-09-19 08:55:52 UTC
*** Bug 202250 has been marked as a duplicate of this bug. ***
Comment 3 Petr Jiricka 2011-10-07 16:39:48 UTC
Reproduced (Windows XP). This is quite serious, changing priority to P2.
Comment 4 Petr Jiricka 2011-10-14 20:04:32 UTC
The root cause of this problem is in GlassFish, I filed the following bug against GF:
http://java.net/jira/browse/GLASSFISH-17429. Waiting for evaluation from the GlassFish team, though this bug may need to be waived for NetBeans 7.1.

I haven't tried, but I think the workaround for the case when JDK 7 constructs are not used in JSP files could be to duplicate the JSP compilation target from build-impl.xml to build.xml, tweak it so it uses source level 1.6, and run this target instead of the "Compile JSPs" checkbox. It would be great if someone could try this out.
Comment 5 neek 2011-10-29 11:36:19 UTC
@Petr: I'm not familiar with the Netbeans build xml files, and I couldn't simply copy the compile-jsps target from nbproject/build-impl.xml to nb-build.xml and change the target and source level, I got an error trying to run the build:

/path/to/project/nb-build.xml:103: The prefix "webproject2" for element "webproject2:javac" is not bound.

This is something to do with the "<webproject2:javac ..." line in the compile-jsps target.

However, simply hacking the build-impl.xml file to force 1.6 works fine:

    <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
[cut]
            <arg value="-compilerSourceVM 1.6"/> <!--${javac.source}"/-->
            <arg value="-compilerTargetVM 1.6"/> <!--${javac.target}"/-->
[cut]
    </target>

"Clean & Build" on my web project now completes successfully.  Hope this helps.
Comment 6 Petr Jiricka 2011-11-01 09:04:31 UTC
Requesting a waiver for NetBeans 7.1. The root cause of this problem is in 3rd party code - GlassFish, so we will need the fix on the GlassFish side to address this. The workaround is described above.
Comment 7 dgradwell 2012-01-08 12:09:33 UTC
This bug is still in NetBeans 7.1 and affects one of my projects but not all.  3 very similar sevlets have complied OK with 7.1 and jdk7.
Comment 8 mjurce 2012-02-07 12:53:11 UTC
*** Bug 208120 has been marked as a duplicate of this bug. ***
Comment 9 Martin Fousek 2012-04-19 16:26:18 UTC
Ok, so I updated the jspparser to one from the latest GF 3.1.2b23 which brought few changes due to refreshing cached parsed items and omitted scope of bean which was never used. Anyway it looks that it's working well and tests are passing.

Anybody from reporters please feel free to try it out in lastest dev builds (once it will be available there - wait for automatically generated message here).

Fixed in web-main #646171d74911.
Comment 10 Quality Engineering 2012-04-20 10:11:19 UTC
Integrated into 'main-golden', will be available in build *201204200400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/646171d74911
User: Martin Fousek <marfous@netbeans.org>
Log: #201414 - nb701/java 7 -- cannot compile jsp pages
Comment 11 Martin Fousek 2012-04-23 10:34:11 UTC
Updated remaining JARs in web-main #21a63a72b543.
Comment 12 Quality Engineering 2012-04-24 10:02:26 UTC
Integrated into 'main-golden', will be available in build *201204240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/21a63a72b543
User: Martin Fousek <marfous@netbeans.org>
Log: #201414 - nb701/java 7 -- cannot compile jsp pages: updated remaining JARs
Comment 13 rshingleton 2012-05-30 14:03:52 UTC
This error also occurs in Tomcat 7 with JDK 1.7, not limited to Glassfish. We have recreated the error on both Windows and Linux platforms using NB 7.1.2
Comment 14 Martin Fousek 2012-05-31 07:58:14 UTC
(In reply to comment #13)
> This error also occurs in Tomcat 7 with JDK 1.7, not limited to Glassfish. We
> have recreated the error on both Windows and Linux platforms using NB 7.1.2

Actually it doesn't depent on the application server used to run your projects but on the glassfish binaries which are bundled with the IDE. It wasn't included in 7.1 patches since the change was quite big and would be risky.

You can check that it's fixed in the daily builds or in the NetBeans IDE 7.2 Beta:
http://dlc.sun.com.edgesuite.net/netbeans/7.2/beta/