----- Original Message -----
Sent: Monday, November 02, 2009 6:51
AM
Subject: RE: [eclipselink-users]
NullPointerException when mapping enum field
Yes, 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
This is very odd. If you remove only the enum
mapping, does it work?
----- Original Message -----
Sent: Friday, October 30, 2009 1:42
PM
Subject: [eclipselink-users]
NullPointerException when mapping enum field
Hi
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@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
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).