Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot access the binding layer from a managed bean that implements MessageListener

Tarek BakrMay 27 2018 — edited May 27 2018

Hi

My Jdeveloper version is 12.2.1.1.0

I have a client application that sends message through JMS to My ADF web application.

My ADF application receives the messages successfully.

My problem is that I want to insert new row in an iterator upon receiving this message.

This is my managed bean

public class DmsDhamanDocTrx implements MessageListener {

private TopicSession session;
private TopicSubscriber subscriber;
protected TopicConnectionFactory tconFactory;
private boolean quit = false;
private TopicPublisher tpub;

And this is the body on the onMessage method

@Override
public void onMessage(Message msg) {
    System.out.println("On Message Fired ************************");
    if (msg instanceof TextMessage) {
        try {  
            String command = msg.getStringProperty("CMD");
            System.out.println("command >>" + command);
            System.out.println("Messages Recivied");       
            if (command.equalsIgnoreCase("SCAN_DONE")) {              
                    DCBindingContainer currentinding = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
                      DCIteratorBinding iterator= currentinding.findIteratorBinding(“Iterator_name”);
            }         
        } catch (Exception e) { 
            e.printStackTrace();
        }
    }
}

The error java.lang.NullPointerException is raised at the following lines

                         DCBindingContainer currentinding = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();

                        DCIteratorBinding iterator= currentinding.findIteratorBinding(“Iterator_name”);

can any one help me please

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2018
Added on May 27 2018
6 comments
279 views