You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jesse <je...@hotmail.com> on 2011/10/16 21:54:29 UTC

Problems using JPA with 5.3

Hi, I've run in to a couple of JPA related issues that are keeping me from
moving to 5.3.  My app previously worked fine with tynamo jpa, but now
throws eclipselink exceptions and won't start with Tapestry 5.3
(5.3-beta-22).

My app works great with tynamo JPA, tynamo resteasy, eclipselink (2.2.1),
and Tapestry 5.2.6.  I had to do one small hack due to the fact that the
tynamo code relies on Defense.  No big deal though, and it's all working.  

I've tried to switch to 5.3, and I believe I have everything set up
correctly (obviously I've removed the tynamo jpa dependency from my pom).  I
don't know if this is important or not, but my entities are not
auto-discovered, but rather explicitly listed in persistence.xml (the
package name is not entities, but I would change this if I got everything
working).  

I now have the following issues

1) I can't start my application due to errors from Eclipselink.  Here's the
important parts:

Exception [EclipseLink-60] (Eclipse Persistence Services -
2.2.1.v20110722-r9776):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_set_section_vh] or
[_persistence_get_section_vh] is not defined in the object
[com.stellalingua.app.entity.MyEntity].
Internal Exception: java.lang.NoSuchMethodException:
com.stellalingua.app.entity.MyEntity._persistence_get_section_vh()
Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[section]
Descriptor: RelationalDescriptor(com.stellalingua.app.entity.MyEntity--> [])

Exception [EclipseLink-218] (Eclipse Persistence Services -
2.2.1.v20110722-r9776):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: A NullPointerException would have occurred accessing
a non-existent weaved _vh_ method [_persistence_get_section_vh].  The class
was not weaved properly - for EE deployments, check the module order in the
application.xml deployment descriptor and verify that the module containing
the persistence unit is ahead of any other module that uses it.

2) To even get this far, I had to change the name used for my data source in
persistence.xml even though I did not actually change the name of the data
source in jetty.  Minor, but still odd.

I'd really like to switch to 5.3, but can't because of this.  Unfortunately,
also tynamo jpa seems to not work with tapestry 5.3.



--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6898469.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I don't see anything weird with your configuration.
I do not have adviseTransactionally() method in my code,
and I am using Glassfish, so no EclipseLink or javax.persistence in my pom.xml,
and JPA stuff works perfectly.

On Oct 19, 2011, at 9:58 PM, jesse wrote:

> So here's my configuration (though there's not much to it):
> 
> In addition to the T5 and tapestry-jpa dependencies in my pom, I also have
> these:
> 
> 
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>javax.persistence</artifactId>
>            <version>2.0.3</version>
>        </dependency>
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>eclipselink</artifactId>
>            <version>2.2.1</version>
>        </dependency>
> 
> I haven't changed my persistence.xml from when it was working fine with
> tynamo (other than as I mentioned, needing to change the name of my
> datasrouce for some reason).  Located on my classpath in
> src/main/resources/META-INF:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
>    <persistence-unit name="stellaPeristenceUnit" transaction-type="JTA">
>        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>        <jta-data-source>jdbc/mypool</jta-data-source>
>        <class>com.mydomain.app.entity.OneOfMyEntities</class>
>        <class>com.mydomain.app.entity.AnotherOneOfMyEntities</class>
>        <properties>
>            <property name="eclipselink.target-database" value="MySQL" />
>            <property name="eclipselink.cache.shared.default"
> value="${tapestry.production-mode}"/>
>        </properties>
>    </persistence-unit>
> </persistence>
> 
> Then:
> 
> I changed all of my import statements to use @CommitAfter from tapestry-jpa
> instead of tynamo (note that I have of course removed the dependency for
> tynamo from my pom)
> 
> And I add transaction advice in my AppModule like so:
> 
>    @Match({"*DAO", "*DAOImpl"})
>    public static void adviseTransactionally(JpaTransactionAdvisor advisor,
> MethodAdviceReceiver receiver) {
>        advisor.addTransactionCommitAdvice(receiver);
>    }
> 
> What else is there to it?  Am I missing something?  I'm not providing code
> from my entities here, but I know that they are not the problem because as
> I've already stated this project works great with tynamo's implementation of
> tapestry-jpa and the same persistence.xml.  My entities are somewhat
> complicated, use inheritance, and have lazy loaded one to many and many to
> many relationships... but obviously this should all just work, no?
> 
> If it is indeed problems with my configuration, it would be great to get
> some help.  If it is a bug in T5 I would love to hear that it will be looked
> into because I would HATE to get left behind and stuck with 5.2.6!
> 
> 
> 
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6911216.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Are you using single or multiple datasources in persistence.xml?
Are you putting your entity classes in entities package?

