Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1、修复tomcat启动不加载配置文件的问题 #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ImportResource;

/**
* Created by zhangyijun on 15/10/26.
*/
@SpringBootApplication
@ImportResource("classpath:spring/spring.xml")
public class ApplicationStarter {
public class ApplicationStarter extends SpringBootServletInitializer {

public static void main(String[] args) {
SpringApplication app = new SpringApplication(ApplicationStarter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Map;
import java.util.Set;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

Expand Down Expand Up @@ -47,14 +48,19 @@
public class BaseController {
protected final Logger logger = LoggerFactory.getLogger(getClass());

@Resource
protected UserService userService;


@Resource
protected AppService appService;


@Resource
protected MachineCenter machineCenter;


@Resource
protected UserLoginStatusService userLoginStatusService;


@Resource
protected RedisCenter redisCenter;

public void setUserService(UserService userService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@
import com.sohu.cache.util.TypeUtil;
import com.sohu.cache.web.enums.SuccessEnum;
import com.sohu.cache.web.service.AppService;

import org.springframework.util.Assert;

import java.util.*;

import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import redis.clients.jedis.HostAndPort;

import java.util.*;

/**
* 应用操作实现类
*
* @author leifu
* @Time 2014年10月21日
*/
@Service
public class AppServiceImpl implements AppService {

private Logger logger = LoggerFactory.getLogger(AppServiceImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
import com.sohu.cache.util.ConstUtils;
import com.sohu.cache.web.enums.SuccessEnum;
import com.sohu.cache.web.service.ConfigService;
import org.springframework.stereotype.Service;

/**
* @author leifu
* @Date 2016年5月23日
* @Time 上午10:35:26
*/
@Service
public class ConfigServiceImpl implements ConfigService {

private Logger logger = LoggerFactory.getLogger(ConfigServiceImpl.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package com.sohu.cache.web.service.impl;

import java.util.List;

import com.sohu.cache.dao.MemFaultDao;
import com.sohu.cache.entity.InstanceFault;
import com.sohu.cache.web.service.MemFaultService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 故障服务
* @author leifu
* @Date 2015-6-6
* @Time 下午10:03:59
*/
@Service
public class MemFaultServiceImpl implements MemFaultService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import com.sohu.cache.entity.ServerStatus;
import com.sohu.cache.server.data.Server;
import com.sohu.cache.web.service.ServerDataService;
import org.springframework.stereotype.Service;

@Service
public class ServerDataServiceImpl implements ServerDataService {
private static final Logger logger = LoggerFactory.getLogger(ServerDataServiceImpl.class);
//持久化接口
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

import com.sohu.cache.util.ConstUtils;
import com.sohu.cache.web.service.UserLoginStatusService;
import org.springframework.stereotype.Service;

/**
* cookie保护登录状态
* @author leifu
* @Date 2016年6月15日
* @Time 下午1:31:17
*/
@Service
public class UserLoginStatusCookieServiceImpl implements UserLoginStatusService {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.apache.commons.lang.math.NumberUtils;

import com.sohu.cache.web.service.UserLoginStatusService;
import org.springframework.stereotype.Service;


/**
Expand All @@ -15,6 +16,7 @@
* @Date 2016年6月15日
* @Time 下午1:31:05
*/
@Service
public class UserLoginStatusSessionServiceImpl implements UserLoginStatusService {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import com.sohu.cache.entity.AppUser;
import com.sohu.cache.web.enums.SuccessEnum;
import com.sohu.cache.web.service.UserService;
import org.springframework.stereotype.Service;

/**
* 用户管理实现
* @author leifu
* @Date 2014年10月27日
* @Time 上午9:57:43
*/
@Service
public class UserServiceImpl implements UserService {
private Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

Expand Down
6 changes: 3 additions & 3 deletions cachecloud-open-web/src/main/swap/local.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cachecloud.db.url = jdbc:mysql://127.0.0.1:3306/cache-cloud
cachecloud.db.user = cachecloud
cachecloud.db.password =
cachecloud.db.url = jdbc:mysql://127.0.0.1:3306/cache_cloud
cachecloud.db.user = root
cachecloud.db.password = 123456
cachecloud.maxPoolSize = 20

isClustered = true
Expand Down
6 changes: 3 additions & 3 deletions cachecloud-open-web/src/main/swap/online.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cachecloud.db.url = jdbc:mysql://127.0.0.1:3306/cache-cloud
cachecloud.db.user = cachecloud
cachecloud.db.password =
cachecloud.db.url = jdbc:mysql://127.0.0.1:3306/cache_cloud
cachecloud.db.user = root
cachecloud.db.password = 123456
cachecloud.maxPoolSize = 20

isClustered = true
Expand Down