File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring RMI Remoting Maven Build ClassCast Execption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring RMI Remoting Maven Build ClassCast Execption" Watch "Spring RMI Remoting Maven Build ClassCast Execption" New topic
Author

Spring RMI Remoting Maven Build ClassCast Execption

Bharathkvr Kumar
Greenhorn

Joined: Oct 15, 2009
Posts: 2
We have used spring remoting using RMI feature, where the service and client are deployed on same server. I am using JndiRmiServiceExporter and JndiRmiProxyFactoryBean. It works fine if i deploy the applications through weblogic workshop. But it fails at runtime when a maven build is done and deployed throwing an error

org.springframework.remoting.RemoteLookupFailureException: Could not narrow RMI stub to service interface [xxx.xxIntf]; nested exception is java.lang.ClassCastException: Cannot narrow remote object ClusterableRemoteRef(1683913221122928763S::production_domain:AdminServer [1683913221122928763S::production_domain:AdminServer/416])/416 to xxxx.xxIntf

Client applicationContext xml entries
<bean class="org.springframework.remoting.rmi.JndiRmiServiceExporter">
<property name="service" value="xxxxImpl"/>
<property name="jndiName" value="jndiName"/>
<property name="serviceInterface" value="xxxxIntf"/>
</bean>

Server applicationContext xml entries

<bean id="bean-id" class="org.springframework.remoting.rmi.JndiRmiProxyFactoryBean">

<property name="jndiName" value="jndiName"/>
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.url.pkgs">weblogic.jndi.factories</prop>
</props>
</property>
<property name="serviceInterface" value="xxxxxIntf"/>
<property name="refreshStubOnConnectFailure"><value>true</value></property>
<property name="lookupStubOnStartup"><value>false</value></property>
</bean>

Does anything has to be included when a maven build is done.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring RMI Remoting Maven Build ClassCast Execption
 
Similar Threads
Obtaining Datasource in Websphere
can't create connection to JBoss MQ using Spring JMS
obtaining Datasource with Spring.
unsatisfied Dependancy exception
[Security:090398]Invalid Subject: weblogic :java.lang.SecurityException: [nested exception is java.l