openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Weßendorf (JIRA) <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1926) ClassCastException - org.apache.openjpa.util.Id cannot be cast to org.apache.openjpa.util.StringId
Date Mon, 17 Jan 2011 17:49:47 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982767#action_12982767
] 

Matthias Weßendorf commented on OPENJPA-1926:
---------------------------------------------

Stack trace:


Caused by: <openjpa-2.0.1-r422266:989424 nonfatal general error> org.apache.openjpa.persistence.PersistenceException:
org.apache.openjpa.util.Id cannot be cast to org.apache.openjpa.util.StringId
FailedObject: select t from Person t [java.lang.String]
	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:986)
	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:885)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1030)
	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
	at org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2344)
	at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
	at org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
	at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36)
	at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1246)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:861)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:792)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:288)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:302)
	at net.wessendorf.enterprise.jpa.dao.PersonDao.loadAll(PersonDao.java:54)
	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:597)
	at org.apache.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:287)
	at org.apache.webbeans.intercept.DependentScopedBeanInterceptorHandler.invoke(DependentScopedBeanInterceptorHandler.java:75)
	at net.wessendorf.enterprise.jpa.dao.PersonDao_$$_javassist_20.loadAll(PersonDao_$$_javassist_20.java)
	at net.wessendorf.enterprise.service.PersonServerImpl.findAllPersons(PersonServerImpl.java:48)
	at net.wessendorf.enterprise.faces.AllPersonsController.getPersons(AllPersonsController.java:37)
	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:597)
	at org.apache.webbeans.intercept.InterceptorHandler.invoke(InterceptorHandler.java:287)
	at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:98)
	at net.wessendorf.enterprise.faces.AllPersonsController_$$_javassist_19.getPersons(AllPersonsController_$$_javassist_19.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:597)
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:302)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
	at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
	at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
	at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
	at org.apache.webbeans.el.WrappedValueExpression.getValue(WrappedValueExpression.java:68)
	at org.apache.myfaces.view.facelets.el.TagValueExpression.getValue(TagValueExpression.java:85)
	at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:243)
	at javax.faces.component.UIData.getValue(UIData.java:1162)
	at javax.faces.component.UIData.createDataModel(UIData.java:1110)
	at javax.faces.component.UIData.getDataModel(UIData.java:1087)
	at javax.faces.component.UIData.getRowCount(UIData.java:460)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:289)
	at org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:173)
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:488)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:617)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1320)
	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
	... 26 more
Caused by: java.lang.ClassCastException: org.apache.openjpa.util.Id cannot be cast to org.apache.openjpa.util.StringId
	at net.wessendorf.enterprise.beans.PeristentObject.pcCopyKeyFieldsFromObjectId(PeristentObject.java)
	at net.wessendorf.enterprise.beans.Friend.pcNewInstance(Friend.java)
	at org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:117)
	at org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:322)
	at org.apache.openjpa.datacache.DataCacheStoreManager.initialize(DataCacheStoreManager.java:340)
	at org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)
	at org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
	at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1005)
	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:963)
	... 87 more


> ClassCastException - org.apache.openjpa.util.Id cannot be cast to org.apache.openjpa.util.StringId
> --------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1926
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1926
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Matthias Weßendorf
>             Fix For: 2.0.1
>
>
> I am getting an ClassCastException (org.apache.openjpa.util.Id cannot be cast to org.apache.openjpa.util.StringId)
> when using @Id (and @GeneratedValue) in an (abstract) @MappedSuperclass, that is extended
by an abstract @Entity bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message