Announcement Announcement Module
Collapse
No announcement yet.
Please help with java.lang.IncompatibleClassChangeError Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Please help with java.lang.IncompatibleClassChangeError

    Hello:

    I apologize for such a long post, but I have read the Spring book chapter on Acegi, I have read through the reference guide and I have gone through this list and I am still stuck with the following error:

    java.lang.IncompatibleClassChangeError
    net.sf.acegisecurity.intercept.web.PathBasedFilter InvocationDefinitionMap.lookupAttributes(PathBased FilterInvocationDefinitionMap.java:116)
    net.sf.acegisecurity.intercept.web.AbstractFilterI nvocationDefinitionSource.getAttributes(AbstractFi lterInvocationDefinitionSource.java:47)
    net.sf.acegisecurity.util.FilterChainProxy.doFilte r(FilterChainProxy.java:165)
    net.sf.acegisecurity.util.FilterToBeanProxy.doFilt er(FilterToBeanProxy.java:125)

    I am using Acegi version 0.8.2 with Spring 1.2.2 and also have tried Spring 1.2.3.

    My web.xm configuration is right below:

    <filter>
    <filter-name>Acegi-Security</filter-name>
    <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
    <init-param>
    <param-name>targetClass</param-name>
    <param-value>net.sf.acegisecurity.util.FilterChainProxy</param-value>
    </init-param>
    </filter>

    <filter-mapping>
    <filter-name>Acegi-Security</filter-name>
    <url-pattern>/Admin/*</url-pattern>
    </filter-mapping>

    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>

    My Spring context file is right below:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>

    <!-- ========================= Security Configuration ========================= -->
    <bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy" >
    <property name="filterInvocationDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    PATTERN_TYPE_APACHE_ANT
    /Admin**=httpSessionContextIntegrationFilter,authen ticationProcessingFilter
    </value>
    </property>
    </bean>

    <!-- ======================== AUTHENTICATION ======================= -->

    <bean id="securityInterceptor"
    class="net.sf.acegisecurity.intercept.web.FilterSe curityInterceptor">
    <property name="authenticationManager">
    <ref bean="authenticationManager"/>
    </property>
    <property name="accessDecisionManager">
    <ref bean="accessDecisionManager"/>
    </property>
    <property name="objectDefinitionSource">
    <value>
    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
    PATTERN_TYPE_APACHE_ANT
    /Admin/**=ROLE_ADMIN
    </value>
    </property>
    </bean>

    <bean id="authenticationManager"
    class="net.sf.acegisecurity.providers.ProviderMana ger">
    <property name="providers">
    <list>
    <ref bean="daoAuthenticationProvider"/>
    </list>
    </property>
    </bean>

    <!-- Automatically receives AuthenticationEvent messages from DaoAuthenticationProvider -->
    <bean id="loggerListener"
    class="net.sf.acegisecurity.providers.dao.event.Lo ggerListener"/>

    <bean id="daoAuthenticationProvider"
    class="net.sf.acegisecurity.providers.dao.DaoAuthe nticationProvider">

    <!-- <property name="userCache">-->
    <!-- <ref bean="userCache"/>-->
    <!-- </property>-->

    <property name="authenticationDao">
    <ref local="authenticationDao"/>
    </property>

    <property name="passwordEncoder">
    <ref local="passwordEncoder"/>
    </property>
    <property name="saltSource">
    <ref local="saltSource"/>
    </property>
    </bean>

    <bean id="authenticationDao"
    class="net.sf.acegisecurity.providers.dao.jdbc.Jdb cDaoImpl">
    <property name="dataSource">
    <ref bean="dataSource"/>
    </property>
    <property name="usersByUsernameQuery">
    <value>
    SELECT login,
    password
    FROM app_user
    WHERE username = ?
    and enabled = 'YES'
    </value>
    </property>
    <property name="authoritiesByUsernameQuery">
    <value>
    SELECT username,
    role
    FROM user_role
    WHERE username = ?
    </value>
    </property>
    </bean>

    <bean id="passwordEncoder"
    class="net.sf.acegisecurity.providers.encoding.Md5 PasswordEncoder"/>
    <bean id="saltSource"
    class="net.sf.acegisecurity.providers.dao.salt.Ref lectionSaltSource">
    <property name="userPropertyToUse">
    <value>userName</value>
    </property>
    </bean>

    <bean id="roleVoter" class="net.sf.acegisecurity.vote.RoleVoter">
    <property name="rolePrefix">
    <value>ROLE_</value>
    </property>
    </bean>

    <bean id="accessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased" >
    <property name="allowIfAllAbstainDecisions"><value>false</value></property>
    <property name="decisionVoters">
    <list>
    <ref bean="roleVoter"/>
    </list>
    </property>
    </bean>

    <!-- <bean id="accessDecisionManager"-->
    <!-- class="net.sf.acegisecurity.vote.UnanimousBased">-->
    <!-- <property name="decisionVoters">-->
    <!-- <list>-->
    <!-- <ref bean="roleVoter"/>-->
    <!-- </list>-->
    <!-- </property>-->
    <!-- <property name="allowIfAllAbstainDecisions">-->
    <!-- <value>true</value>-->
    <!-- </property>-->
    <!-- </bean>-->

    <!-- <bean id="userCache"-->
    <!-- class="net.sf.acegisecurity.providers.dao.cache.Eh CacheBasedUserCache">-->
    <!-- <property name="minutesToIdle">15</property>-->
    <!-- </bean>-->

    <!-- ===================== HTTP REQUEST SECURITY ==================== -->

    <bean id="httpSessionContextIntegrationFilter"
    class="net.sf.acegisecurity.context.HttpSessionCon textIntegrationFilter">
    <property name="context">
    <value>net.sf.acegisecurity.context.security.Secur eContextImpl</value>
    </property>
    </bean>

    <bean id="authenticationProcessingFilter"
    class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilter">
    <property name="authenticationManager">
    <ref local="authenticationManager"/>
    </property>
    <property name="filterProcessesUrl">
    <value>/Admin/j_acegi_security_check</value>
    </property>
    <property name="authenticationFailureUrl">
    <value>/Admin/loginFail.do</value>
    </property>
    <property name="defaultTargetUrl">
    <value>/Admin/loginSuccess.do</value>
    </property>
    </bean>

    <bean id="securityEnforcementFilter"
    class="net.sf.acegisecurity.intercept.web.Security EnforcementFilter">
    <property name="filterSecurityInterceptor">
    <ref local="securityInterceptor"/>
    </property>
    <property name="authenticationEntryPoint">
    <ref local="authenticationEntryPoint"/>
    </property>
    </bean>

    <bean id="authenticationEntryPoint"
    class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilterEntryPoint">
    <property name="loginFormUrl">
    <value>/Admin/login.do</value>
    </property>
    <property name="forceHttps"><value>false</value></property>
    </bean>

    </beans>

    I try to access http://localhost:8080/projectven/Admin and I get the stacktrace at the beginning of this email. Again, I apoligize if my mistake(s) are trivial, but I am new to Acegi and I need to get security enforced in my application.

    Thanks in advance,

  • #2
    Please try Acegi Security 0.8.3 and Spring 1.2.3 and ensure there are no old JARs of either project laying around in your web container. I suspect that is the problem, or you're using earlier versions of either project which did have a compatibiity issue corrected in 0.8.2, as shown in the changelog: http://acegisecurity.sourceforge.net...ort.html#0_8_2

    Comment

    Working...
    X