Skip to content

Commit 7f77d4d

Browse files
authored
Merge pull request #911 from tronprotocol/p2p
p2p: bean import problem
2 parents c42bdcd + f7b8356 commit 7f77d4d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/org/tron/common/overlay/server/SyncPool.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class SyncPool {
6464
private NodeManager nodeManager;
6565

6666
@Autowired
67+
private ApplicationContext ctx;
68+
6769
private ChannelManager channelManager;
6870

6971
private PeerConnectionDelegate peerDel;
@@ -86,6 +88,8 @@ public SyncPool(PeerClient peerClient) {
8688
public void init(PeerConnectionDelegate peerDel) {
8789
this.peerDel = peerDel;
8890

91+
channelManager = ctx.getBean(ChannelManager.class);
92+
8993
poolLoopExecutor.scheduleWithFixedDelay(() -> {
9094
try {
9195
fillUp();

src/main/java/org/tron/program/FullNode.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.tron.program;
22

33
import lombok.extern.slf4j.Slf4j;
4+
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
45
import org.springframework.context.ApplicationContext;
56
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
67
import org.tron.common.application.Application;
@@ -27,7 +28,11 @@ public static void main(String[] args) throws InterruptedException {
2728
return;
2829
}
2930

30-
ApplicationContext context = new AnnotationConfigApplicationContext(DefaultConfig.class);
31+
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
32+
beanFactory.setAllowCircularReferences(false);
33+
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(beanFactory);
34+
context.register(DefaultConfig.class);
35+
context.refresh();
3136
Application appT = ApplicationFactory.create(context);
3237
shutdown(appT);
3338
//appT.init(cfgArgs);

0 commit comments

Comments
 (0)