embedded@glassfish.java.net

Re: web service problems on Glassfish 3.1.2

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Tue, 26 Jun 2012 10:23:27 -0700

Your issue is with JPA setup in EclipseLink. Please ask your question on
eclipselink-users_at_eclipse.org alias.

-marina

petrxn_at_centrum.cz wrote:
>
> Hello
> I would like to ask you for an advice or a direction where to find some example about how to solve my problem. I have web service which is running smoothly on Glassfish 2.1.1. and I am trying to migrate to Glassfish 3.1.2, but the web service is not working there.
>
> I am getting this error from server.log:
>
> …
> Stack:
> Exception [EclipseLink-68] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The value of an aggregate in object […@c950b5] is null. Null values not allowed for Aggregate mappings unless "Allow Null" is specified.
> Mapping: org.eclipse.persistence.mappings.AggregateObjectMapping[popl]
> Descriptor: RelationalDescriptor
> …
> [popl] from the next-to-last line of the exception is an Embedded parametr of an entity class.
> I tried to google it and to set DescriptorCustomizer for the entity class with parametr Allow null as in short below
>
> @Entity
> @Table …
> @Customizer(EntType.class)
> public class EntType implements Serializable, DescriptorCustomizer {
> …
> @Embedded
> protected poplType popl ;
> …
> public void customize(ClassDescriptor descriptor) {
> ((AggregateObjectMapping)descriptor.getMappingForAttributeName("popl")).setIsNullAllowed(true);
> }
> }
>
> And it is still not working :(, can you help me with advice how to do it or where to find some example about this problem?
>
> Thank You very much
> With Regards Petr N
>