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

@PostConstruct in DefaultBulkApiService does not work #1

Open
ghost opened this issue Aug 5, 2016 · 1 comment
Open

@PostConstruct in DefaultBulkApiService does not work #1

ghost opened this issue Aug 5, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 5, 2016

PostConstruct does not execute using spring boot (1.4.1) which therefore means that the validator is never initialised;

e.g. this is not called

@PostConstruct
private void afterConstruct() {
   this.validator = new BulkApiValidator(this.appCtx);
}

As a result all bulk operations fail with an error code;

{
  "timestamp": 1470396287727,
  "status": 500,
  "error": "Internal Server Error",
  "exception": "java.lang.NullPointerException",
  "message": "No message available",
  "path": "/bulk"
}
java.lang.NullPointerException: null
    at com.github.wnameless.spring.bulkapi.DefaultBulkApiService.computeUri(DefaultBulkApiService.java:123) ~[spring-bulk-api-0.5.0.jar:0.5.0]
    at com.github.wnameless.spring.bulkapi.DefaultBulkApiService.validateBulkRequest(DefaultBulkApiService.java:163) ~[spring-bulk-api-0.5.0.jar:0.5.0]
    at com.github.wnameless.spring.bulkapi.DefaultBulkApiService.bulk(DefaultBulkApiService.java:73) ~[spring-bulk-api-0.5.0.jar:0.5.0]
    at com.github.wnameless.spring.bulkapi.BulkApiController.bulk(BulkApiController.java:65) ~[spring-bulk-api-0.5.0.jar:0.5.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_40]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_40]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.2.RELEASE.jar:4.3.2.RELEASE]
@ghost
Copy link
Author

ghost commented Aug 5, 2016

This is because the bean is not managed. Extended the service works as per com.github.wnameless.spring.bulkapi.test.AppConfig

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

0 participants