SAPOSS problem

Hi Gurus,
I recently installed Solman 7.1 and I configured SAProuter and when I am trying to test for connection and auth in SM59 it is displaying the following error
Connection Error
Error when opening an RFC connection (CPIC-CALL: 'ThSAPOCMINIT' : cmRc=17 thRc=2
ERROR: SAP gateway connection failed. Is SAP gateway started?
LOCATION: SAP-Server v37sol_SM1_00 on host v37sol (wp 2)
COMPONENT: CPIC
COUNTER: 8
MODULE:
LINE:
RETURN CODE: 236
SUBRC: 0
RELEASE: 720
TIME: Wed Feb 22 10:23:25 2012
VERSION:
Can anyone help me how to solve this problem
Thanks
Kalyan

I am configuring SAProuter for the first tiime, but when I checked for other systems its not working.  saprouttab is fine.
when I did saprouter -l I am getting the following
[root@v37sol ~]# su - sm1adm
v37sol:sm1adm 1> cd /usr/sap/saprouter
v37sol:sm1adm 2> pwd
/usr/sap/saprouter
v37sol:sm1adm 3> saprouter -l
Sun Feb 26 14:30:00 2012
SAP Network Interface Router, Version 40.2 (SP4)
peer SAProuter with NI version 39 ...
send info-request to running SAProuter ...
SAP Network Interface Router running on port 3299 (PID = 18961)
Started on: Sun Feb 26 14:26:35 2012
ID  CLIENT                         | PARTNER                        service
+----
10  localhost                      | (no partner)
Total no. of clients: 1
Working directory   : /usr/sap/saprouter
Routtab             : ./saprouttab
But when I am testing connection I am getting this error
This is when I did connection test in SM59 for SAPOSS
Connection Error
Error when opening an RFC connection (CPIC-CALL: 'ThSAPOCMINIT' : cmRc=17 thRc=2
ERROR: SAP gateway connection failed. Is SAP gateway started?
LOCATION: SAP-Server v37sol_SM1_00 on host v37sol (wp 7)
COMPONENT: CPIC
COUNTER: 162
MODULE:
LINE:
RETURN CODE: 236
SUBRC: 0
RELEASE: 720
TIME: Tue Feb 21 20:52:44 2012
VERSION:

Similar Messages

  • SAPOSS  Test connection

    Dear All,
    in SM59 : RFC  Connection Test  : for SAPOSS throws an
    Return Code  -12
    Please guide to resolve the issue.
    Regards
    SNB.

    Hi,
    SAPOSS is configured automatically on the basis of data in OSS1. However, if SAPOSS isn´t working, please make sure that the entries for 'Technical settings' in OSS1 are correct. Refer to Notes 33135 and 30289 for more information on OSS1. To ensure SAPOSS is maintained with 'load distribution' set to 'yes', please follow note 766505. SAPNET_RFC and SAPNET_RTCC are copies of SAPOSS. They get created automatically when the tools SDCC (SAPNET_RFC) and RTCCTOOL (SAPNET_RTCC) connect to OSS the first time. They get created with 'Loadbalancing' switched on. This makes the entry in the field 'Target Host' appear very short - please note that the full string as described below can only be maintained if 'Loadbalancing' is set to 'No'.  Please note that after an update of SAPOSS via TA OSS1 the client may change to 000 - please update this manually to 001. Also, after an update of SAPOSS via TA OSS1 SAPNET_RFC and SAPNET_RTCC do NOT get updated automatically. The easiest way to ensure they are updated correctly is to delete both destinations, and then start a connection to OSS from the tools ( SAPNET_RFC: SDCC -> Maintenance -> Refresh -> Service Overview. SAPNET_RTCC: SE38 -> RTCCTOOL) Often ( but not always - systems with 2 saprouters can be different) the parameters of a working SAPOSS or SAPNET_RFC destination (where Load balancing is set to 'No' ) are set up like this:
    Target host: /H/X1/S/sapdp99/H/X2/S/sapdp99/H/oss001 with
    X1 = customer saprouter IP address
    X2 = IP address of sapservX    sapserv1 (194.117.106.129) Internet VPN connection
             sapserv2 (194.39.131.34)   Internet SNC connection
             sapserv3 (147.204.2.5)     for customers connected to Germany.
             sapserv4 (204.79.199.2)    for customers in Americas.
             sapserv5 (194.39.138.2)    for customers connected to Japan.
             sapserv6 (194.39.139.16)   for Australia and New Zealand customers.
             sapserv7 (194.39.134.35)   for Asia customers.
    SAPOSS and SAPNET_RFC
          System number = 01
          Client = 001
          User = OSS_RFC
          Password = CPIC
    SAPNET_RTCC
          Client = 001
          User = ST14_RTCC
          Password gets set automatically when the destination is created. In case of problems with the password please delete SAPNET_RTCC and recreate it.
    Hope this should help you.
    Regards
    Tanuj

  • SAPRouter problem ERROR: sapserv2a: route permission denied

    Hello Gurus,
    we have a problem with connection with SAPOSS, when we test the connection present the following message:
    Connection Error
    Error when opening an RFC connection
    ERROR: sapserv2a: route permission denied (200.30.70.220 to oss001, sapmsOSS)
    LOCATION: SAProuter 37.15 on sapserv2a
    COMPONENT: NI (network interface)
    COUNTER: 5
    MODULE:
    LINE:
    RETURN CODE: -93
    SUBRC: 0
    RELEASE: 640
    TIME: Fri Apr 11 23:54:16 2008
    VERSION: 37
    In the Tx OSS1 we have:
    saprouter1
    name: server name where saprouter is installed
    IP address: LAN IP address where saprouter is installed (is locally intalled)
    Instance no. 99
    Saprouter at SAP
    Name sapserv2
    IP Address 194.39.131.34 (ping to this IP response)
    instance 99
    name oss001
    db name o01
    instance 01
    In Tx ST11, dev_lg log file contains:
    RSTR0006: Display Developer Traces
    trc file: "dev_lg", trc level: 1, release: "700"
    [Thr 4780] Fri Apr 11 16:41:16 2008
    [Thr 4780] *** ERROR => NiBufIProcMsg: hdl 0 received rc=-93 (NIEROUT_INTERN) from peer [nibuf.cpp    2125]
    [Thr 4780] *** ERROR => MsINiWrite: NiBufSend (rc=NIEROUT_INTERN) [msxxi.c      2480]
    [Thr 4780] *** ERROR => MsIAttachEx: MsINiWrite (rc=NIEROUT_INTERN) [msxxi.c      734]
    [Thr 4780] *** ERROR => LgIAttach: MsAttach (rc=NIEROUT_INTERN) [lgxx.c       3980]
    [Thr 4780] *** ERROR => LgApplSrvInfo: LgIAttach(rc=LGEMSLAYER) [lgxx.c       1272]
    [Thr 4780]
    [Thr 4780] *  LOCATION    SAProuter 37.15 on sapserv2a
    [Thr 4780] *  ERROR       sapserv2a: route permission denied (200.30.70.220 to oss001,
                 sapmsO01)
    [Thr 4780] *
    TIME        Fri Apr 11 23:32:17 2008
    [Thr 4780] *  RELEASE     640
    [Thr 4780] *  COMPONENT   NI (network interface)
    [Thr 4780] *  VERSION     37
    [Thr 4780] *  RC          -93
    [Thr 4780] *  COUNTER     3
    [Thr 4780] *
    [Thr 4780] *****************************************************************************
    dev_rout file in /usr/sap/saprouter contains:
    trc file: "dev_rout", trc level: 1, release: "700"
    Fri Apr 11 17:02:21 2008
    SAP Network Interface Router, Version 38.10
    command line arg 0:     saprouter
    command line arg 1:     -r
    command line arg 2:     -R
    command line arg 3:     ./saprouttab
    main: pid = 5504, ppid = 0, port = 3299, parent port = 0 (0 = parent is not a saprouter)
    reading routtab: './saprouttab'
    Fri Apr 11 17:02:36 2008
    ERROR => NiBufIProcMsg: hdl 2 received rc=-94 (NIEROUT_PERM_DENIED) from peer [nibuf.cpp    2125]
    Fri Apr 11 17:03:15 2008
    ERROR => NiBufIProcMsg: hdl 2 received rc=-94 (NIEROUT_PERM_DENIED) from peer [nibuf.cpp    2125]
    Thanks,
    HEPC

    Hello Kaushik,
    the problem was solved adding the following line in the saprouttab file, this line must be the firts line in the file:
    KT "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" 194.39.131.34 *
    the file continue with:
    inbound connections MUST use SNC
    KP "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" <IP server 1> 3299
    KP "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" <IP server 2> 3299
    KP "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" <IP server 1> 3200
    KP "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" <IP server 2> 3200
    outbound connections to <sapserv2> will use SNC
    KT "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" <IP server with saprouter> 3299
    KT "p:CN=sapserv2, OU=SAProuter, O=SAP, C=DE" 194.39.131.34 3299
    permission entries to check if connection is allowed at all
    P <IP server 1> 194.39.131.34 *
    P <IP server 2> 194.39.131.34 *
    I hope this solve your problem,
    Hernando Polania
    Colombia

  • Problem Displaying Earlywatch Report

    I have setup solution manager 4.0, Configured Earlywatch. Now the Solution screen shows :
    SAP EarlyWatch Alert 31.03.2007 QST (0020)
    SAP EarlyWatch Alert 01.04.2007 PPD (0020)
    SAP EarlyWatch Alert 01.04.2007 PPD (0020)
    SAP EarlyWatch Alert 01.04.2007 QST (0020)
    SAP EarlyWatch Alert 07.04.2007 PPD (0020)
    SAP EarlyWatch Alert 07.04.2007 QST (0020)
    SAP EarlyWatch Alert 07.04.2007 QST (0020)
    Some of these show data is available. when i process the reports a background job is started:
    SM:EXEC SERVICES 000000006300100
    this job immeidately stops saying it is cancelled.
    The joblog says this:
    06.04.2007     20:12:47     Job started
    06.04.2007     20:12:47     Step 001 started (program DSMOPBACK_AUTOSESSIONS, variant &0000000000054, user ID SOLMAN)
    06.04.2007     20:12:48     Solution COMPANY is being edited (Operations)
    06.04.2007     20:12:48     Trying to perform session 0010000000058
    06.04.2007     20:12:51     ABAP/4 processor: SYNTAX_ERROR
    06.04.2007     20:12:51     Job cancelled
    How do i make  sure that this job is executed successfully?
    I am facing the same problem when i am trying to view the Service Level Reports.
    how do i go about?
    Does anyone have the exact steps required in setting up the solutions of Solution Manager?

    Hi,
    Check this note <b>763561</b>
    Here's a part of note I copied.
    SDCC_OSS uses its own logon details:
    User: SDCC_NEW
    Password: DOWNLOAD
    Client: 001
                           To ensure SDCC_OSS can be created correctly, SAPOSS itself has to be maintained correctly. The best way to maintain SAPOSS is via settings in transaction OSS1, as described in note 33135.
    It is recommended that SAPOSS also use 'Load distribution'; to achieve this use note 766505.
    Is there a template against which I check these destinations:
    Target host: /H/X1/S/sapdp99/H/X2/S/sapdp99/H/oss001
    with
    X1 = customer saprouter IP address
    X2 = IP address of sapservX ( sapserv1 = 194.117.106.129,
    sapserv2 = 194.39.131.34, sapserv3 = 147.204.2.5,
    sapserv4  = 204.79.199.2, sapserv5 = 194.39.138.2,
    sapserv6 = 194.39.139.16, sapserv7 = 194.39.134.35 )
    System number = 01
                           When SAPOSS is updated, the copy SDCC_OSS must be updated manually. The best way to do this is to delete SDCC_OSS in SM59 and then recreate it, via
    SDCCN -> Goto->Settings-> Task Specific -> RFC destinations
    -> Change Mode -> Create destination to SAPNet R/3 Frontend
    a) Destination to connect to SAP Solution Manager
    The connections between satellite system and SAP Solution Manager are described in the configuration guide for SAP Solution Manager.
    This will solve you problem.
    Feel free to revert back.
    --Ragu

  • SAPNET_RFC-SDCC_OSS and SAPOSS

    hi friends, when i have checked my system through SM59  sapnet_rfc,saposs and sdcc_oss connection test is not ok. All are in red colour.what is the problem? why we need all the above connections ? please tell me process step by step for RFC re-configuration.Explain mainly 'techical settings' tab and logon tab. Can I delete above old connections before going to reconfigure new.
    environment is ecc/BI7/db2/aix/700-kernel
    Thanks

    Hello Nani,
    Go ahead and delete all the connections except SAPOSS
    SAPOSS is the connnection to SAP.It seems your settings are wrong.Go and maintain the settings through T-CODE OSS1
    Please refer to Note 33135 which contains all the setting to be maintained via OSS1
    If you face any issues.ket me know
    sapnet_rfc and sdcc_OSS are created automatically in the system when you configure SDCCso you can delete them with no issues
    first get your SAPOSS connection right,then again activate SDCC
    On info. on SDCC please refer to Note 216952
    Let me know of any issues
    Rohit

  • Problem to Logon to SAPNet

    Hello Experts,
    I am facing the problem in logon to  SAPNet in solution manager.
    I have set the parameter for tha sapserv2 with the ip 194.39.131.34.
    But When I try to logon to the SAPNet,I will shwo the massage.
    Unable to connect with SAPNet logon message server.
    sapserv2a:-route permission denied.
    Return code is -93.
    Please suggest me its solution.
    Regards,
    Abha Sood

    Hello,
    Thankyou for giving me your precious time.
    When i have try to check the registration of my public IP with SAP in the servive market place.
    It will show the authorisation error.
    1.Please tell me how can i overcome by this authorisation error.
    2. Please suggest me if there is any other way to check my public key registration to SAP.
    3. I want to configure the maintainance optimiser in the solman but SAPOSS,SAPOSS,SDCC_OSS RFC is fail.please tell me its solution.
    Regards
    Abha Sood

  • Hotnews info retrieval problem.

    Hi all.
    I am trying to test and evaluate the Solution Manager4.0,
    and I am in a trouble with the HotNews functionality.
    I believe I have done all the necessary configurations, but following error message is shown when I try to check for the new notes: "Could not determine your customer number in the SAP back end system."
    If anyone have encountered with same problem, please please tell me what must be done to resolve this situation?
    thanks in advance.

    Hi uDo.
    Thanks for the reply.
    However, it still does not work.
    By saying RFC connection, I believe I have all RFC settings made correctly. Following three are set in Transaction SM59.
    1) SAPOSS
    2) SAP-OSS
    3) SAP-OSS-LIST-O01
    If I need additional connection setup for Hotnews, could you give some more detailed information about it?
    Thanks.

  • Settings for SAPOSS RFC

    what are settings for the SAPOSS RFC e.g. the target host. how do i find it. In case i have to find out target host for a perticular RFC is there a method or way to get to know that.

    HI Tiest,
          The problem is there is no basis team currently and i am trying to understand the procedures. Could you tell me the procedure or direct me to some documentation that can be useful.
    Thanks in advance.

  • SAPOSS connection / CPI-C error CM_DEALLOCATED_ABEND

    Hi, We are running SAP R/3 4.5B on the iSeries and have a problem with the SAPOSS connection. / CPI-C error CM_DEALLOCATED_ABEND We deleted the RFC connection SAPOSS and recreated it via note 33135.
    We applied oss notes 766505 and 455709 trying to fix the issue.  The connection have worked in the past. 
    We use one saprouter and the SAPOSS RFC connections work from all our later systems(620- NW7.0)
    I have had a message open with SAPsince 6/20/08 trying to resolve the issue -0000475404 2008.
    Any idea's are appriciated.
    Regards, Brian
    Trace saprouter:
    Thu Jul 17 10:59:22 2008 INIT LOGFILE
    Thu Jul 17 10:59:22 2008 READ ROUTTAB ./saprouttab o.k.
    Thu Jul 17 10:59:32 2008 CONNECT FROM C1/- host 192.168.10.253/11627 (S1048KZM)
    Thu Jul 17 10:59:32 2008 CONNECT TO   S1/2 host 194.117.106.129/sapdp99 (194.117.106.129)
    Thu Jul 17 10:59:33 2008 CONNECT FROM C3/- host 192.168.10.253/15833 (S1048KZM)
    Thu Jul 17 10:59:33 2008 DISCONNECT   C1/2 host 192.168.10.253/11627 (S1048KZM)
    Thu Jul 17 10:59:33 2008 CONNECT TO   S3/2 host 194.117.106.129/sapdp99 (194.117.106.129)
    Thu Jul 17 10:59:34 2008 DISCONNECT   S3/2 host 194.117.106.129/3299 (194.117.106.129)
    Last Entires in dev_rout
    NiHsLGetServName: found port number 0C.E3/3299 in cache
    NiIGetServName: port 0C.E3/3299 = servicename 'sapdp99'
    NiSelISelectInt: 1 handles selected (1 buffered)
    DATA from S3/2 (194.117.106.129) received
    NiBufISendErr: send ni-error rc -95 to hdl 3
    NiIWrite: hdl 3 sent data (wrt=259,pac=1,ROUT_IO)
    NiRCloseConn: closing S3/2
    NiICloseHandle: shutdown and close hdl 2 / sock 3
    NiICloseHandle: shutdown and close hdl 3 / sock 5

    only the release not patch level....
    However follow your oss open message.
    If oss don't respond you must insist sending other messages.
    Bye
    Edited by: Antonio Voce on Jul 22, 2008 7:20 PM

  • SAPOSS vs. SDCC_OSS

    Hi Experts,
    I don't understand the difference between the rfc destinations
    SDCC_OSS and SAPOSS
    There exist both destinations in the SDCCN.
    I thought there is only one necessary.
    2nd Problem:
    If I start manually the early watch from my solution manager and call the Service Data Control Center (SDCCN) in the relevant system with the "Call Service Data Control Center" pushbutton I always landing in the 000 client. WHY?
    But that's the wrong client.
    How can I set a main client for the EWA?
    Thanks for your help!

    Hi Doctor,
    regarding your first question:
    SDCC_OSS is created automatically using data from SAPOSS. SDCCN should only use SDCC_OSS and not SAPOSS. SAP decided to use separate RFC connections for different tasks. One reason is to make it easier to figure out where a problem might be. At the moment as far as I know, SAPOSS is used for note assistant and the old transaction SDCC. 
    regarding your second question:
    I'm not sure I understand, but it shouldn't matter which client you use to look at SDCCN, provided the task processor in the satellite system in SDCCN is scheduled in the correct client.
    best regards,
    -David.

  • SAPOSS ID Creation??

    Hi,
    I created an SAPOSS ID in central CUA system, but when i am trying to login from the OS ID i am unable to login.
    What may be the problem.?
    Regards
    Rakesh

    Hi Rakesh,
    CUA is a bit tricky at times. I have often faced this problem. What happens at times is if a user is already created in CUA and is present in say child system 'A'. Now you want to create the same user in child system 'B', you add the roles, set a new password and save it.
    The user will get created in 'B', however the password will not get pushed. We have to manually go in system 'B' and maintain the password.
    Does the child system get an entry in UMR for the id with the roles you have assigned in the CUA system ? In the child system, does the change documents say 'new password set'?
    Thank you
    Abhishek

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

