Results 1 to 5 of 5
- 09-28-2011, 10:42 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 28
- Rep Power
- 0
eclipse shiro classpath problem...
Hi,
I have a problem with setting Shiro up in Eclipse: I put the shiro.ini file in regular places and address it from web.xml just as usual way and I get to error.
As I'm trying toward a proof of concept, I do no change and make everything the way described in tutorials.
Probably I don't understand something from Eclipse and this is not a Shiro question.
In an article I followed:
This is Stuff: Apache Shiro Part 1 - Basics
It suggests:
Create Shiro.ini file and put it on classpath. Configure web.xml to call IniShiroFilter before each request:
so as you see, configPath states that Shiro.ini is in classpath, but when I put the Shiro.ini in the src folder of my project under Eclipse, the error message says failed to find the stated resource. Also, when I move it to WEB-INF directory (another default place) it can't find it.Java Code:<filter> <filter-name>ShiroFilter</filter-name> <filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class> <init-param> <param-name>configPath</param-name> <param-value>classpath:Shiro.ini</param-value> </init-param> </filter> <filter-mapping> <filter-name>ShiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Could anybody please suggest something new to try or a solution?
- 09-28-2011, 11:50 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: eclipse shiro classpath problem...
As with all these cases I would recommend usnig the reall documentation, not someone elses interpretation of it.
Try here.
According to that this is what should be in your web.xml:
And the ini should really be in your WEB-INF.Java Code:<listener> <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class> </listener> ... <filter> <filter-name>ShiroFilter</filter-name> <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class> </filter> <filter-mapping> <filter-name>ShiroFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Try it that way and get that to work before attempting custom locations.
- 09-28-2011, 12:08 PM #3
Member
- Join Date
- Nov 2009
- Posts
- 28
- Rep Power
- 0
Re: eclipse shiro classpath problem...
Thank you very much! I did it as you said and it solved!
I actually ready everything, including documentation (fully), but I read that tutorial last and eyes didn't want to "see" :D
- 09-28-2011, 12:14 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: eclipse shiro classpath problem...
Tutorial Blindness...:D
- 09-28-2011, 12:25 PM #5
Member
- Join Date
- Nov 2009
- Posts
- 28
- Rep Power
- 0
Similar Threads
-
checking runtime classpath in Eclipse
By debu37 in forum EclipseReplies: 3Last Post: 11-23-2012, 01:29 AM -
classpath - packaging problem
By marquis in forum New To JavaReplies: 6Last Post: 07-31-2011, 09:42 PM -
classpath problem
By Nifras in forum New To JavaReplies: 6Last Post: 11-28-2009, 04:49 PM -
classpath problem
By shwein in forum New To JavaReplies: 4Last Post: 04-01-2009, 12:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks