service start exception modify (#787)
* service start exception modify * master,worker start modify * .env update
This commit is contained in:
parent
a6e2d1eb82
commit
0877e35efa
|
|
@ -48,10 +48,10 @@ public class DaoFactory {
|
|||
synchronized (daoMap) {
|
||||
if (!daoMap.containsKey(className)) {
|
||||
try {
|
||||
T t = BeanContext.getBean(clazz);
|
||||
// T t = clazz.getConstructor().newInstance();
|
||||
// // 实例初始化
|
||||
// t.init();
|
||||
// T t = BeanContext.getBean(clazz);
|
||||
T t = clazz.getConstructor().newInstance();
|
||||
// 实例初始化
|
||||
t.init();
|
||||
daoMap.put(className, t);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import org.quartz.SchedulerException;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
|
@ -90,10 +91,9 @@ public class MasterServer extends AbstractServer {
|
|||
* master server not use web service
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SpringApplicationBuilder app = new SpringApplicationBuilder(MasterServer.class);
|
||||
SpringApplication app = new SpringApplication(MasterServer.class);
|
||||
|
||||
app.web(WebApplicationType.NONE)
|
||||
.run(args);
|
||||
app.run(args);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import org.apache.commons.lang.StringUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
|
@ -121,10 +122,9 @@ public class WorkerServer extends AbstractServer {
|
|||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplicationBuilder app = new SpringApplicationBuilder(WorkerServer.class);
|
||||
SpringApplication app = new SpringApplication(WorkerServer.class);
|
||||
|
||||
app.web(WebApplicationType.NONE)
|
||||
.run(args);
|
||||
app.run(args);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,4 @@
|
|||
logging.config=classpath:master_logback.xml
|
||||
|
||||
# server port
|
||||
server.port=5566
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
logging.config=classpath:master_logback.xml
|
||||
|
||||
# server port
|
||||
server.port=7788
|
||||
|
|
@ -47,7 +47,7 @@ elif [ "$command" = "master-server" ]; then
|
|||
LOG_FILE="-Dspring.config.location=conf/application_master.properties -Ddruid.mysql.usePingMethod=false"
|
||||
CLASS=cn.escheduler.server.master.MasterServer
|
||||
elif [ "$command" = "worker-server" ]; then
|
||||
LOG_FILE="-Dlogback.configurationFile=conf/worker_logback.xml -Ddruid.mysql.usePingMethod=false"
|
||||
LOG_FILE="-Dspring.config.location=conf/application_worker.properties -Ddruid.mysql.usePingMethod=false"
|
||||
CLASS=cn.escheduler.server.worker.WorkerServer
|
||||
elif [ "$command" = "alert-server" ]; then
|
||||
LOG_FILE="-Dlogback.configurationFile=conf/alert_logback.xml"
|
||||
|
|
|
|||
Loading…
Reference in New Issue