You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bdumeny <bd...@cvf.fr> on 2009/08/14 14:42:34 UTC
[T5] Does T5 work with JPA ?
Hi all!
I try to develop a T5 / jpa application!
All junits tests on my DAOS work but when I try to deploy on tomcat I
still have a "No Persistence provider for EntityManager name ..." error
when I call DAOs.
My persistence.xml seams to be at good place...
So my question is : Is it possible that T5 don't work with jpa ?
thx all!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by Scot Mcphee <sc...@gmail.com>.
2009/8/15 bdumeny <bd...@cvf.fr>:
> There is no specified scope for jpa dependencies...
And the hibernate.jar is definitely in the generated WAR file?
Otherwise try scope 'compile'. Obviously the javax.persistence jar is.
> If only someone tells me that it's possible...
> I haven't found any example of use t5/jpa
Well, as I said, I've never tried, I'm usually happy to directly use
hibernate rather than bother with JPA. That stack trace has me
stumped. Can you use hibernate directly?
scot
--
let x=x - http://crazymcphee.net/x/
xray dubs - http://autonomous.org/music/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by bdumeny <bd...@cvf.fr>.
There is no specified scope for jpa dependencies...
If only someone tells me that it's possible...
I haven't found any example of use t5/jpa
Message :
org.apache.tapestry5.runtime.ComponentEventException
No Persistence provider for EntityManager named MY_APP
Stack trace
* javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)
* javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
* fr.bd.pages.Search.onSuccess(Search.java:128)
* fr.bd.pages.Search.dispatchComponentEvent(Search.java)
* org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:886)
* org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1059)
* org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:228)
* org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:408)
* org.apache.tapestry5.corelib.components.Form$onAction$invocation_123194ee67c.invokeAdvisedMethod(Form$onAction$invocation_123194ee67c.java)
* org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71)
* org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:45)
* org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54)
* org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80)
* org.apache.tapestry5.corelib.components.Form.onAction(Form.java)
* org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java)
* org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:894)
* org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1059)
* org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:68)
* org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
* org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
* org.apache.tapestry5.services.TapestryModule$44.handle(TapestryModule.java:2105)
* org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:127)
* org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029)
* fr.bd.services.AppModule$1.service(AppModule.java:105)
* org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
* org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
* org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621)
* org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611)
* org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
* org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
* org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
* org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83)
* org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
* org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1007)
* org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
* org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:179)
* org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
* org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
* org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
* org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
* org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
* org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
* org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
* org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
* org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
* org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
* org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
* org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
* org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
* java.lang.Thread.run(Thread.java:619)
Thx Scot
Scot Mcphee a écrit :
> 2009/8/15 bdumeny <bd...@cvf.fr>:
>
>> Yes, all included in my pom.xml.
>>
>> If I haven't dependencies my tests wouldn't work during a mvn install...
>>
>
> well not strictly true seeing as you could could have it in a "test"
> scope (e.g. something I often do with the HSQL classes). sorry i had
> to ask the obvious question. it's been a while since I tried to use
> hibernate in a pure JPA mode, and that wasn't with tapestry. I usually
> go straight for hibernate-native configuration. anyway is there a
> more comprehensive stack trace?
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by Scot Mcphee <sc...@gmail.com>.
2009/8/15 bdumeny <bd...@cvf.fr>:
> Yes, all included in my pom.xml.
>
> If I haven't dependencies my tests wouldn't work during a mvn install...
well not strictly true seeing as you could could have it in a "test"
scope (e.g. something I often do with the HSQL classes). sorry i had
to ask the obvious question. it's been a while since I tried to use
hibernate in a pure JPA mode, and that wasn't with tapestry. I usually
go straight for hibernate-native configuration. anyway is there a
more comprehensive stack trace?
--
let x=x - http://crazymcphee.net/x/
xray dubs - http://autonomous.org/music/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by bdumeny <bd...@cvf.fr>.
Yes, all included in my pom.xml.
If I haven't dependencies my tests wouldn't work during a mvn install...
Scot Mcphee a écrit :
> Doesn't Tomcat - it being "just" a servlet and JSP engine and not a
> full blown JEE specification implementation - not have any actual JPA
> implementation? Are you including one in your WAR file, e.g.
> Hibernate?
>
> 2009/8/14 bdumeny <bd...@cvf.fr>:
>
>> Thiago H. de Paula Figueiredo a écrit :
>>
>>> Em Fri, 14 Aug 2009 09:42:34 -0300, bdumeny <bd...@cvf.fr> escreveu:
>>>
>>>
>>>> Hi all!
>>>>
>>> Hi!
>>>
>>>
>>>> I try to develop a T5 / jpa application!
>>>> All junits tests on my DAOS work but when I try to deploy on tomcat I
>>>> still have a "No Persistence provider for EntityManager name ..." error when
>>>> I call DAOs.
>>>> My persistence.xml seams to be at good place...
>>>> So my question is : Is it possible that T5 don't work with jpa ?
>>>>
>>> I don't think this is a Tapestry-related issue, as it doesn't touch
>>> anything beside page, component and mixin classes.
>>> This looks like a misplaced persistence.xml or the way you create your
>>> EntityManagers in your web app.
>>>
>>>
>> Missplaced persistence.xml was my first idea, but it's placed in
>> WEB-INF/classes/META-INF/ ..
>>
>> My entity manager factory is static in my DAO :
>>
>> private EntityManagerFactory emFactory =
>> Persistence.createEntityManagerFactory(MY_PERSISTENCE);
>> private EntityManager em;
>>
>> public MyDAOImpl(){
>> try {
>> em = emFactory.createEntityManager();
>> } catch (Exception ex) {
>> ex.printStackTrace();
>> }
>> }
>>
>> and My DAO is injected in my tml Page.
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by Scot Mcphee <sc...@gmail.com>.
Doesn't Tomcat - it being "just" a servlet and JSP engine and not a
full blown JEE specification implementation - not have any actual JPA
implementation? Are you including one in your WAR file, e.g.
Hibernate?
2009/8/14 bdumeny <bd...@cvf.fr>:
> Thiago H. de Paula Figueiredo a écrit :
>>
>> Em Fri, 14 Aug 2009 09:42:34 -0300, bdumeny <bd...@cvf.fr> escreveu:
>>
>>> Hi all!
>>
>> Hi!
>>
>>> I try to develop a T5 / jpa application!
>>> All junits tests on my DAOS work but when I try to deploy on tomcat I
>>> still have a "No Persistence provider for EntityManager name ..." error when
>>> I call DAOs.
>>> My persistence.xml seams to be at good place...
>>> So my question is : Is it possible that T5 don't work with jpa ?
>>
>> I don't think this is a Tapestry-related issue, as it doesn't touch
>> anything beside page, component and mixin classes.
>> This looks like a misplaced persistence.xml or the way you create your
>> EntityManagers in your web app.
>>
>
> Missplaced persistence.xml was my first idea, but it's placed in
> WEB-INF/classes/META-INF/ ..
>
> My entity manager factory is static in my DAO :
>
> private EntityManagerFactory emFactory =
> Persistence.createEntityManagerFactory(MY_PERSISTENCE);
> private EntityManager em;
>
> public MyDAOImpl(){
> try {
> em = emFactory.createEntityManager();
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> }
>
> and My DAO is injected in my tml Page.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
let x=x - http://crazymcphee.net/x/
xray dubs - http://autonomous.org/music/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by bdumeny <bd...@cvf.fr>.
Thiago H. de Paula Figueiredo a écrit :
> Em Fri, 14 Aug 2009 09:42:34 -0300, bdumeny <bd...@cvf.fr> escreveu:
>
>> Hi all!
>
> Hi!
>
>> I try to develop a T5 / jpa application!
>> All junits tests on my DAOS work but when I try to deploy on tomcat I
>> still have a "No Persistence provider for EntityManager name ..."
>> error when I call DAOs.
>> My persistence.xml seams to be at good place...
>> So my question is : Is it possible that T5 don't work with jpa ?
>
> I don't think this is a Tapestry-related issue, as it doesn't touch
> anything beside page, component and mixin classes.
> This looks like a misplaced persistence.xml or the way you create your
> EntityManagers in your web app.
>
Missplaced persistence.xml was my first idea, but it's placed in
WEB-INF/classes/META-INF/ ..
My entity manager factory is static in my DAO :
private EntityManagerFactory emFactory =
Persistence.createEntityManagerFactory(MY_PERSISTENCE);
private EntityManager em;
public MyDAOImpl(){
try {
em = emFactory.createEntityManager();
} catch (Exception ex) {
ex.printStackTrace();
}
}
and My DAO is injected in my tml Page.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Does T5 work with JPA ?
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 14 Aug 2009 09:42:34 -0300, bdumeny <bd...@cvf.fr> escreveu:
> Hi all!
Hi!
> I try to develop a T5 / jpa application!
> All junits tests on my DAOS work but when I try to deploy on tomcat I
> still have a "No Persistence provider for EntityManager name ..." error
> when I call DAOs.
> My persistence.xml seams to be at good place...
> So my question is : Is it possible that T5 don't work with jpa ?
I don't think this is a Tapestry-related issue, as it doesn't touch
anything beside page, component and mixin classes.
This looks like a misplaced persistence.xml or the way you create your
EntityManagers in your web app.
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org