启用管理安全性后如何连接到Websphere Application Server 8.5消息队列 [英] How to connect to a websphere Application Server 8.5 Message Queue while Administrative Security is enabled

查看:439
本文介绍了启用管理安全性后如何连接到Websphere Application Server 8.5消息队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个针对 Websphere Applicationserver消息主题的客户端测试程序. 一切正常. 现在,如果我打开了管理安全性,则会收到错误消息.

i have written a little client test programm running against a Websphere Applicationserver Message Topic. All works fine. Now, if i am turning on the administrative security i got an error.

那是我正在使用的代码.

That's the code i am using.

public static void main(String[] args)
    {
    try {
    /**
    * Lookup connection factory object using jndi
    */
    System.out.println("* Looking up CF in jndi...");
    Hashtable env = new Hashtable();

    env.put(Context.PROVIDER_URL, "iiop://192.168.195.144:2809");
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");

    Context ctx = new InitialContext(env);

    TopicConnectionFactory fact=(TopicConnectionFactory)ctx.lookup("jms/Ttestsecure");
    TopicConnection connect = fact.createTopicConnection();
    TopicSession session=connect.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    Topic topic=null;
    try
    {
        topic =(Topic) ctx.lookup("jms/Totestsecure");
        System.out.println(topic.getTopicName());

    }

这是我遇到的错误

在jndi中查找CF ... JSAS1480I:死于ConfigURL-Eigenschaftendatei的定义专家. javax.naming.NamingException:获取WsnNameService属性时出错[根本异常是org.omg.CORBA.TRANSIENT:初始和转发的IOR无法访问vmcid:IBM次要代码:E07已完成:否] 在com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552) 在com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042) 在com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962) 在com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614) 在com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128) 在com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765) 在com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164) 在com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) 在javax.naming.InitialContext.lookup(InitialContext.java:436) 在testmsg.main(testmsg.java:31) 原因:org.omg.CORBA.TRANSIENT:初始和转发的IOR无法访问的vmcid:IBM次要代码:E07已完成:否 在com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1276) 在com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1457) 在com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1164) 在com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1423) 在com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1886) 在com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1379) 在org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:458) 在com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38) 在com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549) ...另外9个 由以下原因引起:java.net.ConnectException:connect:在本地计算机上地址无效,或在远程计算机上端口无效 在java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:381) 在java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:243) 在java.net.PlainSocketImpl.connect(PlainSocketImpl.java:230) 在java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377) 在java.net.Socket.connect(Socket.java:539) 在com.ibm.ws.orbimpl.transport.WSTCPTransportConnection.createSocket(WSTCPTransportConnection.java:313) 在com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:357) 在com.ibm.ws.orbimpl.transport.WSTransport.getConnection(WSTransport.java:436) 在com.ibm.CORBA.transport.TransportBase.getConnection(TransportBase.java:187) 在com.ibm.rmi.iiop.TransportManager.get(TransportManager.java:97) 在com.ibm.rmi.iiop.GIOPImpl.getConnection(GIOPImpl.java:130) 在com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:219) 在com.ibm.rmi.corba.ClientDelegate.locate(ClientDelegate.java:1983) 在com.ibm.rmi.corba.ClientDelegate._createRequest(ClientDelegate.java:2008) 在com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1186) 在com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1272) ...另外17个 我对Websphere服务器不是很熟悉,请问有人有什么问题吗? 我只打开了管理安全性说明,即总线安全性. 如果我关闭,所有的工作都会正常进行.

Looking up CF in jndi... JSAS1480I: Die Sicherheit ist nicht aktiviert, weil die ConfigURL-Eigenschaftendatei nicht definiert ist. javax.naming.NamingException: Error getting WsnNameService properties [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No] at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1552) at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:1042) at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:962) at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:614) at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128) at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179) at javax.naming.InitialContext.lookup(InitialContext.java:436) at testmsg.main(testmsg.java:31) Caused by: org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible vmcid: IBM minor code: E07 completed: No at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1276) at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1457) at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1164) at com.ibm.CORBA.iiop.ClientDelegate.createRequest(ClientDelegate.java:1423) at com.ibm.rmi.corba.ClientDelegate.request(ClientDelegate.java:1886) at com.ibm.CORBA.iiop.ClientDelegate.request(ClientDelegate.java:1379) at org.omg.CORBA.portable.ObjectImpl._request(ObjectImpl.java:458) at com.ibm.WsnBootstrap._WsnNameServiceStub.getProperties(_WsnNameServiceStub.java:38) at com.ibm.ws.naming.util.WsnInitCtxFactory.mergeWsnNSProperties(WsnInitCtxFactory.java:1549) ... 9 more Caused by: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:381) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:243) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:230) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377) at java.net.Socket.connect(Socket.java:539) at com.ibm.ws.orbimpl.transport.WSTCPTransportConnection.createSocket(WSTCPTransportConnection.java:313) at com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:357) at com.ibm.ws.orbimpl.transport.WSTransport.getConnection(WSTransport.java:436) at com.ibm.CORBA.transport.TransportBase.getConnection(TransportBase.java:187) at com.ibm.rmi.iiop.TransportManager.get(TransportManager.java:97) at com.ibm.rmi.iiop.GIOPImpl.getConnection(GIOPImpl.java:130) at com.ibm.rmi.iiop.GIOPImpl.locate(GIOPImpl.java:219) at com.ibm.rmi.corba.ClientDelegate.locate(ClientDelegate.java:1983) at com.ibm.rmi.corba.ClientDelegate._createRequest(ClientDelegate.java:2008) at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1186) at com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1272) ... 17 more I'am not very familiar with the websphere Server has anybody an advice what is going wrong ? I have only turned on the administrative security note the bus security. If i turn i off all works regular.

感谢您的任何提示.

推荐答案

您收到的异常表明您没有为客户端设置ConfigURL

The exception you got indicates you did not set the ConfigURL for the client

JSAS1480I:未启用安全性,因为ConfigURL属性文件 没有设置.

JSAS1480I: Security is not enabled because the ConfigURL property file is not set.

Explanation   The com.ibm.CORBA.ConfigURL property specified in setupCmdLine.bat or on the java command line is not set.
Action    To enable security, set the com.ibm.CORBA.ConfigURL property to a properties file which exists, such as the sas.client.props file.

你失踪了

-Dcom.ibm.CORBA.ConfigURL=file:///home/user1/sas.client.props


您可以阅读信息中心上的指示信息: 查看全文

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