cancel
Showing results for 
Search instead for 
Did you mean: 

First Foundation Client - Bad Credentials

sturner
Champ in-the-making
Champ in-the-making
I'm struggling with the First Foundation Client sample in the SDK. I've installed the WCM preview release ona  Win XP machine. The error I get is 'bad credentials presented', and the line of code that trips this error is:

authenticationService.authenticate("admin", "adminpassword".toCharArray());

Here's the exception:

- Alfresco started (Community Network): Current version 1.4.0 (build-105) schema 21 - Installed version 1.4.0 (Preview @build-number@) schema 21
Exception in thread "main" org.alfresco.repo.security.authentication.AuthenticationException: Bad credentials presented
   at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.authenticate(AuthenticationComponentImpl.java:69)
   at org.alfresco.repo.security.authentication.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:116)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:210)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:156)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:61)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy21.authenticate(Unknown Source)
   at org.alfresco.sample.FirstFoundationClient.doExample(FirstFoundationClient.java:87)
   at org.alfresco.sample.FirstFoundationClient$1.doWork(FirstFoundationClient.java:72)
   at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:168)
   at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:74)
   at org.alfresco.sample.FirstFoundationClient.main(FirstFoundationClient.java:76)
Caused by: net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:290)
   at net.sf.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:159)
   at net.sf.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:49)
   at org.alfresco.repo.security.authentication.AuthenticationComponentImpl.authenticate(AuthenticationComponentImpl.java:63)
   … 27 more


I've seen answers to similar questions that point to a misconfiguration of dir.root in the repository-properties file. However, it's not clear exactly what to specify.

Firstly, I have two files in the alfresco/extension directory in the project's source code:

custom-repository.properties
custom-repository-context.xml

Are these the correct file names?

Then, the properties file has the dir.root specification. Given that my alfresco is installed into C:\alfresco-wcm, what is the correct spec for dir.root? I've tried:

dir.root=c:/alfresco-wcm/alf_data
dir.root=c:\alfresco-wcm\alf_data
dir.root=c:\\alfresco-wcm\\alf_data

Same result (bad credentials) each time. I've verified that I can log in to Alfresco through the web interface (port 8080) using admin/adminpassword

Thanks for any assistance,
Steve Turner.
1 REPLY 1

sturner
Champ in-the-making
Champ in-the-making
I should also mention that I'm still using the default hsql database.

Steve