users@glassfish.java.net

Re: Restful application via GlassFish v3 Prelude

From: Arun Gupta <Arun.Gupta_at_Sun.COM>
Date: Wed, 09 Sep 2009 09:54:03 -0700

The error message indicates that the entity class CenkBeyGil.ActorInfo
in the application does not seem to have a primary key. Does the
corresponding table have a primary key ?

Here is a simple blog that explains how to setup a Persistence Unit on
an earlier GlassFish v3 build:

http://blog.arungupta.me/2009/04/totd-78-glassfish-eclipselink-and-mysql-efficient-pagination-using-limit/

Thanks,
-Arun

glassfish_at_javadesktop.org wrote:
> I don't know why but i always get errors :). This time i decided to ask. I added all jars into my project.(http://www.docjar.com/jar_detail/eclipselink4465519.jar.html) My persistence.xml is like that
>
> [b]<?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
> <persistence-unit name="CenkBeyGilPU" transaction-type="JTA">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> <jta-data-source>jndi/CenkBeyGil</jta-data-source>
> <properties>
> <property name="eclipselink.ddl-generation" value="create-tables"/>
> <property name="eclipselink.jdbc.user" value="root"/>
> <property name="eclipselink.jdbc.password" value="3774634"/>
> </properties>
> </persistence-unit>
> </persistence>[/b]
> [i]
> So i didn't expect errors. But it found me again. How can i get rid of that?[/i]
>
> SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
> javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.EntityManagerSetupException
> Exception Description: Predeployment of PersistenceUnit [CenkBeyGilPU] failed.
> Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:870)
> at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:189)
> at org.glassfish.persistence.jpa.JPAApplication.loadPU(JPAApplication.java:200)
> at org.glassfish.persistence.jpa.JPAApplication.loadAllPus(JPAApplication.java:156)
> at org.glassfish.persistence.jpa.JPAApplication.<init>(JPAApplication.java:92)
> at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:447)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:173)
> at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
> at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
> at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
> at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
> at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
> at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
> at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
> at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
> at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
> at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
> at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
> at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
> Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.EntityManagerSetupException
> Exception Description: Predeployment of PersistenceUnit [CenkBeyGilPU] failed.
> Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210)
> ... 29 more
> Caused by: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.exceptions.ValidationException.noPrimaryKeyAnnotationsFound(ValidationException.java:1245)
> at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1173)
> at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:486)
> at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:443)
> at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:303)
> at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
> ... 28 more
> SEVERE: Exception while deploying the app
> javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.EntityManagerSetupException
> Exception Description: Predeployment of PersistenceUnit [CenkBeyGilPU] failed.
> Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:870)
> at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:189)
> at org.glassfish.persistence.jpa.JPAApplication.loadPU(JPAApplication.java:200)
> at org.glassfish.persistence.jpa.JPAApplication.loadAllPus(JPAApplication.java:156)
> at org.glassfish.persistence.jpa.JPAApplication.<init>(JPAApplication.java:92)
> at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:447)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:173)
> at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
> at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
> at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
> at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
> at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
> at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
> at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
> at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
> at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
> at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
> at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
> at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
> Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.EntityManagerSetupException
> Exception Description: Predeployment of PersistenceUnit [CenkBeyGilPU] failed.
> Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:210)
> ... 29 more
> Caused by: Exception [EclipseLink-7161] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.ValidationException
> Exception Description: Entity class [class CenkBeyGil.ActorInfo] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these annotations then please make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.
> at org.eclipse.persistence.exceptions.ValidationException.noPrimaryKeyAnnotationsFound(ValidationException.java:1245)
> at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1173)
> at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:486)
> at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:443)
> at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:303)
> at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:830)
> ... 28 more
> SEVERE: Exception while shutting down application container
> java.lang.NullPointerException
> at com.sun.enterprise.web.WebDeployer.unload(WebDeployer.java:222)
> at com.sun.enterprise.web.WebDeployer.unload(WebDeployer.java:63)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:789)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:647)
> at com.sun.enterprise.v3.server.ApplicationLifecycle$1.actOn(ApplicationLifecycle.java:158)
> at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:198)
> at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
> at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
> at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
> at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
> at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
> at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
> at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
> at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
> at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
> at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
> at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
> at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
> at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
> at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
> at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
> [Message sent by forum member 'devatate' (ugurguler20_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=363355
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

-- 
Need Application Server ? Download from http://glassfish.org
Blog: http://blogs.sun.com/arungupta