Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] problems with Allow Null in web service on Glassfish 3.1.2

 

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. It is not mandatory parametr and i am getting the error when the parametr is not there. If it is there than there is no error
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, what can be cause of the error or where to find some example about this problem?
Thank You very much
With Regards Petr N


Back to the top