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 198056 - Cannot compile JSPs due to unrecognized arguments in build-impl.xml
Summary: Cannot compile JSPs due to unrecognized arguments in build-impl.xml
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: David Konecny
URL:
Keywords:
: 198293 198343 203366 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-25 12:55 UTC by SMR
Modified: 2013-08-12 12:20 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 SMR 2011-04-25 12:55:37 UTC
I just recently upgraded to NetBeans 7.0 from 6.9.1.  I have a web project that has been in development for a year or two now.  We are using Tomcat 6.0.something.  When attempting to compile a JSP, either as a single test or in a clean-and-build, the compilation fails with the following error:
org.apache.jasper.JasperException: Unrecognized option: -schemas /resources/schemas/.  Use -help for help.

I suspect this is likely due to a version difference somewhere.

The relevant build-impl.xml section is the following:
    <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
        <mkdir dir="${build.generated.dir}/src"/>
        <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
            <arg value="-uriroot"/>
            <arg file="${basedir}/${build.web.dir}"/>
            <arg value="-d"/>
            <arg file="${basedir}/${build.generated.dir}/src"/>
            <arg value="-die1"/>
            <arg value="-schemas ${jspc.schemas}"/>
            <arg value="-dtds ${jspc.dtds}"/>
            <arg value="-compilerSourceVM ${javac.source}"/>
            <arg value="-compilerTargetVM ${javac.target}"/>
            <arg value="-javaEncoding ${source.encoding}"/>
            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
        </java>
        <mkdir dir="${build.generated.dir}/classes"/>
        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
    </target>
and similar sections, like the -do-compile-single-jsp that appears below it.


The -schemas, -dtds, and -sysClasspath are all new to the build-impl.xml file since the 7.0 upgrade.  Commenting -schemas will lead to the same error about -dtds and so forth with -dtds and -sysClasspath.

Manually commenting out the new arguments in build-impl.xml results in a normal and successful compilation.  This is a useable workaround for now, but of course that all-caps warning at the top of the file not to edit the auto-generated xml is a bit worrisome.
Comment 1 David Konecny 2011-05-09 22:42:28 UTC
Anton, it looks like user's web project was not updated properly and is using old versions of JSP compiler library and not the latest one which has new options like -schema. Can you investigate please?

SMR, is your project using Libraries Folder (a setting in the project properties -> libraries panel) or not?
Comment 2 SMR 2011-05-10 12:55:15 UTC
(In reply to comment #1)
> SMR, is your project using Libraries Folder (a setting in the project
> properties -> libraries panel) or not?

Yes, in fact all my projects use the same shared Libraries Folder.  In this folder, the jsp-compiler and jsp-compilation haven't been modified since the upgrade, although there is a jsp-compilation-syscp directory with the same timestamp as the 7.0 install date.  The jsp-compiler's jspcompile.jar doesn't contain any useful versioning information in its manifest or other files, but its filesystem timestamp is from last June; it has a filesize of 6312 bytes.  It's surely out-of-date.
How do I go about upgrading it?
Comment 3 David Konecny 2011-05-10 21:17:06 UTC
Let me reproduce it first and then I will advice how to workaround this bug.
Comment 4 David Konecny 2011-05-10 22:37:27 UTC
Evaluation: all Web projects created prior to NetBeans 7.0 which are #1) using Libraries Folder and #2) has JSP compilation enabled will fail to compile in NetBeans 7.0 with compiler error:

org.apache.jasper.JasperException: Unrecognized option: -schemas /resources/schemas/.  Use -help for help.

Problem workaround is:

1. shutdown NetBeans 7.0
2. delete {your Libraries Folder}/jsp-compilation folder
3. delete {your Libraries Folder}/jsp-compiler folder
4. edit {your Libraries Folder}/nblibraries.properties file and remove two properties: libs.jsp-compilation.classpath and libs.jsp-compiler.classpath
5. start NetBeans 7.0

These steps will result in recreation of two deleted libraries and everything should work.

I'm working on the fix for NetBeans 7.0.1.
Comment 5 David Konecny 2011-05-10 23:37:33 UTC
Fixed as 37c31e6a4ee1. The libraries are automatically updated now.

There is lower priority issue that old library jars are not removed from filesystem - I filled that one as issue 198497.
Comment 6 SMR 2011-05-11 11:46:11 UTC
The procedure to regenerate/update the jsp-comp* folders worked, thanks!
Comment 7 Jiri Skrivanek 2011-05-16 11:45:39 UTC
Verified in Dev build 201105150400. Please, transplant to 70patch1 branch. Also please, next time use "#198056 - ..." pattern in commit messages to let us know when the fix is integrated in daily builds.
Comment 8 David Konecny 2011-05-16 20:04:08 UTC
Transplanted as:

changeset:   198374:4f05b09f76c2
branch:      release70_fixes

Sorry for wrong commit message. Typo on my side.
Comment 9 David Konecny 2011-05-16 20:14:37 UTC
And also: c1505b4d3d05
increasing module version and updating Long Description (as per wiki.netbeans.org/NetBeansPatchesProcess)
Comment 10 stevefyfe 2011-05-26 16:24:38 UTC
*** Bug 198293 has been marked as a duplicate of this bug. ***
Comment 11 David Konecny 2011-10-10 22:20:58 UTC
*** Bug 203366 has been marked as a duplicate of this bug. ***
Comment 12 Martin Fousek 2013-08-12 12:20:35 UTC
*** Bug 198343 has been marked as a duplicate of this bug. ***