Coder Social home page Coder Social logo

networknt / light-example-4j Goto Github PK

View Code? Open in Web Editor NEW
148.0 148.0 66.0 10.35 MB

Example APIs or services to demo all feature of the light-4j framework

License: Apache License 2.0

Java 90.84% HTML 0.34% JavaScript 1.21% CSS 0.13% TypeScript 0.40% Shell 5.10% PLSQL 0.06% Dockerfile 1.85% Makefile 0.07% Lua 0.01%

light-example-4j's People

Contributors

birdstudiocn avatar cortwave avatar dependabot[bot] avatar gavinchenyan avatar greenlaw110 avatar hydra1983 avatar irus avatar jknack avatar jww0924 avatar mayurikasaxena avatar nicholasazar avatar stevehu 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  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

light-example-4j's Issues

Reproducible benchmarks

Which environment uses for benchmarks (OS, memory, cpu, java version)? What about moving benchmarks execution inside vm/containers with constant OS, resources for +- reproducible benchmarks?

update graphql mutation example port number

In the light-bot integration test, we need to use a different port for different servers so that they won't conflict each other. This is due to we have implemented the graceful shutdown in the server and the previous server might not have been shut down completely when you start another one with the same port.

Database examples are missing from repository

The documentation refers to some database examples, but they're missing from the repository.

They can be restored from git history with the following:

git checkout 2bd8e8c -- database

Seems like they need to be upgraded to the most recent version of light-4j. I could take a look at this if you want.

TODO_DB not found in tram todo-list single-module example

23:10:21.601 [main] ERROR com.networknt.tram.todolist.command.TodoRepositoryImpl - SqlException:
org.h2.jdbc.JdbcSQLException: Schema "TODO_DB" not found; SQL statement:
INSERT INTO todo_db.TODO (ID, TITLE, COMPLETED, ORDER_ID) VALUES (?, ?, ?, ?) [90079-176]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
	at org.h2.message.DbException.get(DbException.java:178)
	at org.h2.message.DbException.get(DbException.java:154)
	at org.h2.command.Parser.getSchema(Parser.java:655)
	at org.h2.command.Parser.getSchema(Parser.java:662)
	at org.h2.command.Parser.readTableOrView(Parser.java:5196)
	at org.h2.command.Parser.readTableOrView(Parser.java:5190)
	at org.h2.command.Parser.parseInsert(Parser.java:1024)
	at org.h2.command.Parser.parsePrepared(Parser.java:402)
	at org.h2.command.Parser.parse(Parser.java:306)
	at org.h2.command.Parser.parse(Parser.java:278)
	at org.h2.command.Parser.prepareCommand(Parser.java:243)
	at org.h2.engine.Session.prepareLocal(Session.java:442)
	at org.h2.engine.Session.prepareCommand(Session.java:384)
	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1188)
	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:276)
	at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:312)
	at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)
	at com.networknt.tram.todolist.command.TodoRepositoryImpl.save(TodoRepositoryImpl.java:77)
	at com.networknt.tram.todolist.CommandModuleTest.testUpdate(CommandModuleTest.java:56)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

