How to Run a simple program using JMS Queue.!!

Hi All,
I am trying to run simple program on JMS Queue.
Using SOA Suite 10.1.3.2
I created a connection factory and queue using EM.
Connection Factory => Domain : Queue JNDI Location : jms/sidConnectionFactory
Queue Name : SidQueue JNDI Location : jms/SidQueue
Tried running a simple java class to send the messages to queue.[Pls find the file attached].
Getting this error
javax.naming.NamingException: META-INF/application-client.xml not found (see J2EE spec, application-client chapter for requirements and format of the file)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getRequiredClasspathResource(ApplicationClientInitialContextFactory.java:239)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getArchive(ApplicationClientInitialContextFactory.java:161)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:111)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
Can some one tell me how i need to create this file and where to place this[i.e is this need to be placed in  my project or some directory structure of <SOA-HOME>
Thx,
Siddhardha.
Code:
package demo;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
import javax.jms.*;
import javax.naming.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class JMSQueue {
    public static void main(String args[])
QueueConnection queueConnection;
QueueSession queueSession;
//private MessageProducer producer;
QueueSender queueSender;
try {          
String message = "Test";
String connectionFactoryName = "jms/sidConnectionFactory";
String destinationName = "jms/SidQueue";
/*Do i need to use this .......
* If so where is the error in below statements...
* Properties env = new Properties( );
// ... specify the JNDI properties specific to the vendor
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationClientInitialContextFactory");
env.put(Context.PROVIDER_URL,
"ormi://localhost:23791");
Context ctx = new InitialContext();
// Get the connection factory.
QueueConnectionFactory cf = (QueueConnectionFactory)ctx.lookup(connectionFactoryName);
// Get the destination.
Queue destination = (Queue) ctx.lookup(destinationName);
// Use the connection factory to create a connection.
queueConnection = cf.createQueueConnection();
// Start the connection.
queueConnection.start();
// Use the connection to create a session.
queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
// Use the session and destination to create a message producer and a message consumer.
//producer = queueSession.createProducer(destination);
queueSender = queueSession.createSender(destination);
TextMessage msg = queueSession.createTextMessage(message);
queueSender.send(msg);
queueSession.close();
queueConnection.close();
catch (Exception ex) {
ex.printStackTrace();
* Attached following libraries to the Project
* jms.jar
* optic.jar
* oc4jclient.jar
*/

Hi,
You need to change the INITIAL_CONTEXT_FACTORY to com.evermind.server.RMIInitialContextFactory.
Regards,
Sandeep

Similar Messages

  • How to run a java program using additional jar files

    Hi everyone in the forum,
    i ve created an app using the hFreeChart in eclipse, so i added them as external jar files and tested the program.
    now my problem is that the program should run using a terminal in win and i do not know how can i do to make the command line or the system to find them, i added to the path but i read somtehing about classpath, but i have no idea. if anyone can help?
    thanks in advanced

    Actually, the best way to prepare a program for regular running is to make it an executable jar file, which means adding a manifest file which contains (at least) a Main-class: and a Class-Path: line. Referenced class libraries typically sit in a lib directory next to the java file. Then you can run it using java -jar myprog.jar.
    Failing that create a batch file or link that supplied java with command line parameters including a -classpath=
    Using the class path environment results in too much contention between competing values of it.

  • How to run a simple program with main?

    I have a simple class with main, something like the following:
    public static void main(String[] args) {
    Is it possible to run / execute this main from within workshop?

    In SP2 we've made it very easy to automatically set the main class name
    when you first try to run a class in a Java project that doesn't have
    already have debugging configured.
    More generalized ways to easily run a class with a main method are
    already on the list for the next release.
    Thanks for the feedback,
    Josh
    Carl wrote:
    Thanks, that worked:)
    Workshop should consider dealing with simple classes with main much
    simpler...
    "Josh Eckels" <[email protected]> wrote in message
    news:3f96f8c1$[email protected]..
    Yes, you can run and debug it, but it needs to be in a Java project. If
    it's not already in one, create a new Java project and copy in the
    source. Go to the Project Properties, and select the Debugger settings.
    Enter the class that contains the main method. If you'd like, you can
    set the checkbox for Build before Debugging so that you are always
    running off the current source code.
    You should then be able to run the project after building it.
    Josh
    Carl wrote:
    I have a simple class with main, something like the following:
    public static void main(String[] args) {
    Is it possible to run / execute this main from within workshop?

  • How to run a Concurrent Program from the back end?

    Hi,
    How to run a Concurrent Program from the back end?
    Is it Possible to see that Concuurent Request id which we run from the back end, in the front end?
    If yes, then Please Give reply how to write the code
    Thanks in Advance,
    Bharathi.S

    This is documented in Chapter 20 of the Application Developers Guide http://download.oracle.com/docs/cd/B53825_03/current/acrobat/121devg.pdf. These MOS Docs also have some information available
    221542.1 - Sample Code for FND_SUBMIT and FND_REQUEST API's
    235359.1 - How to Launch Planning Data Pull MSCPDP using FND_REQUEST.SUBMIT_REQUEST
    HTH
    Srini

  • How to run a ABAP Program in Batch JOB

    How to run a ABAP Program in Batch JOB ?

    Hello Manish,
    Using transaction SM36 you can define the batch job along with the start conditions for that job.
    1. Transaction SM36.
    2. Give the Z name of the job in the 'Job Name' input field.
    3. Click on 'Steps' button from the application toolbar.
    4. On the 'Create Step 1' dialog box, give the name of the ABAP program in the 'ABAP Program' section' along with the variant.
    5. Click on 'Check Input' button from the dialog box.
    6. Click on 'Save' button from the dialog box once the check is successful.
    7. One list will be shown. Click on Back button from the standard toolbar.
    8. Click on 'Start Conditions' button from the application toolbar. Specify the start condition e.g. immediate. Click on save.
    9. The job staus is now scheduled.
    10.Click on Save button from the standard toolbar of SM36. The job status will be released.
    Using SM37 you can monitor the status of the job.
    This will sort out your problem.
    PS If the answer solves your query, plz reward points.
    Regards

  • How to run a java program in another folder

    Hello!
    I want to run for example the java class file in the path ./sourcecode/javafile.class. It works fine if I do the following:
    cd sourcecode
    java javafile
    but it cannot work if I do:
    java sourcecode/java
    The error it outputs is NoClassDefFoundError.
    Can someone tell me how to run a java program in another folder
    thanks a lot.

    You need to specify the classpath using the -cp flag when running. so instead of
    "java sourcecode/javafile"
    Try
    "java -cp sourcecode javafile"

  • How to run the simple jsp on oracle 9ias application server?

    hi,
    how to run the simple jsp application jst disply the date on oracle 9ias application server?
    can any expline the steps how to do it?
    thanks
    pullareddy

    No, you need the Reports Server (as part of the Application Server or Weblogic, depending on your version).
    I try to save the report, it's saved as .jspThat depends. You can save it as a .rdf file too (so called Paper Layout). I think this option is used more often.

  • How can i make simple program to match colors ?(photos taken by camera)

    how can i make simple program to match colors ?(photos taken by camera)

    Hi khaledyr,
    use a "random number" and compare for ">0.5" to get a (1 or 0) signal
    What exactly are you searching for?
    - Hints for choosing hardware?
    - How to output voltage or relais signals?
    - Help on using DAQ(mx)?
    - Help on generating (boolean) waveforms?
    Message Edited by GerdW on 04-16-2010 08:15 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to run automatic payment program business area wise

    dear all
    please let me know how to run automtic payment program business area wise.
    for example business area 2020 we want to make payment business area wise.
    what are the back gorund settings for congigration Tc- fbzp
    wht are the configrations forTC- f110
    regards
    babu

    Hi,
    You can make payments business area wise if you had ticked payment goup business area wise in the payment method in company code screen. However you will have to give company codes in the payment parametets, but payments will be grouped by business area.
    Thanks,
    Ramesh.

  • How to run the Servlet program?

    hi, all, I am new to servlet, and I want to know how to run the servlet program. I got the TomCat and Java JDK install in my computer, something else I need for create and run the servlet program?

    no that is all u need to run servlets. u can try few of the servlets that come with tomcat

  • How to run report from form using run_object_report

    I AM USNING FORMS9I/REPORTS 9I , HOW TO RUN REPORT FROM FROM USING RUN_REPORT_OBJECT AND HOW
    TO PASS PARAMETER AS WE DID IN RUN_REPORTS PLEASE HELP ME

    here an example !
    I hope this example you can use it
    PROCEDURE pr_reporte IS
    BEGIN
    DECLARE
         repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    d1 DATE;
    d2 DATE;
    BEGIN
         d1 := :GLOBAL.DIA_INI;
         d2 := :GLOBAL.DIA_FIN;
         repid := find_report_object('rep_lab02');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'p_fec_uno='||to_char((add_months(last_day(d1),-1) +1),'DD/MM/YYYY')||' '||
         'p_fec_dos='||to_char(d2,'DD/MM/YYYY'));
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' then
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver','_blank');
         ELSE
              ventana('E','error reporte no encontrado','S');
         END IF;
    END;
    END;
    The 'rep_lab02' is the name of the report that you give in the node reports
    p_fec_uno and p_fec_dos they are the parameters in the report
    repserver is the name of server created with rwserver
    Greetings

  • How to run the package programs in eclipse ?

    hi all,
    how to run the package programs in eclipse ?
    plz clarify...
    regards
    balakrishna.m

    package source code is
    package package1;
    public class ClassaA
              public void displayA()
                   System.out.println("class A");
         }java source code is import package1.ClassA;
         class Packagetest1
              public static void main(String args[])
                   ClassA objectA = new ClassA();
                   objectA.displayA();
         }if i write the notepad means its executing successfully..
    but in eclips is not working..
    plz help me..

  • How to run windows application programs in mac book pro, how to run windows application programs in mac book pro

    how to run windows application programs in mac book pro, how to run windows application programs in mac book pro

    Install Windows..either by Boot Camp or via virtual machine from VMWare, Parallels or Virtual Box

  • How to know what CBO programs uses transaction codes

    Hello Everyone,
    How to know what CBO programs uses transaction codes?
    Thanks for the help!

    Hi,
    Please clarify your question ....
    for e.g. give program name

  • Need help on how to create the simple mapping using ORACLE DATA INTEGRATOR

    Hi guys,
    am new to learn odi.. please share me or steps how to develop the simple mapping using ODI...

    Hi,
    I am a newbie to Oracle Data Integrator as well. You should have a look here first; http://www.business-intelligence-quotient.com/?p=379
    Try to play around with ODI and then come back if you have specific questions. You should better move to this ODI-forum; Data Integrator
    Good Luck,
    Daan Bakboord
    http://obibb.wordpress.com

Maybe you are looking for

  • Subcontract Challan Reconcilation

    Hi all, We are using the standard functionality of Subcontracting.Here is the prob. description with e.g. As per our challan report(J1IFR) the balance quantity of a material at vendor end is 100Kg. But when we run MBLB the quantity is 10kg only. Pls

  • Openldap, jndi, ssl openssl keystore problem

    I am trying to get a connection between openldap and a java application using jndi. The connection needs to be secure so I want to use ssl. I only want the server to have to have a certificate. I am having troubles creating the right certificates (se

  • Wall charger and travelling to Europe

    I've got a 5G video ipod. I'm about to go to europe and need a wall charger to charge my ipod as i won't have a laptop with me to charge it via usb port. With my old 2G ipod, the apple wall charger converted the 220V in Europe nicely . Should I purch

  • Problem installing Flash 9.0 I get "access error code"

    Up until about a week ago I had Flash installed like every other human on the planet. But then one night flash was gone from my internet. Everywere I went I got the little puzzle piece icon telling me to go and reinstall Flash 9. So I follow the link

  • IPhoto 6 - PE 4 "Save As" tip needed

    I've created an Album in iPhoto 6 ("NC Cabin") and edit the photos there in Photoshop Elements 4. The problem I run into is in how to choose the "NC Cabin" album for saving the edited file. It seems my only option is to save this new file in "Picture