Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Errors in Eclipse but not Netbeans exact same project(Errors in jsp file)
Errors in Eclipse but not Netbeans exact same project [message #1842989] Thu, 08 July 2021 19:31 Go to next message
Jim Whitaker is currently offline Jim WhitakerFriend
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 #1843002 is a reply to message #1842989] Sat, 10 July 2021 04:19 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4086
Registered: July 2009
Senior Member

Jakarta EE 9 uses new "jakarta" package names, not "javax", so you wouldn't have javax.servlet in the IDE if you're using it. Of course,
without knowing which version of Eclipse this is, what server you're using, or which files indicate a problem finding javax.servlet, there's
no way to know if not finding it is actually a problem or not.


Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Sat, 10 July 2021 04:21]

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 Go to previous messageGo to next message
Jim Whitaker is currently offline Jim WhitakerFriend
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 #1843009 is a reply to message #1843008] Sat, 10 July 2021 19:54 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4086
Registered: July 2009
Senior Member

You're not missing a jar or anything. It's the JSP EL handling happening behind the scenes that's not properly adapted to
the newer package names. Retry it with WTP 3.23M1/2021-09M1.


Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Errors in Eclipse but not Netbeans exact same project [message #1843010 is a reply to message #1843009] Sat, 10 July 2021 21:41 Go to previous messageGo to next message
Jim Whitaker is currently offline Jim WhitakerFriend
Messages: 26
Registered: October 2020
Junior Member
I tried searching in market place, tried from here https://projects.eclipse.org/projects/webtools/releases/3.23, clicked link to here https://marketplace.eclipse.org/content/eclipse-java-ee-developer-tools-0 then here.
I dragged it over, but only 3.22 shows installed. How do I install the one above.

[Updated on: Sat, 10 July 2021 21:42]

Report message to a moderator

Re: Errors in Eclipse but not Netbeans exact same project [message #1843011 is a reply to message #1843010] Sat, 10 July 2021 23:09 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4086
Registered: July 2009
Senior Member

Technically it's out on Friday. You could try to install features from https://download.eclipse.org/webtools/downloads/drops/R3.23.0/S-3.23.0.M1-20210710223640/repository/
and force Eclipse to consider the site's contents for updating along the way.

If the messages about javax.servlet also appear in the Problems View, you would need to invoke validation again for them to be cleared up.


Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Errors in Eclipse but not Netbeans exact same project [message #1843014 is a reply to message #1843011] Sun, 11 July 2021 02:31 Go to previous messageGo to next message
Jim Whitaker is currently offline Jim WhitakerFriend
Messages: 26
Registered: October 2020
Junior Member
Wouldn't install yet, I will wait til it's released. Thanks
Re: Errors in Eclipse but not Netbeans exact same project [message #1843156 is a reply to message #1843014] Fri, 16 July 2021 17:21 Go to previous messageGo to next message
Jim Whitaker is currently offline Jim WhitakerFriend
Messages: 26
Registered: October 2020
Junior Member
I got the WTP 3.23M1/2021-09M1 installed, it took care of most errors, but still get warning like:
A problem was encountered using TagExtraInfo class org.apache.taglibs.standard.tei.ForEachTEI for 'c:forEach'


So I am guessing that it's just an Eclipse problem, the project builds and runs perfect.

[Updated on: Fri, 16 July 2021 17:21]

Report message to a moderator

Re: Errors in Eclipse but not Netbeans exact same project [message #1843159 is a reply to message #1843156] Fri, 16 July 2021 19:14 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4086
Registered: July 2009
Senior Member

Yes, specifically the known problem in bug 571273. The changes to the parameter and return types under Jakarta EE 9 mean that the translation mechanism behind the editor and validation has to be updated.

Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Fri, 16 July 2021 19:15]

Report message to a moderator

Previous Topic:Eclipse with PyDev Console not updating
Next Topic:Encoding issue
Goto Forum:
  


Current Time: Sun Jul 25 04:07:28 GMT 2021

Powered by FUDForum. Page generated in 0.09641 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top