当前位置:编程学习 > JAVA >>

jms发不了消息,大伙帮我看看是什么情况

jms是weblogic实现的,各模块如下图所示:

发送端java代码我是这么写的:

try {
//初始化 jndi命名空间环境
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); 
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
ht.put(Context.SECURITY_PRINCIPAL, "weblogic");
ht.put(Context.SECURITY_CREDENTIALS, "weblogic10");

Context ctx = new InitialContext(ht);
TopicConnectionFactory factory = (TopicConnectionFactory)ctx.lookup("ConnectionFactory");

//创建一个Connection
TopicConnection conn = factory.createTopicConnection();

//建立不需要事务的并且能够自动确认已接收的会话 
Session session = conn.createSession(false,TopicSession.AUTO_ACKNOWLEDGE);

//找到主题
Destination destination = (Destination) ctx.lookup("Topic");

//生产者
MessageProducer producer = session.createProducer(destination);

System.out.println("-----消息发送-----");

TextMessage msg = session.createTextMessage("hello java Message service of topic.");
 
producer.send(msg);

System.out.println(msg);

System.out.println("-----消息发送结束-----");

} catch (Exception e) {
e.printStackTrace();
}

发送的时候报错了,异常如下:

2013-12-5 19:50:19 com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
警告: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(Unknown Source)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(Unknown Source)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(Unknown Source)
at weblogic.jms.frontend._FEConnectionFactoryRemote_Stub.connectionCreateRequest(_FEConnectionFactoryRemote_Stub.java:92)
at weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:238)
at weblogic.jms.client.JMSConnectionFactory.createConnectionInternal(JMSConnectionFactory.java:299)
at weblogic.jms.client.JMSConnectionFactory.createConnection(JMSConnectionFactory.java:205)
at com.hiaward.send.JMSSender.main(JMSSender.java:47)
Caused by: java.io.StreamCorruptedException: [Messaging:282000]Unsupported class version 8. Expected a value between 1 and 7 inclusive.
at weblogic.jms.common.JMSUtilities.versionIOException(JMSUtilities.java:102)
at weblogic.jms.client.JMSConnection.readExternal(JMSConnection.java:2038)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(Unknown Source)
at com.sun.corba.se.impl.io.IIOPInputStream.易做图ReadObject(Unknown Source)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(Unknown Source)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(Unknown Source)
... 7 more
weblogic.jms.common.JMSException: [JMSClientExceptions:055053]Error creating connection to the server: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is: 
org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
at weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:272)
at weblogic.jms.client.JMSConnectionFactory.createConnectionInternal(JMSConnectionFactory.java:299)
at weblogic.jms.client.JMSConnectionFactory.createConnection(JMSConnectionFactory.java:205)
at com.hiaward.send.JMSSender.main(JMSSender.java:47)
Caused by: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is: 
org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
at weblogic.jms.frontend._FEConnectionFactoryRemote_Stub.connectionCreateRequest(_FEConnectionFactoryRemote_Stub.java:106)
at weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:238)
... 3 more
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(Unknown Source)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(Unknown Source)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(Unknown Source)
at weblogic.jms.frontend._FEConnectionFactoryRemote_Stub.connectionCreateRequest(_FEConnectionFactoryRemote_Stub.java:92)
... 4 more
Caused by: java.io.StreamCorruptedException: [Messaging:282000]Unsupported class version 8. Expected a value between 1 and 7 inclusive.
at weblogic.jms.common.JMSUtilities.versionIOException(JMSUtilities.java:102)
at weblogic.jms.client.JMSConnection.readExternal(JMSConnection.java:2038)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(Unknown Source)
at com.sun.corba.se.impl.io.IIOPInputStream.易做图ReadObject(Unknown Source)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(Unknown Source)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(Unknown Source)
... 7 more



网上查了好多资料,但是还是解决不了,哪位大牛帮我看看,感激不尽! --------------------编程问答-------------------- 期待大拿!!! --------------------编程问答-------------------- 明显是JDK版本问题 
Unsupported class version 8. Expected a value between 1 and 7 inclusive.
补充:Java ,  Java EE
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,