Results 1 to 5 of 5
  1. #1
    kievari is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Default 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:
    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>
    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.

    Could anybody please suggest something new to try or a solution?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default 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:
    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>
    And the ini should really be in your WEB-INF.
    Try it that way and get that to work before attempting custom locations.

  3. #3
    kievari is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Default 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

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: eclipse shiro classpath problem...

    Tutorial Blindness...:D

  5. #5
    kievari is offline Member
    Join Date
    Nov 2009
    Posts
    28
    Rep Power
    0

    Default Re: eclipse shiro classpath problem...

    I can't also find here, how to declare this post closed (that I happily got my answer)?!

Similar Threads

  1. checking runtime classpath in Eclipse
    By debu37 in forum Eclipse
    Replies: 3
    Last Post: 11-23-2012, 02:29 AM
  2. classpath - packaging problem
    By marquis in forum New To Java
    Replies: 6
    Last Post: 07-31-2011, 10:42 PM
  3. classpath problem
    By Nifras in forum New To Java
    Replies: 6
    Last Post: 11-28-2009, 05:49 PM
  4. classpath problem
    By shwein in forum New To Java
    Replies: 4
    Last Post: 04-01-2009, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •