Exception while setting up Bridge Agent: battleManager.superblockDuration().send() returns null for some reason

Someone I’m talking with is attempting to setup an agent and has ran into the following. They have not posted here yet, so I’m posting for them and will relay info to them.

"I keep getting an exception executing: at org.sysethereum.agents.MainConfiguration.superblockDuration(http://MainConfiguration.java:119)

Which traces to:

Uint256 send = battleManager.superblockDuration().send(); return send.getValue();

battleManager.superblockDuration().send() returns null for some reason

driving me a bit nutty"

Sounds like you’re hitting this issue when starting up the agent?
Please check if your geth is synced, and then check if your geth has peers
you can check whether your geth has peer or not by doing the following
sysgeth.nod attach -datadir .syscoin/geth
replace .syscoin/geth to your syscoin data directory’s geth folder
and then you’ll be in a javascript console. Do a admin.peers and you should see an array of peers. if you get an empty array like [] please allow the network to stabilize for peer connections
You can exit the javascript console by ctrl+c

“Maybe ask him if his infura is configured just create basic account and add the API key to config file in agent”. - Jag

Ok. I’ve managed to replicate the issue by following the instructions here:

I’m using testnet and using a rinkeby infra endpoint in my config.

Geth shows I have 7 peers

Here’s part of my debug:

20:05:31.474 [org.sysethereum.agents.Main.main()] WARN org.springframework.context.annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
at org.sysethereum.agents.MainConfiguration.superblockDuration (MainConfiguration.java:121)
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.CGLIB$superblockDuration$9 ()
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.superblockDuration ()
at org.sysethereum.agents.MainConfiguration.superblockDuration (MainConfiguration.java:119)
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.CGLIB$superblockDuration$9 ()
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.superblockDuration ()
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project sysethereum-agents: An exception occured while executing the Java class. Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project sysethereum-agents: An exception occured while executing the Java class. Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘mainLifecycle’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/MainLifecycle.class]: Unsatisfied dependency expressed through constructor parameter 3; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChainClient’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/SuperblockChainClient.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘superblockChain’ defined in file [/home/monocyte/sysethereum-agents/target/classes/org/sysethereum/agents/core/syscoin/SuperblockChain.class]: Unsatisfied dependency expressed through constructor parameter 5; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘superblockDuration’ defined in class path resource [org/sysethereum/agents/MainConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.math.BigInteger]: Factory method ‘superblockDuration’ threw exception; nested exception is java.lang.RuntimeException: java.lang.NullPointerException
at org.sysethereum.agents.MainConfiguration.superblockDuration (MainConfiguration.java:121)
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.CGLIB$superblockDuration$9 ()
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.superblockDuration ()
at org.sysethereum.agents.MainConfiguration.superblockDuration (MainConfiguration.java:119)
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.CGLIB$superblockDuration$9 ()
at org.sysethereum.agents.MainConfiguration$$EnhancerBySpringCGLIB$$c0dbd073.superblockDuration ()

Here is a censored version of my sysethereum-agents.conf:

Is this issue only happening on testnet?

I have been trying to use testnet with the master branch release, which might have been the root of my issue. I’m going to try the “testnet” branch now.

I got it working! Will create a testnet guide for Bridge Agent now.

I also met the same problem. Do you have any solutions now? :joy: