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 271762 - JSP Project not building .class files
Summary: JSP Project not building .class files
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-06 23:35 UTC by Bob_Shapiro
Modified: 2017-11-07 02:36 UTC (History)
0 users

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 Bob_Shapiro 2017-11-06 23:35:12 UTC
NetBeans 8.2, GlassFish 4.1.1, Windows 7, was working fine with JSPs and Java classes. I tried to integrate a Selenium piece written for me, and now Java classes either not building or I have no idea where they're building to.

So, I opened a new JSP project, directed index.html to a .jsp, which calls a Java class. The index.html, BillPay.jsp, and DBConnection.Java went where I expected, in the web and src/java folders in the project. The .class is NOT in the build project folder.

All works except the .java class. The Exception thrown is shown below.

I tried deleting the cache, stopping GlassFish and doing a Clean & Build, closing my project and NetBeans & restarting, and finally uninstalling & reinstalling NetBeans, but nothing fixes it. To be clear, it started with a project (with 40-50 jsp & java files) but now I cannot create any JSP project with java classes which builds the .class files.
------------------------------
Here are my build properties from the nbproject.project..properties file:

build.classes.dir=${build.web.dir}/WEB-INF/classes
build.classes.excludes=**/*.java,**/*.form
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
build.web.dir=${build.dir}/web
build.web.excludes=${build.classes.excludes}
-----------------------------
(part of) Exception in output window

Severe:   Error compiling file: C:\Users\Bob\personal_domain\generated\jsp\SMServices\org\apache\jsp\BillPay_jsp.java
Warning:   StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
...
PWC6197: An error occurred at line: 16 in the jsp file: /BillPay.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol:   class DBConnection
location: class org.apache.jsp.BillPay_jsp
PWC6197: An error occurred at line: 16 in the jsp file: /BillPay.jsp
PWC6199: Generated servlet error:
cannot find symbol
symbol:   class DBConnection
location: class org.apache.jsp.BillPay_jsp
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:129)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:299)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:392)
...
at java.lang.Thread.run(Thread.java:745)
Severe:   Application not registered
----------------------
Comment 1 Bob_Shapiro 2017-11-06 23:55:20 UTC
In my latest new JSP attempt, I found the java class file (DBConnection.class) in my project build/web/WEB-INF/classes folder. The JSP wasn't running and I tried adding that folder to my classpath in the add library/folder dialog page. It still didn't see the class (and threw the same Exception).
Comment 2 Bob_Shapiro 2017-11-07 02:36:29 UTC
I tried debugging by adding a breakpoint in BillPay.jsp where I instantiate DBConnection.java, and I get an error message saying:

Not able to submit breakpoint LineBreakpoint TDB.java : 48, reason: No source root found for URL 'file:/C:/Users/Bob/Documents/NetBeansProjects/WebApplication4/src/java/SMS2/TDB.java'. Verify the setup of project sources.
Invalid LineBreakpoint TDB.java : 48

It's referring to a file in a different project! NetBeans seems confused over which Project I am running. (I have only one project open, so I expect there should not be a question.)