Am 11.10.13 13:20, schrieb Dmitry Gusev:
Try removing @Inject and only keep @PersistenceContext for the
EntityManager field ? :)

Sure :)

public class Customers {

  @PersistenceContext(unitName = "de.aeits_TapestryWeb_war_1.0-SNAPSHOTPU")
  private EntityManager entityManager;

  @Log
  public List<Customers> getCustomers() {
return entityManager.createNamedQuery("Customer.findAll").getResultList();
  }
}

java.lang.IllegalStateException: Failed to create EntityManagerFactory for persistence unit 'de.aeits_TapestryWeb_war_1.0-SNAPSHOTPU' at org.apache.tapestry5.internal.jpa.EntityManagerSourceImpl.createEntityManagerFactory(EntityManagerSourceImpl.java:212) at org.apache.tapestry5.internal.jpa.EntityManagerSourceImpl.getEntityManagerFactory(EntityManagerSourceImpl.java:185) at org.apache.tapestry5.internal.jpa.EntityManagerSourceImpl.create(EntityManagerSourceImpl.java:276)
        at $EntityManagerSource_132c0b3869f9a87d.create(Unknown Source)


From my understanding of the docu, i only have to add the persistence class to the entities package, right?

Add the dependency to the pom:

              <dependency>
                        <groupId>org.apache.tapestry</groupId>
                        <artifactId>tapestry-jpa</artifactId>
                        <version>5.3.7</version>
                </dependency>

And just create a tml and the class like above.

--
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
a...@ae-online.de | www.ae-online.de
www.tachyon-online.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to