Open Gontran08 opened 7 years ago
If I use appRunWar/appRunWarDebug, my app works. It seems that we use the wrong classpath for JSP on Windows while using appRun/appRunDebug.
I have the same problem while using appBeforeIntegrationTest. It prevents me from running my tests on Windows.
I couldn't find any workaround for this issue. I always have an error saying that my import cannot be resolved when I try to open a JSP while using inplace mode on Windows. I don't have this problem while using Linux.
javax.servlet.ServletException: org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [14] in the generated java file: [[...]\build\serverBaseDir_tomcat8\work\Tomcat\localhost\app\org\apache\jsp\Main_jsp.java]
The import [...] cannot be resolved
The import that cannot be resolved comes from my project. Imports coming from javax are resolved without problem.
I'm using a farm and the problem seems to only affect one of the two projects. Always the same project.
We have come across what looks to be the same or very similar issue very recently (within the last month or so - we cannot be sure when it began). Our web app project has various JSP tags that import classes that are either part of the web app or are part of a jar dependency. The imports for those classes that are part of the jar fail with the error described above. Again, the actual WAR file, when deployed, works fine, and appRunWar etc. work as well - it's only appRun.
We are seeing the problem on Windows machines (7 & 8) and OSX (10.15.1) but not Ubuntu 18.0.4. We're using java 8.0.232
We have further refined the problem in our case.
First, it's likely this problem was introduced (to us) when the dependency moved from being an external jar dependency to a gradle project dependency. Previously the jar was retrieved from a maven repo but now it's a different sub-project in the same gradle hierarchy, and this is definitely a new problem for us. We haven't verified this but the timing seems correct. Again I must stress that when a WAR is produced there is no problem.
Secondly it appears to be due to a name clash. It only affects classes whose name is the same as a package name - even when they have a different case. Eg in our case we have a package called com.company.report that couldn't be imported, but there is also a class called com.company.Report - this may be bad style but it shouldn't be a problem!
My suspicion would be that this is a combination of how jasper compilation works together with something in the way gradle (at least 4.10.3 which is the version we are using) unravels "project" dependencies.
I'm currently trying to migrate my ANT project to Gradle. I'm using Tomcat 8. Everything was going seamlessly on my Linux desktop, but for some reason, my JSP throw an exception if I try to run my project on Windows. My imports cannot be resolved. Yet, it's exactly the same project and I'm using Netbeans with both OS. I use appRun/appRunDebug to launch my app.
Here my build.gradle: