Siemens TC 65 - Problem with Debbuging

Hello!
I�m new here in that forum a newbie at Java ME and my english could be better. So don�t punish me for some mistakes! ;-)
Back to the point: Hopefully you can help me with my current problem.
First of all, i try to use the Siemens Terminal TC65 and it�s java functions. I�m working with the Eclipse Environment and i also installed the whole software package (Eclipse ME+SDK from Siemens).
Everything is doing well, except the debbuging of the program - i use the example of "helloworld".
Debbuging Error at the Console is as follows:
"Initialize module for debugging ....
     Wrong initialization response received from the module.
     Please insert a SIM and enter PIN.
     No initialization for module debugging is possible!
     Debugging aborted! "
First of all: Is it necessary to have a Sim-Card plugged in to run a Midlet?
Second: I add some code to use the AT+CPIN command to enter the pin in the protected void startApp() - part. But still problems with the Initialization of the module!
Third: The Midlet runs, if i connect before with the Hyperterminal, enter the pin code, close the connection, and debug my Mitlet. But MY Midlet should do it and not with help of the Hyperterminal!
Last thing: When i use f.i. System.out.println("Pin wird gesendet"); shouldn�t it be displayed at the Console-Window?
So it seems i have several problems with my Emulator! Maybe you cn help me...thx in advance!
C-man
Message was edited by:
C-man

Hello, I've solved your first problem.
Edit WM_Debug_config.ini and correct initialization sequence. I have:
AT-Cmd1=S:ATE1
AT-Cmd2=R:OK
AT-Cmd3=S:at^scfg=userware/debuginterface,"192.168.0.2","192.168.0.1","0"
AT-CMd4=R:^SCFG: "Userware/DebugInterface","192.168.0.2","192.168.0.1","0"
AT-Cmd5=R:OK
AT-Cmd6=S:at^scfg=userware/mode,"debug","a:/","2000"
AT-Cmd7=R:^SCFG: "Userware/Mode","debug","a:/"," 2000"
AT-Cmd8=R:OK
AT-Cmd9=S:at^scfg=userware/stdout,UDP,
AT-Cmd10=R:^SCFG: "Userware/Stdout","UDP","
AT-Cmd11=R:OK
(removed PIN checking)
Edit: THIS WONT WORK, I SEE PIN I REQUIRED TO DEBUG APPLICATION :/
To see System.out messages uncomment also:
UDPport=12345
Hope I've helped. Beter later than never.
Edited by: p.gasidlo on Oct 20, 2007 8:53 AM

