无法使用glassfish-resources.xml在Glassfish v3.1.2中创建JMS资源 [英] unable create JMS resources in Glassfish v3.1.2 using glassfish-resources.xml
问题描述
我正在尝试在Glassfish上执行的EJB3的第4章中的示例服务器.我将下面的glassfish-resources.xml(使用netbeans创建)打包在ear包的META-INF目录下.但是,耳朵无法部署,并显示错误未创建JMS资源:ShippingRequestQueue".请帮助我解决问题.
I am trying out the example on chapter4 of EJB3 in Action on Glassfish server. I have packaged the below glassfish-resources.xml (created with netbeans) under the META-INF directory of the ear package. However the ear fails to deploy with the error "JMS resource not created : ShippingRequestQueue". Please help me fix the issue.
更新:我能够从管理控制台部署资源xml文件.但是它不会与耳文件一起部署.
Update: I am able to deploy resources xml file from admin console. But it doesn't get deployed along with the ear file.
<?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>
<admin-object-resource enabled="true"
jndi-name="jms/ShippingRequestQueue" object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description />
<property name="Name" value="ShippingRequestQueue"></property>
</admin-object-resource>
<connector-resource enabled="true" jndi-name="jms/ConnectionFactory"
object-type="user" pool-name="jms/ConnectionFactory">
<description />
</connector-resource>
<connector-connection-pool
associate-with-thread="false" connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-definition-name="javax.jms.ConnectionFactory"
connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="false" lazy-connection-association="false"
lazy-connection-enlistment="false" match-connections="true"
max-connection-usage-count="0" max-pool-size="32"
max-wait-time-in-millis="60000" name="jms/ConnectionFactory"
pool-resize-quantity="2" resource-adapter-name="jmsra"
steady-pool-size="8" validate-atmost-once-period-in-seconds="0" />
</resources>
推荐答案
您缺少实际创建JMS队列的admin-object-resource配置. 您当前的配置仅创建连接工厂. 您可以尝试修改后的配置,例如:
You are missing the admin-object-resource config that actually creates the JMS Queue. Your current config only creates the connection factory. You can try a modified configuration such as this:
<admin-object-resource res-adapter="jmsra" res-type="javax.jms.Queue" description="shipping request queue" jndi-name="jms/ShippingRequestQueue">
<property name="Name" value="ShippingRequestQueue" />
</admin-object-resource>
<connector-resource enabled="true" jndi-name="jms/ShippingRequestConnectionPool" object-type="user" pool-name="jms/ShippingRequestConnectionPool">
<description/>
</connector-resource>
<connector-connection-pool associate-with-thread="false" connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10" connection-definition-name="javax.jms.QueueConnectionFactory"
connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0"
fail-all-connections="false" idle-timeout-in-seconds="300"
is-connection-validation-required="false" lazy-connection-association="false"
lazy-connection-enlistment="false" match-connections="true"
max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000"
name="jms/ShippingRequestConnectionPool" pool-resize-quantity="2"
resource-adapter-name="jmsra" steady-pool-size="8"
validate-atmost-once-period-in-seconds="0"/>
这篇关于无法使用glassfish-resources.xml在Glassfish v3.1.2中创建JMS资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!