Skip to content

Parameter names not detected in case @AliasFor'ed attributes are used #617

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

Closed
caoyuanqi opened this issue Aug 17, 2017 · 11 comments
Closed
Milestone

Comments

@caoyuanqi
Copy link

the code like below,

@RequestMapping(value = "/account/{accountName}",method =RequestMethod.GET)
    public AccountResource getAccountInfo(@P("u") @PathVariable String accountName) {
        AccountResource resource = new AccountResource();
        Account account = accountService.getAccountInfo(accountName);
        resource.setAccountName(account.getAccountName());
        resource.setType(account.getType());
        String investorId = account.getInvestor().getId();
        log.info("investor id is " + investorId);
        Link selfLink = linkTo(methodOn(AccountController.class)
                .getAccountInfo(accountName)).withSelfRel();
        Link investorLink = linkTo(methodOn(InvestorController.class).getInverstor(investorId)).withRel("investor");
       // Link investorLink = new Link(baseUrl + serviceUrl
        //        + "/investor/" + investorId).withRel("investor");
        resource.add(selfLink);
        resource.add(investorLink);
        if (accountService.getInvestmentProfile(accountName) != null){
            Link investmentProfileLink = new Link(baseUrl + serviceUrl
                    + "/" + accountName + "/profile").withRel("mandate");
            resource.add(investmentProfileLink);
        }
        return resource;
    } 

Return Json is

{
  "type": "investor",
  "accountName": "cc1502762479261",
  "_links": {
    "self": {
      "href": "http://localhost:2222/accounts/account/ccxxxxxxxxx"
    },
    "investor": {
      "href": "http://localhost:2222/accounts/investor/{id}",
      "templated": true
    },
    "mandate": {
      "href": "http://localhost:9191/accounts/ccxxxxxxxxxx/profile"
    }
  }
}

Any ideas?

@gregturn
Copy link
Contributor

Show me InvestorController and a log output with the investorId.

@caoyuanqi
Copy link
Author

Basically, we are coding with Spring cloud. Related code as below:

package au.com.othera.accountservice.web;

import java.security.Principal;
import java.util.List;
import java.util.Map;

import javax.validation.Valid;

import com.fasterxml.jackson.databind.node.ObjectNode;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.hateoas.Link;
import org.springframework.hateoas.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.method.P;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

....

import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;


@RestController
@Slf4j
public class InvestorController {

    @Autowired
    AccountService accountService;

