Errors in Eclipse but not Netbeans exact same project [message #1842989] |
Thu, 08 July 2021 19:31  |
Jim Whitaker Messages: 26 Registered: October 2020 |
Junior Member |
|
|
I have one project in eclipse, and same exact project in netbeans (I sync / mirror).
I have several errors in eclipse like:
javax.servlet cannot be resolved to a type
Multiple annotations found at this line:
- javax.servlet cannot be resolved
to a type
And happening in this code segment:
<c:set var="surl" value="${pageContext.request.requestURL}" />
<c:choose>
<c:when test="${pageContext.request.queryString != null}">
<c:set var="squy" value="${pageContext.request.queryString}" />
</c:when>
<c:otherwise>
<c:set var="squy" value="t1=${t11}&page=${pageno}" />
</c:otherwise>
</c:choose>
<%--<c:set var="squy" value="${pageContext.request.queryString}" />--%>
<c:set var="sqm" value="?" />
<%--${surl}${sqm}${squy}--%>
<c:set var="surl2" value='${surl}${sqm}${squy}' />
<%--${surl2}--%>
<c:set var="sessvar" value="${surl2}" scope="session" />
But the project runs fine, no build errors, etc. I have in the lib folder:
jakarta.activation-2.0.0.jar
jakarta.el-api-4.0.0.jar
jakarta.servlet.jsp.jstl-2.0.0.jar
jakarta.servlet.jsp.jstl-api-2.0.0.jar
jakarta.servlet-api-5.0.0-M1.jar
jakarta.xml.bind-api-3.0.0.jar
Am I missing some? If so I have no idea where to get them.
And in the pom I have:
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>2.0.0</version>
</dependency>
That came from a stackoverflow post. I am using tomee however. Is there something I need that I am unaware of. And this is a jakarta ee 9 project.
Using the following: io.github.hantsy maven-archetype-jakartaee9
All runs and builds are fine. Any help appreciated.
Also those jstl's I included I got from a github page, I cannot find any instructions on downloading jstl libraries from any jakarta site that's needed with examples.
To add please see this issue:
https://github.com/eclipse-ee4j/jstl-api/issues/54
I am in the same situation, I am having to hunt for what I can find using Google. I cannot find any tutorials or examples of how to install the jstl tags or what jars I need or even where they go.
Project works, but I'd still like to setup fully correctly.
[Updated on: Fri, 09 July 2021 00:43] Report message to a moderator
|
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1843008 is a reply to message #1843002] |
Sat, 10 July 2021 17:22   |
Jim Whitaker Messages: 26 Registered: October 2020 |
Junior Member |
|
|
Nitin DahyabhaiFriend Thanks for answering. Eclipse Version: 2021-06 (4.20.0). A jakarta ee 9 project. I even took all references out of pom to jstl. I downloaded
jakarta.servlet.jsp.jstl-2.0.0.jar from https://jakarta.ee/specifications/tags/2.0/ placed it in WEB-INF\lib. I even changed preferences to ignore these jstl errors,
but they still show up.
However the project builds fine and runs in server Tomee (apache-tomee-webprofile-9.0.0-M7) perfect. No errors running the project on server.
I think Eclipse must have a bug with jslt. I have this also in the jsp file:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
No errors show up in bean classes or servlets. Just those on the jsp jstl..
That's why I asked am I missing a jar, or is it a bug in eclipse. Netbeans shows no errors. I even made a war, deployed to Tomee, ran perfect.
[Updated on: Sat, 10 July 2021 17:25] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1856993 is a reply to message #1856982] |
Thu, 12 January 2023 05:53   |
panda mkk Messages: 37 Registered: April 2022 |
Member |
|
|
project\.settings\org.eclipse.wst.common.project.facet.core.xml
There is such xml in the setting file of the project, where the jst.web records Dynamic Web version 2.5
But this setting file does not exist in my maven project,It is automatically generated after importing eclipse
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="11"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
[Updated on: Thu, 12 January 2023 05:55] Report message to a moderator
|
|
|
|
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857067 is a reply to message #1857066] |
Mon, 16 January 2023 06:53   |
|
It's a bit of both. Version 6 hasn't been added as a facet in WTP for 2022-12, and m2e-wtp isn't aware of 6.0, or even 5.0. I'm working
on the WTP side of it, but I can't predict if/when my PR on m2e-wtp will get merged. When both changes are merged and released,
the Maven import will make use of the referenced schema and/or version number in a web.xml if it's present, and the level of Servlet
API that's on the Java Build Path otherwise.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857413 is a reply to message #1857101] |
Mon, 06 February 2023 02:02   |
panda mkk Messages: 37 Registered: April 2022 |
Member |
|
|
Hi Nitin Dahyabhai,M2 has been released. I have tried it. Although the dynamic web module has added version 6.0, it is still recognized as 2.5 when import maven project
I want to know what determines the version when importing project
I want to judge whether it is a problem of project or eclipse
The project is generated through mvn archetype:generate command,It does not contain any eclipse setting information
The version of web.xml is 6.0
jakarta servlet version is 6.0.0,The web.xml and servlet dependency information can be viewed in the above chat record
[Updated on: Mon, 06 February 2023 02:07] Report message to a moderator
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857417 is a reply to message #1857413] |
Mon, 06 February 2023 15:44   |
|
Odd. org.eclipse.jst.j2ee.core's org.eclipse.jst.jee.util.internal.JavaEEQuickPeek class should recognize 6.0 if you're referring
to the web-app_6_0.xsd schema or declaring version 6.0 as the version in your web-app element. M2E-WTP uses that class
to read the web.xml (in org.eclipse.m2e.wtp.WarPluginConfiguration), but I thought it would return 4.0 and not 2.5 until the next release
containing the changes supporting 5.0 and 6.0.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857425 is a reply to message #1857417] |
Tue, 07 February 2023 06:27   |
panda mkk Messages: 37 Registered: April 2022 |
Member |
|
|
It seems that an exception was caught when reading the version in WarPluginConfiguration, and the default version 2.5 was returned..
try {
IFacetedProject fProject = ProjectFacetsManager.create(project);
if (fProject != null && fProject.hasProjectFacet(WebFacetUtils.WEB_FACET))
return fProject.getProjectFacetVersion(WebFacetUtils.WEB_FACET);
} catch (Exception e) {
LOG.warn(NLS.bind(Messages.Error_Reading_Project_Facet, project.getName()), e);
}
return WTPProjectsUtil.DEFAULT_WEB_FACET;
Where is the log of M2E-WTP.. It seems that the log is output, but I can't find it in the error log view or workspace
[Updated on: Tue, 07 February 2023 06:28] Report message to a moderator
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857426 is a reply to message #1857425] |
Tue, 07 February 2023 07:35   |
|
Interesting, it's using the slf4j logging, so I'm not sure where it goes either, but
then it shouldn't have gotten that far down unless everything above it, both based
on the web.xml contents and the Maven/Java classpath, failed. You were debugging
this using the master branch of m2e-wtp and WTP from 2023-03 M2? Due
to an oversight, it might not properly update from an existing 2022-12 release.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
[Updated on: Tue, 07 February 2023 07:41] Report message to a moderator
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1857429 is a reply to message #1857426] |
Tue, 07 February 2023 09:51   |
panda mkk Messages: 37 Registered: April 2022 |
Member |
|
|
Yes, I use eclipse-jee-2023-03-M2.
The version of m2e-wtp used is 1.5.2
I try to debug,It seems that there is no exception, but there is no added support for 6.0. It is recognized that web.xml is not found,
fProject.hasProjectFacet(WebFacetUtils.WEB_FACET) == false,The default 2.5 is returned
The master branch of m2e-wtp has added support for 6.0, but this version has not been integrated in the eclipse-jee-2023-03-M2...
It seems that the latest m2e-wtp has not been released...Will the m3 version be released? Or will it wait until 2023-06?
[Updated on: Tue, 07 February 2023 10:06] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Errors in Eclipse but not Netbeans exact same project [message #1859511 is a reply to message #1858805] |
Tue, 13 June 2023 06:38  |
panda mkk Messages: 37 Registered: April 2022 |
Member |
|
|

This issue still exists in Eclipse 2023-06
When using Servlet 6.0/Jakarta EE 10 and without a network, web.xml may have errors:
Referenced file contains errors (jar:file:/D:/eclipse-jee-2023-06-RC1-win32-x86_64/eclipse/plugins/org.eclipse.jst.standard.schemas_1.2.500.v202302261818.jar!/dtdsAndSchemas/jakartaee_10.xsd).
The display in 「Show Details」 is as follows
schema_reference.4:Failed to read schema document "https://www.w3.org/2001/xml.xsd",because 1) cloud not find the document;
2) the document cloud not be read; 3) the root element of the document is not <xsd:schema>.
src-resolve:Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component.
[Updated on: Tue, 13 June 2023 06:38] Report message to a moderator
|
|
|