# Can not read HTTP response, caught IOException



## denis7788 (27. Aug 2015)

Hi,

Ich bekomme beim deployen meiner Anwendung folgende Fehlermeldung:
"cannot Deploy CustomerManagement
org.glassfish.tools.ide.admin.CommandException: Can not read HTTP response, caught IOException"

Im Server Log steht u.a. folgendes, was meiner Meinung nach das Problem sein könnte. Nur habe ich eine Id festgelegt. Was mixed access type betrifft bin ich nicht sicher. Aber es müsste doch AccessType.PROPERTY sein, da ich die @Id Annotation über dem getter habe. Oder habe ich da etwas falsch verstanden?:

"Exception Description: Entity class [class de.denis.customers.models.Customer] 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 make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy."

Unten habe ich noch meine zwei Entity Klassen und den StackTrace:

Customer:

```
package de.denis.customers.models;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@JsonIgnoreProperties(ignoreUnknown = true)
public class Customer {
   
    private int id;
    private String firstName;
    private String lastName;
   
    @OneToMany(cascade=CascadeType.ALL, fetch= FetchType.EAGER, orphanRemoval=true)
    private List<Address> addresses;
   
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getFirstName() {
        return firstName;
    }
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    public String getLastName() {
        return lastName;
    }
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    public List<Address> getAddresses() {
        return addresses;
    }
    public void setAddresses(List<Address> addresses) {
        this.addresses = addresses;
    }
   

}
```


Address:

```
package de.denis.customers.models;



import javax.persistence.Access;

import javax.persistence.AccessType;

import javax.persistence.Entity;

import javax.persistence.GeneratedValue;

import javax.persistence.GenerationType;

import javax.persistence.Id;

import javax.persistence.Transient;



import com.fasterxml.jackson.annotation.JsonIgnoreProperties;





@Entity

@JsonIgnoreProperties(ignoreUnknown = true)

public class Address {



privateintid;

private String street;

private String number;

private String zip;

private String city;

private String country;




@Id

@GeneratedValue(strategy = GenerationType.IDENTITY)

public int getId() {

returnid;

}

public void setId(int id) {

this.id = id;

}

public String getStreet() {

returnstreet;

}

public void setStreet(String street) {

this.street = street;

}

public String getNumber() {

returnnumber;

}

public void setNumber(String number) {

this.number = number;

}

public String getZip() {

returnzip;

}

public void setZip(String zip) {

this.zip = zip;

}

public String getCity() {

returncity;

}

public void setCity(String city) {

this.city = city;

}

public String getCountry() {

returncountry;

}

public void setCountry(String country) {

this.country = country;

}



}
```



Das ist der Server Log:

