Schedule_propagation AQ oracle8i multiple_consumers = false
Can anybody please help me -
I want to know if schedule_propagation can be done in oracle 8i where multiple_consumers queue table option is false.
or any other method availabe in oracle 8i for autonatically enqueuing and dequeuing of messages.
thanks.
Hi,
I have also faced the same problem long back. I guess you are
using OCI to dequeue the message from oracle queue.
If you will delete the messages from queue table in oracle this
problem comes.
If you are dequeuing the message using java you wont get such
kind of error.
Solution:
drop all the queues and queue table and create again.
And from then onwards dont delete the message from queue if you
want to remove the messages from the queue simply dequeue those
messages.
Even I think this is a bug with oracle advanced queuing.
best regards
rajeev
Similar Messages
-
Backup/Recovery from web application
Hello guys,
I am using Oracle 9i as DB and Oracle 9iAS for web application server. I want to provide Backup and Recovery functionality to the user via web. I don't know any thing in this regard.
Is it possible that we can take backup and recovery from web application?
Is there any alternative for this function.
any other comments will be appreciated.
Thank you,
Jawed Nazar AliRead this article in order to get an idea about Java Stored Procedures.
Oracle Developer JAVA STORED PROCEDURES
Simplify with Java Stored Procedures
By Kuassi Mensah
Use Java stored procedures to bridge SQL, XML, Java, and J2EE and Web Services.
Stored procedures allow a clean separation of persistence logic that runs in the database tier from business logic that runs in the middle tier. This separation reduces overall application complexity and increases reuse, security, performance, and scalability.
A major obstacle, however, for widespread adoption of stored procedures is the set of various proprietary, database-dependent implementation languages that different database vendors use. The use of Java-based stored procedures fixes this concern. Oracle has implemented ANSI standards that specify the ability to invoke static Java methods from SQL as procedures or functions. This implementation is called simply "Java stored procedures."
In this article, you will learn how Java stored procedures help simplify and increase the performance of your business logic and extend database functionality. I'll show how Oracle enables the use of Java stored procedures within the database. I'll also look at how Java stored procedures access data, and show how to create a basic Java stored procedure.
PL/SQL or Java
When you think of Oracle stored procedures, you probably think of PL/SQL. Oracle, however, has provided Java support in the database since Oracle8i, to offer an open and portable alternative to PL/SQL for stored procedures. I can hear the $64,000 question: "How do I choose between PL/SQL and Java? Should I forget all the things I've been told about PL/SQL and move on to the greener Java pastures?"
Both languages are suitable for database programming, and each has its strengths and weaknesses. In deciding which language to use, here's a general rule of thumb:
Use PL/SQL for database-centric logic that requires seamless integration with SQL and therefore complete access to database objects, types, and features.
Use Java as an open alternative to PL/SQL for database independence, but also for integrating and bridging the worlds of SQL, XML, J2EE, and Web services.
OracleJVM Lets You Run Java within the Database
Since Oracle8i, Release 1 (Oracle 8.1.5), Oracle has offered a tightly integrated Java virtual machine (JVM) that supports Oracle's database session architecture. Any database session may activate a virtually dedicated JVM during the first Java code invocation; subsequent users then benefit from this already Java-enabled session. In reality, all sessions share the same JVM code and staticsonly private states are kept and garbage collected in an individual session space, to provide Java sessions the same session isolation and data integrity capabilities as SQL operations. There is no need for a separate Java-enabled process for data integrity. This session-based architecture provides a small memory footprint and gives OracleJVM the same linear SMP scalability as the Oracle database.
Creating Java Stored Procedures
There are a few steps involved in turning a Java method into a Java stored procedure. These include loading the Java class into the database using the loadjava utility, and publishing the Java methods using a call specification (Call Spec) to map Java methods, parameter types, and return types to their SQL counterparts. The following section shows how to do this.
I'll use a simple Hello class, with one method, Hello.world(), that returns the string "Hello world":
public class Hello
public static String world ()
return "Hello world";
The Loadjava Utility
Loadjava is a utility for loading Java source files, Java class files, and Java resource files; verifying bytecodes; and deploying Java classes and JAR files into the database. It is invoked either from the command line or through the loadjava() method contained within the DBMS_JAVA class. To load our Hello.class example, type:
loadjava -user scott/tiger Hello.class
As of Oracle9i Release 2, loadjava allows you to automatically publish Java classes as stored procedures by creating the corresponding Call Specs for methods contained in the processed classes. Oracle provides Oracle9i JDeveloper for developing, testing, debugging, and deploying Java stored procedures.
The Resolver Spec
The JDK-based JVM looks for and resolves class references within the directories listed in the CLASSPATH. Because Oracle database classes live in the database schema, the OracleJVM uses a database resolver to look for and resolve class references through the schemas listed in the Resolver Spec. Unlike the CLASSPATH, which applies to all classes, the Resolver Spec is applied on a per-class basis. The default resolver looks for classes first in the schema in which the class is loaded and then for classes with public synonyms.
loadjava -resolve <myclass>
You may need to specify different resolvers, and you can force resolution to occur when you use loadjava, to determine at deployment time any problems that may occur later at runtime.
loadjava -resolve -resolver "((* SCOTT) (foo/bar/* OTHERS)
(* PUBLIC))"
Call Spec and Stored Procedures Invocation
To invoke a Java method from SQL (as well as from PL/SQL and JDBC), you must first publish the public static method through a Call Spec, which defines for SQL the arguments the method takes and the SQL types it returns.
In our example, we'll use SQL*Plus to connect to the database and define a top-level Call Spec for Hello.world():
SQL> connect scott/tiger
SQL> create or replace function helloworld return
VARCHAR2 as language java name 'Hello.world () return
java.lang.String';
Function created.
You can then invoke the Java stored procedure as shown below:
SQL> variable myString varchar2[20];
SQL> call helloworld() into :myString;
Call completed.
SQL> print myString;
MYSTRING
Hello world
Java stored procedures are callable, through their Call Spec, from SQL DML statements (INSERT, UPDATE, DELETE, SELECT, CALL, EXPLAIN PLAN, LOCK TABLE, and MERGE), PL/SQL blocks, subprograms, and packages, as well as database triggers. The beauty of Call Spec is that stored procedure implementations can change over time from PL/SQL to Java or vice versa, transparently to the requesters.
Call Spec abstracts the call interface from the implementation language (PL/SQL or Java) and therefore enables sharing business logic between legacy applications and newer Java/J2EE-based applications. At times, however, when invoking a database-resident Java class from a Java client, you may not want to go through the PL/SQL wrapper. In a future release, Oracle plans to provide a mechanism that will allow developers to bypass the Call Spec.
Advanced Data-Access Control
Java stored procedures can be used to control and restrict access to Oracle data by allowing users to manipulate the data only through stored procedures that execute under their invoker's privileges while denying access to the table itself. For example, you can disable updates during certain hours or give managers the ability to query salary data but not update it, or log all access and notify a security service.
Sharing Data Logic Between Legacy and J2EE Applications
Because legacy applications and J2EE applications both invoke stored procedures through the Call Spec, the same data logic can be shared between J2EE and non-J2EE worlds. Thanks to Call Spec, this data logic can be shared regardless of the implementation language used (whether PL/SQL or Java).
Autogeneration of Primary Keys for BMP Entity Beans
When using BMP for EJB entity beans, a bean instance can be uniquely identified by the auto-generated primary key associated with the newly inserted data as a return value for ejbCreate(). You can retrieve this value within ejbCreate() in one database operation by using a stored procedure that inserts the corresponding data and retrieves or computes the primary key. Alternatively, you could insert the data and retrieve the corresponding key (or ROWID) in one SQL statement, using the RETURN_GENERATED_KEYS feature in JDBC 3.0. However, the stored procedure approach is more portable across JDBC driver versions and databases.
You can implement this pattern with these three steps:
Create the Java stored procedure, defining a public static Java method insertAccount() within a public GenPK class. This method will insert data, compute a unique key (by passing out a sequence number), and return the computed key as primary key.
Define the Call Spec.
CREATE OR REPLACE PROCEDURE insertAccount(owner IN
varchar, bal IN number, newid OUT number)
AS LANGUAGE JAVA NAME 'GenPK.insertAccount(
java.lang.String [])';
Invoke the stored procedure within ejbCreate().
Public AccountPK ejbCreate(String ownerName, int balance) throws CreateException
try {
CallableStatement call = conn.prepareCall{
"{call insertAccount(?, ?, ?)}"};
return new AccountPK(accountID);
Custom Primary Key Finders for CMP Entity Beans
Finder methods are used for retrieving existing EJB entity bean instances. Primary key finders allow you to retrieve a uniquely identified EJB instance. For CMP entity beans, the EJB container automatically generates the primary key finder findByPrimaryKey() method, based on declarative description. In some situations, however, you might need more control; for example, you may need a specialized finder such as findByStoredProcKey(). In these situations, you can use Java stored procedures in conjunction with an object relational framework (such as Oracle9i Application Server [Oracle9iAS] TopLink) to implement a custom primary key finder method. After you define the EJB finder as a REDIRECT or NAMED finder, TopLink will generate the SQL query for retrieving the bean instance.
Data-Driven EJB Invocation
In a data-driven architecture, business logic invocation can be triggered as a result of database operations (such as inserts, updates, or deletes). A Java stored procedure implementing the data logic can be declared as a database trigger to invoke EJBs running in a middle-tier J2EE application server. You can make EJB calls by using either standard remote method invocation (RMI) over Interoperable Inter-ORB Protocol (IIOP), using a J2EE 1.3 compatible server, or RMI over a vendor-specific transport protocol (such as ORMI with Oracle9iAS/OC4J or RMI over T3 with BEA WebLogic). Each application server vendor has its own optimized protocol while providing RMI over IIOP for interoperability. Oracle9iAS supports both RMI calls over IIOP and ORMI protocols.
Data-Driven Messaging
Oracle9i Database embeds Advanced Queuing (AQ), which is an integrated, persistent, reliable, secure, scalable, and transactional message-queuing framework. Oracle exposes AQ features to Java developers through the standard Java Messaging System (JMS) API. Java stored procedures can invoke AQ operations through the JMS interface to allow fast, intra-session, scalable, data-driven messaging.
Java stored procedures can use JMS to invoke AQ operations. You can implement this pattern in four steps:
Create and start the JMS Queue (to do so, embed the following operations within a SQL script):
execute dbms_aqadm.create_queue_table(queue_table =>
'queue1', queue_payload_type =>
'SYS.AQ$_JMS_TEXT_MESSAGE', comment => 'a test queue',
multiple_consumers => false, compatible => '8.1.0');
execute dbms_aqadm.create_queue( queue_name => 'queue1',
queue_table => 'queue1' );
execute dbms_aqadm.start_queue(queue_name => 'queue1');
Create the Java stored procedure (a code snippet is shown):
public static void runTest(String msgBody)
try
// get database connection
ora_drv = new OracleDriver();
db_conn = ora_drv.defaultConnection();
// setup sender (cf online code sample)
// create message
s_msg = s_session.createTextMessage(msgBody);
// send message
sender.send(s_msg);
s_session.commit();
// receive message
r_msg = (TextMessage) receiver.receive();
r_session.commit();
// output message text
String body = r_msg.getText();
System.out.println("message was '"+body+"'");
Create the Call Spec:
create or replace procedure jmsproc (t1 IN VARCHAR)
as language java name 'jmsSample.main (java.lang.String[])';
Invoke the stored procedure:
call jmsproc('hello');
Database-Assisted Web Publishing (Cache Invalidation)
One of the common issues application architects must face is how to cache database information reliably to increase overall system performance. JCACHE is an upcoming standard specification (JSR 107) that addresses this problem. It specifies an approach for temporary, in-memory caching of Java objects, including object creation, shared access, spooling, invalidation, and consistency across JVMs. It can be used to cache read-mostly data such as product catalogs and price lists within JSP. Using JCACHE, most queries will have response times an order of magnitude faster because of cached data (in-house testing showed response times about 15 times faster).
In order to track all the changes to the origin data and refresh the cached data, a Java stored procedure is attached to a table as a trigger. Any change to this table will result in the automatic invocation of this stored procedure, which in turn will call out a defined JSP to invalidate the JCACHE object that maps its state to the database table. Upon invalidation, the very next query will force the cache to be refreshed from the database. Next Steps
READ MORE about Java Stored Procedures
This article is adapted from the white paper "Unleash the Power of Java Stored Procedures." You can find the white paper at:
/tech/java/java_db/pdf/
OW_30820_JAVA_STORED_PROC_paper.PDF
New PL/SQL features in Oracle9i Database, Release 2
/tech/pl_sql/pdf/
Paper_30720_Doc.pdf
Resolver Spec
/docs/products/oracle9i/
doc_library/release2/java.920/a96659.pdf
OracleJVM and Java 2 Security
/docs/products/oracle9i/
doc_library/release2/java.920/a96656.pdf
DOWNLOAD Code
Exercise code examples from this article:
/sample_code/tech/
java/jsp/Oracle9iJSPSamples.html
LEARN about stored procedures as Web services
/tech/webservices
Extending Database Functionality
One of the great things about running Java code directly in the database is the ability to implement new functionality by simply loading the code or library and using the Call Spec to make the entry points (public static methods) available to SQL, PL/SQL, Java, J2EE, and non-Java APIs. Oracle9i Database customers can easily extend database functionality. Oracle itself leverages this capability for new utilities and packages such as the XML Developer Kits (XDKs).
Bridging SQL, PL/SQL, Java, J2EE, .NET, and XML
The Oracle XDK is written in Java and exposes its public methods as Java stored procedures, extending the database's XML programmability. SQL, PL/SQL, Java, J2EE, and non-Java (.NET) business logic all have access to the XML parser, the XSLT processor, the XPath engine, and XML SQL Utility (XSU).
The XML parser is accessible through the xmlparser and xmldom packages. XSU is a Java utility that generates an XML document from SQL queries or a JDBC ResultSet, and writes data from an XML document into a database table or view. Using XSU, XML output can be produced as Text, DOM trees, or DTDs. XSU is exposed to PL/SQL through the dbms_xmlquery and dbms_xmlsave packages.
Conclusion
The integration of the Oracle database with a Java VM enables the creation of portable, powerful, database-independent data logic and persistence logic. The loose coupling of business logic that runs in the middle tier with data logic that runs in the database tier improves application scalability, performance, flexibility, and maintenance.
Kuassi Mensah ([email protected]) is a product manager in the Server Technologies division at Oracle.
http://otn.oracle.com/oramag/oracle/03-jan/o13java.html
Joel Pérez -
Hi all, I have a problem getting propagation (with transformation) to work.
First things first:
- Oracle 10.2.0.3 EE
- HP-UX 11.11
- job_queue_processes=2
- aq_tm_processes NOT explicitly set
The goal of my setup:
- have a message of one type come in
- transform it to another type and
- propagate it to another queue
To make tests easier, everything runs within one Schema with aq_administrator_role granted. I tried that (code below), but the message will not be propagated to the second queue. The message remains in the first queue in status 0.
Am I missing something?
Best regards,
Uwe
Here's the setup:
-- Outgoing Queue with user defined MyMsgType
CREATE TYPE mymsgtype AS OBJECT(subject VARCHAR2(100));
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE_TABLE
QUEUE_TABLE => 'AQTEST.VCQ_tab'
,QUEUE_PAYLOAD_TYPE => 'mymsgtype'
,COMPATIBLE => '10.0'
,STORAGE_CLAUSE => '
TABLESPACE USERS'
,SORT_LIST => ''
,MULTIPLE_CONSUMERS => FALSE
,MESSAGE_GROUPING => 0
,SECURE => FALSE
End;
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE
QUEUE_NAME => 'AQTEST.VCQueue'
,QUEUE_TABLE => 'AQTEST.VCQ_tab'
,QUEUE_TYPE => SYS.DBMS_AQADM.NORMAL_QUEUE
,MAX_RETRIES => 0
,RETRY_DELAY => 0
,RETENTION_TIME => -1
END;
BEGIN
SYS.DBMS_AQADM.START_QUEUE
QUEUE_NAME => 'AQTEST.VCQueue'
,ENQUEUE => TRUE
,DEQUEUE => TRUE
END;
-- Incoming Queue with user defined MsgType
CREATE TYPE msgtype AS OBJECT(subject VARCHAR2(100),
text BLOB);
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE_TABLE
QUEUE_TABLE => 'AQTEST.msgtypeQ_tab'
,QUEUE_PAYLOAD_TYPE => 'aqtest.msgtype'
,COMPATIBLE => '10.0'
,STORAGE_CLAUSE => '
TABLESPACE USERS'
,SORT_LIST => ''
,MULTIPLE_CONSUMERS => TRUE
,MESSAGE_GROUPING => 0
,SECURE => FALSE
End;
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE
QUEUE_NAME => 'AQTEST.msgtypeQueue'
,QUEUE_TABLE => 'AQTEST.msgtypeQ_tab'
,QUEUE_TYPE => SYS.DBMS_AQADM.NORMAL_QUEUE
,MAX_RETRIES => 0
,RETRY_DELAY => 0
,RETENTION_TIME => 0
END;
BEGIN
SYS.DBMS_AQADM.START_QUEUE
QUEUE_NAME => 'AQTEST.msgtypeQueue'
,ENQUEUE => TRUE
,DEQUEUE => TRUE
END;
--Transformation
CREATE OR REPLACE FUNCTION my2msg_t(in_mymsg msgtype)
RETURN mymsgtype AS
new_msg mymsgtype;
BEGIN
new_msg := mymsgtype(in_mymsg.subject);
RETURN new_msg;
END my2msg_t;
BEGIN
DBMS_TRANSFORM.CREATE_TRANSFORMATION(
schema => 'AQTEST',
name => 'MY2MSG_XFM',
from_schema => 'AQTEST',
from_type => 'MSGTYPE',
to_schema => 'AQTEST',
to_type => 'MYMSGTYPE',
transformation => 'my2msg_t(source.user_data)');
END;
--Propagation
/* Add subscriber for propagation with transformation. */
-- setzt Multiple Consumer Queue voraus.
DECLARE
subscriber sys.aq$_agent;
BEGIN
subscriber := sys.aq$_agent('msg2mymsg','AQTEST.VCQueue',null);
DBMS_AQADM.ADD_SUBSCRIBER(
queue_name => 'AQTEST.msgtypeQueue',
subscriber => subscriber,
transformation => 'AQTEST.MY2MSG_XFM');
END;
BEGIN
dbms_aqadm.schedule_propagation(
queue_name => 'AQTEST.msgtypeQueue',
latency => 0);
END;
Tests
-- Session A (exits nicely):
set serveroutput on size 9999
DECLARE
v_msg msgtype;
v_msgid RAW(16);
v_options DBMS_AQ.enqueue_options_t;
v_props DBMS_AQ.message_properties_t;
v_recipient DBMS_AQ.aq$_recipient_list_t;
BEGIN
v_msg := msgtype( 'Test_1', empty_blob );
v_recipient(1) := SYS.aq$_agent ('dummy', null, null);
v_props.recipient_list := v_recipient;
DBMS_AQ.ENQUEUE( 'msgtypeQueue', v_options, v_props, v_msg, v_msgid );
COMMIT;
dbms_output.put_line( v_msgid );
END;
-- Session B (waits forever):
set serveroutput on size 9999
DECLARE
v_msg mymsgtype;
v_msgid RAW(16);
v_options DBMS_AQ.dequeue_options_t;
v_props DBMS_AQ.message_properties_t;
v_recipient DBMS_AQ.aq$_recipient_list_t;
BEGIN
v_options.consumer_name := 'dummy';
DBMS_AQ.DEQUEUE('VCQueue', v_options, v_props, v_msg, v_msgid);
COMMIT;
dbms_output.put_line( v_msgid );
dbms_output.put_line( v_msg.subject );
END;
/Thanks for your answer, Daniel,
Dequeue on the "msgtypequeue" works fine. By the way, the message didn't expire, SQL output was just hardly readable - this should be more readable now:
SQL> select qs.name, v.*
2 from v$aq v, all_queues qs
3 where waiting+ready+expired > 0
4 and v.qid = qs.qid;
NAME QID WAITING READY EXPIRED TOTAL_WAIT AVERAGE_WAIT
MSGTYPEQUEUE 44946 0 1 0 975 975I also added the schema name for the transformation function:
transformation => 'AQTEST.my2msg_t(source.user_data)');
...That didn't help either. :-(
Best regards,
Uwe -
Creation of new internal delivery channel using AQ
Hi,
I wanted to route one of Trading partner data to a different queue.(no want to use existing queues - IP_IN /IP_OUT queue).
This needs to create a new delivery channel using AQ in B2B.
I have gone thru the steps & entered all entries, but I am not able to find any queues created in B2B schema.
Do I need to create a queue using PL/SL in B2B to make it available as internal delivery channel or this setup itself will create a queue in B2B?
PFA the entirs:
for transport parameters
- transport server (B2B server IP)
- Protocol as AQ
-URI - b2b.<uri_name> (name of Queue, wanted to create)
- Hostname
- Port
-SID - b2b
-consumer - b2buser
- receiptient - null
-Polling interval - 6000
Transport server details:
Host name - (IP)
IP - Host IP
username -
Pswd - for B2B schema
Any pointers will be a great help.
Regards,
MSAs mentioned by TH in the above post, first thing is to create the data type that is used for messages - IP_MESSAGE_TYPE. This data type will already be present in the B2B database and could be reused.
For a new data type you could do the following.
==============================================================
Create a new data type using the following
==============================================================
create type IP_MSG_TYPE as OBJECT (
MSG_ID VARCHAR2(128),
INREPLYTO_MSG_ID VARCHAR2(128),
FROM_PARTY VARCHAR2(512),
TO_PARTY VARCHAR2(512),
ACTION_NAME VARCHAR2(512),
DOCTYPE_NAME VARCHAR2(512),
DOCTYPE_REVISION VARCHAR2(512),
MSG_TYPE INT,
PAYLOAD CLOB,
ATTACHMENT BLOB
Once you have created a new Data type ( or are reusing the existing data type), you need to create Queue Table that will hold the Outbound and Inbound message queues. The existing Queue table is "IP_QTAB" which can again be reused.
For new Queue table you could do the following
==============================================================
Create a new Queue Table using the following
==============================================================
execute dbms_aqadm.create_queue_table ( queue_table => 'MY_QTAB',
queue_payload_type => 'IP_MSG_TYPE',
multiple_consumers => FALSE);
If you need to reuse the datatype change the queue_payload_type to 'IP_MESSAGE_TYPE'.
Once we have the Queue Table that will hold the queues, we need to add and start the queues that are to be used for the inbound and outbound messages.
==============================================================
Create the new Queues into the Queue Table using the following
==============================================================
execute dbms_aqadm.create_queue (queue_name => 'B2B.MY_OUT_QUEUE', queue_table => 'B2B.MY_QTAB');
execute dbms_aqadm.create_queue (queue_name => 'B2B.MY_IN_QUEUE', queue_table => 'B2B.MY_QTAB');
execute dbms_aqadm.start_queue(queue_name => 'B2B.MY_OUT_QUEUE', dequeue => TRUE, enqueue => TRUE);
execute dbms_aqadm.start_queue(queue_name => 'B2B.MY_IN_QUEUE', dequeue => TRUE, enqueue => TRUE);
If you are reusing the queue table IP_QTAB for creation of new queues, then reference that for the queue_table in above commands.
You need to reference the queue_name eg. B2B.My_OUT_QUEUE in the B2B UI screen.
Hope this helps.
AKT -
Hi All,
This is regarding issue related to Dequeuing of message from AQ on Linux platform using JAVA API. Our appliaction is sending message on AQ which has queue payload type of type 'SYS.AQ$_JMS_TEXT_MESSAGE'. For dequeuing of this message we are using method AQjmsTextMessage_C.getFactory() that returns CustomDatumFactory.
The code snippet is as follows:
AQDequeueOption dequeueOption = new AQDequeueOption();
message = ((AQOracleQueue)l_queue).dequeue(dequeueOption,AQjmsTextMessage_C.getFactory());
The code is working fine on Windows environment. I ran the code from JDev IDE and also from batch file which was hitting the Oracle AQ installed on Linux environment. In both the case either through IDE or through batch file the code is running properly.
The same code on Linux is not working properly i.e. when the method AQjmsTextMessage_C.getFactory() is called we are not able to get the CustomDatumFactory. We are not getting any errors/exceptions and the control is directly going to finally block of our method and we are not getting the message from AQ. We tried with different jar files that contain the AQjmsTextMessage_C class but still not able to figure out the issue(The jar files used are viz. aqapi.jar,aqapi12.jar,aqapi13.jar,aqapi_g.jar,aqapi12_g.jar,aqapi13_g.jar).
The script that we used for creating the queue is as follows:
BEGIN
dbms_aqadm.create_queue_table(
queue_table=>'SAMPLE_T',
queue_payload_type=>'SYS.AQ$_JMS_TEXT_MESSAGE',
multiple_consumers => false,
comment => 'Queue Table For Text Message'
END;
BEGIN
dbms_aqadm.create_queue (
queue_name => 'SAMPLE_Q',
queue_table => 'SAMPLE_T');
END;
BEGIN
dbms_aqadm.start_queue (queue_name=>'SAMPLE_Q');
END;
Please let me know if you have faced such issue on Linux environment or have any pointers about the same.
Regards,
AbhishekIf "control is directly going to finally block" there must be some (unchecked) runtime exception. Catch it.
try{
AQDequeueOption dequeueOption = new AQDequeueOption();
message = ((AQOracleQueue)l_queue).dequeue(dequeueOption,AQjmsTextMessage_C.getFactory());
} catch (Throwable t) {
t.printStackTrace()
}You probably just don't have native code in the library path. -
Javax.jms.JMSException: Not supported in XA-backed session outside globaltx
I am trying to setup OracleOJMS provider and tries to access queue and post to queue from a normal jsp for testing.
I am getting the following
code:
javax.jms.JMSException: Not supported in XA-backed session outside global transaction
at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:525)
at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:199)
at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:210)
at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.prepareForSend(CommonProducerWrapper.java:350)
at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.send(CommonProducerWrapper.java:159)
at ResourceProvider.jspService(_ResourceProvider.java:112)
at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.1.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:453)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:591)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:515)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Steps i have done
ResourceProvider.jsp
code:
<!-- JSP Imports -->
<%@ page import="javax.jms.QueueConnectionFactory "%>
<%@ page import="javax.jms.XAQueueConnectionFactory "%>
<%@ page import="javax.jms.QueueConnection "%>
<%@ page import="javax.jms.QueueSession "%>
<%@ page import="javax.jms.Queue "%>
<%@ page import="javax.jms.QueueSender "%>
<%@ page import="javax.jms.Message "%>
<%@ page import="javax.jms.Session "%>
<%@ page import="javax.naming.Context "%>
<%@ page import="javax.naming.InitialContext "%>
<html>
<head>
<title>
Configuration of ResourceProvider for Advanced Queueing
</title>
</head>
<body>
<form name="TestResourceProvider" method="GET">
<%
// Check if the message has to be enqueued
if (request.getParameter("Message") != null){
Context jndiContext = new InitialContext();
XAQueueConnectionFactory queueCF = (XAQueueConnectionFactory)jndiContext.lookup
("java:comp/env/jms/InQueueCF");
Queue queue = (Queue)jndiContext.lookup("java:comp/env/jms/InQueue");
QueueConnection queueConnection = queueCF.createQueueConnection();
// Start the Connection
queueConnection.start();
QueueSender sender = queueSession.createSender(queue);
Message msg = queueSession.createTextMessage(request.getParameter("Message"));
sender.send(msg);
queueSession.commit();
sender.close();
queueSession.close();
queueConnection.close();
%>
<%
}else{
// User can enter the message to be enqueued through here
%>
Enter the message to be enqueued
<INPUT type="text" name="Message">
<br><br>
<input type="Submit" value="Enqueue Message">
<%
%>
</form>
</body>
</html>
My Steps for OJMS PRovider
1. Creating AQ queue in DB
2. configuration of resource adapter and provider
3. configuration of connection factories for resourceadapter[jmsconnector]
code:
1. Created the Queue table in DB using the sql
DROP USER jmsuser CASCADE;
GRANT connect, resource,AQ_ADMINISTRATOR_ROLE TO jmsuser IDENTIFIED BY jmsuser;
GRANT execute ON sys.dbms_aqadm TO jmsuser;
GRANT execute ON sys.dbms_aq TO jmsuser;
GRANT execute ON sys.dbms_aqin TO jmsuser;
GRANT execute ON sys.dbms_aqjms TO jmsuser;
connect jmsuser/jmsuser;
-- Create table to hold the queue, then create queue.
-- For topics multiple_consumers must be true
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE( Queue_table => 'SMSCP_INQTBL', Queue_payload_type => 'SYS.AQ$_JMS_MESSAGE',
sort_list => 'PRIORITY,ENQ_TIME', multiple_consumers => false, compatible => '8.1.5');
DBMS_AQADM.CREATE_QUEUE( Queue_name => 'SMSCP_INQ', Queue_table => 'SMSCP_INQTBL');
DBMS_AQADM.START_QUEUE(queue_name => 'SMSCP_INQ');
END;
quit;
Now our queue Name is queue Name : SMSCP_INQ table Name: SMSCP_INQTBL
2. Creating the Cp and datasource for the db [jmsuser] to make java to access queue
Creating ConnectionPool jmsDBPool
Creating DataSource jmsDBDataSource
Jndi jdbc jdbc/JMSDBDS
After creating, i got the following data-sources.xml
DATASOURCES.XML
<?xml version = '1.0' encoding = 'UTF-8'?>
<data-sources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd" schema-major-version="10" schema-minor-version="1">
<!-- default one comes with oracle shipping -->
<managed-data-source connection-pool-name="Example Connection Pool" jndi-name="jdbc/OracleDS" name="OracleDS"/>
<!-- New one Created -->
<managed-data-source connection-pool-name="jmsDBPool" jndi-name="jdbc/JMSDBDS" name="jmsDBDataSource"/>
<!-- default one comes with oracle shipping -->
<connection-pool name="Example Connection Pool">
<connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="scott" password="tiger" url="jdbc racle:thin:@//localhost:1521/ORCL"/>
</connection-pool>
<!-- New one Created -->
<connection-pool name="jmsDBPool">
<connection-factory factory-class="oracle.jdbc.pool.OracleDataSource" user="jmsuser" password="jmsuser" url="jdbc racle:thin:@//localhost:1521/xe"/>
</connection-pool>
</data-sources>
3. JMS Connector Task. Customising the ra.xml
ra.xml
<!-- resourceadapter -->
<resourceadapter>
<resourceadapter-class>oracle.j2ee.ra.jms.generic.JMSResourceAdapter</resourceadapter-class>
<config-property>
<config-property-name>lookupMethod</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>resourceProvider</config-property-value>
</config-property>
<config-property>
<config-property-name>resourceProviderName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testResourceProvider</config-property-value>
</config-property>
<!-- adminobject configuration -->
<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
<config-property>
<config-property-name>jndiName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Queues/MY_QUEUE</config-property-value>
</config-property>
<config-property>
<config-property-name>resourceProviderName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testResourceProvider</config-property-value>
</config-property>
</adminobject>
<!--
<adminobject>
<adminobject-interface>javax.jms.Topic</adminobject-interface>
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
<config-property>
<config-property-name>jndiName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Topics/MY_TOPIC</config-property-value>
</config-property>
<config-property>
<config-property-name>resourceProviderName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testResourceProvider</config-property-value>
</config-property>
</adminobject>
-->
<adminobject>
<adminobject-interface>javax.jms.Queue</adminobject-interface>
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
<config-property>
<config-property-name>resourceProviderName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testResourceProvider</config-property-value>
</config-property>
</adminobject>
<adminobject>
<adminobject-interface>javax.jms.Topic</adminobject-interface>
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
<config-property>
<config-property-name>resourceProviderName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testResourceProvider</config-property-value>
</config-property>
</adminobject>
</resourceadapter>
4. Create a JMS Connector INstance
oc4j-connectors.xml
<connector name="testResourceAdapter" path="testResourceAdapter.rar">
<config-property name="lookupMethod" value="resourceProvider"/>
<config-property name="resourceProviderName" value="testResourceProvider"/>
<!-- Default element generated by OC4J. Please uncomment and modify to suit your configuration needs.
<adminobject-config location="">
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectQueueImpl</adminobject-class>
<config-property name="jndiName" value="Queues/MY_QUEUE"/>
<config-property name="resourceProviderName" value="ojmsRP"/>
</adminobject-config>
-->
<!-- Default element generated by OC4J. Please uncomment and modify to suit your configuration needs.
<adminobject-config location="">
<adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
<config-property name="jndiName" value="Topics/MY_TOPIC"/>
<config-property name="resourceProviderName" value="ojmsRP"/>
</adminobject-config>
-->
</connector>
5. RA Connection Factories
<?xml version="1.0" encoding="UTF-8"?>
<oc4j-connector-factories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/oc4j-connector-factories-10_0.xsd"
schema-major-version="10"
schema-minor-version="0">
<connector-factory location="resourceAdapterXAQCF/MYXAQCF" connector-name="testResourceAdapter">
<config-property name="jndiLocation" value="XAQueueConnectionFactories/XAQCF"/>
<connection-pooling use="private">
<property name="waitTimeout" value="300" />
<property name="scheme" value="fixed_wait" />
<property name="maxConnections" value="50" />
<property name="minConnections" value="0" />
</connection-pooling>
<connectionfactory-interface>javax.jms.XAQueueConnectionFactory</connectionfactory-interface>
</connector-factory>
</oc4j-connector-factories>
orion-web.xml
<?xml version="1.0"?>
<orion-web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd" deployment-version="10.1.3.1.0"
deployment-time="1218369811921"
jsp-cache-directory="./persistence"
jsp-cache-tlds="standard"
temporary-directory="./temp"
context-root="/smscpReceiver"
schema-major-version="10" schema-minor-version="0" >
<!-- Uncomment this element to control web application class loader behavior.
<web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="true" />
-->
<resource-ref-mapping name="jms/InQueueCF" location="resourceAdapterXAQCF/MYXAQCF" />
<message-destination-ref-mapping location="resourceAdapterInQ/MYINQ" name="jms/InQueue">
</message-destination-ref-mapping>
<web-app>
</web-app>
</orion-web-app>
web.xml
<resource-ref>
<res-ref-name>jms/InQueueCF</res-ref-name>
<res-type>javax.jms.XAQueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<message-destination-ref>
<message-destination-ref-name>jms/InQueue</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
<message-destination-link>jms/InQueue</message-destination-link>
</message-destination-ref>
<message-destination>
<message-destination-name>jms/InQueue</message-destination-name>
</message-destination>Sorry for the jammed one
Neat one.
am trying to setup OracleOJMS provider and tries to access queue and post to queue from a normal jsp for testing.
I am getting the following
javax.jms.JMSException: Not supported in XA-backed session outside global transaction
at oracle.j2ee.ra.jms.generic.RAUtils.make(RAUtils.java:525)
at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:199)
at oracle.j2ee.ra.jms.generic.RAUtils.toJMSException(RAUtils.java:210)
at oracle.j2ee.ra.jms.generic.CommonProducerWrapper.prepareForS
INVOCATION
<form name="TestResourceProvider" method="GET">
<%
// Check if the message has to be enqueued
if (request.getParameter("Message") != null){
Context jndiContext = new InitialContext();
XAQueueConnectionFactory queueCF = (XAQueueConnectionFactory)jndiContext.lookup
("java:comp/env/jms/InQueueCF");
Queue queue = (Queue)jndiContext.lookup("java:comp/env/jms/InQueue");
QueueConnection queueConnection = queueCF.createQueueConnection();
// Start the Connection
queueConnection.start();
QueueSender sender = queueSession.createSender(queue);
Message msg = queueSession.createTextMessage(request.getParameter("Message"));
sender.send(msg);
queueSession.commit();
sender.close();
queueSession.close();
queueConnection.close();
%>
<%
}else{
// User can enter the message to be enqueued through here
%>
Enter the message to be enqueued
<INPUT type="text" name="Message">
<br><br>
<input type="Submit" value="Enqueue Message">
<%
%>
</form>
</body>
</html>
--------------------- -
Urgent! AIA 2.2.1 deployment fails on weblogic 9.2
Hi,
I have installed SOA 10.1.3.1 advanced installation with 10.1.3.4 patch on weblogic 9.2 and its working fine and now am trying to install AIA 2.2.1 (not doing the complete installation, just copying the AIA software as that is the requirement for AIA on weblogic) on the same platform and when i run the command ant -buildfile FPWLInstall.xml for the foundation pack installation am getting the following error.
The build message was from the FPInstall log file. we are running weblogic 9.2 MP3.
now am getting the following error in the FPWLInstall log file:
CreateDatasources:
CreateCommonDatasources:
createConnectionPool:
[echo] creating ConnectionPool AIAConnectionPool
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
createXAConnectionPool:
[echo] creating ConnectionPool AIAXAConnectionPool
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
createAIADataSource:
[echo] Adding ManagedDataSource AIADataSource
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
createXrefDataSource:
[echo] Adding ManagedDataSource XREFDataSource
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
createDiagnosticQueue:
[echo] ----Creating Diagnostics Queue--------------
[sql] Executing file: D:\aiahome\Infrastructure\install\seeddata\DatabaseObjects\createDiagnosticQueue.sql
[sql] Failed to execute: BEGIN sys.dbms_aqadm.create_queue_table ( queue_table => 'AIA_DIGNST_QUEUE_TBL' , queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE' , sort_list => 'ENQ_TIME' , comment => '' , multiple_consumers => FALSE , message_grouping => DBMS_AQADM.NONE , compatible => '8.1' , primary_instance => '0' , secondary_instance => '0'); COMMIT; END;
[sql] java.sql.SQLException: ORA-24001: cannot create QUEUE_TABLE, AIA.AIA_DIGNST_QUEUE_TBL already exists
[sql] ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2822
[sql] ORA-06512: at "SYS.DBMS_AQADM", line 58
[sql] ORA-06512: at line 1
[sql] Failed to execute: BEGIN sys.dbms_aqadm.create_queue( queue_name => 'AIA_DIGNST_QUEUE' , queue_table => 'AIA_DIGNST_QUEUE_TBL' , queue_type => sys.dbms_aqadm.NORMAL_QUEUE , max_retries => '5' , retry_delay => '0' , retention_time => '0' , comment => ''); END;
[sql] java.sql.SQLException: ORA-24006: cannot create QUEUE, AIA.AIA_DIGNST_QUEUE already exists
[sql] ORA-06512: at "SYS.DBMS_AQADM_SYS", line 3127
[sql] ORA-06512: at "SYS.DBMS_AQADM", line 119
[sql] ORA-06512: at line 1
[sql] 1 of 3 SQL statements executed successfully
CommonConfigurations:
replaceServerDetails:
[copy] Copying 1 file to D:\aiahome\Infrastructure\install\wlscripts
CreateStartupClasses:
[copy] Copying 9 files to D:\aiahome\Infrastructure\install\wlscripts
[java] Using existing user key file...
[java] Using existing user key file...
[java] Using existing user key file...
[mkdir] Created dir: D:\bea\user_projects\domains\SOADomain\AIAaqfiles
[copy] Copying 9 files to D:\bea\user_projects\domains\SOADomain\AIAaqfiles
[delete] Deleting 6 files from D:\aiahome\Infrastructure\install\wlscripts
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
[wlconfig] Ok
stopServer:
[echo] .;D:\product\10.1.3.1\OracleAS_2/bpel/lib/connector15.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/oracle_http_client.jar;D:\product\10.1.3.1\OracleAS_2/j2ee/home/oc4jclient.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/orawsdl.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/orabpel.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/orabpel-common.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/orabpel-common.jar;D:\product\10.1.3.1\OracleAS_2/bpel/lib/orabpel-thirdparty.jar;D:\product\10.1.3.1\OracleAS_2/integration/esb/lib/commons-logging.jar;D:\product\10.1.3.1\OracleAS_2/integration/esb/lib/commons-codec-1.3.jar;D:\product\10.1.3.1\OracleAS_2/j2ee/home/admin_client.jar;D:\aiahome/Infrastructure/install/applications/ESBErrorListenerMDB.jar;d:/bea/weblogic92/server/lib/weblogic.jar;d:/bea/weblogic92/server/lib/ant/ant-weblogic.jar
[wlst] <WLSTTask> Loaded and set the properties from D:\aiahome/Infrastructure/install/wlscripts/server.properties
[wlst] <WLSTTask> The script that will be executed
[wlst] Connecting to t3://localhost:9700 with userid weblogic ...
BUILD FAILED
D:\aiahome\Infrastructure\install\wlscripts\FPWLInstall.xml:96: The following error occurred while executing this line:
D:\aiahome\Infrastructure\install\wlscripts\FPWLInstall.xml:106: The following error occurred while executing this line:
D:\aiahome\Infrastructure\install\wlscripts\FPWLConfiguration.xml:97: The following error occurred while executing this line:
D:\aiahome\Infrastructure\install\wlscripts\FPWLConfiguration.xml:69: The following error occurred while executing this line:
D:\aiahome\Infrastructure\install\wlscripts\FPWLConfiguration.xml:43: Traceback (innermost last):
File "D:\aiahome\Infrastructure\install\wlscripts\stopServer.py", line 3, in ?
File "<iostream>", line 22, in connect
WLSTException: 'Error occured while performing connect : Error getting the initial context. There is no server running at t3://localhost:9700 Use dumpStack() to view the full stacktrace'
Total time: 1 minute 47 seconds
This is due to the error while starting the Oracle SOA Server in the weblogic console which is failing with the following exception:
####<Jun 1, 2009 3:23:34 PM GMT+05:30> <Info> <WebLogicServer> <B4B-2F-011-FZVS> <OracleSOAServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1243850014642> <BEA-000287> <Invoking startup class: com.oracle.oems.weblogic.AQJMSStartupClass.startup(AQJMSPropertiesFile=jmsuserjndi.properties,AQJMSPasswordFile=jmsuser_password.properties,AQJMSSecretFile=jmsuser_secretfile.dat,AQJMSConfigDirectory=D:/bea/user_projects/domains/SOADomain/AIAaqfiles)>
####<Jun 1, 2009 3:23:34 PM GMT+05:30> <Info> <WebLogicServer> <B4B-2F-011-FZVS> <OracleSOAServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1243850014642> <BEA-000288> <com.oracle.oems.weblogic.AQJMSStartupClass reports: SUCCESS: Bound the following Oracle AQ objects into WebLogic JNDI:
XAQueueConnectionFactory -> AQJMS_JMSUSER_XAQueueConnectionFactory
QueueConnectionFactory -> AQJMS_JMSUSER_QueueConnectionFactory
XATopicConnectionFactory -> AQJMS_JMSUSER_XATopicConnectionFactory
TopicConnectionFactory -> AQJMS_JMSUSER_TopicConnectionFactory
XAConnectionFactory -> AQJMS_JMSUSER_XAConnectionFactory
ConnectionFactory -> AQJMS_JMSUSER_ConnectionFactory
>
####<Jun 1, 2009 3:23:34 PM GMT+05:30> <Info> <WebLogicServer> <B4B-2F-011-FZVS> <OracleSOAServer> <[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1243850014642> <BEA-000287> <Invoking startup class: com.oracle.oems.weblogic.AQJMSStartupClass.startup(AQJMSPropertiesFile=oraesbjndi.properties,AQJMSPasswordFile=oraesb_password.properties,AQJMSSecretFile=oraesb_secretfile.dat,AQJMSConfigDirectory=D:/bea/user_projects/domains/SOADomain/AIAaqfiles)>
####<Jun 1, 2009 3:23:34 PM GMT+05:30> <Critical> <WebLogicServer> <B4B-2F-011-FZVS> <OracleSOAServer> <Main Thread> <<WLS Kernel>> <> <> <1243850014753> <BEA-000362> <Server failed. Reason:
There are 1 nested errors:
com.oracle.oems.weblogic.AQJMSException: Failed to get Oracle AQ destinations: JMS-232: An invalid user/password was specified for the JMS connection
javax.jms.JMSSecurityException: JMS-232: An invalid user/password was specified for the JMS connection
at oracle.jms.AQjmsDBConnMgr.checkForSecurityException(AQjmsDBConnMgr.java:868)
at oracle.jms.AQjmsDBConnMgr.getConnection(AQjmsDBConnMgr.java:580)
at oracle.jms.AQjmsDBConnMgr.<init>(AQjmsDBConnMgr.java:169)
at oracle.jms.AQjmsConnection.<init>(AQjmsConnection.java:162)
at oracle.jms.AQjmsTopicConnectionFactory.createTopicConnection(AQjmsTopicConnectionFactory.java:287)
at com.oracle.oems.weblogic.AQJMSStartupClass.startup(AQJMSStartupClass.java:458)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeStartup(ClassDeploymentManager.java:278)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClass(ClassDeploymentManager.java:256)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.access$000(ClassDeploymentManager.java:54)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager$1.run(ClassDeploymentManager.java:205)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClassDeployment(ClassDeploymentManager.java:198)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.runStartupsBeforeAppDeployments(ClassDeploymentManager.java:145)
at weblogic.management.deploy.classdeployment.ClassDeploymentService.start(ClassDeploymentService.java:20)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
at com.oracle.oems.weblogic.AQJMSStartupClass.startup(AQJMSStartupClass.java:473)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeStartup(ClassDeploymentManager.java:278)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClass(ClassDeploymentManager.java:256)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.access$000(ClassDeploymentManager.java:54)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager$1.run(ClassDeploymentManager.java:205)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.invokeClassDeployment(ClassDeploymentManager.java:198)
at weblogic.management.deploy.classdeployment.ClassDeploymentManager.runStartupsBeforeAppDeployments(ClassDeploymentManager.java:145)
at weblogic.management.deploy.classdeployment.ClassDeploymentService.start(ClassDeploymentService.java:20)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Thanks in advance.
Edited by: user10869954 on Jun 8, 2009 12:33 AM
Edited by: user10869954 on Jun 8, 2009 12:35 AM
Edited by: user10869954 on Jun 8, 2009 12:46 AM
Edited by: user10869954 on Jun 8, 2009 1:03 AMthis problem is due to hard-coded user/pwd in installation scripts. Here are steps
1) open file AIA_HOME/Infrastructure/install/wlscripts/FPWLCommonConfig.xml
2) reach to target CreateStartupClasses
3) there are three java tasks for com.oracle.oems.weblogic.AQJMSPasswordUtility
4) in the task for oraesb, password is hardcoded as 'oraesb' in clear text.
5) this should be password of 'ORAESB' database user.
6) change this password value; and restart the installation.
Regards,
Vaibhav -
Hi All,
I am trying to write a anonymous PLSQL block to read JMS data from the ORACLE AQ and getting a ClassCastException as mentioned below. Any help on this would be highly appreciated. Let me know in case any additional information is required.
QUEUE DETAILS
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE_TABLE
QUEUE_TABLE => 'SWB.TEST_MAP_QTAB'
,QUEUE_PAYLOAD_TYPE => 'SYS.AQ$_JMS_MAP_MESSAGE'
,COMPATIBLE => '8.1'
,SORT_LIST => 'ENQ_TIME'
,MULTIPLE_CONSUMERS => FALSE
,MESSAGE_GROUPING => 0
,SECURE => FALSE
End;
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE
QUEUE_NAME => 'SWB.CC_REQUEST_QUEUE'
,QUEUE_TABLE => 'SWB.TEST_MAP_QTAB'
,QUEUE_TYPE => SYS.DBMS_AQADM.NORMAL_QUEUE
,MAX_RETRIES => 5
,RETRY_DELAY => 0
,RETENTION_TIME => 0
END;
CODE SNIPPET
declare
r_dequeue_options DBMS_AQ.DEQUEUE_OPTIONS_T;
r_message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
v_message_handle RAW(500);
o_payload SYS.AQ$_JMS_MAP_MESSAGE;
namearr sys.aq$_jms_namearray;
jmsmsg SYS.AQ$_JMS_VALUE;
agent SYS.AQ$_AGENT;
cnt NUMBER := 0;
msgid PLS_INTEGER;
i_msgid CONSTANT PLS_INTEGER := -1;
java_exp exception;
PRAGMA EXCEPTION_INIT(java_exp, -24197);
begin
r_dequeue_options.dequeue_mode := DBMS_AQ.BROWSE;
DBMS_AQ.DEQUEUE(
queue_name => 'cc_request_queue',
dequeue_options => r_dequeue_options,
message_properties => r_message_properties,
payload => o_payload,
msgid => v_message_handle
-- Retrieve the header
agent := o_payload.get_replyto;
dbms_output.put_line('Type: ' || o_payload.get_type ||
' UserId: ' || o_payload.get_userid ||
' AppId: ' || o_payload.get_appid ||
' GroupId: ' || o_payload.get_groupid ||
' GroupSeq: ' || o_payload.get_groupseq);
msgid := o_payload.prepare(i_msgid);-- Passing -1 reserve a new slot within the message store of sys.aq$_jms_map_message.
dbms_output.put_line(msgid);
namearr := o_payload.get_names(msgid);
FOR i in namearr.FIRST..namearr.LAST
LOOP
o_payload.get_object(msgid,namearr(i),jmsmsg);
CASE jmsmsg.type
WHEN sys.dbms_jms_plsql.DATA_TYPE_BYTE THEN dbms_output.put_line('read_object/byte:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_SHORT THEN dbms_output.put_line('read_object/short:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_INTEGER THEN dbms_output.put_line('read_object/int:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_LONG THEN dbms_output.put_line('read_object/long:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_FLOAT THEN dbms_output.put_line('read_object/float:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_DOUBLE THEN dbms_output.put_line('read_object/double:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_BOOLEAN THEN dbms_output.put_line('read_object/boolean:' || jmsmsg.num_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_CHARACTER THEN dbms_output.put_line('read_object/char:' || jmsmsg.char_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_STRING THEN
dbms_output.put_line('read_object/string:');
display_clob(jmsmsg.text_val);
WHEN sys.dbms_jms_plsql.DATA_TYPE_BYTES THEN
dbms_output.put_line('read_object/bytes:');
display_blob(jmsmsg.bytes_val);
ELSE dbms_output.put_line('No such data type');
END CASE;
END LOOP;
o_payload.clean(msgid);
EXCEPTION
WHEN java_exp THEN
dbms_output.put_line('exception information:');
display_exp(sys.aq$_jms_map_message.get_exception());
end;
ERROR DETAILS
exception information:
exception:java.lang.ClassCastException
err_msg:
stack:288
java.lang.ClassCastException
at oracle.jms.plsql.MapMsgEntity.<init>(MapMsgEntity.java:49)
at oracle.jms.plsql.MsgEntity.createMsgEntity(MsgEntity.java:37)
at oracle.jms.plsql.MsgStore.createMsgEntity(MsgStore.java:65)
at oracle.jms.plsql.MapMsgHandler.prepare(MapMsgHandler.java:50)
References
http://filibeto.org/sun/lib/nonsun/oracle/10.1.0.2/B14117_01/appdev.101/b10802/t_jms.htm#1007681This issue is fixed as part of AQ JMS bug 16756136 and associated backport bugs.
-
Weblogic Connection with Oracle JMS AQ errors
Hi All,
I am a newbie with SOA 11g and I am trying to do a simple test case for a use case of connecting Oracle AQ JMS with Weblogic and using it in my SOA 11g process. I am trying to publish something to my queue that I created but I am getting this error in the weblogic / soa log files pasted below :
The steps I followed exactly are this :
1) Created a Database Queue called DemoInqueue using the following scripts :
exec dbms_aqadm.create_queue_table ( queue_table=> 'DemoInQueue', queue_payload_type=> 'SYS.AQ$_JMS_TEXT_MESSAGE', multiple_consumers=> FALSE, compatible=> '8.1');
COMMIT;
exec dbms_aqadm.create_queue(queue_name=> 'DemoInQueue', queue_table=> 'DemoInQueue');
COMMIT;
exec dbms_aqadm.start_queue('DemoInQueue');
COMMIT;
2) Created a Data Source in weblogic server : Called it using the JNDI name : jdbc/oracle/jms Driver Class Name : oracle.jdbc.xa.client.OracleXADataSource (I tested the connection it works fine)
3) Created a JMS Module (JMSTestModule) and then Created a New Summary of Resource for it ( AQServer) and chose option Foregin Server.
Under General Tab, I gave "oracle.jms.AQjmsInitialContextFactory" as the JNDI Initial Context Factory and Under JNDI Properties I put in "datasource=jdbc/oracle/jms" as I created the above datasource.
Under Connection Factores I created a new "ForeignConnectionFactory-0". Under Configuration I gave Local JNDI name as "jms/DemoCF" and remote JNDI Name as "XAQueueConnectionFactory" (I have also tried with
QAConnectionFactory but no difference )
Under Destinations I created a new "ForeignDestination-0" with local JNDI name as "jms/DemoInQ" and Remote JNDI Name as "Queues/DemoInQueue" (Because my Queue name is that)....
4) I restarted the Weblogic Server then went to SOA suite and tried a very simple process Hello world added a JMS adpater....Inside the adpater I selected OEMS (Advanced Queueing), App server my weblogic server,
operation as ProduceMessage and when I hit Browse I was able to see my AQServer ForeignDestination-0 Queue. I selected it and under destination name it populated "jms/DemoInQ" but under JNDI name it also
populated "eis/aqjms/Queue" I left that as is and deployed my process and tried invoking it. It failed with the error message below.....I also tried modifying the JNDI name to something else...in Jdev..but the results
are the same....
Are these steps correct ? Am I missing something here.?
I followed all the blogs and forums in this site and I think I did all the steps...but if anyone can help me I would really appreciate it...
Here is the error stack below :
<BEA1-57B9592B4D0D4FFD1A5C> <3f3d2d8955322f32:-5d57c961:12ca300b9a3:-7fd3-00000000000002d7> <1291230437281> <BEA-190032> << eis/aqjms/Queue > ResourceAllocationException thrown by resource adapter on call to ManagedConnectionFactory.createManagedConnection(): "BINDING.JCA-12141
ERRJMS_CONN_FAC_NOT_FOUND.
ERRJMS_CONN_FAC_NOT_FOUND.
Unable to instantiate connection factory. JMS adapter was unable to look up the connection factory aqjms/XAQueueConnectionFactory neither through JNDI nor instantiate it as a Java class.
Please examine the log file to determine the problem.
">
####<Dec 1, 2010 2:07:17 PM EST> <Warning> <Connector> <OLRMSPLAP103> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-57B9592B4D0D4FFD1A5C> <3f3d2d8955322f32:-5d57c961:12ca300b9a3:-7fd3-00000000000002d7> <1291230437296> <BEA-190032> << eis/aqjms/Queue > ResourceAllocationException thrown by resource adapter on call to ManagedConnectionFactory.createManagedConnection(): "BINDING.JCA-12141
ERRJMS_CONN_FAC_NOT_FOUND.
ERRJMS_CONN_FAC_NOT_FOUND.
Unable to instantiate connection factory. JMS adapter was unable to look up the connection factory aqjms/XAQueueConnectionFactory neither through JNDI nor instantiate it as a Java class.
Please examine the log file to determine the problem.
">
SOA LOG.....
####<Dec 1, 2010 2:07:17 PM EST> <Error> <oracle.soa.adapter> <OLRMSPLAP103> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-57B9592B4D0D4FFD1A5C> <3f3d2d8955322f32:-5d57c961:12ca300b9a3:-7fd3-00000000000002d7> <1291230437359> <BEA-000000> <JCABinding=> [default/HelloWorldComposite!1.0*soa_25f514de-3db3-4bed-9144-44d83dacbe10.Publishmessage]:Produce_Message One-way operation Produce_Message() failed>
####<Dec 1, 2010 2:07:17 PM EST> <Error> <oracle.soa.bpel.engine.ws> <OLRMSPLAP103> <AdminServer> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-57B9592B4D0D4FFD1A5C> <3f3d2d8955322f32:-5d57c961:12ca300b9a3:-7fd3-00000000000002d7> <1291230437359> <BEA-000000> <<WSInvocationManager::invoke> got FabricInvocationException
oracle.fabric.common.FabricInvocationException: BINDING.JCA-12563
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_Message' failed due to: JCA Binding Component connection issue.
JCA Binding Component is unable to create an outbound JCA (CCI) connection.
HelloWorldComposite:Publishmessage [ Produce_Message_ptt::Produce_Message(body) ] : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: BINDING.JCA-12141
ERRJMS_CONN_FAC_NOT_FOUND.
ERRJMS_CONN_FAC_NOT_FOUND.
Unable to instantiate connection factory. JMS adapter was unable to look up the connection factory aqjms/XAQueueConnectionFactory neither through JNDI nor instantiate it as a Java class.
Please examine the log file to determine the problem.Thanks for passing along the link.
The part about Oracle's documentation not mentioning the JmsAdapter configuration was a real sticking point for me - I was having the same problem as the original poster until I updated that deployment as the link outlined.
Also, towards the end of that link the author mentions running in to problems getting their composite to successfully bind to the queue definitions that were created in WebLogic.
I attempted post my solution to this on the original site, but I'm not sure if it got through - so I'll add the details of what worked for me here:
Connection Factory:
Local JNDI: aqjms/JMSTest_Connection_Factory
Remote JNDI: XAQueueConnectionFactory
Destination:
Local JNDI: aqjms/JMSTest_Queue
Remote JNDI: Queues/JMSTest_Queue
Outbound Connection Pool:
Name: eis/aqjms/JMSTest_Queue
Connection Factory: aqjms/JMSTest_Connection_Factory
JDeveloper Composite:
Destination Name: aqjms/JMSTest_Queue
JNDI Name: eis/aqjms/JMSTest_Queue
Cheers,
- Nathan -
JMS Adapter configuration failed in creating table that handles OEMS JM
Step 2 from Chapter 8 of E15763-01, Oracle Application Integration Architecture -
Foundation Pack 2.5: Integration Developer's
Guide
Configuring of JMS Adapters
Create the table that handles the OEMS JMS destination (queue).
Queues use a queue table. This SQL example creates a single table, AIA
SALESORDERJMSQTAB, for a queue. The multiple_consumers parameter specifies
whether there are multiple consumers. Set multiple_consumers to false for a queue.
Begin
DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table
'AIA_SALESORDERJMSQTAB',Queue_payload_type 'SYS.AQ$_JMS_MESSAGE',
sort_list 'PRIORITY,ENQ_TIME', multiple_consumers = >false,
compatible '8.1.5');
End;
Result:
SQL> Begin
DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table
'AIA_SALESORDERJMSQTAB',Queue_payload_type 'SYS.AQ$_JMS_MESSAGE',
sort_list 'PRIORITY,ENQ_TIME', multiple_consumers = >false,
compatible '8.1.5');
End; 2 3 4 5 6
SELECT * FROM ALL_TABLES WHERE TABLE_NAME='DBMS_AQADM.CREATE_QUEUE_TABLE';
no rows selectedStep 2 from Chapter 8 of E15763-01, Oracle Application Integration Architecture -
Foundation Pack 2.5: Integration Developer's
Guide
Configuring of JMS Adapters
Create the table that handles the OEMS JMS destination (queue).
Queues use a queue table. This SQL example creates a single table, AIA
SALESORDERJMSQTAB, for a queue. The multiple_consumers parameter specifies
whether there are multiple consumers. Set multiple_consumers to false for a queue.
Begin
DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table
'AIA_SALESORDERJMSQTAB',Queue_payload_type 'SYS.AQ$_JMS_MESSAGE',
sort_list 'PRIORITY,ENQ_TIME', multiple_consumers = >false,
compatible '8.1.5');
End;
Result:
SQL> Begin
DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table
'AIA_SALESORDERJMSQTAB',Queue_payload_type 'SYS.AQ$_JMS_MESSAGE',
sort_list 'PRIORITY,ENQ_TIME', multiple_consumers = >false,
compatible '8.1.5');
End; 2 3 4 5 6
SELECT * FROM ALL_TABLES WHERE TABLE_NAME='DBMS_AQADM.CREATE_QUEUE_TABLE';
no rows selected -
Message not deleting from Topic after successfully dequeue
Hi All,
Help please..
I need to design a process where message have to produce into a AQ JMS topic and later i have to consume the message from the same topic and publish to a Queue.
In order to move on this i have created a sample My_Topic1 and My_Queue1 with below syntax
Topic:-
EXEC dbms_aqadm.create_queue_table (queue_table=>'MY_Topic1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>true );
EXEC dbms_aqadm.create_queue(queue_name=>'MY_Topic1', queue_table=>'MY_Topic1');
EXEC dbms_aqadm.start_queue(queue_name=>'MY_Topic1');
Queue:-
EXEC dbms_aqadm.create_queue_table (queue_table=>'My_Queue1', queue_payload_type=>'sys.aq$_jms_text_message', multiple_consumers=>false);
EXEC dbms_aqadm.create_queue(queue_name=>'My_Queue1', queue_table=>'My_Queue1');
EXEC dbms_aqadm.start_queue(queue_name=>'My_Queue1');
Now i created Foreign server and create local and destination topic of queue.topics name and also created Data source of XAType.
Now my bpel process getting a message(which as one element of sting type) from a web service and i am producing the same message to Topic. Once the message published to topic in a separate composite my JMS Adaptor dequeue/Consume the message from the topic and subscribe it to queue.
The Above scenario working as expected but here what my observation on this
1)When i dequeue message from a topic using bpel process successfully i am able to subscribe the message to queue but the message still remain in the topic i think it suppose to get of the topic once successfully dequeued.
Even i check the subscriber topic table and one subscriber is listening to the topic.
2)If in case any error generated at the time of subscribing to the queue the message should rollback( because i am using XA Transaction) but i think it is not happening as i can see in my topic view aq$my_topic1 MGS_STATE changed to PROCESSED.
Can some one please let me know where i am going wrong.
Thanks in advance.
Regards,
Tarak.
Edited by: Tarak on Sep 9, 2012 8:47 PMThe behavior should be the process consume a message from the topic and will try to do its job. If this process fail, {code]
But in this message not there in topic even it is failed in soa process.....i am very much interested how this XA is working that the reason i am trying all this.What to do with a failed/expired message is usually configurable, but doesn't make sense to place it in the same topic again... If the messages are failing too quickly better to adjust the max_retries and retry_delay...I agress in real senario we will move to error queue. But in that case also some how we need to read the message from queue and publish to the end system.
I am just trying to understand the behavior and what i came to know is after all the retire fails message not going to topictable _E. But when i pass Expire time property or time to live then it is moving to error table.What do you mean? What server was restarted, the database or the soa server? Messages that still didn't reach the max retry number will still be retried...Wheni am bouncing my managed server soa_server1 i can see the invoke activity is trying to publish the message into queue... this is happens after server restart and suppose not to happen....
But thanks alot for the inputs...
Regards,
Tarak. -
ORA-03113: end-of-file on communication channel ERROR
After applying Database patch 3095277 to my 9.2.0.1.0 installation
in order to update it to 9.2.0.4.0,I'm getting ORA-03113: end-of-file on communication channel
ERRORS when attempting various tasks. This is a local installation running on a Windows XP Workstation.
I've even tried creating a new test database but the result is the same.
The reason for moving up to 9.2.0.4.0 is so I can start using Advanced Queuing, which I understand had problems in earlier releases.
However before the update I could at least create the JMS queue tables without ERROR whereas now I get the following errors when attempting to create a queue table in SQL Plus from within Enterprise Manager Console.
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Sep 18 08:20:08 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected.
BEGIN SYS.DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table=> 'JMSQTBL',Queue_payload_type=>'SYS.AQ$_JMS_STREAM_MESSAGE',multiple_consumers=> false); END;
ERROR at line 1:
ORA-03113: end-of-file on communication channel
BEGIN SYS.DBMS_AQADM.CREATE_QUEUE(Queue_name=> 'JMSQUE',queue_table=> 'JMSQTBL'); END;
ERROR at line 1:
ORA-03114: not connected to ORACLE
I would be grateful of any pointers as to how to resolve this problem.
Regards
Gary.Chris, Thanks for the suggestion,
I took a look in the trace log and found the following entries that point to a ORA-00600 as you mentioned earlier.
This is only a test database so there's no great loss if
I have to re create it, but in saying that I did create a new test02 from scratch and had the same problem.
Is it posible something went wrong when applying the 9.2.0.4.0 patch ?.
Regards
Gary.
Dump file c:\oracle\admin\test01\udump\test01_ora_2556.trc
Wed Sep 17 16:25:14 2003
ORACLE V9.2.0.4.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.1 Service Pack 1, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Windows 2000 Version 5.1 Service Pack 1, CPU type 586
Instance name: test01
Redo thread mounted by this instance: 1
Oracle process number: 10
Windows thread id: 2556, image: ORACLE.EXE
*** 2003-09-17 16:25:14.046
*** SESSION ID:(7.17) 2003-09-17 16:25:14.031
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** Object defn.s out of sync w/ data
*** 2003-09-17 16:25:14.281
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [qmxiUnpPacked2], [121], [], [], [], [], [], []
Current SQL statement for this session:
select 1
from resource_view
where any_path = '/xdbconfig.xml'
----- PL/SQL Call Stack -----
object line object
handle number name
6A4FA348 6 package body XDB.DBMS_REGXDB
6A504D88 1 anonymous block
6A576AB8 639 package body SYS.DBMS_REGISTRY
6A1DBB6C 1 anonymous block -
I have this error I was hoping someone might be able to point me in the right direction. Basically I need to dequeue messages from a queue in batch (as one at a time will be too slow). The follow error is related to my TYPE I've defined at schema level. I think its the XMLType is causing me this problem as when I use a normal Object type define with columns I can get the dequeue_Array to work fine !
Any help would be appreciated. Thanks.
/* Current DDL for Queue, QTable and Type */
CREATE OR REPLACE TYPE REQUEST_XML_QUEUE_TYPE AS OBJECT (REQUEST_XML XMLTYPE);
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE (
queue_table => 'REQUEST_XML_QUEUE_TABLE',
queue_payload_type => 'REQUEST_XML_QUEUE_TYPE',
storage_clause => NULL,
sort_list => 'priority,enq_time',
multiple_consumers => FALSE,
message_grouping => DBMS_AQADM.TRANSACTIONAL ,
comment => 'Request Queue Table for storing XML inputs for BPs',
auto_commit => TRUE,
primary_instance => 0,
secondary_instance => 0,
compatible => NULL,
secure => FALSE);
END;
BEGIN
DBMS_AQADM.CREATE_QUEUE (
queue_name => 'REQUEST_XML_QUEUE',
queue_table => 'REQUEST_XML_QUEUE_TABLE',
queue_type => DBMS_AQADM.NORMAL_QUEUE,
max_retries => NULL,
retry_delay => 0,
retention_time => 0,
dependency_tracking => FALSE,
comment => 'Request XML Queue',
auto_commit => TRUE);
END;
BEGIN
DBMS_AQADM.START_QUEUE(
queue_name => 'REQUEST_XML_QUEUE',
enqueue => TRUE,
dequeue => TRUE);
END;
/* I created the following to test DBMS_AQ.DEQUEUE_ARRAY */
CREATE TYPE REQUEST_XML_Q_TYPE_ARR AS TABLE OF REQUEST_XML_QUEUE_TYPE;
DECLARE
r_dequeue_options DBMS_AQ.DEQUEUE_OPTIONS_T;
nt_msg_properties DBMS_AQ.MESSAGE_PROPERTIES_ARRAY_T := DBMS_AQ.MESSAGE_PROPERTIES_ARRAY_T();
nt_payloads REQUEST_XML_Q_TYPE_ARR := REQUEST_XML_Q_TYPE_ARR();
nt_msg_ids DBMS_AQ.MSGID_ARRAY_T := DBMS_AQ.MSGID_ARRAY_T();
v_dequeued_cnt PLS_INTEGER;
v_dequeue_batch PLS_INTEGER := 150;
v_continue BOOLEAN := TRUE;
x_timeout EXCEPTION;
PRAGMA EXCEPTION_INIT(x_timeout, -25228);
BEGIN
dbms_output.put_line('Inside DEQUEUE proc...');
nt_payloads.EXTEND(v_dequeue_batch);
nt_msg_properties.EXTEND(v_dequeue_batch);
dbms_output.put_line('Starting While Loop...');
/* Dequeue all messages in batches... */
WHILE v_continue LOOP
BEGIN
dbms_output.put_line('Starting Dequeue ...');
v_dequeued_cnt := DBMS_AQ.DEQUEUE_ARRAY(
queue_name => 'REQUEST_MSG_QUEUE',
dequeue_options => r_dequeue_options,
array_size => v_dequeue_batch,
message_properties_array => nt_msg_properties,
payload_array => nt_payloads,
msgid_array => nt_msg_ids);
DBMS_OUTPUT.PUT_LINE('Dequeued [' || TO_CHAR(v_dequeued_cnt) || '] messages.');
/* other code ..... */
v_continue := (v_dequeued_cnt = v_dequeue_batch);
COMMIT;
EXCEPTION
/* Handle exit scenario two from the notes above... */
WHEN x_timeout THEN
DBMS_OUTPUT.PUT_LINE('No more messages to dequeue.');
v_continue := FALSE;
END;
END LOOP;
dbms_output.put_line('Outside While Loop...');
END;
/* output from code block above when run */
SQL>
Inside DEQUEUE proc...
Starting While Loop...
Starting Dequeue ...
DECLARE
ERROR at line 1:
ORA-25215: user_data type and queue type do not match
ORA-06512: at "SYS.DBMS_AQ", line 619
ORA-06512: at line 24
SQL>I know its being sometime since you posted this message but can you tell me if you got it resolved. I too am experiencing the same problem.
Many thanks in advance. -
Messages are not being dequed by a different connection in JMS
Scenario
There are 2 queues - Q_A and Q_B and There are 2 applications - App_1 and App_2
I am using point 2 point and java JMS
This is what I want to accomplish
App_1 queues messages to Q_A
App_2 dequeues messages from Q_A
App_2 queues messages to Q_B
App_1 dequeues messages from Q_B
But the problem I am having is that neither application can see the messages that have been queued by the other.
So even though I see the messages in the database in Q_A,
When I use QueueBrowser from App_B on Q_A to view the messages ... it is empty
But if I use QueueBrowser from App_A on the same queue Q_ A I can see the messages.
The same is true the other way round.
The queueconnection is being created usng the same db user in both apps, and the queues are owned by the same user.
please help me.
user489532Dear DAMORGAN,
Thank you for your reply and I apologise for the insufficient information. I am providing the details now. I am aware that JMS is supposed to handle my situation. And I am ableto queue and dequeue messages without problems from the same app. Its only when I am using different apps that I am having a problem. I am pasting relevant pieces of code,Please let me know if more info is needed. Thank for your help.
Oracle 10g
Weblogic 10
DDL to create Queue
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE (
QUEUE_TABLE => 'AQ_A_QUEUE'
,QUEUE_PAYLOAD_TYPE => 'SYS.AQ$_JMS_OBJECT_MESSAGE'
,COMPATIBLE => '8.1.3'
,MULTIPLE_CONSUMERS => FALSE
DBMS_AQADM.CREATE_QUEUE(QUEUE_NAME => 'A_QUEUE',
QUEUE_TABLE => 'AQ_A_QUEUE',
MAX_RETRIES => 10,
RETRY_DELAY => 60);
DBMS_AQADM.START_QUEUE(QUEUE_NAME => 'A_QUEUE');
END;
Application A sends messages to A_QUEUE like this
//This is how I get a connection
QueueConnectionFactory queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory(getDatabaseServer(), getDatabaseSid(), getDatabasePort(), "thin");
QueueConnection qc = queueConnectionFactory.createQueueConnection(getDatabaseUser(), getDatabaseUserPassword());
qc.start();
//This is how I get the Queue
QueueSession q_sess = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
Queue aQueue= ((AQjmsSession)q_sess).getQueue(getDatabaseUser(), "A_QUEUE");
TestMsgObject jmsObj = new TestMsgObject();
//populate Test object
QueueSender qs = q_sess.createSender(aQueue )
ObjectMessage msg = q_sess.createObjectMessage(jmsObj);
msg.setStringProperty("MESSAGESOURCE", "APP_A");
qs.send(msg);
qs.close();
q_sess.commit();
//Application B has a message listener like this - TestListener
public void initialize() throws JMSException, NamingException {
QueueConnectionFactory queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory(getDatabaseServer(), getDatabaseSid(), getDatabasePort(), "thin");
qc = queueConnectionFactory.createQueueConnection(getDatabaseUser(), getDatabaseUserPassword());
q_session = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
aQueue = ((AQjmsSession)q_session).getQueue(getDatabaseUser(), "A_QUEUE");
qr = q_session.createReceiver(aQueue);
qr.setMessageListener(this);
qc.start();
public void onMessage(Message message) {
try {
System.out.println("Received Message XFS=" + message.getJMSMessageID());
//more processing
}catch(Exception e) {
e.printStackTrace();
The message listener is created and initialized from the init() method of a servlet that is loaded on startup.
The onMessage of the TestListener is never called.
I can see the messages in the database.
Also when I call the following code snippet from Application A - the messages are retrieved, but the same code called from application B does not give any messages.
browser = q_sess.createBrowser(MyUtil.getQueue(q_sess));
for (Enumeration messages = browser.getEnumeration(); messages.hasMoreElements() ;){
obj_message = (ObjectMessage)messages.nextElement();
System.out.println(obj_message.getJMSMessageID());
I can bounce the app server and still app B does not see the messages.
However if app B publishes messages to the queue itself, it can see those, without any problem.
As mentioned before the database user is the same for both the apps and owns the queue, and deques and enque are both enabled. -
Simultaneous Access to the same queue
Could some one please clarify how does the AQ mechanism handle requests in the following scenario:
Two applications are both talking to the same Queue using the same consumer for dequeuing messages. The dequeuing happens under a main transaction and the dequeue mode is set to REMOVE. The messages is completely removed from the queue when the transaction is committed at the end of processing the message. Also, the dequeue API is through stored procedures.
I would like to know if, while one application has dequeued a message and is still processing it as a part of the transaction, what happens when the second application tries to access the same queue and try to dequeue a message. Would it get the same message that the first application is still processing and is not yet been completely dequeued.
Let me know.
Thanks,
-NS.--- create queue type
CREATE TYPE mesaj_t AS OBJECT
message varchar2(100)
--- create queue table , queue and start queue
BEGIN
dbms_aqadm.create_queue_table(queue_table => 'mesaj_qt',
queue_payload_type => 'mesaj_t',
sort_list => 'PRIORITY,ENQ_TIME',
multiple_consumers => FALSE);
dbms_aqadm.create_queue(queue_name => 'mesaj_q',
queue_table => 'mesaj_qt');
dbms_aqadm.start_queue(queue_name => 'mesaj_q');
END;
--enqueue message
DECLARE
r_enqueue_options dbms_aq.enqueue_options_t;
r_message_properties dbms_aq.message_properties_t;
v_message_handle RAW(16);
BEGIN
dbms_aq.enqueue(queue_name => 'mesaj_Q',
enqueue_options => r_enqueue_options,
message_properties => r_message_properties,
payload => mesaj_t(message => 'selam'),
msgid => v_message_handle);
END;
--dequeue message from session 1 and dont comit
DECLARE
r_dequeue_options dbms_aq.dequeue_options_t;
r_message_properties dbms_aq.message_properties_t;
v_message_handle RAW(16);
l_corr_identifier VARCHAR2(128);
l_recipient_list dbms_aq.aq$_recipient_list_t;
v_payload_handle mesaj_t;
BEGIN
dbms_aq.dequeue(queue_name => 'mesaj_Q',
dequeue_options => r_dequeue_options,
message_properties => r_message_properties,
payload => v_payload_handle,
msgid => v_message_handle);
END;
--and try to dequeue from second session same message with using msg_id property
DECLARE
r_dequeue_options dbms_aq.dequeue_options_t;
r_message_properties dbms_aq.message_properties_t;
v_message_handle RAW(16);
l_corr_identifier VARCHAR2(128);
l_recipient_list dbms_aq.aq$_recipient_list_t;
v_payload_handle mesaj_t;
BEGIN
r_dequeue_options.wait := DBMS_AQ.NO_WAIT; -- if i change to DBMS_AQ.FOREVER then it will wait for new message for dequeuing, with no_wait you will get an exception immediately if there is no message for you in queue
r_dequeue_options.msgid := 'BBAB7BA403CD4B259A86B55783862912'; --replace this with your msg_id of your enqueued message
dbms_aq.dequeue(queue_name => 'mesaj_Q',
dequeue_options => r_dequeue_options,
message_properties => r_message_properties,
payload => v_payload_handle,
msgid => v_message_handle);
END;
conclusion :
with remove mode other session can not dequeue message when first session processing message and not committed yet
Maybe you are looking for
-
HT1338 What cable do I need to connect my macbook pro to my television(hdmi)?
What cable do I need to connect my macbook pro to my television(hdmi)?
-
Views in MM03, how can I add fields and changes fields labels
Hi !! I need to change some labels that appear on Sales: Sales Org 2 (view on MM03, MM02..MM01)... Im not sure what I can do this.. Im an ABAP Programmer(beginner) and I know how I can change labels of fields in programs(reports) that I did...b
-
I get photoshop crashing all the time, multiple times an hour, regardless of various setting changes, here are a few crash logs. This is not my computer, but i have seen the same error on my laptop as well. It most often(almost always) happens on cli
-
Settings App missing after iOS7 upgrade
Decided to upgrade (if that is the word) from iOS6 to iOS7 last night on the iPad2 and have a number of issues but the main one if that the Setting App (icon) does not seem to be visible anywhere. Has anyone had a similar problem after upgrading to i
-
I'm trying to load a .TOD file from a server-based JVC camera. Anyway, I have to use MPEG Streamclip to change the file into a FCE usable format. I'm changing the file format into MPEG4, but it takes FOREVER for the clip to convert into MPEG4 and the