用spring的ejbclient访问ejb问题
在使用spring的ejb客户端访问ejb时,当客户端和ejb服务端有共用class时,
将ejb和客户端部署一起本地访问时,如果两边包中同时都有这个class则客户端使用时报classcastException,即转型转不了。。。如果只在一边部署class这样本地可以 ,但如果
将ejb和 客户端分开部署肯定有一边找不到class。。。
不知道各位有没有什么好的解决方法。。。
appcontext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="processclient"
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
<property name="jndiName">
<value>ejb/ProcessServiceEjb</value>
</property>
<property name="businessInterface">
<value>cn.ipanel.apps.interactiveprojs.commons.agent.ejbs.ProcessService</value>
</property>
<property name="jndiTemplate">
<ref local="jndiTemplate"></ref>
</property>
</bean>
<bean id="jndiTemplate"
class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">
org.jnp.interfaces.NamingContextFactory
</prop>
<prop key="java.naming.provider.url">
jnp://192.168.20.224:1099
</prop>
<prop key="java.naming.factory.url.pkgs">
org.jboss.naming:org.jnp.interfaces
</prop>
</props>
</property>
</bean>
</beans>