使用WebSphere 8 Jython管理API获取ADMN0022E

时间:2016-04-06 08:41:18

标签: websphere jython websphere-8

我们正在使用Jython脚本在不同阶段(测试,集成,qs,生产)配置WebSphere应用程序。在某些服务器上,我对某些调用获得以下异常:

com.ibm.ws.scripting.ScriptingException:    com.ibm.websphere.management.exception.ConnectorException javax.management.JMRuntimeException:
    >> SERVER (id=......., host=........) TRACE START:
    >>    javax.management.JMRuntimeException: ADMN0022E: Access is denied for the addNotificationListener operation on AdminService MBean because of insufficient or empty credentials.
    >>       at com.ibm.ws.management.AdminServiceImpl.preInvoke(AdminServiceImpl.java:2671)
    >>       at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1312)
    >>       at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    >>       at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    >>       at com.ibm.ws.management.remote.AdminServiceForwarder.invoke(AdminServiceForwarder.java:346)
    >>       at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)
    >>       at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:86)
    >>       at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)
    >>       at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399)
    >>       at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:830)
    >>       at javax.management.remote.rmi._RMIConnectionImpl_Tie.invoke(_RMIConnectionImpl_Tie.java:751)
    >>       at javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(_RMIConnectionImpl_Tie.java:158)
    >>       at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:678)
    >>       at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:525)
    >>       at com.ibm.rmi.iiop.ORB.process(ORB.java:616)
    >>       at com.ibm.CORBA.iiop.ORB.process(ORB.java:1581)
    >>       at com.ibm.rmi.iiop.Connection.doRequestWork(Connection.java:3160)
    >>       at com.ibm.rmi.iiop.Connection.doWork(Connection.java:3030)
    >>       at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:64)
    >>       at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
    >>       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1702)
    >> SERVER (id=......., host=........) TRACE END.

获得此错误的最简单的Jython代码是:

try:

    AdminApp.edit('MY_Appl', '[ -MapEnvEntryForEJBMod [[ my.jar my.jar,META-INF/ejb-jar.xml MyServiceBean envName String "" envValue ]]]' )

    AdminConfig.save()
    print "Configure done successfully"
except ScriptingException:
    print "Error:\n"+str(sys.exc_info()[1])

我这样称呼脚本:

/some_path/WAS/WebSphere_80/AppServer/bin/wsadmin.sh -lang jython -user user -passwword password -f setejbenv.py

奇怪的是,只有一些呼叫以这种方式失败。其他调用(如为Web服务客户端设置策略集和绑定)可以正常工作。

我们正在使用WebSphere 8.0.0.9。

有没有人知道缺少哪些凭据,以及在哪里设置凭证?

0 个答案:

没有答案