Has anyone given any consideration to this question?

I've since tried configuring using PropertyConfigurator on a properties file in the 
jar but it too raises a NullPointerException in the configure method.  Runs fine in 
appletviewer, but not in a web browser (IE or NS).  I even tried creating a simple, 
hardcoded configuration by creating a new Properties object and using setProperty 
calls.  It too resulted in a NullPointerException.

I've burned quite a bit of time trying to find the cause of this.  My next step is to 
invoke the commandline debugger in the Java Console and step through the code.

Please, does anyone have ideas of what is wrong here.

Regards,
Michael Rhodes


-----Original Message-----
From: Rhodes, Michael [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 7:52 AM
To: '[EMAIL PROTECTED]'
Subject: Applet logging to remote SocketServer


I'm having difficulty getting an applet to log to a remote socket server.  My 
configuration is failing.  It appears that a socket connection *does* get opened to 
the server.  Any advice on this?  Included below is:

Netscape Java Console output
SimpleSocketServer output
Applet source
HTML source

The output shown was collected after pressing the HTML button 8 times.

TIA.

Michael E. Rhodes 
Diebold, Incorporated

Netscape Java Console output ==========================================
Netscape Communications Corporation -- Java 1.1.5 
Type '?' for options. 
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
log4j: Could not read system property "log4j.configDebug". 
java.lang.NullPointerException
   at org.apache.log4j.BasicConfigurator.configure(Compiled Code)
   at com.diebold.util.Log.initLogging(Compiled Code)
   at com.diebold.util.Log.init(Compiled Code)
 * at netscape.applet.DerivedAppletFrame$InitAppletEvent.dispatch(Compiled Code)
   at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
   at java.awt.EventDispatchThread.run(Compiled Code)
   at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code) 
message = "HI" 
log4j:ERROR No appenders could be found for category (com.diebold.util.Log). 
log4j:ERROR Please initialize the log4j system properly. 
message = "HI"
message = "HI" 
message = "HI" 
message = "HI" 
message = "HI" 
message = "HI" 
message = "HI" 


SimpleSocketServer output =============================================
22:36:51 INFO  [main] impleSocketServer               - Listening on port 9009
22:36:51 INFO  [main] impleSocketServer               - Waiting to accept a new client.
22:38:39 INFO  [main] impleSocketServer               - Connected to client at 
localhost/127.0.0.1
22:38:39 INFO  [main] impleSocketServer               - Starting new socket node.
22:38:39 INFO  [main] impleSocketServer               - Waiting to accept a new client.
22:41:22 INFO  [Thread-0] net.SocketNode                  - Caught 
java.io.EOFException closing conneciton.


Applet source =========================================================
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import org.apache.log4j.*;
import org.apache.log4j.net.*;

public class Log extends Applet {

public void info(String message) {
        System.out.println("message = \"" + message + "\"");
        Category cat = Category.getInstance(Log.class.getName());
        cat.info(message);
}

public void init() {
        String host = getParameter("HOST");
        int port = Integer.decode(getParameter("PORT")).intValue();
        initLogging(host,port);
}

public void initLogging(String host, int port) {
        BasicConfigurator.configure(new SocketAppender(host,port));
}

public void paint(Graphics g) {
        super.paint(g);
}
}


HTML source ===========================================================
<HTML>
<HEAD>
  <TITLE>Log</TITLE>
</HEAD>
<BODY> 
<script>
  function doLog() {
    document.logger.info("HI");
  }
</script>
<H1>Log</H1>
<APPLET MAYSCRIPT CODE=com.diebold.util.Log.class ARCHIVE=Log.jar NAME="logger" 
WIDTH=150 HEIGHT=25>
  <param name=HOST value="localhost">
  <param name=PORT value=9009>
</APPLET>
<form name=form1>
  <input onclick="Javascript:doLog()" type="button"  value="doLog">
</form>
</BODY>
</HTML>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to