User: starksm
Date: 01/04/23 00:13:10
Modified: src/main/org/jnp/server Main.java
Log:
Disable the log4j until this has been tested with JBoss as it appears
to interact badly with the default logging
Revision Changes Path
1.4 +19 -15 jnp/src/main/org/jnp/server/Main.java
Index: Main.java
===================================================================
RCS file: /cvsroot/jboss/jnp/src/main/org/jnp/server/Main.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Main.java 2001/04/23 06:08:06 1.3
+++ Main.java 2001/04/23 07:13:10 1.4
@@ -33,7 +33,7 @@
@author $Author: starksm $
@author [EMAIL PROTECTED]
-@version $Revision: 1.3 $
+@version $Revision: 1.4 $
*/
public class Main
implements Runnable, MainMBean
@@ -70,7 +70,7 @@
// Set configuration
setPort(Integer.getInteger("jnp.port",getPort()).intValue());
- log = Category.getInstance("org.jnp.Naming");
+ // log = Category.getInstance("org.jnp.Naming");
}
// Public --------------------------------------------------------
@@ -83,14 +83,14 @@
public void start()
throws Exception
{
- // Make sure the config file can be found
+ /* Make sure the config file can be found
ClassLoader loader = Thread.currentThread().getContextClassLoader();
URL url = loader.getResource("log4j.properties");
if( url == null )
throw new FileNotFoundException("Failed to find log4j.properties");
PropertyConfigurator.configure(url);
log.info("Starting jnp server");
-
+*/
// Create remote object
theServer = new NamingServer();
@@ -105,19 +105,20 @@
{
serverSocket = null;
serverSocket = new ServerSocket(getPort());
- log.info("Started on port " + getPort());
+ // log.info("Started on port " + getPort());
listen();
} catch (IOException e)
{
- log.error("Could not start on port " + getPort(), e);
+ // log.error("Could not start on port " + getPort(), e);
+ e.printStackTrace();
}
}
-
+
public void stop()
{
try
{
- log.info("Stopping");
+ // log.info("Stopping");
// Unexport server
UnicastRemoteObject.unexportObject(theServer, false);
@@ -126,10 +127,11 @@
ServerSocket s = serverSocket;
serverSocket = null;
s.close();
- log.info("Stopped");
+ // log.info("Stopped");
} catch (Exception e)
{
- log.error("Exception during shutdown", e);
+ // log.error("Exception during shutdown", e);
+ e.printStackTrace();
}
}
@@ -145,14 +147,15 @@
} catch (IOException e)
{
if (serverSocket == null) return; // Stopped by normal means
- log.error("Naming stopped", e);
- log.info("Restarting naming");
+ // log.error("Naming stopped", e);
+ // log.info("Restarting naming");
try
{
start();
} catch (Exception ex)
{
- log.error("Restart failed", ex);
+ // log.error("Restart failed", ex);
+ ex.printStackTrace();
return;
}
}
@@ -168,7 +171,8 @@
}
catch (IOException ex)
{
- log.error("Error writing response", ex);
+ // log.error("Error writing response", ex);
+ ex.printStackTrace();
}
finally
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development