java.lang.NullPointerException
	at com.networknt.tram.todolist.CommandModuleTest.testUpdate(CommandModuleTest.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

how can I use "docker exec" for light-4j containers?

Hi @stevehu ,
I can start some example light-4j from my localhost, but for docker container, I tried to "docker exec" into its container but no lucky.
I see that containers of light-4j inherits from insideo:uc-linux, and I found it support bash command line, I tried these things below:
docker exec -it bash
docker exec -it /bin/bash
docker exec -it /tools/bash

Can you shed some light on it? Thanks.

account-management example build issue

I followed the directions for the light-example-4j/eventuate/account-management/ demo. I got the following error. The error was consistent on a new Ubuntu VM as well as a Linux Mint laptop.

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 10 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 10 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Parent POM
[INFO] eventuate-account-common
[INFO] eventuate-account-command
[INFO] eventuate-account-query
[INFO] eventuate-account-e2etest
[INFO] eventuate-account-service
[INFO] eventuate-account-view-service
[INFO] eventuate-customer-service
[INFO] eventuate-customer-view-service
[INFO] eventuate-transaction-service
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Parent POM 0.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ light-eventuate-account ---
[INFO] Deleting /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.4.201502262128:prepare-agent (pre-unit-test) @ light-eventuate-account ---
[INFO] surefireArgLine set to -javaagent:/home/jtang/.m2/repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=destfile=/home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target/jacoco.exec
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.4.201502262128:report (post-unit-test) @ light-eventuate-account ---
[INFO] Skipping JaCoCo execution due to missing execution data file:/home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target/jacoco.exec
[INFO]
[INFO] --- maven-jar-plugin:2.6:test-jar (default) @ light-eventuate-account ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target/light-eventuate-account-0.1.0-tests.jar
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources @ light-eventuate-account >>>
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.4.201502262128:prepare-agent (pre-unit-test) @ light-eventuate-account ---
[INFO] surefireArgLine set to -javaagent:/home/jtang/.m2/repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=destfile=/home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target/jacoco.exec
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources @ light-eventuate-account <<<
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ light-eventuate-account ---
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.4:jar (attach-javadocs) @ light-eventuate-account ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ light-eventuate-account ---
[INFO] Installing /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/pom.xml to /home/jtang/.m2/repository/com/networknt/light-eventuate-account/0.1.0/light-eventuate-account-0.1.0.pom
[INFO] Installing /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/target/light-eventuate-account-0.1.0-tests.jar to /home/jtang/.m2/repository/com/networknt/light-eventuate-account/0.1.0/light-eventuate-account-0.1.0-tests.jar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building eventuate-account-common 0.1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.networknt:eventuate-common:jar:1.5.13 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.mockito:mockito-core:jar:2.1.0-beta.124 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ eventuate-account-common ---
[INFO] Deleting /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/common/target
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.4.201502262128:prepare-agent (pre-unit-test) @ eventuate-account-common ---
[INFO] surefireArgLine set to -javaagent:/home/jtang/.m2/repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=destfile=/home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/common/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ eventuate-account-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/common/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ eventuate-account-common ---
[INFO] Compiling 37 source files to /home/jtang/data/shared/light-4j/light-example-4j/eventuate/account-management/common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] error: error reading /home/jtang/.m2/repository/com/networknt/eventuate-common/1.5.13/eventuate-common-1.5.13.jar; error in opening zip file
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Parent POM ......................................... SUCCESS [ 1.223 s]
[INFO] eventuate-account-common ........................... FAILURE [ 0.406 s]
[INFO] eventuate-account-command .......................... SKIPPED
[INFO] eventuate-account-query ............................ SKIPPED
[INFO] eventuate-account-e2etest .......................... SKIPPED
[INFO] eventuate-account-service .......................... SKIPPED
[INFO] eventuate-account-view-service ..................... SKIPPED
[INFO] eventuate-customer-service ......................... SKIPPED
[INFO] eventuate-customer-view-service .................... SKIPPED
[INFO] eventuate-transaction-service ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.393 s
[INFO] Finished at: 2018-05-02T08:07:11-07:00
[INFO] Final Memory: 28M/399M
[INFO] ------------------------------------------------------------------------

remove demo example

This demo has been covered by the TechEmpower test cases and it is not necessary anymore.

petstore example in README.md does not run

It looks like the petstore example no longer runs with the described command:
java -jar target/codegen-cli.jar -f light-rest-4j -o ~/networknt/light-example-4j/rest/petstore -m ~/networknt/model-config/rest/petstore/swagger.json -c ~/networknt/model-config/rest/petstore/config.json

It looks like theconfig.json and swagger.json are at least in a 2.0.0 path under petstore. Even with that change though it fails.

The documentation on https://networknt.github.io/light-4j/example/petstore/ is also incomplete.

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.