Maybe you are looking for

  • Enable/disable report parameter control at runtime in SSRS

    Hi, I am using SSRS 2012. I want to enable/disable or hide/show parameters based on another parameter selection. I have a 3 parameter, Parameter 1 says which parameter need to show either Parameter2 or parameter3 in the parameter panel. i don't find

  • Tables requried for free goods

    hi experts, my requirement is when the user give a certain period i want to calculate is any free goods available for that period and check the invoice which falls between that period and give them a report... for free goods i took KOTN010 table my p

  • Java.lang.InstantiationException: Error communicating with server:

    Hello everybody, I am an easy Helloworld application, the deploy is fine, but when I execute the client it appears the next error: java.lang.InstantiationException: Error communicating with server: Lookup error: java.net.ConnectException: Connection

  • How to update only Raw material cost(CK11n) in Material Master ?

    Hi Everybody, My client has a requirement where only raw material costs from the BOM should get updated in Material Master (Accounting 1 view in Standard Price field). But in Receipe & BOM for the Process Order, the client wants all Packing Materials

  • Datasocket 4.0 Network Client stops if Data are with Attirutes

    OS: W2000pro, VB50pro, DSServer40(370) Dear friends, I have some misterious problem with DS40. Configuration : I have one writer with DSServer 40 on one computer and several clients on the same and other computers. Problem: The Clients Data on remote