Similar Messages

  • Several mysterious problems with Solaris 11 x86 install

    Hi folks,
    I've recently installed Solaris 11 x86 as a replacement for Solaris 9 SPARC on an Ultra 2 machine. I like the operating system, but I've promptly acquired some mysterious problems. The computer is a Fujitsu Siemens Esprimo E2500 with a Pentium 4 HT 3.06 GHz processor, 2 GB RAM, an 80 GB SATA disk and a 147 GB SCSI disk.
    I have had a few occasions on which the screen goes totally blank, the monitor claims that there is no signal, and I have to restart the machine. However, with the blank screen, the hard drive activity light is sometimes still flashing. This happens predictably when I try to log off (as opposed to shutting down) and when I use Totem media player and click on anything inside the Totem window. The motherboard has built-in graphics and brief specifications can be found here:
    http://uk.ts.fujitsu.com/rl/servicesupport/techsupport/professionalpc/ESPRIMO/Datasheets/ds_esprimo_edition_e2500.pdf
    Yesterday my PS/2 keyboard started causing the motherboard to beep crazily when I use it. It beeps rapidly 4 times, then prints the expected character. However, the problem doesn't occur at the initial log in screen. The mouse cursor has also gone beserk on one occasion, flying all over the screen (I had this problem with a previous PC, but a different OS, and thought it was a hardware fault, which I why I got this new computer). With the keyboard problem, the machine is basically unusable. However, it is configured as a dual boot machine, and the keyboard problem isn't present with Windows XP.
    There are also a few smaller, odd problems. Occasionally all the icons vanish from my Gnome desktop. The command prompt also mysteriously changed from $chris@pluto to $bash-4.1 just before the keyboard problem appeared, although that might have had something to do with me copying my home directory to a different disk and editing the /etc/auto_home file (moving the home directory worked fine). Also, unlike with Solaris 9 SPARC, I find that I have to have external SCSI devices switched on at boot time, should I want to use them later. That's a pain. With Solaris 9, I could run "boot -r" when I first attached the device, then switch on the SCSI devices and mount them whenever I wanted.
    After the useful advice I received here about "more" and "less", I thought I'd post these problems and see if anyone can help. I'd really appreciate some advice. Can anyone identify likely causes for these problems? Which problems can I expect to solve and which do I have to live with?
    Many thanks,
    Chris Tidy
    Edited by: Chris Tidy on 23-Mar-2012 03:36

    Hi folks,
    I've recently installed Solaris 11 x86 as a replacement for Solaris 9 SPARC on an Ultra 2 machine. I like the operating system, but I've promptly acquired some mysterious problems. The computer is a Fujitsu Siemens Esprimo E2500 with a Pentium 4 HT 3.06 GHz processor, 2 GB RAM, an 80 GB SATA disk and a 147 GB SCSI disk.
    I have had a few occasions on which the screen goes totally blank, the monitor claims that there is no signal, and I have to restart the machine. However, with the blank screen, the hard drive activity light is sometimes still flashing. This happens predictably when I try to log off (as opposed to shutting down) and when I use Totem media player and click on anything inside the Totem window. The motherboard has built-in graphics and brief specifications can be found here:
    http://uk.ts.fujitsu.com/rl/servicesupport/techsupport/professionalpc/ESPRIMO/Datasheets/ds_esprimo_edition_e2500.pdf
    Yesterday my PS/2 keyboard started causing the motherboard to beep crazily when I use it. It beeps rapidly 4 times, then prints the expected character. However, the problem doesn't occur at the initial log in screen. The mouse cursor has also gone beserk on one occasion, flying all over the screen (I had this problem with a previous PC, but a different OS, and thought it was a hardware fault, which I why I got this new computer). With the keyboard problem, the machine is basically unusable. However, it is configured as a dual boot machine, and the keyboard problem isn't present with Windows XP.
    There are also a few smaller, odd problems. Occasionally all the icons vanish from my Gnome desktop. The command prompt also mysteriously changed from $chris@pluto to $bash-4.1 just before the keyboard problem appeared, although that might have had something to do with me copying my home directory to a different disk and editing the /etc/auto_home file (moving the home directory worked fine). Also, unlike with Solaris 9 SPARC, I find that I have to have external SCSI devices switched on at boot time, should I want to use them later. That's a pain. With Solaris 9, I could run "boot -r" when I first attached the device, then switch on the SCSI devices and mount them whenever I wanted.
    After the useful advice I received here about "more" and "less", I thought I'd post these problems and see if anyone can help. I'd really appreciate some advice. Can anyone identify likely causes for these problems? Which problems can I expect to solve and which do I have to live with?
    Many thanks,
    Chris Tidy
    Edited by: Chris Tidy on 23-Mar-2012 03:36

  • Problems with H2 digital interface

    I have a SoomH2, and a macbook, os 10.5.8. When I plug into the USB, to use as a mike for garage band, the sound going into the computer is all distorted and shows a solid thick wad of sound on the garage band recording level, despite turning down the gain on the H2 and/or the macbook. There is a backround of static, even if there is no sound going in. I have had the same problem with the power off, running off of the USB, with batteries and turned on, and with the external power. An old posting said to put a USB powered hub in between, but if I am already plugged in, with the H2 on, that should not be necessary.
    When new, the H2 worked, but developed this problem intermittently, and now does it all the time. Put a new software version into the H2, no difference.
    Used by itself, the H2 is fine, and you can download into garage band. The macbook internal mike does not have any problems, and goes into garage band just fine,  but is not a high quality mike for music. Has anyone else had a problem like this, and how did you resolve it. Thanks for any help.

    Hi Klaus
    In your wsdl file the soap address tag (given below)
    <b><soap:address location="http://xxxxxxxx:8000/XISOAPAdapter/MessageServlet?channel=:Foo_SOAP_Service:SOAP_Foo_out&version=3.0&Sender.Service=Foo_SOAP_Service&Interface=urn%3A%2F%2Fporeceive.xi.pse.siemens.com%5Efoo_out_sync" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/></b>
    is to be edited as
    <b><soap:address location="http://xxxxxxxx:50000//XISOAPAdapter/MessageServlet?channel=:Foo_SOAP_Service:SOAP_Foo_out" /></b>
    because the soap address format should be like :
    <i>http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel</i>
    For more information :
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    Hope this will be helpful.
    Regards
    Suraj

  • Problems with russian characters

    I need to localize my application to russian language and i have problems with their special characters. I use Graphics.drawString method and unicode escape sequences and this works fine on phones like SE, Nokia and Siemens. But some phones are not able to display these characters (Motorola, Sharp, Samsung). Do u know any other way how to draw these characters on problematic phones listed above?
    thanx for any hint

    thanx for hint, but i'm not familliar with this stuff in j2me. could u described it in more details, please?

  • Problem with one database

    Hi, I'm having currently one problem with Siemens ACS Tool. We've one got diagram, which tells information about chillers, temperatures, pressure and etc. The message when I try to open some diagram is:
    The Microsoft Jet database engine stopped the process because you and another user are attempting to change the same data at the same time. Driver's SQSetConnectStrAttr failed
    Connectionstring:
    Driver={Microsoft Access Driver (*mdb)};Dbq=C:\Documents and Settings\All Users\Documents\Siemens\ACS790\Plants\HOTEL ****\HOTEL ****.plx;Uuid=;Pwd=;
    I can't contact the support, they're too busy these days and I'm trying to get help from somewhere.

    Starting with the total lack of version numbers you have posted far too little information for anyone to help you.
    For example: Insert data using what tool?
    And there are dozens of other important facts you have not stated.

  • Problem with debug XT75

    Hello
    I have problem with debug program for XT75. I work in XP , install java j2sdk1.4.2_09 (from CD) , eclipse (with EclipseMEplugin_123) ,SMTK and connect terminal TC65 with XT75 module.
    When I want to debug my simple Midlet HelloWorld under celipse I get error:
    =========================================================================
         Starting XT75 emulator for debugging application. Please wait ...
         =========================================================================
         COM port used for "emulator session": COM1
         Used baud rate for the module "115200 baud"..
         >>> Emulator is set to no download of Jar and Jad file! <<<
         Initialize module for debugging ...
         The module is now initialized for debugging!
         >>> Establishing TCP/IP connection "IP connection for remote debugging"... <<<
         Please wait ...
         Done.
         >>> Starting Debug Agent ... <<<
         The debug agent is not started!
    File WM_Debug_config.ini in WTK for XT75 is:
    # This ini file is used to configure emulator.exe
    # Hints:
    # Store this ini file into the directory where the emulator.exe is located!
    [Module type]
    # Define the used module type
    ModuleType=XT75
    [AT command]
    # These AT commands are used for initialising the module for debugging!
    # Hints:
    # The IP address range 10.x.x.x is not supported for configuration of debugging!
    AT-Cmd1=S:ATE1
    AT-Cmd2=R:OK
    AT-Cmd3=S:at+cpin?
    AT-Cmd4=R:+CPIN: READY
    AT-Cmd5=R:OK
    AT-Cmd6=S:at^scfg=userware/debuginterface,"192.168.0.21","192.168.0.22","0"
    AT-CMd7=R:^SCFG: "Userware/DebugInterface","192.168.0.21","192.168.0.22","0"
    AT-Cmd8=R:OK
    AT-Cmd9=S:at^scfg=userware/mode,"debug","a:/","2000"
    AT-Cmd10=R:^SCFG: "Userware/Mode","debug","a:/","2000"
    AT-Cmd11=R:OK
    AT-Cmd12=S:at^scfg=userware/stdout,UDP,2000
    AT-Cmd13=R:^SCFG: "Userware/Stdout","UDP","2000"
    AT-Cmd14=R:OK
    [System.out port]
    # used UDP port number range: 1024 ... 65535
    # comment out the following line for switching off Java "System.out" displaying in the IDE window
    #UDPport=12345
    [DebugAgent delay timer]
    # settings for Debug Agent delay timer in ms
    #DATimer=2000
    I send At command to terminal AT^SCFG? and get answer:
    ^SCFG: "AutoExec","0","0","0","0",""
    ^SCFG: "AutoExec","0","1","0","0","","000:00:00","000:00:00"
    ^SCFG: "AutoExec","0","1","1","0","","000:00:00","000:00:00"
    ^SCFG: "AutoExec","0","1","2","0","","000:00:00","000:00:00"
    ^SCFG: "GPRS/ATS0/withAttach","on"
    ^SCFG: "GPRS/AutoAttach","disabled"
    ^SCFG: "GPRS/PersistentContexts","0"
    ^SCFG: "GPRS/RingOnIncomingData","off"
    ^SCFG: "MEopMode/Airplane","off"
    ^SCFG: "MEopMode/Airplane/OnStart","off"
    ^SCFG: "MEShutdown/OnIgnition","off"
    ^SCFG: "PowerSaver/Mode9/Timeout","20"
    ^SCFG: "Radio/Band","3","15"
    ^SCFG: "Radio/OutputPowerReduction","3"
    ^SCFG: "Serial/USB/DDD","0","0","0409","0681","0034","Siemens AG Wireless Modules","XT75",""
    ^SCFG: "Tcp/BufSize","5200"
    ^SCFG: "Tcp/IRT","3"
    ^SCFG: "Tcp/MR","10"
    ^SCFG: "Tcp/OT","6000"
    ^SCFG: "Tcp/SAck","1"
    ^SCFG: "Tcp/TTcp","0"
    ^SCFG: "Tcp/WithURCs","on"
    ^SCFG: "Trace/Syslog/OTAP","0"
    ^SCFG: "Userware/Autostart","0"
    ^SCFG: "Userware/Autostart/AppName",""
    ^SCFG: "Userware/Autostart/Delay","0"
    ^SCFG: "Userware/DebugInterface","192.168.0.21","192.168.0.22","0"
    ^SCFG: "Userware/Passwd"
    ^SCFG: "Userware/Mode","debug","a:/Project02.jar","2000"
    ^SCFG: "Userware/Stdout","UDP","2000"
    ^SCFG: "URC/CallStatus/CIEV","restricted"
    ^SCFG: "URC/CallStatus/SLCC","verbose"
    ^SCFG: "URC/Datamode/Ringline","off"
    ^SCFG: "URC/Ringline","local"
    ^SCFG: "URC/Ringline/ActiveTime","2"
    OK
    Please help me.
    Thanks.

    Hello,
    I would like to know if you could debug?
    That's the same problem what I have.
    At the moment I have the DSB75 and the XT75 module I don't know what else I can to to run the program under debug.
    OS: Win XP
    eclipse-SDK-3.3.1.1
    eclipseme.feature_1.7.7
    Regards,
    NOVI

  • Problems with VC in NW 7.0 SP18?

    After applying SP18 we are running into massive problems with existing, unmodified visual composer models. Error messages like
    >>> JSPCompiler >>> ERROR in Compiling :JSPFileInfo :588073642
    JSP File : /usr/sap/JWP/JC02/j2ee/cluster/server2/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.siemens.pct.ptd.dgy.main_view/jsp/aaddgy.jsp
    Class Name: sapportalsjspAADDGY
    Java File : /usr/sap/JWP/JC02/j2ee/cluster/server2/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.siemens.pct.ptd.dgy.main_view/work/jsp/_sapportalsjsp_aaddgy.java
    Package Name : jsp
    Class File : /usr/sap/JWP/JC02/j2ee/cluster/server2/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.siemens.pct.ptd.dgy.main_view/work/jsp/_sapportalsjsp_aaddgy.class
    Is out dated : false [email protected]ed2c5
    are thrown at runtime (VC iview with deltalink was added to portal page; unchanged portal page in preview mode). I don't understand the "class is out dated" error: is there a need to recompile / redeploy Visual Composer apps with SP18 which where embedded manually in portal pages (deltalink)?

    Hi,
    I hope you can get the solution in the note.
    Note 1235408 - Known Issues - Visual Composer for SAP NetWeaver 7.0 SP16-18
    Also go through these notes if you feel you have time
    Note 972506 - Known issues with Portal Platform SP18
    Note 944846 - NW04: Central Note for Portal SP18
    Note 716752 - Release Note - SAP NetWeaver Visual Composer 6.0
    Note 1121318 - Analysis of the performance of dependency knowledge in VC
    Note 1038511 - Error Analysis for NW Visual Composer 7.0
    regards
    nag

  • Problems with the display when I change the view

    Hi,
    I have recently downloaded th emost up to dat everion of itunes and I have a problem when I change the view. All I get is a black screen down the right hand side where the library details sit. This eventually clears but is **** annoying. It also happened when I had version V7.01 running.
    Any ideas?
    Thanks,
    Fujitsu Siemens MS 6567V2   Windows XP  

    Helpful AnswerRe: Have anyone problems with the dock? when I start the imac it doesn't appears
    27-jun-2011 15:58 (in response to pocoto)
    If you run Parallels, this is one of the symptoms of this issue:
    http://kb.parallels.com/en/111541
    Regards,
    Captfred
    Like (0) Reply
    Captfred post me this page, follow the instrutions on parallels preferences and for me it works. Try it and let us knows if it's works for u too..Regards

  • Problem with not getting Internet Connect on AirPort Express

    Problem with not getting Internet Connect on AirPort Express (version7.6.4). Error says cannot get valid IP address. Have reset Siemens SpeedStream 4100 several time, even with tech support from the big "A" DSL provider. Plug MacBook Pro directly into modem and works fine. Unplugged AirPort, even reset it, still no luck. A bad Express?? or am not looking in the right place to make connection. Was working fine up until Sunday.

    Connect the AirPort Express (AX) to the cable modem via Ethernet cable.
    In configuring the AX using AirPort Utility:
    Under Internet, set the connection to be Ethernet using DHCP.
    Under Connection Sharing, set it to distribute a range of IP addresses.
    Under AirPort>Wireless, set the Wireless Mode to Create a wireless network, and fill in the remaining settings in the same window. Until you get it working, you might want to set Wireless Security to None.

  • K7T Turbo2 (6330v5) problem (with locked Tbreds)

    Hi,
    I've recently bought a K7T Turbo2 board (6330v5) OEM version (green PCB) made probably for Fujitsu-Siemens UK. They probably didn't need those board anymore and sold them (a lot of wholesalers have them in my country now).
    Anyway I think the board I bought is damaged, but I not sure.
    The problem is that it won't POST with locked T-breds. I've tried a 2000+ (3rd week of 2004) and a 2400+ locked T-bred (46th week of 2003) and the PC haven't started.
    But with a T-Bird 1400Mhz, a 1700+ and 1800+ Palomino (probably locked) and 2400+ unlocked T-bred the board started without any problems.
    Is this the problem with new XP processors (produced after the 39th week 2003 and internally locked) and this board or I have a damaged board?
    TIA,
    Max

    Well, I didn't know it was the OEM version when I was buying it...  But in this case I don't think the bios is the problem. The board looks virtually the same as the normal board.
    And it boots with a pre-39 (24th week of 2003) T-bred 2400+, so it's not a lack of compatibility with T-bred issue.
    For me it seems that this board has problem with T-bred made after the 39th week of 2003 (internally locked ones).  
    So I need to know if all of those boards have the same problem, or only this one?
    BTW. Currently I'm running my unlocked T-bred 2400+ on a Abit KT7A board, and I've tried the same locked T-bred 2400+ that failed on MSI K7T Turbo2 on my abit board and it also didn't boot. So maybe there's something wrong the KT133A chip which makes KT133A boards incompatible with new locked T-breds?
    Of course the locked T-bred runs fine on a KT400 board or a nforce2 ultra400 boards...

  • A problem with jdk 1.6

    when I compile my java files, class file are produced after debbug.
    but when i try to run my program (my class with main method ), I get this error message "error on thread main ...." .
    so what can I do to run my classes?thanks for the help.
    PS: I use command line on windows xp.

    Hi,
    I have such problem too.
    With JRE under Windows.
    Applets are executed properly.
    But programmes for interpriter java.com
    are compiled without errors but
    are not work under JRE 1.6.
    After:
    java.com programme.class,
    I get error message:
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloJava/class".
    for any programmes. Even for class with empty main function.
    Second problem with compiler for Windows:
    When source file programme.java
    in UTF-8, the first symbol in file is spetial for unicode
    files in Windows.
    The compiler writes an error message and stops.

  • Fujitzu/Siemens v8210 laptops bluescreen with Wireless Controller 4.2.61.0

    I have noticed a problem with Wireless LAN Controller version 4.2.61.0. This version causes a blue screen with Fujitzu Siemens v8210 laptops with driver atheros ar5006eg driver version 4.1.2.111 sia installed.
    Other make and model of laptops work fine with the controller such as Dell and IBM etc.
    The atheros manufacturers website has a later driver than the fujitsu website which clears the fault, once you install the new driver on the laptop.
    Has anyone else had this problem and would you reccomend to downgrade the Wireless LAN controller to a previous firmware release, as the bug toolkit and caveats for the controller release did not highlight this problem?

    Hi Carl,
    Your LAPs joins the wrong WLC even when you've configured the primary/secondary controllers name OR IP address and you are using v4.2.61.0.  Is this correct?
    If so, then it's a well-known bug of the v4.x.  Unfortunately, the workaround is CLI.  It's unfortunate because you have to type the command on the WLC and specify the LAP.
    The command is:  config ap controller primary
    This bug has been fixed on the 5.X and 6.X firmware.
    Hope this helps.

  • 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

Maybe you are looking for

  • Issue with Default Variable in WAD after Java Patch 7.01.7.31

    Hello all, I'm running into an issue with the Web Application Designer Template execution for a particular default variable. This started occuring after Java Patch 7.01.7.31 we had implented over the weekend. The issue is when Executing the WAD Templ

  • Two bug fixes for DeferredWrite databases

    Hi all, If you are using DatabaseConfig.setDeferredWrite(true) to configured a deferred write database, you will be interested in two recent bug fixes. These fixes will be in the next patch release (JE 3.2.69 and later), but we haven't decided when t

  • Announcement/message before shutdown by using Automator?

    I wondered if it was possible to show a message or announcement when I try to shut down, like a message of some sorts that reminds me to set my Magic Mouse on off to save batteries and stuff like that. I'm not experienced enough with Applescript to k

  • Web service endpoint uri

    version: OSB 10g Hi, Can anyone tell me hoe to find the service endpoint uri for a web service derived from java classes is and deployed on weblogic? In ALSB this used to be in a file called weblogic-webservices.xml but this file no longer exists. I

  • Control break stmts

    Can anyone explain the concepts of Control break statements Give me a small simple sample program..