```
2015-08-27T12:54:53.156+0200|Information: Running GlassFish Version: GlassFish Server Open Source Edition  4.1  (build 13)

2015-08-27T12:54:53.160+0200|Information: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter

2015-08-27T12:54:53.328+0200|Information: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.

2015-08-27T12:54:53.344+0200|Information: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.

2015-08-27T12:54:53.350+0200|Information: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.

2015-08-27T12:54:53.616+0200|Information: Authorization Service has successfully initialized.

2015-08-27T12:54:53.684+0200|Information: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry

2015-08-27T12:54:54.124+0200|Information: Grizzly Framework 2.3.15 started in: 50ms - bound to [/0.0.0.0:8080]

2015-08-27T12:54:54.155+0200|Information: Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:8181]

2015-08-27T12:54:54.164+0200|Information: Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:4848]

2015-08-27T12:54:54.225+0200|Information: Grizzly Framework 2.3.15 started in: 1ms - bound to [/0.0.0.0:3700]

2015-08-27T12:54:54.227+0200|Information: GlassFish Server Open Source Edition  4.1  (13) startup time : Felix (5.315ms), startup services(1.219ms), total(6.534ms)

2015-08-27T12:54:54.635+0200|Information: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://deniss-mbp:8686/jndi/rmi://deniss-mbp:8686/jmxrmi

2015-08-27T12:54:54.793+0200|Information: Grizzly Framework 2.3.15 started in: 4ms - bound to [/0.0.0.0:7676]

2015-08-27T12:54:55.052+0200|Information: HV000001: Hibernate Validator 5.0.0.Final

2015-08-27T12:54:56.279+0200|Information: visiting unvisited references

2015-08-27T12:54:56.880+0200|Information: visiting unvisited references

2015-08-27T12:54:57.105+0200|Information: visiting unvisited references

2015-08-27T12:54:57.157+0200|Information: visiting unvisited references

2015-08-27T12:54:57.166+0200|Information: visiting unvisited references

2015-08-27T12:54:57.470+0200|Information: Java security manager is disabled.

2015-08-27T12:54:57.470+0200|Information: Entering Security Startup Service.

2015-08-27T12:54:57.474+0200|Information: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.

2015-08-27T12:54:57.532+0200|Information: Security Service(s) started successfully.

2015-08-27T12:54:57.787+0200|Information: Initiating Jersey application, version Jersey: 2.10.4 2014-08-08 15:09:00...

2015-08-27T12:54:57.931+0200|Information: visiting unvisited references

2015-08-27T12:54:58.712+0200|Information: Listening to REST requests at context: /management/domain.

2015-08-27T12:54:58.897+0200|Information: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@7ad54c55 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@7f829c76.

2015-08-27T12:54:59.070+0200|Information: visiting unvisited references

2015-08-27T12:55:00.310+0200|Information: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080

2015-08-27T12:55:00.319+0200|Information: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181

2015-08-27T12:55:00.322+0200|Information: Created HTTP listener admin-listener on host/port 0.0.0.0:4848

2015-08-27T12:55:00.350+0200|Schwerwiegend: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method

2015-08-27T12:55:00.351+0200|Schwerwiegend: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method

2015-08-27T12:55:00.362+0200|Information: Created virtual server server

2015-08-27T12:55:00.362+0200|Schwerwiegend: org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.

at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:182)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)

at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)

at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)

at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)

at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)

at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)

at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)

at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)

at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)

at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)

at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)

at java.lang.Thread.run(Thread.java:745)

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1954)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1945)

at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:322)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:309)

at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:88)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:155)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:152)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:232)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:241)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:267)

at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:152)

... 40 more

Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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:230)

... 58 more

Caused by: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] has no primary key specified. It should define either an @Id, @EmbeddedId or an @IdClass. If you have defined PK using any of these an

2015-08-27T12:55:00.362+0200|Schwerwiegend: notations then 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:1422)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1536)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processMappingAccessors(EntityAccessor.java:1243)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:697)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1793)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:576)

at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:585)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1869)

... 56 more

2015-08-27T12:55:00.364+0200|Information: Created virtual server __asadmin

2015-08-27T12:55:00.371+0200|Schwerwiegend: Exception while preparing the app

2015-08-27T12:55:00.371+0200|Schwerwiegend: Exception during lifecycle processing

org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.

at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:182)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)

at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)

at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)

at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)

at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)

at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)

at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)

at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)

at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)

at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)

at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)

at java.lang.Thread.run(Thread.java:745)

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1954)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1945)

at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:322)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:309)

at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:88)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:155)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:152)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:232)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:241)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:267)

at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:152)

... 40 more

Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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:230)

... 58 more

Caused by: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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:1422)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1536)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processMappingAccessors(EntityAccessor.java:1243)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:697)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1793)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:576)

at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:585)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1869)

... 56 more



2015-08-27T12:55:00.537+0200|Schwerwiegend: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 make sure that you do not have mixed access-type (both fields and properties annotated) in your entity class hierarchy.

javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:1954)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1945)

at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:322)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:199)

at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:107)

at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)

at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)

at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)

at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:168)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:309)

at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:88)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:155)

at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:152)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:232)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:241)

at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:267)

at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:152)

at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:925)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:434)

at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)

at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)

at java.security.AccessController.doPrivileged(Native Method)

at javax.security.auth.Subject.doAs(Subject.java:360)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)

at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)

at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)

at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)

at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)

at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)

at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)

at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)

at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)

at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)

at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)

at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)

at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)

at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)

at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)

at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)

at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)

at java.lang.Thread.run(Thread.java:745)

Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [CustomerManagementEJB] failed.

Internal Exception: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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:230)

... 58 more

Caused by: Exception [EclipseLink-7161] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException

Exception Description: Entity class [class de.denis.customers.models.Customer] 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 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:1422)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.validatePrimaryKey(EntityAccessor.java:1536)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processMappingAccessors(EntityAccessor.java:1243)

at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.process(EntityAccessor.java:697)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage2(MetadataProject.java:1793)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:576)

at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:585)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1869)

... 56 more



2015-08-27T12:55:00.589+0200|Information: Setting JAAS app name glassfish-web

2015-08-27T12:55:00.591+0200|Information: Virtual server server loaded default web module 

2015-08-27T12:55:01.386+0200|Information: visiting unvisited references

2015-08-27T12:55:01.406+0200|Information: visiting unvisited references

2015-08-27T12:55:01.407+0200|Information: visiting unvisited references

2015-08-27T12:55:03.109+0200|Information: Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362) für Kontext '' wird initialisiert.

2015-08-27T12:55:04.856+0200|Information: Loading application [__admingui] at [/]

2015-08-27T12:55:04.859+0200|Information: Loading application __admingui done in 5.962 ms
```


----------



## denis7788 (28. Aug 2015)

Ich habe den Fehler gefunden, verstehe aber nicht so ganz warum es jetzt funktioniert. 
Ich habe in der Customer.java AccessType.Field gesetzt indem ich die @Id Annotation über die Instanzvariable statt den Getter gesetzt habe. Hat jemand einen Tipp warum es jetzt funktioniert bzw. warum ich das nur bei der Customer.java, nicht aber bei der Address.java so machen muss?


```
@Entity

@JsonIgnoreProperties(ignoreUnknown = true)

public class Customer {


@Id

@GeneratedValue(strategy = GenerationType.AUTO)

privateintid;

private String firstName;

private String lastName;


@OneToMany(cascade=CascadeType.ALL, fetch= FetchType.EAGER, orphanRemoval=true)

private List<Address> addresses;


public int getId() {

returnid;

}

public void setId(int id) {

this.id = id;

}
....
}
```


----------

