Buggy code:
@ Controller @ RequestMapping ( "//invest" ) public class InvestController { @ Autowired private LoanService loanService ; @ Autowired private ProductService productService ; @ Autowired private InvestService investService ; @ Autowired private InvestProfitService investProfitService ; @ Autowired private UserInfoService userInfoService ; @ Autowired private PropertiesService propertiesService ; @ Autowired private RepayService repayService ; @ Autowired private DictionaryService dictionaryService ; @ Autowired private LabelService labelService ; private static final String CACHE_LOAN_DEADLINE_PREFIX = "com.jlfex.hermes.cache.loan.deadline." ; private static final String INVEST_BID_MULTIPLE = "invest.bid.multiple" ; @ RequestMapping ( "checkMoneyMore" ) @ ResponseBody public JSONObject checkMoneyMore ( BigDecimal investamount , String loanid ) { } @ RequestMapping ( "checkMoneyLess" ) @ ResponseBody public JSONObject checkMoneyLess ( BigDecimal investamount ) { } @ RequestMapping ( "//display" ) public String display ( Model model ) { } @ RequestMapping ( "//index" ) public String index ( Model model ) { } @ RequestMapping ( "//bid" ) @ ResponseBody public Result bid ( String loanid , String investamount , String otherrepayselect ) { } @ RequestMapping ( "//bidsuccess" ) public String bidsuccess ( String investamount , String loanid , Model model ) { } @ RequestMapping ( "//bidfull" ) public String bidfull ( Model model ) { } @ RequestMapping ( "//calmaturegain" ) @ ResponseBody public BigDecimal calmaturegain ( HttpServletRequest request ) { } @ RequestMapping ( "//indexsearch" ) public String indexsearch ( String purpose , String raterange , String periodrange , String repayname , String page , String size , String orderByField , String orderByDirection , Model model ) { } private String getUTFFormat ( String src ) { } @ RequestMapping ( "//info" ) public String info ( Model model , String loanid ) { App . checkUser ( ) ; Logger . info ( ( "loanid:" + loanid ) ) ; Loan loan = loanService . loadById ( loanid ) ; model . addAttribute ( "loan" , loan ) ; Dictionary dictionary = dictionaryService . loadById ( loan . getPurpose ( ) ) ; model . addAttribute ( "purpose" , dictionary . getName ( ) ) ; model . addAttribute ( "product" , loan . getProduct ( ) ) ; model . addAttribute ( "repay" , loan . getProduct ( ) . getRepay ( ) ) ; model . addAttribute ( "user" , loan . getUser ( ) ) ; if ( ( Caches . get ( ( ( InvestController . CACHE_LOAN_DEADLINE_PREFIX ) + loanid ) ) ) == null ) { LoanLog loanLogStartInvest = loanService . loadLogByLoanIdAndType ( loanid , START_INVEST ) ; if ( ( loanLogStartInvest != null ) && ( ( loanLogStartInvest . getDatetime ( ) ) != null ) ) { String duration = ( String . valueOf ( loan . getDeadline ( ) ) ) + "d" ; Date datetimeloanLogStartInvest = loanLogStartInvest . getDatetime ( ) ; Date deadline = Calendars . add ( datetimeloanLogStartInvest , duration ) ; Caches . set ( ( ( InvestController . CACHE_LOAN_DEADLINE_PREFIX ) + loanid ) , deadline , "7d" ) ; } } if ( ( Caches . get ( ( ( InvestController . CACHE_LOAN_DEADLINE_PREFIX ) + loanid ) ) ) != null ) { Date deadline = Caches . get ( ( ( InvestController . CACHE_LOAN_DEADLINE_PREFIX ) + loanid ) , Date . class ) ; Date start = new Date ( ) ; long endTime = deadline . getTime ( ) ; long startTime = start . getTime ( ) ; if ( ( endTime - startTime ) > 0 ) { model . addAttribute ( "remaintime" , String . valueOf ( ( endTime - startTime ) ) ) ; } else { model . addAttribute ( "remaintime" , 0 ) ; } } else { model . addAttribute ( "remaintime" , 0 ) ; } <START_BUG> LoanUserInfo loanUserInfo = loanService . loadLoanUserInfoByUserId ( loan . getUser ( ) . getId ( ) ) ; <END_BUG> model . addAttribute ( "loanUserInfo" , loanUserInfo ) ; List < Invest > investList = investService . findByLoan ( loan ) ; model . addAttribute ( "invests" , investList ) ; List < LoanAuth > loanAuthlist = loanService . findLoanAuthByLoan ( loan ) ; model . addAttribute ( "loanauths" , loanAuthlist ) ; model . addAttribute ( "nav" , "invest" ) ; String investBidMultiple = App . config ( InvestController . INVEST_BID_MULTIPLE ) ; model . addAttribute ( "investBidMultiple" , investBidMultiple ) ; return "invest//info" ; } @ RequestMapping ( "//myinvest" ) public String myinvest ( Model model ) { } @ RequestMapping ( "//myinvestinfo//{invest}" ) public String myinvestinfo ( @ PathVariable ( "invest" ) String investid , HttpServletRequest request , Model model ) { } }

Fix:
LoanUserInfo loanUserInfo = loanService . loadLoanUserInfoByUserId ( App . user ( ) . getId ( ) ) ;