Stlport problem with streambuf EOF

Hi
stlport4 does not seem to fail correctly with the following example on
SunOS sun 5.8 Generic_117350-27 sun4u sparc SUNW,Sun-Fire-480R
with
CC: Sun C++ 5.6 Patch 117549-03 2005/07/19
or
CC: Sun C++ 5.8 2005/10/13
CC test.cpp -library=stlport4
./a.out < test.cpp
#include <iostream>
#include <streambuf>
class obuf : public std::streambuf
protected:
        virtual int_type overflow (int_type c)
                std::cout << static_cast<char>(c);
                return EOF;
int main()
        obuf ofail;
        std::ostream ostrm( & ofail );
        ostrm << std::cin.rdbuf() << std::endl;
        return 0;
}Please clamage45, tell me I'm doing something wrong.
/Lars

Probably releated
The following code will hang when run on a filled filesystem.
CC test.cpp -library=stlport4
test.cpp
#include <iostream>
#include <fstream>
int main()
    std::ofstream ofs( "test.out" );
    std::ifstream ifs( "test.cpp" );
    if( ofs )
        ofs << ifs.rdbuf() << std::endl;
    std::cout << ofs.good() << ' ' << ofs.fail() << ' ' << ofs.bad() << std::end
l;
    return 0;
}

