Weblogic ALSBConfigurationMBean 初始化
我正在尝试使用 Java 进行 OSB (ESB) 自动构建过程。为此,我需要执行以下操作:
- 连接到 weblogic - 这正在工作 //weblogic 版本是 10.3.0.0
- 使用连接创建一个 DomainRuntimeServiceMBean 对象 - 这也正在工作
- 使用之前创建的 DomainRuntimeServiceMBean 对象创建 ALSBConfigurationMBean 对象 -这是我的问题。
我使用以下代码来创建 ALSBConfigurationMBean 对象:
DomainRuntimeServiceMBean domainService = ConnectionUtil
.createDomainService(mHost, mPort, mUsername, mPassword,
connector);
ALSBConfigurationMBean alsbSession = (ALSBConfigurationMBean) domainService
.findService(ALSBConfigurationMBean.NAME,
ALSBConfigurationMBean.TYPE, null);
我得到的错误是:
Exception in thread "main" java.lang.ClassCastException: $Proxy1 cannot be cast to weblogic.management.mbeanservers.Service
at $Proxy0.findService(Unknown Source)
I'm trying to make an OSB (ESB) automated build process using Java. For that purpose I need to do the following things:
- Connect to weblogic - this is working //The weblogic version is 10.3.0.0
- Make a DomainRuntimeServiceMBean object using the connection - this is also working
- Make a ALSBConfigurationMBean object using the previously created DomainRuntimeServiceMBean object - here is my problem.
I use the following code for making the ALSBConfigurationMBean object:
DomainRuntimeServiceMBean domainService = ConnectionUtil
.createDomainService(mHost, mPort, mUsername, mPassword,
connector);
ALSBConfigurationMBean alsbSession = (ALSBConfigurationMBean) domainService
.findService(ALSBConfigurationMBean.NAME,
ALSBConfigurationMBean.TYPE, null);
The error that I get is:
Exception in thread "main" java.lang.ClassCastException: $Proxy1 cannot be cast to weblogic.management.mbeanservers.Service
at $Proxy0.findService(Unknown Source)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在研究类似的东西,@Rich 提供的解决方案对我有用。但是,我最终采用了一种稍微不同的方法,不需要使用 weblogic.management.jmx.MBeanServerInvocalHandler (至少直接使用)。
以下是一些应该执行您要查找的操作的代码:
以下是有关我的解决方案的一些注意事项:
I am working on something similar, and the solution that @Rich gave worked for me. However, I have ended up with a slightly different approach that doesn't require using the weblogic.management.jmx.MBeanServerInvocationHandler (directly at least).
Here is some code that should do what you are looking for:
Here are some things to note about my solution:
如果有人遇到同样的错误,请使用
weblogic.management.jmx.MBeanServerInvocalHandler 而不是 javax.management.MBeanServerInvocalHandler:
https://forums.oracle.com/forums/thread.jspa?threadID=817973&tstart=420
In case that anyone gets the same error then use
weblogic.management.jmx.MBeanServerInvocationHandler instead of javax.management.MBeanServerInvocationHandler:
https://forums.oracle.com/forums/thread.jspa?threadID=817973&tstart=420