users@glassfish.java.net

Error deploying web app using JPA

From: <glassfish_at_javadesktop.org>
Date: Sat, 30 Jun 2007 23:16:10 PDT

Hi, I'm trying to deploy a web app which is supposed to use a Glassfish managed connection pool, but am getting this error message

[code]
DPL8011: autodeployment failure while deploying the application : Deployment Error -- The persistence-context-ref-name [StocksBean/em] in module
[/var/lib/java/glassfish/domains/domain1/applications/j2ee-modules/StocksWeb] resolves to a persistence unit
called [stockfoo] which is of type RESOURCE_LOCAL.
Only persistence units with transaction type JTA can be used as a container managed entity manager. Please verify your application.
"|#]
[/code]

My persistence.xml file looks like

[code]
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence">
        <persistence-unit name="stockfoo" transaction-type="JTA">
                <jta-data-source>jdbc/stockfoo</jta-data-source>
                <exclude-unlisted-classes>false</exclude-unlisted-classes>
                <properties>
                        <property name="toplink.logging.level" value="FINEST" />
                </properties>
        </persistence-unit>
</persistence>
[/code]

I have checked that the JDBC resource is created on the server, and that the server is pingable from the connection pool interface. What am I doing wrong here?
[Message sent by forum member 'fawad' (fawad)]

http://forums.java.net/jive/thread.jspa?messageID=224817