日期:2014-05-17  浏览次数:20993 次

Quartz RMI
有人用过Quartz RMI 嘛,为什么我设置的远程调用服务端可以注册RMI服务成功,但是我在客户端调用的时候老师出现连接拒绝,求大侠解决,我的服务端和客户端的properties配置如下
Server.properties
Java code

org.quartz.scheduler.instanceName = EximBills Enterprise Schedule Service
org.quartz.scheduler.rmi.export = true
org.quartz.scheduler.rmi.registryHost = 127.0.0.1
org.quartz.scheduler.rmi.registryPort = 1099
org.quartz.scheduler.rmi.serverPort = 0
org.quartz.scheduler.rmi.createRegistry = true
org.quartz.scheduler.rmi.proxy = false
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore


Client.properties
Java code

org.quartz.scheduler.instanceName = EximBills Enterprise Schedule Service
org.quartz.scheduler.rmi.registryHost = 127.0.0.1
org.quartz.scheduler.rmi.registryPort = 1099
org.quartz.scheduler.rmi.proxy = true
org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
org.quartz.scheduler.rmi.export = false


出错信息:
Java code

Exception in thread "main" org.quartz.SchedulerException: Could not get handle to remote scheduler: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection refused: connect [See nested exception: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection refused: connect]
    at org.quartz.impl.RemoteScheduler.getRemoteScheduler(RemoteScheduler.java:123)
    at org.quartz.impl.RemoteScheduler.getSchedulerName(RemoteScheduler.java:149)
    at org.quartz.impl.SchedulerRepository.bind(SchedulerRepository.java:82)
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:629)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)
    at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1371)
    at QuartzRMIClient.run(QuartzRMIClient.java:21)
    at QuartzRMIClient.main(QuartzRMIClient.java:34)
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnecti