You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by "larson.micah" <la...@gmail.com> on 2012/12/01 21:39:37 UTC

Persistence configuration

I'm trying to create a simple Java EE web app for a sample restaurant
website. I'm using JPA for persistence. I'm using Geronimo, OpenJPA, and
Derby. In Geronimo's console, I set up a database, RestaurantDB, and a
database pool, jdbc/RestaurantPool, that refers to RestaurantDB.

In my project, I configured web.xml and geronimo-web.xml and persistence.xml
to use those resources.

web.xml (excerpt):


geronimo-web.xml (excerpt):


persistence.xml (excerpt):


I don't want use an EJB for this project, if possible, so my understanding
is that I want a non-jta-data-source and a transaction-type of
RESOURCE_LOCAL.

When I try to deploy the project (from Eclipse, wrapped in an EAR), I get
the following error:


This seems to indicate that I did something wrong in web.xml or
geronimo-web.xml, but I can't figure out what. Please help.

Disclaimers: As you can tell, this is my first web project. If this isn't
the proper forum for this question, please direct me to a more appropriate
one. If you need more information, please ask -- I don't have a good sense
yet of what is relevant.

Thank you,

Micah





--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Persistence-configuration-tp3986115.html
Sent from the Users mailing list archive at Nabble.com.

Re: Persistence configuration

Posted by "larson.micah" <la...@gmail.com>.
Ivan Xu wrote
> the value for non-jta-data-source in persistence.xml should be
> jdbc/RestaurantPool

Thank you, that made a difference; now I'm getting a different error:


I fixed this in non-EE projects by including derby jars on the classpath and
adding a "properties" section to the persistence unit in persistence.xml. I
think Geronimo includes the drivers I need, though, and I was under the
impression that the <non-jta-data-source> used the configuration in Geronimo
and thus didn't need explicit properties defined in persistence.xml.




--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Persistence-configuration-tp3986115p3986123.html
Sent from the Users mailing list archive at Nabble.com.

Re: Persistence configuration

Posted by Ivan <xh...@gmail.com>.
Think that the value for non-jta-data-source in persistence.xml should
be jdbc/RestaurantPool,
as the resource-ref in web.xml has no special relation with that.

Hope it helps !

2012/12/2 larson.micah <la...@gmail.com>

> I'm trying to create a simple Java EE web app for a sample restaurant
> website. I'm using JPA for persistence. I'm using Geronimo, OpenJPA, and
> Derby. In Geronimo's console, I set up a database, RestaurantDB, and a
> database pool, jdbc/RestaurantPool, that refers to RestaurantDB.
>
> In my project, I configured web.xml and geronimo-web.xml and
> persistence.xml
> to use those resources.
>
> web.xml (excerpt):
>
>
> geronimo-web.xml (excerpt):
>
>
> persistence.xml (excerpt):
>
>
> I don't want use an EJB for this project, if possible, so my understanding
> is that I want a non-jta-data-source and a transaction-type of
> RESOURCE_LOCAL.
>
> When I try to deploy the project (from Eclipse, wrapped in an EAR), I get
> the following error:
>
>
> This seems to indicate that I did something wrong in web.xml or
> geronimo-web.xml, but I can't figure out what. Please help.
>
> Disclaimers: As you can tell, this is my first web project. If this isn't
> the proper forum for this question, please direct me to a more appropriate
> one. If you need more information, please ask -- I don't have a good sense
> yet of what is relevant.
>
> Thank you,
>
> Micah
>
>
>
>
>
> --
> View this message in context:
> http://apache-geronimo.328035.n3.nabble.com/Persistence-configuration-tp3986115.html
> Sent from the Users mailing list archive at Nabble.com.
>



-- 
Ivan