googlecloudplatform / appengine-modules-sample-java Goto Github PK
View Code? Open in Web Editor NEWApp Engine Modules usage, packaged as an EAR (Entreprise Archive) Maven project
License: Apache License 2.0
App Engine Modules usage, packaged as an EAR (Entreprise Archive) Maven project
License: Apache License 2.0
The same configuration that works for backends doesn't work with modules:
myTaskOptionsInstance.header("Host", ModulesServiceFactory.getModulesService().getModuleHostname("mymodulename", modulesApi.getDefaultVersion("mymodulename"))
please show in the sample how to schedule tasks to modules.
(Solved, nevermind, missed the logs)
Has someone been able to implement cronjobs with this example?
I can't seem to get it working.
Can someone please advise? Thanks.
I followed the simple instructions on the readme: clone; cd; mvn appengine:devserver
Then I get a build failure with the following error:
[ERROR] No plugin found for prefix 'appengine' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local, central] -> [Help 1]
Is there anything I'm missing or this is indeed not working anymore?
I have a 6 module setup and it takes more than 2 minutes to compile everything and run all the servers.
How would you suggest to make development bearable with this kind of setup? I'm at the point of migrating the HTML building frontend part to PHP and accessing this bulky module setup by API.
thanks
According to the Google Documentation there is supposed to be at least one default module:
The default module
Every application must have a single default module. To define the default module, include the setting default in the module's appengine-web.xml file, or leave the setting out.
Also be sure to list the default module as the first module in the EAR directory's META-INF/application.xml file, as shown in the example below.
source: https://cloud.google.com/appengine/docs/java/modules/
However, both modules have an tag in their appengine-web.xml file.
My solution was to remove the tag from one of the modules, as documented here: http://stackoverflow.com/a/26767693/2848676
Tagging author @ludoch for comment.
Having a queue targeting shardecounter
module:
<queue>
<name>counter-queue</name>
<rate>100/s</rate>
<bucket-size>50</bucket-size>
<mode>push</mode>
<target>shardedcounter</target>
</queue>
And then calling this code in the default module (appengine-modules-guestbook
)
Queue queue = QueueFactory.getQueue("counter-queue");
queue.add(TaskOptions.Builder.withUrl("/worker").param("key", "testing"));
It doesn't go to sharedcounter
module but it keeps trying the default module:
[INFO] INFO: Returning NOBODY because of SkipAdminCheck.
[INFO] Feb 24, 2016 2:50:38 PM com.google.appengine.api.taskqueue.dev.UrlFetchJob execute
[INFO] INFO: Web hook at http://127.0.0.1:8080/worker/ returned status code 404. Rescheduling...
Is there any way to make this queue target
configuration to work?
The file appengine-application.xml contains:
google.com:ludovmengine
What is the prefix google.com:
for?
It gave me an error so I removed it and I was able to upload. The problem and solution are posted here: http://stackoverflow.com/a/26766324/2848676.
The pom.xml files for the modules seem to be missing a <configuration>
section for this plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
</plugin>
That's preventing a substitution of ${appengine.app.version} from happening in appengine-web.xml. I've described the problem in more detail here: http://stackoverflow.com/questions/27475714/why-doesnt-maven-property-appengine-app-version-get-interpolated-in-multi-mo/27475715
What I notice is that the version number is just hard coded in appengine-web.xml: https://github.com/GoogleCloudPlatform/appengine-modules-sample-java/blob/master/appengine-modules-shardedcounter/src/main/webapp/WEB-INF/appengine-web.xml:
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>yet-another-sharded-counter</application>
<version>1</version>
<threadsafe>true</threadsafe>
<module>shardedcounter</module>
</appengine-web-app>
I'd like to propose to you the solution I've documented on stackoverflow: http://stackoverflow.com/a/27475715/2848676
I'm using eclipse 4.4.1 with the gae eclipse plugins.
After I downloaded your project, eclipse tells me that the project configuration is not up to date. When I try to update it (maven -> update project) I get a NPE.
Actually I think it's a bug within eclipse, but maybe you have some ideas on how to address it?
Thanks in advance.
It's bad practise to publish an example without the Gradle Wrapper because there might be compatibility issues between Gradle versions.
Hi,
is it possible to specify a port number to each module?
For now I have managed to set port for default module, the other one gets a random port.
It would be nice to have a more complete example that isn't just a hello world.
The current modules sample doesn't expose the dispatch.xml configuration that actually doesn't work at developing time.
Modules make developer's life a living hell because it doesn't allow us to run and debug the project on a rather complex multi module.
Hi, I'd like to know how to just update one module instead the whole ear.
Thanks in advance
After 'mvn install', there are some error messages:
Forking command line: cmd.exe /X /C ""C:\Program Files\Java\jre1.8.0_25\bin\java" -jar C:\Users\James\Documents\dev\CardDefense\Server\appengine-modules-sample-java-master\appengine-modules-guestbook\target\surefire\surefirebooter4813219224560267512.jar C:\Users\James\Documents\dev\CardDefense\Server\appengine-modules-sample-java-master\appengine-modules-guestbook\target\surefire\surefire25565902430025426tmp C:\Users\James\Documents\dev\CardDefense\Server\appengine-modules-sample-java-master\appengine-modules-guestbook\target\surefire\surefire_01718481748581354868tmp"
Running com.google.appengine.demos.guestbook.GuestbookServletTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.228 sec <<< FAILURE!
testDoGet(com.google.appengine.demos.guestbook.GuestbookServletTest) Time elapsed: 1.021 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<Hello, test[]
but was:<Hello, test[
]at junit.framework.Assert.assertEquals(Assert.java:85) at junit.framework.Assert.assertEquals(Assert.java:91) at com.google.appengine.demos.guestbook.GuestbookServletTest.testDoGet(GuestbookServletTest.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running com.google.appengine.demos.guestbook.SignGuestbookServletTest
十月 29, 2014 7:42:33 上午 com.google.appengine.api.datastore.dev.LocalDatastoreService init
資訊: Local Datastore initialized:
Type: Master/Slave
Storage: In-memory
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.559 sec
I have been having this issue of creating a project with modules one for backend processing and one for the web front , however i keep getting this AppConfigException about my endpoints directory not being available .
The application actually builds but when it comes to deploying to the appengine development server there are issues .
This looks like an ear maven project. According to this documentation: https://cloud.google.com/appengine/docs/java/webtoolsplatform#enterprise_application_ear
this is not supported.
"Note: Currently, only Maven WAR projects are supported, not Maven EAR projects"
Also, the directory structure differs from the module overview documentation.
https://cloud.google.com/appengine/docs/java/modules/
Is this the suggested way to set up an app engine project using modules, or should we use the way in the documentation? How do we convert an old project in Eclipse?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.