Pebble on JDK 1.4.2_06 and JDK 1.5

I've had several reports via e-mail and through JIRA to say that Pebble doesn't work under JDK 1.4.2_06 and the new JDK 1.5 release. It looks like something has changed regarding JavaBeans properties in these two new versions of the JDK. 1.4.2_05 works fine.

Pebble uses the JSTL expression language to display nested properties in the JSP pages and attempting to access a read-only property causes an error. Of course, strictly speaking the JavaBeans spec says that you must have both a getter and setter, and I suspect something has been tightened up in the new releases to enforce this. Incidently, this also happened between JDK 1.3 and JDK 1.4 where I encountered similar problems with code that didn't meet the specification.

I've done some limited testing on JDK 1.5 (J2SE 5.0) and it seems to work. If you're running on Tomcat versions prior to 5.5, you'll need to remove the $TOMCAT_HOME/common/endorsed/xml-apis.jar file since this causes problems with a system property. I'll put out a new binary release today or tomorrow.



Re: Pebble on JDK 1.4.2_06 and JDK 1.5

"...strictly speaking the JavaBeans spec says that you must have both a getter and setter..." That's definitely not mandated by the spec. There's clearly support for read-write, read-only, and write-only properties. Check out section 8.3 "Design Patterns for Properties". I can't put my finger on it, but there may well have been changes made to 1.4.2_06/1.5.0 in terms of bean property identification. Review the bean class in question and make sure it's truly a well-behaved bean and doesn't do something like implement overloaded accessor methods.

Re: Pebble on JDK 1.4.2_06 and JDK 1.5

I am on Tomcat 5.0 and there is no $TOMCAT_HOME/common/endorsed/xml-apis.jar file. Am I missing something?

Re: Pebble on JDK 1.4.2_06 and JDK 1.5

I have Tomcat 5.0.28 and I do have this file. Which version are you using?

Add a comment Send a TrackBack