BundleException: Timed Out

I use OSGi and I create bundle called Server, which contains three classes and one of them is the bundle activator. I will publich the code of the three classes and then will write my problem. So the first class is calles "ServerThread" :

public class ServerThread extends Thread implements Constants {

private Socket socket;

private DataInputStream serverDataIn;

private DataOutputStream serverDataOut;

private int intCommand;

private HashMap statusHash;

public ServerThread(Socket socket) {

this.socket = socket;

}

public void run() {

try {

serverDataOut = new DataOutputStream(socket.getOutputStream());

serverDataIn = new DataInputStream(socket.getInputStream());

} catch (Exception ioe) {

ioe.printStackTrace();

}

try {

intCommand = serverDataIn.readInt();

} catch (IOException ioe) {

ioe.printStackTrace();

}

if (intCommand == LOGIN) {

String name = "";

String pass = "";

try {

name = serverDataIn.readUTF();

pass = serverDataIn.readUTF();

} catch (IOException e) {

e.printStackTrace();

}

if (!name.equals("") & !pass.equals("")) {

statusHash.put(name, ONLINE);

System.out.println("The user" + name + "is added in the statusHash");

try {

serverDataOut.writeInt(LOGIN);

serverDataOut.writeBoolean(true);

} catch (IOException e) {

e.printStackTrace();

}

}

}

if (intCommand == SEND_MESSAGE) {

String receiver = "";

String message = "";

try {

receiver = serverDataIn.readUTF();

message = serverDataIn.readUTF();

} catch (IOException e) {

e.printStackTrace();

}

if (!receiver.equals("") & !message.equals("")

& Integer.parseInt(statusHash.get(receiver).toString()) == ONLINE) {

System.out.println("Send message successful");

try {

serverDataOut.writeInt(SEND_MESSAGE);

serverDataOut.writeBoolean(true);

} catch (IOException e) {

e.printStackTrace();

}

}

}

}

}

===========================================================

The second class is :

public class OpenSocket extends Thread {

private static final int port = 8081;

private ServerSocket serverSocket;

private Socket socketServ;

private ServerThread serverThread = new ServerThread(socketServ);

public void run() {

try {

serverSocket = new ServerSocket(port);

System.out.println("Server port : " + port);

System.out.println("serverSocket : " + serverSocket);

} catch (IOException ioe) {

ioe.printStackTrace();

}

while (true) {

try {

socketServ = serverSocket.accept();

} catch (IOException e) {

e.printStackTrace();

}

serverThread.start();

}

}

}

===========================================================

And the Activator class is :

public class ServerActivator implements BundleActivator {

OpenSocket openSocket = new OpenSocket();

public void start(BundleContext arg0) throws Exception {

// TODO Auto-generated method stub

System.out.println("ServerActivator.start()");

openSocket.start();

}

public void stop(BundleContext arg0) throws Exception {

// TODO Auto-generated method stub

openSocket.stop();

}

}

===========================================================

So my problem is that when I install the bundle and start it, is thrown BundleException: Timed Out. Can someone tell me why this happens ?

[3733 byte] By [JTTa] at [2007-11-27 11:23:29]
# 1

I`ve decided my problem

JTTa at 2007-7-29 15:00:59 > top of Java-index,Core,Core APIs...
# 2

fixed the compiler errors?

ejpa at 2007-7-29 15:00:59 > top of Java-index,Core,Core APIs...
# 3

Yes I fixed the problem. It was in my code

JTTa at 2007-7-29 15:00:59 > top of Java-index,Core,Core APIs...
# 4

I know. What I can't understand is how that code threw a BundleException when it doesn't even compile.

ejpa at 2007-7-29 15:00:59 > top of Java-index,Core,Core APIs...
# 5

It compiles. I didn`t post all the information about my problem. However everyhting is OK now

JTTa at 2007-7-29 15:00:59 > top of Java-index,Core,Core APIs...