Skip to content

403 on firebase-tictactoe example when trying first move #691

Closed
@nczempin

Description

@nczempin

In which file did you encounter the issue?

example project at /appengine/firebase-tictactoe

Did you change the file? If so, how?

I changed firebase_config.jspf to the code from the firebase console, as instructed.

Describe the issue

In the example /appengine/firebase-tictactoe, I cannot play a game, because when I click on any of the starting player's empty squares, the request
POST http://localhost:8080/move?gameKey=a3620663-5581-4ec5-8b63-0d955e458e0f
receives a
403 (Forbidden)
result:

send @ jquery.min.js:4
ajax @ jquery.min.js:4
r.(anonymous function) @ jquery.min.js:4
moveInSquare @ main.js:92
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
jquery.min.js:4

I can see some data for players in the firebase console.

My development machine is on Ubuntu-16.04.

I managed to get everything set up and can run "mvn appengine:run". All the tests pass, and the server starts up.

Upon calling localhost:8080, initially I got some errors about missing WEB-INF/view/firebase_config.jspf, which I resolved by manually copying that file to my target/appengine-firebase-tictactoe-1.0-SNAPSHOT/WEB-INF/view folder (from the one in src/). That is probably a separate issue, currently not my concern since I have the workaround.
``java.lang.RuntimeException: java.io.FileNotFoundException: WEB-INF/view/firebase_config.jspf (No such file or directory) at com.example.appengine.firetactoe.FirebaseChannel.<init>(FirebaseChannel.java:98) at com.example.appengine.firetactoe.FirebaseChannel.getInstance(FirebaseChannel.java:72) at com.example.appengine.firetactoe.Game.sendUpdateToUser(Game.java:124) at com.example.appengine.firetactoe.Game.sendUpdateToClients(Game.java:130) at com.example.appengine.firetactoe.TicTacToeServlet.doGet(TicTacToeServlet.java:87) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

I also see some warnings about directories:
[INFO] GCLOUD: WARNING: Your working directory, (/home/nczempin/git/java-docs-samples/appengine/firebase-tictactoe) is not equal to your [INFO] GCLOUD: web application root (/home/nczempin/git/java-docs-samples/appengine/firebase-tictactoe/target/appengine-firebase-tictactoe-1.0-SNAPSHOT) [INFO] GCLOUD: You will not be able to access files from your working directory on the production server.
I am not sure if these are relevant to the issue at hand.

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions