Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

iterating a list in jstl using foreach causes exception  RSS feed

 
Darren Minifie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I am working through a simple JSTL tutorial and have hit a stumbling block. I have a list of objects passed to my JSP that I would like to iterate over (i have confirmed that the list is getting to the JSP correctly). Here is my JSP code:



Part of the exception thrown is:


I have read that this may be caused by incompatible lib versions, but AFAIK know I am using the most recent version of the required libraries. I am using maven to build and test. I am running the jetty6 maven plugin as my servlet container. My web.xml file declares servlet version 2.5.

Any help on my this iteration attempt is not working would be really helpful. Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An AbstractMethodError occurs when you try to call an abstract method. Is your bean completely concrete?
 
Darren Minifie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for the response. I am a bit confused by your terminology.

You say "when YOU call an abstract method". I don't think I am calling any abstract methods, the exception looks like the servlet container called the abstract method? Also you say to make sure my bean is completely concrete, which bean? Sorry for the vagueness but all of this new stuff with Spring has seen several uses for the term bean.

Is it possible there is some sort of incompatibility between the servlet container and the taglib implementation I'm using?

What other helpful information can I provide?

Thanks again.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darren Minifie wrote:You say "when YOU call an abstract method".

Your EL references implicitly calls bean methods. Understanding how EL expressions work to reference the scoped variables is essential.

Also you say to make sure my bean is completely concrete, which bean?

The beans in your list.

Is it possible there is some sort of incompatibility between the servlet container and the taglib implementation I'm using?

If so, your container is buggy or non-compliant.

What other helpful information can I provide?

Perhaps the bean class?
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darren Minifie wrote:Is it possible there is some sort of incompatibility between the servlet container and the taglib implementation I'm using?

That would be my guess. The error message (I think) says the abstract method in question is this one:
javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext
 
Darren Minifie
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[SOLVED]

Thanks Bear and Paul, both right:

Paul, I was using some incompatible libraries / containers. I ended up creating a default maven webapp project and using the dependencies it has listed. I also changed my web.xml from 2.5 to 2.4. Finally I changed to tomcat v6 from jetty.

Bear, after the change to tomcat, i received a much clearer exception message. You were right about it being a problem with a bean. I was using the wrong attribute name (one which didn't exist).

Thanks again for the help!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!