Closed elharo closed 7 years ago
INFO: submitting command: /Users/elharo/google-cloud-sdk/bin/dev_appserver.py /Users/elharo/workspaces/runtime-gcloud-eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/bookshelf-standard-2 --host=localhost --port=8080 --admin_host=localhost --admin_port=8000 --max_module_instances=1 --automatic_restart=false
I was also perplexed by what's going on. After some time, I happened to open the Console view, and I see
google.appengine.api.yaml_errors.EventError: Unable to assign value '[YOUR-PROJECT-ID]' to attribute 'application':
Value '[YOUR-PROJECT-ID]' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
in "<string>", line 1, column 14:
application: '[YOUR-PROJECT-ID]'
^
Removing the <application>
element fixes that problem. Running locally works, but the app gives 503. It might be that the app needs further configuration. Not sure.
HTTP ERROR 503
Problem accessing /. Reason:
java.lang.IllegalStateException: Invalid storage type. Check if bookshelf.storageType property is set.
Caused by:
javax.servlet.UnavailableException: java.lang.IllegalStateException: Invalid storage type. Check if bookshelf.storageType property is set.
at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:415)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:458)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:268)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)
at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)
at com.google.appengine.tools.development.Modules.startup(Modules.java:105)
at com.google.appengine.tools.development.devappserver2.DevAppServer2Impl.doStart(DevAppServer2Impl.java:250)
at com.google.appengine.tools.development.devappserver2.DevAppServer2Impl.access$000(DevAppServer2Impl.java:52)
at com.google.appengine.tools.development.devappserver2.DevAppServer2Impl$1.run(DevAppServer2Impl.java:216)
at com.google.appengine.tools.development.devappserver2.DevAppServer2Impl$1.run(DevAppServer2Impl.java:214)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.devappserver2.DevAppServer2Impl.start(DevAppServer2Impl.java:214)
at com.google.appengine.tools.development.devappserver2.StandaloneInstance$StartAction.apply(StandaloneInstance.java:131)
at com.google.appengine.tools.development.devappserver2.StandaloneInstance$StartAction.apply(StandaloneInstance.java:83)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:47)
at com.google.appengine.tools.development.devappserver2.StandaloneInstance.run(StandaloneInstance.java:67)
at com.google.appengine.tools.development.devappserver2.StandaloneInstance.main(StandaloneInstance.java:45)
Powered by Jetty://
However, looking at the bookshelf doc, it sounds like it should just work:
Running the app on your local machine
To run the app locally:
- In the getting-started-java/bookshelf/2-structured-data directory, enter this command to start a local web server:
mvn -Plocal clean jetty:run-exploded -DprojectID=[YOUR-PROJECT-ID]
- In your web browser, navigate to http://localhost:8080
From the error message we seem to miss the bookshelf.storageType
property:
So the issue is like, dev_appserver doesn't import properties defined in pom.xml
? dev_appserver is independent of build systems and configurations, so basically users may need to provide properties to dev_appserver themselves when necessary? Or, could it be that the app is just broken?
It looks like some maven plugin uses the pom properties to fill in web.xml
as part of the build.
What are the steps to import this into Eclipse?
Please refer to http://stackoverflow.com/a/42954117/1927782 for steps on how to import the project.
Importing the bookshelf-2
has a number of problems.
com.google.cloud.samples:shared-configuration
parent) have switched to using the errorprone compiler which leads to configuration errors when importing the projects. This is arguably something we should fix.
com.google.cloud.samples:shared-configuration
as I did with https://github.com/GoogleCloudPlatform/appengine-plugins-core/pull/354 but this turns into a game of whackamole.versions-maven-plugin
(used in the appengine-standard-archetype
/HelloAppEngine archetype). But this only helps people who have CT4E installed.web.xml
quick-peek parser (JavaEEQuickPeek
), used by m2e-wtp during the import to associate various facets, and so m2e-wtp sets it to Servlet 3.1.web.xml
actually says it's 3.0, which isn't right for AES.web.xml
and so the ${bookshelf.storageType}
is never propagated. This is actually a bug in m2e-wtp Here there are two issues: first, m2e-wtp only checks if the maven-war-plugin configuration specifies the filteringDeploymentDescriptors
property, but it doesn't look for the maven.war.filteringDeploymentDescriptors
user property which is used in the bookshelf poms. This user property was removed from the maven-war-plugin
in 3.0.0 MWAR-376. But we're pulling in the default version 2.2.
maven-war-plugin
in the bookshelf parent pomHaving worked around the above, it works!
Still have this issue on MacOS with Maven 3.5.0
OK, I'll try to take a look at this.
Good Morning,
I have the same problem @chanseokoh Exception :
javax.servlet.UnavailableException: java.lang.IllegalStateException: Invalid storage type. Check if bookshelf.storageType property is set.
My POM bockshelf:
<parent> <!-- Only used for testing - NOT REQUIRED -->
<artifactId>getting-started-java</artifactId>
<groupId>com.example</groupId>
<version>1.0.0</version>
<relativePath>../</relativePath>
</parent>
<properties>
<jetty.maven.plugin>9.4.3.v20170317</jetty.maven.plugin>
<bookshelf.storageType>datastore</bookshelf.storageType> <!-- datastore or cloudsql -->
<sql.dbName>bookshelf</sql.dbName> <!-- A reasonable default -->
<bookshelf.bucket>SECRET</bookshelf.bucket> <!-- bucket you created earlier -->
<callback.host>SECRET</callback.host> <!-- Typically projectname.appspot.com -->
<bookshelf.clientID>SECRET</bookshelf.clientID> <!-- for User Authentication -->
<bookshelf.clientSecret>SECRET</bookshelf.clientSecret> <!-- from g.co/cloud/console -->
</properties>
<profiles>
What can be the cause of problem? The storageType
is properly set to datastore
.
The initial sample works for me now (which it didn't used to). How deep in the tutorial were you?
deployment works though I do get this warning:
Nov 07, 2017 10:18:14 AM com.google.cloud.tools.eclipse.appengine.standard.java8.AppEngineWebBuilder build
WARNING: P/bookshelf-standard-2: no build required: missing appengine-web.xml
Surprising since this is a Java 7 project.
I'm going to close this for now since I can't reproduce. If you can with the latest CT4E, please reopen with more details.
Sorry I wrong of Google Cloud plataform proyect.
Sorry for the annoy!
Just downloaded and setup all cloud on MacOS (latest) and see this error as well. What is the fix?
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00) Maven home: /.../apache-maven-3.5.2 Java version: 1.8.0_131, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.1", arch: "x86_64", family: "mac"
@nlonginow that is not an error message but what you get when you do mvn -version
.
@chanseokoh I think @nlonginow is saying he's encountering this issue (Bookshelf sample app fails to start on local server) and he's reporting his configuration :-)
@nlonginow what version of Eclipse are you running? There is a bug in m2e-wtp that was fixed for Oxygen.
Hi, I figured out how to run correctly Bookshelf on the app engine standard Environment
I´m actually running with this
Maven home: /Applications/apache-maven-3.6.1 Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/jre`
IDE: STS (Sprint Tool Suite), Platform: Eclipse 2018-09 (4.9.0)
First of all.
I updated some repo versions, because when I was runnign locally with
mvn -Plocal clean appengine:devserver
have some errors with JSTL and doesn´t compile
Original POM.xml bookshelf-standard/2-structured-data/pom.xml
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
my POm.xml Updated
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
I change <groupId><artifactID><version>
of these 3 dependencies becasuse the older ones were deprecated (Validated with Maven Repository).
And that`s it, works good
For the deploying the app in the App Engine Standard Environment
I updated appengine-web.xml
, it was running with java 7 and for App Engine was deprecated
Migrating from Java 7 to Java 8 Runtime
Then run the command
mvn appengine:update -Dappengine.appId=[YOUR-PROJECT-ID] -Dappengine.version=[YOUR-VERSION]
Where YOUR-PROJECT-ID is the name that appears in your console and [YOUR-VERSION] is the number of the version you want to release (Remove [] )
And obtained a BUILD SUCCESS and perfectly running in https://[YOUR-PROJECT-ID].appspot.com
not immediately clear why: