JMS send seems to work, but receive and browse not

Hi,
I use an Oracle9i database, registered it to OID and also registered a QueueConnectionFactory using Oracle sample code with slight changes as you can see below.
I then wrote a little AQ-JMS test programm to test sending and receiving messages also using Oracle's sample code with slight changes.
Registration works (as much as I can tell - at least I can see an entry in the OracleDBConnections in OID). Sending passes without any error messages and retrieval as well as browsing crashes with a null pointer exception of the style:
java.lang.NullPointerException
     at oracle.jms.AQjmsConsumer.<init>(AQjmsConsumer.java:222)
     at oracle.jms.AQjmsQueueBrowser.<init>(AQjmsQueueBrowser.java:99)
     at oracle.jms.AQjmsSession.createBrowser(AQjmsSession.java:1404)
     at oracle.jms.AQjmsSession.createBrowser(AQjmsSession.java:1251)
     at TestRegisteredAQQCF.browseMessages(TestRegisteredAQQCF.java:167)
     at TestRegisteredAQQCF.browse(TestRegisteredAQQCF.java:73)
     at TestRegisteredAQQCF.main(TestRegisteredAQQCF.java:26)
I will mark the lines, where this exceptions occur with //EXCEPTION
Oracle's Enterprise Manager Console says, there were no waiting, ready or expired messages in the queue.
Actually I simply want to use AQ as resource provider for OAS Dev Preview, but I could not find detailed documentation on that (in oc4j_j2ee_svcguide_r2.pdf I cannot find, what I have to put into jms.xml in case of AQ as resource provider) so I tried to test, whether I can send and receive at all. Maybe someone of you knows, what is wrong.
=================================================================
=================================================================
Send and Mail Code
==================
import java.util.Enumeration;
import java.util.Hashtable;
import javax.jms.*;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import oracle.jms.AQjmsConstants;
import oracle.jms.AQjmsSession;
public class TestRegisteredAQQCF
public static void main(String args[])
try
I ran send a few times and commented the other two out. Then I tried each
of the other ones, always sending a few times inbetween.
//send();
//receive();
browse();
catch (JMSException e)
e.printStackTrace();
System.out.println("\n\nLinked Exception:\n");
e.getLinkedException().printStackTrace();
catch (Exception e)
e.printStackTrace();
public static void send() throws JMSException
QueueConnectionFactory qcf = null;
QueueSession qs = null;
Queue queue = null;
qcf = get_Factory_from_LDAP();
qs = getQueueSession(qcf);
queue = getQueue(qs);
sendMessageToQueue(queue, qs);
public static void receive() throws JMSException
QueueConnectionFactory qcf = null;
QueueSession qs = null;
Queue queue = null;
qcf = get_Factory_from_LDAP();
qs = getQueueSession(qcf);
queue = getQueue(qs);
receiveMessageFromQueue(queue, qs);
public static void browse() throws JMSException
QueueConnectionFactory qcf = null;
QueueSession qs = null;
Queue queue = null;
qcf = get_Factory_from_LDAP();
qs = getQueueSession(qcf);
queue = getQueue(qs);
browseMessages(queue, qs);
public static QueueConnectionFactory get_Factory_from_LDAP()
Hashtable env = new Hashtable(5, 0.75f);
env.put(Context.INITIAL_CONTEXT_FACTORY, AQjmsConstants.INIT_CTX_FACTORY);
// aqldapserv is your LDAP host and 389 is your port
env.put(Context.PROVIDER_URL, "ldap://anduin:389");
// now authentication info
// username/password scheme, user is OE, password is OE
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=orcladmin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
//env.put("server_dn", "cn=ora9_aq,cn=OracleContext");
QueueConnectionFactory qc_fact = null;
try
DirContext inictx = new InitialDirContext(env);
// initialize context with the distinguished name of the database server
inictx = (DirContext) inictx.lookup("cn=ora9_aq,cn=OracleContext");
//go to the connection factory holder cn=OraclDBConnections
DirContext connctx = (DirContext) inictx.lookup("cn=OracleDBConnections");
// get connection factory "oe_queue_factory"
qc_fact = (QueueConnectionFactory)
connctx.lookup("cn=CarnotQueueConnectionFactory");
catch (NamingException e)
e.printStackTrace();
System.out.println("\n\nRoot Cause: \n");
e.getRootCause().printStackTrace();
return qc_fact;
public static Queue getQueue(QueueSession qsession)
throws JMSException
Queue queue = null;
queue = ((AQjmsSession) qsession).getQueue("", "CARNOTQUEUE");
return queue;
private static QueueSession getQueueSession(QueueConnectionFactory qcf)
throws JMSException
QueueConnection qc = qcf.createQueueConnection("carnotaq", "carnotaq");
qc.start();
QueueSession qs = qc.createQueueSession(true, 0);
return qs;
private static void sendMessageToQueue(Queue queue, QueueSession qsession)
throws JMSException
String whatEverObject = "I'm the message's object nr. 1!";
QueueSender sender = null;
ObjectMessage objMessage = null;
sender = qsession.createSender(queue);
objMessage = qsession.createObjectMessage();
objMessage.setJMSCorrelationID("JMS1");
objMessage.setObject(whatEverObject);
qsession.commit();
private static void receiveMessageFromQueue(Queue queue, QueueSession qsession)
throws JMSException
QueueReceiver receiver = null;
ObjectMessage objMessage = null;
String whatEverObject = null;
receiver = qsession.createReceiver(queue); //EXCEPTION
objMessage = (ObjectMessage) receiver.receive();
whatEverObject = (String) objMessage.getObject();
System.out.println("Object: " + whatEverObject);
System.out.println("JMSCorrelation ID: " + objMessage.getJMSCorrelationID());
private static void browseMessages(Queue queue, QueueSession qsession)
throws JMSException
QueueBrowser browser;
ObjectMessage objMessage;
Enumeration messages;
String whatEverObject;
browser = qsession.createBrowser(queue,
"JMSCorrelationID = 'JMS1'"); //EXCEPTION
for (messages = browser.getEnumeration() ; messages.hasMoreElements() ;)
objMessage = (ObjectMessage)messages.nextElement();
whatEverObject = (String) objMessage.getObject();
System.out.println("Object: " + whatEverObject);
System.out.println("JMSCorrelation ID: " + objMessage.getJMSCorrelationID());
browser.close();
=================================================================
=================================================================
Registration Code:
==================
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Hashtable;
import javax.jms.JMSException;
import javax.naming.Context;
import oracle.jms.AQjmsConstants;
import oracle.jms.AQjmsFactory;
public class RegisterAQQCF
public static void main(String args[])
register_Factory_in_LDAP();
public static void register_Factory_in_LDAP()
Hashtable env = new Hashtable(5, 0.75f);
env.put(Context.INITIAL_CONTEXT_FACTORY, AQjmsConstants.INIT_CTX_FACTORY);
System.out.println(AQjmsConstants.INIT_CTX_FACTORY);
// aqldapserv is your LDAP host and 389 is your port
env.put(Context.PROVIDER_URL, "ldap://anduin:389");
// now authentication info
// username/password scheme, user is standard
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=orcladmin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put("server_dn", "cn=ora9_aq,cn=OracleContext");
/* register queue connection factory for database "ora9aq", host "anduin",
port 1521, driver "thin" */
try
AQjmsFactory.registerConnectionFactory(env, "CarnotQueueConnectionFactory", "anduin",
"ora9aq", 1521, "thin", "queue");
catch (JMSException e)
e.printStackTrace();
System.out.println("\n\n Root Cause: \n");
e.getLinkedException().printStackTrace();

