Add spring-web.jar or spring-webmvc.jar to your classpath.

(Which one depends on which Spring version you use.
RequestUtils moved from spring-web.jar to spring-webmvc.jar in version 2.5)


tapestry5-acegi does not bring it in automatically.

HTH,
Olle


2008/3/27, Jacob Bergoo <[EMAIL PROTECTED]>:
>
>
> Hi again,
> thanks to your advice I have manage to come a few steps closer to a
> working
> solution. But now I get this exception:
>
> [WARN] ServletHandler Error for /j_acegi_security_check
> java.lang.NoClassDefFoundError: org/springframework/web/bind/RequestUtils
>         at
>
> org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.rememberMeRequested
> (TokenBasedRememberMeServices.java:360)
>         at
> org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.loginSuccess(
> TokenBasedRememberMeServices.java:366)
>         at
>
> $RememberMeServices_118ee374713.loginSuccess($RememberMeServices_118ee374713.java)
>         at
> org.acegisecurity.ui.AbstractProcessingFilter.successfulAuthentication(
> AbstractProcessingFilter.java:488)
>         at
> org.acegisecurity.ui.AbstractProcessingFilter.doFilter(
> AbstractProcessingFilter.java:266)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service
> (HttpServletRequestFilterWrapper.java:52)
>         at
>
> $HttpServletRequestFilter_118ee37470b.service($HttpServletRequestFilter_118ee37470b.java)
>         at
>
> $HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper$1.doFilter
> (HttpServletRequestFilterWrapper.java:57)
>         at
> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(
> HttpSessionContextIntegrationFilter.java:249)
>         at
>
> nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper.service
> (HttpServletRequestFilterWrapper.java:52)
>         at
>
> $HttpServletRequestFilter_118ee37470a.service($HttpServletRequestFilter_118ee37470a.java)
>         at
>
> $HttpServletRequestHandler_118ee374711.service($HttpServletRequestHandler_118ee374711.java)
>         at
>
> $HttpServletRequestHandler_118ee374709.service($HttpServletRequestHandler_118ee374709.java)
>         at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java
> :168)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at
>
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal
> (OpenSessionInViewFilter.java:198)
>         at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(
> OncePerRequestFilter.java:75)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(
> WebApplicationHandler.java:471)
>         at org.mortbay.jetty.servlet.ServletHandler.handle(
> ServletHandler.java:568)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>         at
> org.mortbay.jetty.servlet.WebApplicationContext.handle(
> WebApplicationContext.java:633)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java
> :820)
>         at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java
> :986)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
>         at
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> Caused by: java.lang.ClassNotFoundException:
> org.springframework.web.bind.RequestUtils
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>         ... 31 more
>
>   And on the web page it say:
> HTTP ERROR: 500
>
> org/springframework/web/bind/RequestUtils
>
> RequestURI=/j_acegi_security_check
>
> This is what I have done so far:
>
> In my AppModule.java:
>
> public static void contributeApplicationDefaults(
>                         MappedConfiguration<String, String> configuration)
> {
>
>         configuration.add("tapestry.supported-locales", "en");
>         configuration.add("acegi.loginform.url", "/loginPage");
>
>         configuration.add("acegi.password.salt", "");
>         configuration.add("acegi.accessDenied.url", "/SecurityException");
> }
>
>
> public static void contributeProviderManager(
>         OrderedConfiguration<AuthenticationProvider> configuration,
>         @InjectService("DaoAuthenticationProvider")
>
>         AuthenticationProvider daoAuthenticationProvider) {
>
>         configuration.add("daoAuthenticationProvider",
> daoAuthenticationProvider);
> }
>
> I have a UserDetailsServiceImpl like this:
> public class UserDetailsServiceImpl implements UserDetailsService {
>
>         /* PRIVATE MEMBERS */
>         private AppUserDao appUserDao;
>
>         /* DAO SETTERS */
>         public void setAppUserDao(AppUserDao appUserDao){
>                 this.appUserDao = appUserDao;
>         }
>
>         public UserDetails loadUserByUsername(String username) throws
> UsernameNotFoundException, DataAccessException {
>                 return new UserDetailsBean(appUserDao.findById(username));
>         }
> }
>
> I hoocked up this service using spring:
> <bean id="userDetailsService"
> class="com.bergoo.webshop.services.internal.UserDetailsServiceImpl">
>         <property name="appUserDao" ref="appUserDao"/>
> </bean>
>
> UserDetailsBean is the same as from the example for Tapestry5-Acegi
> project
> except that I added a constructor that take in my AppUser object and I
> added
> a new toString() method so I can see the content.
>
> GrantedAuthorityBean.java, Start.java, Start.tml, LoginPage.java,
> LoginPage.tml, Secure.java, Secure.tml are the same as in the example...
>
> I put a system.out.println() in the end of the constructor where I create
> the UserDetailsBean and this is what the sysout returns:
>
> UserDetailsBean {
>         username = jacob
>         password = jacob
>         accountNonExpired = true
>         passwordaccountNonLocked = true
>         credentialsNonExpired = true
>         enabled = true
>         grantedAuthorities {
>                 'ROLE_ADMIN'
>                 'ROLE_MANAGER'
>                 'ROLE_USER'
>         }
> }
>
> That means that The part where I access the database and gets the user
> information for the security check is working... but it looks like I get
> this exception when I am in the loginSuccess method....
>
> Does anybody have any idears on how to fix this exception?
> I have spring-web in my pom.xml...
>
> thanks in advance for any help, pointers...
>
> Jacob
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16321412.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se

Reply via email to