Oc4j JMS samples

hi all
i need to work on oc4j jms and i tried to download jms samples by searching google
all links i found are broken at oracle site
for example in the following link also links are dead http://radio-weblogs.com/0135826/2004/03/23.html
can anybody have these oc4j samples, please give me some live links
thanks
siva k

Radim Kolek ,
its not there in OC4J_Production9.0.2 bundle..
but i can see that in J2EE folder JDeveloper production bundle....
Cheers
--Venky

Similar Messages

  • JMS sample code not working

    Hi,
    I am new to JMS and am trying to learn the technology. When I tried to run the JMS sample codes available at http://www.oracle.com/technology/sample_code/tech/java/jms/index.html, I got the following error:
    [java] javax.naming.NoInitialContextException: Cannot instantiate class: co
    m.evermind.server.rmi.RMIInitialContextFactory [Root exception is java.lang.Clas
    sNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory]
    Please help me solve the problem. I find that, the downloaded code does not contain the class mentioned in the error message. Also, I do not see how the code is interacting with the OC4J server. It would be great if anyone could clarify.

    hi adith,
    the problem you are facing can be removed by adding oc4jclient.jar as libraray.
    But after that i am facing following error.
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/JMSEndpointStats
         at com.evermind.server.jms.EvermindSession.createProducer(EvermindSession.java:311)
         at warid.com.jms.JMSProducerConsumer.performMessagingOperations(JMSProducerConsumer.java:80)
         at warid.com.jms.JMSProducerConsumer.main(JMSProducerConsumer.java:42)
    Regards

  • How to insert message in OC4J JMS from standalone java client.

    Hi,
    I have been following available examples for creating standalone java clients to insert messages in JMS queues.
    I am able to insert using java client when the SOA suite and the standalone java code are on same machine.
    package producerconsumerinjava;
    import javax.jms.*;
    import javax.naming.*;
    import java.util.Hashtable;
    public class QueueProducer
    public static void main(String[] args)
    String queueName = "jms/demoQueue";
    String queueConnectionFactoryName = "jms/QueueConnectionFactory";
    Context jndiContext = null;
    QueueConnectionFactory queueConnectionFactory = null;
    QueueConnection queueConnection = null;
    QueueSession queueSession = null;
    Queue queue = null;
    QueueSender queueSender = null;
    TextMessage message = null;
    int noMessages = 5;
    * Set the environment for a connection to the OC4J instance
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
    env.put(Context.SECURITY_CREDENTIALS, "mypass");
    env.put(Context.PROVIDER_URL,"ormi://myserver.company.com:12402"); //12402 is the rmi port
    * Set the Context Object.
    * Lookup the Queue Connection Factory.
    * Lookup the JMS Destination.
    try
    jndiContext = new InitialContext(env);
    queueConnectionFactory =
    (QueueConnectionFactory) jndiContext.lookup(queueConnectionFactoryName);
    queue = (Queue) jndiContext.lookup(queueName);
    catch (NamingException e)
    System.out.println("JNDI lookup failed: " + e.toString());
    System.exit(1);
    * Create connection.
    * Create session from connection.
    * Create sender.
    * Create text message.
    * Send messages.
    * Send non text message to end text messages.
    * Close connection.
    try
    queueConnection = queueConnectionFactory.createQueueConnection();
    queueSession =
    queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    queueSender = queueSession.createSender(queue);
    message = queueSession.createTextMessage();
    for (int i = 0; i < noMessages; i++)
    message.setText("Message " + (i + 1));
    System.out.println("Producing message: " + message.getText());
    queueSender.send(message);
    queueSender.send(queueSession.createBytesMessage());
    catch (JMSException e)
    System.out.println("Exception occurred: " + e.toString());
    finally
    if (queueConnection != null)
    try
    queueConnection.close();
    catch (JMSException e)
    System.out.println("Closing error: " + e.toString());
    But when the SOA Suite is remote, I am struggling to get the settings correct
    Till now, here is what I have figured out from looking at blogs/tars etc on the Net:
    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactory (http://download.oracle.com/docs/cd/E14101_01/doc.1013/e13975/jndi.htm)
    2. The project should have a META-INF/application-client.xml file, which may be dummy (http://www.wever.org/java/space/Oracle/JmsTar1). Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.
    Errors:
    When trying to run exact same code on local server that tries to enqueue JMS on remotee serverer
    Exception occurred: javax.jms.JMSException: Unable to create a connection to "xxxxxxx.yyyyyy01.dev.com/10.42.456.11:12,602" as user "null".
    Any help is greatly welcome.
    As an exercise, I copied this complete code on the server and then ran locally using a telnet client...it worked. So the problem is coming when accessing the server remotely.
    Rgds,
    Amit

    1. I need to use ApplicationClientInitialContextFactory instead of RMIInitialContextFactoryNot necessarily.
    2. The project should have a META-INF/application-client.xml fileThat's only necessary if going the ApplicationClientInitialContextFactory route.
    There are two types of JMS client applications you can write -- a pure/plain Java app, and an "AppClient". That first is your everyday run-of-the-mill Java application, nothing special. That latter is a special, complicated beast that tries to act as a part of the whole client/server/J2EE architecture which provides you with a semi-managed environment. Either can be made to work, but if all you need is JMS access (using plain OC4J JMS factory/queue names and not JMS Connector names), then the first is easier to get working (and performs a tiny bit better as well due to being a lighter-weight solution).
    I think the problem you are having might be: When you use the plain Java client solution, you do not have any type of management, and that includes user management. With no user management (and if the JMS server is not configured to allow anonymous connections) you need to include the username and password in the call to createConnection. (I think it may be that this is actually true in the AppClient case as well -- I avoid using the AppClient model as much as possible so my memory there is weaker.)
    If you prefer to go the AppClient route, I would point you to a demo I wrote which had a functioning example, but Oracle seems to have removed it (and all of the 10.1.3 demos?) from OTN. :-(
    Hmm, it seems to still be available on the wayback machine:
    http://web.archive.org/web/20061021064014/www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
    (Just look down the page for "With OEMS JMS (In-Memory and File-Based)" -- there is an .html document with info, and there is a .zip file with source code.)
    Question is, my code is there in a single absolutely standalone code..how I can use this application-client.xml and where it has to be placed.The app client in my demo had the following directory structure:
    myjavaclient.class
    jndi.properties
    META-INF\MANIFEST.MF
    META-INF\application-client.xml
    META-INF\orion-application-client.xml
    When you use ApplicationClientInitialContextFactory I think it just looks under .\META-INF for the .xml files.
    -Jeff

  • Message posted from BPEL not found in oc4j JMS queue

    Hi,
    I am facing a weird problem when I try to post a message in oc4j JMS from a BPEL process.
    There is no exception(Not even in the logs) and the BPEL process gets completed. But the message is missing(Could not find it while monitoring the queue).
    I am using SOA suite 10.1.3.5 and the oc4j JMS queue which comes with the installation.
    Can someone help me please.
    Saptarishi
    Edited by: saptarishi on May 25, 2010 3:51 PM

    Got a solution.

  • Password for Oc4j JMS in SOA Suite

    Hi,
    If I want to connect to OC4J JMS from an external application, so that the external application can insert message in queue (say a file persisted queue, that is being managed by the OC4J JMS), I would need to share the hostname, user id and pwd with the client.
    Problem is, the pwd for the OC4J JMS is oc4jadmin password, which I dont want to share with clients for obvious reasons. So is it possible to set the OC4j JMS password to be something other than the oc4jadmin password.
    TIA
    Amit

    You do not need to use admin to connect to OC4J JMS -- you can use any user that has RMI login permission. Just create a new user, give it RMI login permission, and then give the client that username/password. (That's assuming you're OK with giving the client RMI login permission of course.)
    -Jeff

  • OC4J/JMS Queue Listener

    Hello,
    Have a simple test JMS client that is listening for messages posted to a JMS queue setup in the OC4J/JMS. While the messages are ending up in the proper queues [this can be verified via a queue browser] the listener does not seem to be getting any notifications. The receiver code is essentially,
    queueConnection = queueConnectionFactory.createQueueConnection();
    QueueSession queueSession = queueConnection.createQueueSession(
                             false,
                             Session.AUTO_ACKNOWLEDGE);
    QueueReceiver queueReceiver = queueSession.createReceiver(queue);
    System.out.println("Set Listener");
    queueReceiver.setMessageListener(new OracleListener());
    queueConnection.start();
    This is from a remote client for both the sender and the reciever. Any help would be much appreciated.
    Vinay Menon

    I am investigating this issue myself.   I have come up with two possible scenarios.
    1.  Do it in Java -- Of course this defeats the purpose of using SOA Suite.  In the book SOA Suite 11g handbook, chapter twelve he has a jms adapter publishing to a queue and a java program listening to that queue.    http://technology.amis.nl/2010/09/21/soa-suite-11g-handbook-chapter-complements/
    you can refer to the TheFinancialApplication.
    2.  If you have access to the Jms programs that publish the messages to the queue (that your programs want to listen to) and they are done in SOA Suite 11g, you could use Event Delivery Network (EDN) to create a event on the publishing side-- and then set up your listening processes to listen for that Event (which is jms under the hood).
    You could then have those processes kick off from that event.
    Anyone with a better idea?
    -- Update 8 hours later  -- I have a better idea:
    I created a composite that publishes a JMS message to a queue on weblogic using the jms adapter.  I created a second composite with a jms adapter (on the Exposed services side of the composite)  that Consumes a message, hooked it up to a mediator and then wrote the contents of the message to a file.  Uploaded both.
    Moments after the JMS publisher Composite ran, a file was created.  From this I would surmise that you could run other processes as well.
    -- Update two days later.   So much for the better idea.
    Given that the Flow Trace of the last test looked suspiciously like this one one application and not two separate applications, I decided to test it further.  I have two PCs.  On each PC I have a soa domain, Uploaded the jms publisher to one domain, and the JMS Consumer to the other separate domain on the other PC.   Ran the publisher, and the other one just sat still -- didn't start at all.
    The first test was too good to be true!
    Stuart

  • Is JMS 1.0.2 Supported in OC4J JMS 10.1.2 adaptor

    Hi
    I am wondering if JMS 1.0.2 is Supported in OC4J JMS 10.1.2 adaptor.
    Thank you
    Wade Adams
    Message was edited by:
    user617346

    Just wanted to update with what I found out incase anyone else needs this information:
    The SRE 505 eGate JMS Reference PDF file, indicates that SRE JMS is compliant with JMS version 1.0.2. In ICAN 505, the JMS server is compliant with JMS version 1.0.2b.
    Also OC4j 10.1.2 adaptor is compliant iwth JMS version1.0.2b.

  • OC4J JMS Message retries

    Hello,
    I'm using OC4J JMS on OC4J 9.0.4. I have a message I want to X times. (X is normally 1, but could be more :| ) We have the requirement of supporting both OracleAQ JMS and OC4J JMS.
    If there is an exception I currently rollback, but with OC4J JMS this means it attempts to redeliver again - forever.
    Is there a way to set the maxiumum retries for OC4J JMS! We badly need this functionality.
    We have it when using OJMS (OracleAS JMS), we just set the max-retries when we create the queue!
    I'm horribly tempted to throw an exception so that we can use "JVM property: oc4j.jms.listenerAttempts", which is only used when exceptions are thrown. If I do this how will this affect the way OJMS works?
    Thanks in advance.
    Mark

    Ok, so I tried throwing a RuntimeException to force a rollback. This happens, and the message is redelivered.
    However oc4j.jms.listenerAttempts appears to be ignored. Either the default, or when I specify the property as a system property starting my enqueuing client (java ... -Doc4j.jms.listenerAttempts=1 ...).
    Anyone help me out here?

  • OC4J/JMS question

    Is there a possibility to send messages to OC4J/JMS queue from remote client program?

    Yes, exactly this way I obtain a connection factory. Here is piece of code, how I do it:
              env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
              env.put(Context.SECURITY_PRINCIPAL, "admin");
              env.put(Context.SECURITY_CREDENTIALS, "admin");
              env.put(Context.PROVIDER_URL, "ormi://localhost:23791/");
              Context context = new InitialContext(env);
              QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("jms/my/test.queueConnectionFactory");
    Then I obtain a connection, lookup my queue and create sender:
    QueueConnection connection = connectionFactory.createQueueConnection();
              QueueSession qSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
              Queue q = (Queue)context.lookup("jms/my/test.queue");
              QueueSender sender = qSession.createSender(q);
              connection.start();
    Then I try send my message and it fails on sender's send method:
    TextMessage message = qSession.createTextMessage();
    message.setText("Text message text");
    sender.send(message);
    And exception is:
    javax.jms.JMSException: Unable to connect to JMSServer (/127.0.0.1:9127)
         at com.evermind.server.jms.EvermindQueueConnection.connect(E[i]Long postings are being truncated to ~1 kB at this time.

  • OC4J JSP SAMPLE

    Dear Sir/Madam,
    Can i deploy/run jsp page of oc4j jsp sample on tomcat server ?
    Best regards
    boris

    Hi Boris,
    The JSP samples were developed for OC4J. They include some samples that use EJB's(Enterprise Java Beans) which you cannot run under Tomcat. Also, there are some samples that demonstrate the use of OC4J JSP utility tag libraries and javabeans which need OC4J JSP libraries.
    We would suggest that you deploy these samples under OC4J which comes packaged with the required libraries. You can download OC4J from the following location:
    http://otn.oracle.com/software/products/ias/devuse.html
    Regards,
    Srinivas

  • Use OC4J jms provider in a java application

    Hi all,
    I'd like to send messages in a OC4J queue (declared in jms.xml) using a java application, is it possible?
    Thank in advice, Cesare
    I read messages by a servlet using this code:
    factory = (QueueConnectionFactory)new InitialContext().lookup("jms/myQueueConnectionFactory");
    queue = (Queue) new InitialContext().lookup("jms/myQueue");
    connection = factory.createQueueConnection();
    connection.start();
    QueueSession queueSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    QueueReceiver receiver = queueSession.createReceiver(queue);
    Message message = receiver.receive();

    hi
    if you wish to know how to send and recieve messages from a queue then there is a sample application available at the following link.
    http://otn.oracle.com/sample_code/tech/java/oc4j/samplesPage.html
    try the ch19 sample.
    hope this helps
    regards
    shrinivas

  • SOAP over JMS sample BPEL Process

    Hi ,
    Does any one has the sample BPEL Process code for SOAP/JMS protocol bindings on Oracle Weblogic server ?
    This is very urgent , any help is appreciated !
    Regards,
    Sam

    Have the same requirement.

  • JMS Sample code hangs.....

    Hi guys,
    i have tried a sample client code for JMS with Sun Appl Server.
    but that one is getting hang after i has sent the messages to destination.
    can anyone pls give me some of your examples and tell me how to deploy them before running the application
    thanx in advance.
    --Subbu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    maybe you have an infinite loop in there waiting for a response message from some other component that you've not (yet) installed?

  • JMS Sample Application

    I'm having difficulty getting the sample JMS application to work. I get the first client window that says "Ready to receive SOAP messages", but when I open the second window, it makes it as far as "Convert the message to JMS message" and quits. Here's the error I get:
    WARNING: ACC003: Application threw an exception.
    java.lang.NoClassDefFoundError: com/sun/messaging/xml/MessageTransformer
    at samples.jms.soaptojms.SendSOAPMessageWithJMS.send(Unknown Source)
    at samples.jms.soaptojms.SOAPMessageWithJMSClient.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:23
    7)
    at com.sun.enterprise.appclient.Main.<init>(Main.java:425)
    at com.sun.enterprise.appclient.Main.main(Main.java:97)
    Has anyone gotten this to work? At first I thought it might have to do with the OS I installed J2EE on, but now I have the same error on 3 different platforms. Is there something I am missing? Any help is greatly appreciated.
    Scott

    if you are using Sun AppServer, Add the following line to JVM_CLASSPATH in appclient.bat
    %AS_INSTALL%\imq\lib\imqxm.jar
    if you are running the sample separately, add the above jar file to your system classpath.

  • JMS Sample App

    Hello There.
    I'm relatively new to J2EE, and have just downloaded and installed the software on my laptop - running Windows XP. I'm trying to get java to run the SimpleQueueSender class after starting j2ee on a separate window, and get the following error:
    C:\jms_tutorial\examples\simple>java -Djava.endorsed.dirs=%J2EE_HOME%\lib\endors
    ed -Djms.properties=%J2EE_HOME%\config\jms_client.properties SimpleQueueSender M
    yQueue 3
    Queue name is MyQueue
    JNDI API lookup failed: javax.naming.CommunicationException: com.sun.enterprise.
    resource.PoolingException
    at com.sun.enterprise.naming.factory.JavaAppClientObjectHandler.createCo
    nnectionFactory(JavaAppClientObjectHandler.java:194)
    at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectIns
    tance(ConnectorObjectFactory.java:89)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:3
    01)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:124
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at SimpleQueueSender.main(SimpleQueueSender.java:102)
    Caused by: java.lang.ClassNotFoundException: com.sun.jms.connector.ra.JMSManaged
    QueueConnectionFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:217)
    at com.sun.enterprise.naming.factory.JavaAppClientObjectHandler.createCo
    nnectionFactory(JavaAppClientObjectHandler.java:179)
    ... 5 more
    I do not know why this is happening. I cannot find the class 'com.sun.jms.connector.ra.JMSManagedQueueConnectionFactory' anywhere.
    Owen.

    The problem seems to be that you are using the Java 2, Enterprise Edition (J2EE) SDK, version 1.4 Beta, but are following the instructions in the JMS Tutorial that goes with version 1.3.1.
    Please use the revised tutorial at http://java.sun.com/j2ee/1.4/docs/tutorial/index.html. See the section on Java Message Service Technology.
    You need an additional JAR file in your classpath, %J2EE_HOME%\lib\system\jmsra.jar.
    I hope this is helpful.
    Kim Haase
    Technical Writer
    Sun Microsystems, Inc.

Maybe you are looking for

  • Shouldn't I have a free upgrade to hub 5?

    I have been on Infinity 2 for a long time and have the hub 4. When my contract came near the end around 3 months ago I got a call from BT during which they recontracted me for another 12 months, however, they failed to mention that I was eligible for

  • I can't MY JFrame to run out side jbuidler6

    i can't get My Jframe to compile and pop up using javaw fuction downloaded from java site. I know the rest of my code works but for some reason when i run the javaw compiler it's unable to launch the frame, An error message pops up stating"Can't find

  • ALV Toolbar on modal dialog screen and toolbar on text edit control

    Hello, I have created one container and producing ALV Grid output on a modal dialog screen. i do not want the ALV Toolbar to appear on this screen. How can I hide it ? ALso I need to hide some buttons on a Text edit control. How can I hide them ? Tha

  • Business Partner not created in PPOMA_BBP

    Hi this is for a new implementation where we are trying to Setup IDES for the initial training... The problem is - system is not showing any BP for the objects in the Org Structure. Tried running BBP_BP_OM_INTEGRATE too but no results. There is no de

  • AWT method not recognised

    Hi, I am trying to compile a simple program on centering a window using the get local graphics environment method but I received the error "getCenterPoint()" symbol not recognised. Can someone help please. The code is below import javax.swing.JFrame;