aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse complains about undefined type. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse complains about undefined type." Watch "Eclipse complains about undefined type." New topic
Author

Eclipse complains about undefined type.

Bob Hysell
Greenhorn

Joined: Apr 14, 2011
Posts: 7
Hi all,

I have jsp page with the directive <%@ page import="ppr_tv.javaSrc.UserBean"%> and the statement <jsp:useBean id="currentSessionUser" class="ppr_tv.javaSrc.UserBean" scope="session"> </jsp:useBean>.
This page loads and displays fine and I have full access to the UserBean class. But in the Eclipse IDE the class value of "ppr_tv.javaSrc.UserBean" is underlined in red with the error "Undefined type: ppr_tv.javaSrc.UserBean". I am not sure why it is complaining.

I have tried changing the directive to <%@ page import="ppr_tv.javaSrc.*"%>. The application still works but the error message persists.
I have also tried changing the class value from "ppr_tv.javaSrc.UserBean" to "UserBean". The error remains and the application does not work.

Perhaps this is not a big deal as the application works. Still, things underlined in red just rub me the wrong way. ;-)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Where is the UserBean class located? Is it in the same project as the JSP file? If not, does the Eclipse project include the JAR containing UserBean?


JBoss In Action
Bob Hysell
Greenhorn

Joined: Apr 14, 2011
Posts: 7
UserBean is in the same directory as all the other project java files.
Bob Hysell
Greenhorn

Joined: Apr 14, 2011
Posts: 7
Solved.
My Servlet already states: package ppr_tv.javaSrc;

But when I also added:
import ppr_tv.javaSrc.UserBean;
import ppr_tv.javaSrc.SearchBean;

the error message and red underline went away.
 
Don't get me started about those stupid light bulbs.
 
subject: Eclipse complains about undefined type.