如何在 Spring Boot 中使用 WebSphere Runtime 库作为独立应用程序

2024-01-12

我正在尝试构建一个 Spring Boot 控制台应用程序。 首先,我使用 spring 初始化程序 v 1.3.1

这是简单的“hello world”,没有 Web,没有 JPA,什么都没有 现在我编辑了 pom.xml 并添加了对名为的 jar 文件的依赖项 'com.ibm.ws.ejb.thinclient_8.5.0.jar'

突然我在构建时遇到以下错误

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.management.MBeanServer]: Factory method 'mbeanServer' threw exception; nested exception is org.springframework.jmx.MBeanServerNotFoundException: Could not access WebSphere's AdminServiceFactory.getMBeanFactory/getMBeanServer method; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 37 common frames omitted

如何将 Websphere 8 运行时库包含到 Spring-Boot 独立应用程序中

目标: 我正在尝试开发一个简单的独立 java 应用程序,它将通过 IIOP 调用 EJB 服务。该应用程序在外部运行(作为独立客户端)并与 websphere 内的 EJB 应用程序进行通信。


默认情况下,spring-boot 中启用了 jmx。

如果您的项目没有使用 JMX。在 application.properties 中添加此行。那应该可以解决这个问题。

spring.jmx.enabled=false
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 Spring Boot 中使用 WebSphere Runtime 库作为独立应用程序 的相关文章

随机推荐