[JMF] problem with mediaURL

Hello!!
For beginning, sorry about my english... I'm french...
So, i'm learning about JMF and more precisely make a video player.
My problem start now, i've make a program who read a .avi file but this one doesn't run.
That is my code for my video class:
import javax.swing.*;
import javax.media.*;
import java.awt.*;
import java.net.*;
import java.io.*;
public class Video extends JFrame implements ControllerListener {
    Player player;
    String URLdocument;
    Container container;
    public Video(String url){
        super();
        container = getContentPane();
        container.setLayout(new BorderLayout());
        this.URLdocument = url;
        URL mediaURL = null;
        try {
            mediaURL = new URL(url);
            player = Manager.createPlayer(mediaURL);
        catch (Exception ex) {
            JOptionPane.showMessageDialog(null, "Erreur de construction: \n"+ex.getMessage(), "ERREUR FATALE", JOptionPane.ERROR_MESSAGE);
        player.addControllerListener(this);
        player.start();       
    public void controllerUpdate(ControllerEvent e){
        if (e instanceof StartEvent){
            Component compvisual = player.getVisualComponent();
            Component compControl = player.getControlPanelComponent();
            if (compvisual != null) {
                container.add(BorderLayout.CENTER, compvisual);
            if (compControl != null){
                container.add(BorderLayout.CENTER, compControl);
            validate();
            pack();
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setVisible(true);
//MA CLASSE MAIN
public class main {
    public static void main(String[] args) {
        Video V = new Video("file:C:\\Documents and Settings\\cyrille\\Mes documents\\Mes vid�os\\23 - Einstein.avi");
And that is the error message:
C:\Borland\JBuilder2005\jdk1.4\bin\javaw -classpath "C:\Documents and Settings\cyrille\jbproject\test-multimedia\classes;C:\Program Files\JMF2.1.1e\lib\customizer.jar;C:\Program Files\JMF2.1.1e\lib\jmf.jar;C:\Program Files\JMF2.1.1e\lib\mediaplayer.jar;C:\Program Files\JMF2.1.1e\lib\multiplayer.jar;C:\Program Files\JMF2.1.1e\lib\sound.jar;C:\Borland\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\charsets.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jce.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\jsse.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\plugin.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\rt.jar;C:\Borland\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;C:\Borland\JBuilder2005\jdk1.4\lib\dt.jar;C:\Borland\JBuilder2005\jdk1.4\lib\htmlconverter.jar;C:\Borland\JBuilder2005\jdk1.4\lib\tools.jar"  test.main
  Unable to handle format: DX50, 464x352, FrameRate=25.0, Length=979968 0 extra bytes
  Unable to handle format: mpeglayer3, 44100.0 Hz, 0-bit, Stereo, Unsigned, 16000.0 frame rate, FrameSize=8 bits
Failed to realize: com.sun.media.PlaybackEngine@109fd93
Error: Unable to realize com.sun.media.PlaybackEngine@109fd93
ERROR while querying ACM driver's information
With debugger mode (JBuilder), hte line where there is a problem is:
mediaURL = new URL(url);
I'm leraning to use JMF with a french book where error are not mentioned...
Thanks in advance for your help.

Blue screen means something in the Windows code is crashing your computer. There's probably not anything you can do to fix it except unplug any devices you have plugged in...

Similar Messages

  • JMF Problem with Logitech camera

    Hi
    I have a problem with JMF Registry Editor. I've tryed Detect Capture Devices and during detecting my computer crashes (blue screan) and restart the system. How can I solve this problem? I've set JMFHome.
    Thank you in advance.
    Falken

    Blue screen means something in the Windows code is crashing your computer. There's probably not anything you can do to fix it except unplug any devices you have plugged in...

  • Problem with file descriptors not released by JMF

    Hi,
    I have a problem with file descriptors not released by JMF. My application opens a video file, creates a DataSource and a DataProcessor and the video frames generated are transmitted using the RTP protocol. Once video transmission ends up, if we stop and close the DataProcessor associated to the DataSource, the file descriptor identifying the video file is not released (checkable through /proc/pid/fd). If we repeat this processing once and again, the process reaches the maximum number of file descriptors allowed by the operating system.
    The same problem has been reproduced with JMF-2.1.1e-Linux in several environments:
    - Red Hat 7.3, Fedora Core 4
    - jdk1.5.0_04, j2re1.4.2, j2sdk1.4.2, Blackdown Java
    This is part of the source code:
    // video.avi with tracks audio(PCMU) and video(H263)
    String url="video.avi";
    if ((ml = new MediaLocator(url)) == null) {
    Logger.log(ambito,refTrazas+"Cannot build media locator from: " + url);
    try {
    // Create a DataSource given the media locator.
    Logger.log(ambito,refTrazas+"Creating JMF data source");
    try
    ds = Manager.createDataSource(ml);
    catch (Exception e) {
    Logger.log(ambito,refTrazas+"Cannot create DataSource from: " + ml);
    return 1;
    p = Manager.createProcessor(ds);
    } catch (Exception e) {
    Logger.log(ambito,refTrazas+"Failed to create a processor from the given url: " + e);
    return 1;
    } // end try-catch
    p.addControllerListener(this);
    Logger.log(ambito,refTrazas+"Configure Processor.");
    // Put the Processor into configured state.
    p.configure();
    if (!waitForState(p.Configured))
    Logger.log(ambito,refTrazas+"Failed to configure the processor.");
    p.close();
    p=null;
    return 1;
    Logger.log(ambito,refTrazas+"Configured Processor OK.");
    // So I can use it as a player.
    p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.RAW_RTP));
    // videoTrack: track control for the video track
    DrawFrame draw= new DrawFrame(this);
    // Instantiate and set the frame access codec to the data flow path.
    try {
    Codec codec[] = {
    draw,
    new com.sun.media.codec.video.colorspace.JavaRGBToYUV(),
    new com.ibm.media.codec.video.h263.NativeEncoder()};
    videoTrack.setCodecChain(codec);
    } catch (UnsupportedPlugInException e) {
    Logger.log(ambito,refTrazas+"The processor does not support effects.");
    } // end try-catch CodecChain creation
    p.realize();
    if (!waitForState(p.Realized))
    Logger.log(ambito,refTrazas+"Failed to realize the processor.");
    return 1;
    Logger.log(ambito,refTrazas+"realized processor OK.");
    /* After realize processor: THESE LINES OF SOURCE CODE DOES NOT RELEASE ITS FILE DESCRIPTOR !!!!!
    p.stop();
    p.deallocate();
    p.close();
    return 0;
    // It continues up to the end of the transmission, properly drawing each video frame and transmit them
    Logger.log(ambito,refTrazas+" Create Transmit.");
    try {
    int result = createTransmitter();
    } catch (Exception e) {
    Logger.log(ambito,refTrazas+"Error Create Transmitter.");
    return 1;
    } // end try-catch transmitter
    Logger.log(ambito,refTrazas+"Start Procesor.");
    // Start the processor.
    p.start();
    return 0;
    } // end of main code
    * stop when event "EndOfMediaEvent"
    public int stop () {
    try {   
    /* THIS PIECE OF CODE AND VARIATIONS HAVE BEEN TESTED
    AND THE FILE DESCRIPTOR IS NEVER RELEASED */
    p.stop();
    p.deallocate();
    p.close();
    p= null;
    for (int i = 0; i < rtpMgrs.length; i++)
    if (rtpMgrs==null) continue;
    Logger.log(ambito, refTrazas + "removeTargets;");
    rtpMgrs[i].removeTargets( "Session ended.");
    rtpMgrs[i].dispose();
    rtpMgrs[i]=null;
    } catch (Exception e) {
    Logger.log(ambito,refTrazas+"Error Stoping:"+e);
    return 1;
    return 0;
    } // end of stop()
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
    Logger.log(ambito,refTrazas+"\nControllerEvent."+evt.toString());
    if (evt instanceof ConfigureCompleteEvent ||
    evt instanceof RealizeCompleteEvent ||
    evt instanceof PrefetchCompleteEvent) {
    synchronized (waitSync) {
    stateTransitionOK = true;
    waitSync.notifyAll();
    } else if (evt instanceof ResourceUnavailableEvent) {
    synchronized (waitSync) {
    stateTransitionOK = false;
    waitSync.notifyAll();
    } else if (evt instanceof EndOfMediaEvent) {
    Logger.log(ambito,refTrazas+"\nEvento EndOfMediaEvent.");
    this.stop();
    else if (evt instanceof ControllerClosedEvent)
    Logger.log(ambito,refTrazas+"\nEvent ControllerClosedEvent");
    close = true;
    waitSync.notifyAll();
    else if (evt instanceof StopByRequestEvent)
    Logger.log(ambito,refTrazas+"\nEvent StopByRequestEvent");
    stop =true;
    waitSync.notifyAll();
    Many thanks.

    Its a bug on H263, if you test it without h263 track or with other video codec, the release will be ok.
    You can try to use a not-Sun h263 codec like the one from fobs or jffmpeg projects.

  • Classpath problems with JMF

    Hi all,
    I'm trying to develop a simple application using JMF; I've problems importing classes from javax.media package. Problem with my application is that when I explicitly specify classpath as a command line argument to javac my application compiles; but if I use CLASSPATH environment variable it doesn't. Here's the output:
    situ@situ-desktop:~/myjava/media$ cat First.java
    import javax.media.*;
    public class First{
    situ@situ-desktop:~/myjava/media$ echo $CLASSPATH
    /home/situ/jmf/JMF-2.1.1e/lib/jmf.jar:/home/situ/jmf/JMF-2.1.1e/lib/sound.jar:.:
    situ@situ-desktop:~/myjava/media$ javac First.java
    First.java:1: package javax.media does not exist
    import javax.media.*;
    ^
    1 error
    situ@situ-desktop:~/myjava/media$ javac -classpath /home/situ/jmf/JMF-2.1.1e/lib/jmf.jar First.java
    situ@situ-desktop:~/myjava/media$
    Thanks.

    According to the documentation, it wants you to set two environmental variables, JMFHOME and CLASSPATH. And it wants the CLASSPATH to be relative to that JMFHOME variable.
    Try this.
    setenv JMFHOME /home/someuser/JMF2.1.1
    setenv CLASSPATH $JMFHOME/lib/jmf.jar:.:${CLASSPATH}

  • Problem with Transmitting media using JMF

    Hello Everyone !!
    I am working on an application called SIPSpeaker which listens for incoming calls, answer the call and plays a message. I am done with the first two parts of the application, i.e. it can successfully answers the call. I am now facing problem with transmitting audio to the SIP Phone (the caller). I am using JMF and I am trying to send the audio over RTP.
    My code looks something like this....
    locator = new MediaLocator("rtp://130.237.214.124:" + port + "/audio");
            f = new File("C:/1.wav");
            try {
                ds = Manager.createDataSource(f.toURL());         
            } catch (NoDataSourceException ex) {
                ex.printStackTrace();
            } catch (MalformedURLException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            format = new Format[]{new AudioFormat(AudioFormat.GSM_RTP,8000,8,1)};
            contentDesc = new ContentDescriptor(ContentDescriptor.RAW_RTP);
                    processor = Manager.createProcessor(ds);
                    waitForState(processor,Processor.Configured);
                    processor.setContentDescriptor(contentDesc);
                    processor.getTrackControls()[0].setFormat(format[0]);
                    waitForState(processor,Processor.Realized);
    try {
                sink = Manager.createDataSink(processor.getDataOutput(),locator);
                System.out.println("6");
            } catch (NotRealizedError ex) {
                ex.printStackTrace();
            } catch (NoDataSinkException ex) {
                ex.printStackTrace();
    processor.start();
            try {
                sink.open();
                sink.start();
            } catch (SecurityException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
               we are required to work with a .wav file as input ....
    i am new to java and to JMF and i have absolutely no idea whats going wrong...
    please help me
    Regards,
    Sanjay !!

    Hello
    following is the error i get
    Failed to realize: com.sun.media.ProcessEngine@618d26
    Cannot build a flow graph with the customized options:
    Unable to transcode format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 16000.0 frame rate, FrameSize=32768 bits
    to: mpegaudio/rtp, 8000.0 Hz, 8-bit, Mono
    outputting to: RAW/RTP
    Error: Unable to realize com.sun.media.ProcessEngine@618d26
    what could be the problem ???

  • Problem with installing JMF

    Hi all,
    Im kinda new to Java and im trying to play an avi file with java. I understood one need to add the jmf to its project to make this possible. I downloaded the jmf for windows from this site.
    The problem is it wont install. It says (translated): "C:\windows\system32\autoexec.nt. This systemfile is not applyable for ms DOS or Windows applications."
    I have really no idea what its talking about. I have no other problems with this comp or anything. Running windows xp prof. The file i try to install is called: "jmf-2_1_1e-windows-i586.exe"
    Can someone please help me or explain the problem? I need this for school and Im stuck as long as this problems keep appearing...
    Thanks in advance,
    Jordin

    I think I dont have a problem installing JMF without connect the webcam.
    The JMF registry can detect new media locator. isnt't it?
    Hey Khrisna, can u suggest me my question in topic
    "Video Conferrence over internet???"
    I get confuse about cloning the datasource. thanks

  • Problem with streaming video

    Hi!
    I have a problem with my project. Please help me!
    I tried to send a video streaming between 2 computers. I used socket connection and AVReceive2, AVTransmit. When received computer display 59 seconds, it stop the connection, socket is closed and program send a error report.
    I list here:
    =========================================================================
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x070b17ff, pid=1180, tid=2176
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_13-b05 mixed mode, sharing)
    # Problematic frame:
    # C [jmmpegv.dll+0x17ff]
    --------------- T H R E A D ---------------
    Current thread (0x02cdf930): JavaThread "Loop thread: com.sun.media.parser.RawBufferParser$FrameTrack@27391d" daemon [_thread_in_native, id=2176]
    siginfo: ExceptionCode=0xc0000005, reading address 0x0d2451f8
    Registers:
    EAX=0x0000008e, EBX=0xfffffffd, ECX=0x070c2a68, EDX=0x0000ffff
    ESP=0x078ff8a4, EBP=0x0000000d, ESI=0x016c0000, EDI=0x077451f8
    EIP=0x070b17ff, EFLAGS=0x00010202
    Top of Stack: (sp=0x078ff8a4)
    0x078ff8a4: 00000001 00000164 07110650 00000000
    0x078ff8b4: 00000005 0000010f 070c2a34 00000003
    0x078ff8c4: 00000003 070b65c8 070c250f 070c2b3c
    0x078ff8d4: 07740048 00000002 00000000 00000000
    0x078ff8e4: 00000000 00000000 070b66c0 07740048
    0x078ff8f4: 07740048 070b6c3b 00000001 07740048
    0x078ff904: 071101a0 07740048 078ff990 00000000
    0x078ff914: 00000000 070b74b5 07740048 078ff97c
    Instructions: (pc=0x070b17ff)
    0x070b17ef: fc 01 0c 07 0b d7 8b 3d c0 2d 0c 07 c1 fe 03 45
    0x070b17ff: d9 04 b7 8b 35 44 36 0c 07 8b f9 d8 0c 86 d9 1c
    Stack: [0x078c0000,0x07900000), sp=0x078ff8a4, free space=254k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [jmmpegv.dll+0x17ff]
    [error occurred during error reporting, step 120, id 0xc0000005]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j com.ibm.media.codec.video.mpeg.MpegVideo.videoDecode(J[BIIILjava/lang/Object;JII[I[I[I[I[I[I)I+0
    j com.ibm.media.codec.video.mpeg.MpegVideo.process(Ljavax/media/Buffer;Ljavax/media/Buffer;)I+574
    J com.sun.media.BasicFilterModule.process()V
    J com.sun.media.BasicOutputConnector.writeReport()V
    J com.sun.media.BasicFilterModule.process()V
    J com.sun.media.BasicOutputConnector.writeReport()V
    J com.sun.media.SourceThread.process()Z
    j com.sun.media.util.LoopThread.run()V+14
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x02cdd008 JavaThread "Loop thread: com.sun.media.parser.RawBufferParser$FrameTrack@cec0c5" daemon [_thread_blocked, id=3104]
    0x02d1df88 JavaThread "Loop thread: com.sun.media.renderer.audio.DirectAudioRenderer@2ce908" daemon [_thread_blocked, id=1176]
    =>0x02cdf930 JavaThread "Loop thread: com.sun.media.parser.RawBufferParser$FrameTrack@27391d" daemon [_thread_in_native, id=2176]
    0x02ce0890 JavaThread "Loop thread: com.sun.media.renderer.video.DDRenderer@14a8cd1" daemon [_thread_blocked, id=2296]
    0x02c5e920 JavaThread "Progress Slider thread" daemon [_thread_blocked, id=3172]
    0x02d18c58 JavaThread "Loop thread" daemon [_thread_blocked, id=2920]
    0x00ab5a50 JavaThread "DirectSound Request Thread" daemon [_thread_blocked, id=3984]
    0x00a80480 JavaThread "Progress Slider thread" daemon [_thread_blocked, id=3180]
    0x02c89d18 JavaThread "Loop thread" daemon [_thread_blocked, id=788]
    0x02d37098 JavaThread "JMF thread: SendEventQueue: com.sun.media.PlaybackEngine" daemon [_thread_blocked, id=3328]
    0x02c8bc28 JavaThread "JMF thread: SendEventQueue: com.sun.media.content.unknown.Handler" daemon [_thread_blocked, id=2916]
    0x02c78720 JavaThread "RTPStream" daemon [_thread_blocked, id=3400]
    0x02db1d90 JavaThread "JMF thread: SendEventQueue: com.sun.media.PlaybackEngine" daemon [_thread_blocked, id=3032]
    0x02c73c10 JavaThread "JMF thread: SendEventQueue: com.sun.media.content.unknown.Handler" daemon [_thread_blocked, id=1440]
    0x02c7d930 JavaThread "RTPStream" daemon [_thread_blocked, id=2664]
    0x02d195e0 JavaThread "RTCP Reporter" daemon [_thread_blocked, id=2416]
    0x02d19008 JavaThread "SSRC Cache Cleaner" daemon [_thread_blocked, id=592]
    0x02d24a30 JavaThread "RTP Forwarder for address 192.168.1.34 port 1627" daemon [_thread_in_native, id=376]
    0x02c5fa30 JavaThread "RTCP Forwarder for address192.168.1.34 port 1628" daemon [_thread_in_native, id=3840]
    0x02c5f008 JavaThread "RTPEventHandler" daemon [_thread_blocked, id=2516]
    0x02c60440 JavaThread "RTCP Reporter" daemon [_thread_blocked, id=2820]
    0x02c602b8 JavaThread "SSRC Cache Cleaner" daemon [_thread_blocked, id=3816]
    0x02d403d0 JavaThread "RTP Forwarder for address 192.168.1.34 port 1625" daemon [_thread_in_native, id=2272]
    0x02d0de20 JavaThread "RTCP Forwarder for address192.168.1.34 port 1626" daemon [_thread_in_native, id=1500]
    0x00a64e30 JavaThread "RTPEventHandler" daemon [_thread_blocked, id=3852]
    0x02c9d6e8 JavaThread "TimerQueue" daemon [_thread_blocked, id=2472]
    0x00035c78 JavaThread "DestroyJavaVM" [_thread_blocked, id=2776]
    0x02cbbb10 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=364]
    0x02c58478 JavaThread "AWT-Shutdown" [_thread_blocked, id=1008]
    0x02c58898 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3548]
    0x00aabf08 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2440]
    0x00a716d0 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3644]
    0x00a702b0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3348]
    0x00a6f598 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1184]
    0x00a6a300 JavaThread "Finalizer" daemon [_thread_blocked, id=2556]
    0x00a68e78 JavaThread "Reference Handler" daemon [_thread_blocked, id=1296]
    Other Threads:
    0x00a67c38 VMThread [id=1956]
    0x00a6f440 WatcherThread [id=3560]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 640K, used 501K [0x22a70000, 0x22b20000, 0x22f50000)
    eden space 576K, 76% used [0x22a70000, 0x22adde88, 0x22b00000)
    from space 64K, 96% used [0x22b10000, 0x22b1f758, 0x22b20000)
    to space 64K, 0% used [0x22b00000, 0x22b00000, 0x22b10000)
    tenured generation total 8172K, used 6973K [0x22f50000, 0x2374b000, 0x26a70000)
    the space 8172K, 85% used [0x22f50000, 0x2361f4e0, 0x2361f600, 0x2374b000)
    compacting perm gen total 8192K, used 2098K [0x26a70000, 0x27270000, 0x2aa70000)
    the space 8192K, 25% used [0x26a70000, 0x26c7ca90, 0x26c7cc00, 0x27270000)
    ro space 8192K, 67% used [0x2aa70000, 0x2afd23e0, 0x2afd2400, 0x2b270000)
    rw space 12288K, 47% used [0x2b270000, 0x2b81f450, 0x2b81f600, 0x2be70000)
    Dynamic libraries:
    0x00400000 - 0x0040d000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\java.exe
    0x7c900000 - 0x7c9b0000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000      C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000      C:\WINDOWS\system32\RPCRT4.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d740000 - 0x6d8dd000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000      C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f56000      C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x6d300000 - 0x6d308000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d710000 - 0x6d71c000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\verify.dll
    0x6d380000 - 0x6d39d000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\java.dll
    0x6d730000 - 0x6d73f000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\zip.dll
    0x6d070000 - 0x6d1da000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\awt.dll
    0x73000000 - 0x73026000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x76390000 - 0x763ad000      C:\WINDOWS\system32\IMM32.dll
    0x774e0000 - 0x7761c000      C:\WINDOWS\system32\ole32.dll
    0x305e0000 - 0x305f6000      C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 7.0\miscr3.dll
    0x77f60000 - 0x77fd6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x30480000 - 0x3048e000      C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 7.0\fssync.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\MSVCR80.dll
    0x5ad70000 - 0x5ada8000      C:\WINDOWS\system32\uxtheme.dll
    0x73760000 - 0x737a9000      C:\WINDOWS\system32\ddraw.dll
    0x73bc0000 - 0x73bc6000      C:\WINDOWS\system32\DCIMAN32.dll
    0x6d2b0000 - 0x6d300000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\fontmanager.dll
    0x7c9c0000 - 0x7d1d4000      C:\WINDOWS\system32\shell32.dll
    0x773d0000 - 0x774d2000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5d090000 - 0x5d127000      C:\WINDOWS\system32\comctl32.dll
    0x6d540000 - 0x6d553000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\net.dll
    0x71ab0000 - 0x71ac7000      C:\WINDOWS\system32\WS2_32.dll
    0x71aa0000 - 0x71aa8000      C:\WINDOWS\system32\WS2HELP.dll
    0x6d560000 - 0x6d569000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\nio.dll
    0x60300000 - 0x60307000      C:\PROGRA~1\Yahoo!\MESSEN~1\idle.dll
    0x7c340000 - 0x7c396000      C:\PROGRA~1\Yahoo!\MESSEN~1\MSVCR71.dll
    0x71a50000 - 0x71a8f000      C:\WINDOWS\system32\mswsock.dll
    0x662b0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000      C:\WINDOWS\System32\wshtcpip.dll
    0x10000000 - 0x10015000      C:\WINDOWS\system32\jmutil.dll
    0x76f20000 - 0x76f47000      C:\WINDOWS\system32\DNSAPI.dll
    0x30460000 - 0x3047b000      C:\Program Files\Kaspersky Lab\Kaspersky Anti-Virus 7.0\dnsq.dll
    0x76fb0000 - 0x76fb8000      C:\WINDOWS\System32\winrnr.dll
    0x76f60000 - 0x76f8c000      C:\WINDOWS\system32\WLDAP32.dll
    0x76fc0000 - 0x76fc6000      C:\WINDOWS\system32\rasadhlp.dll
    0x05540000 - 0x0554d000      C:\WINDOWS\system32\jmacm.dll
    0x77be0000 - 0x77bf5000      C:\WINDOWS\system32\MSACM32.dll
    0x58420000 - 0x58427000      C:\WINDOWS\system32\imaadp32.acm
    0x72cf0000 - 0x72cf7000      C:\WINDOWS\system32\msadp32.acm
    0x58330000 - 0x58335000      C:\WINDOWS\system32\msg711.acm
    0x58300000 - 0x58308000      C:\WINDOWS\system32\msgsm32.acm
    0x582d0000 - 0x582d4000      C:\WINDOWS\system32\tssoft32.acm
    0x73b70000 - 0x73b77000      C:\WINDOWS\system32\tsd32.dll
    0x58310000 - 0x5832d000      C:\WINDOWS\system32\msg723.acm
    0x58340000 - 0x5838d000      C:\WINDOWS\system32\msaud32.acm
    0x582e0000 - 0x582fe000      C:\WINDOWS\system32\sl_anet.acm
    0x581a0000 - 0x581d9000      C:\WINDOWS\system32\iac25_32.ax
    0x58390000 - 0x5841a000      C:\WINDOWS\system32\l3codeca.acm
    0x056d0000 - 0x056dc000      C:\WINDOWS\system32\jmdaud.dll
    0x73f10000 - 0x73f6c000      C:\WINDOWS\system32\DSOUND.dll
    0x77c00000 - 0x77c08000      C:\WINDOWS\system32\VERSION.dll
    0x06d50000 - 0x06dae000      C:\WINDOWS\system32\jmmpa.dll
    0x06c20000 - 0x06c2b000      C:\WINDOWS\system32\jmvcm.dll
    0x75a70000 - 0x75a91000      C:\WINDOWS\system32\MSVFW32.dll
    0x070b0000 - 0x070c6000      C:\WINDOWS\system32\jmmpegv.dll
    0x07210000 - 0x07218000      C:\WINDOWS\system32\jmddraw.dll
    0x073e0000 - 0x0748c000      C:\WINDOWS\system32\jmvh263.dll
    0x6d3e0000 - 0x6d3e6000      C:\Program Files\Java\jdk1.5.0_13\jre\bin\jawt.dll
    0x07340000 - 0x07349000      C:\WINDOWS\system32\jmfjawt.dll
    0x76c30000 - 0x76c5e000      C:\WINDOWS\system32\WINTRUST.dll
    0x77a80000 - 0x77b14000      C:\WINDOWS\system32\CRYPT32.dll
    0x77b20000 - 0x77b32000      C:\WINDOWS\system32\MSASN1.dll
    0x76c90000 - 0x76cb8000      C:\WINDOWS\system32\IMAGEHLP.dll
    0x72d20000 - 0x72d29000      C:\WINDOWS\system32\wdmaud.drv
    0x72d10000 - 0x72d18000      C:\WINDOWS\system32\msacm32.drv
    0x77bd0000 - 0x77bd7000      C:\WINDOWS\system32\midimap.dll
    0x73ee0000 - 0x73ee4000      C:\WINDOWS\system32\KsUser.dll
    VM Arguments:
    java_command: FrameLogin
    Launcher Type: SUN_STANDARD
    Environment Variables:
    CLASSPATH=.;.;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;
    PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
    USERNAME=Tung
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 1 (cores per cpu 1, threads per core 1) family 15 model 1 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 245280k(6040k free), swap 2279684k(1755548k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_13-b05) for windows-x86, built on Sep 25 2007 19:11:52 by "java_re" with MS VC++ 6.0
    ==============================================================================
    Is it a problem with jre or a problem with socket connection?
    Please help me! Thanks!

    rohitmadiwal, don't post on old threads. If you have a problem, post a new thread.
    The above error was caused by a bug in the JNI code inside of JMF. The best solution to such problems is to reboot your system, and if that doesn't work, reinstall JMF.
    If neither of those 2 things fix it, it cannot be fixed.

  • Very urgent!! Problems with the H.263 codec on JMStudio

    I downloaded the JMF Version 2.1.1e ' version.
    The H.263 codec doesn't work.
    I noticed that the file sound.jar wasn't in the lib directory of JMF-2.1.1e.
    Is for this reason I have problems with the H.263 codec??
    Thanks for your help.

    What do you try to broadcast? H263 is a video codec, not audio..

  • Problem with RTPExport output video files

    Hi, I have a problem with RTPExport output video files. One side streams H263/RTP(AVTransmit2.java) and other write this steam to a file by RTPExport.java. When network conditions are ideal, output video file has same fps and same number of frames like original file. Problem occures, when theres packet lost in network, then output file has different fps,and also has less frames like original video(because it didnt write missing frames to file, and thats why it get shorter). Pls how can I achieve output file that will have the same fps like original one? How to write to file an identical copy of what I can see while receiveing video with AVReceive2.java? Its there a way to modifi rtpexport or avreceiver to do this? Thanks a lot!

    Trubka wrote:
    When network conditions are ideal, output video file has same fps and same number of frames like original file. Problem occures, when theres packet lost in network, then output file has different fps,and also has less frames like original video(because it didnt write missing frames to file, and thats why it get shorter). Okay, first off, the second file is smaller on purpose. RTP intentionally drops packets that are old/out of order in order to make sure real-time video stays as close to real time as it can. This is by design, so there's really nothing that can be done about it.
    How to write to file an identical copy of what I can see while receiveing video with AVReceive2.java? Technically speaking, what you're getting in the RTPExport is exactly what you got on the receiving end. Any frames that are dropped during transmission will not be seen by the receiver, nor saved by the receiver.
    Pls how can I achieve output file that will have the same fps like original one? I'm not 100% sure that you can, but, you can give the following idea a try. I make no guarentees that it'll work, but it should work for you...
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/RTPConnector.html]
    That example is an example of a "custom transport layer" for RTP connections. Essentially, it's some code that's handed the RTP packets on the transmission end, and it's expected to deliver those RTP packets on the other end. And it doesn't care about how they get from A to B, only that they do.
    If you were to replace the UDP socket in that example with a TCP socket, you would be guarenteed not to drop packets due to network reasons. Every RTP packet you were handed by the transmitter, you would then hand to the receiver. There is no guarentee that none of the packets would be cast away as "old" by the RTP protocol itself, but there's also no guarentee any of them would be. It's a crap-shoot at best, but it's certainly worth a try.

  • Error thread java : problem with the function "resume 0x***"  (forum sun)

    One problem with the function of jdb occured when I tried to use it to
    pilot the processor with differents threads. In fact, I use a simple example with 2 threads.
    I stop the two threads with two breakpoint, and I want to resume one or the other (with the function "resume 0x****"), the one wich I resumed stop again on the breackpoint and I decide again to resume one or the other. All of that to obtain a tree of execution.
    I give you the code of the class and the code of jdb.
    CLASS: (it's just a object Room with a variable degre that I increment and decrement with two threads increase and decrease)
    public class Test{
         public static void main(String[] args){
              Room r = new Room();
              decrease de = new decrease(r);
              increase in = new increase(r);
              de.start();
              in.start();
    class Room {
         private volatile int degre=20;
         public void more(){
         degre += 4;
         public void less(){      
         degre -= 3;
    class decrease extends Thread{
    private Room room;
    public decrease(Room r){
              room =r;
    public void run(){
    try{ 
         while (!interrupted()){ 
              room.less();
    catch(InterruptedException e) {}
    class increase extends Thread{
    private Room room;
    public increase(Room r){
         room =r;
    public void run(){ 
         try{ 
              while (!interrupted()){
                   room.more();
    catch(InterruptedException e) {}
    JDB:
    Initializing jdb ...
    stop at Test:7Deferring breakpoint Test:7.
    It will be set after the class is loaded.
    runrun Test
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Test:7
    Breakpoint hit: "thread=main", Test.main(), line=7 bci=30
    7 in.start();
    main[1] stop at room:16
    Set breakpoint room:16
    main[1] stop at room:20
    Set breakpoint room:20
    main[1] resume
    All threads resumed.
    >
    Breakpoint hit: "thread=Thread-0", room.less(), line=20 bci=0
    20 degre -= 3;
    Thread-0[1] threads
    Group system:
    (java.lang.ref.Reference$ReferenceHandler)0x10d Reference Handler cond. waiting
    (java.lang.ref.Finalizer$FinalizerThread)0x10c Finalizer cond. waiting
    (java.lang.Thread)0x10b Signal Dispatcher running
    Group main:
    (decrease)0x146 Thread-0 running (at breakpoint)
    (increase)0x147 Thread-1 running (at breakpoint)
    (java.lang.Thread)0x148 DestroyJavaVM running
    Thread-0[1] resume 0x147
    Thread-0[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] print degre
    degre = 24
    Thread-1[1] resume 0x146 //It's here the problem, thread 0x146 have to stop on the //next breakpoint of decrease but nothing happen
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] clear
    Breakpoints set:
    breakpoint Test:7
    breakpoint room:16
    breakpoint room:20
    PS: I tried many other examples with other class and other kind of breakpoints, but, in any cases, on thread doesn't manage to resume. When I try with general resume (no specification of the thread), It works but it isn't interresting for me because I want to decide wich thread continue his execution.

    Hi,
    I have read the FAQ of the JMF.
    The problem was the jar files of the JMF were not in the JRE\BIN\EXT
    folder of the Java runtime!
    now it works!
    thanks
    Reg

  • JMF problems

    Hi!
    I am having a problem with JMF. I need to be able to use it when my app is an executable jar file. When I execute the Jar, JMF does not work. Is there any way to make JMF work with Jar files? Thanks for any help!

    I am having a problem with JMF. I need to be able to use it when my app is an executable jar file. When I execute the Jar, JMF does not work. Is there any way to make JMF work with Jar files? Thanks for any help!Can you be a little bit mor accurate ? Is there an excpetion ? Any Error Message ?
    What exactly is your programm trying to do ? Which JVM ? ...

  • FrameGrabbingControl - grab frame problem with video type

    Hi all
    I have a problem with extracting frames from a video.
    Currently I am able to extracting video from some avi formats. But this method does not works for many formats. like mpg etc...
    The FrameGrabbingControl object return null for many formats.
    This is my code
    public Player getVideoPlayer() throws Exception
            if (videoPlayer == null)
                File file = new File("E:\\Songs\\English\\Video\\Alizee\\20090209114235.avi");
                MediaLocator videoMediaLocator = new MediaLocator(file.toURL());
                videoPlayer = Manager.createRealizedPlayer(videoMediaLocator);
            return videoPlayer;
    public FrameGrabbingControl getFrameGrabCntrl() throws Exception
            if (frameGrabCntrl == null)
                frameGrabCntrl = (FrameGrabbingControl) getVideoPlayer().getControl("javax.media.control.FrameGrabbingControl");
            return frameGrabCntrl;
    // frame extract method
    public Image captureCurrent() throws Exception
            Buffer frame = getFrameGrabCntrl().grabFrame();
            BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
            return stopBuffer.createImage(frame);
        }Here are some 3 sample media information I have tested with the program. First two works fine but 3rd one does not works.
    // taken from http://www.exactfutures.com/index02.htm and downloaded http://www.exactfutures.com/vid2jpg.zip
    // WORKS FINE
       General
          Complete name : E:\Songs\English\Video\Alizee\testcam04.avi
          Format : AVI
          Format/Info : Audio Video Interleave
          Format/Family : RIFF
          File size : 1.88 MiB
          PlayTime : 29s 596ms
          Bit rate : 533 Kbps
       Video #0
          Codec : Indeo 4
          Codec/Info : Intel Indeo Video 5.0 Wavelet
          PlayTime : 29s 596ms
          Bit rate : 528 Kbps
          Width : 320 pixels
          Height : 240 pixels
          Aspect ratio : 4/3
          Frame rate : 3.818 fps
          Bits/(Pixel*Frame) : 1.801
    // recorded video from a webcam
    // WORKS FINE
       General
          Complete name : C:\Program Files\MSI\MyGuard Live\VideoClip\20090209114235.avi
          Format : AVI
          Format/Info : Audio Video Interleave
          Format/Family : RIFF
          File size : 311 KiB
          PlayTime : 3s 200ms
          Bit rate : 710 Kbps
       Video #0
          Codec : Indeo 4
          Codec/Info : Intel Indeo Video 5.0 Wavelet
          PlayTime : 3s 200ms
          Bit rate : 705 Kbps
          Width : 640 pixels
          Height : 480 pixels
          Aspect ratio : 4/3
          Frame rate : 15.000 fps
          Bits/(Pixel*Frame) : 0.153
    // downloaded avi sample video
    // NOT WORKS
       General
          Complete name : E:\Songs\English\Video\Alizee\fvss_demo.avi
          Format : AVI
          Format/Info : Audio Video Interleave
          Format/Family : RIFF
          File size : 10.3 MiB
          PlayTime : 2mn 300ms
          Bit rate : 715 Kbps
       Video #0
          Codec : MS Video
          Codec/Info : Microsoft Video 1
          PlayTime : 2mn 300ms
          Bit rate : 638 Kbps
          Width : 160 pixels
          Height : 120 pixels
          Aspect ratio : 4/3
          Frame rate : 10.000 fps
          Bits/(Pixel*Frame) : 3.325
       Audio #1
          Codec : PCM
          Codec/Family : PCM
          Codec/Info : Microsoft PCM
          PlayTime : 2mn 300ms
          Bit rate : 64 Kbps
          Channel(s) : 1 channel
          Sampling rate : 8000 Hz
          Resolution : 8 bitsI think problem is the codec. Am I correct?
    Could anyone please tell me why can't I use this FrameGrabbingControl object to extract frames?

    deshan wrote:
    Currently I am able to extracting video from some avi formats. But this method does not works for many formats. like mpg etc...
    The FrameGrabbingControl object return null for many formats.That's expected behavior when the codec doesn't support capture...
    Could anyone please tell me why can't I use this FrameGrabbingControl object to extract frames?Because it's not supported for that format.
    But T.B.M. and I have recently worked on / posted a workaround that should capture any video format that JMF can play.
    [http://forums.sun.com/thread.jspa?messageID=10596692#10596692]

  • 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