[jboss-user] [JBoss Seam] - ClassCastException: java.lang.Long when viewing home page.

garypinkham do-not-reply at jboss.com
Fri Jul 6 16:28:23 EDT 2007


ok.   Apologizes early if I don't post the right info...  I checked the forums and the Jira and don't see this issue so I'm betting it's me.. but here goes..   

I used Seam generate-entities to create a bunch of crud pages.. all went well.    I have tried this again with the same DB several different times with no luck.     It seems to generate the entities just fine, deploys and starts up but when I try to view the home page I'm presented with a "java.lang.ClassCastException: java.lang.Long"    I've tried it with both 1.3Alpha (which worked the 1st time) and with 2.0Beta1.     I'm using SQL Server 2005 and the SprintA TDS driver.   

Since there is so much code I didn't create I'm really not sure where to look for the issue.   So any suggestions would be greatly appreciated.    Also note that I had this error on a different entity.. I removed it from the included DB tables.. regenerated and now the next entity has the same issue so I know it wasn't a particular entity.   

Here is the Stack Trace:


  | java.lang.ClassCastException: java.lang.Long
  |         at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrVal
  | ueBinding(ManagedPersistenceContext.java:228)
  |         at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistence
  | Context.java:79)
  |         at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceC
  | ontext.java:107)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
  |         at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
  |         at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
  |         at org.jboss.seam.Component.unwrap(Component.java:1983)
  |         at org.jboss.seam.Component.getInstance(Component.java:1770)
  |         at org.jboss.seam.Component.getInstance(Component.java:1723)
  |         at org.jboss.seam.Component.getInstance(Component.java:1717)
  |         at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:258)
  |         at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceControlle
  | r.java:20)
  |         at org.jboss.seam.framework.EntityQuery.getEntityManager(EntityQuery.java:120)
  |         at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:29)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
  |         at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
  |         at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  |         at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
  |         at org.jboss.seam.util.Work.workInTransaction(Work.java:39)
  |         at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.jav
  | a:32)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  |         at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:4
  | 2)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  |         at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
  |         at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java
  | :151)
  |         at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
  |         at com.foo.bar.config.entities.AuthoritiesList_$$_javassist_32.validate(AuthoritiesList_$
  | $_javassist_32.java)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
  |         at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
  |         at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
  |         at org.jboss.seam.Component.callCreateMethod(Component.java:1880)
  |         at org.jboss.seam.Component.newInstance(Component.java:1859)
  |         at org.jboss.seam.Component.getInstance(Component.java:1756)
  |         at org.jboss.seam.Component.getInstance(Component.java:1723)
  |         at org.jboss.seam.Component.getInstance(Component.java:1717)
  |         at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:60)
  |         at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
  |         at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
  |         at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
  |         at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
  |         at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
  |         at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
  |         at org.jboss.seam.navigation.Param.getValueFromModel(Param.java:127)
  |         at org.jboss.seam.navigation.Pages.getPageParameterValue(Pages.java:711)
  |         at org.jboss.seam.navigation.Pages.getConvertedParameters(Pages.java:687)
  |         at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBase.java:50)
  |         at org.jboss.seam.ui.renderkit.LinkRendererBase.doEncodeBegin(LinkRendererBase.java:26)
  |         at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
  |         at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:785)
  |         at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:280)
  |         at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolBarRendererBase.java:
  | 81)
  |         at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
  |         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
  |         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:577)
  |         at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
  |         at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
  |         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
  |         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
  |         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
  |         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
  | ava:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  | 
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
  |         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  |         at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  |         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
  | ava:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  | 
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
  | ava:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  | 
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.
  | 16:08:58,074 ERROR [STDERR] java:179)
  |         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
  |         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:
  | 156)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
  | va:580)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  |         at java.lang.Thread.run(Thread.java:595)
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061468#4061468

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061468



More information about the jboss-user mailing list