Filter Problem
bulloncito May 16, 2007 6:42 PMHi there, I'm running into a weird problem, while searching the forums has not brought enlightenment to my path.
I'm getting a
ERROR [org.jboss.seam.web.ExceptionFilter] uncaught exception javax.servlet.ServletException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.String (full stack at bottom)
whenever I update things like this
<s:decorate> <h:selectOneMenu id="schedule-category" value="#{schedule.category}" required="true"> <s:selectItems value="#{categories.resultList}" var="category" label="#{category.name}" noSelectionLabel="#{messages.please_select_one}"/> <s:convertEntity /> <a:support event="onblur" reRender="schedule-category-errors"/> </h:selectOneMenu> <br/> <a:outputPanel id="schedule-category-errors"> <h:messages for="schedule-category" /> </a:outputPanel> </s:decorate> ... <h:commandButton value="#{messages.schedule_edit}" action="#{scheduleHome.update}" rendered="#{scheduleHome.managed}"/>
I'm extending HomeObject, the weird thing is, it did work sometime ago, since I'm still learning(developing) havent used update feature much, now it's not working again, don't know why, updated seam version a couple of times from then on, AND, if I update objects with no <h:select[One|Many]Menu> HomeObject work great for creating and updating, and stuff. Am I missing some converters ? <s:convertEntity /> is the one that should do the trick, or am I missing something else? it used to work with old <ec:convertEntity /> (now deprecated for seam version)
Any help will do.
Here's a more complete stack:
ERROR [org.jboss.seam.web.ExceptionFilter] uncaught exception javax.servlet.ServletException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.String at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63) ... 2007-05-16 17:27:46,713 ERROR [org.jboss.seam.web.ExceptionFilter] exception root cause java.lang.IllegalArgumentException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.String at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:188) at org.jboss.seam.persistence.EntityManagerProxy.find(EntityManagerProxy.java:78) at org.jboss.seam.ui.EntityConverter.loadEntityFromPersistenceContext(EntityConverter.java:224) at org.jboss.seam.ui.EntityConverter.getAsObject(EntityConverter.java:200) at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:651) ... Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.String at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:84) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:174) ...