I'm not sure at this point why you see NullPointerException,
I suspect something with the Queue. You code is running in my
environment.
If you could, please provide info on how the queue
carnotaq.carnotqueue was created (pl/sql, java api calls, etc.).
Make sure that carnotaq.carnotqueue is a type that can contain
object message payloads.
Here is the PL/SQL code I used to create the queue. You may want
to try this to see if error remains.
---- start pl/sql script ----
-- drop queue
CONNECT carnotaq/carnotaq;
execute dbms_aqadm.drop_queue_table( queue_table => 'CARNOTQUEUE', force => true
-- create queue
execute dbms_aqadm.create_queue_table( queue_table => 'CARNOTQUEUE', queue_paylo
ad_type => 'SYS.AQ$_JMS_OBJECT_MESSAGE', comment => 'single-consumer, default so
rt ordering, Obj Message', compatible => '8.1.0' );
execute dbms_aqadm.create_queue( queue_name => 'CARNOTQUEUE', queue_table => 'C
ARNOTQUEUE');
-- start queue
execute dbms_aqadm.start_queue(queue_name => 'CARNOTQUEUE');
---- end of pl/sql script ----

Similar Messages

  • My eMail can receive - send seems to work (emails in sent box) but are not actually sent - unless I am responding to an email

    I am not an iPad guy (its my wifes) but really cannot figure out what is happening.  She can receive email.  She can send email but it never gets there - it does appear in the Sent Messages and that "Whirly Gig"  spins when you think its being sent - BUT when you respond to an email it seems to work - when you send an eMail to yourself it goes out and comes back.  We had a storm last and ever since then this has been a problem.  I wonder whether it was plugged in and got a power surge but cannot remember.  As well when my wife downloads books from the library it seems to work but it does not.HELP

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • CC 2014 nik efex - My Nik Efex filters are not working in Photoshop CC 2014 - they appear under plug-ins and seem to work, but after running and clicking okay, no new layer appears - seems to have no effect.  The separate menu panel does not appear either

    My Nik Efex filters are not working in Photoshop CC 2014 - they appear under plug-ins and seem to work, but after running and clicking okay, no new layer appears - seems to have no effect.  The separate menu panel does not appear either.  Help with this?

    BINGO !!!!
    Thanks so much Woodsroad. I had the exact same problem with my Dell Windows 7 64 bit with AMD Radeon 6700 Video card.
    All the video tests passed with flying colors.
    The sniffer rename trick fixed the problem.
    Thank goodness for the internet!

  • I just used stellar phoenix mac data recovery and it seemed to work but now my files won't open.  Even though they are "jpeg, mov" files the error message is  could not be opened. The movie's file format isn't recognized. "  Any help or are they corrupted

    I just used stellar phoenix mac data recovery and it seemed to work but now my files won't open.  Even though they are "jpeg, mov" files, the error message is  "could not be opened". The movie's file format isn't recognized. "  Any help or are they corrupted?

    Sounds to me like the file is probably corrupt. If you had hard drive corruption or damage, that could easily result in recovered files not being fully intact. If you were trying to recover accidentally deleted files, it's possible they might have been partially overwritten before recovering. There are never any guarantees with file recovery.
    Without more information on the circumstances that led you to try recovery, it's hard to give advice on what to try from here. You could always try another file recovery tool, like Data Rescue 3. Just be sure you're taking appropriate precautions when doing recovery. See Recovering deleted files.

  • MacBook Pro turns on but will not load. Battery will power up and charge. The PRAM second start up seems to work, but the Apple timer continues add-infinitum. There is also a disc in the laptop so I can't load re-load software OS 10.6.1. How do I resolv

    MacBook Pro turns on but will not load. Battery will power up and charge. The PRAM second start up seems to work, but the Apple timer continues add-infinitum. There is also a disc in the laptop so I can't load re-load software OS 10.6.1. How do I resolve this problem?

    Try booting in Safe Mode by holding your Shift key down when booting. Also, try holding the eject key down when booting to eject the DVD. If you plug a mouse in and hold the clicker down when booting, that should eject the DVD.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • [Fwd: Re: Mbean method seems to work, but nothing happen]

    Forwarding to security news group for help ...
    -------- Original Message --------
    Subject: Re: Mbean method seems to work, but nothing happen
    Date: 18 Jun 2004 15:25:51 -0700
    From: Claudio Lazo <[email protected]>
    Reply-To: Claudio Lazo <[email protected]>
    Newsgroups: weblogic.developer.interest.management
    References: <40d21c98$1@mktnews1>
    Hi Folks,
    I have news about this case and maybe help you to help me find out how
    to follow
    to give the next step.
    I am using SimpleSampleRoleMapper sample at dev2dev to test my case. I
    discovered
    something I had not figure out until now.
    weblogic.management.commo.WebLogicMBeanMaker creates an class called
    SimpleSampleRoleMapperImpl.java which has my method "resetCache" but
    empty, so
    back to documentation I think i understood what they wanted to say when
    said :"
    If you included any custom operations in
    your MDF, implement the methods using the method stubs." (Located in page
    http://e-docs.bea.com/wls/docs81/dvspisec/credmap.html#1142366)
    So now I can´t find a reference to do a link between
    SimpleSampleRoleMapperImpl.resetCache()
    method
    and SimpleSampleRoleMapperProviderImpl.resetCache() method.
    So Anyone know how to make that connection, or maybe some reading I can
    do to
    write my implementation?
    Thanks again
    Claudio
    Claudio Lazo <[email protected]> wrote:
    Hi Folks,
    I have created a Custom RoleMapper Security provider, who is a MBean,
    I included a custom method called resetCache who do some reset inside
    it.
    The problem is when I try to call the method no exception is thrown,
    however no line inside the method is executed.
    So my question is if there is something I am missing, I am able to see
    with my client properties inside MBean.
    I ejecute method using mBeanHome.getMBeanServer().invoke(mBeanName, "resetCache",null,null);
    Any help is valuable, thanks
    Claudio

    Hi Folks,
    I have news about this case and maybe help you to help me find out how to follow
    to give the next step.
    I am using SimpleSampleRoleMapper sample at dev2dev to test my case. I discovered
    something I had not figure out until now.
    weblogic.management.commo.WebLogicMBeanMaker creates an class called
    SimpleSampleRoleMapperImpl.java which has my method "resetCache" but empty, so
    back to documentation I think i understood what they wanted to say when said :"
    If you included any custom operations in
    your MDF, implement the methods using the method stubs." (Located in page
    http://e-docs.bea.com/wls/docs81/dvspisec/credmap.html#1142366)
    So now I can´t find a reference to do a link between SimpleSampleRoleMapperImpl.resetCache()
    method
    and SimpleSampleRoleMapperProviderImpl.resetCache() method.
    So Anyone know how to make that connection, or maybe some reading I can do to
    write my implementation?
    Thanks again
    Claudio
    Claudio Lazo <[email protected]> wrote:
    Hi Folks,
    I have created a Custom RoleMapper Security provider, who is a MBean,
    I included a custom method called resetCache who do some reset inside
    it.
    The problem is when I try to call the method no exception is thrown,
    however no line inside the method is executed.
    So my question is if there is something I am missing, I am able to see
    with my client properties inside MBean.
    I ejecute method using mBeanHome.getMBeanServer().invoke(mBeanName, "resetCache",null,null);
    Any help is valuable, thanks
    Claudio

  • I can't read acsm files on my e-reader after transferring them from the pc with ADE. it seems to work, but then when I try to open the files on the e-reader it says "open failure". what's wrong?

    I can't read acsm files on my e-reader after transferring them from the pc with ADE. it seems to work, but then when I try to open the files on the e-reader it says "open failure". what's wrong?

    The acsm file is not the book, it is a ticket to get the book.  I sometimes get library books online, here is what I do.
    1. Start ADE on the computer
    2. Go to library website and find the book I want to download.
    3. Click on the download link
    4. In windows 7 a box opens asking whether I want to open( or run) or save the acsm file
    5. Click open/run and ADE downloads the book into the "Library"
    6. Transfer the book (epub file) to the reader.

  • I dropped my phone in a toilet, the sound and vibrate are working but the screen will not turn on, what should I do?

    I dropped my phone in a toilet, the sound and vibrate are working but the screen will not turn on, what should I do? do I just need a new screen or what? I'm freaking out here

    Don't freak out, just get over it. It's probably done.
    What should I do if I drop my phone in the toilet?
    Apple may offer you an refurbished iPhone in exchange for yours, for about half the cost of a new one.
    I wouldn't be too specific about just how it got wet

  • Just got a new iPad 2.  64 GB.  It will connect to wifi and facetime works, but email and internet won't connect.  Suggestions?  Thanks!

    Just got a new iPad 2.  It is 64 GB.  It will connect to wifi no problem and facetime works, but email and internet won't connect.
    Suggestions?
    Thanks!

    If facetime works, then the internet IS connecting.

  • Java works, but jar and javac don't

    java at the command line works, but jar and javac don't
    could it be the CLASSPATH
    I'm running Windows if that helps. If you need more info ask away
    Thanks
    CINC

    Definitely sounds like the classpath problem. From the sounds of the error message, you are using win95/98/ME, and so the best way to get around this is to set the classpath in your autoexec.bat file. I think the problem is because you have to set 2 variables in your path, one for the running of the java (JRE) and one for the tools to process the uncompiled files (SDK);
    rightclick on your autoexec.bat and select Edit
    here is my path, change yours accordingly so the paths lead to your windows, command and bin directories accordingly.
    PATH=D:\WINDOWS;D:\WINDOWS\COMMAND;D:\PROGRAM FILES\JAVASOFT\J2SDK1.4\BIN
    SET CLASSPATH=.;D:\PROGRAM FILES\JAVASOFT\J2SDK1.4\BIN\TOOLS.JAR
    Theres a section on setting classpath in This site at :
    java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html
    and if that doesn't work, then i recommend you download and IDE which sorts ou most of these problems for you, and makes programming much easier also :)
    anything from:
    Suns Forte
    Jcreator
    Jbuilder
    to a real heavyweight which i use and find indispensible called Visual Age for Java, which is so powerful, but not for the faint hearted or weak-computered. :P
    Good Luck
    Benji

  • The mic is not working on skype, and its not muted

    Every time my sister or myself go to use Skype on the IMac, the mic does not work, we can hear the person on the other end but they can not hear us, the mic is not muted, and when you go into the sound settings the mic is on the proper setting from what I can tell, and when I go into speech (under speech recognition) the microphone option for built-in microphone is grayed out. I don't what exactly this all means, but if someone else does, and can help me fix this problem I would greatly appreciate it.

    I find it quite frankly perthetic that this issue still occurs and is simply ignored by Apple. You find this problem over and over, mic doesn't seem to work, but calibration does pick up sound, and there is no clear indication what is wrong, and what could possibly be done about it.
    Like Dragonlover above, I have the same problem, and while looking through various Forums, I see that A LOT of other customers have the same issue. Help on this is virtually been zero from Apple. I now need to use an external mic which is just what I had in mind when I bot the Macbook Air...
    Hope that the next 56 views will not just look and leave but post of they have the same problem, just to show how utterly sad it is that this is clearly a problem not just on the iMac, but on all Macbooks too. Sad Apple...just sad...

  • Problem on ios 7.0.4 on iphone  enable your mobile data uncheck to green (enambled) works great ring and shows who ringing may work on 4s and five not tested please try get back to me thanks

    on iphone  enable your mobile data uncheck to green (enambled) works great ring and shows who ringing may work on 4s and five not tested please try get back to me thanks

    I'm sorry, but you are going to have to try a little better to explain your issue and what your question is, or post in your native language.

  • IPAD Mini Locked after iOS upgrade, tried reset on iPAD did not work, plugged in and device not appearing in iTUNEs for reset/restore

    PAD Mini Locked after iOS upgrade, tried reset on iPAD did not work, plugged in and device not appearing in iTUNEs for reset/restore.  Just get an Apple Logo then a flashing blue screen as if it is caught booting up.   This has happened twice before and iTunes restore fixed it.  But this time device not appearing in iTunes.
    Running iTunes for PC.  But as stated restore has worked before!  Any help greatly appreciated!!

    Place the device in DFU mode and let iTunes restore the device to factory condition.

  • My firefox works but my safari will not load anything

    my firefox works but my safari will not load any websites

    What OS version are you running?
    10.10
    Safari/Preferences/Advanced - enable the Develop menu, then go there and Empty Caches. Quit/reopen Safari and test. Then try Safari/History/Show History and delete all history items.  Quit/reopen Safari and test. You can also try try Safari/Clear History and Web Site Data. The down side is it clears all cookies.Doing this may cause some sites to no longer recognize your computer as one that has visited the web site.
    Earlier.
    Safari/Preferences/Advanced - enable the Develop menu, then go there and Empty Caches. Quit/reopen Safari and test. Then try Safari/History/Show History and delete all history items.  Quit/reopen Safari and test. You can also try try Safari/Reset Safari. The down side is it clears all cookies.Doing this may cause some sites to no longer recognize your computer as one that has visited the web site.

  • My printer HP photosmart was working but now says printer not responding. Wireless network test came back with no problems. Any suggestions on how to fix this?

    My printer HP photosmart was working but now says printer not responding. Wireless network test came back with no problems. Any suggestions on how to fix this?

    marie274 wrote:
    My printer HP photosmart was working but now says printer not responding. Wireless network test came back with no problems. Any suggestions on how to fix this?
    What exactly happens between the the time the printer was last working well and no on your system? Any updates or upgrades?
    Lupunus

Maybe you are looking for

  • Report to find total absences of all the employees for 2006

    we have to find the total absences of all the employees for the year 2006. is there any good report to do this job

  • Missing tools in photoshop CS4

    Hi there, I've just taken the plunge and bought Photoshop CS4.  I installed it but when I first went to use it it appears that the tool palette is incomplete.  The magic eraser isn't there.  The plain old eraser is, but there is nothing behind it.  T

  • Doubt in select in to statement

    In employees table employee_id first_name last_name are columns. Written Following pl/sql and it compiles fine create or replace procedure passEmp(employee_id number,colname varchar2) as sname varchar2(50); begin select colname into sname from employ

  • Reader X not compatible with PowerPoint?

    I frequently create Microsoft PowerPoint presentations with linked PDF documents. This has never been a problem until the update to Reader X - now, when attempting to open a linked PDF from Show mode in either PowerPoint 2003 or 2007, the PowerPoint

  • Purchasing Groups deleted: Errors when processing related documents

    Hi Gurus, We are on SRM 7 and we are currently facing an issue when processing documents which Purchasing Groups have been deleted after thee procurement documents were created In our case, when a PGroups is deleted and unassigned, an interfase from