关于J2EE开发中遇到的一个问题(急!!!!)
MVC环境介绍:
Linux下安装: j2sdk,tomcat,Hiberate;
Windows 下浏览.
运行Execution Server(自己开发的)时,发现localhost报告错误如下:
2005-11-1 11:29:11 xx.util.LogManager error
警告: Job Execution Server Error: Unknown host: localhost; nested exception is:
java.net.UnknownHostException: localhost
sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:565)
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
java.rmi.Naming.rebind(Naming.java:160)
xx.execution.server.JobExecutionServerImpl.main(JobExecutionServerImpl.java:198)
源程序如下:
public static void main(String[] args) {
RMISecurityManager sm = new RMISecurityManager();
System.setSecurityManager(sm);
try {
// Get Properties from property file
Properties props = Properties.getInstance();
int port = props.getIntProperty("ats.execution.port", 3000);
// Export the registry from the same JVM
LocateRegistry.createRegistry(port);
// Construct an instance of Job Execution Server
JobExecutionServerImpl exeServer = new
JobExecutionServerImpl(Constants.JOB_EXECUTION_SERVER);
// Bind the instance to the server
Naming.rebind("//localhost:" + port + "/" +
Constants.JOB_EXECUTION_SERVER, exeServer);
// Write information to log file
LogManager.info("Job Execution Server is bound in RMI Registry.");
// Reload running suite to job-suite queue
exeServer.setup();
} catch (Exception e) {
LogManager.error("Job Execution Server Error: " + e.getMessage(),
e.getStackTrace());
请问:1)该如何解决?Tomcat服务器已正常启动.报错显示位于: Naming.rebind,该如何解决?
2)如何在Windows下通过Eclipse实时调试?如何配置?
急!!!!!!