    @Value(“${xxx.baseUrl}")
    private String baseUrl;

    @Value(“${xxx.service.name}")
    private String serviceUrl;
 
    ...

    @ApiOperation(value = "Get user information",
            notes = "Gets user's information. Only user and admin.")
    @GetMapping("/investor/{id}")
    @PreAuthorize("hasAuthority('ADMIN') ")
    public ResponseEntity<InvestorResource> getInverstor(
            @PathVariable(name = "id") String investorId) {
        InvestorResource dto = accountService.getInvestorInformation(investorId);
        return new ResponseEntity<>(dto, HttpStatus.OK);
    }
   
    @ApiOperation(value = "User security information.", notes = "Only for development")
    @GetMapping("/user")
    public Principal getUserInfo(Principal user) {
        return user;
    }
    ….  
}

Debug Log for that request: with root debug opened.

2017-08-17 23:22:00.973 DEBUG 11481 --- [-25 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-25 - Pool stats (total=30, active=0, idle=30, waiting=0)
2017-08-17 23:22:03.733 DEBUG 11481 --- [2222-Acceptor-0] o.apache.tomcat.util.threads.LimitLatch  : Counting up[http-nio-2222-Acceptor-0] latch=1
2017-08-17 23:22:03.738 DEBUG 11481 --- [nio-2222-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@50ed0a1e:org.apache.tomcat.util.net.NioChannel@25c0334d:java.nio.channels.SocketChannel[connected local=/192.168.1.103:2222 remote=/192.168.1.103:51305]], Read from buffer: [0]
2017-08-17 23:22:03.741 DEBUG 11481 --- [nio-2222-exec-3] o.a.coyote.http11.Http11InputBuffer      : Received [GET /accounts/account/cc1502949957725 HTTP/1.1
authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MDI5Nzk3NTYsInVzZXJfbmFtZSI6ImpvaG4iLCJhdXRob3JpdGllcyI6WyJVU0VSIiwiQURNSU4iXSwianRpIjoiZGI1OThjNWUtMmUyNS00MTFhLTkzM2MtMWI1YTYwYzQ2M2E2IiwiY2xpZW50X2lkIjoid2ViX2FwcCIsInNjb3BlIjpbInVpIl19.a_D1Cm5nUlxz3evbEM9J_LJNPdFumiwLNJ8QAOoPqFAaFRXwCfGe8XZKWuLDOqm45ZtdnKtB0ZgZ5vub1n1L7sVyxg9tTGkroLiVIAITTwcjdkKWpCfHDPhQREkKnqjMioO4K7N2oIHR7dJLJcWQoFcE5QNDeDgXLgtpF7ynKfLjkwnBhm2DXDQGUjklkkFfBMlR2noNF9Yuz9O9nlvwlkPfSgLzJx6auoXzCm5GfRqWB4oZJ9gGe0IAwjxIj7fDGrFrtmhHSmmpfSZ-2Pm-zMCzopr96TAOGCLD1hANWp_fUuPy-TwGOG19DOiUcgecNsLHOFOUg0_yl_Jxjmz6LA
content-type: text/plain; charset=utf-8
user-agent: Paw/3.1.3 (Macintosh; OS X/10.12.6) GCDHTTPRequest
x-forwarded-host: localhost:9191
x-forwarded-proto: http
x-forwarded-port: 9191
x-forwarded-for: 127.0.0.1
Accept-Encoding: gzip
Content-Length: 0
Host: 192.168.1.103:2222
Connection: Keep-Alive

]
2017-08-17 23:22:03.745 DEBUG 11481 --- [nio-2222-exec-3] o.a.c.authenticator.AuthenticatorBase    : Security checking request GET /accounts/account/cc1502949957725
2017-08-17 23:22:03.746 DEBUG 11481 --- [nio-2222-exec-3] org.apache.catalina.realm.RealmBase      :   No applicable constraints defined
2017-08-17 23:22:03.746 DEBUG 11481 --- [nio-2222-exec-3] o.a.c.authenticator.AuthenticatorBase    :  Not subject to any constraint
2017-08-17 23:22:03.757 DEBUG 11481 --- [nio-2222-exec-3] pertySourcedRequestMappingHandlerMapping : Looking up handler method for path /account/cc1502949957725
2017-08-17 23:22:03.757 DEBUG 11481 --- [nio-2222-exec-3] pertySourcedRequestMappingHandlerMapping : looking up handler for path: /account/cc1502949957725
2017-08-17 23:22:03.757 DEBUG 11481 --- [nio-2222-exec-3] pertySourcedRequestMappingHandlerMapping : Did not find handler method for [/account/cc1502949957725]
2017-08-17 23:22:03.764 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.t.internal.TransactionImpl         : begin
2017-08-17 23:22:03.786  INFO 11481 --- [nio-2222-exec-3] a.c.o.a.service.impl.AccountServiceImpl  : Get information of Account cc1502949957725
2017-08-17 23:22:03.790 DEBUG 11481 --- [nio-2222-exec-3] o.h.jpa.criteria.CriteriaQueryImpl       : Rendered criteria query -> select generatedAlias0 from Account as generatedAlias0 where generatedAlias0.accountName=:param0
2017-08-17 23:22:03.791 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
    /* select
    ….


2017-08-17 23:22:03.800 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e]
2017-08-17 23:22:03.801 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e]
2017-08-17 23:22:03.802 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 

  …..


2017-08-17 23:22:03.820 DEBUG 11481 --- [nio-2222-exec-3] o.h.l.p.e.p.i.ResultSetProcessorImpl     : Starting ResultSet row #0
2017-08-17 23:22:03.821 DEBUG 11481 --- [nio-2222-exec-3] l.p.e.p.i.EntityReferenceInitializerImpl : On call to EntityIdentifierReaderImpl#resolve, EntityKey was already known; should only happen on root returns with an optional identifier specified
2017-08-17 23:22:03.822 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.822 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.822 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec]
2017-08-17 23:22:03.822 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Loading entity: [au.com.othera.accountservice.entity.investor.Investor#fbfb4db6-e558-4baf-a151-2937b14844ec]
2017-08-17 23:22:03.825 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
    /* load au.com.othera.accountservice.entity.investor.Investor */ select
       ....

2017-08-17 23:22:03.845 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], null, EntityKey[au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec], null, EntityKey[au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780], EntityKey[au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768], EntityKey[au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.848 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Done entity load
2017-08-17 23:22:03.850 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec]
2017-08-17 23:22:03.853 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780]
2017-08-17 23:22:03.855 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Loading entity: [au.com.othera.accountservice.entity.investor.Investor#b03ab3f8-c6f8-422a-a1cb-900765215780]
2017-08-17 23:22:03.859 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
    /* load au.com.othera.accountservice.entity.investor.Investor */

....


2017-08-17 23:22:03.890 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], null, EntityKey[au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec], null, EntityKey[au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780], EntityKey[au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768], EntityKey[au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.892 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Done entity load
2017-08-17 23:22:03.892 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780]
2017-08-17 23:22:03.894 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768]
2017-08-17 23:22:03.896 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Loading entity: [au.com.othera.accountservice.entity.investor.Investor#a29932e0-f3cb-4d79-891b-7110d683a768]
2017-08-17 23:22:03.901 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
    /* load au.com.othera.accountservice.entity.investor.Investor */ 

....


2017-08-17 23:22:03.921 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], null, EntityKey[au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec], null, EntityKey[au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780], EntityKey[au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768], EntityKey[au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.921 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Done entity load
2017-08-17 23:22:03.921 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768]
2017-08-17 23:22:03.921 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Resolving associations for [au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c]
2017-08-17 23:22:03.921 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Loading entity: [au.com.othera.accountservice.entity.investor.Investor#3309d010-7af4-45d0-b492-9ec697a2230c]
2017-08-17 23:22:03.923 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
    /* load au.com.othera.accountservice.entity.investor.Investor */ 
....


2017-08-17 23:22:03.934 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], null, EntityKey[au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec], null, EntityKey[au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780], EntityKey[au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768], EntityKey[au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c], EntityKey[au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc]
2017-08-17 23:22:03.935 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Done entity load
2017-08-17 23:22:03.935 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c]
2017-08-17 23:22:03.935 DEBUG 11481 --- [nio-2222-exec-3] o.h.r.j.i.ResourceRegistryStandardImpl   : HHH000387: ResultSet's statement was not registered
2017-08-17 23:22:03.937 DEBUG 11481 --- [nio-2222-exec-3] .l.e.p.AbstractLoadPlanBasedEntityLoader : Done entity load : au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc
2017-08-17 23:22:03.938 DEBUG 11481 --- [nio-2222-exec-3] o.h.engine.internal.TwoPhaseLoad         : Done materializing entity [au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e]
2017-08-17 23:22:03.938 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.t.internal.TransactionImpl         : committing
2017-08-17 23:22:03.939 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Processing flush-time cascades
2017-08-17 23:22:03.939 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Dirty checking collections
2017-08-17 23:22:03.939 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.engine.internal.Collections  : Collection found: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], was: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc] (uninitialized)
2017-08-17 23:22:03.940 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects
2017-08-17 23:22:03.941 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : Listing entities:
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestOption{createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, lastModifiedBy=anonymousUser, authority=General Authority, paymentMethod=Cheque, id=a29932e0-f3cb-4d79-891b-7110d683a768, expectedFurtherAmmount=600, initInvestment=500}
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.Account{createdAt=2017-08-17 16:05:58.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:06:24.0, createdBy=anonymousUser, accountName=cc1502949957725, lastModifiedBy=anonymousUser, systemUser=null, id=5f72eec4-f768-4861-880d-bef9a0f9552e, type=investor, activeCode=null}
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.BankDetails{bsb=12344, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, accountName=Prasad, lastModifiedBy=anonymousUser, accountNo=1234555, bankName=common wealth, id=fbfb4db6-e558-4baf-a151-2937b14844ec, branch=abc}
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.PreferContact{country=AUS, lastModifiedAt=2017-08-17 16:05:57.0, lastModifiedBy=anonymousUser, givenName=Yuanqi, postcode=2035, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, createdBy=anonymousUser, phone=11111, street=address, surname=Cao, suburb=suburb, id=b03ab3f8-c6f8-422a-a1cb-900765215780, state=NSW, [email protected]}
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestmentProfile{maxReturn=88888, longestTerm=18, majorRegionalPermit=true, maxLvrPermitted=68, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, maxPartInFundPercent=59, propertyType=land, devAndCon=turnArounds, maxReturnGA=1333, loanPurpose=C, id=3309d010-7af4-45d0-b492-9ec697a2230c, state=QLD, minReturn=8, creditRiskGrade=B}
2017-08-17 23:22:03.942 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.Investor{lastModifiedAt=2017-08-17 16:42:13.0, checkCertifiedDoc=true, lastModifiedBy=cc1502949957725, individualInvestors=<uninitialized>, companyInvestor=null, type=Individual, checkApplication=true, investOption=au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768, verifiedFlag=false, createdAt=2017-08-17 16:05:57.0, accountAuthorities=Normal, bankDetails=au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec, createdBy=anonymousUser, contact=au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780, accountAuthoritiesOther=Othe, id=21414f3f-0c41-4a1a-8a47-3c1d12adfacc, enableFlag=false, account=au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e, investmentProfile=au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c, oldNewFlag=No}
2017-08-17 23:22:03.943  INFO 11481 --- [nio-2222-exec-3] a.c.o.a.web.AccountController            : investor id is 21414f3f-0c41-4a1a-8a47-3c1d12adfacc
2017-08-17 23:22:03.951 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.t.internal.TransactionImpl         : begin
2017-08-17 23:22:03.952  INFO 11481 --- [nio-2222-exec-3] a.c.o.a.service.impl.AccountServiceImpl  : Get InvestmentProfileDto for accountName cc1502949957725
2017-08-17 23:22:03.952 DEBUG 11481 --- [nio-2222-exec-3] o.h.jpa.criteria.CriteriaQueryImpl       : Rendered criteria query -> select generatedAlias0 from Account as generatedAlias0 where generatedAlias0.accountName=:param0
2017-08-17 23:22:03.952 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Processing flush-time cascades
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Dirty checking collections
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.engine.internal.Collections  : Collection found: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], was: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc] (uninitialized)
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : Listing entities:
2017-08-17 23:22:03.953 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestOption{createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, lastModifiedBy=anonymousUser, authority=General Authority, paymentMethod=Cheque, id=a29932e0-f3cb-4d79-891b-7110d683a768, expectedFurtherAmmount=600, initInvestment=500}
2017-08-17 23:22:03.955 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.Account{createdAt=2017-08-17 16:05:58.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:06:24.0, createdBy=anonymousUser, accountName=cc1502949957725, lastModifiedBy=anonymousUser, systemUser=null, id=5f72eec4-f768-4861-880d-bef9a0f9552e, type=investor, activeCode=null}
2017-08-17 23:22:03.955 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.BankDetails{bsb=12344, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, accountName=Prasad, lastModifiedBy=anonymousUser, accountNo=1234555, bankName=common wealth, id=fbfb4db6-e558-4baf-a151-2937b14844ec, branch=abc}
2017-08-17 23:22:03.955 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.PreferContact{country=AUS, lastModifiedAt=2017-08-17 16:05:57.0, lastModifiedBy=anonymousUser, givenName=Yuanqi, postcode=2035, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, createdBy=anonymousUser, phone=11111, street=address, surname=Cao, suburb=suburb, id=b03ab3f8-c6f8-422a-a1cb-900765215780, state=NSW, [email protected]}
2017-08-17 23:22:03.955 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestmentProfile{maxReturn=88888, longestTerm=18, majorRegionalPermit=true, maxLvrPermitted=68, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, maxPartInFundPercent=59, propertyType=land, devAndCon=turnArounds, maxReturnGA=1333, loanPurpose=C, id=3309d010-7af4-45d0-b492-9ec697a2230c, state=QLD, minReturn=8, creditRiskGrade=B}
2017-08-17 23:22:03.955 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.Investor{lastModifiedAt=2017-08-17 16:42:13.0, checkCertifiedDoc=true, lastModifiedBy=cc1502949957725, individualInvestors=<uninitialized>, companyInvestor=null, type=Individual, checkApplication=true, investOption=au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768, verifiedFlag=false, createdAt=2017-08-17 16:05:57.0, accountAuthorities=Normal, bankDetails=au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec, createdBy=anonymousUser, contact=au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780, accountAuthoritiesOther=Othe, id=21414f3f-0c41-4a1a-8a47-3c1d12adfacc, enableFlag=false, account=au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e, investmentProfile=au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c, oldNewFlag=No}
2017-08-17 23:22:03.958 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.SQL                        : 
   ....
2017-08-17 23:22:03.964 DEBUG 11481 --- [nio-2222-exec-3] org.hibernate.loader.Loader              : Result row: EntityKey[au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e]
2017-08-17 23:22:03.965 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.t.internal.TransactionImpl         : committing
2017-08-17 23:22:03.965 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Processing flush-time cascades
2017-08-17 23:22:03.966 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Dirty checking collections
2017-08-17 23:22:03.967 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.engine.internal.Collections  : Collection found: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc], was: [au.com.othera.accountservice.entity.investor.Investor.individualInvestors#21414f3f-0c41-4a1a-8a47-3c1d12adfacc] (uninitialized)
2017-08-17 23:22:03.970 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects
2017-08-17 23:22:03.970 DEBUG 11481 --- [nio-2222-exec-3] o.h.e.i.AbstractFlushingEventListener    : Flushed: 0 (re)creations, 0 updates, 0 removals to 1 collections
2017-08-17 23:22:03.970 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : Listing entities:
2017-08-17 23:22:03.971 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestOption{createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, lastModifiedBy=anonymousUser, authority=General Authority, paymentMethod=Cheque, id=a29932e0-f3cb-4d79-891b-7110d683a768, expectedFurtherAmmount=600, initInvestment=500}
2017-08-17 23:22:03.972 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.Account{createdAt=2017-08-17 16:05:58.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:06:24.0, createdBy=anonymousUser, accountName=cc1502949957725, lastModifiedBy=anonymousUser, systemUser=null, id=5f72eec4-f768-4861-880d-bef9a0f9552e, type=investor, activeCode=null}
2017-08-17 23:22:03.972 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.BankDetails{bsb=12344, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, lastModifiedAt=2017-08-17 16:05:57.0, createdBy=anonymousUser, accountName=Prasad, lastModifiedBy=anonymousUser, accountNo=1234555, bankName=common wealth, id=fbfb4db6-e558-4baf-a151-2937b14844ec, branch=abc}
2017-08-17 23:22:03.973 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.PreferContact{country=AUS, lastModifiedAt=2017-08-17 16:05:57.0, lastModifiedBy=anonymousUser, givenName=Yuanqi, postcode=2035, createdAt=2017-08-17 16:05:57.0, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, createdBy=anonymousUser, phone=11111, street=address, surname=Cao, suburb=suburb, id=b03ab3f8-c6f8-422a-a1cb-900765215780, state=NSW, [email protected]}
2017-08-17 23:22:03.974 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.InvestmentProfile{maxReturn=88888, longestTerm=18, majorRegionalPermit=true, maxLvrPermitted=68, investor=au.com.othera.accountservice.entity.investor.Investor#21414f3f-0c41-4a1a-8a47-3c1d12adfacc, maxPartInFundPercent=59, propertyType=land, devAndCon=turnArounds, maxReturnGA=1333, loanPurpose=C, id=3309d010-7af4-45d0-b492-9ec697a2230c, state=QLD, minReturn=8, creditRiskGrade=B}
2017-08-17 23:22:03.975 DEBUG 11481 --- [nio-2222-exec-3] o.hibernate.internal.util.EntityPrinter  : au.com.othera.accountservice.entity.investor.Investor{lastModifiedAt=2017-08-17 16:42:13.0, checkCertifiedDoc=true, lastModifiedBy=cc1502949957725, individualInvestors=<uninitialized>, companyInvestor=null, type=Individual, checkApplication=true, investOption=au.com.othera.accountservice.entity.investor.InvestOption#a29932e0-f3cb-4d79-891b-7110d683a768, verifiedFlag=false, createdAt=2017-08-17 16:05:57.0, accountAuthorities=Normal, bankDetails=au.com.othera.accountservice.entity.investor.BankDetails#fbfb4db6-e558-4baf-a151-2937b14844ec, createdBy=anonymousUser, contact=au.com.othera.accountservice.entity.investor.PreferContact#b03ab3f8-c6f8-422a-a1cb-900765215780, accountAuthoritiesOther=Othe, id=21414f3f-0c41-4a1a-8a47-3c1d12adfacc, enableFlag=false, account=au.com.othera.accountservice.entity.Account#5f72eec4-f768-4861-880d-bef9a0f9552e, investmentProfile=au.com.othera.accountservice.entity.investor.InvestmentProfile#3309d010-7af4-45d0-b492-9ec697a2230c, oldNewFlag=No}
2017-08-17 23:22:03.984 DEBUG 11481 --- [nio-2222-exec-3] o.a.tomcat.util.net.SocketWrapperBase    : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@50ed0a1e:org.apache.tomcat.util.net.NioChannel@25c0334d:java.nio.channels.SocketChannel[connected local=/192.168.1.103:2222 remote=/192.168.1.103:51305]], Read from buffer: [0]
2017-08-17 23:22:03.985 DEBUG 11481 --- [nio-2222-exec-3] o.apache.coyote.http11.Http11Processor   : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@50ed0a1e:org.apache.tomcat.util.net.NioChannel@25c0334d:java.nio.channels.SocketChannel[connected local=/192.168.1.103:2222 remote=/192.168.1.103:51305]], Status in: [OPEN_READ], State out: [OPEN]
2017-08-17 23:22:06.007 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.MonitoredConnectionManager  : Closing connections idle longer than 30000 SECONDS
2017-08-17 23:22:06.008 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Closing connections idle longer than 30000 SECONDS
2017-08-17 23:22:06.009 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.MonitoredConnectionManager  : Closing connections idle longer than -1 SECONDS
2017-08-17 23:22:06.010 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Closing connections idle longer than 0 SECONDS
2017-08-17 23:22:06.010 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Closing connection last used @ Thu Aug 17 23:21:36 AEST 2017
2017-08-17 23:22:06.010 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Deleting connection [{}->http://localhost:8761][null]
2017-08-17 23:22:06.010 DEBUG 11481 --- [t-Conn-Cleaner2] o.a.h.impl.conn.DefaultClientConnection  : Connection 0.0.0.0:51151<->127.0.0.1:8761 closed
2017-08-17 23:22:06.011 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Closing connection last used @ Thu Aug 17 23:21:36 AEST 2017
2017-08-17 23:22:06.011 DEBUG 11481 --- [t-Conn-Cleaner2] c.n.d.shared.NamedConnectionPool         : Deleting connection [{}->http://localhost:8761][null]
2017-08-17 23:22:06.011 DEBUG 11481 --- [t-Conn-Cleaner2] o.a.h.impl.conn.DefaultClientConnection  : Connection 0.0.0.0:51152<->127.0.0.1:8761 closed
2017-08-17 23:22:06.243 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.MonitoredConnectionManager  : Get connection: {}->http://localhost:8761, timeout = 5000
2017-08-17 23:22:06.243 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : [{}->http://localhost:8761] total kept alive: 0, total issued: 0, total allocated: 0 out of 200
2017-08-17 23:22:06.243 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : No free connections [{}->http://localhost:8761][null]
2017-08-17 23:22:06.244 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : Available capacity: 50 out of 50 [{}->http://localhost:8761][null]
2017-08-17 23:22:06.244 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : Creating new connection [{}->http://localhost:8761]
2017-08-17 23:22:06.247 DEBUG 11481 --- [tbeatExecutor-0] .a.h.i.c.DefaultClientConnectionOperator : Connecting to localhost:8761
2017-08-17 23:22:06.248 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.client.protocol.RequestAddCookies  : CookieSpec selected: default
2017-08-17 23:22:06.248 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.client.protocol.RequestAuthCache   : Auth cache not set in the context
2017-08-17 23:22:06.248 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.c.p.RequestTargetAuthentication    : Target auth state: UNCHALLENGED
2017-08-17 23:22:06.249 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.c.p.RequestProxyAuthentication     : Proxy auth state: UNCHALLENGED
2017-08-17 23:22:06.250 DEBUG 11481 --- [tbeatExecutor-0] o.a.http.impl.client.DefaultHttpClient   : Attempt 1 to execute request
2017-08-17 23:22:06.250 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.impl.conn.DefaultClientConnection  : Sending request: PUT /eureka/apps/ACCOUNTS/192.168.1.103:accounts:2222?status=UP&lastDirtyTimestamp=1502975885994 HTTP/1.1
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "PUT /eureka/apps/ACCOUNTS/192.168.1.103:accounts:2222?status=UP&lastDirtyTimestamp=1502975885994 HTTP/1.1[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Id: 192.168.1.103[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "Accept-Encoding: gzip[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "Content-Length: 0[\r][\n]"
2017-08-17 23:22:06.251 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "Host: localhost:8761[\r][\n]"
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "Connection: Keep-Alive[\r][\n]"
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "User-Agent: Java-EurekaClient/v1.6.2[\r][\n]"
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  >> "[\r][\n]"
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> PUT /eureka/apps/ACCOUNTS/192.168.1.103:accounts:2222?status=UP&lastDirtyTimestamp=1502975885994 HTTP/1.1
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Name: DefaultClient
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Version: 1.4
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Id: 192.168.1.103
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> Accept-Encoding: gzip
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> Content-Length: 0
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> Host: localhost:8761
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> Connection: Keep-Alive
2017-08-17 23:22:06.252 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : >> User-Agent: Java-EurekaClient/v1.6.2
2017-08-17 23:22:06.258 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  << "HTTP/1.1 200 [\r][\n]"
2017-08-17 23:22:06.258 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  << "Content-Type: application/xml[\r][\n]"
2017-08-17 23:22:06.258 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  << "Content-Length: 0[\r][\n]"
2017-08-17 23:22:06.258 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  << "Date: Thu, 17 Aug 2017 13:22:06 GMT[\r][\n]"
2017-08-17 23:22:06.258 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.wire                     :  << "[\r][\n]"
2017-08-17 23:22:06.259 DEBUG 11481 --- [tbeatExecutor-0] o.a.h.impl.conn.DefaultClientConnection  : Receiving response: HTTP/1.1 200 
2017-08-17 23:22:06.259 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : << HTTP/1.1 200 
2017-08-17 23:22:06.259 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : << Content-Type: application/xml
2017-08-17 23:22:06.259 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : << Content-Length: 0
2017-08-17 23:22:06.259 DEBUG 11481 --- [tbeatExecutor-0] org.apache.http.headers                  : << Date: Thu, 17 Aug 2017 13:22:06 GMT
2017-08-17 23:22:06.260 DEBUG 11481 --- [tbeatExecutor-0] o.a.http.impl.client.DefaultHttpClient   : Connection can be kept alive indefinitely
2017-08-17 23:22:06.261 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.MonitoredConnectionManager  : Get connection: {}->http://localhost:8761, timeout = 5000
2017-08-17 23:22:06.261 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.MonitoredConnectionManager  : Released connection is reusable.
2017-08-17 23:22:06.262 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : [{}->http://localhost:8761] total kept alive: 0, total issued: 1, total allocated: 1 out of 200
2017-08-17 23:22:06.262 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : Releasing connection [{}->http://localhost:8761][null]
2017-08-17 23:22:06.262 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : No free connections [{}->http://localhost:8761][null]
2017-08-17 23:22:06.263 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : Available capacity: 49 out of 50 [{}->http://localhost:8761][null]
2017-08-17 23:22:06.264 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : Creating new connection [{}->http://localhost:8761]
2017-08-17 23:22:06.264 DEBUG 11481 --- [freshExecutor-0] .a.h.i.c.DefaultClientConnectionOperator : Connecting to localhost:8761
2017-08-17 23:22:06.265 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : Pooling connection [{}->http://localhost:8761][null]; keep alive indefinitely
2017-08-17 23:22:06.265 DEBUG 11481 --- [tbeatExecutor-0] c.n.d.shared.NamedConnectionPool         : Notifying no-one, there are no waiting threads
2017-08-17 23:22:06.266 DEBUG 11481 --- [tbeatExecutor-0] n.d.s.t.j.AbstractJerseyEurekaHttpClient : Jersey HTTP PUT http://localhost:8761/eureka//apps/ACCOUNTS/192.168.1.103:accounts:2222; statusCode=200
2017-08-17 23:22:06.267 DEBUG 11481 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_ACCOUNTS/192.168.1.103:accounts:2222 - Heartbeat status: 200
2017-08-17 23:22:06.267 DEBUG 11481 --- [freshExecutor-0] o.a.h.client.protocol.RequestAddCookies  : CookieSpec selected: default
2017-08-17 23:22:06.268 DEBUG 11481 --- [freshExecutor-0] o.a.h.client.protocol.RequestAuthCache   : Auth cache not set in the context
2017-08-17 23:22:06.268 DEBUG 11481 --- [freshExecutor-0] o.a.h.c.p.RequestTargetAuthentication    : Target auth state: UNCHALLENGED
2017-08-17 23:22:06.268 DEBUG 11481 --- [freshExecutor-0] o.a.h.c.p.RequestProxyAuthentication     : Proxy auth state: UNCHALLENGED
2017-08-17 23:22:06.269 DEBUG 11481 --- [freshExecutor-0] o.a.http.impl.client.DefaultHttpClient   : Attempt 1 to execute request
2017-08-17 23:22:06.269 DEBUG 11481 --- [freshExecutor-0] o.a.h.impl.conn.DefaultClientConnection  : Sending request: GET /eureka/apps/delta HTTP/1.1
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "GET /eureka/apps/delta HTTP/1.1[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "Accept: application/json[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "DiscoveryIdentity-Id: 192.168.1.103[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "Accept-Encoding: gzip[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "Host: localhost:8761[\r][\n]"
2017-08-17 23:22:06.270 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "Connection: Keep-Alive[\r][\n]"
2017-08-17 23:22:06.271 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "User-Agent: Java-EurekaClient/v1.6.2[\r][\n]"
2017-08-17 23:22:06.271 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  >> "[\r][\n]"
2017-08-17 23:22:06.271 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> GET /eureka/apps/delta HTTP/1.1
2017-08-17 23:22:06.271 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> Accept: application/json
2017-08-17 23:22:06.272 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Name: DefaultClient
2017-08-17 23:22:06.272 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Version: 1.4
2017-08-17 23:22:06.272 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> DiscoveryIdentity-Id: 192.168.1.103
2017-08-17 23:22:06.272 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> Accept-Encoding: gzip
2017-08-17 23:22:06.272 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> Host: localhost:8761
2017-08-17 23:22:06.274 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> Connection: Keep-Alive
2017-08-17 23:22:06.274 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : >> User-Agent: Java-EurekaClient/v1.6.2
2017-08-17 23:22:06.277 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "HTTP/1.1 200 [\r][\n]"
2017-08-17 23:22:06.277 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "Content-Encoding: gzip[\r][\n]"
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "Content-Type: application/json[\r][\n]"
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "Content-Length: 522[\r][\n]"
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "Date: Thu, 17 Aug 2017 13:22:06 GMT[\r][\n]"
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "[\r][\n]"
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] o.a.h.impl.conn.DefaultClientConnection  : Receiving response: HTTP/1.1 200 
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : << HTTP/1.1 200 
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : << Content-Encoding: gzip
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : << Content-Type: application/json
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : << Content-Length: 522
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.headers                  : << Date: Thu, 17 Aug 2017 13:22:06 GMT
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] o.a.http.impl.client.DefaultHttpClient   : Connection can be kept alive indefinitely
2017-08-17 23:22:06.278 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x8d]SMo[0xdb]0[0xc][0xfd]/B[0x8e][0x81][0x13][0xe7][0xab][0x89]O-[0xec][0x1e][0x82][0xa1]I[0xb0]4[0xdd]a[0x18][0xc]Nfbm[0xb2]dHr:#[0xc8][0x1f]e[0xd7]YS,[0xd8][0xec][0x83]-[0xf2][0xf1][0x91]|[0xa4]N[0xc][0xca]R[\n]"
2017-08-17 23:22:06.279 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "[0xe]NheYtbG4[0xd6][0xff][0xa7]i[0x86][0xd2][0x1][0x8b][0xd8]l4e}[0x8f]#[[0xe]6[0xe7]:C2'[0xeb]/[0xab]4Lw[0x9b]t[0x9a][0xb6][0xfe][0x8e][0x87]E_OLA[0xe1]Q[0xf]q[0xbc][0xde][0xad][0x9e][0xb7][0x84][0x10][0xca]:P[0x1c][0x1b]wwXf[0x4][0x92][0x9a][0x83][0xcc][0xb5]u[0x11]p[0xae]+[0xe5]l4[0xa2][0x87]b[0xbc]q[0xd5]2[0x85][0x8b]Q[0x10][0xce][0xe6]A[0x18][0x84][0xc3]q[0x9b][0xf0][0x3][0xf9][0x90]e[0xe6]/H[0xca][0xe4]*[0xfb]V2[0x9d]5[0xf5]hD[0x96][0xa1][0xba]xv[0xab]O[0xab][0xd6]Yj[0xe3][0xbc][0xe]=[0xd6][0xd4][0xd0]g[0xf7][0xa8][0xe0][0xbb]D_[0xa7]3[0x15][0xb2]3[0x11]"[0xaf][0xc]n[0xfe] '[0x93][0xf1][0x15]p[0xf][0xd2]6[0xc8][0xa6][0x1b]S[0xfb].[0xc3]>[0xcb][0xc0]A[0x8c][0xca][0xa1]Y[0xaa][0xbd][0xf6][0xb1][0xf7]\[0x82][0xf5][0x5]p][0x4][\n]"
2017-08-17 23:22:06.280 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "[0xdd]^[0x8a]_[0x1]u&[0xc8][0x1f],;[0x8d][0xe8][0xd0]Kp[0xf][0x95]t[0xc9]5E[0xbf][0xd3][0xf9][0xa9]^[0xbf]*[0x9f]Q"X[0xec][0xe8][\r]*|[0x5][0xb9][0xf4][0xf8][0xa3][0xff]n[0x91]S[0xb6][0xf1][0x90]j[0xa9]L3[0xac][0xce][0xb6] [0x9b][0xc1][0x83][0xb0][0xae][0xb5]?[0x8b][0x2])}A"[0x87][0xd3][0xe1]hq7[0x9d][0xdf]M[0xc2][0xf9][0x9c]2[0x80]u[0x9f][[0xe2][0xdb] <[\n]"
2017-08-17 23:22:06.280 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "[0xfe][0x81]f[0xe8][0x85]3d[0xc7]][0xf9][0xde]LE[0x17][0xe8][0xc0][0x8b]s%[0xc9][0xf]8BP9![0x83]XK[0x89][\r][0x9d][0xed]=[0x16][0xa5][0xab][0x9f][0xa0][0xf4][0xbd][0xe6][0xba][0xc0][\r][0x1c]pg$[0xe1]s[0xe7][0xca]h0[0xb8][0x9a]~3[0xc3][0xc1]e[0x7][0xfe][0x7],Z]s[0x4][0xe9][0xf2]8G[0xfe][0xf3]_[0x11]-[0x94]b[0x8e][0xed][\n]"
2017-08-17 23:22:06.281 DEBUG 11481 --- [freshExecutor-0] org.apache.http.wire                     :  << "bS~[0xb7][0xca][0xac][0xdb][0x97][0x97][0x1b]^ac[0xad]M&[0x14][0xe9][0xae][0xe][0x89][0xb0][0xdc]/h[0xbd]%[0xad][0xd0]\[0x96][0xa9][0xd5]}W[0x92]L[0x98][0xbd][0x93][0x8f]][0x9][0xff][0x6]K[0x84]q[0xf5][\r][0xd0]l[0xe1]/O;[0x9c][0xba]l[0xee]h[0x92]<&[0xec][0xfc][0x8d][0xde][0xf3]o[0x9d][0xdc]q&[0x11][0x4][0x0][0x0]"
2017-08-17 23:22:06.282 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.MonitoredConnectionManager  : Released connection is reusable.
2017-08-17 23:22:06.282 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : Releasing connection [{}->http://localhost:8761][null]
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : Pooling connection [{}->http://localhost:8761][null]; keep alive indefinitely
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] c.n.d.shared.NamedConnectionPool         : Notifying no-one, there are no waiting threads
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] n.d.s.t.j.AbstractJerseyEurekaHttpClient : Jersey HTTP GET http://localhost:8761/eureka//apps/delta?; statusCode=200
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Got delta update with apps hashcode DOWN_1_UP_5_
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Added instance localhost:accounts:2222 to the existing apps in region null
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : The total number of instances fetched by the delta processor : 1
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : The total number of all instances in the client now is 6
2017-08-17 23:22:06.283 DEBUG 11481 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Completed cache refresh task for discovery. All Apps hash code is Local region apps hashcode: DOWN_1_UP_5_, is fetching remote regions? false 

the result is

{
  "type": "investor",
  "accountName": "cc1502949957725",
  "_links": {
    "self": {
      "href": "http://localhost:9191/accounts/account/cc1502949957725"
    },
    "investor": {
      "href": "http://localhost:9191/accounts/investor/{id}",
      "templated": true
    },
    "mandate": {
      "href": "http://localhost:9191/accounts/investor/cc1502949957725/profile"
    }
  }
}

Thanks.

@caoyuanqi
Copy link
Author

@gregturn
Is that because I use uuid as id ? the href should be like below

"investor": {
      "href": "http://localhost:9191/accounts/investor/21414f3f-0c41-4a1a-8a47-3c1d12adfacc",
      "templated": true
    },

@gregturn
Copy link
Contributor

I don't think so.

I spotted one thing to try. I noticed InvestorController's method has {id} in the route with @PathVariable("id") String investorId. What happens if you change the signature to @PathVariable String id?

@caoyuanqi
Copy link
Author

caoyuanqi commented Aug 31, 2017

@gregturn Ok, After I change the name into the same, problem solved, thank you. However, I think that could be a potentially bug or a improve point. I changed the code a little bit. the code as below:

  @GetMapping("/investor/{investor}")
    @PreAuthorize("#u.saveFlag or hasAuthority('ADMIN') "
            + "or (isAuthenticated() and authentication.name.equals(#u.account.accountName)) ")
    public ResponseEntity<InvestorResource> getInverstor(
            @PathVariable(name = "investor") @P("u") @ApiIgnore Investor investor) {
        InvestorResource dto = accountService.getInvestorInformation(investor.getId());
        return new ResponseEntity<>(dto, HttpStatus.OK);
    }

By the way. To make most of preauthorize I have to map String to object first and then use the hateoas. However, It is another bug in #118, and I have to extend the WebMvcConfigurerAdapter, I think that also worth to fix.

config file as below.


/**
 * This configuration file is to fix bug of Spring Hateoas.
 * please check https://github.com/spring-projects/spring-hateoas/issues/118.
 */

@Component
public class MvcConfig extends WebMvcConfigurerAdapter {

    @Autowired
    private ApplicationContext applicationContext;

    @Override
    public void addFormatters(final FormatterRegistry registry) {
        super.addFormatters(registry);

        try {
            Class<?> clazz = Class.forName("org.springframework.hateoas.mvc."
                    + "AnnotatedParametersParameterAccessor$BoundMethodParameter");
            Field field = clazz.getDeclaredField("CONVERSION_SERVICE");
            field.setAccessible(true);
            DefaultFormattingConversionService service =
                    (DefaultFormattingConversionService) field.get(null);
            for (Formatter<?> formatter : applicationContext
                    .getBeansOfType(Formatter.class).values()) {
                service.addFormatter(formatter);
            }
            for (Converter<?, ?> converter : applicationContext
                    .getBeansOfType(Converter.class).values()) {
                service.addConverter(converter);
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
}

@gregturn
Copy link
Contributor

Definitely a bug. You just helped me pinpoint it. Also know how to write a test case.

@gregturn
Copy link
Contributor

BTW, what version of Spring HATEOAS are you using?

@gregturn
Copy link
Contributor

Okay, I pinpointed it. It's when you explicitly use @PathVariable(name="whatever"). Even the default value parameter it works. Thanks for helping me target this!

@caoyuanqi
Copy link
Author

@gregturn I am using , spring-boot-starter-hateoas, springBootVersion = '1.5.3.RELEASE', Spring cloud version is Dalston.SR1, thank you.

gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's annotations, used composite map of attributes to find the value. Leverages @AliasFor annotations of parameters.
gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's method parameters, use composite map of parameter annotation's attributes to find the value. Leverages @AliasFor annotations of parameters.
gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's method parameters, use Spring's SynthesizingMethodParameter to handle alternative attributes.
gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's method parameters, use Spring's SynthesizingMethodParameter to handle alternative attributes.
gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's method parameters, use Spring's SynthesizingMethodParameter to handle alternative attributes.
gregturn added a commit that referenced this issue Sep 1, 2017
When parsing controller's method parameters, use Spring's SynthesizingMethodParameter to handle alternative attributes.
@gregturn
Copy link
Contributor

gregturn commented Sep 1, 2017

@caoyuanqi The attached PR should fix the problem at hand so it doesn't happen again.

@gregturn
Copy link
Contributor

gregturn commented Sep 1, 2017

Related #621

odrotbohm pushed a commit that referenced this issue Oct 13, 2017
…eclarations.

We're now using SynthesizingMethodParameter to correctly support annotation attributes that use @AliasFor.

Original pull request: #621.
@odrotbohm odrotbohm changed the title value can not insert into {} in another controller Parameter names not detected in case @AliasFor'ed attributes are used Oct 13, 2017
@odrotbohm odrotbohm added this to the 0.24 milestone Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants