如果jsp或servlet调用ejb时报下面的错误:
INFO [STDOUT] java.rmi.ServerException: EJBException:; nested
exception is:
javax.ejb.EJBException: Invalid invocation, check your deployment packaging,
method=public abstract test.ejb.TestEJBInterface test.ejb.TestEJBHome.create()
throws javax.ejb.CreateException,java.rmi.RemoteException
解决办法有三种:
1、编辑%jboss%/server/default/conf/jboss-service.xml
<mbean code="org.jboss.naming.NamingService"
name="jboss:service=Naming"
xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
<!-- The call by value mode. true if all lookups are unmarshalled using
the caller's TCL, false if in VM lookups return the value by reference.
-->
<attribute name="CallByValue">false</attribute>
...
</mbean>
将属性CallByValue的值改为true
2、编辑%jboss%/server/default/deploy/ear-deployer.xml
<mbean code="org.jboss.deployment.EARDeployer"
name="jboss.j2ee:service=EARDeployer">
<attribute name="Isolated">false</attribute>
<attribute name="CallByValue">false</attribute>
<attribute name="EnablelibDirectoryByDefault">true</attribute>
</mbean>
将属性Isolated和CallByValue的值改为true
3、编辑%jboss%/server/default/deploy/jboss-web.deployer/META-INF/jboss-service.x
ml
<attribute name="Java2ClassLoadingCompliance">false</attribute>
<attribute name="UseJBossWebLoader">false</attribute>
将属性Java2ClassLoadingCompliance和UseJBossWebLoader的值改为false,这里默认值一
般都是false
一般情况下,使用第二种方式就可以解决该问题。
EJBException: Invalid invocation, check your deployment packaging creat
最新推荐文章于 2024-04-29 21:50:20 发布
本文介绍了解决JSP或Servlet调用EJB时出现的EJBException错误的方法。通过修改JBoss配置文件中的CallByValue、Isolated等属性,可以有效解决部署包装引起的异常。
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印
开发板推荐:天空星STM32F407VET6开发板
超高性价比 STM32主控 | 超高主频 | 一板兼容百芯 | 比赛神器 | 沉金彩色丝印

433

被折叠的 条评论
为什么被折叠?



