{"id":2950,"date":"2011-08-16T14:16:35","date_gmt":"2011-08-16T19:16:35","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=2950"},"modified":"2011-09-15T13:13:10","modified_gmt":"2011-09-15T18:13:10","slug":"setup-weblogic-10-3-1-aq-jms","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=2950","title":{"rendered":"WebLogic 11g: Setup AQ JMS"},"content":{"rendered":"<span id=\"Overview\"><h2>Overview<\/h2><\/span>\n<p>* Uses WebLogic JMS Foreign Server framework.<br \/>\n* Supports RAC via WebLogic Multi Data Sources.<\/p>\n<span id=\"Configure_Oracle_AQ\"><h2>Configure Oracle AQ<\/h2><\/span>\n<p>* Follow <a href=\"?p=1487\">this post<\/a> to create an AQ queue named <strong>TEST_QUEU<\/strong>E owned by a user name <strong>aq<\/strong>. <\/p>\n<span id=\"Configure_WebLogic_Server\"><h2>Configure WebLogic Server<\/h2><\/span>\n<span id=\"Configure_a_WebLogic_Data_Source\"><h3>Configure a WebLogic Data Source<\/h3><\/span>\n<p>* Follow <a href=\"?p=2952\">this post<\/a> to create a data source with following properties:<br \/>\n&#8211; Name: <strong>myAQDS<\/strong><br \/>\n&#8211; JNDI Name: <strong>jdbc\/myAQDS<\/strong><br \/>\n&#8211; Database Type: <strong>Oracle<\/strong><br \/>\n&#8211; Database Driver: <strong>Oracle&#8217;s Driver (Thin XA) for Service connections; Verions:9.0.1 and later<\/strong><\/p>\n<span id=\"Create_a_Dedicated_JMS_System_Module\"><h3>Create a Dedicated JMS System Module<\/h3><\/span>\n<p>* Click soa_domain -> Services -> Messaging -> <strong>JMS Modules<\/strong><br \/>\n* Click <strong>New<\/strong> button under JMS Modules.<br \/>\n* Enter<br \/>\n&#8211; Name: <strong>myAQJMSModule<\/strong><br \/>\n&#8211; Descriptor File Name: <strong>myAQJMSModule-jms.xml<\/strong><br \/>\n* Click <strong>Next<\/strong>.<br \/>\n* Select target server, e.g. <strong>soa_server1<\/strong>.<br \/>\n* Click <strong>Next<\/strong>.<br \/>\n* Click <strong>Finish<\/strong>.<\/p>\n<span id=\"Create_a_JMS_Foreign_Server\"><h3>Create a JMS Foreign Server<\/h3><\/span>\n<p>* Click soa_domain -> Services -> Messaging -> <strong>JMS Modules<\/strong><br \/>\n* Click the newly created <strong>mySQJMSModule<\/strong>.<br \/>\n* Click <strong>New <\/strong>button under Summary of Resources.<br \/>\n* On the Choose the type of resource you want to create screen, select <strong>Foreign Server<\/strong>.<br \/>\n* Name Foreign Server: <strong>myAQForeignServer<\/strong><br \/>\n* Click <strong>Next<\/strong>.<br \/>\n* Click <strong>Finish<\/strong>.<\/p>\n<span id=\"Configure_JMS_Foreign_Server_to_Point_to_AQ_Database_via_JNDI\"><h3>Configure JMS Foreign Server to Point to AQ Database via JNDI<\/h3><\/span>\n<p>* Click the newly created <strong>myAQForeignServer<\/strong>.<br \/>\n* Click <strong>Configuration -> General<\/strong> tab. Enter:<br \/>\n&#8211; JNDI Initial Context Factory: <strong>oracle.jms.AQjmsInitialContextFactory<\/strong><br \/>\n&#8211; JNDI Properties: <strong>datasource=jdbc\/myAQDS<\/strong><\/p>\n<span id=\"\"><h4><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ds.jpg\" alt=\"\" title=\"wls_aq_ds\" width=\"443\" height=\"179\" class=\"aligncenter size-full wp-image-2967\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ds.jpg 443w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ds-300x121.jpg 300w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/h4><\/span>\n<p>* Click Save.<\/p>\n<span id=\"Configure_JMS_Foreign_Server_Connection_Factories\"><h3>Configure JMS Foreign Server Connection Factories<\/h3><\/span>\n<p>* Click soa_domain -> Services -> Messaging -> <strong>JMS Modules<\/strong><br \/>\n* Click <strong>myAQJMSModule<\/strong>.<br \/>\n* Click <strong>myAQForeignServer<\/strong>.<br \/>\n* Click <strong>Configuration -> Connection Factories<\/strong> tab.<br \/>\n* Click <strong>New <\/strong>button. Enter:<br \/>\n&#8211; Name: <strong>myAQCF<\/strong><br \/>\n&#8211; Local JNDI Name: <strong>jms\/aq\/myAQCF<\/strong><br \/>\n&#8211; Remote JNDI Name: <strong>XAQueueConnectionFactory<\/strong><\/p>\n<span id=\"_1\"><h4><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_cf.jpg\" alt=\"\" title=\"wls_aq_cf\" width=\"318\" height=\"273\" class=\"aligncenter size-full wp-image-2987\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_cf.jpg 318w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_cf-300x257.jpg 300w\" sizes=\"auto, (max-width: 318px) 100vw, 318px\" \/><\/h4><\/span>\n<p>* Click <strong>OK<\/strong>.<\/p>\n<span id=\"Other_Remote_JNDI_Names_for_AQ_JMS_Connection_Factories\"><h3>Other Remote JNDI Names for AQ JMS Connection Factories<\/h3><\/span>\n<p>* <strong>ConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.ConnectionFactory<br \/>\n* <strong>QueueConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.QueueConnectionFactory<br \/>\n* <strong>TopicConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.TopicConnectionFactory<br \/>\n* <strong>XAConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.XQConnectionFactory<br \/>\n* <strong>XAQueueConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.XAQueueConnectionFactory<br \/>\n* <strong>XATopicConnectionFactory <\/strong><br \/>\n&#8211; javax.jms.XATopicConnectionFactory<\/p>\n<span id=\"Configure_AQ_JMS_Foreign_Server_Destinations\"><h3>Configure AQ JMS Foreign Server Destinations<\/h3><\/span>\n<p>* Remote JNDI Names are mapped as follows:<br \/>\n&#8211; For queue: <strong>Queues\/queue_name<\/strong><br \/>\n&#8211; For Topics: <strong>Topics\/topic_name<\/strong><\/p>\n<span id=\"Configure_Queue\"><h4>Configure Queue<\/h4><\/span>\n<p>* Click soa_domain -> Services -> Messaging -> <strong>JMS Modules<\/strong><br \/>\n* Click <strong>myAQJMSModule<\/strong>.<br \/>\n* Click <strong>myAQForeignServer<\/strong>.<br \/>\n* Click <strong>Configuration -> Destinations<\/strong> tab.<br \/>\n* Click <strong>New <\/strong>button. Enter:<br \/>\n&#8211; Name: <strong>myAQTestQ<\/strong><br \/>\n&#8211; Local JNDI Name: <strong>jms\/aq\/testQ<\/strong><br \/>\n&#8211; Remote JNDI Name: <strong>Queues\/TEST_QUEUE<\/strong><\/p>\n<span id=\"_2\"><h4><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_destination.jpg\" alt=\"\" title=\"wls_aq_destination\" width=\"262\" height=\"265\" class=\"aligncenter size-full wp-image-2993\" \/><\/h4><\/span>\n<p>* Click <strong>OK<\/strong>.<\/p>\n<span id=\"Configure_Topic\"><h4>Configure Topic<\/h4><\/span>\n<p>* Click soa_domain -> Services -> Messaging -> <strong>JMS Modules<\/strong><br \/>\n* Click <strong>myAQJMSModule<\/strong>.<br \/>\n* Click <strong>myAQForeignServer<\/strong>.<br \/>\n* Click <strong>Configuration -> Destinations<\/strong> tab.<br \/>\n* Click <strong>New <\/strong>button. Enter:<br \/>\n&#8211; Name: <strong>myAQTestTopic<\/strong><br \/>\n&#8211; Local JNDI Name: <strong>jms\/aq\/testTopic<\/strong><br \/>\n&#8211; Remote JNDI Name: <strong>Topics\/TEST_TOPIC<\/strong><br \/>\n* Click <strong>OK<\/strong>.<\/p>\n<span id=\"Restart_WebLogic_Server_Instance\"><h3>Restart WebLogic Server Instance<\/h3><\/span>\n<p>* Don&#8217;t forget to <strong>restart <\/strong>WebLogic server instance.<\/p>\n<span id=\"Error\"><h2>Error<\/h2><\/span>\n<span id=\"java.lang.UnsupportedOperationException:_Remote_JDBC_disabled\"><h3>java.lang.UnsupportedOperationException: Remote JDBC disabled<\/h3><\/span>\n<p>* Go to domain bin directory:<br \/>\ncd \/opt\/oracle\/Middleware\/home_11gr1\/user_projects\/domains\/soa_domain\/bin<br \/>\n* vi setDomainEnv.sh and set WLS_JDBC_REMOTE_ENABLED to true:<\/p>\n<pre>\r\n#WLS_JDBC_REMOTE_ENABLED=\"-Dweblogic.jdbc.remoteEnabled=false\"\r\nWLS_JDBC_REMOTE_ENABLED=\"-Dweblogic.jdbc.remoteEnabled=true\"\r\nexport WLS_JDBC_REMOTE_ENABLED\r\n<\/pre>\n<p>* <strong>Restart <\/strong>server instance.<\/p>\n<span id=\"java.io.NotSerializableException:_oracle.jdbc.aq.AQDequeueOptions\"><h3>java.io.NotSerializableException: oracle.jdbc.aq.AQDequeueOptions<\/h3><\/span>\n<span id=\"Possible_Cause\"><h4>Possible Cause<\/h4><\/span>\n<p>* You are using stand alone JMS client to access AQ JMS destinations. Since the foreign server was configured with JDBC <strong>JNDI <\/strong>lookup, JDBC connections thus obtained can not be serialized to standalone clients.<\/p>\n<span id=\"Fix\"><h4>Fix<\/h4><\/span>\n<p>* Configure foreign server to use direct JDBC connection (instead of JNDI lookup):<\/p>\n<span id=\"_3\"><h4><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ext_jdbc.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ext_jdbc-300x181.jpg\" alt=\"\" title=\"wls_aq_ext_jdbc\" width=\"300\" height=\"181\" class=\"aligncenter size-medium wp-image-3026\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ext_jdbc-300x181.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_ext_jdbc.jpg 441w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h4><\/span>\n<p>* Put following libraries in client classpath:<br \/>\n&#8211; AQ JMS, which contains following jars:<br \/>\n~ C:\\prog\\Oracle\\Middleware\\wlserver_10.3\\server\\lib\\api.jar,<br \/>\n~ C:\\prog\\Oracle\\Middleware\\modules\\javax.transaction_1.0.0.0_1-1.jar<br \/>\n&#8211; WebLogic 10.3 Remote-Client, which contains following jars:<br \/>\n~C:\\prog\\Oracle\\Middleware\\wlserver_10.3\\server\\lib\\weblogic.jar<\/p>\n<span id=\"_4\"><h4><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_remote_client_cp.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_remote_client_cp.jpg\" alt=\"\" title=\"wls_aq_remote_client_cp\" width=\"521\" height=\"403\" class=\"aligncenter size-full wp-image-3013\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_remote_client_cp.jpg 521w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/08\/wls_aq_remote_client_cp-300x232.jpg 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/a><\/h4><\/span>\n<p>* See <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E12839_01\/web.1111\/e13738\/aq_jms.htm#CJADCIEB\">here <\/a>for more info.<br \/>\n* See <a href=\"?p=1591\">this post<\/a> for sample JMS client.<\/p>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E12839_01\/web.1111\/e13738\/aq_jms.htm\">Interoperating with Oracle AQ JMS<\/a><br \/>\n* <a href=\"http:\/\/books.google.com\/books?id=9PZW7uoxWc8C&#038;pg=PT384&#038;lpg=PT384&#038;dq=WebLogic+Foreign+Server+data+source&#038;source=bl&#038;ots=KgXlD4B9dg&#038;sig=Zo5jaK4yxHZLJm59mmxmRpwHmZc&#038;hl=en&#038;ei=iUBFTpLrFeHL0QGa29XvBw&#038;sa=X&#038;oi=book_result&#038;ct=result&#038;resnum=3&#038;sqi=2&#038;ved=0CCkQ6AEwAg#v=onepage&#038;q=WebLogic%20Foreign%20Server%20data%20source&#038;f=false\">Professional Oracle WebLogic Server By Robert Patrick, Gregory Nyberg, Philip Aston<\/a><br \/>\n* <a href=\"http:\/\/biemond.blogspot.com\/2009\/07\/using-aq-jms-text-message-in-wls-1031.html\">Using AQ ( JMS Text message ) in WLS 10.3.1 <\/a><br \/>\n* <a href=\"http:\/\/biemond.blogspot.com\/2008\/10\/jms-in-jdeveloper-11g-and-weblogic-103.html\">JMS in JDeveloper 11g and WebLogic 10.3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview * Uses WebLogic JMS Foreign Server framework. * Supports RAC via WebLogic Multi Data Sources. Configure Oracle AQ * Follow this post to create an AQ queue named TEST_QUEUE owned by a user name aq. Configure WebLogic Server Configure &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=2950\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[86,71,91],"tags":[],"class_list":["post-2950","post","type-post","status-publish","format-standard","hentry","category-aq","category-jms","category-weblogic"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-LA","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2950"}],"version-history":[{"count":50,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2950\/revisions"}],"predecessor-version":[{"id":3402,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2950\/revisions\/3402"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}