Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Object: null is not a known entity type

Np, 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@xxxxxxxxxxx> 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@xxxxxxxxxxx> 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@xxxxxxxxxxx> 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@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> ./tch
>>>> _______________________________________________
>>>> eclipselink-users mailing list
>>>> eclipselink-users@xxxxxxxxxxx
>>>> 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@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>>
>>
>>
>> --
>> ./tch
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> 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@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>



-- 
./tch


Back to the top