You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by ipas <mi...@gmail.com> on 2011/06/19 14:29:07 UTC

Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Hi,
I am new to shiro. I'm trying to integrate shiro with vaadin. Found nice
article about shiro-vaadin integration here :
http://eneuwirt.de/2011/04/22/using-apache-shiro-to-secure-vaading-application/
. Followed this tutorial step by step but it is not working for me. I am not
using maven my server is tomcat 6.

Here is the stack trace which i get from tomcat on application startup :

SEVERE: Exception starting filter ShiroFilter
java.lang.ClassNotFoundException:
org.apache.shiro.web.servlet.IniShiroFilter
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
	at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
	at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
	at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
	at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)


My shiro specific web.xml snippet is as follows: 

<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>
[main]
[roles]
admin = *
user_role_1 = permission_1
user_role_2 = permission_2

[users]
admin = admin, admin
demo = demo, user_role_1
view = view, user_role_2
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


Any help is appreciated.

Thanking you,
Mirlan 

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6492798.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by sh...@xoxy.net.
If your Eclipse project is a Dynamic Web Project (or a Faceted Project with
the Dynamic Web Module facet enabled - this may have been added after
Galileo), the JARs under WEB-INF/lib will be added to the build path
automatically.


On Sun, Jun 19, 2011 at 1:15 PM, ipas - mipasov@gmail.com wrote:

>
> Thank you Jack Razvan it is working now. ;). I copied all necessary jar
> files into WEB-INF/lib folder. But it is really weird to include all
> libraries into built path and copy them again to the WEB-INF/lib folder.
>
>
> Regards,
> Mirlan
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6493419.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>
>

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by ipas <mi...@gmail.com>.
On 06/19/2011 09:52 PM, juminoz [via Shiro User] wrote:
> Actually, you have to include all JAR files in WEB-INF/lib yourself. I 
> have always found this to be very weird with the Tomcat plug-in. This 
> equivalent to building a WAR file and deploy it to Tomcat.
>
> Try including slf4j-api and slf4j-simple in your lib folder as well.
>
> Another option is to deployed common JAR into Tomcat so they are 
> available to all applications.
>
> http://tomcat.apache.org/tomcat-4.1-doc/appdev/deployment.html
>
> Look at the topic under Shared Library Files.
>
> HTH,
> Jack
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6493198.html 
>
> To unsubscribe from Shiro Vaadin integration. SEVERE: Exception 
> starting filter ShiroFilter error, click here 
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6492798&code=bWlwYXNvdkBnbWFpbC5jb218NjQ5Mjc5OHwxNzM2MTIwNjcw>. 
>
Thank you Jack Razvan it is working now. ;). I copied all necessary jar 
files into WEB-INF/lib folder. But it is really weird to include all 
libraries into built path and copy them again to the WEB-INF/lib folder.


Regards,
Mirlan


--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6493419.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by juminoz <ju...@hotmail.com>.
Actually, you have to include all JAR files in WEB-INF/lib yourself. I have
always found this to be very weird with the Tomcat plug-in. This equivalent
to building a WAR file and deploy it to Tomcat.

Try including slf4j-api and slf4j-simple in your lib folder as well.

Another option is to deployed common JAR into Tomcat so they are available
to all applications.

http://tomcat.apache.org/tomcat-4.1-doc/appdev/deployment.html

Look at the topic under Shared Library Files.

HTH,
Jack

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6493198.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by ipas <mi...@gmail.com>.
On 06/19/2011 07:02 PM, ipas [via Shiro User] wrote:
> Hi Razvan.
>
> I am using Eclipse galileo WTP. In my build path i have included 
> shiro-core-1.1.0.jar and shiro-web-1.1.0.jar as a user library. To 
> make sure i have hard copied them to WEB-INF/lib folder too, but i get 
> same error.
>
>
> Regards,
> Mirlan
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6492853.html 
>
> To unsubscribe from Shiro Vaadin integration. SEVERE: Exception 
> starting filter ShiroFilter error, click here 
> <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6492798&code=bWlwYXNvdkBnbWFpbC5jb218NjQ5Mjc5OHwxNzM2MTIwNjcw>. 
>
I was wrong after i copied them to WEB-INF i get another error :

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
     at 
org.apache.shiro.web.servlet.AbstractFilter.<clinit>(AbstractFilter.java:40)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
     at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
     at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
     at java.lang.Class.newInstance0(Class.java:372)
     at java.lang.Class.newInstance(Class.java:325)
     at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
     at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
     at 
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
     at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
     at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
     at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
     at 
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
     at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
     at 
org.apache.catalina.core.StandardService.start(StandardService.java:525)
     at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:616)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
     at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
     at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
     ... 25 more

I think it is asking me for slf4j right?

But when i am adding libraries to the build path isn't it directly 
included into WEB-INF/lib folder when i build them and deploy?


Regards.
Mirlan


--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6492859.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by ipas <mi...@gmail.com>.
Hi Razvan.

I am using Eclipse galileo WTP. In my build path i have included
shiro-core-1.1.0.jar and shiro-web-1.1.0.jar as a user library. To make sure
i have hard copied them to WEB-INF/lib folder too, but i get same error.


Regards,
Mirlan

--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6492853.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Shiro Vaadin integration. SEVERE: Exception starting filter ShiroFilter error

Posted by Razvan Dragut <ra...@gmail.com>.
Hi Mirlan,

what shiro jar files do you have in your classpath ?
You also need to make sure these shiro jar files are in your WEB-INF/lib
directory when you start up your webapp.

Razvan

On Sun, Jun 19, 2011 at 1:29 PM, ipas <mi...@gmail.com> wrote:

> Hi,
> I am new to shiro. I'm trying to integrate shiro with vaadin. Found nice
> article about shiro-vaadin integration here :
>
> http://eneuwirt.de/2011/04/22/using-apache-shiro-to-secure-vaading-application/
> . Followed this tutorial step by step but it is not working for me. I am
> not
> using maven my server is tomcat 6.
>
> Here is the stack trace which i get from tomcat on application startup :
>
> SEVERE: Exception starting filter ShiroFilter
> java.lang.ClassNotFoundException:
> org.apache.shiro.web.servlet.IniShiroFilter
>        at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
>        at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
>        at
>
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
>        at
>
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
>        at
>
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
>        at
>
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
>        at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
>        at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>        at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>        at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>        at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>        at
> org.apache.catalina.core.StandardService.start(StandardService.java:525)
>        at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
>
>
> My shiro specific web.xml snippet is as follows:
>
> <filter>
> <filter-name>ShiroFilter</filter-name>
> <filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class>
> <init-param>
> <param-name>config</param-name>
> <param-value>
> [main]
> [roles]
> admin = *
> user_role_1 = permission_1
> user_role_2 = permission_2
>
> [users]
> admin = admin, admin
> demo = demo, user_role_1
> view = view, user_role_2
> </param-value>
> </init-param>
> </filter>
> <filter-mapping>
> <filter-name>ShiroFilter</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
>
>
> Any help is appreciated.
>
> Thanking you,
> Mirlan
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Shiro-Vaadin-integration-SEVERE-Exception-starting-filter-ShiroFilter-error-tp6492798p6492798.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>