vlingo / xoom-schemata Goto Github PK
View Code? Open in Web Editor NEWThe VLINGO XOOM Schema Registry.
Home Page: https://vlingo.io
License: Mozilla Public License 2.0
The VLINGO XOOM Schema Registry.
Home Page: https://vlingo.io
License: Mozilla Public License 2.0
When POSTing a schema version like this
POST http://localhost:9019/organizations/{{orgId}}/units/{{unitId}}/contexts/{{contextId}}/schemas/{{schemaId}}/versions
Content-Type: application/json
{
"organizationId": "{{orgId}}",
"unitId": "{{unitId}}",
"contextId": "{{contextId}}",
"schemaId": "{{schemaId}}",
"schemaVersionId": "",
"description": "Initial revision.",
"status": "Published",
"previousVersion": "0.0.0",
"currentVersion": "1.0.0"
}
The server returns 201 Created.
However, when querying afterwards, no versions are returned.
### Schema Versions of Schema
GET http://localhost:9019/organizations/{{orgId}}/units/{{unitId}}/contexts/{{contextId}}/schemas/{{schemaId}}/versions
Accept: application/json
The API calls can be found in rest-api-calls.http
The following GET
will crash in the compiler.
curl -i -X GET -H "Accept: application/json" http://localhost:9019/code/{reference}/{language}
Concrete example:
Org:Unit:Context:Schema:Version
E.g. /code/vlingo:PlatformDevelopment:io.vlingo.schemata:SchemaDefined:1.0.0/java
This is due to two problems:
SchemaVersion
has a dependency on another named SchemaVersion
there is no way to resolve that dependency type.CacheTypeResolver
Currently, the only validation is that the Create
button is only enabled if all fields are filled.
Vuetify has nice helpers for validation: https://vuetifyjs.com/en/components/forms
We can use it to e.g. check for syntactically valid version numbers and illegal chars in names, so the user has faster and more helpful feedback and the server isn't bothered to try things we already know to be invalid on the client.
Journal
for Event SourcingJournal
writes and reads for vlingo/schemataWhen creating a new Schema Version w/ incompatible previousVersion
and currentVersion
, an exception is thrown on the server but the HTTP request does not finish and report the error. The request times out eventually.
Example request (assuming Organization, Unit, Context and Schema exist):
POST http://localhost:9019/organizations/{{orgId}}/units/{{unitId}}/contexts/{{contextId}}/schemas/{{schemaId}}/versions
Content-Type: application/json
{
"organizationId": "{{orgId}}",
"unitId": "{{unitId}}",
"contextId": "{{contextId}}",
"schemaId": "{{schemaId}}",
"schemaVersionId": "",
"description": "Initial revision.",
"specification": "event SchemaDefined { type eventType }",
"status": "Published",
"previousVersion": "1.0.1",
"currentVersion": "1.0.0"
}
Exception on the server:
11:17:42.520 [pool-2-thread-12] ERROR io.vlingo.actors.Logger - Exception thrown by Resource execution
java.lang.IllegalArgumentException: Versions are incompatible: previous: 1.0.1 next: 1.0.0
at io.vlingo.schemata.model.SchemaVersion.with(SchemaVersion.java:48) ~[classes/:na]
at io.vlingo.schemata.model.SchemaVersion.with(SchemaVersion.java:33) ~[classes/:na]
at io.vlingo.schemata.resource.SchemaVersionResource.defineWith(SchemaVersionResource.java:58) ~[classes/:na]
at io.vlingo.http.resource.RequestHandler5.lambda$null$2(RequestHandler5.java:83) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestExecutor.executeRequest(RequestExecutor.java:23) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestHandler5.lambda$handle$3(RequestHandler5.java:83) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestHandler5.lambda$execute$6(RequestHandler5.java:112) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestExecutor.executeRequest(RequestExecutor.java:23) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestHandler5.lambda$execute$7(RequestHandler5.java:113) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestHandler.runParamExecutor(RequestHandler.java:55) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.RequestHandler5.execute(RequestHandler5.java:113) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.DynamicResource.lambda$dispatchToHandlerWith$0(DynamicResource.java:44) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.ResourceRequestHandlerActor.handleFor(ResourceRequestHandlerActor.java:28) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.http.resource.ResourceRequestHandler__Proxy.lambda$handleFor$0(ResourceRequestHandler__Proxy.java:32) ~[vlingo-http-0.8.9.jar:na]
at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:115) ~[vlingo-actors-0.8.9.jar:na]
at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:47) ~[vlingo-actors-0.8.9.jar:na]
at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:101) ~[vlingo-actors-0.8.9.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
Use the vlingo logo for favicon.
Right now the io.vlingo.schemata.query.SchemaVersionQueriesActor#resolve method is not fully implemented because it doesn't resolve correctly a type based on it's full qualified name.
We need to create a new query that will find the IDs:
based on their names, so the type can be resolved in the TBL_SCHEMAVERSIONS table.
For updates to the schema version's description, an Exception is thrown:
08:33:28.235 [pool-2-thread-7] ERROR io.vlingo.actors.Logger - Default before resume recovery after: Invalid UUID string: 6ffcb30e-53c1-4ca7-8164-476fbc4e7da6/contexts/f4f8795d-6647-474b-8daf-a3250e83bbba/schemas/2e561b9b-7eb5-4ac6-819d-cec3bc56885f/versions/8b51a3e0-a4f6-4dbc-9080-b5e9bdff78f2
java.lang.IllegalArgumentException: Invalid UUID string: 6ffcb30e-53c1-4ca7-8164-476fbc4e7da6/contexts/f4f8795d-6647-474b-8daf-a3250e83bbba/schemas/2e561b9b-7eb5-4ac6-819d-cec3bc56885f/versions/8b51a3e0-a4f6-4dbc-9080-b5e9bdff78f2
at java.util.UUID.fromString(UUID.java:194) ~[na:1.8.0_212]
at io.vlingo.lattice.grid.GridAddressFactory.from(GridAddressFactory.java:45) ~[classes/:na]
at io.vlingo.lattice.router.RoutableCommand.handleWithin(RoutableCommand.java:191) ~[classes/:na]
at io.vlingo.lattice.router.CommandRouterWorkerActor.route(CommandRouterWorkerActor.java:32) ~[classes/:na]
at io.vlingo.lattice.router.CommandRouter__Proxy.lambda$route$0(CommandRouter__Proxy.java:32) ~[classes/:na]
at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:115) ~[classes/:na]
at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:47) ~[classes/:na]
at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:101) ~[classes/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
It seems that instead of describeAs
in SchemaVersionCommands
, the command of the same name in UnitCommands
is called. I currently can't see where this comes from.
To reproduce, create an org/unit/context/schema/schemaVersion and request the following:
PATCH http://localhost:9019/organizations/{{orgId}}/units/{{unitId}}/contexts/{{contextId}}/schemas/{{schemaId}}/versions/{{schemaVersionId}}/description
Content-Type: application/json
with a body of updated description
.
Note that the content type needs to be application/json
instead of text/plain
, see vlingo/xoom-http#49
The analogue to update a schema version specification works as expected:
PATCH http://localhost:9019/organizations/{{orgId}}/units/{{unitId}}/contexts/{{contextId}}/schemas/{{schemaId}}/versions/{{schemaVersionId}}/specification
Content-Type: application/json
updated spec
Interesting to note that it calls a command of the same name but in a different class. The handler does reference the correct command in SchemaVersion commands.
Currently, when executing an invalid schema version state transition via the API, the request returns 200 but does not execute the transition.
To reproduce, PATCH
a body of Published
against /organizations/<O>/units/<U>/contexts/<C>/schemas/<S>/versions/<V>/status
of a version that is already deprecated or removed.
Since 6ddcf3d#diff-ebfbce655b794498a2b1f38cf4dacb6cR68, we see an compilation error in TypeDefinitionCompiler
:
... TypeDefinitionCompiler.java:[68,64] incompatible types: io.vlingo.schemata.query.SchemaVersionQueries cannot be converted to io.vlingo.schemata.codegen.processor.types.TypeResolver
This is b/c, while SchemaQueriesActor
implements TypeResolver
, SchemaQueries
doesn't.
After the recent updates to vlingo-wire
(I suspect somewhere around vlingo/xoom-wire#13 and vlingo/xoom-wire@12f372d...10c9ded ), the server consumes roughly 4GB of memory. Trying to start the server w/ less memory leads to failures like in the exception below.
After giving the server 3.8G Xmx, startup works as expected.
This occured first in CircleCI b/c the server is killed by the system for consuming too much memory. After setting -Xmx
to sth. below 3800m
, the following exceptions are thrown.
java.lang.IllegalArgumentException: Actor instantiation failed because: ActorFactory failed actor creation for: Address[id=9223372036854775803, name=(none)]
at io.vlingo.actors.Stage.createRawActor(Stage.java:659)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
Caused by: java.lang.InstantiationException: ActorFactory failed actor creation for: Address[id=9223372036854775803, name=(none)]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:139)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
... 8 more
Exception in thread "main" java.lang.NullPointerException
at io.vlingo.actors.Stage.actorFor(Stage.java:152)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
Currently, most things the UI requires are queried from the backend each time they are required.
This includes:
While this makes state management between client and server easier, it is more chatty then stricly required.
Since the payloads are rather small, this is not a big issue now, but we should probably discuss the trade-off between state management complexities and responsiveness of the UI and network load.
Generated sources should be visible and downloadable via the UI.
Right now the compiler does not support default values for basic types. You can take a look at the syntax in #22.
*.redefineWith
handlersSince the update to 0.9.1-RC2
, most unit tests in schemata fail with the exception below.
It seems the Grid
c'tor has been replaced by static factory methods in this version as of vlingo/xoom-lattice@d1de410 which is still used in actors.World
: https://github.com/vlingo/vlingo-actors/blob/master/src/main/java/io/vlingo/actors/World.java#L430
java.lang.IllegalStateException: World cannot create new stage: vlingo-schemata-grid because: io.vlingo.lattice.grid.Grid.<init>(io.vlingo.actors.World, io.vlingo.actors.AddressFactory, java.lang.String)
at io.vlingo.actors.World.stageNamed(World.java:439)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:37)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.BootstrapTest.testThatBootstrapStartsServerCleanly(BootstrapTest.java:18)
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:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
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)
Caused by: java.lang.NoSuchMethodException: io.vlingo.lattice.grid.Grid.<init>(io.vlingo.actors.World, io.vlingo.actors.AddressFactory, java.lang.String)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at io.vlingo.actors.World.stageNamed(World.java:430)
... 25 more
Right now, neither the ANTLR4 parser nor the code generator support array types. Array types can be from any other basic type, but there are two constraints:
int[] array = {1, 2, 3}
If a node is opened in the schema treeview, the loading icon flashes and the data is loaded in the background.
However, the node is not expanded and you need to click again to open it.
Implement E2E tests using https://www.cypress.io
We should at least test the following
The tests should run against a containerized version of the application so we can easily run it in CI builds
Accessing non-existing resources just hangs w/o sending HTTP 404
response code.
io.vlingo.symbio.store.StorageException
exception is thrown containing the message: No object identified by expression.
Currently, both the editor and the display support markdown formatting.
As (I think) the description will be rendered into the generated code's comments, we need to make sure that this does not break the target syntax.
This is also true for arbitrary comments.
Currently, a schema version of maj.min+1.patch
or maj+1.min.patch
cannot be created if preceeded by maj.min.patch
in status Draft
. A version of maj.min.patch+1
can be created.
It is not entirely clear to me what the actual business rules encompassing previousVersion
, currentVersion
and status
should be.
When adding a new SchemaVersion
with a major version pre-existing on an earlier SchemaVersion
, the new version specification must be backward compatible with the former, and the former forward compatible with the latter.
Example:
Existing: SchemaVersion (1.0.0)
New: SchemaVersion (1.1.0)
SchemaVersion (1.1.0)
must be backward compatible with SchemaVersion (1.0.0)
and SchemaVersion (1.0.0)
must be forward compatible with SchemaVersion (1.1.0)
.
This basically means:
These can all be determined by comparing the parsed results of both versions.
This may not be the best choice for long-term, but currently it will help to simplify the queries for the source code requests and compiler seeking complex type dependencies.
After invetigating #64, it seems that updating persistent objects in schemata is broken in general.
If it is not and I'm just missing sth., I'd be very happy, so please to correct me if this is wrong.
Tests in io.vlingo.schemata.infra.persistence.SchemataObjectStoreTest
seem to work, but the assertions currently used are too weak to uncover the issue.
Currently, it is only checked that the updated and the expected object are different, e.g. here: https://github.com/vlingo/vlingo-schemata/blob/master/src/test/java/io/vlingo/schemata/infra/persistence/SchemataObjectStoreTest.java#L178
When additionally asserting the updated fields like below, the tests fail.
assertEquals(updatedContextState.namespace, ((ContextState) queryInterest.singleResult.get().stateObject).namespace);
assertEquals(updatedContextState.description, ((ContextState) queryInterest.singleResult.get().stateObject).description);
Now, in HSQLDB against which the tests run, the unique constraints are turned off.
When running the test against Postgres (SchemataObjectStore.instance("
dev prod");
in https://github.com/vlingo/vlingo-schemata/blob/master/src/test/java/io/vlingo/schemata/infra/persistence/SchemataObjectStoreTest.java#L265), the tests fails with unique constraint violations like ERROR: duplicate key value violates unique constraint "context_parent_index" Detail: Key (organizationid, unitid)=(A343, U44) already exists.
After disabling the constaints, we see that actually a second row is inserted instead of the existing one being updated:
For ObjectStore
s, this shouldn't be the case, right?
Probably the root cause of #64.
Design and Create Queries for Hierarchy Navigation
A TypeResolver is a class that needs to be implemented so the compiler can find out which types are custom types defined in schemata. Right now there is no implementation of it, so the compiler itself is unusable in a real environment.
InMemoryTypeResolver
has been temporarily moved to src/main
so the compiler will work for end-to-end tests.While we could have users write their schema version descriptions in markdown in a textarea, we could also integrate an editor w/ buttons for the casual markdowner & a preview.
There are already components out there that would work, but I haven't used them and can't say anything about their quality. E.g. https://github.com/DCsunset/vuetify-markdown-editor
OTOH, if we implement #34, we could probably use this editor for both the schema version spec and the description.
Patching against io.vlingo.schemata.resource.SchemaVersionResource#specifyWith creates a new row in HSQL and throws a unique constraint violated exception in Postgres.
Currently, when requesting code for a specification that cannot be parsed,
the request hangs w/ sth. like the exception below.
We should return an HTTP error response in this case.
12:08:07.622 [pool-2-thread-4] DEBUG io.vlingo.actors.Logger - COMPILING: khlkjljlk
line 1:4 mismatched input 'khlkjljlk' expecting {'command', 'data', 'document', 'envelope', 'event', 'metadata'}
12:08:07.656 [pool-2-thread-6] ERROR io.vlingo.actors.Logger - Message#deliver(): Exception: null for Actor: Actor[type=AntlrTypeParser address=GridAddress[id=6834f14a-f3a2-4c24-83da-b86420060825, name=(none)]] sending: parseTypeDefinition(java.io.InputStream, java.lang.String)
java.lang.NullPointerException: null
at io.vlingo.schemata.codegen.parser.AntlrTypeParser.parseTypeDeclaration(AntlrTypeParser.java:68) ~[classes/:na]
at io.vlingo.schemata.codegen.parser.AntlrTypeParser.parseTypeDefinition(AntlrTypeParser.java:51) ~[classes/:na]
at io.vlingo.schemata.codegen.parser.TypeParser__Proxy.lambda$parseTypeDefinition$0(TypeParser__Proxy.java:29) ~[classes/:na]
at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:115) ~[classes/:na]
at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:47) ~[classes/:na]
at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:101) ~[classes/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
12:08:07.656 [pool-2-thread-6] ERROR io.vlingo.actors.Logger - DefaultSupervisorOverride: Failure of: GridAddress[id=6834f14a-f3a2-4c24-83da-b86420060825, name=(none)] because: null Action: Resuming.
java.lang.NullPointerException: null
at io.vlingo.schemata.codegen.parser.AntlrTypeParser.parseTypeDeclaration(AntlrTypeParser.java:68) ~[classes/:na]
at io.vlingo.schemata.codegen.parser.AntlrTypeParser.parseTypeDefinition(AntlrTypeParser.java:51) ~[classes/:na]
at io.vlingo.schemata.codegen.parser.TypeParser__Proxy.lambda$parseTypeDefinition$0(TypeParser__Proxy.java:29) ~[classes/:na]
at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:115) ~[classes/:na]
at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:47) ~[classes/:na]
at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:101) ~[classes/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_212]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
Due to the current versioning scheme, the contents of a non-SNAPSHOT dependency might change (for a thorough discussion see vlingo/xoom-actors#17).
With artifacts being cached either in .m2
or in proxies on the way from central to where ever the build runs, this leads to flakey builds.
To work around this until the mentionend issue is resolved, we just build the dependencies freshly in CI on each build
After pulling the changes of all dependencies (updates between 2019-10-30 and 2019-11-08), the server fails to start with the exception below.
The corresponding test io.vlingo.schemata.BootstrapTest#testThatBootstrapStartsServerCleanly
also fails.
I checked whether the Definition
args match the Actor's c'tor as indicated in the exception, but they do, see screenshot below.
Instead, the exception seems to be thrown during initialization of ServerActor
from the Actor
super c'tor when trying to create a new TestEnvironment
. In io/vlingo/actors/testkit/TestEnvironment.java:17
, TestWorld.Instance.get().world().stage()
throws an NPE as TestWorld.Instance.get()
returns null
.
This happens in the unit tests as well as when running the application in dev
or prod
modes. In the latter cases, is it correct that no ActorFactory.threadLocalEnvironment
is found?
java.lang.IllegalArgumentException: Actor instantiation failed because: ActorFactory failed actor creation for: Address[id=101, name=(none)]
at io.vlingo.actors.Stage.createRawActor(Stage.java:659)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:406)
at io.vlingo.actors.Actor.childActorFor(Actor.java:181)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.startProcessors(ServerRequestResponseChannelActor.java:161)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.<init>(ServerRequestResponseChannelActor.java:44)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannel.start(ServerRequestResponseChannel.java:54)
at io.vlingo.http.resource.ServerActor.<init>(ServerActor.java:83)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
Caused by: java.lang.InstantiationException: ActorFactory failed actor creation for: Address[id=101, name=(none)]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:139)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
... 31 more
java.lang.IllegalArgumentException: Actor instantiation failed because: ActorFactory failed actor creation for: Address[id=9223372036854775802, name=server-request-response-channel]
at io.vlingo.actors.Stage.createRawActor(Stage.java:659)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannel.start(ServerRequestResponseChannel.java:54)
at io.vlingo.http.resource.ServerActor.<init>(ServerActor.java:83)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
Caused by: java.lang.InstantiationException: ActorFactory failed actor creation for: Address[id=9223372036854775802, name=server-request-response-channel]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:139)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
... 19 more
java.lang.IllegalArgumentException: Actor instantiation failed because: ActorFactory failed actor creation for: Address[id=9223372036854775803, name=(none)]
at io.vlingo.actors.Stage.createRawActor(Stage.java:659)
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448)
at io.vlingo.actors.Stage.actorFor(Stage.java:143)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
Caused by: java.lang.InstantiationException: ActorFactory failed actor creation for: Address[id=9223372036854775803, name=(none)]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:139)
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75)
at io.vlingo.actors.Stage.createRawActor(Stage.java:656)
... 8 more
Exception in thread "main" java.lang.NullPointerException
at io.vlingo.actors.Stage.actorFor(Stage.java:152)
at io.vlingo.http.resource.Server.startWith(Server.java:111)
at io.vlingo.http.resource.Server.startWith(Server.java:81)
at io.vlingo.http.resource.Server.startWith(Server.java:60)
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68)
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87)
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96)
13:27:13.779 [pool-2-thread-5] ERROR io.vlingo.actors.Logger - ActorFactory: failed actor creation. This is sometimes cause be the constructor parameter types not matching the types in the Definition.parameters(). Often it is caused by a failure in the actor constructor. We have attempted to uncover the root cause here, but that may not be available in some cases.
The root cause may be: java.lang.NullPointerException
See stacktrace for more information. We strongly recommend reviewing your constructor for possible failures in dependencies that it creates.
java.lang.NullPointerException: null
at io.vlingo.actors.testkit.TestEnvironment.<init>(TestEnvironment.java:17) ~[classes/:na]
at io.vlingo.actors.Actor.<init>(Actor.java:162) ~[classes/:na]
at io.vlingo.wire.channel.SocketChannelSelectionProcessorActor.<init>(SocketChannelSelectionProcessorActor.java:49) ~[classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116) ~[classes/:na]
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75) ~[classes/:na]
at io.vlingo.actors.Stage.createRawActor(Stage.java:656) ~[classes/:na]
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448) ~[classes/:na]
at io.vlingo.actors.Stage.actorFor(Stage.java:406) ~[classes/:na]
at io.vlingo.actors.Actor.childActorFor(Actor.java:181) ~[classes/:na]
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.startProcessors(ServerRequestResponseChannelActor.java:161) ~[classes/:na]
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannelActor.<init>(ServerRequestResponseChannelActor.java:44) ~[classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116) ~[classes/:na]
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75) ~[classes/:na]
at io.vlingo.actors.Stage.createRawActor(Stage.java:656) ~[classes/:na]
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448) ~[classes/:na]
at io.vlingo.actors.Stage.actorFor(Stage.java:143) ~[classes/:na]
at io.vlingo.wire.fdx.bidirectional.ServerRequestResponseChannel.start(ServerRequestResponseChannel.java:54) ~[classes/:na]
at io.vlingo.http.resource.ServerActor.<init>(ServerActor.java:83) ~[classes/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_212]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_212]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_212]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_212]
at io.vlingo.actors.ActorFactory.start(ActorFactory.java:116) ~[classes/:na]
at io.vlingo.actors.ActorFactory.actorFor(ActorFactory.java:75) ~[classes/:na]
at io.vlingo.actors.Stage.createRawActor(Stage.java:656) ~[classes/:na]
at io.vlingo.actors.Stage.actorProtocolFor(Stage.java:448) ~[classes/:na]
at io.vlingo.actors.Stage.actorFor(Stage.java:143) ~[classes/:na]
at io.vlingo.http.resource.Server.startWith(Server.java:111) ~[classes/:na]
at io.vlingo.http.resource.Server.startWith(Server.java:81) ~[classes/:na]
at io.vlingo.http.resource.Server.startWith(Server.java:60) ~[classes/:na]
at io.vlingo.schemata.Bootstrap.<init>(Bootstrap.java:68) ~[classes/:na]
at io.vlingo.schemata.Bootstrap.instance(Bootstrap.java:87) ~[classes/:na]
at io.vlingo.schemata.Bootstrap.main(Bootstrap.java:96) ~[classes/:na]
We need a backend compiler for C#. We don't know if there is something like JavaPoet for C#, but because types are relatively simple, it might make sense to just do it manually.
An example implementation for Java can be found here: io.vlingo.schemata.codegen.backend.java.JavaBackend
Currently, a H2 connection is hardcoded in io.vlingo.schemata.infra.persistence.JDBCConfiguration
.
We should be able to configure different DB backends, preferably using env vars, so we can simply spin up another database (container) and let the schemata container connect to it.
Or are there other configuration mechanisms I am not aware of?
StateStore
for the Query Model0.0.0
in the entry fieldType definitions need to be compiled when queried from the database. Now the TypeResolver is asynchronous so it would allows us to reactively compile type definitions.
io.vlingo.schemata.codegen.processor.types.TypeResolver
We need to extend the TypeResolver interface in the SchemaVersionQueries protocol:
io.vlingo.schemata.query.SchemaVersionQueries
And probably we will need to change the TypeResolver to be able to compile TypeDefinitions from sources.
Users should be able to change schema version state from the UI.
Valid state transitions:
When requesting the sources for a schema that contains at least one basic type not checked for in io.vlingo.schemata.codegen.processor.types.ComputableTypeProcessor#resolveType
, the request hangs.
Schema not containing simple types can be retrieved, but after trying to retrieve one that does, a second try with a schema that worked before also fails.
If I'm not mistaken, this only happens with the TypeResolver
in SchemaVersionQueriesActor
, CacheTypeResolver
did work with basic types.
When compiling the same schema within a test, the compilation works.
To reproduce via the http API:
src/test/resources/rest-api-calls.http
starting from L:148
one after anotherL:160
) leads to the issueTo reproduce via the UI:
string
property, see exampleSource
Minimal example spec:
event Foo {
string bar
}
There already was a discussion on Slack, but I prefer having an issue to reference instead of searching within the chat history.
A simple text field for defining SchemaVersion
specifications is not the best we can provide, IMHO.
Since we already have a specification grammar and things like https://microsoft.github.io/monaco-editor/ are out there, we can probably integrate a real editor.
We should discuss/research options.
Currently, the app hangs when serving resources, but only when run within docker. Running the jar works as expected.
Steps to reproduce
mvn package
(java -jar target/vlingo-schemata-0.9.3-RC4-jar-with-dependencies.jar dev
curl localhost:9019/app/
docker build . -t vlingo/vlingo-schemata
docker run -p9019:9019 vlingo/vlingo-schemata
curl localhost:9019/app/
@kbastani wrote an alternative implementation for serving static resources (https://github.com/vlingo/vlingo-xoom/blob/master/vlingo-xoom-server/src/main/java/io/vlingo/xoom/resource/CachedStaticFilesResource.java) using caches instead of re-reading resources from the FS that seems not to suffer from this issue.
Currently creating organizations, units and contexts with the resp. same name is possible.
This can lead to them not being distinguishable from the UI. We could either also show the resp. IDs (but Users having to compare UUIDs is probably not the UX we're aiming for) or constrain the names to have to be unique.
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.