I am using SmartGWT 2.4 (2011.01.05). Trying to get the JPADataSource to work. Application is running on Geronimo 2.2, which manages the database connection pool to a MS SQL 2008 DB.
The server.properties looks like this:
The persistence.xml looks like this:
The problem is, it is not using the <jta-data-source> value to access the DB, instead it is trying to use the values specified in the properties to access the DB using direct JDBC.
The server.properties looks like this:
Code:
webRoot: __AUTODETECT__ sql.defaultDatabase:sqlserver sql.SQLServer.driver:net.sourceforge.jtds.jdbc.Driver project.datasources: $webRoot/ds, $webRoot/shared/ds project.ui: $webRoot/shared/ui project.apps: $webRoot/shared/app jpa.emfProvider:com.isomorphic.jpa.EMFProviderLMT jpa.persistenceUnitName:TestSqlServices RPCManager.enabledBuiltinMethods: *
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="TestServices" transaction-type="JTA"> <jta-data-source>jdts/testDS</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> <property name="openjpa.ConnectionDriverName" value="net.sourceforge.jtds.jdbc.Driver"/> <property name="openjpa.ConnectionURL" value="jdbc:jtds:sqlserver://localhost:1433;DatabaseName=testDB"/> <property name="openjpa.ConnectionUserName" value="sa"/> <property name="openjpa.ConnectionPassword" value="password"/> </properties> </persistence-unit> </persistence>
Comment