database - Issue with EntityManager with Tapestry and JPA -


i've been trying go tapestry-hibernate tapestry-jpa.

i've followed user guide http://tapestry.apache.org/integrating-with-jpa.html , however, i'm experiencing some, me unknown, exceptions , have no more ideas how solve it.

2013-07-25 12:36:20.608:warn::failed app: java.lang.runtimeexception: exception constructing service 'registrystartup': error invoking service contribution method org.apache.tapestry5.jpa.jpamodule.startupearly(entitymanagermanager, boolean): no persistence providers available "demounit" after trying following discovered implementations: none 2013-07-25 12:36:20.608:warn::failed startup of context org.mortbay.jetty.webapp.webappcontext@2bbd9de3{/addressbook,c:\users\eivaore\workspaces\training\addressbook\src\main\webapp} java.lang.runtimeexception: exception constructing service 'registrystartup': error invoking service contribution method org.apache.tapestry5.jpa.jpamodule.startupearly(entitymanagermanager, boolean): no persistence providers available "demounit" after trying following discovered implementations: none     @ org.apache.tapestry5.ioc.internal.services.justintimeobjectcreator.obtainobjectfromcreator(justintimeobjectcreator.java:75)     @ org.apache.tapestry5.ioc.internal.services.justintimeobjectcreator.createobject(justintimeobjectcreator.java:54)     @ $runnable_11a5a7e5614b.delegate(unknown source)     @ $runnable_11a5a7e5614b.run(unknown source)     @ org.apache.tapestry5.ioc.internal.registryimpl.performregistrystartup(registryimpl.java:325)     @ org.apache.tapestry5.ioc.internal.registrywrapper.performregistrystartup(registrywrapper.java:80)     @ org.apache.tapestry5.tapestryfilter.init(tapestryfilter.java:118)     @ org.mortbay.jetty.servlet.filterholder.dostart(filterholder.java:97)     @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:50)     @ org.mortbay.jetty.servlet.servlethandler.initialize(servlethandler.java:713)     @ org.mortbay.jetty.servlet.context.startcontext(context.java:140)     @ org.mortbay.jetty.webapp.webappcontext.startcontext(webappcontext.java:1282)     @ org.mortbay.jetty.handler.contexthandler.dostart(contexthandler.java:518)     @ org.mortbay.jetty.webapp.webappcontext.dostart(webappcontext.java:499)     @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:50)     @ org.mortbay.jetty.handler.handlerwrapper.dostart(handlerwrapper.java:130)     @ org.mortbay.jetty.server.dostart(server.java:224)     @ org.mortbay.component.abstractlifecycle.start(abstractlifecycle.java:50)     @ runjettyrun.bootstrap.main(bootstrap.java:97) 2013-07-25 12:36:20.642:info::started selectchannelconnector@0.0.0.0:8888 

my persistence.xml placed @ src/main/resources/meta-inf/ , looks this:

<?xml version="1.0" encoding="utf-8"?>  <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">     <persistence-unit name="demounit" transaction-type="resource_local">         <properties>             <property name="javax.persistence.jdbc.driver" value="org.h2.driver" />             <property name="javax.persistence.jdbc.url"    value="jdbc:h2:mem:test" />             <property name="javax.persistence.jdbc.user"   value="sa" />             <property name="eclipselink.ddl-generation"    value="create-tables"/>             <property name="eclipselink.logging.level"     value="fine"/>         </properties>     </persistence-unit> </persistence> 

i using in dao class this:

package com.example.addressbook.data.impl;  import java.util.list;  import javax.persistence.entitymanager; import javax.persistence.persistencecontext; import javax.persistence.typedquery;  import org.apache.tapestry5.ioc.annotations.postinjection;  import com.example.addressbook.data.celebritydao; import com.example.addressbook.entities.celebrity; import com.example.addressbook.entities.occupation; import com.example.addressbook.util.formats;  public class celebritydaoimpl implements celebritydao {      @persistencecontext(unitname = "demounit")     private entitymanager entitymanager;      public celebritydaoimpl() {     }      public void add(celebrity celebrity) {         entitymanager.persist(celebrity);     }      public celebrity get(long id) {         return entitymanager.find(celebrity.class, id);     }      public list<celebrity> getall() {         return entitymanager.createquery("select c celebrity",                 celebrity.class).getresultlist();      }      public list<celebrity> getrange(long startindex, long endindex) {         typedquery<celebrity> query = entitymanager.createquery(                 "select c celebrity c.id between :idstart , :idend",                  celebrity.class);         query.setparameter("idstart", startindex);         query.setparameter("idend", endindex);          return query.getresultlist();     }      @postinjection     public void prepare() {         add(new celebrity("britney", "spearce",                 formats.parsedate("12/02/1981"), occupation.singer, "", true));         add(new celebrity("bill", "clinton", formats.parsedate("08/19/1946"),                 occupation.politician, "", true));         add(new celebrity("placido", "domingo",                 formats.parsedate("01/21/1941"), occupation.singer, "", true));         add(new celebrity("albert", "einstein",                 formats.parsedate("03/14/1879"), occupation.scientist, "", true));         add(new celebrity("ernest", "hemingway",                 formats.parsedate("07/21/1899"), occupation.writer, "", true));         add(new celebrity("luciano", "pavarotti",                 formats.parsedate("10/12/1935"), occupation.singer, "", true));         add(new celebrity("ronald", "reagan", formats.parsedate("02/06/1911"),                 occupation.politician, "", true));         add(new celebrity("pablo", "picasso", formats.parsedate("10/25/1881"),                 occupation.artist, "", true));         add(new celebrity("blaise", "pascal", formats.parsedate("06/19/1623"),                 occupation.scientist, "", true));         add(new celebrity("isaac", "newton", formats.parsedate("01/04/1643"),                 occupation.scientist, "", true));         add(new celebrity("antonio", "vivaldi",                 formats.parsedate("03/04/1678"), occupation.composer, "", true));         add(new celebrity("niccolo", "paganini",                 formats.parsedate("10/27/1782"), occupation.musician, "", true));         add(new celebrity("johannes", "kepler",                 formats.parsedate("12/27/1571"), occupation.scientist, "", true));         add(new celebrity("franz", "kafka", formats.parsedate("07/03/1883"),                 occupation.writer, "", true));         add(new celebrity("george", "gershwin",                 formats.parsedate("09/26/1898"), occupation.composer, "", true));     }      public int count() {         return getall().size();     }  } 

your project seems have no jpa implementations in classpath. try adding eclipse-jpa following instructions in http://search.maven.org/#artifactdetails%7corg.eclipse.persistence%7corg.eclipse.persistence.jpa%7c2.5.1%7cjar.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -