Problem with a simple RMI program

I'm trying to get a simple RMI program to work, by following the instructions in this link:
http://developer.java.sun.com/developer/technicalArticles/RMI/CreatingApps/index.html#dro
When it gets to this line:
Lookup look_obj = (Lookup)Naming.lookup(name);this exception is generated:
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
What's wrong, eh?

Canadian, eh?
Looks like your security settings on you computer are set to not allow a socket connection.
Specifically is is saying that access to port 1099 on your local machine (127.0.0.1 is the loopback address) is being denied.
There are two main reasons this could happen (off the top of my head), though someone else might know from the message exaclty which one.
1. Your java security permissions do not allow an out going socket connection (are you writing an applet?)
2. Your computer protects access to port 1099.

Similar Messages

  • Problem with a SIMPLE SaveDialog program.. Did I found a Java bug?

    When I run the follower program:
         /** Dialog test */
         public static void main(String args[]) {
              JFileChooser fileChooser = new JFileChooser(new File("Sem nome"));
              fileChooser.addChoosableFileFilter(new JLFileFilter());
              // mostra saveDialog
              int returnVal = fileChooser.showSaveDialog(App.getJFrame());
              // Se confirmado..
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   System.out.println("OK!");
              } else {
                   System.out.println("Canceled!");
         }it runs ok, but if I run on Eclipse's Debug Mode, I can't see the files and folders on my docs folder in the dialog... why??
    I'm running Windows XP SP3 with JDK6update4
    Edited by: wellington7 on Aug 13, 2008 11:35 AM
    Edited by: wellington7 on Aug 14, 2008 7:30 AM

    Hmmm, not really. Since a Table (ie MyTable) would be part of a larger whole (like inside a JFrame) Only the program that puts all those elements together has to be lunched on the EDT because everything inside that program would, by default, be created there as well.
    public class MyProgram {
         public MyProgram() {
              //all of these will be created on EDT because MyProgram is created there.
              JFrame f = new JFrame();
              JButton b = new JButton("hi");
              JTextField t = new JTextField();
              MyTable tbl = new MyTable();
              //place items on Frame
              f.add(t, BorderLayout.NORTH);
              f.add(b, BorderLayout.CENTER);
              f.add(tbl, BorderLayout.SOUTH);
              //show the window
              f.setVisible(true);
              f.pack();
          * @param args
         public static void main(String[] args) {
              //create MyProgram on EDT
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        new MyProgram();
    }Only the items created, explicitly, inside the main method would need to be created on the EDT.
    -D-

  • Problems with a simple stop watch program

    I would appreciate help sorting out a problem with a simple stop watch program. The problem is that it throws up inappropriate values. For example, the first time I ran it today it showed the best time at 19 seconds before the actual time had reached 2 seconds. I restarted the program and it ran correctly until about the thirtieth time I started it again when it was going okay until the display suddenly changed to something like '-50:31:30:50-'. I don't have screenshot because I had twenty thirteen year olds suddenly yelling at me that it was wrong. I clicked 'Stop' and then 'Start' again and it ran correctly.
    I have posted the whole code (minus the GUI section) because I want you to see that the program is very, very simple. I can't see where it could go wrong. I would appreciate any hints.
    public class StopWatch extends javax.swing.JFrame implements Runnable {
        int startTime, stopTime, totalTime, bestTime;
        private volatile Thread myThread = null;
        /** Creates new form StopWatch */
        public StopWatch() {
         startTime = 0;
         stopTime = 0;
         totalTime = 0;
         bestTime = 0;
         initComponents();
        public void run() {
         Thread thisThread = Thread.currentThread();
         while(myThread == thisThread) {
             try {
              Thread.sleep(100);
              getEnd();
             } catch (InterruptedException e) {}
        public void start() {
         if(myThread == null) {
             myThread = new Thread(this);
             myThread.start();
        public void getStart() {
         Calendar now = Calendar.getInstance();
         startTime = (now.get(Calendar.MINUTE) * 60) + now.get(Calendar.SECOND);
        public void getEnd() {
         Calendar now1 = Calendar.getInstance();
         stopTime = (now1.get(Calendar.MINUTE) * 60) + now1.get(Calendar.SECOND);
         totalTime = stopTime - startTime;
         setLabel();
         if(bestTime < totalTime) bestTime = totalTime;
        public void setLabel() {
         if((totalTime % 60) < 10) {
             jLabel1.setText(""+totalTime/60+ ":0"+(totalTime % 60));
         } else {
             jLabel1.setText(""+totalTime/60 + ":"+(totalTime % 60));
         if((bestTime % 60) < 10) {
             jLabel3.setText(""+bestTime/60+ ":0"+(bestTime % 60));
         } else {
             jLabel3.setText(""+bestTime/60 + ":"+(bestTime % 60));
        private void ButtonClicked(java.awt.event.ActionEvent evt) {                              
         JButton temp = (JButton) evt.getSource();
         if(temp.equals(jButton1)) {
             start();
             getStart();
         if(temp.equals(jButton2)) {
             getEnd();
             myThread = null;
         * @param args the command line arguments
        public static void main(String args[]) {
         java.awt.EventQueue.invokeLater(new Runnable() {
             public void run() {
              new StopWatch().setVisible(true);
        // Variables declaration - do not modify                    
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration                  
    }

    Although I appreciate this information, it still doesn't actually solve the problem. I can't see an error in the logic (or the code). The fact that the formatting works most of the time suggests that the problem does not lie there. As well, I use the same basic code for other time related displays e.g. countdown timers where the user sets a maximum time and the computer stops when zero is reached. I haven't had an error is these programs.
    For me, it is such a simple program and the room for errors seem small. I am guessing that I have misunderstood something about dates, but I obviously don't know.
    Again, thank you for taking the time to look at the problem and post a reply.

  • Problem with a simple GRE tunnel

    Hello everyone:
    I have a problem with a simple GRE tunnel, and can not make it work, the problem lies in the instruction "tunnel source loopback-0" if I use this command does not work, now if I use "tunnel source <ip wan >" if it works, someone can tell me why?
    Thanks for your help
    Router 1: 2811
    version 12.4
    no service password-encryption
    hostname cisco2811
    no aaa new-model
    ip cef
    interface Loopback0
    ip address 2.2.2.2 255.255.255.255
    interface Tunnel0
    ip address 10.10.1.1 255.255.255.0
    tunnel source Loopback0
    tunnel destination 217.127.XXX.188
    interface Tunnel1
    ip address 10.10.2.1 255.255.255.0
    tunnel source Loopback0
    tunnel destination 80.32.XXX.125
    interface FastEthernet0/0
    description LOCAL LAN Interface
    ip address 192.168.1.254 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    duplex auto
    speed auto
    interface FastEthernet0/1
    description WAN Interface
    ip address 195.77.XXX.70 255.255.255.248
    ip nat outside
    ip virtual-reassembly
    duplex auto
    speed auto
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 195.77.XXX.65
    ip route 192.168.3.0 255.255.255.0 Tunnel0
    ip route 192.168.4.0 255.255.255.0 Tunnel1
    ip nat inside source route-map salida-fibra interface FastEthernet0/1 overload
    access-list 120 deny ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
    access-list 120 deny ip 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255
    access-list 120 permit ip 192.168.1.0 0.0.0.255 any
    route-map salida-fibra permit 10
    match ip address 120
    Router 2: 2811
    version 12.4
    service password-encryption
    ip cef
    no ip domain lookup
    multilink bundle-name authenticated
    username admin privilege 15 password 7 104CXXXXx13
    interface Loopback0
    ip address 4.4.4.4 255.255.255.255
    interface Tunnel0
    ip address 10.10.1.2 255.255.255.0
    tunnel source Loopback0
    tunnel destination 195.77.XXX.70
    interface Ethernet0
    ip address 192.168.3.251 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    hold-queue 100 out
    interface ATM0
    no ip address
    no ip route-cache cef
    no ip route-cache
    no atm ilmi-keepalive
    dsl operating-mode auto
    interface ATM0.1 point-to-point
    ip address 217.127.XXX.188 255.255.255.192
    ip nat outside
    ip virtual-reassembly
    no ip route-cache
    no snmp trap link-status
    pvc 8/32
    encapsulation aal5snap
    ip route 0.0.0.0 0.0.0.0 ATM0.1
    ip route 192.168.1.0 255.255.255.0 Tunnel0
    ip nat inside source route-map nonat interface ATM0.1 overload
    access-list 100 permit ip 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.255
    access-list 120 deny ip 192.168.3.0 0.0.0.255 192.168.1.0 0.0.0.255
    access-list 120 permit ip 192.168.3.0 0.0.0.255 any
    route-map nonat permit 10
    match ip address 120

    Hello, thank you for the answer, as to your question, I have no connectivity within the tunnel, whether from Router 1, I ping 10.10.1.2 not get response ...
    Now both routers remove the loopback, and the interface tunnel 0 change the tunnel source to "tunnel source " tunnel works perfectly, the problem is when I have to use the loopback. Unfortunately achieved when the tunnel work, this will have to endure multicast, and all the examples found carrying a loopback as' source '... but this is a step back ..
    Tunnel0 is up, line protocol is up
    Hardware is Tunnel
    Internet address is 10.10.1.1/24
    MTU 1514 bytes, BW 9 Kbit, DLY 500000 usec,
    reliability 255/255, txload 1/255, rxload 1/255
    Encapsulation TUNNEL, loopback not set
    Keepalive not set
    Tunnel source 2.2.2.2 (Loopback0), destination 217.127.XXX.188
    Tunnel protocol/transport GRE/IP
    Key disabled, sequencing disabled
    Checksumming of packets disabled
    Tunnel TTL 255
    Fast tunneling enabled
    Tunnel transmit bandwidth 8000 (kbps)
    Tunnel receive bandwidth 8000 (kbps)
    Last input 09:04:38, output 00:00:19, output hang never
    Last clearing of "show interface" counters never
    Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
    Queueing strategy: fifo
    Output queue: 0/0 (size/max)
    5 minute input rate 0 bits/sec, 0 packets/sec
    5 minute output rate 0 bits/sec, 0 packets/sec
    0 packets input, 0 bytes, 0 no buffer
    Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
    0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
    11101 packets output, 773420 bytes, 0 underruns
    0 output errors, 0 collisions, 0 interface resets
    0 unknown protocol drops
    0 output buffer failures, 0 output buffers swapped out

  • Problems running a simple RMI

    Hi there,
    I have had alot of problems running a small RMI program.
    It has now boiled down to a java.lang.NoClassDefFoundError
    when i try to use my policy file.
    The program complies, when i run javac *.java
    It also creates the stub, when i run rmic.
    I have trawled alot of forums and the closest answer i got was "add your classpath".
    As im a student of java, this does not really tell me much.
    The class/java files are in
    C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server
    The policy file is also in the folder.
    I must add, that the program is from an example, so i would not think there is any coding errors.
    Also when i run it en eclipse, i get "Hello server failed: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)"
    So it seems something is running.

    The answer you found is correct. Java needs to know where to find the class files for execution.
    For starters, use the environment variable CLASSPATH. Set the value to:
    C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server
    This way whatever you run (RMI Registry, Server, Client) has the proper class path. When you get everything running ok, then you can look into other methods of specifying where the class files are found.
    Eclipse, as well as command line Java starts, need to find the policy file. Set up this:
    -Djava.security.policy=C:\Documents and Settings\MONDARIZ\workspace\RmiHello\server\your_policy_file.xxx

  • Problem with RFC connection - tp program not registered

    Hello everyone
    recently there  has appeared a problem with the RFC connection on our system - we received the following set of messages:
    Trace file opened at 20101221 130738 Central European Standard Time, SAP-RE
    ======> CPIC-CALL: 'ThSAPOCMINIT' : cmRc=2 thRc=679
    Tp program is not registered.
    ABAP Programm: RSRFCPIN (Transaction: SM59)
    User: xxx(Client: 100)
    Destination: SIDRFC_IFSAPHRCZPKCP (handle: 2, , )
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 1501
    CPIC-CALL: 'ThSAPOCMINIT' : cmRc=2 thRc=679
    Program transakcji nie jest zarejestrowany
    DEST =SIDRFC_IFSAPHRCZPKCP
    HOST =%%RFCSERVER%%
    PROG =IFCZPKCP
    GWHOST =ssapprod
    GWSERV =sapgw21
    I tried to register program with a command:
    rfcexec -aIFCZPKCP -gssapprod -xsapgw21
    but with no success - the program didn't appear on the list of logged clients on the system in gateway monitor. Frankly speaking we do not know now what else we can do - please help!
    We have ECC 6.0 (SAP_BASIS 700 SP18) on Windows Server 2003 R2 x64.
    Thanks in advance for any help.
    Regards
    Peter

    Hi Salim
    thanks for your reply.
    ./rfcexec -a(PROG_ID) -gssapprod -xsapgw21 &
    The syntax you're providing refers to UNIX systems, but I did similar thing on our Windows system - I tried all of the following methods (unfortunatelly without success):
    rfcexec -a(PROG_ID) -gssapprod -xsapgw21
    full_path_to_rfcexec.exe -a(PROG_ID) -gssapprod -xsapgw21
    rfcexec -a(PROG_ID) -gssapprod.domain -xsapgw21
    full_path_to_rfcexec.exe -a(PROG_ID) -gssapprod.domain -xsapgw21
    Can you advise me what to do now?
    Thanks
    Piotr

  • I have a little problem with input in my program...(System.in, BufferedRead

    I'm coding a program that takes a input like this :
    Sample Input
    1 11 5
    2 6 7
    3 13 9
    12 7 16
    14 3 25
    19 18 22
    23 13 29
    24 4 28
    So I wrote a code like this :
    public static void main(String[] args) throws Exception{
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String input = null;
                   while((input = br.readLine()) != null) {
                   StringTokenizer st = new StringTokenizer(input);
                   int leftX = Integer.parseInt(st.nextToken());
                   int height = Integer.parseInt(st .nextToken());
                   int rightX = Integer.parseInt(st.nextToken());
    .... rest of the code....
    But unlike I expected, the program did not pass the while loop.
    When I observed in debugging mode, when "br.readLine()" has no more strings to read,
    the whole program just becomes idle doing nothing, and it does not proceed further.
    Is there any problem with my code there? I've been trying to figure it out for hours... Please help!!!

    myunghajang wrote:
    Why doesn't it work in a way I intended? BufferedReader returns null if there is no more string to read, and what's the problem?
    It's so frustrating...The computer doesn't have a mind reading input, how is your program supposed to know you have finished typing the input?
    If you put the data in a file and redirect it into your program on the command line it will work (because the file knows where its end is)
    Your program could instead assume that a blank line is you end of input.

  • Problem while executing simple java program

    Hi
    while trying to execute a simple java program,i am getting the following exception...
    please help me in this
    java program :import java.util.*;
    import java.util.logging.*;
    public class Jump implements Runnable{
        Hashtable activeQueues = new Hashtable();
        String dbURL, dbuser, dbpasswd, loggerDir;   
        int idleSleep;
        static Logger logger = Logger.getAnonymousLogger();      
        Thread myThread = null;
        JumpQueueManager manager = null;
        private final static String VERSION = "2.92";
          public Jump(String jdbcURL, String user, String pwd, int idleSleep, String logDir) {
            dbURL = jdbcURL;
            dbuser = user;
            dbpasswd = pwd;
            this.idleSleep = idleSleep;
            manager = new JumpQueueManager(dbURL, dbuser, dbpasswd);
            loggerDir = logDir;
            //preparing logger
            prepareLogger();
          private void prepareLogger(){      
            Handler hndl = new pl.com.sony.utils.SimpleLoggerHandler();
            try{
                String logFilePattern = loggerDir + java.io.File.separator + "jumplog%g.log";
                Handler filehndl = new java.util.logging.FileHandler(logFilePattern, JumpConstants.MAX_LOG_SIZE, JumpConstants.MAX_LOG_FILE_NUM);
                filehndl.setEncoding("UTF-8");
                filehndl.setLevel(Level.INFO);
                logger.addHandler(filehndl);
            catch(Exception e){
            logger.setLevel(Level.ALL);
            logger.setUseParentHandlers(false);
            logger.addHandler(hndl);
            logger.setLevel(Level.FINE);
            logger.info("LOGGING FACILITY IS READY !");
          private void processTask(QueueTask task){
            JumpProcessor proc = JumpProcessorGenerator.getProcessor(task);       
            if(proc==null){
                logger.severe("Unknown task type: " + task.getType());           
                return;
            proc.setJumpThread(myThread);
            proc.setLogger(logger);       
            proc.setJumpRef(this);
            task.setProcStart(new java.util.Date());
            setExecution(task, true);       
            new Thread(proc).start();       
         private void processQueue(){       
            //Endles loop for processing tasks from queue       
            QueueTask task = null;
            while(true){
                    try{
                        //null argument means: take first free, no matters which queue
                        do{
                            task = manager.getTask(activeQueues);
                            if(task!=null)
                                processTask(task);               
                        while(task!=null);
                    catch(Exception e){
                        logger.severe(e.getMessage());
                logger.fine("-------->Sleeping for " + idleSleep + " minutes...hzzzzzz (Active queues:"+ activeQueues.size()+")");
                try{
                    if(!myThread.interrupted())
                        myThread.sleep(60*1000*idleSleep);
                catch(InterruptedException e){
                    logger.fine("-------->Wakeing up !!!");
            }//while       
        public void setMyThread(Thread t){
            myThread = t;
        /** This method is only used to start Jump as a separate thread this is
         *usefull to allow jump to access its own thread to sleep wait and synchronize
         *If you just start ProcessQueue from main method it is not possible to
         *use methods like Thread.sleep becouse object is not owner of current thread.
        public void run() {
            processQueue();
        /** This is just another facade to hide database access from another classes*/
        public void updateOraTaskStatus(QueueTask task, boolean success){
            try{         
                manager.updateOraTaskStatus(task, success);
            catch(Exception e){
                logger.severe("Cannot update status of task table for task:" + task.getID() +  "\nReason: " + e.getMessage());       
        /** This is facade to JumpQueueManager method with same name to hide
         *existance of database and SQLExceptions from processor classes
         *Processor class calls this method to execute stored proc and it doesn't
         *take care about any SQL related issues including exceptions
        public void executeStoredProc(String proc) throws Exception{
            try{
                manager.executeStoredProc(proc);
            catch(Exception e){
                //logger.severe("Cannot execute stored procedure:"+ proc + "\nReason: " + e.getMessage());       
                throw e;
         *This method is only to hide QueueManager object from access from JumpProcessors
         *It handles exceptions and datbase connecting/disconnecting and is called from
         *JumpProceesor thread.
        public  void updateTaskStatus(int taskID, int status){       
            try{
                manager.updateTaskStatus(taskID, status);
            catch(Exception e){
                logger.severe("Cannot update status of task: " + taskID + " to " + status + "\nReason: " + e.getMessage());
        public java.sql.Connection getDBConnection(){
            try{
                return manager.getNewConnection();
            catch(Exception e){
                logger.severe("Cannot acquire new database connection: " + e.getMessage());
                return null;
        protected synchronized void setExecution(QueueTask task, boolean active){
            if(active){
                activeQueues.put(new Integer(task.getQueueNum()), JumpConstants.TH_STAT_BUSY);
            else{
                activeQueues.remove(new Integer(task.getQueueNum()));
        public static void main(String[] args){
                 try{
             System.out.println("The length-->"+args.length);
            System.out.println("It's " + new java.util.Date() + " now, have a good time.");
            if(args.length<5){
                System.out.println("More parameters needed:");
                System.out.println("1 - JDBC strign, 2 - DB User, 3 - DB Password, 4 - sleeping time (minutes), 5 - log file dir");
                return;
            Jump jump = new Jump(args[0], args[1], args[2], Integer.parseInt(args[3]), args[4]);
            Thread t1= new Thread(jump);
            jump.setMyThread(t1);      
            t1.start();}
                 catch(Exception e){
                      e.printStackTrace();
    } The exception i am getting is
    java.lang.NoClassDefFoundError: jdbc:oracle:thin:@localhost:1521:xe
    Exception in thread "main" ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
    JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820] Please help me.....
    Thanks in advance.....sathya

    I am not willing to wade through the code, but this portion makes me conjecture your using an Oracle connect string instead of a class name.
    java.lang.NoClassDefFoundError: jdbc:oracle:thin:@localhost:1521:xe

  • When Place Image in Photoshop, error msg: 'Problem with Photoshop CS6 caused program to stop working

    When I 'Place Image' in Photoshop, the following error msg comes up: 'A Problem with Photoshop CS6 has caused the program to stop working, close programme?'
    Do I need to adjust my set-up to run this? The PC operates on a 32-bit  system/Windows 6.

    You need to provide much more info: What files are you trying to place into what document? What are the document sizes, resolution, color mode etc.? Anything else we should know about? This could be a million things from color profile issues to color space mismatches to the files to be placed being damaged or badly structured or a importer module being broken. Also provide exact system info and crash logs:
    Working with your Operating System’s Tools
    Mylenium

  • Help with a simple Java program

    I'm making a sort of very simple quiz program with Java. I've got everything working on the input/output side of things, and I'm looking to just fancy everything up a little bit. This program is extremely simple, and is just being run through the Windows command prompt. I was wondering how exactly to go about making it to where the quiz taker was forced to hit the enter key after answering the question and getting feedback. Right now, once the question is answered the next question is immediately asked, and it looks kind of tacky. Thanks in advance for your help.

    Hmm.. thats not quite what I was looking for, I don't think. Here's an example of my program.
    class P1 {
    public static void main(String args[]) {
    boolean Correct;
    char Selection;
    int number;
    Correct = false;
    System.out.println("Welcome to Trivia!\n");
    System.out.println("Who was the first UF to win the Heisman Trophy?\n");
    System.out.print("A) Danny Wuerffel\nB) Steve Spurrier\nC) Emmit Smith\n");
    Selection = UserInput.readChar();
    if(Selection == 'B' | Selection == 'b')
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    System.out.println("(\nHit enter for the next question...");
    System.in.readLine();
    Correct = false;
    System.out.println("\nWhat year did UF win the NCAA Football National Championship?\n");
    number = UserInput.readInt();
    if(number == 1996)
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    Correct = false;
    System.out.println("\nWho is the President of the University of Florida?\n");
    System.out.println("A) Bernie Machen\nB) John Lombardi\nC) Stephen C. O'Connell\n");
    Selection = UserInput.readChar();
    if(Selection == 'A' | Selection == 'a')
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    }

  • Problem with servlet and application program

    i have this error appearing in my browser...
    i have this feeling it is about the application, but if application alone, i now having some trouble running it, once i bind it with an applet i always have this message:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         exString.triming(exString.java:12)
         exString.geta(exString.java:113)
         forplay.play(forplay.java:9)
         textServe.doGet(textServe.java:14)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)
         org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
    i know this is a simple problem...
    how come my application is having some difficulty in running my application...
    this servlet by the way is a get parameter base...

    Its caused cuz ur exString is null..
    rgds
    shanu

  • Got a problem with my Chatting-Room program, please help me if you can.

    There is one bug in the code (should be just one), but I couldn't find it, I even recoded the whole thing, after I recoded the code, the same problem seems still there. I just can't find where the problem is. So I hope someone here can help me, thank you very much.
    First, I made a Server and a Client. Server has 5 classes, and Client has 2 classes. My intention is that all the clients(running on other computers) will connect to the server (which is my laptop), and then they can communicate with each other. For example, if person A typed "Hello", person B and person C's computers will receive this message and display it.
    The problem is that several clients can connect to the server (My laptop), but if one person type something, other people won't receive the message, it's blank on their screens. Maybe there is a problem when server receiving the message. So this is the problem I want to solve.
    I have the code down there, here is a brife description what each class mainly does.
    First class of Server is for connecting client, this class is named Server. Everytime a client is connected, the Server class calls the second class to store the client's information (which is its IP address), the second class is named People.
    Third class is named Receiver, it is for receiving the massage from any one of the clients, then stores the message to a static field variable in Fourth class, fourth class is named Saying.
    Fifth class of Server is named Sender, it is for sending the massage to the client, that message is the one that stored in Saying.
    The First class of client is named Client, it prints any message that the server send to it.
    The Second class of client is named SendFromClient, it wait for user to type something, and then send the message to the server, so server's Receiver class hopefully will get it and store it to the field variable in the Saying class.
    Here is all the codes:
    Server Class:
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class Server
         public static void main(String[] args)
              /*port number*/
              final int port = 41333;
              /*welcome messages:*/
              System.out.println("This is FriendlyJ 1.0 running");
              System.out.println("Listening on ports 41333");
              try
                   /*Clear the ArrayList*/
                   People clear = new People();
                   clear.IPs.clear();
                   /*Create a server socket that will accept any connection on this port*/
                   ServerSocket ss = new ServerSocket(port);
                   /*keep getting clients*/
                   while(true)
                        /*connect with one client at a time*/
                        Socket s = ss.accept();
                        PrintWriter out = new PrintWriter(s.getOutputStream(),true);
                        Scanner in = new Scanner(s.getInputStream());
                        /*indicate one establish of connection*/
                        System.out.println("One connection estabolished!");
                        /*two classes, one foe receiving, one for sending*/
                        Receiver receive = new Receiver(in);
                        Thread ty = new Thread(receive);
                        Sender send = new Sender(out, s);
                        Thread yt = new Thread(send);
                        ty.start();
                        yt.start();
                        /*add IP to ArrayList*/
                        clear.storing(s.getInetAddress().toString());
                        out.println("There are " + clear.IPs.size() + " people online;");
                        System.out.println("Connected to " + s.getInetAddress().toString());
              catch (Exception e)
                   System.out.println("System exception");
    }People Class:
    import java.util.*;
    public class People
         ArrayList<String> IPs = new ArrayList<String>();
         /*A method for storing IPs*/
         public void storing(String IP)
              IPs.add(IP);
    }Receiver Class:
    import java.util.*;
    public class Receiver implements Runnable
         final private Scanner in;
         /*Constructor to get the scanner*/
         public Receiver(Scanner abc)
              in = abc;
         public void run()
              Saying say = new Saying();
              try
                   while(true)
                        /*waiting for input from client, then give it to Saying*/
                        say.setSaying(in.nextLine());
              catch (Exception e)
                   e.printStackTrace();
    }Saying Class:
    public class Saying
         static String saying = "";
         public void setSaying(String a)
              saying = a;
         public String getSaying()
              return saying;
         public void resetSaying()
              saying = "";
         public int getlength()
              return saying.length();
    }Sender Class:
    import java.io.*;
    import java.net.*;
    public class Sender implements Runnable
         final private PrintWriter out;
         final private Socket s;
         public Sender(PrintWriter abcd, Socket abcde)
              out = abcd;
              s = abcde;
         public void run()
              out.println("Feel free to chat.");
              int count;
              Saying says = new Saying();
              try
              while(!s.isClosed())
                   count = says.getlength();
                   if(count>0)
                        out.println(says.getSaying());
                        says.resetSaying();
              /*disconnect with the client*/
              s.close();
              System.out.println("Connection with " + s.getInetAddress().toString() + " is closed.");
              catch (IOException e)
                   System.out.println("Network error!");
    }Client Class:
    import java.util.*;
    import java.net.*;
    import java.io.*;
    public class Client
         public static void main(String[] args)
              Socket sc;
              System.out.println("Welcome to FriendlyJ IM program");
              System.out.println("Connecting to the server...");
              int port = 41333;
              /*A variable for storing IP address of Server*/
              InetAddress ip;
              try
                   ip = InetAddress.getByName("192.168.1.68");
                   sc = new Socket(ip, port);
                   System.out.println("Connected with Server");
                   Scanner in = new Scanner(sc.getInputStream());
                   PrintWriter out = new PrintWriter(sc.getOutputStream());
                   /*a thread for sending message to the server*/
                   sendFromClient sendin = new sendFromClient(out);
                   Thread sending = new Thread(sendin);
                   sending.start();
                   /*display welcome message*/
                   System.out.println(in.nextLine());
                   /*displaying how many people are online now*/
                   System.out.println(in.nextLine());
                   while(true)
                        /*print out the message sent by the server*/
                        System.out.println(in.nextLine());
              catch(UnknownHostException e)
                   System.out.println("Couldn't find the host!");
              catch(IOException e)
                   System.out.println("Network error!");
              catch (Exception e)
                   e.printStackTrace();
    }SendFromClient Class:
    import java.io.*;
    import java.util.*;
    public class sendFromClient implements Runnable
         private PrintWriter send;
         public sendFromClient(PrintWriter sendto)
              send = sendto;
         public void run()
              Scanner sc = new Scanner(System.in);
              while(true)
                   /*get a message, then send to the server*/
                   send.println(sc.nextLine());
    That's all, thank you for helping!
    Edited by: stdioJ on Oct 31, 2007 3:58 PM

    Hi pgeuens ,
    I tried it ...but it didn't work for me.
    I changed my .jsp like this
    <%@ page language="java" %>
    <%@ taglib uri="/tags/struts-html" prefix="html"%>
    <html:form action="Registration.do">
    UserName:<html:text property="username"/><br>
    enter password:<htnl:password property="password1"/><br>
    re-enter password:<html:password property="password2"/><br>
    <html:submit value="Register"/>
    </html:form>And i changed that web.xml like..
    <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>Now I am getting an error like ......."File "/WEB-INF/struts-html.tld"not found.
    Hi Ashish
    I didn't find struts-form.tld in WEB-INF folder.But all the remaining file all there.
    Again I downloaded that struts1.2.9 ...in that also i couldn't find struts-form.tld file(except this remaining are there).
    Please tell me, if there any other ways....
    Thanks,
    kona.

  • Problems with a simple Midlet

    Hi , i'm trying to run a simple Midlet with a list, but appear the following errors:
    Error running executable C:\WTK22\bin\zayit
    java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
         at java.net.PlainSocketImpl.socketBind(Native Method)
         at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
         at java.net.ServerSocket.bind(ServerSocket.java:319)
         at java.net.ServerSocket.<init>(ServerSocket.java:185)
         at java.net.ServerSocket.<init>(ServerSocket.java:97)
         at com.sun.kvem.Lime.runClient(Unknown Source)
         at com.sun.kvem.KVMBridge.runKVM(Unknown Source)
         at com.sun.kvem.KVMBridge.runKVM(Unknown Source)
         at com.sun.kvem.midp.MIDP$4.run(Unknown Source)
    the code of the Midlet is so simple and i don't know what happen.
    i hope that you can help me
    thanks

    the code is:
    package componentes;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class InterfazMid extends MIDlet implements CommandListener {
    private Display display;
    private List menu;
    private List lista;
    private TextBox cajaTexto;
    private Form form;
    private DateField campoFecha;
    private Gauge indicador;
    private TextField campoTexto;
    private Ticker ticker;
    private Alert aviso;
    private Image imagen;
    private Command atras;
    private Command menuPrincipal;
    private Command salir;
    String menuActual = null;
    public InterfazMid() {
    form = new Form( "Formulario" );
    indicador = new Gauge( "Indicador",false,50,20 );
    campoTexto = new TextField( "Campo de texto","abc",40,0 );
    ticker = new Ticker( "Componentes de la intefaz MIDP" );
    aviso = new Alert( "Aviso Sonoro" );
    imagen = Image.createImage( "/error.png" );
    } catch( Exception e ) {}
    atras = new Command( "Atr�s",Command.BACK,0 );
    menuPrincipal = new Command( "Men� Ppal",Command.SCREEN,1 );
    salir = new Command( "Salir",Command.STOP,2 );
    protected void startApp() {
    display = Display.getDisplay( this );
    menu = new List( "Interfaz MIDP",Choice.IMPLICIT );
    menu.append( "Caja de texto",null );
    menu.append( "Fecha",null );
    menu.append( "Lista",null );
    menu.append( "Aviso",null );
    menu.append( "Formulario",null );
    menu.addCommand( salir );
    menu.setCommandListener( this );
    menu.setTicker( ticker );
    mainMenu();
    protected void pauseApp() {}
    protected void destroyApp( boolean flag ) {}
    public void mainMenu() {
    menuActual = "Men� Ppal";
    display.setCurrent( menu );
    public void testTextBox() {
    cajaTexto = new TextBox( "Teclea algo:","",10,TextField.ANY );
    cajaTexto.setTicker( new Ticker("Probando TextBox") );
    cajaTexto.addCommand( atras );
    cajaTexto.setCommandListener( this );
    cajaTexto.setString( "ABC" );
    display.setCurrent( cajaTexto );
    menuActual = "texto";
    public void testList() {
    lista = new List( "Seleciona:",Choice.MULTIPLE );
    lista.setTicker( new Ticker("Probando List") );
    lista.addCommand( atras );
    lista.setCommandListener( this );
    lista.append( "Opci�n 1",null );
    lista.append( "Opci�n 2",null );
    lista.append( "Opci�n 3",null );
    lista.append( "Opci�n 4",null );
    display.setCurrent(lista);
    menuActual = "lista";
    public void testAlert() {
    aviso.setType( AlertType.ERROR );
    aviso.setImage( imagen );
    aviso.setString( " ** ERROR **" );
    display.setCurrent( aviso );
    public void testDate() {
    java.util.Date fecha = new java.util.Date();
    campoFecha = new DateField( "Hoy es: ",DateField.DATE );
    campoFecha.setDate( fecha );
    Form f = new Form( "Fecha" );
    f.append( campoFecha );
    f.addCommand( atras );
    f.setCommandListener( this );
    display.setCurrent( f );
    menuActual = "fecha";
    public void testForm() {
    form.append( campoTexto );
    form.append( indicador );
    form.addCommand( atras );
    form.setCommandListener( this );
    display.setCurrent( form );
    menuActual = "form";
    public void commandAction( Command c,Displayable d ) {
    String label = c.getLabel();
    if( label.equals("Salir") ) {
    destroyApp( true );
    notifyDestroyed();
    else if (label.equals("Atr�s")) {
    if( menuActual.equals( "lista" ) ||
    menuActual.equals( "texto" ) ||
    menuActual.equals( "fecha" ) ||
    menuActual.equals( "form" ) ) {
    mainMenu();
    else {
    List l = (List)display.getCurrent();
    switch( l.getSelectedIndex() ) {
    case 0:
    testTextBox();
    break;
    case 1:
    testDate();
    break;
    case 2:
    testList();
    break;
    case 3:
    testAlert();
    break;
    case 4:
    testForm();
    break;
    the code is so simple. i think that the problem is on the j2me wirless toolkit but i don't know.
    thank you
    bye

  • Problem with compiling STL using program with Forte C++ 6 update 1 in compat mode

    I try to compile SGI STL using program with Forte C++ 6 update 1 and I get an errror
    ld -L/opt/SUNWspro/WS6U1/lib -liostream test.o -o test
    Undefined first referenced
    symbol in file
    __0oNIostream_initctv test.o
    __0oNIostream_initdtv test.o
    Iostream_init - declared as a static class CC4/iostream.h, but nm libiostream.a produce
    __1cNIostream_init2T6M_v_
    __1cNIostream_init2t6M_v_
    and program can't link.
    What's wrong?
    Thank you for any comments

    Hi!
    I experienced the same problem and the solution looks like the following: in sunpro6.mak file there is a variable STL_INCL that has the following value: -I. -I${PWD}/../stlport
    Change that to -I. -I${PWD}/../stlport/SC5 and the problem vanishes. The reason is that stlport/SC5 contains files *.SUNWCCh which are used by SUNpro C++ compiler as standard headers and contain correct STLPort namespace information.
    Regars,
    Art

  • Problem with Relay Mulitplexer Module Programming

    Sir,
    I loaded a following vi from example code library.I am using Relay Switch Card(NI 2503) and DMM(NI 4060) for Measurement.
    Switch_SCANNER_with_DMM_Handshaking.vi, This vi is same as shown in Relay Switch software manual. In this vi, It demands niDMM configure Measurement.vi and niDMM Configure Meas Complete Dest.vi
    These vis are not in old and new driver of this module, I used niDMM configure.vi and
    niDMM Configure Meas Complete.vi instead of that vi by seeing same node. Then after execution of program , Its showing error in niDMM Configure Multi point.vi
    Error Code is : BFFA0010
    Because in diagram there is shown TTL1 in sample trigger node and in given vi (niDMM Configure Multi point.vithere is only o
    ne option shown Immediate.
    so please solve these problems and how these vi which are not with driver, will be used or from where i can download these vi.
    Regards,
    Jitendra
    HAL Korwa

    Hi,
    Can you have a look at the PBO event? I guess after the PAI of the Screens, Sy-Ucomm values are not getting changed and it is retaining the same values. And hence it is triggering the same Screen again and again.
    You can simply put a debug point and can have a look at the logic flow.
    Hope this will help.
    Thanks,
    Samantak.

Maybe you are looking for

  • Why does one particular website not open on my ipad*,

    Why does one particular website not open on my ipad, when it alwasys did, but the same website is available upstairs on my PC, I'm using the same remote connection but for some reason it doesn't want to open.  I;ve tried refreshing etc... but nothing

  • Why can't I print my pdfs out of the InDesign Trial Version CS4?

    HELP !! I can't print out the Pdfs I made with i the Adobe  InDesign CS4 Version. Can't even save the document as eps. and a printer  spooler file it won't do either due "to unknown error". Is there something wrong with the trial version? Printing di

  • Iphone 4 screen blinking and changes color.

    Hi. When i woke up this morning, my iphone's screen is blinking and the color is distorted. No history of fall, any contact to water or whatsoever. The phone works well, internet, calls, apps, only the screen. However, when i took a screen shot and u

  • Cannot update pages 4.2 to 4.3 software preinstalled by Apple

    When I try to update to Pages 4.3 at the App store I get an error message saying that I don't own the original software? Its a 27" imac 2.9 Ghz running Mountain Lion 10.8.3. Any ideas? Cheers Pete

  • Exchange 2010

    Has anyone got Coldfusion 9 to connect with Exchange 2010? I keep getting Unable to connect to the Exchange server using HTTP/HTTPS protocol. I have tried it with Forms and without. Just about every possible combination. I would appreciate any help.