Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] problem with criteria The type [null] is not the expected [EntityType] for the key class [class] - try upgrade past 8141.

    The workaround for DI 101 and bug# 338837 to fix the IAE issue for Criteria/Metamodel users attempting to use an EntityType that is not found is to specify the location of the classes (usually not required for Java EE environments)
This environment will exist in Java SE, Spring and certain implementations of Java EE 6 Web Profile.

Exception in thread "main" java.lang.IllegalArgumentException: The type [null] is not the expected [EntityType] for the key class [class org.eclipse.persistence.example.distributed.collatz.model.UnitOfWork].

Is detailed in

workaround is also detailed in

Global to all classes
or specific to a single class

thank you
Michael O'Brien

On 15/11/2010 09:57, Michael O'Brien wrote:
    Hi, this is unfortunate - I will try to help narrow down the issue.
    You may be experiencing some outstanding issues with the critical child bug 303063 of 266912 that was fixed in rev# 8141 in early Sept 2010, or your issue may be a reproduction of DI 101 depending on the rev# you are running on.  It is hard to narrow down your issue unless we know what type of model you are using (IE: is your @Id singular/composite, is it defined on a @MappedSuperclass superclass or chain), and whether you are running on a container, what type of container (GlassFish?) or just SE (where predeploy and deploy happen in sequence).

    Short answer:
    - check your revision is past 8141 - from my forensic analysis cross-referencing your 152 stack trace line to the 160 expected source - it looks like your rev is pre 8006
    - After you refresh past 8141 - verify you are not seeing DI 95 or 101 - that should be fixed
    - see if you are experiencing outstanding DI 101

    Long answer:

    The following issues were fixed surrounding premature metamodel initialization before the metadata was fully processed

    However, the fix for 322585 in 8141 will not fix all instances (The Metamodel API must assume that all RelationalDescriptors are initialized - with both their class and className set) - we may have a one or more scenarios where the RelationalDescriptor is not ready to use - these are very difficult to reproduce - see the references for design issue 101

    The reproduction of DI 101 could only occur if one of the 3 API calls below is called and the underlying ''RelationalDescriptor'' is invalid

    From your stack trace I see that you have called MetamodelImpl.entity() and that the stacktrace indicates you are on line 152.
    The current trunk version (8492) is 8 lines ahead and would show as :160
at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entity(
     The 8 lines were added in SVN rev# 8006 on Aug 6 - you therefore are using a version before 8006 and the larger fix in 8141

    I would like to know if your model reproduced DI 101?
    You can also raise an EclipseLink bug so that it can get prioritized and/or voted on.

    thank you

Daniel Gomes-THINK IT wrote:



Hi, I try to developer one application with netbeans platform (RCP) with eclipselink, but sometimes I got the following error:

 java.lang.IllegalArgumentException: The type [null] is not the expected [EntityType] for the key class [class].

        at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl.entity(



        at org.netbeans.core.startup.NbInstaller.loadCode(

        at org.netbeans.core.startup.NbInstaller.load(

        at org.netbeans.ModuleManager.enable(

        at org.netbeans.core.startup.ModuleList.installNew(

        at org.netbeans.core.startup.ModuleList.trigger(

        at org.netbeans.core.startup.ModuleSystem.restore(

        at org.netbeans.core.startup.Main.getModuleSystem(

        at org.netbeans.core.startup.Main.start(


[catch] at

Daniel Gomes

TI Infra

Tel:+55 (11) 3049-6035

Fax:+55 (11) 3045-9506


Banco Fator

R Dr Renato Paes de Barros, 1017 - 11º ,12º e 13º andares
Itaim Bibi - 04530-001 - São Paulo - SP


P  Evite o desperdício: imprima somente o necessário.


Pontos de vista e opiniões inclusos nesta mensagem são de responsabilidade do remetente a menos que claramente mencionado como originados pelas Empresas do Conglomerado Fator. Comunicações pela internet não podem ser garantidas quanto à sua segurança ou inexistência de erros e vírus. As empresas controladas pelo Banco Fator, por esta razão, não assumem responsabilidade por qualquer erro ou omissão no contexto da mensagem, decorrente da transmissão via internet. Essa mensagem pode conter informação confidencial. Se você não for o destinatário ou a pessoa autorizada a receber esta mensagem, não poderá usar, copiar ou divulgar as informações nela contidas ou tomar qualquer ação baseada nessas informações. Se você recebeu esta mensagem por engano, por favor, avise imediatamente o remetente, respondendo este e-mail e em seguida apagando-o. Agradecemos a sua cooperação.

Points of view and opinions herein expressed are the responsibility of sender unless clearly stated otherwise as having been originated in companies of the Fator Conglomerate. Communications via the Internet cannot be guaranteed with regards to safety or the absence of errors and viruses. For this reason, Banco Fator-controlled companies shall not assume responsibility for errors or omissions in the context of a transmission via the Internet. This e-mail may be confidential. If you are not the intended recipient or the authorized person to receive this message, you may not use, copy or publicize information therein contained or take any action based on such information. If you are not the intended addressee, please advise sender immediately by replying to this e-mail and delete if obtained in error. We appreciate your cooperation.

SAC (Customer Care): 0800-770-7229 / sac@xxxxxxxxxxxxxxxxx
Ouvidoria (Ombudsperson): 0800-77-32867 / ouvidoria@xxxxxxxxxxxxxxxxx
Rua Dr. Renato Paes de Barros, 1017, 12o.andar – Itaim Bibi - São Paulo – SP – 04530-001.

_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx

Back to the top