使用 Oracle AQ 队列配置 Web 逻辑 JMS 模块
我测试设置一个可以使用 Oracle AQ JMS 实现的 Web 逻辑服务器,但由于某种原因,我的 WLS 连接池看不到我创建的队列,我可以看到在 Web 逻辑中查找队列的唯一方法是使Web 逻辑数据源连接池使用创建队列的数据库用户的凭据。
我以 admin_user 身份执行了以下操作:
创建队列表
EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table=>'testqueue_table',queue_payload_type=>'sys.aq$_jms_text_message');
创建队列
EXECUTE dbms_aqadm.create_queue(queue_name=>'testqueue', queue_table=>'testqueue_table');
启动队列
EXECUTE dbms_aqadm.start_queue(queue_name=>'testqueue');
授予 CPOOL 用户权限
GRANT aq_user_role TO cpool;
EXECUTE DBMS_AQADM.grant_queue_privilege(privilege=>'ALL', queue_name=>'adming_user.testqueue', grantee=>'cpool',grant_option=>FALSE);
在 Web Logic 中设置 2 个 JDBC 数据源 我在连接到我的数据库的 Web 逻辑中设置了 2 个数据源,两者相同,只是一个使用 cpool 用户,另一个使用 admin_user
创建 JMS 模块< /强> 现在,我使用 JDBC 数据源注册 jms 模块,并连接本地和外部 JDNI 名称。
如果我使用使用 admin_user 的数据源,一切都会正常,并且我部署的应用程序可以在 JNDI 中找到队列。
问题 如果我使用使用 cpool 的数据源,那么它无法在 JNDI 中找到连接池,但永远找不到队列(尽管它适用于 admin_user)。我从 WL 收到以下错误:
Related cause:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testqueue': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Cannot resolve name:Queues/TESTQUEUE
有谁知道为什么 WL 无法解析队列的 JNDI 名称,除非我对数据源使用 admin_user 帐户。
I testing setting up a web logic server which can use an Oracle AQ JMS implementation, but for some reason my WLS connection pool cannot see the queue I have created, the only way I can see the find the queue in web logic is to make the web logic datasource connection pool use the credentials of the DB user who created the queue.
I have done the following as admin_user:
Created a Queue Table
EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table=>'testqueue_table',queue_payload_type=>'sys.aq$_jms_text_message');
Created a Queue
EXECUTE dbms_aqadm.create_queue(queue_name=>'testqueue', queue_table=>'testqueue_table');
Started the Queue
EXECUTE dbms_aqadm.start_queue(queue_name=>'testqueue');
Granted the CPOOL user permissions
GRANT aq_user_role TO cpool;
EXECUTE DBMS_AQADM.grant_queue_privilege(privilege=>'ALL', queue_name=>'adming_user.testqueue', grantee=>'cpool',grant_option=>FALSE);
Set up 2 JDBC DataSources in Web Logic
I set up 2 datasources in web logic which connect to my database, both are identical except that one uses the cpool user and the other uses admin_user
Create JMS Modules
Now I register a jms module with the JDBC DataSources and wire up the local and foreign JDNI names.
If I use the DataSource which uses admin_user everything works fine and my deployed application can find queue in JNDI.
Problem
If I use the data source which uses cpool then it fails finds the connection pool in JNDI but never the Queue (despite the fact it worked for admin_user). I get the following error from WL:
Related cause:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testqueue': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Cannot resolve name:Queues/TESTQUEUE
Does anyone know why WL cannot resolve the JNDI name for the queue unless I use the admin_user account for my datasource.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是我的连接池用户缺少一些授权,以下是需要的:
确保创建目标的用户向连接池用户授予访问权限:
最后在 Web Logic 中,确保通过完整的外部 JNDI 名称引用目标:
The answer was that my connection pool user was missing some grants, the following where required:
Make sure the user who creates the destination grants access to the connection pool user:
Finally in Web Logic make sure to reference the destination by their full foreign JNDI name: