Jms 如何在启用管理安全性的情况下连接到WebSphereApplicationServer8.5消息队列

Jms 如何在启用管理安全性的情况下连接到WebSphereApplicationServer8.5消息队列,jms,websphere,Jms,Websphere,我已经编写了一个针对WebSphereApplicationServer消息主题运行的小客户端测试程序。 一切正常。 现在,如果我打开管理安全,我会出错 这就是我正在使用的代码 public static void main(String[] args) { try { /** * Lookup connection factory object using jndi */ System.out.println("* Looking up CF i

我已经编写了一个针对WebSphereApplicationServer消息主题运行的小客户端测试程序。 一切正常。 现在,如果我打开管理安全,我会出错

这就是我正在使用的代码

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:这是一个不明确的定义,但也不明确定义。 javax.naming.NamingException:获取WsnNameService属性时出错[根异常为org.omg.CORBA.TRANSIENT:初始和转发的IOR不可访问vmcid:IBM次要代码:E07已完成:否] 位于com.ibm.ws.naming.util.WsnInitCtxFactory.mergewsnnsprroperties(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.\u请求中(ObjectImpl.java:458) 位于com.ibm.WsnBootstrap.\u WsnNameServiceStub.getProperties(\u WsnNameServiceStub.java:38) 位于com.ibm.ws.naming.util.WsnInitCtxFactory.mergewsnnsprroperties(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.socksocketimpl.connect(socksocketimpl.java:377) 位于java.net.Socket.connect(Socket.java:539) 位于com.ibm.ws.orbempl.transport.WSTCPTransportConnection.createSocket(WSTCPTransportConnection.java:313) 在com.ibm.CORBA.transport.TransportConnectionBase.connect(TransportConnectionBase.java:357)上 在com.ibm.ws.orbempl.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.\u createRequest(ClientDelegate.java:2008) 位于com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1186) 位于com.ibm.rmi.corba.ClientDelegate.createRequest(ClientDelegate.java:1272) ... 还有17个 我对websphere Server不是很熟悉,有人能告诉我出了什么问题吗? 我只打开了管理安全说明-公交车安全。 如果我关掉了所有的工作


谢谢你的提示

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

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

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


您可以阅读信息中心上的说明:

非常感谢。我对ssl配置有一些问题,但我知道它是有效的