tag:blogger.com,1999:blog-5700399228771658115.post4122441232882962469..comments2019-02-22T14:01:41.261+03:00Comments on Knowledge For All: Oracle DB to IBM MQ connectorAshraf Fouadhttps://plus.google.com/112465373784813635820noreply@blogger.comBlogger39125tag:blogger.com,1999:blog-5700399228771658115.post-77720278054692487882017-11-15T19:09:45.356+03:002017-11-15T19:09:45.356+03:00I didn&#39;t require such permissions.
Anyway, ha...I didn&#39;t require such permissions.<br /><br />Anyway, happy to c it worked for u :)Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-3210232650592926872017-11-15T17:13:52.366+03:002017-11-15T17:13:52.366+03:00Hi Ashraf,
We finally got it to work; it appears...Hi Ashraf, <br /><br />We finally got it to work; it appears that 2 additional java permissions needed to be set:<br /><br />Call dbms_java.grant_permission( &#39;ORAMQ&#39;, &#39;SYS:javax.management.MBeanServerPermission&#39;, &#39;createMBeanServer&#39;, &#39;&#39; );<br />Call dbms_java.grant_permission( &#39;ORAMQ&#39;, &#39;SYS:javax.management.MBeanPermission&#39;, &#39;Paul Fennemahttps://www.blogger.com/profile/15575266109905829757noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-88232090068684700112017-11-14T07:17:15.902+03:002017-11-14T07:17:15.902+03:00Hi Paul,
I have updated the post (plz have a look ...Hi Paul,<br />I have updated the post (plz have a look at the end with update with todays date) &amp; uploaded new version for both MQClient.java and new File MQClientDebug.java<br /><br />MQClient: changes just added catch for RuntimeException in two locations.<br />MQClientDebug.java: Sample for debugging to file.<br /><br />In the post I have added permission from Oracle to be given.<br /><br Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-61130348876706963002017-11-12T23:20:00.759+03:002017-11-12T23:20:00.759+03:00Hi Ashraf,
I was not clear apparently, the code ...Hi Ashraf, <br /><br />I was not clear apparently, the code is running from within Oracle. Either with the job debugger or not, I get exactly the same behaviour with the exception being thrown.<br />In fact, if I&#39;m running the MQClient (with the main method added) as a standalone program outside Oracle it runs fine. It is really the integration within Oracle which does not work.<br />It couldPaul Fennemahttps://www.blogger.com/profile/15575266109905829757noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-33249864651428753762017-11-11T19:49:27.947+03:002017-11-11T19:49:27.947+03:00Dear Paul,
Adding main method and running your MQC...Dear Paul,<br />Adding main method and running your MQClient outside Oracle JVM is different than running within Oracle JVM.<br /><br />Running from outside, you will need to declare classpath and pass it to the application. This was not my intention, as you need to trust that Java code is working :) (BTW, you can find similar libraries nearly coding the same way to connect to IBM MQ). The Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-16522845656995475952017-11-11T16:11:09.397+03:002017-11-11T16:11:09.397+03:00Hi Ashraf,
Thanks for your help, these are the ve...Hi Ashraf,<br /><br />Thanks for your help, these are the versions etc:<br />[oracle@hi032009 pf]$ java -version<br />java version &quot;1.5.0_30&quot;<br />Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)<br />Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_30-b03, mixed mode)<br />Oracle Path: /opt/oracle/product/11.2.0/db_1/jdk/bin:<br /><br />I used your MQClient source Paul Fennemahttps://www.blogger.com/profile/15575266109905829757noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-45369678781341185532017-11-10T11:04:33.963+03:002017-11-10T11:04:33.963+03:00For debugging, I used to log from Java component &...For debugging, I used to log from Java component &quot;MQClient.java&quot; to file, but it requires that you give Oracle permission to write files before doing such change.<br /><br />BTW, the steps has been used from multiple friends &amp; it didn&#39;t cause issue before, most issues, comes from environment permission or missing a step.<br /><br />If u identified the line causing error &amp; Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-41353738397129324792017-11-09T14:11:57.493+03:002017-11-09T14:11:57.493+03:00Hi Ashraf,
We are trying to implement your solut...Hi Ashraf, <br /><br />We are trying to implement your solution but unfortunately we are still stuck at the issue that when executing the stored procedure we get the following error:<br /><br />ERROR at line 1:<br />ORA-29532: Java call terminated by uncaught Java exception:<br />java.lang.ExceptionInInitializerError<br />ORA-06512: at &quot;EMCF_MIS.SET_AND_FORGET&quot;, line 1<br />ORA-06512: Paul Fennemahttps://www.blogger.com/profile/15575266109905829757noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-46557332637406900442015-07-23T15:51:28.890+03:002015-07-23T15:51:28.890+03:00&lt;&gt; means: &lt;&lt;ALL FILES&gt;&gt;&lt;&gt; means: &lt;&lt;ALL FILES&gt;&gt;xpet71https://www.blogger.com/profile/01078248723508297239noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-48568634763784228822015-07-23T15:48:00.166+03:002015-07-23T15:48:00.166+03:00Thank you the response!
The solution for the prob...Thank you the response!<br /><br />The solution for the problem is: Grant the JAVAUSERPRIV role or the &quot;java.io.FilePermission &lt;&gt; read&quot; permission to schema user.<br />I don&#39;t know why need FilePermission when we not use files in the program.<br />Our DBA&#39;s not allow the &lt;&gt; right.xpet71https://www.blogger.com/profile/01078248723508297239noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-43158876103204734752015-07-22T12:13:46.830+03:002015-07-22T12:13:46.830+03:00The version size I have used for javaee-api-5.0.0....The version size I have used for javaee-api-5.0.0.jar is (3,994,473 bytes)<br /><br />I have shared it in this link<br />https://drive.google.com/file/d/0B9tUTHxSSn7jOEF0ZDBob01rT3c/view?usp=sharing<br /><br />Please retry again &amp; let me know if u still face issue.<br /><br />Solution is not platform specific, It has been running Windows, AIX, Linux without change in the solution itself, justAshraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-44653810788257093952015-07-16T13:43:03.599+03:002015-07-16T13:43:03.599+03:00Where can I find the correct javaee-api-5.0.0.jar?...Where can I find the correct javaee-api-5.0.0.jar?<br /><br />When I try to load javaee-api-5.0.0.jar (jar size: 3994473) I got the following error:<br />ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.rdbms.MalformedDefinitionException: In ClassHandle.create in schema XXXXXX<br />ORA-29509: incorrectly formed Java binary class definition<br /><br />When I use xpet71https://www.blogger.com/profile/01078248723508297239noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-38807532642510270852015-07-16T12:48:52.901+03:002015-07-16T12:48:52.901+03:00This comment has been removed by the author.xpet71https://www.blogger.com/profile/01078248723508297239noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-32274181701750208992014-02-25T10:01:39.136+03:002014-02-25T10:01:39.136+03:00First error 01919 is Oracle error not related to t...First error 01919 is Oracle error not related to the MQ, please check this forum http://www.orafaq.com/forum/t/177415/<br /><br />Java version, Oracle 11gr2, you should be having Java 1.5, please execute the command from this path:<br />%ORACLE_HOME%\dbhome_1\jdk\bin&gt;java -version<br /><br />Please when posting multiple issues, please have some separator to make it easier in reading.Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-64097107158191068552014-02-25T07:48:44.514+03:002014-02-25T07:48:44.514+03:00I am trying to implement this solution and on firs...I am trying to implement this solution and on first grant command I get an error.<br />grant connect to ORAMQ;<br />&quot;ORA-01919: role &#39;CONNECT&#39; does not exist&quot;<br />SQLPLUS reports oracle release<br />&quot;Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production&quot;<br />JAVA -version<br />java version &quot;1.4.2_14&quot;<br />Java(TM) 2 Runtime Jacques van der Merwehttps://www.blogger.com/profile/03550463884160161859noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-10402792398044890972013-07-03T14:10:31.016+03:002013-07-03T14:10:31.016+03:00Hello!
I am trying to run a simple java applicatio...Hello!<br />I am trying to run a simple java application for the MQClient. I tried to call SendAndForget. In NetBeans it works fine, but in Oracle 11g (11.2 - instance on linux) I have same error: <br />java.lang.NullPointerException<br /> at MQClient.putMessage(MQClient_2:198)<br /> at MQClient.sendAndForget(MQClient_2:306)<br /><br />this line is:<br />MQMessage mqMessage = new MQMessage();<br Romanhttps://www.blogger.com/profile/11295414671269868728noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-2176916390034447992013-07-03T14:09:16.558+03:002013-07-03T14:09:16.558+03:00This comment has been removed by the author.Romanhttps://www.blogger.com/profile/11295414671269868728noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-72630338236491658332013-07-03T14:08:02.777+03:002013-07-03T14:08:02.777+03:00This comment has been removed by the author.Romanhttps://www.blogger.com/profile/11295414671269868728noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-46281822603818654182013-06-16T07:42:19.136+03:002013-06-16T07:42:19.136+03:00I c.
1- using library that is jdk 1.6 will never w...I c.<br />1- using library that is jdk 1.6 will never work, think of it as normal Java IDE that u specified to use jdk 1.5 for yr project, so all yr jars can&#39;t use higher version, u can only use same or lower versions.<br /><br />2- jee 5 works as ibm mq is depending on classes that do not require container to run, think of it again as including it in yr classpath.<br /><br />3- Regarding theAshraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-83527299750897267112013-06-16T01:33:39.364+03:002013-06-16T01:33:39.364+03:00Sure. After I did my POC and told my boss and the...Sure. After I did my POC and told my boss and the colleagues that it can be done and what the requirements were - that we should use JDK 1.5 and the compliant libraries and gave them the list of libraries - one of my colleagues tried with JDK 1.6 and told me basically I was wrong because the list says to use JavaEE 5 jars, he should be able to use it with JDK 1.6, but it doesn&#39;t work. <br Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-29436772157214429502013-06-15T23:43:04.982+03:002013-06-15T23:43:04.982+03:00Happy to hear it worked for u :)))
Regarding yr q...Happy to hear it worked for u :)))<br /><br />Regarding yr question of using 1.4 ee, this I never thought about, but let me think loudly trying to answer:<br />1- you might be right in yr assumption, u will never know unless u try.<br />2- I really don&#39;t know what differs Oracle JVM from normal Java sdk, all I know it is special and have some limitation, so I was looking for compatibility to Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-26901621542799695932013-06-15T23:22:52.551+03:002013-06-15T23:22:52.551+03:00Your earlier explanations helped me a lot and I co...Your earlier explanations helped me a lot and I could get it working in our environment. Thak you so much for your detailed help.<br /><br />I have one question that I haven&#39;t found an answer to.<br /><br />In the start of the article, it mentions Oracle 11g supports JDK 1.5 level. And a little later in the table of required jars, it indicates we should use javaee-api-5.0.0.jar Java Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-79084888180303720592013-06-10T02:22:30.617+03:002013-06-10T02:22:30.617+03:00Thanks for yr kind words &amp; encouragement.Thanks for yr kind words &amp; encouragement.Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-85243957614107895662013-06-09T21:49:56.456+03:002013-06-09T21:49:56.456+03:00attractive piece of information, I had come to kno...attractive piece of information, I had come to know about your blog from my friend arjun, ahmedabad,i have read atleast eleven posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that i had been looking for, i&#39;m already your rss reader now and i would regularly watch out for the new posts, once Nandkishor Waghhttps://www.blogger.com/profile/17313661190126567875noreply@blogger.comtag:blogger.com,1999:blog-5700399228771658115.post-84988972353265501092013-05-23T17:18:29.322+03:002013-05-23T17:18:29.322+03:00The code I have provided connects to MQ using clie...The code I have provided connects to MQ using client connectivity not binding connectivity i.e. the server of MQ is irrelevant to the server of DB, and it also can exist on same server.<br /><br />From IBM MQ perspective, it is recommended to have common IBM MQ (Usually called MQ HUB) for all of your applications in the enterprise (Might be spanned across multiple servers for high load situation)Ashraf Fouadhttps://www.blogger.com/profile/08164634185768329685noreply@blogger.com