What to use for INITIAL_CONTEXT_FACTORY for Sun AppServer Platform Ed 8x

I've got an external java JMS client trying to connect to Sun Java System Application Server Platform Edition 8.1 2005Q1 and I need to know what to use for the Context.INITIAL_CONTEXT_FACTORY (and what jar it's in) plus the PROVIDER_URL for the following code:
Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, ????);
p.setProperty(Context.PROVIDER_URL, ????);
Context ctx = new InitialContext(p);
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup(factory);

I experienced similar problems while trying to create a Message Driven Bean
and send a message to it from a standalone client program.
After much guddling around (and finally finding some helpful information in
the App Servers Troubleshooting Guide) I managed to get this to work by doing
the following:
     1) Including the following jars at client compile time:
          appserv-rt.jar
          j2ee.jar
     2) Including the following jars at client run time:
          appserv-rt.jar
          j2ee.jar
          appserv-admin.jar
          imqjmsra.jar
     3) Passing in the following arguments at client run time:
          -Dorg.omg.CORBA.ORBInitialHost=localhost
          -Dorg.omg.CORBA.ORBInitialPort=3700
     4) Creating the context using the no-arg InitialContext method � i.e.
          Context ctx = new InitialContext();
     Note that this method picks up the initial context factory
     as com.sun.enterprise.naming.SerialInitContextFactory from
     a jndi.properties file in appserv-rt.jar.