tapestry-jpa is more sensitive about these thing then Tynamo is.

On Oct 22, 2011, at 6:54 AM, Dimitris Zenios wrote:

> there regarding weaving.So there must be something else.Maybe igor


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


Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
Jesse i have looked at tynamo-jpa source code and there is nothing in
there regarding weaving.So there must be something else.Maybe igor
(Creator of tapestry-jpa) can help us.

On Sat, Oct 22, 2011 at 6:21 AM, jesse <je...@hotmail.com> wrote:
> Maybe tynamo does something to get weaving working that tapestry-jpa doesn't
> do?
>
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6919297.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by Igor Drobiazko <ig...@gmail.com>.
No, neither tapestry-jpa nor tynamo-jpa have special logic for weaving.

Please check out the weaving section here:

http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Weaving

Looks like you need to configure EclipseLink weaving.

On Sat, Oct 22, 2011 at 5:21 AM, jesse <je...@hotmail.com> wrote:

> Maybe tynamo does something to get weaving working that tapestry-jpa
> doesn't
> do?
>
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6919297.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Maybe tynamo does something to get weaving working that tapestry-jpa doesn't
do?

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6919297.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Nope, still cant get around it.  This is part of the error I get 

"The class was not weaved properly - for EE deployments, check the module
order in the application.xml deployment descriptor and verify that the
module containing the persistence unit is ahead of any other module that
uses it."

Does that mean anything to anyone?

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6919287.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
Jesse.Did you manage to find the cause of the problem?From the bug
that you reported there is nothing that indicated that its t5 fault.

On Thu, Oct 20, 2011 at 10:29 PM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> I don't understand what this has anything to do with Tapestry.
> Doesn't seem like Tapestry  bug at all.
>
> On Oct 20, 2011, at 3:09 PM, jesse wrote:
>
>> Here's some explanation about this from eclipselink:
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=323403
>>
>> Can a commiter please tell me how and where I can report a T5 bug?
>
>
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I don't understand what this has anything to do with Tapestry.
Doesn't seem like Tapestry  bug at all.

On Oct 20, 2011, at 3:09 PM, jesse wrote:

> Here's some explanation about this from eclipselink:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=323403
> 
> Can a commiter please tell me how and where I can report a T5 bug?


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


Re: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Here's some explanation about this from eclipselink:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=323403

Can a commiter please tell me how and where I can report a T5 bug?

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6914456.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I am running inside Glassfish (3.1.1) and everything works 100%,
including weaving.

On Oct 20, 2011, at 1:05 PM, Dimitris Zenios wrote:

