Git Product home page Git Product logo

appengine-modules-sample-java's Introduction

status: inactive

This project is no longer actively developed or maintained.

For new work on this check out java-docs-samples and getting-started-java.

appengine-modules-sample-java

It has 2 web apps each deployed to a different module: guestbook and shardedcounter.

Usage (After changing the app id in the appengine-modules-ear/src/main/application/META-INF/appengine-application.xml):

git clone https://github.com/GoogleCloudPlatform/appengine-modules-sample-java.git
cd appengine-modules-sample-java
mvn install
cd appengine-modules-ear
#to test it locally:
mvn appengine:devserver
#or to deploy it:
mvn appengine:update

=============================

appengine-modules-sample-java's People

Contributors

ctesniere avatar lesv avatar ludoch avatar mattstep avatar nbashirbello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appengine-modules-sample-java's Issues

How to create this project in Eclipse

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?

modules doesn't respect dispatch.xml

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.

add gradle wrapper

It's bad practise to publish an example without the Gradle Wrapper because there might be compatibility issues between Gradle versions.

No default module specified

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.

mvn appengine:<anything> do not work: no plugin found

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?

Cronjob extension?

(Solved, nevermind, missed the logs)

Has someone been able to implement cronjobs with this example?

I can't seem to get it working.

  1. According to (https://cloud.google.com/appengine/docs/java/modules/), cron.xml should be in the default module. In this case \appengine-modules-guestbook\src\main\webapp\WEB-INF\cron.xml
  2. I have set up two cron entries in cron.xml. The first with url /cronhour with target 'shardedcounter'. The second cron has the url simply as /cronminute.
  3. This is where it gets confusing, should the servlet mappings be done at their respective modules? /cronminute declared in appengine-modules-guestbook\src\main\webapp\WEB-INF\web.xml and /cronhour delcared in appengine-modules-shardedcounter\src\main\webapp\WEB-INF\web.xml? Or should both be declared in the default?
  4. Referring to point 3, currently in this setup. The result seems to be that cronminute is always running but I don't see any logs of cronhour being run.

Can someone please advise? Thanks.

Errors when install

After 'mvn install', there are some error messages:


T E S T S

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

How do you suggest making development bearable with this setup?

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

Maven property ${appengine.app.version} get interpolated

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

TaskOptions isn't able to schedule tasks to modules

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.

Build & deploy to test server issue

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 .

Each module on its own port

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.

Error Updating Maven configuration - NPE

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.

Does queue target work?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.