這裏是我的GlassFish-resources.xml中:無法創建連接池和數據源在GlassFish中的H2數據庫
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool res-type="javax.sql.DataSource"
datasource-classname="org.h2.jdbcx.JdbcDataSource"
pool-resize-quantity="1" max-pool-size="5" steady-pool-size="0"
statement-timeout-in-seconds="60" name="jdbc/test_pool">
<property name="driverClass" value="org.h2.Driver"/>
<property name="URL" value="jdbc:h2:D:\test\test;IFEXISTS=TRUE;AUTO_SERVER=TRUE"/>
<property name="User" value="root"/>
<property name="Password" value="root"/>
</jdbc-connection-pool>
<jdbc-resource object-type="system-all" enabled="true" jndi-name="jdbc/test" pool-name="jdbc/test_pool" />
</resources>
通過m2eclipse的Maven的GlassFish的插件部署戰爭到服務器,當我做我的asadmin> list-jdbc-connection-pools
後連接池不在列表中。我真的迷失了
編輯。
工作正常,由於某種原因,
Glassfish的3.1.2(建立23)
的pom.xml:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.1.1</version>
<type>maven-plugin</type>
</dependency>
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>d:\glassfish3</glassfishDirectory>
<user>admin</user>
<passwordFile>d:\password.txt</passwordFile>
<debug>true</debug>
<echo>true</echo>
<domain>
<name>domain1</name>
<adminPort>4848</adminPort> <!-- mandatory for mvn glassfish:deploy -->
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
</component>
</components>
</configuration>
</plugin>
EDIT2 問題解決了。感謝大家!!!
您是否通過管理控制檯看到連接池? – 2012-04-05 17:35:40
你的意思是GUI?不,只有TimerPool和DerbyPool – bunnyjesse112 2012-04-05 17:36:49
你使用正確的maven插件版本作爲你的GF服務器嗎? XML描述符名稱/序言最近從sun *更改爲glassfish *。 – 2012-04-05 17:44:10