无法将消息发送到weblogic队列 [英] cannot send message to weblogic queues

查看:156
本文介绍了无法将消息发送到weblogic队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将字符串消息发送到在weblogic服务器中创建的JMS队列中.我使用Eclipse IDE,当我运行Web应用程序时出现以下错误,tomcat服务器关闭.错误是

Iam trying to send a string message into a JMS queue created in weblogic server. Iam using Eclipse ide and when i run my web application i get the following error and the tomcat server gets shutdown.The error is

javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is: 
    java.io.StreamCorruptedException: invalid type code: 31]
    at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
    at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:32)
    at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
    at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:673)
    at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:466)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)
    at weblogic.jndi.Environment.getContext(Environment.java:307)
    at weblogic.jndi.Environment.getContext(Environment.java:277)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at com.infotech.jms.JMSBEAQueueSend.sendMessage(JMSBEAQueueSend.java:48)
    at com.infotech.struts.actions.AppAction.execute(AppAction.java:75)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is: 
    java.io.StreamCorruptedException: invalid type code: 31
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:229)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
    at weblogic.common.internal.RMIBootServiceImpl_1001_WLStub.authenticate(Unknown Source)
    at weblogic.security.acl.internal.Security$1.run(Security.java:185)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.security.acl.internal.Security.authenticate(Security.java:181)
    at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateRemotely(WLInitialContextFactoryDelegate.java:734)
    at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:667)
    ... 29 more
Caused by: java.io.StreamCorruptedException: invalid type code: 31
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
    at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:227)
    ... 37 more

请帮帮我.谢谢和问候

推荐答案

基于对该问题的一些快速研究,它似乎是由应用服务器和客户端之间使用不同的JDK级别引起的.我所看到的大多数示例都表明,在Java 5上运行Weblogic时,在客户端上使用Java 6时会发生这种情况.

Based on a some quick research into this issue, it appears to be caused by using different JDK levels between the app server and the client. Most of the examples I have seen have shown it to occur when using Java 6 on the client while running Weblogic on Java 5.

虽然我还没有亲自尝试过,但建议将以下内容添加到客户端应用程序的启动命令中:

While I have not personally tried it, the recommendation is to add the following to your client application's startup command:

-Dsun.lang.ClassLoader.allowArraySyntax=true

设置此属性可在ClassLoader的loadClass方法中启用向后兼容模式.

Setting this property enables a backwards compatibility mode in the ClassLoader's loadClass method.

这是一个指向Oracle论坛问题的链接,其中提供了一些其他信息.

Here is a link to an Oracle forum question that provides some additional information.

或者,如果要执行直接集成,则必须确保客户端和服务器运行相同的JVM级别.显然,这通常不是最佳解决方案.

Alternatively, you would have to look at making sure the client and server are running the same JVM level if you are performing direct integrations. Obviously, this is not usually the optimal solution.

这篇关于无法将消息发送到weblogic队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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