Hi,
 I am trying Swarm on a test project as per

http://wicketstuff.org/confluence/display/STUFFWIKI/Swarm+and+Acegi+HowTo

I got the source and build it in eclipse. When I started the server, I am
getting injection problem. I checked the libraries and they are newer than
that specified in the document. I dont understand why there is conversion
error. Please guide me.

SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'wicketApplication' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.TypeMismatchException: Failed to
convert property value of type [org.acegisecurity.providers.ProviderManager]
to required type [org.acegisecurity.AuthenticationManager] for property
'authenticationManager'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type
[org.acegisecurity.providers.ProviderManager] to required type
[org.acegisecurity.AuthenticationManager] for property
'authenticationManager': no matching editors or conversion strategy found

My web.xml is

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
<web-app>
    <display-name>Wicket Security Examples</display-name>
    <!-- Additional Spring config -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <!-- acegi filter-->
    <filter>
        <filter-name>Acegi HTTP Request Security Filter</filter-name>
       
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
        <init-param>
            <param-name>targetClass</param-name>
           
<param-value>org.acegisecurity.util.FilterChainProxy</param-value>
        </init-param>
    </filter>
    <!-- Spring Wicket app-->
    <filter>
        <filter-name>acegi</filter-name>
        <filter-class>
            org.apache.wicket.protocol.http.WicketFilter
        </filter-class>
        <init-param>
            <param-name>applicationFactoryClassName</param-name>
            <param-value>
                org.apache.wicket.spring.SpringWebApplicationFactory
            </param-value>
        </init-param>
    </filter>
    <!-- Acegi filter first, only for /acegi urls -->
    <filter-mapping>
        <filter-name>Acegi HTTP Request Security Filter</filter-name>
        <url-pattern>/acegi/*</url-pattern>
    </filter-mapping>
    <!-- regular mapping for spring wicket app -->
    <filter-mapping>
        <filter-name>acegi</filter-name>
        <url-pattern>/acegi/*</url-pattern>
    </filter-mapping>
    <!-- Listener for Spring -->
    <listener>
       
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
</web-app>

My Applicationcontext file is

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

<!-- setup wicket application -->
<bean id="wicketApplication"
class="org.apache.wicket.security.examples.acegi.MyAcegiApplication">
<property name="authenticationManager" ref="authenticationManager"/>
</bean>

<!-- acegi config -->
<!-- Proxy to a set of filters that enforce authentication and
authorization. -->
  <bean id="filterChainProxy"
class="org.acegisecurity.util.FilterChainProxy">
    <property name="filterInvocationDefinitionSource">
      <value>
        CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
        PATTERN_TYPE_APACHE_ANT
        /**=httpSessionContextIntegrationFilter
      </value>
    </property>
  </bean>

  <!-- Maintains security context between requests (using the session). -->
  <bean id="httpSessionContextIntegrationFilter"
    class="org.acegisecurity.context.HttpSessionContextIntegrationFilter">
    <property name="forceEagerSessionCreation" value="true"/>
  </bean>

   <!-- Users cache for Acegi (Ehcache). -->
   <bean id="userCache"
class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
      <property name="cache">
         <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">
            <property name="cacheManager" ref="cacheManager"/>
            <property name="cacheName"
value="your.application.name.USER_CACHE"/>
         </bean>
      </property>
   </bean>
   <bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>

   <!-- Authentication manager, configured with one provider that retrieves
authentication information
        from test data. -->
   <bean id="authenticationManager"
class="org.acegisecurity.providers.ProviderManager">
        <property name="providers">
            <list>
                <ref local="testAuthenticationProvider"/>
            </list>
        </property>
    </bean>

    <!-- Authentication provider for test authentication. -->
    <bean id="testAuthenticationProvider"
class="org.acegisecurity.providers.TestingAuthenticationProvider">
    </bean>
</beans>


Regards,
NTS
-- 
View this message in context: 
http://www.nabble.com/wicket-security-tp16790657p16790657.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to