prismicio / java-play-starter

Starter project for Java, Play – Works with any prismic.io repository
https://developers.prismic.io
9 stars 9 forks source link

Private-api prismic => app failure ; though Public API works #1

Closed ghost closed 10 years ago

ghost commented 11 years ago

Prismic.io: "Public API for master only" works (main settings / "security" block) allows the app to access the master API without any token. For Public API alone, the java-play-starter works out of the box deployed to Heroku with minor edits to / conf / application.conf per the instructions.

However, when set to Private API, the Application fails:

(Oops, an error occured This exception has been logged with id #hash.)

play - Application started (Prod) 2013-10-10T19:34:32.594462+00:00 heroku[web.1]: State changed from starting to up 2013-10-10T19:34:32.625662+00:00 app[web.1]: [info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:21645 2013-10-10T19:34:35.745906+00:00 app[web.1]: [error] play - Cannot invoke the action, eventually got an error: [UNEXPECTED] Got an HTTP error 401 (Unauthorized) 2013-10-10T19:34:35.812391+00:00 app[web.1]: 2013-10-10T19:34:35.812391+00:00 app[web.1]: 2013-10-10T19:34:35.812391+00:00 app[web.1]: ! @6fpmlecch - Internal server error, for (GET) [/] -> 2013-10-10T19:34:35.812391+00:00 app[web.1]: play.api.Application$$anon$1: Execution exception[[Error: Got an HTTP error 401 (Unauthorized)]] 2013-10-10T19:34:35.812391+00:00 app[web.1]: at play.api.DefaultApplication.handleError(Application.scala:399) [com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812391+00:00 app[web.1]: [error] application - 2013-10-10T19:34:35.812391+00:00 app[web.1]: at play.api.Application$class.handleError(Application.scala:293) ~[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812391+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812391+00:00 app[web.1]: at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.2.jar:na] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at io.prismic.Api.get(Api.java:40) ~[io.prismic.java-kit-1.0-M2.jar:na] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at controllers.Prismic.getApiHome(Prismic.java:62) ~[prismicio-starter.prismicio-starter-1.0-SNAPSHOT.jar:1.0-SNAPSHOT] 2013-10-10T19:34:35.812628+00:00 app[web.1]: Caused by: io.prismic.Api$Error: Got an HTTP error 401 (Unauthorized) 2013-10-10T19:34:35.812628+00:00 app[web.1]: at io.prismic.core.HttpClient.fetch(HttpClient.java:49) ~[io.prismic.java-kit-1.0-M2.jar:na] 2013-10-10T19:34:35.812391+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at controllers.Prismic$ActionImpl.call(Prismic.java:182) ~[prismicio-starter.prismicio-starter-1.0-SNAPSHOT.jar:1.0-SNAPSHOT] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90) ~[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2.applyOrElse(PlayDefaultUpstreamHandler.scala:261) [com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 2013-10-10T19:34:35.812628+00:00 app[web.1]: at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91) ~[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0]

dohzya commented 11 years ago

Thanks for reporting this issue, we're working on it!

guillaumebort commented 11 years ago

Hi,

Can you please try to build the HEAD java-kit and to use it along with this starter project (the version is M3-SNAPHSOT but you have to build it locally using mvn install) ? It should fix this issue.

dohzya commented 10 years ago

@castlechip Hi, did the new version fixed your problem?

rudyrigot commented 10 years ago

No answer in 5 months -> please reopen if the issue persists.