Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot resolve Symbol

 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if you try it like this?

 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect it's a version thing, check the version of the servlet api maybe?
 
John Davis
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic