"No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

"No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux

Reply | Threaded
Open this post in threaded view
|

Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

Laszlo Hornyak
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF
Reply | Threaded
Open this post in threaded view
|

回复: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF
Reply | Threaded
Open this post in threaded view
|

Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

Laszlo Hornyak
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF
Reply | Threaded
Open this post in threaded view
|

Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

Brian Demers
The Spring support in 1.4 has been updated.  We haven't had a chance to update the docs yet, but you can take a look at one of the examples: 


On Mon, Jun 5, 2017 at 3:45 AM, Laszlo Hornyak <[hidden email]> wrote:
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF

Reply | Threaded
Open this post in threaded view
|

Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei
In reply to this post by Laszlo Hornyak

Hi,

When specified <context-param> and <listener> in web.xml, following exceptions was caught.

05-Jun-2017 17:11:40.306 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
05-Jun-2017 17:11:42.286 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
 java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:296)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4734)

Acutally I used annotation of "@SpringBootApplication"  as below,

@SpringBootApplication

public class AdminBoard {

    public static void main(String[] args) throws Exception {
         SpringApplication.run(AdminBoard.class, args);
    }
    
}



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 4:54:40 AM
To: [hidden email]
Subject: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF
Reply | Threaded
Open this post in threaded view
|

Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei
In reply to this post by Laszlo Hornyak

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF
Reply | Threaded
Open this post in threaded view
|

Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

Brian Demers
You shouldn't need a shiro.ini for the spring integration at all, (unless you are using an Ini based Realm of course)

On Mon, Jun 5, 2017 at 2:22 PM, Yu Wei <[hidden email]> wrote:

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF

Reply | Threaded
Open this post in threaded view
|

回复: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei

Without shiro.ini, should I configure all shiro related in applicationcontext.xml?

Jared
Interested in cloud computing,big data processing,linux

2017年6月6日 04:28于 Brian Demers <[hidden email]>写道:
You shouldn't need a shiro.ini for the spring integration at all, (unless you are using an Ini based Realm of course)

On Mon, Jun 5, 2017 at 2:22 PM, Yu Wei <[hidden email]> wrote:

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

Brian Demers
Yes, see: https://github.com/apache/shiro/blob/master/samples/spring-xml/src/main/webapp/WEB-INF/applicationContext.xml

I'd typically recommend programatic configuration of beans, but either way will work

On Mon, Jun 5, 2017 at 7:37 PM, Yu Wei <[hidden email]> wrote:

Without shiro.ini, should I configure all shiro related in applicationcontext.xml?

Jared
Interested in cloud computing,big data processing,linux

2017年6月6日 04:28于 Brian Demers <[hidden email]>写道:
You shouldn't need a shiro.ini for the spring integration at all, (unless you are using an Ini based Realm of course)

On Mon, Jun 5, 2017 at 2:22 PM, Yu Wei <[hidden email]> wrote:

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF


Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei

Hi Brian,

Thanks for the information. I read the source code you mentioned, but I still failed to resolve my problem.

It seemed that applicationContext.xml in directory webapp/WEB-INF was not picked up.


I have following code.

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class AdminBoard {

    public static void main(String[] args) throws Exception {
         SpringApplication.run(AdminBoard.class, args);
    }
    
}
Does "@SpringBootApplication" make any unexpected auto configuartion?


Any advice for further debug this problem?


Actually applicationContext.xml only have bean of "shiroFilter" as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="loginUrl" value="/s/login"/>
    <property name="successUrl" value="/s/index"/>
    <property name="unauthorizedUrl" value="/s/unauthorized"/>
    <property name="filterChainDefinitions">
        <value>
            /dashboard/users/list = authc, roles[admin]
            /dashboard/users/view/* = authc, roles[admin]
            /dashboard/users/update/* = authc, roles[super]
            /dashboard/users/delete/* = authc, roles[super]
            /dashboard/users/** = authc, roles[admin]
        </value>
    </property>
</bean>




Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Brian Demers <[hidden email]>
Sent: Tuesday, June 6, 2017 10:27:56 PM
To: [hidden email]
Subject: Re: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes, see: https://github.com/apache/shiro/blob/master/samples/spring-xml/src/main/webapp/WEB-INF/applicationContext.xml

I'd typically recommend programatic configuration of beans, but either way will work

On Mon, Jun 5, 2017 at 7:37 PM, Yu Wei <[hidden email]> wrote:

Without shiro.ini, should I configure all shiro related in applicationcontext.xml?

Jared
Interested in cloud computing,big data processing,linux

2017年6月6日 04:28于 Brian Demers <[hidden email]>写道:
You shouldn't need a shiro.ini for the spring integration at all, (unless you are using an Ini based Realm of course)

On Mon, Jun 5, 2017 at 2:22 PM, Yu Wei <[hidden email]> wrote:

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF


Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot

yuwei
In reply to this post by Brian Demers

I resolved the problem by adding @ImportResource({"classpath*:applicationContext.xml"})



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Brian Demers <[hidden email]>
Sent: Tuesday, June 6, 2017 10:27:56 PM
To: [hidden email]
Subject: Re: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes, see: https://github.com/apache/shiro/blob/master/samples/spring-xml/src/main/webapp/WEB-INF/applicationContext.xml

I'd typically recommend programatic configuration of beans, but either way will work

On Mon, Jun 5, 2017 at 7:37 PM, Yu Wei <[hidden email]> wrote:

Without shiro.ini, should I configure all shiro related in applicationcontext.xml?

Jared
Interested in cloud computing,big data processing,linux

2017年6月6日 04:28于 Brian Demers <[hidden email]>写道:
You shouldn't need a shiro.ini for the spring integration at all, (unless you are using an Ini based Realm of course)

On Mon, Jun 5, 2017 at 2:22 PM, Yu Wei <[hidden email]> wrote:

Hi,

I still don't quite understand the relationship between shiro.ini and applicationContext.xml.

For example, I put following stuff into shiro.ini.

datasrc = org.apache.shiro.jndi.JndiObjectFactory
datasrc.requiredType = javax.sql.DataSource
datasrc.resourceName = mysql/ustudy
datasrc.resourceRef = true


Then I got following exception,

05-Jun-2017 18:15:54.326 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.apache.shiro.web.env.EnvironmentLoaderListener]
 java.lang.IllegalStateException: Unable to look up javax.sql.DataSource with jndi name 'mysql/ustudy'.
        at org.apache.shiro.jndi.JndiObjectFactory.getInstance(JndiObjectFactory.java:44)
        at org.apache.shiro.config.ReflectionBuilder.resolveReference(ReflectionBuilder.java:417)
        at org.apache.shiro.config.ReflectionBuilder.resolveValue(ReflectionBuilder.java:572)

Which other configurations did I missed?


Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux


From: Laszlo Hornyak <[hidden email]>
Sent: Monday, June 5, 2017 3:45:02 PM
To: [hidden email]
Subject: Re: Re: "No bean named 'shiroFilter' available" when try to integrate shiro with spring boot
 
Yes I believe the shiro.ini is needed or at least it is practical to have it separate from the rest of your application configuration, since typically applicationContext will be all the same in dev and production environment, while you very likely need completely different security settings.

On Mon, Jun 5, 2017 at 2:15 AM, Yu Wei <[hidden email]> wrote:

I didn't have web.xml at first, it's generated by spring autoconfiguration. When integrated with shiro, I only added shiro related in web.xml.
I have little experience in using spring and shiro. This is my mistake.
Another question is about shiro.ini.
Is shiro.ini still needed when integrating with spring? I only found description about setting applicationContext.xml when integrating with shiro.

Thanks for your help.
Jared
Interested in cloud computing,big data processing,linux

2017年6月5日 04:54于 Laszlo Hornyak <[hidden email]>写道:
Hi,

Did spring start up at all? You do not have it in your web.xml...

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>



On Sun, Jun 4, 2017 at 7:23 PM, Yu Wei <[hidden email]> wrote:

Hi guys,

I tried to integrate shiro with spring boot by following document in Apache shiro.

I found a problem when trying to deploy war to tomcat as below:

04-Jun-2017 16:16:00.163 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Shiro environment
04-Jun-2017 16:16:00.448 SEVERE [main] org.apache.catalina.core.StandardContext.filterStart Exception starting filter [shiroFilter]
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'shiroFilter' available
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)


According to shiro document, I should add applicationContext.xml with proper settings. Where should I place the context file? In WEB-INF or other directory?


How could I fix this problem?


Detailed configuration is as below,


Web.xml in directory WEB-INF is as following,

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">   
    <!-- configuration for Aapache shiro -->
    <listener>
        <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>shiroFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetFilterLifecycle</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>shiroFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    
</web-app>

applicationContext.xml is placed in folder WEB-INF, and content is as below,

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <property name="filterChainDefinitions">
        <value>/dashboard/users/list = authc, roles[admin]</value>
    </property>
</bean>

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
    <property name="realm" ref="myRealm"/>
    <!-- By default the servlet container sessions will be used.  Uncomment this line
         to use shiro's native sessions (see the JavaDoc for more): -->
    <!-- <property name="sessionMode" value="native"/> -->
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>

<!-- Define the Shiro Realm implementation you want to use to connect to your back-end -->
<!-- security datasource: -->
<bean id="myRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm">
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"/>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"/>
</bean>
</beans>



Thanks,

Jared, (韦煜)
Software developer
Interested in open source software, big data, Linux




--

EOF



--

EOF