No agent booting via Java
See original GitHub issueDescribe the bug
I can run my application via maven exec:java
because it starts a Java class which will create an agent.
However, I cannot anymore in 0.11.0 start an agent directly using Java + SRE’s Booting service.
Even trying to do what is stated in http://www.sarl.io/docs/official/gettingstarted/RunSARLAgentCLI.html gives error:
$ java -cp target/agtcity-sarl-base-4.5.0.11.0-jar-with-dependencies.jar io.sarl.sre.boot.Boot --help
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/ssardina/git/soft/agents/MAC-AgtCity/2018-rmit/agtcity-sarl-base.git/target/agtcity-sarl-base-4.5.0.11.0-jar-with-dependencies.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
Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Could not find a suitable constructor in io.sarl.sre.boot.commands.RunSingleAgentCommand. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
at io.sarl.sre.boot.commands.RunSingleAgentCommand.class(RunSingleAgentCommand.java:60)
at io.bootique.BQCoreModuleExtender.setDefaultCommand(BQCoreModuleExtender.java:95)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:73)
at io.bootique.Bootique.createInjector(Bootique.java:472)
at io.bootique.Bootique.createRuntime(Bootique.java:330)
at io.sarl.sre.boot.SreMain.createRuntime(SreMain.java:232)
at io.sarl.sre.boot.SreMain.ensureBootiqueRuntimeInstance(SreMain.java:238)
at io.sarl.sre.boot.SreMain.runSRE(SreMain.java:253)
at io.sarl.sre.boot.Boot.main(Boot.java:84)
When I try to boot an agent:
$ java -cp target/agtcity-sarl-base-4.5.0.11.0-jar-with-dependencies.jar io.sarl.sre.boot.Boot au.edu.rmit.agtgrp.agtcity.sarl.agents.dummy.SuperSingleAgent
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/ssardina/git/soft/agents/MAC-AgtCity/2018-rmit/agtcity-sarl-base.git/target/agtcity-sarl-base-4.5.0.11.0-jar-with-dependencies.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
Exception in thread "main" com.google.inject.CreationException: Unable to create injector, see the following errors:
1) Could not find a suitable constructor in io.sarl.sre.boot.commands.RunSingleAgentCommand. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
at io.sarl.sre.boot.commands.RunSingleAgentCommand.class(RunSingleAgentCommand.java:60)
at io.bootique.BQCoreModuleExtender.setDefaultCommand(BQCoreModuleExtender.java:95)
1 error
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
at com.google.inject.Guice.createInjector(Guice.java:99)
at com.google.inject.Guice.createInjector(Guice.java:73)
at io.bootique.Bootique.createInjector(Bootique.java:472)
at io.bootique.Bootique.createRuntime(Bootique.java:330)
at io.sarl.sre.boot.SreMain.createRuntime(SreMain.java:232)
at io.sarl.sre.boot.SreMain.ensureBootiqueRuntimeInstance(SreMain.java:238)
at io.sarl.sre.boot.SreMain.runSRE(SreMain.java:253)
at io.sarl.sre.boot.Boot.main(Boot.java:84)
System configuration: – SARL version: 0.11.0 – SARL compiler:
-
- [] Eclipse compiler without Maven
-
- Eclipse compiler with Maven
-
- Maven compiler on the command line
-
- sarlc compiler – Java JDK version (with the manufacturer name): – Operating System:
-
- Linux 64bits
-
- Windows 64bits
-
- MacOS 64bits
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Instrument Java bytecode without agent - Stack Overflow
One way to circumvent this, is to use another process. All this process has to to, is to attach to your original process...
Read more >Unable to start NR as java agent in spring boot application
I've edited my app startup script and added the line -javaagent:/path-to-NR.jar. But it seems NR does not want to start all all. No...
Read more >Error in configuring javaagent in Spring Boot application
The agent is not getting started and the application is not getting detected by appdynamics. Can you please help resolve. Thanks.
Read more >Java Instrumentation Agent's Boot-Class-Path is not visible
According to the documentation, If I have specified jars in Boot-Class-Path attribute in my agent MANIFEST.MF - it should locate the jars and...
Read more >Package java.lang.instrument - Oracle Help Center
An agent provides an implementation of this interface in order to ... When the agent is started after VM startup the premain method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ahhh OK so I was a bit useful then 😉 ha!
Just tested and it works! I can run the system via Java.
No problem; I have added it a couple of days ago based on your issue report 😃