Problem with STMS

Hello SAP,
When we configure the STMS System (PRO is the domain), the connection with DES system fail (the CALTP_Linux RFC no run properly)
See the image please,
When execute ping to host the ping respond properly,
64 bytes from
HOST): icmp_seq=1 ttl=64 time=0.015 ms
  64 bytes from
(IP): icmp_seq=2 ttl=64 time=0.023 ms
64 bytes from
HOST): icmp_seq=3 ttl=64 time=0.021 ms
64 bytes from
HOST: icmp_seq=4 ttl=64 time=0.019 ms
64 bytes from
HOSTicmp_seq=5 ttl=64 time=0.025 ms
64 bytes from
HOSTicmp_seq=6 ttl=64 time=0.026 ms
64 bytes from
HOSTicmp_seq=7 ttl=64 time=0.023 ms
Can you help me please?
Thanks.

Hi Victor,
Could you please share dev_w7 log file from the OS level,as it's completely related with the hostname entry under hosts file.Have you followed all the above recommendations completely.
Try to share the ping result for particular system,if failing then try to look under /etc/hosts files for proper entries as already suggested to you by @Regan Benjamin .
Also you mentioned
No, our IP address is solved by DNS
Our IP address is solved by DNS
Have you provided a static IP to that machine or by a DHCP server.,if obtaining IP from DHCP server than here could be the issue for failing of RFC connection.Kindly confirm.
Regards,
Gaurav Rana

