The moose likes Beginning Java and the fly likes cannot resolve Symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot resolve Symbol" Watch "cannot resolve Symbol" New topic

cannot resolve Symbol

John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
I instantiated a HttpSession object

and then attempted

But my Idea (IDE) flags "getAttribute" in the above statement and complains that it cannot resolve Symbol.

I do not understand how this can happen as the HttpSession object should have a getAttribute method which accepts a string argument.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
What if you try it like this?

John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
When I try the version with the toString() method, the result is the same.
Note: I obtained the source by deploying a .war file I downloaded. The application byte code which maps to the source runs fine in Tomcat5.5. This would seem to indicate that the problem lies with my IDE (IntelliJ Idea) or with an incompatibility with servlets.jar. But all documentation which I have seen indicates that getAttribute(String) is a method in HttpSession.
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
I suspect it's a version thing, check the version of the servlet api maybe?

ASCII silly question, Get a silly ANSI.
John Davis
Ranch Hand

Joined: Nov 02, 2000
Posts: 189
Thanks for the suggestion. I was in the process of narrowing this down. I had downloaded and installed Sun's Enterprise IDE and experienced no problems compiling in that environment. I also noticed that in Sun's environment there was no servlets.jar file, everything needed for app server packaged together in j2ee.jar. So I added j2ee.jar to my IntelliJ Idea project classpath and problem solved! Thanks to all who have helped me with this problem.
I agree. Here's the link: http://aspose.com/file-tools
subject: cannot resolve Symbol
Similar Threads
Session Tracker
HttpSession get and setAttribute problem
error when testing...any help will be appreciated
HF p176 example compile error
problem in web application with connection pooling