Closed bwssytems closed 5 years ago
Can you give me some background please. OS, java version, signalk-java version (latest?)
If you are able to try that and it works, pls let me know. Otherwise I will add and test Java 9+ later. I only run/test on Java 8 as its the usual version on RPi's
Well crap, I am running Java 10.... I believe it is to add this '`—add-modules java.xml.bind' to the command line. I'll give it a try.
Also, I am running on Linux Mint 19.1 and just used that standard build process defined in the readme
FYI: Ive just commited a JDK11 branch that runs under JDK11, using the new Graal compiler. Still a first cut, but seems to run js code MUCH faster. Its using the Liberica JDK11, which is available on the RPi :-) The graal complier means it should run any js, python, LLVM( c, c++, etc) source code transparently at native speeds!.
Any help with testing appreciated.
I was under the impression that Graal does not support arm architectures, has this changed?
Will get the new branch and test it.
Graalvm doesnt yet, but only because the substratevm doesnt. Thats under way, a few months off. But the graal hotspot compiler already supports ARM, and is useable from JDK11 on the normal VM which is available for ARM. (bellsoft Liberica). (Ive yet to confirm the JIT works on the RPi, but its written in java, so it runs on any VM)
I am getting this error on execution: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project signalk-java: Unable to parse configuration of mojo org.codehaus.mojo:exec-maven-plugin:1.6.0:java for parameter arguments: Cannot store value into array: ArrayStoreException -> [Help 1]
Oh - I had that one :-) Try
export JAVA_HOME=/usr/lib/jvm/jdk-11-bellsoft-amd64/
mvn -DskipTests clean install
mvn exec:exec -X
I think a build then exec fixed it.
Well, not working for me under signalk-java. If I compile and run from the artemis-server it will start and looks good so far.
When starting a nmeatcp stream from kplex to signalk, nothing happens except the multiple JS:Parser instantiated!. I had to increase the VM memory to even get this and I am at 1G now.
14:58:46.992 INFO o.a.c.AtmosphereFramework - Atmosphere Framework 2.5.2 started. 14:58:46.992 INFO o.a.c.AtmosphereFramework -
For Atmosphere Framework Commercial Support, visit
http://www.async-io.org/ or send an email to support@async-io.org
14:58:46.992 INFO o.a.c.AtmosphereFramework - Installed AtmosphereInterceptor nz.co.fortytwo.signalk.artemis.atmosphere.intercept.AuthenticationInterceptor with priority AFTER_DEFAULT 14:58:47.064 INFO n.c.f.s.a.s.ArtemisServer - Starting tcp/udp server 14:58:47.112 INFO n.c.f.s.a.s.ArtemisServer - Starting NMEA output 14:58:47.144 INFO n.c.f.s.a.s.ArtemisServer - Starting scheduled services 14:58:47.144 INFO n.c.f.s.a.s.ArtemisServer - Starting Zeroconf discovery agent 14:58:47.144 INFO n.c.f.s.a.s.ArtemisServer - Starting serial port manager 14:58:47.167 INFO n.c.f.s.a.s.ChartService - Reload charts at startup 14:58:47.170 INFO n.c.f.s.a.s.ChartService - Existing charts: Quan:0 14:58:47.171 INFO n.c.f.s.a.s.ChartService - Reloading charts from: /home/bsamuels/git/artemis-server/./signalk-static/./mapcache WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/home/bsamuels/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding() WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 14:58:47.221 INFO n.c.f.s.a.s.ChartService - Loading new chart: WORLD= {"context":"resources","put":[{"path":"charts.urn:mrn:signalk:uuid:804d3b42-19f5-4424-961f-b31a378612cf","value":{"identifier":"WORLD","maxzoom":4,"name":"World Outline","bounds":[-85.05112878,-180.0,83.64310000000003,179.95295325327942],"format":"png","description":"World Outline","tilemapUrl":"/./mapcache/WORLD/{z}/{x}/{-y}.png","scale":250000,"type":"tilelayer","minzoom":0}}]} 14:58:47.459 INFO n.c.f.s.a.s.ChartService - Loading new chart: WORLD1= {"context":"resources","put":[{"path":"charts.urn:mrn:signalk:uuid:2c79932d-4da0-42fa-bd1a-f45275950be6","value":{"identifier":"WORLD1","maxzoom":6,"name":"World Outline 1","bounds":[-85.05112878,-180.0,83.64310000000003,179.97217572748764],"format":"png","description":"World Outline 1","tilemapUrl":"/./mapcache/WORLD1/{z}/{x}/{-y}.png","scale":250000,"type":"tilelayer","minzoom":3}}]} 14:58:47.587 INFO n.c.f.s.a.s.ChartService - Chart resources updated 14:59:18.803 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue b46d83fffe8e8343-000077de-00000006-2e01ae5c2128f370-16b70582 in AddressSettings 14:59:18.803 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue b46d83fffe8e8343-000077de-00000006-2e01ae5c2128f370-16b70582 in AddressSettings JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! JS:Parser instantiated! 15:00:13.660 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue stream-eff18a59-1535-42cc-8b8c-49300052fdbc in AddressSettings 15:00:13.660 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue stream-eff18a59-1535-42cc-8b8c-49300052fdbc in AddressSettings 15:00:13.686 WARN o.a.w.WebSocket - Unable to write 415 Unsupported Media Type 15:00:13.686 WARN o.a.w.p.SimpleHttpProtocol - Status code higher or equal than 400. Unable to deliver the websocket messages to installed component. Status 415 Message Unsupported Media Type 15:00:51.955 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue af0b4632-2808-41f2-9ef6-15b535df2889 in AddressSettings 15:00:51.955 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue af0b4632-2808-41f2-9ef6-15b535df2889 in AddressSettings 15:01:11.390 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue stream-1c56f53e-9baa-4752-aa65-89a9dbe6cf84 in AddressSettings 15:01:11.390 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue stream-1c56f53e-9baa-4752-aa65-89a9dbe6cf84 in AddressSettings 15:01:11.405 WARN o.a.w.WebSocket - Unable to write 415 Unsupported Media Type 15:01:11.406 WARN o.a.w.p.SimpleHttpProtocol - Status code higher or equal than 400. Unable to deliver the websocket messages to installed component. Status 415 Message Unsupported Media Type 15:02:03.594 ERROR n.c.f.s.a.a.i.AuthenticationInterceptor - JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted. 15:02:06.663 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue 57b56ccc-6860-40c7-9c03-ec9087db016f in AddressSettings 15:02:06.663 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue 57b56ccc-6860-40c7-9c03-ec9087db016f in AddressSettings 15:02:07.215 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue 90e043b3-8567-4510-a0b7-ba529fbcde6f in AddressSettings 15:02:07.215 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue 90e043b3-8567-4510-a0b7-ba529fbcde6f in AddressSettings 15:02:31.932 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue 35b43a05-adce-4fe7-a09c-548f7057b48c in AddressSettings 15:02:31.932 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue 35b43a05-adce-4fe7-a09c-548f7057b48c in AddressSettings 15:02:50.840 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue 6c8da776-379b-4a1b-86f6-f4bbb6b830ad in AddressSettings 15:02:50.841 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue 6c8da776-379b-4a1b-86f6-f4bbb6b830ad in AddressSettings 15:03:35.182 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue e04fdfc7-b31e-405b-931f-d0f96d824961 in AddressSettings 15:03:35.182 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue e04fdfc7-b31e-405b-931f-d0f96d824961 in AddressSettings 15:03:54.326 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue aeb496f8-bdc3-4b66-b318-2706f84f9228 in AddressSettings 15:03:54.326 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue aeb496f8-bdc3-4b66-b318-2706f84f9228 in AddressSettings 15:04:48.968 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue d30924c9-6b8a-4bd3-9865-ec01621e1469 in AddressSettings 15:04:48.968 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue d30924c9-6b8a-4bd3-9865-ec01621e1469 in AddressSettings 15:04:53.993 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue 5f62f536-3c44-42d8-ae51-1b9c379b1bc0 in AddressSettings 15:04:53.993 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue 5f62f536-3c44-42d8-ae51-1b9c379b1bc0 in AddressSettings 15:06:23.246 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue stream-c8ee5c21-f69d-4344-8824-bdbfcb87d1eb in AddressSettings 15:06:23.247 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue stream-c8ee5c21-f69d-4344-8824-bdbfcb87d1eb in AddressSettings
And now I have an issue where it will exception out:
bsamuels@Mint-Hp:~/git/artemis-server$ mvn exec:exec
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building artemis-server 0.9.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (default-cli) @ artemis-server ---
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=jar:file:/home/bsamuels/.m2/repository/org/apache/logging/log4j/log4j-core/2.8.2/log4j-core-2.8.2.jar!/META-INF/log4j-provider.properties, classLoader=jdk.internal.loader.ClassLoaders$AppClassLoader@725bef66]
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Took 0.047988 seconds to load 200 plugins from jdk.internal.loader.ClassLoaders$AppClassLoader@725bef66
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false.false-1
DEBUG StatusLogger Starting LoggerContext[name=725bef66, org.apache.logging.log4j.core.LoggerContext@193f604a]...
DEBUG StatusLogger Reconfiguration started for context[name=725bef66] at URI null (org.apache.logging.log4j.core.LoggerContext@193f604a) with optional ClassLoader: null
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 4 plugins
DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@16a0ee18
ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
15:40:42.545 WARN o.a.a.a.c.server - AMQ222018: AIO was not located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
15:40:42.548 WARN o.a.a.a.c.server - AMQ222269: Please use a fixed value for "journal-pool-files". Default changed per https://issues.apache.org/jira/browse/ARTEMIS-1628
15:40:42.585 INFO o.a.a.a.c.server - AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/largemessages,pagingDirectory=data/paging)
15:40:42.597 INFO o.a.a.a.c.server - AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 536,870,912
15:40:42.632 INFO o.a.a.a.c.server - AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
15:40:42.633 INFO o.a.a.a.c.server - AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
15:40:42.634 INFO o.a.a.a.c.server - AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
15:40:42.668 INFO o.a.a.a.c.server - AMQ224092: Despite disabled persistence, page files will be persisted.
15:40:42.676 INFO o.a.a.a.c.server - AMQ221003: Deploying queue incoming.raw on address incoming.raw
15:40:42.699 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue incoming.raw in AddressSettings
15:40:42.699 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue incoming.raw in AddressSettings
15:40:42.718 INFO o.a.a.a.c.server - AMQ221003: Deploying queue outgoing.reply on address outgoing.reply
15:40:42.720 WARN o.a.a.a.c.server - AMQ222165: No Dead Letter Address configured for queue outgoing.reply in AddressSettings
15:40:42.720 WARN o.a.a.a.c.server - AMQ222166: No Expiry Address configured for queue outgoing.reply in AddressSettings
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.oracle.truffle.api.TruffleOptions
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotImpl.buildEngine(PolyglotImpl.java:177)
at org.graalvm.sdk/org.graalvm.polyglot.Engine$Builder.build(Engine.java:488)
at org.graalvm.sdk/org.graalvm.polyglot.Context$Builder.build(Context.java:1085)
at nz.co.fortytwo.signalk.artemis.transformer.N2kMsgTransformer.initEngine(N2kMsgTransformer.java:111)
at nz.co.fortytwo.signalk.artemis.transformer.N2kMsgTransformer.
Can you capture the nmeatcp stream from kplex and send me the file? It should only start 1 JS Parser, your debug suggests its creating one per sentence, not sure why. I run mine in 256Mb and its plenty.
BTW the "WARNING: Illegal reflective access by .." messages just mean the lib is not yet JDK11 ready. I'll have to update a few more in the pom.
The last exception is not one Ive seen, what OS, java version, eclipse version are you running?
BTW thanks for testing this out.
Hmm, interesting - managed to replicate your problem with a demo file. Basically the default artemis messaging server runs 30 worker threads, and each creates its own private js environment. So basically you were running 30 concurrent js servers in artemis-server! I trimmed it to 5, and it now runs in 256Mb without OOMs. Just pull down the latest from git
This highlights one of the advantages of the artemis-server, it can scale horizontally across all available CPU's, where node servers only use a single thread (aka a single cpu) no matter how many cpu's are available. And the js environments are sandboxed (both memory and security), so they cant compromise the entire server.
Will test that update today. Another question I have is the signalkconstants.java file. I see that a lot of paths that are commented out, does this mean they will not be parsed by the Artemis server?
Getting this error on some messages from nmeatransformer
2019-03-05 09:43:00,261 ERROR nz.co.fortytwo.signalk.artemis.transformer.NMEAMsgTransformer [Thread-4 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5@cbc8d0f)] org.graalvm.polyglot.PolyglotException: RangeError: time value is not a finite number
org.graalvm.polyglot.PolyglotException: RangeError: time value is not a finite number
at
Also, still not getting output on subscription. It decodes most of the nmea messages from the kplex stream, but subscription gives me "{}"
Can you send a sample of the offending line pls. If you turn debug on for NMEAMsgTransformer ir should print out the sentence.
Re subs: check there is data in influxdb, check the rows timestamp is not in the future, and that there are no row values in the future. (It will always select the highest time). Check the uuid is the same as your self
entry
Well, now I cannot test as I keep getting an error on finding com.oracle.truffle.api.TruffleOptions even though the path points there. Wondering if it is a runtime instantiated class so it gets cut out.
Edit: Sometimes I hate maven......
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.oracle.truffle.api.TruffleOptions
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotImpl.buildEngine(PolyglotImpl.java:177)
at org.graalvm.sdk/org.graalvm.polyglot.Engine$Builder.build(Engine.java:488)
at org.graalvm.sdk/org.graalvm.polyglot.Context$Builder.build(Context.java:1085)
at nz.co.fortytwo.signalk.artemis.transformer.N2kMsgTransformer.initEngine(N2kMsgTransformer.java:111)
at nz.co.fortytwo.signalk.artemis.transformer.N2kMsgTransformer.
try a mvn clean compile maven is powerful but can be a beast
I did a clean before that and also rebuilt my maven repository.
Closing this to move the #17, as its getting way off its initial topic
Agreed
Might be a dependency missing in the pom file.
SEVERE: Implementation of JAXB-API has not been found on module path or classpath. javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.