IllegalArgumentException: no such setter method: conversationIsLongRunningParameter
2:57 PM, Fri, Dec 7 2007
JBoss Seam 2.0 is out, so it's time to upgrade your apps so you don't get stuck on the old version. I did the obvious things: replace all the relevant jar files, and fix the imports. Some classes have moved to different packages, so imports need to be fixed. NetBeans' fix imports feature handles this.
I then ran it and got today's Exception of the Day:
Caused by: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.faces.FacesManager.conversationIsLongRunningParameter at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:236) at org.jboss.seam.Component.initInitializers(Component.java:466)
Who is looking for this no longer existent method? It's in
components.xml. Remove the
conversation-is-long-running-parameter="clr" entry. Also change the XML declaration in
components.xml. Look at the examples to see the proper declaration. This is important, because how the file is parsed is determined by the version number in the declaration.
After that, the application started, but when I accessed a page, I hit:
To fix, add
jboss-el.jar to the
SEVERE: Error Rendering View[/index.xhtml] java.lang.IllegalStateException: entityManager is null at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:39)
components.xml, and replace:
<core:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:/myProjectEntityManagerFactory"/>
<persistence:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:/myProjectEntityManagerFactory"/>
And now the application is running with JBoss Seam 2.0.
It's important to keep up with versions. In this case, no further development is expected in the Seam 1.x branch, so upgrading is inevitable, and the earlier the upgrade is done, the easier it is.