Home » Server Options » Streams & AQ » 'Insufficient privileges' enque JMS ObjectMessage to owned by different usr
icon8.gif  'Insufficient privileges' enque JMS ObjectMessage to owned by different usr [message #176057] Tue, 06 June 2006 12:19
niraj@suryainfosys.com
Messages: 1
Registered: June 2006
Location: USA
Junior Member
Getting 'ORA-01031: insufficient privileges' while enqueuing a JMS ObjectMessage to a queue owned by different user

I am having tough time figuring out which privilege is missing here. My environment consists of the following:

- Oracle9i Enterprise Edition Release 9.2.0.5.0 running on Solaris server
- Two queues accessed by JMS client application (JDK 1.4.2.11)
- First Queue FileQueue is for holding JMS MapMessage (Queue Table type AQ$_JMS_MAP_MESSAGE)
- Second Queue CustQueue is for holding JMS ObjectMessage (Queue Table type AQ$_JMS_OBJECT_MESSAGE)
- Both queues are under owned by BLANC_OWNER so the queues are BLANC_OWNER.FILEQUEUE and BLANC_OWNER.CUSTQUEUE
- Both queues have public synonyms
- The oracle database user that uses this application is BLANC_USER

Here is the problem:

There is no problem when my JMS Client app is logged in as BLANC_OWNER,
BUT WHEN MY JMS CLIENT APP IS LOGGED IN AS BLANC_USER THEN:

- When enqueing to or dequeing from FileQueue with a JMSMapMessage, there is no problem
- When enqueing to CustQueue with JMS ObjectMessage, I am getting ORA-01031: insufficient privileges exception.
Here are details of this exception:

oracle.jms.AQjmsException: JMS-204: An error occurred in the AQ JNI layer
at oracle.jms.AQjmsError.throwEx(AQjmsError.java:283)
at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:1164)
at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:585)
at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:416)
at com.tasq.ems.data.xml.MerchantAQPost.execute(MerchantAQPost.java:1019)
........
........
........
[Linked-exception]
oracle.jms.AQjmsException: ORA-01031: insufficient privileges

at oracle.jms.AQjmsObjectMessage.write_blob(AQjmsObjectMessage.java:544)
at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:1111)
at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:585)
at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:416)
at com.tasq.ems.data.xml.MerchantAQPost.execute(MerchantAQPost.java:1019)
........
........
........


I have researched documentation and forums but haven't found a solution. Based on what I read, I tried giving many privileges to BLANC_USER
but nothing is working
. Here are privileges to BLANK_USER:

-- System Object Privileges for BLANC_USER
GRANT CONNECT TO BLANC_USER;
GRANT AQ_USER_ROLE TO BLANC_USER;
GRANT AQ_ADMINISTRATOR_ROLE TO BLANC_USER;
SYS.DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE ( PRIVILEGE => 'DEQUEUE_ANY', GRANTEE => 'BLANC_USER', ADMIN_OPTION => FALSE);
SYS.DBMS_AQADM.GRANT_SYSTEM_PRIVILEGE ( PRIVILEGE => 'ENQUEUE_ANY', GRANTEE => 'BLANC_USER', ADMIN_OPTION => FALSE);

SYS.dbms_aqadm.grant_type_access('BLANC_USER');

-- Object Privileges for BLANC_USER

GRANT EXECUTE ON SYS.AQ$_AGENT TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_DEQUEUE_HISTORY TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_DEQUEUE_HISTORY_T TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_HISTORY TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_NOTIFY_MSG TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_RECIPIENTS TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.AQ$_SUBSCRIBERS TO BLANC_USER WITH GRANT OPTION;
GRANT EXECUTE ON SYS.DBMS_AQ TO BLANC_USER;
GRANT EXECUTE ON SYS.DBMS_AQADM TO BLANC_USER;
GRANT EXECUTE ON SYS.DBMS_AQIN TO BLANC_USER;
GRANT EXECUTE ON SYS.DBMS_AQJMS TO BLANC_USER;
GRANT EXECUTE ON SYS.DBMS_AQJMS_INTERNAL TO BLANC_USER;



Any help or pointers will be deeply appreciated.

Thanks
Previous Topic: Message always in ready state
Next Topic: Message in processed state not deleted from queue
Goto Forum:
  


Current Time: Thu Mar 28 10:21:45 CDT 2024