如何在Spring Boot中使用WebSphere Runtime库作为应用程序 [英] How to use WebSphere Runtime libraries inside Spring Boot as stand along app

查看:939
本文介绍了如何在Spring Boot中使用WebSphere Runtime库作为应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个Spring启动控制台应用程序。
开始我正在使用spring initializer v 1.3.1



它是简单的'hello world'没有Web,没有JPA,没有任何
现在我编辑了pom.xml,并添加了一个名为
'com.ibm.ws.ejb.thinclient_8.5.0.jar'的jar文件的依赖项

突然间,我在构建时收到以下错误。

 引起的:org.springframework.beans.BeanInstantiationException:无法实例化[ javax.management.MBeanServer]:工厂方法'mbeanServer'抛出异常;嵌套异常是org.springframework.jmx.MBeanServerNotFoundException:无法访问WebSphere的AdminServiceFactory.getMBeanFactory / getMBeanServer方法;嵌套异常是java.lang.NullPointerException 
在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)〜[spring-beans-4.2.4.RELEASE.jar:4.2.4 .RELEASE]
在org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)〜[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 37个共同的框架省略

如何将Websphere 8运行时库添加到Spring-启动独立应用程序



目标:
我正在尝试开发一个简单的独立Java应用程序,这将通过IIOP调用EJB服务。这个应用程序在外面(作为一个独立的客户端)运行,并与websphere中的EJB应用程序进行交谈。

解决方案

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



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

  spring.jmx.enabled = false 
pre>

I am trying to build a Spring Boot console app. to get started I am using the spring initializer v 1.3.1

it's simple 'hello world' with no Web, no JPA, no anything Now I edited the pom.xml and added a dependency to jar file called 'com.ibm.ws.ejb.thinclient_8.5.0.jar '

all of a sudden I get the following errors upon build

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

How can I include Websphere 8 run time libraries into Spring-Boot stand-alone app

Goal: I am trying to develop a simple stand alone java app, that will invoke EJB services via IIOP. This app runs out-side (as a stand alone client) and talks to EJB app inside websphere.

解决方案

By default, jmx is enabled in spring-boot.

If you are not using JMX for your project. Add this line in the application.properties. That should solve this problem.

spring.jmx.enabled=false

这篇关于如何在Spring Boot中使用WebSphere Runtime库作为应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