> I tried using eclipselink with tapestry-jpa and i had the same errors
> as you with jetty.I though that the problem was that i was not doing
> weaving so i stopped there and revert back to hibernate.If what you
> are saying is correct (When you run your app in a j2ee container (like
> tomcat and jetty, both of which I'm using) you don't need to do
> anything for weaving to work) then it should work.Btw if you find a
> solution please post it on the list


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


Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
I tried using eclipselink with tapestry-jpa and i had the same errors
as you with jetty.I though that the problem was that i was not doing
weaving so i stopped there and revert back to hibernate.If what you
are saying is correct (When you run your app in a j2ee container (like
tomcat and jetty, both of which I'm using) you don't need to do
anything for weaving to work) then it should work.Btw if you find a
solution please post it on the list

On Thu, Oct 20, 2011 at 6:51 PM, jesse <je...@hotmail.com> wrote:
> I really appreciate your quick response, and thanks for trying to help!
>
> Yes, my app uses weaving - otherwise it wouldn't work with lazy loaded
> entities.  Eclipselink uses weaving by default.  When you run your app in a
> j2ee container (like tomcat and jetty, both of which I'm using) you don't
> need to do anything for weaving to work.  You don't need to use a plugin in
> your pom to do the weaving at build time.
>
> It's totally possible that I'm missing something here but this app works
> fine with tapestry 5.2.6 and tynamo's implementation of tapestry-jpa, which
> is why I'm wondering if there is a bug in the new tapestry-jpa module.
>
>
>
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6913446.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
I really appreciate your quick response, and thanks for trying to help!

Yes, my app uses weaving - otherwise it wouldn't work with lazy loaded
entities.  Eclipselink uses weaving by default.  When you run your app in a
j2ee container (like tomcat and jetty, both of which I'm using) you don't
need to do anything for weaving to work.  You don't need to use a plugin in
your pom to do the weaving at build time.

It's totally possible that I'm missing something here but this app works
fine with tapestry 5.2.6 and tynamo's implementation of tapestry-jpa, which
is why I'm wondering if there is a bug in the new tapestry-jpa module. 



--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6913446.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
Jesse most probably t5 is not doing anything.Are you doing static
weaving?And if yes can you post maven plug in that weaves your
classes?Maybe you are not doing weaving at all.Thats why eclipselink
complains

On Thu, Oct 20, 2011 at 6:36 PM, jesse <je...@hotmail.com> wrote:
> Yes, I agree that the problem is with weaving, but the question I have is:
> what in T5 is causing eclipselink to have the problem with weaving.
>
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6913386.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Yes, I agree that the problem is with weaving, but the question I have is:
what in T5 is causing eclipselink to have the problem with weaving.  

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6913386.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
Jess i think you problem is with weaving.Try adding <property
name="eclipselink.weaving" value="false" /> in your persistence.xml
and see if it works.Have in mind though that disabling weaving is not
a good option.but you can try just to see if this is the problem

On Thu, Oct 20, 2011 at 11:25 AM, Igor Drobiazko
<ig...@gmail.com> wrote:
> Might it be a Glassfish issue? Check this out:
> http://java.net/jira/browse/GLASSFISH-13688
> I would also use the 2.0 as persistence version. Apart from that you are
> using a tapestry symbol inside persistence.xml. This is not going to work.
>
> On Thu, Oct 20, 2011 at 3:58 AM, jesse <je...@hotmail.com> wrote:
>
>> So here's my configuration (though there's not much to it):
>>
>> In addition to the T5 and tapestry-jpa dependencies in my pom, I also have
>> these:
>>
>>
>>        <dependency>
>>            <groupId>org.eclipse.persistence</groupId>
>>            <artifactId>javax.persistence</artifactId>
>>            <version>2.0.3</version>
>>        </dependency>
>>        <dependency>
>>            <groupId>org.eclipse.persistence</groupId>
>>            <artifactId>eclipselink</artifactId>
>>            <version>2.2.1</version>
>>        </dependency>
>>
>> I haven't changed my persistence.xml from when it was working fine with
>> tynamo (other than as I mentioned, needing to change the name of my
>> datasrouce for some reason).  Located on my classpath in
>> src/main/resources/META-INF:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
>>    <persistence-unit name="stellaPeristenceUnit" transaction-type="JTA">
>>        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>>        <jta-data-source>jdbc/mypool</jta-data-source>
>>        <class>com.mydomain.app.entity.OneOfMyEntities</class>
>>        <class>com.mydomain.app.entity.AnotherOneOfMyEntities</class>
>>        <properties>
>>            <property name="eclipselink.target-database" value="MySQL" />
>>            <property name="eclipselink.cache.shared.default"
>> value="${tapestry.production-mode}"/>
>>        </properties>
>>    </persistence-unit>
>> </persistence>
>>
>> Then:
>>
>> I changed all of my import statements to use @CommitAfter from tapestry-jpa
>> instead of tynamo (note that I have of course removed the dependency for
>> tynamo from my pom)
>>
>> And I add transaction advice in my AppModule like so:
>>
>>    @Match({"*DAO", "*DAOImpl"})
>>    public static void adviseTransactionally(JpaTransactionAdvisor advisor,
>> MethodAdviceReceiver receiver) {
>>        advisor.addTransactionCommitAdvice(receiver);
>>    }
>>
>> What else is there to it?  Am I missing something?  I'm not providing code
>> from my entities here, but I know that they are not the problem because as
>> I've already stated this project works great with tynamo's implementation
>> of
>> tapestry-jpa and the same persistence.xml.  My entities are somewhat
>> complicated, use inheritance, and have lazy loaded one to many and many to
>> many relationships... but obviously this should all just work, no?
>>
>> If it is indeed problems with my configuration, it would be great to get
>> some help.  If it is a bug in T5 I would love to hear that it will be
>> looked
>> into because I would HATE to get left behind and stuck with 5.2.6!
>>
>>
>>
>> --
>> View this message in context:
>> http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6911216.html
>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>

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


Re: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Thanks for the suggestion but the symbol in my persistence.xml gets replaced
by mvn when it filters my resources.  I've set it up that way in my pom, and
as I've said previously, this works fine using tynamo jpa, so if it's a
problem with my persistence.xml it's not going to be an obvious one like
that.

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6913373.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Igor Drobiazko <ig...@gmail.com>.
Might it be a Glassfish issue? Check this out:
http://java.net/jira/browse/GLASSFISH-13688
I would also use the 2.0 as persistence version. Apart from that you are
using a tapestry symbol inside persistence.xml. This is not going to work.

On Thu, Oct 20, 2011 at 3:58 AM, jesse <je...@hotmail.com> wrote:

> So here's my configuration (though there's not much to it):
>
> In addition to the T5 and tapestry-jpa dependencies in my pom, I also have
> these:
>
>
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>javax.persistence</artifactId>
>            <version>2.0.3</version>
>        </dependency>
>        <dependency>
>            <groupId>org.eclipse.persistence</groupId>
>            <artifactId>eclipselink</artifactId>
>            <version>2.2.1</version>
>        </dependency>
>
> I haven't changed my persistence.xml from when it was working fine with
> tynamo (other than as I mentioned, needing to change the name of my
> datasrouce for some reason).  Located on my classpath in
> src/main/resources/META-INF:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
>    <persistence-unit name="stellaPeristenceUnit" transaction-type="JTA">
>        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>        <jta-data-source>jdbc/mypool</jta-data-source>
>        <class>com.mydomain.app.entity.OneOfMyEntities</class>
>        <class>com.mydomain.app.entity.AnotherOneOfMyEntities</class>
>        <properties>
>            <property name="eclipselink.target-database" value="MySQL" />
>            <property name="eclipselink.cache.shared.default"
> value="${tapestry.production-mode}"/>
>        </properties>
>    </persistence-unit>
> </persistence>
>
> Then:
>
> I changed all of my import statements to use @CommitAfter from tapestry-jpa
> instead of tynamo (note that I have of course removed the dependency for
> tynamo from my pom)
>
> And I add transaction advice in my AppModule like so:
>
>    @Match({"*DAO", "*DAOImpl"})
>    public static void adviseTransactionally(JpaTransactionAdvisor advisor,
> MethodAdviceReceiver receiver) {
>        advisor.addTransactionCommitAdvice(receiver);
>    }
>
> What else is there to it?  Am I missing something?  I'm not providing code
> from my entities here, but I know that they are not the problem because as
> I've already stated this project works great with tynamo's implementation
> of
> tapestry-jpa and the same persistence.xml.  My entities are somewhat
> complicated, use inheritance, and have lazy loaded one to many and many to
> many relationships... but obviously this should all just work, no?
>
> If it is indeed problems with my configuration, it would be great to get
> some help.  If it is a bug in T5 I would love to hear that it will be
> looked
> into because I would HATE to get left behind and stuck with 5.2.6!
>
>
>
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6911216.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
So here's my configuration (though there's not much to it):

In addition to the T5 and tapestry-jpa dependencies in my pom, I also have
these:


        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.2.1</version>
        </dependency>

I haven't changed my persistence.xml from when it was working fine with
tynamo (other than as I mentioned, needing to change the name of my
datasrouce for some reason).  Located on my classpath in
src/main/resources/META-INF:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
    <persistence-unit name="stellaPeristenceUnit" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/mypool</jta-data-source>
        <class>com.mydomain.app.entity.OneOfMyEntities</class>
        <class>com.mydomain.app.entity.AnotherOneOfMyEntities</class>
        <properties>
            <property name="eclipselink.target-database" value="MySQL" />
            <property name="eclipselink.cache.shared.default"
value="${tapestry.production-mode}"/>
        </properties>
    </persistence-unit>
</persistence>

Then:

I changed all of my import statements to use @CommitAfter from tapestry-jpa
instead of tynamo (note that I have of course removed the dependency for
tynamo from my pom)

And I add transaction advice in my AppModule like so:

    @Match({"*DAO", "*DAOImpl"})
    public static void adviseTransactionally(JpaTransactionAdvisor advisor,
MethodAdviceReceiver receiver) {
        advisor.addTransactionCommitAdvice(receiver);
    }

What else is there to it?  Am I missing something?  I'm not providing code
from my entities here, but I know that they are not the problem because as
I've already stated this project works great with tynamo's implementation of
tapestry-jpa and the same persistence.xml.  My entities are somewhat
complicated, use inheritance, and have lazy loaded one to many and many to
many relationships... but obviously this should all just work, no?

If it is indeed problems with my configuration, it would be great to get
some help.  If it is a bug in T5 I would love to hear that it will be looked
into because I would HATE to get left behind and stuck with 5.2.6!



--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6911216.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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


Re: Problems using JPA with 5.3

Posted by Igor Drobiazko <ig...@gmail.com>.
There must be something wrong either with your configuration or your
environment. You need to provide more details in order to get help.

On Sun, Oct 16, 2011 at 9:54 PM, jesse <je...@hotmail.com> wrote:

> Hi, I've run in to a couple of JPA related issues that are keeping me from
> moving to 5.3.  My app previously worked fine with tynamo jpa, but now
> throws eclipselink exceptions and won't start with Tapestry 5.3
> (5.3-beta-22).
>
> My app works great with tynamo JPA, tynamo resteasy, eclipselink (2.2.1),
> and Tapestry 5.2.6.  I had to do one small hack due to the fact that the
> tynamo code relies on Defense.  No big deal though, and it's all working.
>
> I've tried to switch to 5.3, and I believe I have everything set up
> correctly (obviously I've removed the tynamo jpa dependency from my pom).
>  I
> don't know if this is important or not, but my entities are not
> auto-discovered, but rather explicitly listed in persistence.xml (the
> package name is not entities, but I would change this if I got everything
> working).
>
> I now have the following issues
>
> 1) I can't start my application due to errors from Eclipselink.  Here's the
> important parts:
>
> Exception [EclipseLink-60] (Eclipse Persistence Services -
> 2.2.1.v20110722-r9776):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The method [_persistence_set_section_vh] or
> [_persistence_get_section_vh] is not defined in the object
> [com.stellalingua.app.entity.MyEntity].
> Internal Exception: java.lang.NoSuchMethodException:
> com.stellalingua.app.entity.MyEntity._persistence_get_section_vh()
> Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[section]
> Descriptor: RelationalDescriptor(com.stellalingua.app.entity.MyEntity-->
> [])
>
> Exception [EclipseLink-218] (Eclipse Persistence Services -
> 2.2.1.v20110722-r9776):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: A NullPointerException would have occurred accessing
> a non-existent weaved _vh_ method [_persistence_get_section_vh].  The class
> was not weaved properly - for EE deployments, check the module order in the
> application.xml deployment descriptor and verify that the module containing
> the persistence unit is ahead of any other module that uses it.
>
> 2) To even get this far, I had to change the name used for my data source
> in
> persistence.xml even though I did not actually change the name of the data
> source in jetty.  Minor, but still odd.
>
> I'd really like to switch to 5.3, but can't because of this.
>  Unfortunately,
> also tynamo jpa seems to not work with tapestry 5.3.
>
>
>
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6898469.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: Problems using JPA with 5.3

Posted by Dimitris Zenios <di...@gmail.com>.
Jesse i am using tapestry-jpa with hibernate and it works great except
the problem of value encoder.Maybe you did something wrong in the
persistence.xml or you didn't place it in the correct location.

On Mon, Oct 17, 2011 at 8:07 PM, jesse <je...@hotmail.com> wrote:
> Thanks Thiago,
>
> I have read the documentation on the new JPA stuff in Tapestry.  I'm pretty
> sure I have it set up correctly.  I did everything the documentation
> suggests and I'm still having the issue.  The only reason I mentioned tynamo
> was just to make it clear that I did at one point have JPA working in my
> project, so the problem likely isn't with eclipselink or my persistence.xml
> configuration.
>
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6901440.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Problems using JPA with 5.3

Posted by jesse <je...@hotmail.com>.
Thanks Thiago,

I have read the documentation on the new JPA stuff in Tapestry.  I'm pretty
sure I have it set up correctly.  I did everything the documentation
suggests and I'm still having the issue.  The only reason I mentioned tynamo
was just to make it clear that I did at one point have JPA working in my
project, so the problem likely isn't with eclipselink or my persistence.xml
configuration.

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6901440.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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