修复没有tomcat.json时报错的bug

This commit is contained in:
F7575 2019-05-30 02:41:47 +08:00
parent d236987acb
commit 80f7d0e9bc
3 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@ public class LinuxTomcatCommander extends AbstractTomcatCommander {
"-Dcatalina.base=\"%s\" " +
"-Dcatalina.home=\"%s\" " +
"-Djava.io.tmpdir=\"%stemp/\" " +
"org.apache.catalina.startup.Bootstrap %s &", tomcatInfoModel.getPath(), tomcatInfoModel.getPath(),
"org.apache.catalina.startup.Bootstrap %s", tomcatInfoModel.getPath(), tomcatInfoModel.getPath(),
tomcatInfoModel.getPath(), tomcatInfoModel.getPath(), tomcatInfoModel.getPath(),
tomcatInfoModel.getPath(), tomcatInfoModel.getPath(), cmd);
try {

View File

@ -103,7 +103,7 @@ public class TomcatManageController extends BaseAgentController {
if (tomcatInfoModelTemp == null) {
if (StrUtil.isEmpty(tomcatInfoModel.getAppBase())) {
tomcatInfoModel.setAppBase(FileUtil.normalize(tomcatInfoModel.getPath()).concat("webapps"));
tomcatInfoModel.setAppBase(FileUtil.normalize(tomcatInfoModel.getPath()).concat(File.separator).concat("webapps"));
} else {
String path = FileUtil.normalize(tomcatInfoModel.getAppBase());
if (FileUtil.isAbsolutePath(path)) {
@ -184,7 +184,7 @@ public class TomcatManageController extends BaseAgentController {
if (tomcatInfoModelTemp == null || tomcatInfoModelTemp.getId().equals(tomcatInfoModel.getId())) {
if (StrUtil.isEmpty(tomcatInfoModel.getAppBase())) {
tomcatInfoModel.setAppBase(FileUtil.normalize(tomcatInfoModel.getPath()).concat("webapps"));
tomcatInfoModel.setAppBase(FileUtil.normalize(tomcatInfoModel.getPath()).concat(File.separator).concat("webapps"));
} else {
String path = FileUtil.normalize(tomcatInfoModel.getAppBase());
if (FileUtil.isAbsolutePath(path)) {

View File

@ -44,6 +44,10 @@ public class TomcatManageService extends BaseOperService<TomcatInfoModel> {
public TomcatInfoModel getItemByName(String name) {
JSONObject allTomcat = getJSONObject(AgentConfigBean.TOMCAT);
if (allTomcat == null) {
return null;
}
JSONObject tomcat = null;
for (String key : allTomcat.keySet()) {
JSONObject object = allTomcat.getJSONObject(key);