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: 23 Registered: April 2022 |
Junior 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
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04334 seconds