Similar Messages

  • Problem with STMS configuration ( READ_PROFILE_FAILED )

    Hi All,
    When i am configuring STMS in solution manager getting below error.
    message :READ_PROFILE_FAILED
    Command  TMS_PM_READ_PROFILE
    Service  tp Profile Service
    Start    Online
    Function TMS_PS_READ_PROFILE_FROM_DISK
    Message  READ_PROFILE_FAILED
    Function TMS_PS_WRITE_PROFILE_TO_DISK
    Message  SET_CODEPAGE_FAILED
    error: Transport control program tp ended with error 0212
    Please help me.
    Thanks,
    Balu...

    Hi Balu,
    Key here is
    DB Connect -- Link to database failed
    Offline Call -- could not access file as supposed
    which is tp is unable to connect to your database.. indirectly R3trans may not be working fine.
    While you are configuring TMS tp will conenct to database to update database tables which it is unable to do.
    Please provide trace of R3trans -d
    1. Logon at OS level with <sid>adm
    2. Execute R3trans -d and paste the contenct of trans.log in the same directory where you executed R3trans -d
    3. If you are able to solve DB connection error your self you can else please give OS and DB version and also Environment variables for the user sidadm.
    Thanks,
    Kiran.

  • Problem with TMS setup in HA systems

    Dear colleagues,
    Our team have installed a new production environmnent to ECC in HA. We have a ASCS in cluster and two dialog instance in each server(local instance).
    A virtual host GPPR3CIB and two instances in local, node GPPR301 and node GPPR302. This is an ECC 6.0 on Windows 2003 Server and SQL server 2005.
    The architecture is as follows:
    - GPPR301 node:
       - Virtual ASCS ASCS_0 (message server)
       - ABAP Primary Instance PPR301_1 (disp+work)
       - ERS (Enqueue replication server) instace ERS_10
    - GPPR302 node:
       -ABAP Additional Instance PPR302_2 (disp+work)
       -Virtual Database Instance GPPR3DB
       -ERS (Enqueue replication server) Instance ERS_10
    Once the installation is complete you need to apply SAP Note No. 943334 - "TMS setup in high availability systems" to set up high availability STMS. The problem is to distribute the configuration after running
    the report " 'TMS_MGR_LOADBALANCING" described in SAP note.
    The message indicates problems trying to run the command tp.exe. It has followed the note No. 1010990 and we have checked the folder permissions of the kernel but the problem persists.
    Any information or help regarding this type of setup would be welcome.
    Thanks.

    Hi,
    We have solved the problem with STMS. After several tests, the problem was in the parameter SAPLOCALHOSTFULL. This parameter must be assigned the hostname of the local system for each profile instance. If you've assigned the virtual host in the cluster generates the error in the distribution of the STMS.
    Regards.

  • Problem with exhange setup. Especially regarding kalender

    Can't sync. my kalender with my exhange account.

    Hi,
    We have solved the problem with STMS. After several tests, the problem was in the parameter SAPLOCALHOSTFULL. This parameter must be assigned the hostname of the local system for each profile instance. If you've assigned the virtual host in the cluster generates the error in the distribution of the STMS.
    Regards.

  • Problem with the AF of my new 18-135mm EFS IS STM lens

    Hello,
    The lens came with the EOS Rebel T5i bundle.
    The auto focus is working incorrectly, focusing closer than the detected area. This is happening when I use the viewfinder. When a picture is taken using the “direct view” (LCD display) it focus correctly.
     I didn’t use the camera a lot since I bought it, now looking the first pictures I see that this problem is happening since I bought it.
    I changed the zoom lens with another Canon camera and then my new Rebel T5i works fine and the same problem happens with the other camera, therefore I’m sure that the problem is in the lens and not in the camera body.
    The out of focus is more noticeable when I'm taking pictures in 18mm position to an object farther than 2 meters but it is happening in any zoom position. It is clear when I compare the same picture taken with the viewfinder with one taken with the LCD Display.
    I updated the body firmware and the problem continues.
    Is it possible to update the lens firmaware? I couldn’t find them in the canon webpage.
    I will go into an important trip next week, therefore I will not have time to send the camera to repair.
    Any idea?
    Thanks!

    You may want to rent a lens for your trip and get this lens to service.
    You'll want to be sure it really is a problem with the lens (it sounds like it is from your description).  Test the lens against a "flat" target (such as a wall).  You can hang something on the wall with high-contrast (newspaper works great) and put the camera on a tripod.  The idea is that (a) the camera is definitely not moving, (b) the focus target is definitely not moving, and (c) the target is flat and there are no distracting objects in the field of view so it's not possible for the focus system to decide to lock focus on anything OTHER than your intended target.
    Next... deliberately turn the focus ring to put the camera out of focus (so that the camera HAS to move the focus).  This is mildly tricky with an STM lens since there's no mechanical link from the focus ring to the lens -- it's electronic.  The lens only accepts focus input when focus is active (e.g. half-press the shutter button, etc. to wake it up.)  I run focus all the way in and test several times, then run focus all the way out and test several times (that way it has to move focus in both directions.)
    If the lens is consistently focusing closer, then it will need service.  
    Tim Campbell
    5D II, 5D III, 60Da

  • STMS problem with transport import

    Hello all
    I had a problem with transports in STMS.
    Log history of imported transport didn't show any error and simophore is green.
    But in target system data element wasn't presented.
    When i import this transport again - it's all ok.
    It happened twice. And i didn't find any solutions yet.((
    Did anyone have the same problem???

    Start import LIMUMETH/NPQ/CL_RESERVATION           SPLIT_RESERV ...
    0 entries from SMODILOG (CLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    0 entries from SMODISRC (CVCLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    0 entries from SMODISRC (CUCLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    0 entries from SMODISRC (PRCLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    0 entries from SMODISRC (SVCLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    0 entries from SMODISRC (CICLAS/NPQ/CL_RESERVATION                     METH/NPQ/CL_RESERVATION           SPLIT_RESERVATION
    method SPLIT_RESERVATION                                             include /NPQ/CL_RESERVATION===========CM01Z      will be impor
    REPOS /NPQ/CL_RESERVATION===========CM01M      A replaced.
    End of import LIMUMETH/NPQ/CL_RESERVATION           SPLIT_RESERV
    E071-LOCKFLAGs 000016 - 000016 updated ('2', 1 entries).
    E071C entries 000016 - 000016 deleted (1 entries).
    report /NPQ/CL_RESERVATION===========CM01M      (L) synchronized.
    report /NPQ/CL_RESERVATION===========CP         (L) synchronized.
    169836 5330910
    LIMUTABD/NPQ/LOCATION_HIERARCHY_QRY was not imported in this step
    LIMUTABD/NPQ/RESERV_ROOM_SERVICE_STR was not imported in this step
    LIMUTABD/NPQ/RES_SERVICE was not imported in this step
    LIMUTABD/NPQ/RES_SERVICE_DETAILS was not imported in this step
    Start import LIMUWAPP/NPQ/FM                       SERVICE/CREA ...
    Start import LIMUWAPP/NPQ/FM                       SERVICE/CREA ...
    Start import LIMUWAPP/NPQ/FM                       SERVICE/GETS ...
    Start import LIMUWAPP/NPQ/FM_NEW_DESIGN            SERVICE/CREA ...
    Start import LIMUWAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETS ...
    0 entries from SMODILOG (WAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIO
    0 entries from SMODISRC (CVWAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCAT
    0 entries from SMODISRC (CUWAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCAT
    0 entries from SMODISRC (PRWAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCAT
    0 entries from SMODISRC (SVWAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCAT
    0 entries from SMODISRC (CIWAPA/NPQ/FM_NEW_DESIGN                      WAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCAT
    0 d /   0 i /   2 u /   1 =  33% ucf O2PAGCON
    3 entries for O2PAGCON imported (TR/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 d /   0 i /   1 u /   0 =   0% ucf O2PAGDIR
    1 entry for O2PAGDIR imported (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 d /   0 i /   0 u /   4 = 100% ucf O2PAGDIRT
    4 entries for O2PAGDIRT imported (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 d /   0 i /   0 u /   1 = 100% ucf O2PAGEVH
    1 entry for O2PAGEVH imported (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 entries from O2PAGPAR (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY                                  %) d
    0 entries from O2PAGPAR (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY                                  %) d
    0 entries from O2PAGPART (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY                                  %)
    0 entries from O2PAGPART (/NPQ/FM_NEW_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY                                  %)
    0 entries from SOTR_USE (LIMUWAPP/NPQ/FM#_NEW#_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 entries from SOTR_USE (LIMUWAPP/NPQ/FM#_NEW#_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 entries from SOTR_USEU (LIMUWAPP/NPQ/FM#_NEW#_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    0 entries from SOTR_USEU (LIMUWAPP/NPQ/FM#_NEW#_DESIGN            SERVICE/GETSRVPOINTLOCATIONHIERARCHY
    End of import LIMUWAPP/NPQ/FM_NEW_DESIGN            SERVICE/GETS
    R3TRDTEL/NPQ/DELIVERY_POINT was not imported in this step
    R3TRDTEL/NPQ/SRV_POINT was not imported in this step
    E071-LOCKFLAGs 000021 - 000025 updated ('2', 5 entries).
    E071C entries 000021 - 000025 deleted (5 entries).
    DEVK902177           touched.
    table O2PAGDIR (R) synchronized.
    1 tables in P-buffer synchronized.
    2 tables in R-buffer synchronized.
    42832 5373742
    158359 bytes read.
    Transport overhead 15.3 %.
    Data compressed to 5.3 %.
    Duration: 14 sec (11311 bytes/sec).
    1 0
    Summary:
    15 REPOS imported.
    Totally 15 Objects imported.
    Totally 1551 tabentries imported.
    5373742 bytes modified in database.
    [dev trc     ,00000]  Thu Mar 03 18:26:16 2011                                             13410099  13.410099
    [dev trc     ,00000]  Disconnecting from ALL connections:                                       21  13.410120
    [dev trc     ,00000]  Disconnecting from connection 0 ...                                       33  13.410153
    [dev trc     ,00000]  Now I'm disconnected from SAP DB                                        4897  13.415050
    [dev trc     ,00000]  Disconnected from connection 0                                            63  13.415113
    [dev trc     ,00000]  statistics db_con_commit (com_total=17, com_tx=17)                        26  13.415139
    [dev trc     ,00000]  statistics db_con_rollback (roll_total=0, roll_tx=0)                      25  13.415164
    Disconnected from database.
    End of Transport (0000).
    date&time: 03.03.2011 - 18:26:16
    Main import
    End date and time : 20110303182616
         |   Ended with return code:  ===> 0 <===

  • Tp ended with error code 0247 - addtobuffer has problems with data- and/or

    Hello Experts,
    If you give some idea, it will be greatly appreciated.
    This transported issue started coming after power outage, sap system went hard shutdown.
    Then we brought up the system. Before that , we do not have this transport issue.
    our TMS landscape is
    DEV QA-PRD
    SED-SEQSEP
    DEV is having the TMS domain controller.
    FYI:
    *At OS level, when we do scp command using root user, it is fine for any TR.
    In STMS, while adding TR in SEQ(QA system), we  are getting error like this.
    Error:
    Transport control program tp ended with error code 0247
         Message no. XT200
    Diagnosis
         An error occurred when executing a tp command.
           Command:        ADDTOBUFFER SEDK906339 SEQ client010 pf=/us
           Return code:    0247
           Error text:     addtobuffer has problems with data- and/or
           Request:        SEDK906339
    System Response
         The function terminates.
    Procedure
         Correct the error and execute the command again if necessary.
    This is tp version 372.04.71 (release 700, unicode enabled)
    Addtobuffer failed for SEDK906339.
      Neither datafile nor cofile exist (cofile may also be corrupted).
    standard output from tp and from tools called by tp:
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 0
    ERRORS: Highest tp internal error was: 0247

    when we do scp using sm69,
    SEDADM@DEVSYS:/usr/sap/trans/cofiles/K906339.SED SEQADM@QASYS:/usr/sap/trans/cofiles/.
    it throws the error like below,
    Host key verification failed.
                                                                                    External program terminated with exit code 1
    Thanks
    Praba

  • Is anyone else having problems with the Canon Online Store?

    In the last month or so, I've had one problem after another with the Canon Online Store; from being unable to delete items from the shopping cart; to not being able to add "in stock" items; disappearing Wish Lists; and just now, I tried to add one lens cap to the 6 or 7 items I already had in the Shopping Cart, and they disappeared.
    I've called, more than once, and I've written, also more than once, to Canon Support about this, but they ignore what I tell them, and tell me there are no problems with the Online Store.  They don't even seem to report to anyone that anyone has complained, because each time is "the first time", even though I've called (more than once) and written (more than once) to them about continuing Online Stores problems.
    Is anyone else having problems with the Canon Online Store?
    Why does Canon not care to track reported problems with the storefront part of their web-site? 
    I'm not trying to insult Canon, it's just that I've been a Canon customer for less than 3 months, and the're only batting .333, so far.  Canon Support was very quick to respond about a concern I had that a 50mm f/1.4 I had just purchased was authentic or not.  In trying to register that lens, I looked up on the Canon web site where to find the serial number.  Since my new lens did not have any numbers there, I was concerned I had been sold a fake.  But, then Canon Support sent me link to a different online document that showed a few different places where it might be, and there it was. 
    Is Canon like that with other problems, as well?  Or is their "batting" average better than my very limited experience? 
    I just love my Rebel T5i, and my Canon lenses (from "the Kit brothers of the Cropped Frame coral":  EF-S 18-55mm f/3.5-5.6 IS STM, and EF-S 70-300mm f/4-5.6 IS USM; to the "Truly Nifty Fifty", the 50mm f/1.4 USM, [the f/1.8 is just a "thrifty fifty"], and finally, the "Super-Macro" MP-E 65mm f/2.8 1x-5x Macro)! 
    Regards and Thanks,
    Calen
    As an old friend used to always say,
    "Keep Looking Up!"
    Calen

    Hi Danny.  Thanks for replying.
    I only use my desktop PC to access Canon's web site, and I've been using Mozilla Firefox for years.  And, yes, it is the latest version.  Since Canon REFUSES to support the use of Firefox on it's web site, WHAT BROWSER DOES CANON SUPPORT?  WHEN did Canon STOP SUPPORTING Firefox?
    I've been told that there are 2 pending orders in my account.  Yet, I NEVER placed those orders!  WHY CAN'T CANON SEE THAT THIS IS A PROBLEM??? 
    Instead of off-target suggestions, and pasted boilerplate REFUSALS TO EVEN LOOK at this issue, I would prefer it if Canon went "old school", and FIXED THE PROBLEM, in the first place!  But, maybe that's a bit too grown up of an answer for you! 
    "Award-winning" support???   And, just exactly WHAT AWARD did Canon "support" WIN for CONSISTANTLY IGNORING REPORTED PROBLEMS???  The OSTRICH?
    Please pull your head out, and FIX this problem, OR YOU ARE THE PROBLEM!!!
    Thank you for your "prompt" attention to this matter!
    Calen
    As an old friend used to always say,
    "Keep Looking Up!"
    Calen

  • Problem with opening html page in Dreamweaver

    Hello,
    I would like to ask the forum because I have a problem with Dreamweaver 8.
    In the past when I work with my PC on Windows XP I didn't have this problem.
    Now I have a new PC with Windows 7 Familial Edition Premium.
    I can open he most pages I would like, .htm particuliarly but some of them like .html don't opened in Dreamweaver 8
    on PC with Windows 7.
    Example:
    With this page: http://www.pb-veille-consulting.com/veille.html
    I can open it with Dreamweaver 8 under Windows XP on my portable PC.
    But I can't open it with Dreamweaver 8 under Windows 7 on my fix PC.
    Where is the problem?
    You could watch the code of this page and perharps give me answers from my question.
    Thanks a lot.
    Patrick.

    It could be that Extensions.txt and MMDocumentTypes.xml do not have the full set file extensions.
    The first one can be located at ~username/AppData/Roaming/Adobe/Dreamweaver CS6/en_us/Configuration and needs to have HTML added to line 1
    The second one can be located at ~username/AppData/Roaming/Adobe/Dreamweaver CS6/en_us/Configuration/DocumentTypes and needs to have HTML added to line 3 so that it looks like
    <documenttype id="HTML" internaltype="HTML" winfileextension="html,htm,shtml,shtm,stm,tpl,lasso,xhtml" macfileextension="html,htm,shtml,shtm,tpl,lasso,xhtml,ssi" file="Default.html" writebyteordermark="false" mimetype="text/html">

  • Problems with Transport Management System

    Hi All,
    i seem to be having some issues with my Transport Management System, we have a two system landscape DEV & PRD, the operating system is windows 2003 server. i am trying to access the usr/sap/trans on the transport host (DEV) from the PRD system, i have put patches on the DEV server, but i can't access these patches from the PRD server. I have also tried to release a test transport, but the queues are not being updated. the systems are in the same Domain and the same transport group. on the PRD server i have specified the following value for the DIR_TRANS =
    DEVSERVER\sapmnt\trans. i have checked the files and they are shared, what could be the cause of this?

    Can you please check the access of global TRANS directory from your PRD server. Login to your PRD server, goto transaction STMS --> Overview --> Systems. Select your developement system and goto SAP System --> Check --> Transport Directory. If it can access the global directory the tick marks will come otherwise there is some problem with the directory access.
    Regards,
    Abhishek Jain

  • Problems with transporting

    Hi,
    I have a problem with transporting from DEV to PROD. There are no imports in import queue in SMTS.
    I can export data from DEV, but there are not displayed in STMS. (Only texts as Language Netweaver 04 SR1 CS).
    In TMS alert viewer there are a lot of errors. F.E. READ_DOCU_FAILED, RFC_SYSTEM_FAILURE, TP_REPORTED_ERROR (Transport control program tp ended with error code 0012).
    We had no problems with this before but the old transports are not displayed in gueue too.
    The RFC connection seems to be ok.
    Can anybody help?
    Thanks
    Radka

    Hi,
    it seems does not help.
    But I found a problem in transport groups.
    If i run a check of transport groups. The error message "System DWP cannot read test file written by DWD" is displayed.
    "When the system checked the transport groups, it discovered that system DWP cannot read a test file written by system DWD to the transport directory. The return code of the action was 0008"
    DWD=DEV
    DWP=PROD
    Can anybody help? Or does somebody know, where sap creates the test file? Or the name of the test file...
    Thanks
    RH

  • 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();
    }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

  • Problem with threads and camera.

    Hi everybody!
    I've a problem with taking snapshot.
    I would like to display a loading screen after it take snapshot ( sometimes i
    have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
    I was trying to use threads but i didn't succeed.
    I made this code:
    display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while((!performing.isShown()) && (backgroundCamera.isShown())){
                        Thread.yield();
                    notifyAll();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        this.wait();                   
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();This code is sometimes showing performing screen but sometimes no.
    I don't know why. In my opinion performing.isShown() method isn't working correctly.
    Does anyone have some idea how to use threads here?

    Hi,
    I've finally managed to work this fine.
    The code:
           Object o = new Object();
           display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while(!performing.isShown()){
                        Thread.yield();
                   synchronized(o) {
                      o.notify();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        synchronized(o) {
                           o.wait(1);
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();

Maybe you are looking for