org.springframework.web.client.HttpClientErrorException: 403 Forbidden

Spring JIRA | Karol Dowbecki | 1 year ago
  1. 0

    After enabling security in {{XD_HOME/config/servers.yml}} {code} spring: profiles: admin security: basic: enabled: true # false to disable security settings (default) realm: SpringXD user: # valid only if security.basic.enabled=true name: johndoe password: johndoe role: ADMIN, VIEW, CREATE {code} It's no longer possible to connect to admin server through xd-shell {code} server-unknown:>admin config server --username johndoe --password johndoe Unable to contact XD Admin Server at 'http://localhost:9393/'. server-unknown:>admin config info ------------- -------------------------------------------------------------- Credentials [username='johndoe, password=****'] Result Unable to contact XD Admin Server at 'http://localhost:9393/'. Target http://localhost:9393/ Timezone used Greenwich Mean Time (UTC 0:00) ------------- -------------------------------------------------------------- ------------------------------------------------------------------------------- An exception ocurred during targeting: org.springframework.web.client.HttpClientErrorException: 403 Forbidden at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) at org.springframework.xd.rest.client.impl.VndErrorResponseErrorHandler.handleError(VndErrorResponseErrorHandler.java:50) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:614) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:570) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:545) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:253) at org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:114) at org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:102) at org.springframework.xd.shell.command.ConfigCommands.target(ConfigCommands.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:202) at org.springframework.shell.core.SimpleExecutionStrategy.invoke(SimpleExecutionStrategy.java:64) at org.springframework.shell.core.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:57) at org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:127) at org.springframework.shell.core.JLineShell.promptLoop(JLineShell.java:533) at org.springframework.shell.core.JLineShell.run(JLineShell.java:179) at java.lang.Thread.run(Thread.java:745) {code} It looks like admin base URL (http://localhost:9393/) is not defined in security section of {{application.yml}} so {{SpringXDTemplate}} can't be initialized.

    Spring JIRA | 1 year ago | Karol Dowbecki
    org.springframework.web.client.HttpClientErrorException: 403 Forbidden
  2. 0

    After enabling security in {{XD_HOME/config/servers.yml}} {code} spring: profiles: admin security: basic: enabled: true # false to disable security settings (default) realm: SpringXD user: # valid only if security.basic.enabled=true name: johndoe password: johndoe role: ADMIN, VIEW, CREATE {code} It's no longer possible to connect to admin server through xd-shell {code} server-unknown:>admin config server --username johndoe --password johndoe Unable to contact XD Admin Server at 'http://localhost:9393/'. server-unknown:>admin config info ------------- -------------------------------------------------------------- Credentials [username='johndoe, password=****'] Result Unable to contact XD Admin Server at 'http://localhost:9393/'. Target http://localhost:9393/ Timezone used Greenwich Mean Time (UTC 0:00) ------------- -------------------------------------------------------------- ------------------------------------------------------------------------------- An exception ocurred during targeting: org.springframework.web.client.HttpClientErrorException: 403 Forbidden at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91) at org.springframework.xd.rest.client.impl.VndErrorResponseErrorHandler.handleError(VndErrorResponseErrorHandler.java:50) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:614) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:570) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:545) at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:253) at org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:114) at org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:102) at org.springframework.xd.shell.command.ConfigCommands.target(ConfigCommands.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:202) at org.springframework.shell.core.SimpleExecutionStrategy.invoke(SimpleExecutionStrategy.java:64) at org.springframework.shell.core.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:57) at org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:127) at org.springframework.shell.core.JLineShell.promptLoop(JLineShell.java:533) at org.springframework.shell.core.JLineShell.run(JLineShell.java:179) at java.lang.Thread.run(Thread.java:745) {code} It looks like admin base URL (http://localhost:9393/) is not defined in security section of {{application.yml}} so {{SpringXDTemplate}} can't be initialized.

    Spring JIRA | 1 year ago | Karol Dowbecki
    org.springframework.web.client.HttpClientErrorException: 403 Forbidden
  3. 0

    Requests Failing After 7.0.1 Upgrade with Event... | VMware Communities

    vmware.com | 4 weeks ago
    org.springframework.web.client.HttpClientErrorException: 403 Forbidden
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 128#261364228

    GitHub | 2 weeks ago | cvenegasj
    org.springframework.security.authentication.BadCredentialsException: Could not obtain access token
  6. 0

    Feed parse from page fails because its trying to access age_range from Page

    GitHub | 2 years ago | digz6666
    org.springframework.social.UncategorizedApiException: (#100) Tried accessing nonexisting field (age_range) on node type (Page)

  1. Tahir 1 times, last 1 month ago
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.web.client.HttpClientErrorException

    403 Forbidden

    at org.springframework.web.client.DefaultResponseErrorHandler.handleError()
  2. Spring
    DefaultResponseErrorHandler.handleError
    1. org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
    1 frame
  3. org.springframework.xd
    VndErrorResponseErrorHandler.handleError
    1. org.springframework.xd.rest.client.impl.VndErrorResponseErrorHandler.handleError(VndErrorResponseErrorHandler.java:50)
    1 frame
  4. Spring
    RestTemplate.getForObject
    1. org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:614)
    2. org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:570)
    3. org.springframework.web.client.RestTemplate.execute(RestTemplate.java:545)
    4. org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:253)
    4 frames
  5. org.springframework.xd
    ConfigCommands.target
    1. org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:114)
    2. org.springframework.xd.rest.client.impl.SpringXDTemplate.<init>(SpringXDTemplate.java:102)
    3. org.springframework.xd.shell.command.ConfigCommands.target(ConfigCommands.java:112)
    3 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  7. Spring Core
    ReflectionUtils.invokeMethod
    1. org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:202)
    1 frame
  8. org.springframework.shell
    JLineShell.run
    1. org.springframework.shell.core.SimpleExecutionStrategy.invoke(SimpleExecutionStrategy.java:64)
    2. org.springframework.shell.core.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:57)
    3. org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:127)
    4. org.springframework.shell.core.JLineShell.promptLoop(JLineShell.java:533)
    5. org.springframework.shell.core.JLineShell.run(JLineShell.java:179)
    5 frames
  9. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame