JBOSS4.2.2 Spring2.0.8 web中调用EJB异常
来源:互联网 发布:c语言格雷戈里公式 编辑:程序博客网 时间:2024/05/30 23:27
从容器外能够正常调用EJB,但是web 应用中spring bean调用EJB出现下面异常 <bean id="secuContainerBo" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean"> <property name="jndiName" value="oss.service.security.business.SecuContainerBo"/> <property name="businessInterface" value="oss.service.security.business.ISecuContainerBo"/> <property name="lookupHomeOnStartup" value="false"/> </bean>
RemoteProxyFailureException: No matching RMI stub method found for: public abstract
从JSP页面直接调用EJB <% Hashtable hs = new Hashtable(); hs.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory"); hs.put("java.naming.provider.url","jnp://localhost:1099"); hs.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); Context iniCtx = new InitialContext(hs); Object ref = iniCtx.lookup("oss.service.security.business.SecuContainerBo"); oss.service.security.business.SecuContainerBoEJBHome ejbHomeObject = (oss.service.security.business.SecuContainerBoEJBHome) PortableRemoteObject.narrow(ref, oss.service.security.business.SecuContainerBoEJBHome.class); out.print((ejbHomeObject.create()).loadAllAuth(new oss.service.security.domain.SysStaffMember())); %> java.rmi.ServerException: EJBException:; nested exception is: javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract
解决办法:
1。修改 conf/jboss-service.xml 中NamingService 的CallByValue 参数值为'true'
<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">true</attribute> <!-- The listening port for the bootstrap JNP service. Set this to -1 to run the NamingService without the JNP invoker listening port. -->
2。修改 deploy/ear-deployer.xml,中的Isloated和CallByValue 为 true
<server> <!-- EAR deployer, remove if you are not using ear deployments --> <mbean code="org.jboss.deployment.EARDeployer" name="jboss.j2ee:service=EARDeployer"> <!-- A flag indicating if ear deployments should have their own scoped class loader to isolate their classes from other deployments. --> <attribute name="Isolated">true</attribute> <!-- A flag indicating if the ear components should have in VM call optimization disabled. --> <attribute name="CallByValue">true</attribute> <!-- A flag the enables the default behavior of the ee5 library-directory. If true, the lib contents of an ear are assumed to be the default value for library-directory in the absence of an explicit library-directory. If false, there must be an explicit library-directory. --> <attribute name="EnablelibDirectoryByDefault">true</attribute> </mbean> </server>
3。修改 deploy/jboss-web.deployer/META-INF/jboss-service.xml中的Java2ClassLoadingCompilance 和 UseJbossWebLoader为true
<!-- Get the flag indicating if the normal Java2 parent first class loading model should be used over the servlet 2.3 web container first model. --> <attribute name="Java2ClassLoadingCompliance">true</attribute> <!-- A flag indicating if the JBoss Loader should be used. This loader uses a unified class loader as the class loader rather than the tomcat specific class loader. The default is false to ensure that wars have isolated class loading for duplicate jars and jsp files. --> <attribute name="UseJBossWebLoader">true</attribute>
- JBOSS4.2.2 Spring2.0.8 web中调用EJB异常
- jboss4中远程调用ejb失败的问题
- JBOSS4.2.2 EJB WEB 群集配置与部署全过程
- jboss4中手动部署EJB
- RCP中调用EJB
- EjB vs spring2.5
- EJB调用时遭遇NotSerializableException异常
- 调用ejb出现java.lang.ClassCastException异常
- tomcat调用weblogic的EJB报异常
- EJB中bean的调用
- Glassfish不同WEB项目调用ejb对象
- 依赖注入--一个EJB中调用另一个EJB
- Weblogic中EJB调用方法总结
- ASP.NET应用程序中调用EJB
- ASP.NET应用程序中调用EJB
- ASP.NET应用程序中调用EJB
- 在独立的Tomcat 中调用EJB
- 在独立的tomcat中调用EJB
- Ant使用简介
- (转)Java多线程程序设计详细解析
- 使用用户控件属性和方法
- 技术员必备计算机英文知识
- C语言内存分配基础知识
- JBOSS4.2.2 Spring2.0.8 web中调用EJB异常
- 了解SOA风险 治理很重要
- 懈寄生---走出软件作坊:三五个人十来条枪 如何成为开发正规军(十四)(转载)
- php连接数据库类
- droplist绑定数组
- 一些面试题目
- 快速建站
- 关于网络上的言语自由
- Substitution控件