Similar Messages

  • Problem with EOF and EOL

    I would like to create in my server an identical CSV file that can be created in local, but when i use the open datset and transfer sentences, i have real problems with the end of line and end of file marks. Does anybody solved this problem?
    - I have tried to open in text mode but it has additional marks than in local files
    - I have tried to open in binary mode and add crlf signs but i can´t replicate an identical file
    Thanks in advance.
    Regards

    Is the same file

  • Mapping problem with compressed key update record

    Hi, could you please advise?
    I'm getting the following problem:
    About a week ago replicat abened with "Error in mapping" error. I found in discard file some record looking like:
    filed1 = NULL
    field2 =
    field3 =
    field4 =
    field5 =
    datefield = -04-09 00:00:00
    field6 =
    field8 =
    field9 = NULL
    field10 =
    Where filed9 = @GETENV("GGHEADER", "COMMITTIMESTAM"), field10 = = @GETENV("GGHEADER", "COMMITTIMESTAM"), others are table fields mapped by USEDEFAULTS
    So I got Mapping problem with compressed key update record at 2012-06-01 15:44
    I guess I need to mention that extract failed in 5 minuts before it with: VAM function VAMRead returned unexpected result: error 600 - VAM Client Report <[CFileInfo::Read] Timeout expired after 10 retries with 1000 ms delay, waiting to read transaction log or backup files. To increase the number of retries, use SETENV (GGS_CacheRetryCount = n) in Extract parameter file. To control retry delay time, use SETENV (GGS_CacheRetryDelay = n). handle: 0000000000000398 ReadFile GetLastError:997 Wait GetLastError:997>.
    I don't know if it has ther same source as data corruption, could you tell me if it is?
    Well, I created new extract, starting 2012-06-01 15:30 to check if there was something with extract at the time, but got the same error.
    If I run extract beging at 15:52 it starts and works.
    But well, I got another one today. Data didn't look that bad, but yet one column came with null value:( And I'm using it as a key column, so I got Mapping problem with compressed key update record again:(
    I'm replicating from SQL Server 2008 to Oracle 11g.
    I'm actually using NOCOMPRESSUPDATES in Extract.
    CDC is enabled for all tables replicated. The only thing is that it is enabled not by ADD TRANDATA command, but by SQL Server sys.sp_cdc_enable_table, does it matter?
    Could you please advise why does it happen?

    Well, the problem begins somewhere in extract or before extract, may be in transaction log, I don't know:(
    Here are extract parameters:
    EXTRACT ETCHECK
    TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT
    SOURCEDB TEST, USERID **, PASSWORD *****
    exttrail ./dirdat/ec
    NOCOMPRESSUPDATES
    NOCOMPRESSDELETES
    TABLE tst.table1, COLS (field1, field2, field3, field4, field5, field6, field7, field8 );
    TABLE tst.table2, COLS (field1, field2, field3, field4 );
    Data pump:
    EXTRACT DTCHECK
    SOURCEDB TEST, USERID **, PASSWORD *****
    RMTHOST ***, MGRPORT 7809
    RMTTRAIL ./dirdat/dc
    TABLE tst.table1;
    TABLE tst.table2;
    Replicat:
    REPLICAT rtcheck
    USERID tst, PASSWORD ***
    DISCARDFILE ./dirrpt/rtcheck.txt, PURGE
    SOURCEDEFS ./dirdef/sourcei.def
    HANDLECOLLISIONS
    UPDATEDELETES
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    MAP dbo.TPROCPERIODCONFIRMSTAV, TARGET R_019_000001.TPROCPERIODCONFIRMSTAV, COLMAP (USEDEFAULTS , field5 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed6= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (filed1, field2, field3);
    Rpt file for replicat:
    Oracle GoldenGate Delivery for Oracle
    Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040
    Windows x64 (optimized), Oracle 11g on Apr 22 2011 00:34:07
    Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
    Starting at 2012-06-05 12:49:38
    Operating System Version:
    Microsoft Windows Server 2008 R2 , on x64
    Version 6.1 (Build 7601: Service Pack 1)
    Process id: 2264
    Description:
    ** Running with the following parameters **
    REPLICAT rtcheck
    USERID tst, PASSWORD ***
    DISCARDFILE ./dirrpt/rtcheck.txt, PURGE
    SOURCEDEFS ./dirdef/sourcei.def
    HANDLECOLLISIONS
    UPDATEDELETES
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    MAP dbo.TPROCPERIODCONFIRMSTAV, TARGET R_019_000001.TPROCPERIODCONFIRMSTAV, COLMAP (USEDEFAULTS , field5 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed6= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (filed1, field2, field3);
    CACHEMGR virtual memory values (may have been adjusted)
    CACHEBUFFERSIZE: 64K
    CACHESIZE: 512M
    CACHEBUFFERSIZE (soft max): 4M
    CACHEPAGEOUTSIZE (normal): 4M
    PROCESS VM AVAIL FROM OS (min): 1G
    CACHESIZEMAX (strict force to disk): 881M
    Database Version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Database Language and Character Set:
    NLS_LANG = "AMERICAN_AMERICA.CL8MSWIN1251"
    NLS_LANGUAGE = "AMERICAN"
    NLS_TERRITORY = "AMERICA"
    NLS_CHARACTERSET = "CL8MSWIN1251"
    For further information on character set settings, please refer to user manual.
    ** Run Time Messages **
    Opened trail file ./dirdat/dc000000 at 2012-06-05 12:49:39
    2012-06-05 12:58:14 INFO OGG-01020 Processed extract process RESTART_ABEND record at seq 0, rba 925 (aborted 0 records).
    MAP resolved (entry tst.table1):
    MAP tst.table1, t.table1, COLMAP (USEDEFAULTS , filed9 = @GETENV("GGHEADER", "COMMITTIMESTAMP"), filed10= @CASE(@GETENV("GGHEADER", "OPTYPE"), "SQL COMPUPDATE", "U", "PK UPDATE", "U",@GETENV("GGHEADER", "OPTYPE")) ), KEYCOLS (field3);
    2012-06-05 12:58:14 WARNING OGG-00869 No unique key is defined for table table1. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
    Using the following default columns with matching names:
    field1=field1, field2=field2, field3=field3, field4=field4, field5=field5, field6=field6, field7=field7, field8=field8
    Using the following key columns for target table R_019_000001.TCALCULATE: field3.
    2012-06-05 12:58:14 WARNING OGG-01431 Aborted grouped transaction on 'tst.table1', Mapping error.
    2012-06-05 12:58:14 WARNING OGG-01003 Repositioning to rba 987 in seqno 0.
    2012-06-05 12:58:14 WARNING OGG-01151 Error mapping from tst.table1 to tst.table1.
    2012-06-05 12:58:14 WARNING OGG-01003 Repositioning to rba 987 in seqno 0.
    Source Context :
    SourceModule : [er.main]
    SourceID : [er/rep.c]
    SourceFunction : [take_rep_err_action]
    SourceLine : [16064]
    ThreadBacktrace : [8] elements
    : [C:\App\OGG\replicat.exe(ERCALLBACK+0x143034) [0x00000001402192B4]]
    : [C:\App\OGG\replicat.exe(ERCALLBACK+0x11dd44) [0x00000001401F3FC4]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x000000014009F102]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x00000001400B29CC]]
    : [C:\App\OGG\replicat.exe(<RCALLBACK+0x11dd44) [0x00000001400B8887]]
    : [C:\App\OGG\replicat.exe(releaseCProcessManagerInstance+0x25250) [0x000000014028F200]]
    : [C:\Windows\system32\kernel32.dll(BaseThreadInitThunk+0xd) [0x000000007720652D]]
    : [C:\Windows\SYSTEM32\ntdll.dll(RtlUserThreadStart+0x21) [0x000000007733C521]]
    2012-06-05 12:58:14 ERROR OGG-01296 Error mapping from tst.table1 to tst.table1.
    * ** Run Time Statistics ** *
    Last record for the last committed transaction is the following:
    Trail name : ./dirdat/dc000000
    Hdr-Ind : E (x45) Partition : . (x04)
    UndoFlag : . (x00) BeforeAfter: A (x41)
    RecLength : 249 (x00f9) IO Time : 2012-06-01 15:48:56.285333
    IOType : 115 (x73) OrigNode : 255 (xff)
    TransInd : . (x03) FormatType : R (x52)
    SyskeyLen : 0 (x00) Incomplete : . (x00)
    AuditRBA : 44 AuditPos : 71176199289771
    Continued : N (x00) RecCount : 1 (x01)
    2012-06-01 15:48:56.285333 GGSKeyFieldComp Len 249 RBA 987
    Name: DBO.TCALCULATE
    Reading ./dirdat/dc000000, current RBA 987, 0 records
    Report at 2012-06-05 12:58:14 (activity since 2012-06-05 12:58:14)
    From Table tst.table1 to tst.table1:
    # inserts: 0
    # updates: 0
    # deletes: 0
    # discards: 1
    Last log location read:
    FILE: ./dirdat/dc000000
    SEQNO: 0
    RBA: 987
    TIMESTAMP: 2012-06-01 15:48:56.285333
    EOF: NO
    READERR: 0
    2012-06-05 12:58:14 ERROR OGG-01668 PROCESS ABENDING.
    Discard file:
    Oracle GoldenGate Delivery for Oracle process started, group RTCHECK discard file opened: 2012-06-05 12:49:39
    Key column filed3 (0) is missing from update on table tst.table1
    Missing 1 key columns in update for table tst.table1.
    Current time: 2012-06-05 12:58:14
    Discarded record from action ABEND on error 0
    Aborting transaction on ./dirdat/dc beginning at seqno 0 rba 987
    error at seqno 0 rba 987
    Problem replicating tst.table1 to tst.table1
    Mapping problem with compressed key update record (target format)...
    filed1 = NULL
    field2 =
    field3 =
    field4 =
    field5 =
    datefield = -04-09 00:00:00
    field6 =
    field8 =
    field9 = NULL
    field10 =
    Process Abending : 2012-06-05 12:58:14

  • Problem with access to Ironport C370

    Hi,
    We have C370 (upgraded to last version) configured and everythings work fine! But one day, from some reason, we cant access Ironport via HTTPS, HTTP and SSH, only works ping. Problem with network is not because we try access Ironport direct from Managment port. After reboot, then access is fine. Please can you tell me how I can figure out what was a problem, which logs I need to analyze.... Why I could not access to ironport via HTTP/S, SSH?

    I dont think that problem is exchange because problem also was about accessing to ironport, I think that some problem is on ironport:
    Tue Apr 16 16:08:52 2013 Info: New SMTP DCID 15929874 interface 172.30.20.4 address 65.55.37.88 port 25
    Tue Apr 16 16:08:52 2013 Info: ICID 5276886 Receiving Failed: Out of Memory
    Tue Apr 16 16:08:52 2013 Info: ICID 5276886 close
    Tue Apr 16 16:08:53 2013 Info: Delayed: DCID 15929873 MID 11206813 to RID 0 - 4.1.0 - Unknown address error ('450', ['too many connections from your IP (rate controlled)']) []
    Tue Apr 16 16:08:53 2013 Info: MID 11206813 to RID [0] pending till Tue Apr 16 17:08:53 2013 [Default]
    Tue Apr 16 16:08:53 2013 Info: Connection Error: DCID 15929873 domain: shop.com IP: 216.136.0.12 port: 25 details: EOF interface: 172.30.20.4 reason: network error
    Tue Apr 16 16:08:53 2013 Info: ICID 5276890 Receiving Failed: Out of Memory
    Tue Apr 16 16:08:53 2013 Info: ICID 5276890 close
    Tue Apr 16 16:08:53 2013 Info: New SMTP DCID 15929875 interface 172.30.20.4 address 216.136.0.12 port 25
    Tue Apr 16 16:08:53 2013 Info: Delivery start DCID 15929874 MID 11744351 to RID [0]
    Tue Apr 16 16:08:53 2013 Info: New SMTP ICID 5276899 interface data (172.30.20.4) address 172.29.18.137 reverse dns host unknown verified no
    Tue Apr 16 16:08:53 2013 Info: ICID 5276899 RELAY SG RELAY match 172.0.0.0/8 SBRS rfc1918
    Tue Apr 16 16:08:53 2013 Info: Connection Error: DCID 15929874 domain: hotmail.com IP: 65.55.37.88 port: 25 details: 421-"RP-001 (COL0-MC2-F35) Unfortunately, some messages from 195.222.56.65 weren't sent. Please try again. We have limits for how many messages can be sent per hour and per day. You can also refer to http://mail.live.com/mail/troubleshooting.aspx#errors." interface: 172.30.20.4 reason: unexpected SMTP response
    Tue Apr 16 16:08:53 2013 Info: Delayed: DCID 15929874 MID 11744351 to RID 0 - 4.3.2 - Not accepting messages at this time ('421', ["RP-001 (COL0-MC2-F35) Unfortunately, some messages from 195.222.56.65 weren't sent. Please try again. We have limits for how many messages can be sent per hour and per day. You can also refer to http://mail.live.com/mail/troubleshooting.aspx#errors."]) []

  • Problem with field-length in sql-loader

    Hello,
    (sorry I see it's the wrong forum -> SQL-Developer, I searched for SQL-Loader, is there a possibility to change the forum ?)
    I can't find an answer for my question at google, so I hope there is someone in this forum who can help me.
    I have a dat-File that contains 12 500 000 records and want to laod it via sql-loader. The first field contains the ID and there were numbers from 1 to 12 500 000 stored.
    When I run the sql-loader, the ID run up to 9 999 999 and then, for the last 2 500 001 records, ist starts at 1 again.
    I noticed a few things :
    1. Numbers < 10 000 000 don't make Problems
    2. Numbers >= 10 000 000 make Problems, the first digit ( in this example "1") is cut, so the number "10 000 001" ist stored as "1". It comes to double entries (IDs 1 to 2 500 000).
    3. The same field-definition, I have for the third field of the record -> there is no Problem. THERE I can store any number.
    4. I tried to store a number > 100 000 000 -> the first digit was cut too, but ONLY the first digit.
    5. I'm able to store any number manually in the Database.
    So, I have a problem with the first field. If the number is greater then 10 000 000, the first Number is cut. It doesn't make any differance, if the number is 10 000 000 or 999 999 999, just the first digit, in the first field, is cut.
    Any idea ??????????
    Here some infos :
    Database :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    SQL-PLUS :
    SQL*Plus: Release 10.2.0.4.0 - Production
    Script sqlldr :
    sqlplus ${schema}/$2 <<EOF >>LOAD.LOG
    set timing on
    set echo on
    set heading off
    set heading on
    !sqlldr userid=${schema}/$2 control=surface_geometry.ctl log=surface_geometry.log
    exit
    EOF
    ctl-File :
    LOAD DATA
    INFILE imp_surface_geometry_test2
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE SURFACE_GEOMETRY
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    ID INTEGER EXTERNAL ,
    GMLID,
    GMLID_CODESPACE,
    PARENT_ID NULLIF PARENT_ID = BLANKS,
    ROOT_ID NULLIF ROOT_ID = BLANKS,
    IS_SOLID,
    IS_COMPOSITE,
    IS_TRIANGULATED,
    IS_XLINK,
    IS_REVERSE,
    GEB_ID,
    GEOMETRY COLUMN OBJECT
    SDO_GTYPE INTEGER EXTERNAL,
    SDO_SRID CONSTANT 31468,
    SDO_ELEM_INFO VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL),
    SDO_ORDINATES VARRAY TERMINATED BY '|/'
    (X FLOAT EXTERNAL)
    Table-Definition (sql-File) :
    CREATE TABLE SURFACE_GEOMETRY (
    ID NUMBER,
    GMLID VARCHAR2(256),
    GMLID_CODESPACE VARCHAR2(1000),
    PARENT_ID NUMBER,
    ROOT_ID NUMBER,
    IS_SOLID NUMBER(1,0),
    IS_COMPOSITE NUMBER(1,0),
    IS_TRIANGULATED NUMBER(1,0),
    IS_XLINK NUMBER(1,0),
    IS_REVERSE NUMBER(1,0),
    GEB_ID CHAR(7),
    GEOMETRY MDSYS.SDO_GEOMETRY,
    CONSTRAINT c_unique_id UNIQUE (ID))
    storage (initial 1M next 1M maxextents 1024) ;
    Some Entries in the dat-File :
    12556067| |XXX|12556066|12556066|0|0|0|0|0| |
    #3003|1|1003|1|/
    #4479400.000000|5333360.000000| 526.870000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333340.000000| 526.980000|4479400.000000|5333360.000000| 526.870000|/
    12556068| |XXX| |12556068|0|0|1|0|0| |
    #||/
    #|/
    12556069| |XXX|12556068|12556068|0|0|0|0|0| |
    #3003|1|1003|1|/
    #4479380.000000|5333380.000000| 526.600000|4479380.000000|5333360.000000| 526.720000|4479400.000000|5333360.000000| 526.870000|4479380.000000|5333380.000000| 526.600000|/
    log-File : (100 records for the test)
    SQL*Loader: Release 10.2.0.4.0 - Production on Fr Mai 28 15:16:43 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    Kontrolldatei: surface_geometry.ctl
    Datendatei: imp_surface_geometry_test.dat
    Fehlerdatei: imp_surface_geometry_test.bad
    Datei für zurückgewiesene Sätze: nichts spezifiziert
    (alle Discards zulassen)
    Zu ladende Anzahl: ALL
    Zu überspringende Anzahl: 0
    Zulässige Fehler: 50
    Bind-Array: 64 Zeilen, maximal 256000 Bytes
    Fortsetzung: 1:1 = 0X23(Zeichen '#'), im nächsten physischen Satz
    Benutzer Pfad: Konventionell
    Tabelle SURFACE_GEOMETRY, geladen von jedem logischen Satz.
    Insert-Option in Kraft für diese Tabelle: TRUNCATE
    Option TRAILING NULLCOLS ist wirksam
    Spaltenname Position Läng Term Eing Datentyp
    ID FIRST * | CHARACTER
    GMLID NEXT * | CHARACTER
    GMLID_CODESPACE NEXT * | CHARACTER
    PARENT_ID NEXT * | CHARACTER
    NULL wenn PARENT_ID = BLANKS
    ROOT_ID NEXT * | CHARACTER
    NULL wenn ROOT_ID = BLANKS
    IS_SOLID NEXT * | CHARACTER
    IS_COMPOSITE NEXT * | CHARACTER
    IS_TRIANGULATED NEXT * | CHARACTER
    IS_XLINK NEXT * | CHARACTER
    IS_REVERSE NEXT * | CHARACTER
    GEB_ID NEXT * | CHARACTER
    GEOMETRY DERIVED * COLUMN OBJECT
    *** Felder in GEOMETRY
    SDO_GTYPE NEXT * | CHARACTER
    SDO_SRID CONSTANT
    Wert ist '31468'
    SDO_ELEM_INFO DERIVED * VARRAY
    Abschlusszeichenfolge : '|/'
    *** Felder in GEOMETRY.SDO_ELEM_INFO
    X FIRST * | CHARACTER
    *** Feldende in GEOMETRY.SDO_ELEM_INFO
    SDO_ORDINATES DERIVED * VARRAY
    Abschlusszeichenfolge : '|/'
    *** Felder in GEOMETRY.SDO_ORDINATES
    X FIRST * | CHARACTER
    *** Feldende in GEOMETRY.SDO_ORDINATES
    *** Feldende in GEOMETRY
    Tabelle SURFACE_GEOMETRY:
    100 Zeilen erfolgreich geladen.
    0 Zeilen aufgrund von Datenfehlern nicht geladen.
    0 Zeilen nicht geladen, da alle WHEN-Klauseln fehlerhaft waren.
    0 Zeilen nicht geladen, da alle Felder NULL waren.
    Zugewiesener Bereich für Bind-Array: 232576 Bytes (64 Zeilen)
    Byte in Lese-Puffer: 1048576
    Gesamtzahl der übersprungenen logischen Datensätze: 0
    Gesamtzahl der gelesenen logischen Datensätze: 100
    Gesamtzahl der abgelehnten logischen Datensätze: 0
    Gesamtzahl der zurückgewiesenen logischen Datensätze: 0
    Lauf begonnen am Fr Mai 28 15:16:43 2010
    Lauf beendet am Fr Mai 28 15:16:43 2010
    Abgelaufene Zeit: 00:00:00.19
    CPU-Zeit: 00:00:00.01
    Edited by: user9338988 on 28.05.2010 06:21

    sorry, wrong forum. I opened the thread in forum "Export/Import/SQL-Loader & External Tables"

  • Problem with XSQLRequest.process

    Problem with XSQLRequest.process:
    I'm trying to run XSQL files using XSQLRequest.process. I'm working on the chapter 3 examples in Muench's book and got FAQXML.xsql running okay but have had problems with: FAQhtml.xsql BTW I am calling them from a different directory and am using 9iAS under win2K SP3.:
    I've fixed errors such as:
    End tag does not match start tag 'img'.
    by adding </img>
    and:
    End tag does not match start tag 'META'.
    by removing the <head> section from the xsl.
    But now i've got:
    XML parse error at line 2, char 1
    Expected 'EOF'.
    and don't have a clue.
    Some questions I have are:
    --Why don't I get these errors when I run the same files from Internet Explorer?
    --Where is the intermediate XML file?
    --How will I get HTML output?
    I'd appreciate any help you could suggest.
    Peter.
    Here is the .xsql and some of the .xsl:
    <?xml version="1.0"?>
    <!-- FAQHTML.xsql: Show FAQ.xsql in HTML Format for browsers -->
    <?xml-stylesheet type="text/xsl" href="http://localhost/ch03/FAQ-In-HTML.xsl"?>
    <xsql:include-xsql href="FAQ.xsql" xmlns:xsql="urn:oracle-xsql"/>
    <!-- FAQ-In-HTML.xsl: Transform ROWSET/ROW format into HTML Format -->
    <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    -->
    <body>
    <center>
    <table border="0">
    <tr>
    <th>Question</th>
    <th>Difficulty</th>
    </tr>
    <xsl:for-each select="ROWSET/ROW">
    <tr>
    <td>
    <table border="0" cellspacing="0">
    etc...

    XSQL version is 1.0.2.0.
    Well, in answer to your import question, yes. Xerces can import Xerces documents properly. Thus if we use Xerces importNode on a document parsed/created using Xerces' DOM implementation, the attribute values stay.
    We are using Xerces because it is the foundation of our infrastructure layer (which is partly because it's used in Catalina).
    Question. Is it possible that XSQLParserHelper which, as you say, uses an instance of oracle.xml.parser.v2.DOMParser to parse the document, is having trouble with different versions of DOM? I ask because we've noticed that to use Catalina and have its class loader to function successfully, we had strip all the DOM classes from xmlparserv2.jar
    importNode snippit ...
    public void service(CioServletRequest req, CioServletResponse resp) throws ServletException {
    DomResponse respm = resp.createDomResponse();
    Document dbdoc = respm.getDocument();
    XSQLRequest req = new XSQLRequest( pageUrl );
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    req.process(params, ostream, new PrintWriter(System.err));
    String s = new String(ostream.toByteArray());
    Document retDoc = respm.parseDocument(s);
    dbdoc.appendChild(dbdoc.importNode(retDoc.getDocumentElement(), true));
    Hope this helps.
    Steve.
    null

  • Problems with *.zmg Image deploy via PXE

    Hi all,
    I am currently faced with the following problem unfortunately:
    We use ZCM pre boot (pxe) to image our clients with a windows7.zmg image which was configured with sysprep.
    The image is created on a PC, which has a 300GB HDD. The windows partition is over the total size of the hdd.
    This imaging process on a new pc is as following script shows:
    Code:
    # Delete + MBR partition table
    dd if = /dev/zero of=/dev/sda bs=512 count=1
    # partition
    fdisk /dev/sda << EOF
    w
    EOF
    # imaging
    img rp server IP path/to/image.zmg
    This works quite well so far, with the only problem, that the partition on the new PC has the maximum of 300 GB. So if I image this image on a pc, which hdd has 500 GB, 200 GB will remain unpartitioned.
    I have redesigned the imaging now follows:
    Code:
    # imaging
    img pc1 NTFS
    img rp server IP path/to/image.zmg a1: p1
    img pa1
    Now the entire HDD is used for the partition, but after the imaging the PC doesn`t boot, and stops with a black screen and a blinking cursor.
    I am typing this on a problem with the mbr, but does not know how to fix it: (
    I have to modify the imaging-process, that i can use the image on every HDD size with the result, that always the max partitionsize is used.

    hi all, i am having an issue where found out that Imaging Script cannot be used to multicast so i am running in to a problem now. If i push out an image via zcm script bundle it works fine with your suggestions but i cannot seem to figure out why the image wipes out all the hard drives in the systems during multicast image set or a single image load via pxe boot.
    First problem:
    if i push out an image via Zenworks Image preboot bundle file set is set to 1 it wipes out all the hardrvie in the system (tow hard drive, disk 0 and disk 1. i can certainly fix the disk resizing issue by adding a script to unattaned file after the image is loaded to resize the disk automatically using diskpart commands. which works fine.
    Second problem:
    here is what i did:
    1. created an multicast Image Set
    2. number of clients needed set to 1
    3. Time out in five minutes
    It does not load the image znd waits for session to start.
    how can i automate this via zcm to make sure on pxe boot the both pcs receive the image as scheduled in zcm.
    Please assist.
    thank you.

  • Huge Problems with WD Mycloud... files disappearing...

    I recently installe done of these in a small clients office (they have 4 or 5 users) and wanted a simple storage device. I had used these before andf they loooked good so I bought one. It has been a huge embarrassment and I hope you can help me resolve my users issues. Here is the behavior described to me:I had a file saving problem in FileA. It could have been around 5:41. Detailed: - The original file was saved in the "FolderA" folder in Share1 (saved there on Tuesday). - I hit save and it said it could not be saved. I hit okay, and then save again, and it said "file not saved". - I copy/pasted the data into a new, blank document, and closed the original file. When I tried to reopen the original it told me Excel cannot open this file, it may be corrupted. - I saved the copy/pasted version to my desktop and continued working in that.  My client is repeatedly going back to using their desktops becaus eof saving and corrupt file frustratiopns on wd mycloud.Firmware is up to date.Please help.

    If one maps the WD My Cloud through WD2Go.com connection to their local computer then there will be problems with saving and opening files on or to the WD My Cloud. The problem actually lies with Microsoft Office in that case. If you have mapped the drive(s) through WD2Go.com then see the following explanation from WD Support and a workaround to the problem if connecting remotely through WD2Go.com. Microsoft Office documents in a device connected through WD My Cloud Remote Web Access cannot be opened If both the client computers and the WD My Cloud device are both on the same local network, there is no need to map the drive through the WD2Go interface and one should be able to save/open Microsoft Office documents on the WD My Cloud. See the WD Support documents below for directions on how to map a WD My Cloud that is on the local network (not remotely). How to map a WD My Cloud or NAS product on a Windows PCMapping a drive letter on a WD Network hard drive using WD Discovery

  • Problem with  SQL_ATTR_ROW_STATUS_PTR on 11.02.0030

    The problem occur only with version *11.02.0030* all other previous version of the client work has expected.
    If you set a row status ptr. This properties is supposed to be an SQLUSMALLINT (unsign short)
    So assuming my code does sothing like:
    SQLUSMALLINT *m_rgRowStatus;
    m_rgRowStatus=(SQLUSMALLINT *)malloc(112 * sizeof(SQLUSMALLINT));
    ::SQLSetStmtOption(m_hstmt, SQL_ATTR_ROW_ARRAY_SIZE, 112)
    ::SQLSetStmtOption(m_hstmt, SQL_ATTR_ROW_STATUS_PTR, m_rgRowStatus));
    After a call to
    AFX_ODBC_CALL(::SQLFetchScroll(m_hstmt, SQL_FETCH_NEXT, 0));
    The status of each row get rewriten has if it was SQLUINTEGER effectively overwriting memory.
    Maybe a screens shots will help:
    [Before fetchScroll|http://i200.photobucket.com/albums/aa19/jajoflo/before_fetchscroll.png]
    [After FetchScroll|http://i200.photobucket.com/albums/aa19/jajoflo/afterfetchscroll.png]
    Of course this is a major problem.
    Any Idea or workaround?
    Edited by: ca109900 on Feb 17, 2012 1:22 PM

    Hi all I have a similar problem, but don't know what's wrong:
    LOAD DATA
    INFILE *
    INTO TABLE table_test
    REPLACE
    FIELDS TERMINATED BY ','
    number1 INTEGER EXTERNAL,
    mychar1 CHAR(250),
    image LOBFILE (mychar1) TERMINATED BY EOF
    BEGINDATA
    1153,/opt/oracle/appl/myproject/HR/imgdir/1153.JPG
    the error msg is :
    SQL*Loader-350: Syntax error at line 9.
    Expecting "," or ")", found "LOBFILE".
    image LOBFILE (mychar1) TERMINATED BY EOF
    (The table has the columns number1 (number) , mychar1 (varchar2(250) and image (blob) )
    What is the problem with LOBFILE...?
    Thanks,
    Jose.

  • 8i Listener Problem with client

    Hi
    I'm having problems with our Linux 8i server.
    Software has been installed ok and I can get client connections with a
    freshly started listener (LSNRCTL start) using the DBA studio client.
    Once I disconnect and then attempt to reconnect I get a "Target not found"
    error. But, if I restart the listener on the server then try to connect
    again all is fine.telnet is ok the port is open and ready.
    I have some more information below that I think is causing my problem
    When I start the listener I get
    TNSLSNR for Linux: Version 8.1.6.0.0 - Production
    System parameter file is
    /u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
    Log messages written to
    /u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
    Listening on:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=holly.mv)(PORT=1521)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
    Connecting to
    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=holly.mv)(PORT=1521)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
    Start Date 23-AUG-2000 09:23:48
    Uptime 0 days 0 hr. 0 min. 0 sec
    Trace Level off
    Security OFF
    SNMP ON
    Listener Parameter File
    /u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
    Listener Log File
    /u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
    Services Summary...
    PLSExtProc has 1 service handler(s)
    ora8 has 1 service handler(s)
    The command completed successfully
    ***EOF
    For around 50 -65 seconds after this I can connect and reconnect etc
    After this time if I do a lsnrctl status I get ( Note the 3 extra
    handlers
    on ora8 )
    LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 23-AUG-2000 09:24:39
    (c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
    Connecting to
    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=holly.mv)(PORT=1521)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
    Start Date 23-AUG-2000 09:23:48
    Uptime 0 days 0 hr. 0 min. 51 sec
    Trace Level off
    Security OFF
    SNMP ON
    Listener Parameter File
    /u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
    Listener Log File
    /u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
    Services Summary...
    PLSExtProc has 1 service handler(s)
    ora8 has 1 service handler(s)
    ora8 has 3 service handler(s)<======== ???????
    The command completed successfully
    ***EOF
    Once these extra handlers appear, I can no longer connect to the server.
    Here is my listener.ora file
    # LISTENER.ORA Configuration
    File:/u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = holly.mv)(PORT = 1521))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/ora8/app/oracle/8i_8.1.6)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ora8)
    (ORACLE_HOME = /u01/ora8/app/oracle/8i_8.1.6)
    (SID_NAME = ora8)
    ***EOF
    Any ideas on if this is related to my problem
    Regards
    Andrew
    null

    The client debug is a good place to start and here is a document explaining that process.
    http://www.cisco.com/en/US/products/hw/wireless/ps430/products_tech_note09186a008091b08b.shtml
    You many want to do dot11 debugs as well. But sniff the air first and see what activity you see... Also check your clients for a possible misconfig.

  • Peculiar problem with playing media off of an HFS+ partition

    Hi guys,
    I have Arch Linux installed on my Macbook Pro, and I need to play the music and videos off of my HFS+ partition in Linux. I want to use VLC and Banshee, but both seem to be having problems with this.
    Here is the issue:
    1. I can read/write to the HFS+ partiton as a normal user
    2. I can play music and videos with mplayer off of that partition
    3. However, VLC will not open/play anything off of that partition
    4. Banshee marks the music files that I have imported from that partition with an 'X' when I try to play them and does not play them
    5. VLC and Banshee will play anything on my Linux partition (including the same file with the same permissions)
    I can't seem to figure out why VLC and Banshee refuse to play anything off of that partition even though I have read/write permissions to it. Mplayer works fine, though.
    Please help!
    -Chetan
    More info:
    Here is how the partition is mounted:
    /dev/sda2 /media/mac_hd hfsplus rw,exec,auto,users 0 0
    Permissions on a certain mp3 file I am trying to play:
    [chetan@chetan-macbook mac_hd]$ ls -l It\'s\ Going\ Down.mp3
    -rwxr-xr-x 1 chetan chetan 4841568 2009-04-28 09:59 It's Going Down.mp3
    VLC debug output trying to play that file in the HFS+ partition:
    qt4 debug: New item: /media/mac_hd/It's Going Down.mp3
    main debug: adding item `It's Going Down.mp3' ( /media/mac_hd/It's Going Down.mp3 )
    main debug: rebuilding array of current - root Playlist
    main debug: rebuild done - 1 items, index -1
    main debug: starting new item
    main debug: processing request item It's Going Down.mp3 node Playlist skip 0
    main debug: resyncing on It's Going Down.mp3
    main debug: It's Going Down.mp3 is at 0
    main debug: creating new input thread
    main debug: Creating an input for 'It's Going Down.mp3'
    main debug: waiting for thread initialization
    main debug: thread started
    main debug: thread 2952383376 (input) created at priority 10 (input/input.c:370)
    main debug: `/media/mac_hd/It's Going Down.mp3' gives access `' demux `' path `/media/mac_hd/It's Going Down.mp3'
    main debug: creating demux: access='' demux='' path='/media/mac_hd/It's Going Down.mp3'
    main debug: looking for access_demux module: 3 candidates
    main debug: TIMER module_Need() : 0.100 ms - Total 0.100 ms / 1 intvls (Avg 0.100 ms)
    main debug: creating access '' path='/media/mac_hd/It's Going Down.mp3'
    main debug: looking for access module: 5 candidates
    vcd debug: trying .cue file: /media/mac_hd/It's Going Down.cue
    vcd debug: could not find .cue file
    access_directory debug: opening directory `/media/mac_hd/It's Going Down.mp3'
    main debug: using access module "access_directory"
    main debug: TIMER module_Need() : 0.079 ms - Total 0.079 ms / 1 intvls (Avg 0.079 ms)
    main debug: Using AStream*Stream
    main debug: pre-buffering...
    main debug: deleting item `It's Going Down.mp3'
    access_directory debug: /media/mac_hd/It's Going Down.mp3 directory is empty
    qt4 debug: Updating the stream status: 3
    qt4 debug: New Event: type 1102
    qt4 debug: Updating the stream status: 2
    main debug: received first data for our buffer
    main debug: pre-buffering done 1408981 bytes in 0s - 33435 kbytes/s
    main debug: creating demux: access='' demux='directory' path='/media/mac_hd/It's Going Down.mp3'
    main debug: looking for demux module: 1 candidate
    main debug: using demux module "access_directory"
    main debug: TIMER module_Need() : 0.117 ms - Total 0.117 ms / 1 intvls (Avg 0.117 ms)
    main debug: looking for a subtitle file in /media/mac_hd/
    main debug: `/media/mac_hd/It's Going Down.mp3' successfully opened
    main debug: rebuilding array of current - root Playlist
    main debug: rebuild done - 0 items, index -1
    main debug: EOF reached
    main debug: control type=1
    qt4 debug: New Event: type 1103
    qt4 debug: Updating the stream status: 3
    main debug: finished input
    main debug: dying input
    main debug: removing module "access_directory"
    main debug: removing module "access_directory"
    main debug: thread ended
    qt4 debug: Updating the stream status: 8
    main debug: dead input
    main debug: thread 2952383376 joined (playlist/engine.c:244)
    main debug: TIMER input launching for 'It's Going Down.mp3' : 43.636 ms - Total 43.636 ms / 1 intvls (Avg 43.636 ms)
    main debug: starting new item
    main info: playlist is empty
    main debug: nothing to play
    VLC debug output playing the same file on the Linux partition:
    qt4 debug: New item: /media/It's Going Down.mp3
    main debug: adding item `It's Going Down.mp3' ( /media/It's Going Down.mp3 )
    main debug: rebuilding array of current - root Playlist
    main debug: rebuild done - 2 items, index 0
    main debug: dying input
    main debug: control type=0
    main debug: control: stopping input
    main debug: removing module "mpeg_audio"
    main debug: removing module "mpga"
    main debug: removing module "access_file"
    main debug: removing module "mpeg_audio"
    main debug: thread ended
    qt4 debug: Updating the stream status: 8
    main debug: thread 2948737936 joined (input/decoder.c:248)
    main debug: killing decoder fourcc `mpga', 0 PES in FIFO
    main debug: removing module "mpgatofixed32"
    main debug: removing module "bandlimited_resampler"
    main debug: thread ended
    main debug: thread 2935872400 joined (alsa.c:742)
    main debug: removing module "alsa"
    main debug: removing module "trivial_mixer"
    main debug: thread ended
    main debug: dead input
    main debug: thread 2974059408 joined (playlist/engine.c:244)
    main debug: TIMER input launching for 'It's Going Down.mp3' : 69.642 ms - Total 69.642 ms / 1 intvls (Avg 69.642 ms)
    main debug: starting new item
    main debug: processing request item It's Going Down.mp3 node Playlist skip 0
    main debug: resyncing on It's Going Down.mp3
    main debug: It's Going Down.mp3 is at 1
    main debug: creating new input thread
    main debug: Creating an input for 'It's Going Down.mp3'
    main debug: thread started
    main debug: waiting for thread initialization
    main debug: `/media/It's Going Down.mp3' gives access `' demux `' path `/media/It's Going Down.mp3'
    main debug: creating demux: access='' demux='' path='/media/It's Going Down.mp3'
    main debug: looking for access_demux module: 3 candidates
    main debug: TIMER module_Need() : 0.102 ms - Total 0.102 ms / 1 intvls (Avg 0.102 ms)
    main debug: creating access '' path='/media/It's Going Down.mp3'
    main debug: looking for access module: 5 candidates
    vcd debug: trying .cue file: /media/It's Going Down.cue
    vcd debug: could not find .cue file
    access_file debug: opening file `/media/It's Going Down.mp3'
    main debug: using access module "access_file"
    main debug: TIMER module_Need() : 0.218 ms - Total 0.218 ms / 1 intvls (Avg 0.218 ms)
    main debug: Using AStream*Stream
    main debug: pre-buffering...
    main debug: received first data for our buffer
    main debug: pre-buffering done 1408981 bytes in 0s - 623169 kbytes/s
    main debug: creating demux: access='' demux='' path='/media/It's Going Down.mp3'
    main debug: ID3v2.2 revision 0 tag found, skipping 3040 bytes
    main debug: looking for demux module: 52 candidates
    main debug: looking for packetizer module: 18 candidates
    main debug: using packetizer module "mpeg_audio"
    main debug: TIMER module_Need() : 0.059 ms - Total 0.059 ms / 1 intvls (Avg 0.059 ms)
    main debug: using demux module "mpga"
    main debug: TIMER module_Need() : 0.161 ms - Total 0.161 ms / 1 intvls (Avg 0.161 ms)
    main debug: looking for a subtitle file in /media/
    main debug: looking for meta reader module: 2 candidates
    main debug: using meta reader module "taglib"
    main debug: TIMER module_Need() : 0.457 ms - Total 0.457 ms / 1 intvls (Avg 0.457 ms)
    main debug: removing module "taglib"
    main debug: `/media/It's Going Down.mp3' successfully opened
    mpeg_audio debug: MPGA channels:2 samplerate:44100 bitrate:160
    main debug: selecting program id=0
    main debug: looking for decoder module: 31 candidates
    main debug: using decoder module "mpeg_audio"
    main debug: TIMER module_Need() : 0.133 ms - Total 0.133 ms / 1 intvls (Avg 0.133 ms)
    main debug: thread 2935872400 (decoder) created at priority 5 (input/decoder.c:217)
    main debug: thread 2974059408 (input) created at priority 10 (input/input.c:370)
    qt4 debug: Updating the stream status: 3
    main debug: control type=1
    main debug: thread started
    mpeg_audio debug: MPGA channels:2 samplerate:44100 bitrate:160
    main debug: no aout present, spawning one
    main debug: looking for audio output module: 4 candidates
    alsa debug: opening ALSA device `default'
    main debug: thread 2948737936 (aout) created at priority 15 (alsa.c:687)
    main debug: using audio output module "alsa"
    main debug: TIMER module_Need() : 91.497 ms - Total 91.497 ms / 1 intvls (Avg 91.497 ms)
    main debug: thread started
    main debug: output 'fl32' 44100 Hz Stereo frame=1 samples/8 bytes
    main debug: mixer 'fl32' 44100 Hz Stereo frame=1 samples/8 bytes
    main debug: no need for any filter
    main debug: looking for audio mixer module: 3 candidates
    main debug: using audio mixer module "float32_mixer"
    main debug: TIMER module_Need() : 0.072 ms - Total 0.072 ms / 1 intvls (Avg 0.072 ms)
    main debug: input 'mpga' 44100 Hz Stereo frame=1152 samples/1053 bytes
    main debug: filter(s) 'mpga'->'fl32' 44100 Hz->44100 Hz Stereo->Stereo
    main debug: looking for audio filter module: 24 candidates
    main debug: using audio filter module "mpgatofixed32"
    main debug: TIMER module_Need() : 0.062 ms - Total 0.062 ms / 1 intvls (Avg 0.062 ms)
    main debug: found a filter for the whole conversion
    main debug: filter(s) 'fl32'->'fl32' 48510 Hz->44100 Hz Stereo->Stereo
    main debug: looking for audio filter module: 24 candidates
    main debug: using audio filter module "bandlimited_resampler"
    main debug: TIMER module_Need() : 0.086 ms - Total 0.086 ms / 1 intvls (Avg 0.086 ms)
    main debug: found a filter for the whole conversion

    See this thread on the VLC forums. The VLC devs have stopped supporting HFS+ until a bug in the filesystem is fixed.
    http://forum.videolan.org/viewtopic.php … 9&start=15

  • 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