|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Object: null is not a known entity typeWhen trying to do a remove of an entity (Product detailed below) and its children I am getting the error.
java.lang.IllegalArgumentException: Object: null is not a known entity type. at org.eclipse.persistence.internal.jpa.EntityManagerImpl.remove(EntityManagerImpl.java:263) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:194) at $Proxy31.remove(Unknown Source) at uk.co.blueskyts.bizservices.product.product.ProductServiceBSImpl.deleteProduct(ProductServiceBSImpl.java:356) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy32.deleteProduct(Unknown Source) at BSImplTest.testDeleteProduct(BSImplTest.java:172) @Entity public class Product implements Serializable{ @Id @Column(nullable = false) private String id; @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, cascade={CascadeType.ALL}) private List<ProductName> productNameList; @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, cascade={CascadeType.ALL}) private List<ProductData> productDataList; } @Entity @IdClass(ProductDataPK.class) public class ProductData implements Serializable{ @Id @Column(nullable = false) private String id; @Id @Column(name="PR_ID", nullable = false, insertable = false, updatable = false) private String prId; @ManyToOne @JoinColumn(name = "PR_ID", referencedColumnName = "ID") private Product product; } @Entity @IdClass(ProductNamePK.class) public class ProductName implements Serializable{ @Id @Column(name="DISTBN_TECHNOLOGY_NO", nullable = false) private Integer distbnTechnologyNo; @Id @Column(name="LOCALE_NO", nullable = false) private Integer localeNo; @Column(nullable = false) private String name; @Id @Column(name="PR_ID", nullable = false, insertable = false, updatable = false) private String prId; @ManyToOne @JoinColumn(name = "PR_ID", referencedColumnName = "ID") private Product product; } |
|
|
Re: Object: null is not a known entity typeObvious question that has to be asked, is the entity you're trying to
remove null? /tim On Fri, Jun 13, 2008 at 10:04 AM, ageing student <rsherman315@...> wrote: > > When trying to do a remove of an entity (Product detailed below) and its > children I am getting the error. > > > java.lang.IllegalArgumentException: Object: null is not a known entity type. > at > org.eclipse.persistence.internal.jpa.EntityManagerImpl.remove(EntityManagerImpl.java:263) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at > org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:194) > at $Proxy31.remove(Unknown Source) > at > uk.co.blueskyts.bizservices.product.product.ProductServiceBSImpl.deleteProduct(ProductServiceBSImpl.java:356) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) > at > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) > at > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) > at $Proxy32.deleteProduct(Unknown Source) > at BSImplTest.testDeleteProduct(BSImplTest.java:172) > > @Entity > public class Product implements Serializable{ > @Id > @Column(nullable = false) > private String id; > > @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, > cascade={CascadeType.ALL}) > private List<ProductName> productNameList; > > @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, > cascade={CascadeType.ALL}) > private List<ProductData> productDataList; > } > > @Entity > @IdClass(ProductDataPK.class) > public class ProductData implements Serializable{ > @Id > @Column(nullable = false) > private String id; > > @Id > @Column(name="PR_ID", nullable = false, insertable = false, updatable = > false) > private String prId; > > @ManyToOne > @JoinColumn(name = "PR_ID", referencedColumnName = "ID") > private Product product; > } > > > @Entity > @IdClass(ProductNamePK.class) > public class ProductName implements Serializable{ > @Id > @Column(name="DISTBN_TECHNOLOGY_NO", nullable = false) > private Integer distbnTechnologyNo; > > @Id > @Column(name="LOCALE_NO", nullable = false) > private Integer localeNo; > > @Column(nullable = false) > private String name; > > @Id > @Column(name="PR_ID", nullable = false, insertable = false, updatable = > false) > private String prId; > > @ManyToOne > @JoinColumn(name = "PR_ID", referencedColumnName = "ID") > private Product product; > } > -- > View this message in context: http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17824204.html > Sent from the EclipseLink - Users mailing list archive at Nabble.com. > > _______________________________________________ > eclipselink-users mailing list > eclipselink-users@... > https://dev.eclipse.org/mailman/listinfo/eclipselink-users > -- ./tch _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
Re: Object: null is not a known entity typeI've debugged up to the point where the EntityManager.remove is called and the entity is not null at that point. I'm just about to try debugging into the eclipselink code to see if I can work out what's happening. I.E. find what I've done wrong.
|
|
|
Re: Object: null is not a known entity typeI noticed you had CascadeType.ALL set, i wonder if you have a child set as null?
/tim On Fri, Jun 13, 2008 at 10:17 AM, ageing student <rsherman315@...> wrote: > > I've debugged up to the point where the EntityManager.remove is called and > the entity is not null at that point. I'm just about to try debugging into > the eclipselink code to see if I can work out what's happening. I.E. find > what I've done wrong. > > > Tim Hollosy wrote: >> >> Obvious question that has to be asked, is the entity you're trying to >> remove null? >> >> /tim >> >> On Fri, Jun 13, 2008 at 10:04 AM, ageing student >> <rsherman315@...> wrote: >>> >>> When trying to do a remove of an entity (Product detailed below) and its >>> children I am getting the error. >>> >>> >>> java.lang.IllegalArgumentException: Object: null is not a known entity >>> type. >>> at >>> org.eclipse.persistence.internal.jpa.EntityManagerImpl.remove(EntityManagerImpl.java:263) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>> at >>> org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:194) >>> at $Proxy31.remove(Unknown Source) >>> at >>> uk.co.blueskyts.bizservices.product.product.ProductServiceBSImpl.deleteProduct(ProductServiceBSImpl.java:356) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>> at >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>> at >>> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) >>> at >>> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) >>> at >>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) >>> at >>> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) >>> at >>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) >>> at >>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) >>> at $Proxy32.deleteProduct(Unknown Source) >>> at BSImplTest.testDeleteProduct(BSImplTest.java:172) >>> >>> @Entity >>> public class Product implements Serializable{ >>> @Id >>> @Column(nullable = false) >>> private String id; >>> >>> @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, >>> cascade={CascadeType.ALL}) >>> private List<ProductName> productNameList; >>> >>> @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, >>> cascade={CascadeType.ALL}) >>> private List<ProductData> productDataList; >>> } >>> >>> @Entity >>> @IdClass(ProductDataPK.class) >>> public class ProductData implements Serializable{ >>> @Id >>> @Column(nullable = false) >>> private String id; >>> >>> @Id >>> @Column(name="PR_ID", nullable = false, insertable = false, updatable = >>> false) >>> private String prId; >>> >>> @ManyToOne >>> @JoinColumn(name = "PR_ID", referencedColumnName = "ID") >>> private Product product; >>> } >>> >>> >>> @Entity >>> @IdClass(ProductNamePK.class) >>> public class ProductName implements Serializable{ >>> @Id >>> @Column(name="DISTBN_TECHNOLOGY_NO", nullable = false) >>> private Integer distbnTechnologyNo; >>> >>> @Id >>> @Column(name="LOCALE_NO", nullable = false) >>> private Integer localeNo; >>> >>> @Column(nullable = false) >>> private String name; >>> >>> @Id >>> @Column(name="PR_ID", nullable = false, insertable = false, updatable = >>> false) >>> private String prId; >>> >>> @ManyToOne >>> @JoinColumn(name = "PR_ID", referencedColumnName = "ID") >>> private Product product; >>> } >>> -- >>> View this message in context: >>> http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17824204.html >>> Sent from the EclipseLink - Users mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> eclipselink-users mailing list >>> eclipselink-users@... >>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >>> >> >> >> >> -- >> ./tch >> _______________________________________________ >> eclipselink-users mailing list >> eclipselink-users@... >> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >> >> > > -- > View this message in context: http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17824489.html > Sent from the EclipseLink - Users mailing list archive at Nabble.com. > > _______________________________________________ > eclipselink-users mailing list > eclipselink-users@... > https://dev.eclipse.org/mailman/listinfo/eclipselink-users > -- ./tch _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
Re: Object: null is not a known entity typeI feel more senile than usual today. I was calling the delete method twice in a row so of course it failed the second time.
<Hangs head in shame> Thanks for your prodding that made me look deeper into my code. Richard
|
|
|
Re: Object: null is not a known entity typeNp, We've all been there, sometimes all it takes is someone looking
over your shoulder, even virtually :) On Fri, Jun 13, 2008 at 10:42 AM, ageing student <rsherman315@...> wrote: > > I feel more senile than usual today. I was calling the delete method twice in > a row so of course it failed the second time. > > <Hangs head in shame> > > Thanks for your prodding that made me look deeper into my code. > Richard > > > Tim Hollosy wrote: >> >> I noticed you had CascadeType.ALL set, i wonder if you have a child set as >> null? >> >> /tim >> >> On Fri, Jun 13, 2008 at 10:17 AM, ageing student >> <rsherman315@...> wrote: >>> >>> I've debugged up to the point where the EntityManager.remove is called >>> and >>> the entity is not null at that point. I'm just about to try debugging >>> into >>> the eclipselink code to see if I can work out what's happening. I.E. find >>> what I've done wrong. >>> >>> >>> Tim Hollosy wrote: >>>> >>>> Obvious question that has to be asked, is the entity you're trying to >>>> remove null? >>>> >>>> /tim >>>> >>>> On Fri, Jun 13, 2008 at 10:04 AM, ageing student >>>> <rsherman315@...> wrote: >>>>> >>>>> When trying to do a remove of an entity (Product detailed below) and >>>>> its >>>>> children I am getting the error. >>>>> >>>>> >>>>> java.lang.IllegalArgumentException: Object: null is not a known entity >>>>> type. >>>>> at >>>>> org.eclipse.persistence.internal.jpa.EntityManagerImpl.remove(EntityManagerImpl.java:263) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at >>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>>> at >>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>>> at >>>>> org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:194) >>>>> at $Proxy31.remove(Unknown Source) >>>>> at >>>>> uk.co.blueskyts.bizservices.product.product.ProductServiceBSImpl.deleteProduct(ProductServiceBSImpl.java:356) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at >>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>>> at >>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>>> at >>>>> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) >>>>> at >>>>> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) >>>>> at >>>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) >>>>> at >>>>> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) >>>>> at >>>>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) >>>>> at >>>>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) >>>>> at $Proxy32.deleteProduct(Unknown Source) >>>>> at BSImplTest.testDeleteProduct(BSImplTest.java:172) >>>>> >>>>> @Entity >>>>> public class Product implements Serializable{ >>>>> @Id >>>>> @Column(nullable = false) >>>>> private String id; >>>>> >>>>> @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, >>>>> cascade={CascadeType.ALL}) >>>>> private List<ProductName> productNameList; >>>>> >>>>> @OneToMany(mappedBy = "product", fetch = FetchType.EAGER, >>>>> cascade={CascadeType.ALL}) >>>>> private List<ProductData> productDataList; >>>>> } >>>>> >>>>> @Entity >>>>> @IdClass(ProductDataPK.class) >>>>> public class ProductData implements Serializable{ >>>>> @Id >>>>> @Column(nullable = false) >>>>> private String id; >>>>> >>>>> @Id >>>>> @Column(name="PR_ID", nullable = false, insertable = false, updatable >>>>> = >>>>> false) >>>>> private String prId; >>>>> >>>>> @ManyToOne >>>>> @JoinColumn(name = "PR_ID", referencedColumnName = "ID") >>>>> private Product product; >>>>> } >>>>> >>>>> >>>>> @Entity >>>>> @IdClass(ProductNamePK.class) >>>>> public class ProductName implements Serializable{ >>>>> @Id >>>>> @Column(name="DISTBN_TECHNOLOGY_NO", nullable = false) >>>>> private Integer distbnTechnologyNo; >>>>> >>>>> @Id >>>>> @Column(name="LOCALE_NO", nullable = false) >>>>> private Integer localeNo; >>>>> >>>>> @Column(nullable = false) >>>>> private String name; >>>>> >>>>> @Id >>>>> @Column(name="PR_ID", nullable = false, insertable = false, updatable >>>>> = >>>>> false) >>>>> private String prId; >>>>> >>>>> @ManyToOne >>>>> @JoinColumn(name = "PR_ID", referencedColumnName = "ID") >>>>> private Product product; >>>>> } >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17824204.html >>>>> Sent from the EclipseLink - Users mailing list archive at Nabble.com. >>>>> >>>>> _______________________________________________ >>>>> eclipselink-users mailing list >>>>> eclipselink-users@... >>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >>>>> >>>> >>>> >>>> >>>> -- >>>> ./tch >>>> _______________________________________________ >>>> eclipselink-users mailing list >>>> eclipselink-users@... >>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17824489.html >>> Sent from the EclipseLink - Users mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> eclipselink-users mailing list >>> eclipselink-users@... >>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >>> >> >> >> >> -- >> ./tch >> _______________________________________________ >> eclipselink-users mailing list >> eclipselink-users@... >> https://dev.eclipse.org/mailman/listinfo/eclipselink-users >> >> > > -- > View this message in context: http://www.nabble.com/Object%3A-null-is-not-a-known-entity-type-tp17824204p17825042.html > Sent from the EclipseLink - Users mailing list archive at Nabble.com. > > _______________________________________________ > eclipselink-users mailing list > eclipselink-users@... > https://dev.eclipse.org/mailman/listinfo/eclipselink-users > -- ./tch _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
Re: Object: null is not a known entity typeHello,
For your information, I am currently member of an active project (only 2 developpers) on code.google/volute namd SimDB : http://volute.googlecode.com/svn/trunk/projects/theory/snapdm/ The project main concept consist in generating code representations from any generic UML model (saved as XMI 2.1 in MagicDrawUML Community Edition 12.1). For now, this project uses XMI / XSLT / Jpa EclipseLink provider 1.0-M8 and JAXB 2.1 (2.1.6 ref). The transformer tool handles any Data Model (in xmi uml serialization) to translate it to other documents : - XML schemas (xsd) : one schema for each uml package + DM_root.xsd (base elements) http://volute.googlecode.com/svn/trunk/projects/theory/snapdm/output/schema/ - documentation (html in ivoa format) - java formatted code (JPA / JAXB compliant) + javadoc + jalopy formatter + unit tests (XML unmarshalling -> Java Object graph -> Jpa persist() -> Jpa reload() -> XML marshalling) : http://volute.googlecode.com/svn/trunk/projects/theory/snapdm/output/java/ - DDL script (microsoft sql server / postgresql databases / oracle soon ?) as SQL scripts - TAP VOTABLEs (ivoa ) This project will soon be split off to code.google/vo-urp to be totally independent with the UML Data Model ... You can maybe find some interesting things : xsd generation, meta model introspection, toString() & equals() methods ... Enjoy, Comments are welcome, Laurent Bourgès ------------------------------------------------------------------------- Laurent Bourgès, IT engineer EURO-VO-DCA Project LUTh, Observatoire de Paris-Meudon Email: bourges.laurent@... ------------------------------------------------------------------------- _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
| Free embeddable forum powered by Nabble | Forum Help |