I have included my client code below FYI.
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Date;
* @author dlowe8
public class JmsTest2 {
/** Creates a new instance of JmsTest2 */
public JmsTest2() {
public static void main(String[] args) {
Connection c = null;
try {
Context ctx = new InitialContext();
String factoryJndiName = "jms/ConnectionFactory";
String queueJndiName = "jms/Queue";
System.out.println("Factory JNDI Name = " + factoryJndiName);
System.out.println("Queue JNDI Name = " + queueJndiName);
     ConnectionFactory cfa = (ConnectionFactory)ctx.lookup(factoryJndiName);
     c = cfa.createConnection();
Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue)ctx.lookup(queueJndiName);
MessageProducer producer = s.createProducer(q);
TextMessage m = s.createTextMessage();
m.setText("Helloooo from standalone program at " + new Date());
producer.send(m);
s.close();
Object o = ctx.lookup(factoryJndiName);
System.out.println("Factory object class [" + o.getClass().getCanonicalName() + "]");
o = ctx.lookup(queueJndiName);
System.out.println("Queue object class [" + o.getClass().getCanonicalName() + "]");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (c != null) {
try {
c.close();
} catch (JMSException e) {}
System.exit(0);
}

Similar Messages

  • What does "use cellular data for" mean?

    In the settings, what happens if I turn on/off "use cellular data for?"

    For apps that require a data connection, if you enable that and you are not within range of a wifi node to use, the app will use cellular data which will count towards your cell plan's data usage.  If you turn that OFF, and there is no wifi available, the app will not work, but you also won't use any cellular data.
    so in the iTunes and App store settings, if you want to limit the stores to only use wifi, turn the "Use Cellular Data" option OFF (e.g. to avoid big downloads over cellular).

  • What to use to study for the Clad exam?

    Hello to all who may read this.
    I will be going for my CLAD exam in just a few months and I hope that I will pass it and finally attain my certification.
    I have a question for anyone who can answer it. What materials should I consider using to study for this test? I have been to the Basics 1 and 2, with Daq following that. I was a novice using LabView and could write a fairly decent program measuring temperatures and frequency sensors / transducers. However, I transferred to a new lab and haven't been able to even crack the book to maintain my level of knowledge for approximately 1 1/2 years. I haven't ever built a state machine or anything like that. My test will be in about 2 months, and I need a little direction on the study materials. Any help for me cramming all this in my head would be useful and appreciated. Preferably an app engineer or a clad, cld holder advice would be most helpful.
    Please email me with any questions and / or advice you may have.
    [email protected]
    thanx in advance,
    Myke

    To add to one of the previous posts, if you can get a hold of a newer (7.x) version (while there are differences between 7.0 and 7.1 they're not huge) write programs using as many of the main concepts (Loops, cases, etc.,) as possible. It will help you in the CLAD exam, things that are theoretical will also be remembered in the practical part of your brain!. Plus, if and when you are ready to take the CLD exam being _very_ familiar with the environment will really help. The following only applies when you are ready to take the CLD exam:
        As an addition to the previous post, (when you are taking the CLD exam), while you will be tested up to the version previous to the latest release, the test center may have the latest release on the computer you will use. Not much difference between 7.0 and 7.1, environment wise, but if all you have programmed in were the previous to 7.x releases, the environment (look and feel) of the "out of the box" installation is very different. The biggest problem that many have with the CLD exam isn't the difficulty of the problem as much as thinking of a solution and then implementing it within the test time. A good friend, and one of the best LabVIEW programmers I've known, wasn't familiar with the new lay out and didn't know that NI had given switches to make 7.x look like 6.x and the mental context switching and the looking for familiar tools in unfamiliar places cost him the exam (CLD) the first time he took it. The exam(s) are not terribly tough if you are prepared, but they are definitely not trivial either. Which is as it should be for them to have any validity!
    Study hard and good luck.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • What are PROVIDER_URL and INITIAL_CONTEXT_FACTORY for Sun iMQ

    Hi
    Thank you for reading my post
    I am trying to use sun MQ from outside the application server from an standalone client .
    i want to access to some queue and process its message from the standalone client , but where ever i searched i can not find those two parameters , can some one give them to me ?
    I need them to initiate the Context object

    Initial context factory is generally:
    com.sun.jndi.ldap.LdapCtxFactory
    URL depends on how you set up your object hierarchy. e.g. It might look something like:
    "LDAP://myhost.mycompany.com:15200/ou=AdministeredObjects,ou=MessageQueue,dc=sfbay,dc=sun,dc=com";

  • What to use iPod Touch For?

    I'm getting a free iPod Touch.
    What can I use it for?

    Alan Abentrod wrote:
    not much just music, movies, podcasts, games, surfing web, e-mail
    why would you buy something you don't what it's for?
    Its free (Back to school promo) - and I want to learn about it, develop apps etc
    For me I think it will be mainly web - hotmail etc. And possibly skype. And perhaps the kids for games and video on the move.

  • Use of BADI for SNP capacity levelling

    I am using APO V5.1.
    I'm interested in using the Business Add in (BADI) for SNP capacity levelling.
    Can anyone tell me which BADI this is, and the possible functionality it can provide?
    Thanks for any information on this...

    To give you a couple of examples of what we use the BADi for:
    1) Based on a product characteristic, the levelling will only level certain products. E.g. you could set a characteristic to mark products for internal use versus export use and then level the internal requirements first.
    2) The levelling will only level planned production for highlighted orders in the data view.
    Hope that helps for ideas
    Regards
    Ian

  • What is uses of dashboard?

    I wonder what is uses of dashboard for macbook pro. lately i discovered that i'm not use it at all.. i wonder what is the use of dashboard and all the widget..

    Mac 101: Dashboard   
    Tip: Want to learn more about Dashboard? Check out the built-in Help guide on your Mac (in the Finder, chooseMac Help from the Help menu, and type dashboard in the search field).

  • Sun-appserv-deploy task fails

    Hi There,
    I am trying to deploy an EJB module into the Sun Application Server 8 using ANT scripts.
    The given below is the script, I use.
    <taskdef name="sun-appserv-deploy"
    classname="org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask">
    <classpath>
    <pathelement location="${appSerLib}/sun-appserv-ant.jar"/>
    </classpath>
    </taskdef>
    <target name="doDeploy">
    <sun-appserv-deploy file="${destDir}/${ejbJarName}" name="SampleEjb"
    force="true" type="ejb" verify="false" user="admin" password="#infy123"
    host="localhost" port="4848" generatermistubs="true" asinstalldir="${appServer}"/>
    </target>
    The build fails throwing the below error
    A Sun Java System Application Server 8 admin CLI class could not be found (com.sun.enterprise.cli.framework.InputsAndOutputs). Use the asinstalldir attribute, set the asinstall.dir property, or add the appropriate JARs to the classpath.
    See the script I have mentioned the asinstalldir attribute in the sun-appserv-deploy.
    Need help to resolve it.
    ..Thiruppathy.R

    Use the 'asant' command to run your script rather than 'ant'. This will set up the required environment variables to allow the task to execute.
    Cheers
    Spencer

  • I can't send email from my iPad. I am from Australia but on holidays in Greece. Does anyone know what is the smtp outserver for Greece that I should use?

    I can't send email from my iPad. I am from Australia but on holidays in Greece. Does anyone know what is the smtp outserver for Greece that I should use?

    As you haven't told us who your email provider is, no.
    There isn't an SMTP server for Greece - it is either provided by your email provider, or the Internet provider you are connected through.

  • Help! I received a message on my iPhone that "phone Number Added to iPad4 [NAME of IPAD] is now using [PHONE NUMBER] for FaceTime and iMessage" and it is not my iPad!! What do I do, how do I shut them out??

    Help! I received a message on my iPhone that "phone Number Added to iPad4 [NAME of IPAD] is now using [PHONE NUMBER] for FaceTime and iMessage" and it is not my iPad!! What do I do, how do I shut them out??

    Use a strong password and set up Two Step Verification on your account.
    http://support.apple.com/kb/ht5570

  • I'm installing the new OS and iPhone is asking for a password to "restore" my iPhone, but I've never used a password for the phone and don't know what it is!

    I'm installing the new OS and iPhone is asking for a password to "restore" my iPhone, but I've never used a password for the phone and don't know what it is!  Can anyone help??

    You selected Encrypt iPhone Backups in iTunes.  Then you entered a password.
    It would be that specific password it is asking for.
    See here:
    https://discussions.apple.com/thread/3284065?start=0&tstart=0

  • What does this message mean baring in mind we don't know who 'Lareib' is?: ''Lareibs phone' is now using (my number) for iMessage'

    What does this message mean baring in mind we don't know who 'Lareib' is?: ''Lareibs phone' is now using (my number) for iMessage'

    How would we users in this forum also know who Lareib is?
    It means what is stated, that person is now using your number for imessage.

  • TS1702 We use one ID for  the Apps store for 2 iPhones. In the second profile on the Macit is impossible to update apps there is a mistake. What is the decision?

    We use one ID for  the Apps store for 2 iPhones. In the second profile on the Macit is impossible to update apps there is a mistake. What is the decision?

    This happens when you both use the same Apple ID for iMessage.  To fix this you have two choices:
    On one of the phones go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a different ID.  Note: you can still share the same ID for purchasing in Settings>iTunes & App Stores; or
    On both phones go to Settings>Messages>Send & Receive and uncheck the email address(es) shown under "You can be reached by iMessage at".  Also uncheck the other phone's phone number, if present.

  • What happens if I switch off the "Use Cellular Data for Facetime"?

    So I got a notice saying that my phone's storage was almost full which makes no sense to me because I barely have about 300 pictures on my phone, barely any apps, but I do have music. I have mail turned OFF, and I am always on WIFI. I don't know how this is a problem.
    So what would happen if I pressed the switch off button for the "Use Cellular Data for: facetime"?
    I use facetime A LOT with my friends WHILE ON WIFI but if this is causing my storage to go so full, I will do it.
    Please heLP!

    Using cellular data has nothing to do with the storage capacity on your phone. By turning it off you will only be able to FaceTime when your connected to wifi, thus saving you on your data plan if you do not have unlimited data from your carrier.
    You can go to settings > usage to view what is filling up the capacity of your phone. You should import and back up your pictures to your computer following the directions here http://support.apple.com/kb/HT4083

  • HT5527 But what on earth can I use this storage for?

    I got the email this morning. It's somewhat annoying that I've just signed up for iTunes Match and will have to pay for that when I could have opted to just send my music to the cloud, which I thought was going to be reduced to 5gb.
    So I'd like to find out what I can use this free space for.
    When I had an iDisk I used it to store work files so they were easily available at work and at home. I also put treasured photos and documents for the family to see there. I often used it to store scores of music I've written to add another layer of security in case everything got lost this end in case we got struck by lightening or something. I'm not sure how much of that I'll be able to put in iCloud storage now.
    So far I'm using it for email and calendar and I'm using a very small amount of space. I've paid for iTunes Match, which is considerably bigger. Perhaps I could put my audio books in there? I'm still not going to use 55GB.
    The only real use I can see for it would be to email all my important documents such as the music notation scores to myself - and then I suppose I will have put them into the cloud. But if I'm going to lose it all in a year's time I'm not sure I want to go to all that trouble.
    Any other suggestions would be gratefully received.

    So really, they can offer us 55GB of space for a year, which seems a very generous offer given that they are not charging well over £100 as I used to pay for my maxed out iDisk. But there's probably not a single user who is going to fill 55GB with the kind of documents that can be stored there. Only photographs could fill that space; and even then it would take a massive amount of those to use up 55GB.
    And having found every last word processing document and photograph I can lay my hands on to fill the space, would it be worth it if I knew that at the end of the year I'd have to remove it all and back it all up somewhere else?
    One wonders why they bothered! It is no replacement for my iDisk. Now if we have a flood or a fire, I've lost the lot, no matter how much backing up I've done. Unless I turn to DropBox, that is. Maybe I will. What Apple has done is handed me a huge trunk and told me I can keep only unboxed cufflinks and earrings in it for a year, while I'm desperately looking around for somewhere to put my boots!
    Thanks for the comments, guys. I think you'll agree with me that this is a statement of bewildered disbelief rather than a problem and that there's no solution unless Apple changes the way iCloud works.

Maybe you are looking for