• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring RMI Remoting Maven Build ClassCast Execption

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic