JSP not loading <script> and <link> content locally

97 views
Skip to first unread message

Bill Tricarico

unread,
Dec 7, 2016, 1:40:29 AM12/7/16
to Google App Engine
When I run mvn gcloud:run locally in IDEA, localhost:8080 does not resolve my <script> javascript includes and <link> css files.  I get 404s.
But when I deploy to appspot via mvn gcloud:deploy, everything resolves just fine.

Any ideas why this is happening locally?

Alex (Cloud Platform Support)

unread,
Dec 8, 2016, 2:11:09 PM12/8/16
to Google App Engine

Hi Bill,


In order for us to reproduce your error, it is important that you submit a Minimal Working Example of your code demonstrating the observed behaviour. Can you do this while making sure not to share any private information?


Also, using Maven 3.3.9 and Google Cloud SDK 137.0.0, I was able to run both of the referenced applications in the Bookshelf App for Java and Using Apache Maven tutorials.

Let me know if running “mvn -Plocal clean jetty:run-exploded -DprojectID=YOUR-PROJECT-ID” command solves your issue. (see here for more information)

Bill Tricarico

unread,
Dec 8, 2016, 2:38:18 PM12/8/16
to google-a...@googlegroups.com
When I run "mvn -Plocal clean jetty:run-exploded -DprojectID=my project ID" all I get is an automatic build failure:

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.921 s [INFO] Finished at: 2016-12-08T11:20:48-08:00 [INFO] Final Memory: 10M/155M [INFO] ------------------------------------------------------------------------ [WARNING] The requested profile "local" could not be activated because it does not exist. [ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/billt/.m2/repository)] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

I pulled down the pom.xml from the GAE developer tutorials after I created the AppEngine instance, as I figured that was the most relevant/current. It build and deployed to appspot with no problem. But of course it was a servlet and had no JSP content.

The problem is that the GAE general docs and the developer tutorials built into GAE seem very inconsistent to me.

What I will do is try the Bookshelf example since it uses JSPs. All I really have is a single JSP to launch my SPA, the rest is servlet driven.

If all else fails, I can always try node ;)

Also, how do I actually debug this in IDEA? Every example says to do mvn:run but what if I have breakpoints in my project that I need to test on the servlet side? The Google docs do not mention specfic IDE scenarios at all. It's all command-line driven.

Thanks,
Bill

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/y2Ko6qaXZlU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/0f4d937c-59c3-45cf-b782-e4818e23ff36%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Alex (Cloud Platform Support)

unread,
Dec 9, 2016, 5:57:26 PM12/9/16
to Google App Engine

In fact, the rapid evolution of GAE products may not always be updated accordingly with the available documentation across the platform.


Concerning your questions about debugging App Engine applications using Third-Party IDE’s, there is in fact several options that you might be interested in. First, Cloud Tools for IntelliJ are available on the Cloud Platform and here is the Using Stackdriver Debugger tutorial that you can use to debug live application running in the Cloud. Note that this is a Beta release of Stackdriver Debugger in IntelliJ IDEA. This feature might be changed in backward-incompatible ways and is not subject to any SLA or deprecation policy.


Then, this Third-Party site proposes another way to Run/Debug the configuration of your Google App Engine Deployment.


As another alternative, it is possible to use the Google Stackdriver Debugger feature of the Cloud Platform to debug your application in production directly from the console. Here is the Quickstart for App Engine tutorial that shows how to do it.


Lastly, let me know if the Bookshelf App for Java tutorial helps you in solving your issue. And if it doesn’t, I would need you to provide the previously referenced Minimal Working Example of your code in order to investigate your issue further.

Reply all
Reply to author
Forward
0 new messages