JMS Java Tutorial Problems

Hi nice forum,
I'm trying out the Quickstart Tutorial that comes with the documentation at http://docs.sun.com/source/816-5923-10/tutorial.html and getting some errors.
Before I paste lines of source code and error messages - is this an appropriate place to ask for java programming help? If not, could someone point me to the correct forum?
TIA,
Jools

Yes, questions/comments on the tutorial are welcome here.
What problems/errors are you seeing ?

Similar Messages

  • Problems with running quote server from Java Tutorial

    Hello
    The problem is this: I try to run QuoteServer from java tutorial (Trail: Deployment
    Lesson: Applets, A Simple Network Client Applet) and server compiles but when I try to run it following message shows up:
    QuoteServer listening on port: 32769
    Exception in thread "QuoteServer" java.lang.NullPointerException
    at java.net.DatagramPacket.setData(DatagramPacket.java:244)
    at java.net.DatagramPacket.<init>(DatagramPacket.java:62)
    at java.net.DatagramPacket.<init>(DatagramPacket.java:78)
    at QuoteServerThread.run(QuoteServerThread.java:38)
    And then server stops. What's going on?.
    Cheers

    Line 38 of QuoteServer.java is: packet = new DatagramPacket(buf, 256);
    And that's where the problem is because in line 31 is written byte[] buf = null;
    And what I get when I run QuoteServer.java with gcj version of java (gives more clues) is:
    java QuoteServer
    QuoteServer listening on port: 32785
    Exception in thread "QuoteServer" java.lang.NullPointerException: Null buffer
    at java.net.DatagramPacket.setData(byte[], int, int) (/usr/lib/libgcj.so.6.0.0)
    at java.net.DatagramPacket.DatagramPacket(byte[], int, int) (/usr/lib/libgcj.so.6.0.0)
    at java.net.DatagramPacket.DatagramPacket(byte[], int) (/usr/lib/libgcj.so.6.0.0)
    at QuoteServerThread.run() (Unknown Source)
    at .GC_start_routine (/usr/lib/libgcj.so.6.0.0)
    at .__clone (/lib/libc-2.3.5.so)
    So the problem is with this null buffer. What enter in line 31 instead of null?.
    What values can byte[] reach except null?. I tried to find byte[] in java API but there is only Byte variable. I get the same output with java 5.0 compiler (but less clues).
    Message was edited by:
    macmacmac

  • Java tutorial - helps, problem  is i don't understand the API

    I don't understand the JAVA Tutorials or the API

    Take two steps back.
    Buy a book on basic Java Programming. You need to understand the concepts behind programming before you should start reading the API.
    But kudos for at least trying to read the API.
    Now look at the column on the left, and follow the link called [url http://developer.java.sun.com/developer/onlineTraining/] Tutorials 
    and then the link titled [url http://java.sun.com/docs/books/tutorial/index.html]The Java Tutorial (Java Series).
    And finally read through the sections starting with [url http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html]Your First Cup of Java.
    Then once you have been through all of that, come back and ask for clarification
    on any specific points that you have trouble understanding.
    Finally (Because the Finally always gets executed) Try taking a class in java programming.
    regards

  • Multi-lingual Java program/problem

    Hi,
    The following program from the Sun books, is supposed to work with different languages. Except it doesn't!
    It has a problem finding the Properties files (?)
    It gives the following Exception:
    Exception in thread "main" java.util.MissingResourceException: Can't find bundle
    for base name MessagesBundle, locale en_GB
    here is the Sun program:
    import java.util.*;
    public class I18NSample {
    static public void main(String[] args) {
    String language;
    String country;
    if (args.length != 2) {
    language = new String("en");
    country = new String("GB");
    } else {
    language = new String(args[0]);
    country = new String(args[1]);
    Locale currentLocale;
    ResourceBundle messages;
    currentLocale = new Locale(language, country);
    messages =ResourceBundle.getBundle("MessagesBundle",currentLocale);
    System.out.println(messages.getString("greetings"));
    System.out.println(messages.getString("inquiry"));
    System.out.println(messages.getString("farewell"));
    and I have created several properties file (English, French, German, Arabic) as text files. Maybe I have problems with the properties files.
    I have followed the steps from the Java Tutorial book from Sun.
    Any help would be most welcome.
    Akz

    First save a java file "MessageBundle.java" in your current directory, for the moment. Then save java files "MessagesBundle_en_GB.java", "MessagesBundle_fr_FR", "MessagesBundle_de_DE" or "MessagesBundle_ar_EG" for example. Compile them to class files.
    Then try using your code with various locales.

  • I'm stuck! Following the Java Tutorial

    I'm confused :=Q
    I am following the Java tutorial and am trying to do the ClickMe applet. The html file was saved as text in notepad. I downloaded the ClickMe and Spot source files. They compiled without errors along with the html file. I double checked my DIR and saw that I had the class files. When I went to run the applet, the little window appeared without any spot and said something about Clickme class in the heading border and then in the box it said applet not initialized. So, I went through the forum and looked for anything similar and I saw that someone said to compile like:C:\jdk1.3.1_01 javac ClickMe.java Spot.java
    So, I tried that, and I still have class files, but now I don't have the applet box showing anymore and I don't get any errors. I was successful when I did the Hello World applet, so I know it's not a class path problem or text prob. I was using typing appletviewer ClickMe.html
    I'm getting so hungup on trying to get the applets to work I am losing track of how and why they are supposed to work. It is so discouraging especially when there doesn't seem to be anyone in particular to ask.
    Does anyone have anything encouraging to offer?
    I am using JDK 1.3 on WinXP (Java has been totally enabled without using the plug in) It has worked successfully.
    Thanks in advance once again for your help.
    Karen

    I'm learning with the tutorial also ;)
    Makes about 3 months I'm doing so, and from my experience, it is much more fun to create Programs than Applets.. I always work with Swing and it is a pain to use it inside Applets (but Swing is really great to create GUIs..) Learning how to build Jar and how to use Swing helps you building up Jar files that run like EXEs ;) That gives good results!

  • Java tutorial suggestion

    Hi Guru
    I am newbie i wish to learn Java, to improve my stills and to find jobs in java related domain
    I need your help to get succeed please suggest your opinion
    1)Is that easy to learn Java by Self? I know little bit (Threotically) But technical wise i am not that much sound ..
    2)If i what to be good in techical means ?what should i want to do ..
    3)Is it bettet to go for training center . I have already Paid 18k For learning java in one instute but didnt gain the practical knowledge .they have not given me training as per the company prospects..so i am sound only theotical
    I can test my skill and i found that i am not that much good in programming
    4)I there any best place for training in Chennai (To teach my prcatically and as per the company aspects
    5)It ll be bets to learn by self purchasing Book like that and go for it since i know some logic but implementing that logic i am bad
    6)with out getting the details i have wasted my money once again iam not ready to waste money so i need your suggetsion
    So please suggent me the best way to start my carrier in Java
    It will be highly appreciable for your help
    Aarasu

    850225 wrote:
    I am newbie i wish to learn Java, to improve my stills and to find jobs in java related domainOkay. Generally you would do that "on the job" though. More on that later.
    >
    1)Is that easy to learn Java by Self? I know little bit (Threotically) But technical wise i am not that much sound ..The language is not that hard to learn. The platform and the architectural insight generally take years to develop, all through working experience.
    2)If i what to be good in techical means ?what should i want to do ..Start at the very beginning; learn the language and the tools. The online java tutorial could be enough.
    3)Is it bettet to go for training center . I have already Paid 18k For learning java in one instute but didnt gain the practical knowledge .they have not given me training as per the company prospects..so i am sound only theoticalNo, I wouldn't do that. It is better to learn by doing, and that you can do yourself. You cannot be told HOW to program, only where to look and what to focus on. The rest is up to you in any case. Generally you don't only read a book or listen to a lecture; you actually make something and through research, reasoning and some trial and error you gradually figure out how to do things. And after that you figure out what works well and what doesn't in specific situations.
    I can test my skill and i found that i am not that much good in programming
    4)I there any best place for training in Chennai (To teach my prcatically and as per the company aspectsA school? Most of us start out there, although I still stand by my earlier comment that it is mostly up to you to learn this stuff.
    5)It ll be bets to learn by self purchasing Book like that and go for it since i know some logic but implementing that logic i am badYeah that is a big issue. You cannot force yourself to understand these things, if you have big problems with logical reasoning and thinking then programming simply isn't for you.
    6)with out getting the details i have wasted my money once again iam not ready to waste money so i need your suggetsion
    So please suggent me the best way to start my carrier in Java Really, I would first ask yourself if a career in development really is for you. Perhaps you shouldn't focus on Java development but for example look at Ruby development. Maybe Java at this point is simply too big a step for you.

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java Programming Problem

    Hi all,
    I was looking for this java programming problem which had to do with a large building and there was some gallons of water involved in it too somehow and we had to figure out the height of the buiding using java. This problem is also in one of the java books and I really need to find out all details about this problem and the solution. NEED HELP!!
    Thanks
    mac

    Yes, it will. The water will drain from the bottom of
    the tank until the pressure from the water inside the
    tank equals the pressure from the pipe. In other
    words, without a pump, the water will drain out until
    there is the same amount of water in the tank as in
    the pipe The water pressure depends on the depth of the water, not the volume. So once the depth of the water inside the pipe reaches the same depth as the water inside the tank it will stop flowing. This will never be above the height of the tank.
    I found this applet which demonstrates our problem. If you run it you can drag the guy up to the top, when water in his hose reaches the level of the water in the tank it will stop flowing out.

  • Java Uninstall Problem

    Java Uninstall Problem
    This all came about because of a failed uninstall, using Your Uninstaller.
    The {Java runtime which is all I want) is not listed now & I tried all the other fix bad uninstall type features, all to no avail.} )
    When I DL & run the latest package (jxpiinstall-6u11-fcs-bin-b90-windows-i586-25_nov_2008.exe}
    & run it I get:
    1st message:
         "This software has already been installed on your computer.
         Would you like to install it?"
    If I say no, it exits.
    If I say yes, I get this second message:
         :This action is only valid for products that are currently installed."
    So Now I have no Java & have no idea what to do.
    Any help would be greatly appreciated.
    Thanks, Neuromancer23

    Sorry...after posting it i realized there was a more appropriate forum, of which it took quiet awhile to find.)
    Now that I know where to find the forum list I will never double-post again.
    I'll close the question if I can

  • Sun Java security problems

    Please any one tel me about Sun Java security problems
    with Desktop application

    Hi.
    If you're using SSGD 4.41, please download the Admin guide from here:
    http://docs.sun.com/app/docs/doc/820-4907
    There, at page #41 you'll find useful info concerning "Client Connections and Security Warnings".
    Hope this helps,
    Rob

  • JMS Java client - JMSExcepiton initializeConnection

    Hello,
    I'm working on a JMS java client to connect to an OC4J instance that's residing in a Oracle Application Server. I have the client jars in the Java client classpath and in fact the JNDI lookup for the connection factory and topic succeeded but when I try to create the connection it fails with the following error:
    javax.jms.JMSException: initializeConnection
    at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1050)
    at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1130)
    at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJM
    SRemoteServer.java:161)
    at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJM
    SRemoteServer.java:114)
    at com.evermind.server.jms.TCPJMSRemoteServer.<init>(TCPJMSRemoteServer.
    java:72)
    at com.evermind.server.jms.EvermindConnection.<init>(EvermindConnection.
    java:124)
    at com.evermind.server.jms.EvermindTopicConnection.<init>(EvermindTopicC
    onnection.java:69)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.unprivileged_c
    reateTopicConnection(EvermindTopicConnectionFactory.java:96)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.access$000(Eve
    rmindTopicConnectionFactory.java:41)
    at com.evermind.server.jms.EvermindTopicConnectionFactory$1.execute(Ever
    mindTopicConnectionFactory.java:78)
    at com.evermind.server.jms.RemoteClientProxy.doSecureOp(RemoteClientProx
    y.java:94)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.createTopicCon
    nection(EvermindTopicConnectionFactory.java:75)
    at com.evermind.server.jms.EvermindTopicConnectionFactory.createTopicCon
    nection(EvermindTopicConnectionFactory.java:66)
    at beis_test.BEISConsumer.consumeMessage(BEISConsumer.java:51)
    at beis_test.BEISConsumer.main(BEISConsumer.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at oracle.oc4j.appclient.ApplicationClientLauncherImpl.launch(Applicatio
    nClientLauncherImpl.java:107)
    at oracle.oc4j.appclient.AppClientContainer.main(AppClientContainer.java
    :48)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.evermind.server.jms.TCPJMSRemoteServer$2.execute(TCPJMSRemoteServ
    er.java:318)
    at com.evermind.server.jms.RemoteClientProxy.doSecureOp(RemoteClientProx
    y.java:94)
    at com.evermind.server.jms.TCPJMSRemoteServer.makeSocket(TCPJMSRemoteSer
    ver.java:315)
    at com.evermind.server.jms.TCPJMSRemoteServer.initializeConnection(TCPJM
    SRemoteServer.java:121)
    ... 18 more
    JMSConsumer: Context Closed.
    If I run this on the local machine it works - but it doesn't when I attempt it from my workstation. Any help will be greatly appreciated.
    Thanks in advance,
    Barry

    JNDI lookups go through the RMI port, which you apparently have configured correctly. JMS operations (starting with and including JMS connection creation) go through the JMS port (which for OC4J JMS is always a different port than the RMI port). The JMS port is specified where the connection factory is configured -- in jms.xml.

  • Where is the "Net" trail from Java tutorial?

    Hello!
    May be it's stupid question, but I just need to look at Net trail from java tutorial (java.net, urls, sokets etc...) . As I remember there was good tutorial about this, probably in "essential java classes", but now there is no it.
    Does anybody know where is it or what's happend?
    Thanks

    Is this what you're looking for? http://java.sun.com/docs/books/tutorial/networking/index.html

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • ElGamal - Is there some Java tutorial that shows how this can be done?

    Hello,
    I found this by doing a quick search on Google.com;
    http://www.java2s.com/Tutorial/Java/0490__Security/ElGamalexamplewithrandomkeygeneration.htm
    However I was wondering whether there is Java Tutorial that shows how ElGamal can be implemented in a Java program. I am looking to develop a client / server application that share files between them and I would like to encrypt every file being transmitted.
    Regards,
    Sim085

    Either use linked content or use InCopy Text stories.

  • The Java Tutorial

    Does The Java Programming Language, Third Edition include the contents of The Java Tutorial, Third Edition: A Short Course on the Basics ?

    Contact the Documentation Team

Maybe you are looking for

  • Using Element 31" LCD TV as display

    I have a 2008 macbookpro15 with the big video output plug on the upper right side as you face the computer. In the past I have used it successfully with my 2008 vintage 46" samsung to display photos stored in iphoto. (mac output to HDMI input). now w

  • "Internal error (-5002) occurred" On Pick List Update Picked Quantity

    Hi Experts, I have an SDK program that simply tries to update the Picked Quantity in SAP. Previously it has been working fine, until I try to use the same logic for items managed by Batch or Serial Number. In this scenario, I have created a PickList

  • Subcontracting  charges and process

    Hi, We are implementing the Sub Contracting process, we have sonme restriction from our finance department that tehy do not wnat to include the subcontracter service  charges  in the total product cost, means payment to the subcontracter should be pa

  • Change default page of Wikis

    Hi. When i turned on the Wikis Server my default HTML page change to the attached. There are some way to change it for an html page? I created a html cool menu but its designed in HTML. Thanks !!!

  • How do I make Smart Groups in Address Book in iCloud?

    I have Smart Groups in my Address Book on my iMac but they don't appear in iCloud. Can anyone tell me how to do this? Many thanks in anticipation.