tag:blogger.com,1999:blog-785895453418216075.post1965753209035935365..comments2023-08-23T09:18:07.636-07:00Comments on Tug's Blog: Create and Deploy a JAX-RS REST service on Google App EngineTug Grallhttp://www.blogger.com/profile/12028480831632266604noreply@blogger.comBlogger32125tag:blogger.com,1999:blog-785895453418216075.post-12508723546201619332015-06-03T05:57:03.304-07:002015-06-03T05:57:03.304-07:00Hi,
I tried to implement JAX-RS rest service in ...Hi, <br /><br />I tried to implement JAX-RS rest service in the google app engine as documented above. Only difference is the Google App Engine version 1.9.21, JDK 1.7, jersey-bundle 1.15 jersey core 1.17. <br /><br />There are 2 asm jar 3.3.1 (jersey RS dependency) and 4.0 (from google app engine), may be this could be the reason for failure on the google server.<br /><br />Locally the service works using eclipse google plugin.manoj sharmahttps://www.blogger.com/profile/15002535929898597183noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-5512979364752569582015-05-26T09:45:23.009-07:002015-05-26T09:45:23.009-07:00maybe worth a try to add the following libs in the...maybe worth a try to add the following libs in the WEB-INF/lib folder:<br /> - jackson-annotations-2.3.2<br /> - jackson-module-jaxb-annotations-2.1.3<br /> - jersey-media-json-jackson-2.13<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-77441657607505805672015-02-09T01:47:55.621-08:002015-02-09T01:47:55.621-08:00Hi,
I just tried to implement JAX-RS rest service ...Hi,<br />I just tried to implement JAX-RS rest service in app engine.<br />This is working fine, if I am running in local environment, but when I am deploying this service in Google App Engine <br />http///rest/hr/employee<br />I am getting 500 Internal Server Error,<br />In the logs , I am not able to see the error.<br /><br />App Engine SDK: 1.19.17<br />JAX-RS jars-1.1.5<br />JAXB jars- 2.2.11Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-25641497852285921092015-01-15T23:52:04.847-08:002015-01-15T23:52:04.847-08:00Will you be posting the second part to this articl...Will you be posting the second part to this article any time soon? First part is very informative thanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-14054452538067486722014-11-15T23:40:42.681-08:002014-11-15T23:40:42.681-08:00Hi I tried implementing the following service.
Bt...Hi I tried implementing the following service.<br /><br />Btw, I had to add "Jersy jar" files also to make it work. because it was giving me compilation errors in <br /><br />import javax.ws.rs.Path;<br />import javax.ws.rs.GET;<br />import javax.ws.rs.Produces;<br /><br />Now the service runs on localhost perfectly.<br /><br />But when i deploy the application to google app engine, It doesn't work. I did tried the given url and several others too, to execute the rest service. <br /><br />Please help.Anonymoushttps://www.blogger.com/profile/10001493593839650100noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-52993661955149605772014-02-21T21:07:09.565-08:002014-02-21T21:07:09.565-08:00Hi Tug,
I tried the way you explained it. But I d...Hi Tug,<br /><br />I tried the way you explained it. But I did not get the right dependent jars and because of that its not running. DO you have the code and jars with you? If yes, would you please share that<br /><br />Regards<br />VishalVedaVyashttps://www.blogger.com/profile/11814594982593167605noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-34685636016813585762013-08-24T23:28:51.985-07:002013-08-24T23:28:51.985-07:00CM, which version of the SDK are you using?
Note ...CM, which version of the SDK are you using?<br /><br />Note that when I moved to SDK 1.8.x I completely remove JAX-RS and use my own REST services based on simple servlets. (too much dependencies issue with JDO, JAX-RS and ASM)<br /><br />It was faster for me to create a simple REST API with Servlet + Jackson<br /><br />tTug Grallhttps://www.blogger.com/profile/12028480831632266604noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-72220823833752587432013-08-14T08:38:10.521-07:002013-08-14T08:38:10.521-07:00I am getting following error though it works fine ...I am getting following error though it works fine locally. <br /><br />Uncaught exception from servlet<br />java.lang.IncompatibleClassChangeError: Implementing class<br /> at com.google.appengine.runtime.Request.process-cc7b6106c16d6f89(Request.java)<br /> at java.lang.ClassLoader.defineClass1(Native Method)<br /> at java.lang.ClassLoader.defineClass(ClassLoader.java:794)<br /> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)<br /> at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)<br /> at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br /> at java.lang.reflect.Method.invoke(Method.java:601)<br /> at java.lang.ClassLoader.loadClass(ClassLoader.java:359)<br /> at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79)<br /> at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)<br /> at com.sun.jersey.api.core.PackagesResourceConfig.(PackagesResourceConfig.java:78)<br /> at com.sun.jersey.api.core.PackagesResourceConfig.(PackagesResourceConfig.java:89)<br /> at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:696)<br /> at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)<br /> at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)<br /> at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)<br /> at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)<br /> at javax.servlet.GenericServlet.init(GenericServlet.java:212)<br /> at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)<br /> at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)<br /> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)<br /> at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)<br /> at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)<br /> at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)<br /> at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)<br /> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)<br /> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)<br /> at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:435)<br /> at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:442)<br /> at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:186)<br /> at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:306)<br /> at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:298)<br /> at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:439)<br /> at java.lang.Thread.run(Thread.java:722)<br /><br />I 2013-08-14 08:15:34.356<br /><br />This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.<br /><br />cmhttps://www.blogger.com/profile/13077857778436131890noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-37824721797506461632013-08-12T03:03:48.687-07:002013-08-12T03:03:48.687-07:00Clean and great.Clean and great.Technical Tipshttps://www.blogger.com/profile/11361726371671236608noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-11111096619125838702012-12-10T10:25:13.009-08:002012-12-10T10:25:13.009-08:00Great article .. Thank you very much Tug.Great article .. Thank you very much Tug.Anonymoushttps://www.blogger.com/profile/02630820126451965668noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-5664326948755642492012-12-10T03:23:54.018-08:002012-12-10T03:23:54.018-08:00Hi Tug, I have the exact same problem as Tim. I am...Hi Tug, I have the exact same problem as Tim. I am using Jersey-1.16, Appengine 1.7 and JRE 1.6.Roco Escalerahttps://www.blogger.com/profile/04526352010191196981noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-2037763259232206682012-11-13T21:25:22.339-08:002012-11-13T21:25:22.339-08:00Hello Tim,
Which error do you have in the log (on...Hello Tim,<br /><br />Which error do you have in the log (on the GAE console?). <br /><br />Which version on JAX-RS are you using? this post is quite old now and I have upgraded my application to Jersey 1.14 to avoid error related to some package not being in the GAE white listTug Grallhttps://www.blogger.com/profile/12028480831632266604noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-28759737905711133372012-11-13T18:29:32.305-08:002012-11-13T18:29:32.305-08:00hi, all works fine locally, but when I try to run ...hi, all works fine locally, but when I try to run it on GAE, when I press the link EmployeeService I get "Error: Server Error<br />The server encountered an error and could not complete your request.<br />If the problem persists, please report your problem and mention this error message and the query that caused it."<br /><br />and looking in the GAE Administrator Admin Logs it says "API serving not allowed for this application"<br /><br />I've searched for possible reasons for the error, and find suggestions that I need to sign up for Google's trusted tester programme!<br /><br />Is that really the case - not mentioned in this tutorial :-(<br /><br />Tim<br /><br />Timhttps://www.blogger.com/profile/04564969658322366508noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-33239854260407762442012-07-12T05:54:10.648-07:002012-07-12T05:54:10.648-07:00can I develop rest web service with out Google app...can I develop rest web service with out Google app enginepradeephttps://www.blogger.com/profile/14194555536562996509noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-38335406891715504602012-05-25T08:59:39.573-07:002012-05-25T08:59:39.573-07:00Thanks for the post. After getting me started wit...Thanks for the post. After getting me started with Jersey on GAE, hopefully this will enable me to build out a fully functional API.Pacehttps://www.blogger.com/profile/03710979728514592674noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-87944905787198878442012-05-25T08:58:29.586-07:002012-05-25T08:58:29.586-07:00Thanks for the post. It was really helpful to get...Thanks for the post. It was really helpful to get me started with Jerseyon GAE. I hope I will be able to build it out from here into a fully functional REST APIPacehttps://www.blogger.com/profile/03710979728514592674noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-76653895534738278742012-02-22T19:32:00.262-08:002012-02-22T19:32:00.262-08:00Hi,
any idea how i can learn the CRUD operations ...Hi,<br /><br />any idea how i can learn the CRUD operations for rest service on Google app engine??<br /><br />thanks a lot!<br />SidhantSidhant Jainhttps://www.blogger.com/profile/08744754787265727533noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-41186956664238360682012-02-19T23:48:56.813-08:002012-02-19T23:48:56.813-08:00Hello 8002E,
Are you sure that the JAXB jar is pa...Hello 8002E,<br /><br />Are you sure that the JAXB jar is packaged in your WAR file?<br /><br />For me this is just a packaging issue.<br /><br />TugTug Grallhttps://www.blogger.com/profile/12028480831632266604noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-85702976091135258642012-02-13T07:22:54.995-08:002012-02-13T07:22:54.995-08:00Tug,
I managed to get this working on my desktop ...Tug,<br /><br />I managed to get this working on my desktop without any JSON or XML support, I deployed it to appengine, which reported success, but when I try to run it I get the following error in the logs:<br /><br />java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector<br /><br />After a bit of trawling round the web I tried adding a copy of jaxb-impl-2.1.5.jar.<br /><br />This got things a bit further but then I got:<br /><br />Caused by: java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String).<br /><br />Not sure where to go from here, any ideas?8002Ehttps://www.blogger.com/profile/18305724173010299747noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-34386250379282837582012-02-13T07:22:52.583-08:002012-02-13T07:22:52.583-08:00Tug,
I managed to get this working on my desktop ...Tug,<br /><br />I managed to get this working on my desktop without any JSON or XML support, I deployed it to appengine, which reported success, but when I try to run it I get the following error in the logs:<br /><br />java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector<br /><br />After a bit of trawling round the web I tried adding a copy of jaxb-impl-2.1.5.jar.<br /><br />This got things a bit further but then I got:<br /><br />Caused by: java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on protected final java.lang.Class java.lang.ClassLoader.findLoadedClass(java.lang.String).<br /><br />Not sure where to go from here, any ideas?8002Ehttps://www.blogger.com/profile/18305724173010299747noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-40620932937270317672011-05-29T13:07:57.240-07:002011-05-29T13:07:57.240-07:00Really excellent tutorial! Thank you.
Will the nex...Really excellent tutorial! Thank you.<br />Will the next article on adding persistence and create a CRUD Rest service on Google App Engine be forthcoming? That looked very interesting indeed.GIMMESHELTERhttps://www.blogger.com/profile/09087075361849965402noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-23022277347546414832011-05-29T13:02:23.420-07:002011-05-29T13:02:23.420-07:00Kudos to the author for a great REST on GAE tutori...Kudos to the author for a great REST on GAE tutorial. It's just what I needed! And what of the CRUD Rest service on Google App Engine? Is this still to be forthcoming?GIMMESHELTERhttps://www.blogger.com/profile/09087075361849965402noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-10414414161943410952011-05-12T05:10:48.306-07:002011-05-12T05:10:48.306-07:00What about security ? Is there a way to secure the...What about security ? Is there a way to secure the WS using Google Accounts ?Ionut Scutaruhttps://www.blogger.com/profile/17272878481907776699noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-36942625235954581992011-03-23T09:07:22.765-07:002011-03-23T09:07:22.765-07:00With JAXB 2.2.3,
On GAE, we have to disable WADL g...With JAXB 2.2.3,<br />On GAE, we have to disable WADL generation on Jersey<br /><br /> <br /> com.sun.jersey.config.feature.DisableWADL<br /> true<br />07 <br /><br /><br />http://java.net/jira/browse/JERSEY-630Unknownhttps://www.blogger.com/profile/06448682494796984428noreply@blogger.comtag:blogger.com,1999:blog-785895453418216075.post-71771575701415945992011-02-06T11:18:12.456-08:002011-02-06T11:18:12.456-08:00Thanks so much for your post! It put me in the ri...Thanks so much for your post! It put me in the right direction when I've been having a frustrating time putting this together!Anonymousnoreply@blogger.com