Hi all. I've recently downloaded the Sample broker from here to run a simulation game, and tried running the broker in the command prompt using mvn test exec:exec, but a "connectionFactory is required" exception keeps popping up for the past few days. This error has also appeared when I tried to run other agents like AgentUDE17.
Perplexingly, I tried the exact steps I took on another person's laptop and it could run the game perfectly. Here's what came out on my side: [INFO] --- exec-maven-plugin:1.6.0:exec (default-cli) @ sample-broker --- <options /> Starting session 1 name=Sample Exception in thread "main" java.lang.IllegalArgumentException: Property 'connectionFactory' is required at org.springframework.jms.support.JmsAccessor.afterPropertiesSet(JmsAccessor.java:169) at org.springframework.jms.listener.AbstractJmsListeningContainer.afterPropertiesSet(AbstractJmsListeningContainer.java:165) at org.powertac.samplebroker.core.JmsManagementService.registerMessageListener(JmsManagementService.java:112) at org.powertac.samplebroker.core.PowerTacBroker.run(PowerTacBroker.java:260) at org.powertac.samplebroker.core.PowerTacBroker.startSession(PowerTacBroker.java:185) at org.powertac.samplebroker.core.BrokerRunner.processCmdLine(BrokerRunner.java:173) at org.powertac.samplebroker.core.BrokerMain.main(BrokerMain.java:39) [ERROR] Command execution failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:804) at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:751) at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:313) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.383 s [INFO] Finished at: 2019-09-28T12:00:03+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default-cli) on project sample-broker: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException Any help would be greatly appreciated |
Administrator
|
Hello -
This is very strange. The connectionFactory is defined in broker-core/src/main/resources/broker.xml and should get bundled into the generated jar file. I doubt this is a software problem in the broker; more likely something is broken in the machine you are running it on. What can you tell us about the machine and its OS, software, and network environment, and how it is different from the machine where it works? Cheers - John
|
In reply to this post by CChan1168
Hi, thanks for replying!
Here are some of my machine specifications: Model and hardware System Manufacturer: Dell Inc. System Model: XPS 15 9560 BIOS: 1.15.0 (type: UEFI) Processor: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 CPUs), ~2.8GHz Memory: 16384MB RAM OS Windows 10 Pro 64-bit (10.0, Build 18362) Software Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00) Maven home: C:\apache-maven-3.6.1\bin\.. Java version: 12.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-12.0.2 Default locale: en_US, platform encoding: Cp1252 Network Name: Killer Wireless-n/a/ac 1535 Wireless Network Adapter Device ID: PCI\VEN_168C&DEV_003E&SUBSYS_15351A56&REV_32\4&17E84AC7&0&00E0 Usually, I use only wireless on my machine as it does not have a dedicated ethernet port. I've gone to two different places with different wireless networks and both yielded the same results. Differences with other machine - Other machine is Windows 10 Home 64-bit - Other machine uses: Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-05T03:00:29+08:00) Maven home: C:\Users\lovef\Desktop\apache-maven-3.6.1\bin\.. Java version: 1.8.0_151, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_151\jre Default locale: en_SG, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" If you need any specific details, let me know and I'll gladly provide them. |
Administrator
|
Thanks for the details.
There's a possibility that the problem is Java 12. I have tested a broker built with Java 8 under Java 11, but not under Java 12. We actually don't intend to support Java 12, but rather Java 11 LTS, which should be good for three years rather than the 6-month lifetime of intermediate versions like Java 12. If someone else is using Java 12 successfully, please let us know. But we simply don't have the resources to support it. Cheers - John |
I downloaded and installed both JDK and JRE 8, and it worked like a charm! Thank you kindly for the help :)
|
Administrator
|
In reply to this post by CChan1168
Dear colleagues -
This is Issue #1043. It turns out that older brokers seem to be built with an active-mq library that does not work correctly under Java 11. They do still work under Java 8, and they interact correctly with the 1.7 server running under Java 11. So you have two choices for older brokers: (1) run them from a different machine that's still running Java 8, or (2) run them in a different shell or different account that's configured to run under Java 8. On Linux, it may be enough to set JAVA_HOME to an older Java installation, but I haven't tested that. The local web interface (mvn -Pweb2) for the server does not allow setting of the jms-url, so you have to run the server from the command line if you want to run the broker on a different machine. I hope this helps. Please let us know if you encounter further problems with this. John |
Free forum by Nabble | Edit this page |