zdravim konferenciu,
chcel som pouzit vo svojom projekte Spring a Acegi, ked som "vkladal"
Acegi presne podla navodu narazil som na nasledovnu chybu:
v subore application-acegi.xml mam:
<bean id="hibernateAuthenticationDao"
class="com.house.dao.HibernateAuthenticationDao">
<property name="userManager" ref="userManager"/>
</bean>
<bean id="daoAuthenticationProvider"
class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="hibernateAuthenticationDao"/>
<property name="userCache" ref="userCache"/>
<property name="saltSource" ref="saltSource"/>
<property name="passwordEncoder" ref="passwordEncoder"/>
</bean>
<bean id="authenticationManager"
class="org.acegisecurity.providers.ProviderManager">
<property name="providers">
<list>
<ref local="daoAuthenticationProvider"/>
</list>
</property>
</bean>
Trieda com.house.dao.HibernateAuthenticationDao vyzera nasledovne:
package com.house.dao;
import org.springframework.dao.DataAccessException;
import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UserDetailsService;
import org.acegisecurity.userdetails.UsernameNotFoundException;
import com.house.model.User;
import com.house.service.UserManager;
public class HibernateAuthenticationDao implements UserDetailsService {
private UserManager userManager;
public void setUserManager(UserManager userManager) {
this.UserManager = userManager;
}
public UserManager getUserManager() {
return userManager;
}
public UserDetails loadUserByUsername(String username) throws
UsernameNotFoundException, DataAccessException {
.....
}
}
trieda sa bez problemov prekompiluje, napriek tomu dostavam nasledovnu
chybu:
2008-01-08 21:16:33,568 ERROR ContextLoader - Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [com.house.dao.HibernateAuthenticationDao] for bean with name
'hibernateAuthenticationDao' defined in class path resource
[applicationContext-acegi.xml]; nested exception is
java.lang.ClassNotFoundException: com.house.dao.HibernateAuthenticationDao
at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1160)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:581)
....
skontroloval som preklepy, je nejaka specialna poziadavka ako ma vyzerat
bean , ked je prekompilovany a aj napriek tomu Spring pise ze ju nevie
najst ?, pretoze okrem tohoto mam v aplikacii asi 100 definicii
<bean></bean> a tam je vsetko OK.
dakujem
Ivan