Ssv
Ssv

Reputation: 1059

javax.el.PropertyNotFoundException: Property 'toArray' not found on type org.hibernate.collection.internal.PersistentSet

I am using hashset.toArray()[x] to display a element in the jsf view, and this is working fine in my machine. But when I move this on to test server, the above error is thrown.

Both machines are running tomcat 7.

what is causing this error?

Upvotes: 1

Views: 1289

Answers (1)

BalusC
BalusC

Reputation: 1109182

The ability to invoke arbitrary non-property-related methods in EL is introduced in EL version 2.2 which goes hand in hand with Servlet 3.0. This feature didn't exist in older versions like Servlet 2.5 / EL 2.1.

So, if you deploy your webapp to a Servlet 3.0 compatible container with a Servlet 3.0 compatible web.xml root declaration, then it will work fine. However, if you deploy your webapp to a container of an older version, or with a web.xml which dictates an older version, or have dropped arbitrary container-specific JAR files of an older version inside webapp's /WEB-INF/lib or even server's own /lib, then this feature won't work.

Provided that you're absolutely positive that the test server is running Tomcat 7 and thus not Tomcat 6 or so, then that can only mean that the web.xml was been changed to dictate an older version, or that your webapp or server's /lib is littered with arbitrary container-specific JAR files such as jsp-api.jar, el-api.jar, etc which would only conflict with container's own libraries (this is often done by ignorant starters in order to workaround compilation errors they face in their IDE; which should have been solved differently).

Upvotes: 1

Related Questions