Explorar o código

【启动提示bean无法创建,因依赖注入导致bean创建失败。一般因为嵌套导致,找到引用的bean 设置@Lazy (延迟注入)即可】

wub hai 1 ano
pai
achega
55ae6a507c

+ 2 - 0
src/com/uas/erp/controller/oa/SendMailController.java

@@ -5,6 +5,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -17,6 +18,7 @@ import com.uas.erp.service.oa.SendMailService;
 @Controller
 public class SendMailController {
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private EmployeeMailService employeeMailService;

+ 2 - 0
src/com/uas/erp/dao/common/impl/PurchaseChangeNewDaoImpl.java

@@ -9,6 +9,7 @@ import com.uas.erp.dao.common.PurchaseChangeNewDao;
 import com.uas.erp.model.Employee;
 import com.uas.erp.service.oa.SendMailService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -19,6 +20,7 @@ import java.util.List;
 public class PurchaseChangeNewDaoImpl extends BaseDao implements PurchaseChangeNewDao {
 
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	static final String TURNPURC = "SELECT * FROM purchasechange WHERE pc_id=?";

+ 2 - 0
src/com/uas/erp/service/common/impl/DocDistributionServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -38,6 +39,7 @@ public class DocDistributionServiceImpl implements DocDistributionService {
 	@Autowired
 	private HandlerService handlerService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private DocumentListService documentListService;

+ 2 - 0
src/com/uas/erp/service/common/impl/ForgetPwdServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -37,6 +38,7 @@ public class ForgetPwdServiceImpl implements ForgetPwdService {
 	@Autowired
 	private EmployeeService employeeService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private EmployeeDao employeeDao;

+ 2 - 0
src/com/uas/erp/service/ma/impl/EncryptServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -31,6 +32,7 @@ public class EncryptServiceImpl implements EncryptService {
 	@Autowired
 	private EmployeeService employeeService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	
 	/**

+ 2 - 0
src/com/uas/erp/service/oa/impl/BatchMailServiceImpl.java

@@ -7,6 +7,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import com.uas.erp.core.BaseUtil;
@@ -22,6 +23,7 @@ public class BatchMailServiceImpl implements BatchMailService {
 	@Autowired
 	private BaseDao baseDao;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	
 	/*public List<CheckTree> getHrOrgTree(String language) {

+ 2 - 0
src/com/uas/erp/service/pm/impl/MakeBaseServiceImpl.java

@@ -21,6 +21,7 @@ import com.uas.erp.service.pm.MakeBaseService;
 import com.uas.erp.service.scm.ApplicationService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -46,6 +47,7 @@ public class MakeBaseServiceImpl implements MakeBaseService {
 	@Autowired
 	private DetailGridDao detailGridDao;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	@Override

+ 2 - 0
src/com/uas/erp/service/pm/impl/MakeChangeServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.Map;
 
 import com.uas.erp.service.oa.SendMailService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
@@ -30,6 +31,7 @@ public class MakeChangeServiceImpl implements MakeChangeService{
 	@Autowired
 	private HandlerService handlerService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Override
 	public void saveMakeChange(String caller,String formStore, String gridStore) {

+ 2 - 0
src/com/uas/erp/service/scm/impl/BatchDealServiceImpl.java

@@ -16,6 +16,7 @@ import java.util.regex.Pattern;
 import net.sf.json.JSONObject;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
@@ -115,6 +116,7 @@ public class BatchDealServiceImpl implements BatchDealService {
 	@Autowired
 	private EnterpriseService enterpriseService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private SendNotifyService sendNotifyService;

+ 2 - 0
src/com/uas/erp/service/scm/impl/CustomerBaseServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.Map;
 
 import org.drools.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,6 +41,7 @@ public class CustomerBaseServiceImpl implements CustomerBaseService {
 	@Autowired
 	private EnterpriseService enterpriseService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	@Transactional

+ 2 - 0
src/com/uas/erp/service/scm/impl/PurchaseChangeNewServiceImpl.java

@@ -13,6 +13,7 @@ import com.uas.erp.service.oa.SendMailService;
 import com.uas.erp.service.scm.PurchaseChangeNewService;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
@@ -31,6 +32,7 @@ public class PurchaseChangeNewServiceImpl implements PurchaseChangeNewService {
 	@Autowired
 	private HandlerService handlerService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	@Override

+ 2 - 0
src/com/uas/erp/service/scm/impl/PurchaseChangeServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.*;
 
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import com.uas.erp.core.BaseUtil;
@@ -32,6 +33,7 @@ public class PurchaseChangeServiceImpl implements PurchaseChangeService {
 	@Autowired
 	private HandlerService handlerService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	@Override

+ 2 - 0
src/com/uas/erp/service/scm/impl/PurchaseServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.Map;
 import net.sf.json.JSONObject;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.http.HttpStatus;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
@@ -73,6 +74,7 @@ public class PurchaseServiceImpl implements PurchaseService {
 	@Autowired
 	private TransferRepository transferRepository;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private GetGoodsReserveService getGoodsReserveService;

+ 2 - 0
src/com/uas/erp/service/scm/impl/ScmHandler.java

@@ -26,6 +26,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.drools.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -111,6 +112,7 @@ public class ScmHandler {
 	@Autowired
 	private ProductKindService productKindService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	@Autowired
 	private ReturnApplyDao returnApplyDao;

+ 2 - 0
src/com/uas/erp/service/scm/impl/TenderServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.Set;
 import net.sf.json.JSONObject;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 
@@ -56,6 +57,7 @@ public class TenderServiceImpl implements TenderService{
 	private B2BAttachsService B2BAttachsService;
 	
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 	
 	@Autowired

+ 2 - 0
src/com/uas/erp/service/scm/impl/VendorServiceImpl.java

@@ -17,6 +17,7 @@ import com.uas.erp.service.oa.SendMailService;
 import com.uas.erp.service.scm.VendorService;
 import org.drools.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 
@@ -37,6 +38,7 @@ public class VendorServiceImpl implements VendorService {
 	@Autowired
 	private EnterpriseService enterpriseService;
 	@Autowired
+	@Lazy
 	private SendMailService sendMailService;
 
 	@Override