I've deployed a Neo4j unmanaged extension. The unmanaged extension can be called using REST Client and successfully returned the result. The problem is when I try to call / invoke the unmanaged extension from another java class, it keep on throwing the 401 Unauthorized.
I used Spring RestTemplate to invoke the unmanaged extension.
My codes :
RestTemplate restTemplate = new RestTemplate();
PostPhotoRest postPhotoRest = restTemplate.getForObject("http://myneo4jusername:myneo4jpassword@localhost:7474/extension/servicetwo/postphoto/55b12d35-94fd-4297-bb18-e6040d7b7109", PostPhotoRest.class);
Full Error :
Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) ~[spring-web-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:668) ~[spring-web-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:621) ~[spring-web-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:581) ~[spring-web-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:288) ~[spring-web-4.3.0.RC2.jar:4.3.0.RC2]
at my.winapp.hashtagmanipulation.worker.RabbitMQWorker.processMessage(RabbitMQWorker.java:76) ~[classes/:na]
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_66]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-messaging-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:115) ~[spring-messaging-4.3.0.RC2.jar:4.3.0.RC2]
at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) ~[spring-rabbit-1.5.5.RELEASE.jar:na]
at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:112) ~[spring-rabbit-1.5.5.RELEASE.jar:na]
... 12 common frames omitted