Google App Engine + Jersey + IntelliJ Idea - google-app-engine

Okay so I'm having some annoying issue here. I am clearly missing something, and already been frustrating myself with this for the last 4-5 hours.
I cannot seem to be able to create a simple GAE+Jersey up and running with IntelliJ.
The frustrating part is that I do not get any errors, just that the REST service is not present after deployment.
I've tried out a few basic stuff, basically everything you can find on Google (and here).
After some frustration I've downloaded this project: https://github.com/BluerockInteractive/GAE-Jersey-Guice-Sample
Just cause this will list out the available servers, plus the deeper logging level.
Now here's the output of the AppEngine startup:
https://docs.google.com/open?id=0B42XvjSlpDCtTTdwQl9MSTBlQ0U
So my problem: The AppEngine is up and running. If I create a basic servlet everyting works fine. However, I cannot get Jersey to work. In every form I could try it always throws an
HTTP ERROR 404
Problem accessing /jerseyguicesample. Reason:
NOT_FOUND
Powered by Jetty://
Any ideas, what I could be missing here?
Here's an image of the IDE and the artifact settings: http://img51.imageshack.us/img51/7913/20120428124133.png
Thanks, :D

This example has REST handlers mapped to /rest/test, /rest/players/{name}/xml, /rest/players/{name}/json and /rest/hello.
What (and where) did you map /jerseyguicesample to?

Related

Google App Engine login fails with error 500

I have an appengine (Java) app with the ability to sign in via Google. For this I use
UserServiceFactory.getUserService().createLoginURL(...).
This has been working fine so far, and still works well locally (using mvn appengine:run) but on production it consistently throws a generic 500 while on /_ah/conflogin?state=~AJKiYcHHHXI45-... (the 5th URL of the login process, while already being logged in with Google) and I can find nothing relevant in the Logs Explorer at https://console.cloud.google.com/logs/...
I've since even updated to the latest https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk/2.0.10 but the problem remains.
Where should I look at to solve this issue?
To find the root cause of this issue, you can find the logs for this error will be helpful.
In this documentation there is a sample query that you could try to check for logs error with status 500.
resource.type="gae_app" AND
log_id("appengine.googleapis.com/request_log") AND
httpRequest.status>=500
Alternatively you could also try running ‘gcloud app logs read’ as mentioned in this document to see if you get any logs.
The issue tracker mentioned by Rez in comment is marked as Fixed and after checking your issue I think it also relates to the same issue tracker. As it closed I suggest to get your issue resolved I recommend to raise new issue tracker by referencing the fixed one or else you may raise support ticket with google

Intermittent authorization failure on publish

I am seeing an odd intermittent authorization failure on publish. My publisher is running on App Engine Standard (Python). Because of that, I am using the "old" python client library. So the code looks like this:
from googleapiclient.discovery import build
build('pubsub','v1').projects().topics().publish(topic=topic,body=body).execute()
This works just fine. The identity gets picked up and everything is authenticated. However, again intermittently, it will stop working and I get 403 forbidden errors. Then later it will start working again (even with the same topic and body). In the meantime, no code changes, no deployments.
I have had to wrap the publish to catch this error, throw it on a task queue and have the request repeat with decaying frequency until it finally starts working again a few hours later. This is OK in the very short term, but obviously this will not work for us.
To summarize, this is on the publish side, GAE Standard ... it works, then stops working, then works again.
Thanks for any insight or help.
It turns out, of course, that in fact there were deployments when I wasn't aware. So I thought, "no code change - no deployments", but there were deployments. And the issue was that the person making these deployments had an old library (or other dependency) for google_api_python_client. Once corrected, pubsub is working just fine.

How to resolve the "Unusual traffic" error with calls from appengine to gdata

App-engine CAPTCHA code
Googles GData is asking Google-app-engine for a CAPTCHA code.
How to enter a code OR reset things?
Error message
All has been working fine for about 1 year, but then I got this "Unusual traffic" error yesterday.
My logs show a link to the page: "Unusual traffic from your computer network"
i.e. support.google.com/websearch/answer/86640
What is also strange, almost all the errors are calls that "Write" to Gdata, most "Reads" work just fine.
The call to:
com.google.gdata.client.GoogleService.insert
causes the error:
com.google.gdata.util.ServiceException
I am using the gdata style spreadsheet API
Also the load has been low, load several times the current load has worked fine in the past.
Issue
I created an issue here: https://code.google.com/p/gdata-issues/issues/detail?id=6237
Took a few hours - but this worked:
a) Added the App-Engine IP addresses to support.google.com/websearch/contact/ban
b) Creating the issue in the GData issue tracker may have helped.
Is hard to be sure which of these resolved the problem, but is now working again.

Problems using Twitter4j on GAE throws 401 just after deploy

Well, I'm having a weird error here:
I'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message:
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.
message - Could not authenticate you
code - 32
I've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to "Write, Read and Direct Messages" and even assingning one Callback URL but nothing seems to work...
I've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.
I'm working with AppEngine 1.8.3 and Twitter4j 3.0.4
Iv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.
On some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...
Did someone had a clue?
Ok, the problem was me (and Twitter.... well..... I really think it was Twitter problem for being so dark on his api messages)...
On testing server I was looking for an existing account and on the cloud I was looking for an inexistent one. So, It was my mistake. But seriously, what about Twitter saying: "Access Forbidden"? That doesn't have any sense...

Google-app-engine Server: Error 500 on working code - deployment problems. Java code

I have this site, a random little one i just play around on with jsf and primefaces.
I have my own domain connected to it, and hosted it on google-app-engine...
It's been working as a charm right up until now. I have not done anything on the site due to vacation time, and suddenly the site is down? It was working when i deployed the last time, now when i go to my site i get this:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
It tells me absolutely nothing, i've tried to re deploy my app, after checking that it worked fine running locally. The first couple of time it just kept on waiting for a verify.. So i stopped it, which led me to learn how to do a rollback as i could not redeploy with the same version number after i stopped it the first time.
I got the rollback fixed, and i now deployed what i know i working code to the app-engine, and still when navigating to my site i get the above error? :S
I'm totally clueless here as the error doesn't really give me anything :S
Anyone have any ideas, i can post code etc. if necessary but something tells me that it is something else seeing that my code runs locally, and ran fine deployed too :S
You can find the log file for your web application at
https://appengine.google.com/logs?&app_id=yourappname
or on the Dashboard page in the list on the left side.
If you deploy a new version, also re-start the browser to clear old session data.
(Maybe you still get the 500 error still because of old session data).

Resources