I noticed that java web start GUI application does not start for “Apache
Shiro :: Samples :: Spring”.

I use stand alone java program to access tomcat. Here its code

PropertyConfigurator.configure("web/WEB-INF/log.properties");
ctx = new
FileSystemXmlApplicationContext("/web/WEB-INF/remoting-client.xml");
LoginManagerRemote loginManager = (LoginManagerRemote)
ctx.getBean("loginManager");
UserRemote user = loginManager.login();
log.info("user name: " + user.getName());
log.info("sesssionId: " + user.getSessionId());

SampleManager sampleManager = (SampleManager) ctx.getBean("sampleManager");
sampleManager.secureMethod1();

So I write 2 spring remote beans 
first makes login and return jsessionId. 
<bean name="/login"
class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
    <property name="service" ref="loginManager"/>
    <property name="serviceInterface"
value="com.springbook.LoginManagerRemote"/>
</bean>

second is secure bean

<bean name="/sampleManager"
class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        <property name="service" ref="sampleManager"/>
        <property name="serviceInterface"
value="my.samples.shiro.spring.SampleManager"/>
        <property name="remoteInvocationExecutor"
ref="secureRemoteInvocationExecutor"/>
    </bean>

What should I do to call secure bean from my standalone client?

If I just call it after login I get 

Exception in thread "main" java.lang.IllegalStateException: 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.
        at
org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:115) 

-- 
View this message in context: 
http://n2.nabble.com/Spring-stand-alone-client-tp3910311p3910311.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to