users@glassfish.java.net

The getter method on entity class does not have a corresponding setter method defined

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Thu, 21 Jan 2010 13:05:51 -0500

Hi Guys,

I was getting this exception due to JAXB RI XJC issue:

https://jaxb.dev.java.net/issues/show_bug.cgi?id=733


Exception Description: An exception was thrown while searching for
persistence archives with ClassLoader: WebappClassLoader (delegate=true;
repositories=WEB-INF/classes/)
Internal Exception: javax.persistence.PersistenceException: Exception
[EclipseLink-28018] (Eclipse Persistence Services -
2.0.0.v20091127-r5931):
org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit
[xxx-persistence-unit] failed.
Internal Exception: Exception [EclipseLink-7174] (Eclipse Persistence
Services - 2.0.0.v20091127-r5931):
org.eclipse.persistence.exceptions.ValidationException
Exception Description: The getter method [method
isReturnComposedObjects] on entity class [class xxx.ResponseOptionType]
does not have a corresponding setter method defined.
    at com.sun.enterprise.web.WebApplication.start(WebApplication.java:117)
    at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
    at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
    at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
    at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
    at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
    at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
    at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
    at
com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)

I worked around the above issue (by removing default="false" in xsd) so
that the generated class has corresponding setters and getters:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResponseOptionType")
public class ResponseOptionType
{

    @XmlAttribute
    protected Boolean returnComposedObjects;

...

    public Boolean isReturnComposedObjects() {
        return returnComposedObjects;
    }

    /**
     * Sets the value of the returnComposedObjects property.
     *
     * @param value
     * allowed object is
     * {_at_link Boolean }
     *
     */
    public void setReturnComposedObjects(Boolean value) {
        this.returnComposedObjects = value;
    }

...

}

However, I am still seeing the same error. BTW, I am using hibernate
entity manager and not toplink. I do have the Hibernate JPA Add ON
installed.
Why is EclipseLink code being run in stack trace?

What could possibly be wrong now?

Note that things are fine on Glassfish V3 Prelude but dont work in
Glassfish V3 Final and this is blocking my product and customers to
migrate to Glassfish V3 Final. Thanks for your help.

-- 
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com