I have been struggling for a day or two trying to get a standalone Spring
example working.  My "understanding" is that I can use
SecureRemoteInvocationFactory/Executor as "pairs" between the client and the
server to bind session/subjects between the two.  Like I have seen in other
postings, I keep getting "No SecurityManager accessible to the calling code,
either bound to the org.apache.shiro.util.ThreadContext or as a vm static
singleton.  This is an invalid application configuration."   I have a class
called Authenticator that basically just authenticates a user and that seems
to work, but when I call the second method "EndOfDayPositionSource" it
doesn't seem to have any context of the Subject. Maybe I am oversimplifying
this but I thought this state would be maintained between the client/server
if I used the SecureRemoteInvocationFactory/Executor behind the scenes.  Can
someone point me to any example that could help me understand how to build a
simple client/server standalone Spring example.  It would greatly help with
my understanding of the correct way to use Shiro. 

Not sure if this helps, but I basically have two methods exported in a
Spring container.  On the server side I have defined 

   <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
      <property name="serviceName" value="AuthenticatorSource"/>
      <property name="service" ref="simpleAuthenticator"/>
      <property name="serviceInterface"
value="com.skyroad.positionmanager.Authenticator"/>
      <property name="remoteInvocationExecutor"
ref="secureRemoteInvocationExecutor"/>
  </bean>

  <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    <property name="serviceName" value="EODPositionSource"/>
    <property name="service" ref="csvEodSource"/>
    <property name="serviceInterface"
value="com.skyroad.positionmanager.EndOfDayPositionSource"/>
    <property name="remoteInvocationExecutor"
ref="secureRemoteInvocationExecutor"/>
  </bean>

and on the client side I have defined 

 <bean id="authenticatorRMI"
class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    <property name="serviceUrl"
value="rmi://${PositionManangerHost}/AuthenticatorSource"/>
    <property name="serviceInterface"
value="com.skyroad.positionmanager.Authenticator"/>
    <property name="remoteInvocationFactory"
ref="secureRemoteInvocationFactory"/>
  </bean>

  <bean id="eodRMIService"
class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    <property name="serviceUrl"
value="rmi://${PositionManangerHost}/EODPositionSource"/>
    <property name="serviceInterface"
value="com.skyroad.positionmanager.EndOfDayPositionSource"/>
    <property name="remoteInvocationFactory"
ref="secureRemoteInvocationFactory"/>
  </bean>

-- 
View this message in context: 
http://n2.nabble.com/SecureRemoteInvocationFactory-SecureRemoteInvocationExecutor-tp4234121p4234121.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to