2
votes

I am new to java, I am trying to write a jms project in eclipse using weblogic server.

I created a connection factory and queue in oracle weblogic and wrote a sender class but when I run my class I saw in the error logs:

java.lang.IllegalArgumentException: Project facet oracle.adf.web has not been defined

How can I fix this

my class is below:

package jms.learning;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

import javax.jms.*;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class JMSQueueSender {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        JMSQueueSender jms=new JMSQueueSender();
 jms.sentMessage();
    }

    public void sentMessage(){

        InitialContext ctx=null;

        try {
            QueueConnectionFactory cf=(QueueConnectionFactory) ctx.lookup("jms/ConnectionFactory");
            QueueConnection con=cf.createQueueConnection();
            con.start();
            QueueSession ses=con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            Queue test=(Queue) ctx.lookup("jms/QueueConnection");
            QueueSender sender=ses.createSender(test);
            TextMessage msg=ses.createTextMessage();

            Scanner scan=new Scanner(System.in);

                System.out.println("Enter your message");
                while(scan.hasNext()){
                String s=scan.nextLine();

                    msg.setText(s);
                    sender.send(msg);
                    System.out.println("Message sent succesfully");
                }


        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 
    }
}
1

1 Answers

5
votes

I've noticed this log message doesn't appear when AppXray is disabled.

Window -> Preferences -> Oracle -> AppXray -> Disable AppXray

I've found disabling this feature beneficial since it resolves workspace issues, like the error log message.

Either way, this is a bug with the eclipse toolset and not your code.