|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
NullPointerException when mapping enum fieldHi
I am getting
NullPointerException during EM initialization. I am not using JPA
annotations, just mappings file (see attachment).
In my orm.xml file,
I have an entity with enum field mapped as
<enumerated>STRING</enumerated>. The exception I am getting
is:
...
Caused by:
javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse
Persistence Services - 2.0.0.v20091026-r5655):
org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [el.test] failed. Internal Exception: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:927) at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:217) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1392) ... 51 more Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.0.0.v20091026-r5655): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [el.test] failed. Internal Exception: java.lang.NullPointerException at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210) ... 57 more Caused by: java.lang.NullPointerException at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.getMetadataFactory(ORMetadata.java:227) at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.getJavaClass(ORMetadata.java:189) at org.eclipse.persistence.internal.jpa.metadata.ORMetadata.getJavaClass(ORMetadata.java:149) at org.eclipse.persistence.internal.jpa.metadata.converters.EnumeratedMetadata.process(EnumeratedMetadata.java:100) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processEnumerated(MappingAccessor.java:1285) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicAccessor.processEnumerated(BasicAccessor.java:339) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processJPAConverters(MappingAccessor.java:1299) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processMappingConverter(MappingAccessor.java:1400) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processMappingValueConverter(MappingAccessor.java:1418) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.BasicAccessor.process(BasicAccessor.java:299) at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.processAccessors(MetadataDescriptor.java:1270) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.processAccessors(ClassAccessor.java:789) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processAccessors(EntityAccessor.java:845) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:706) at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:683) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1311) at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:462) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:337) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:881) ... 56 more I think there might
be a bug in EclipseLink as this is working when using EL
1.1.0. Thanks.
Regards
Jaro This e-mail is confidential and is intended only for the person to whom it is addressed. It may be privileged and should not be read, copied or used by anyone other than the intended recipient. If you are not that person, you are not permitted to make use of the information and you are requested to notify the sender immediately that you have received it and then destroy the copy in your possession without disclosing its contents to any person. Commerzbank AG may monitor outgoing and incoming e-mails. By replying to this e-mail you consent to such monitoring. We believe, but do not warrant, that this e-mail and any attachments are virus free, but you must take full responsibility for virus checking. This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank Corporates & Markets, a division of Commerzbank AG. Commerzbank AG is a company incorporated in the Federal Republic of Germany and registered in England (registered number FC008139, place of business 30 Gresham Street, London EC2V 7PG) and is authorised by Bundesanstalt fuer Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited regulation by the Financial Services Authority (FSA). _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
Re: NullPointerException when mapping enum fieldThis is very odd. If you remove only the enum
mapping, does it work?
_______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
RE: NullPointerException when mapping enum fieldYes, when I remove the enum mapping, session is created,
but obviously the field is not mapped.
When I comment out <enumerated>STRING</enumerated>, the field is
mapped as integer.
Jaro From: eclipselink-users-bounces@... [mailto:eclipselink-users-bounces@...] On Behalf Of Guy Pelletier Sent: 30 October 2009 19:09 To: EclipseLink User Discussions Subject: Re: [eclipselink-users] NullPointerException when mapping enum field This is very odd. If you remove only the enum
mapping, does it work?
This e-mail is confidential and is intended only for the person to whom it is addressed. It may be privileged and should not be read, copied or used by anyone other than the intended recipient. If you are not that person, you are not permitted to make use of the information and you are requested to notify the sender immediately that you have received it and then destroy the copy in your possession without disclosing its contents to any person. Commerzbank AG may monitor outgoing and incoming e-mails. By replying to this e-mail you consent to such monitoring. We believe, but do not warrant, that this e-mail and any attachments are virus free, but you must take full responsibility for virus checking. This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank Corporates & Markets, a division of Commerzbank AG. Commerzbank AG is a company incorporated in the Federal Republic of Germany and registered in England (registered number FC008139, place of business 30 Gresham Street, London EC2V 7PG) and is authorised by Bundesanstalt fuer Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited regulation by the Financial Services Authority (FSA). _______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
|
|
Re: NullPointerException when mapping enum fieldLooks like a bug, please enter one to have this
fixed.
In the mean time, using the Enumerated annotation
should work.
Thanks,
Guy
_______________________________________________ eclipselink-users mailing list eclipselink-users@... https://dev.eclipse.org/mailman/listinfo/eclipselink-users |
| Free embeddable forum powered by Nabble | Forum Help |