Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 views
in Technique[技术] by (71.8m points)

jdbc __pm postfix and glassfish deployment descriptor

Created an Enterprise APllication with EAR (EJB+WEB Modules) . EJB Module coming with glassfish-resources.xml contanining the db resourse as jdbc/db_ds and these jndi is referred by persistence.xml file. I read : another issue about but ,

I am asking , it is possible to get GF to auto create Jdbc resourse and pool without to configure it from asadmin or web console admin ? In other words , how to configure glassfish_resurces.xml to create resource when EAR is deployed ? My tring is below but doesn't work because deployer complain 'Invalid resource : jdbc/hb_ds__pm of jdbc connection pools.'

my glassfish-resource.xml :

<?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-resource enabled="true" jndi-name="jdbc/hb_ds" object-type="user" pool-name="hb_pool">
<description/>

</jdbc-resource>
<jdbc-connection-pool name="hb_pool"  allow-non-component-callers="false" associate-with- thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="URL" value="jdbc:mysql://localhost:3306/hb?zeroDateTimeBehavior=CONVERT_TO_NULL&amp;serverTimezone=UTC"/>
<property name="User" value="HB"/>
<property name="Password" value="hb"/>
</jdbc-connection-pool>
</resources>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...