0
春天开机不会自动装配一个MBean的,我从另一个Web应用程序导出的:Spring Boot autowire MBean?
@Component
@Service
@ManagedResource(objectName = IHiveService.MBEAN_NAME)
public class HiveService implements IHiveService {
@Autowired(required = true)
CategoryRepository categoryRepository;
@Override
@ManagedOperation
public String echo(String input) {
return "you said " + input;
}
}
我可以看到在甲骨文的Java任务控制,但其他的Spring应用程序启动使用Bean是不能够自动装配豆。我这是我错过了一个注释。自动装配我使用的豆:
@Controller
@Configuration
@EnableMBeanExport
public class GathererControls {
@Autowired
IHiveService hiveService; // <-- this should be auto wired
任何想法?
'@ Controller'和'@ Configuration'在同一个班?那可能吗? – Pau
@PauChorro我得到绝望,并尝试了一切...... –