cancel
Showing results for 
Search instead for 
Did you mean: 

Failed trying to run org.alfresco.jcr.example in JCR project

chi
Champ in-the-making
Champ in-the-making
Hi guys
I have been trying to run the SimpleExample.java file
But I got the following errors

I must be doing something wrong.
please help

11:24:47,546 ERROR [transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert "C:\DOCUME~1\testboy\LOCALS~1\Temp\2\Alfresco\ImageMagickContentTransformer_init_source_63748.gif"  "C:\DOCUME~1\testboy\LOCALS~1\Temp\2\Alfresco\ImageMagickContentTransformer_init_target_63749.png"
Feb 17, 2006 11:24:47 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Feb 17, 2006 11:24:48 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
11:24:49,281 ERROR [alfresco.smb.protocol] Error accessing Win32 NetBIOS, check DLL is on the path
Feb 17, 2006 11:24:49 AM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Feb 17, 2006 11:24:50 AM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
Exception in thread "main" javax.jcr.LoginException: Alfresco Repository failed to authenticate credentials: Bad credentials presented: Bad credentials presented
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:215)
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:240)
   at org.alfresco.jcr.example.SimpleExample.main(SimpleExample.java:59)
Caused by: 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:93)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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:37)
   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 $Proxy43.authenticate(Unknown Source)
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:210)
   … 2 more
Caused by: net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.getUserFromBackend(DaoAuthenticationProvider.java:393)
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:225)
   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)
   … 21 more
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:93)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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:37)
   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 $Proxy43.authenticate(Unknown Source)
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:210)
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:240)
   at org.alfresco.jcr.example.SimpleExample.main(SimpleExample.java:59)
Caused by: net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.getUserFromBackend(DaoAuthenticationProvider.java:393)
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:225)
   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)
   … 21 more
11:24:50,375 INFO  [admin.patch.PatchExecuter] Checking for patches to apply …
11:24:50,453 INFO  [admin.patch.PatchExecuter] No patches were required.
11:24:50,468 INFO  [service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_06-b05; maximum heap size 63.563MB
11:24:50,468 WARN  [service.descriptor.DescriptorService] Alfresco JVM - WARNING - maximum heap size 63.563MB is less than recommended 512MB
11:24:50,468 INFO  [service.descriptor.DescriptorService] Alfresco started (Open Source) - v1.2.0 (RC2); repository v1.2.0 (RC1); schema 4
4 REPLIES 4

davidc
Star Contributor
Star Contributor
Can you check the username/password is admin/admin within SimpleExample.java - it should be in the RC2 code line.

Then, can you check you can connect via the Web Client using admin/admin.  Also, check you're connecting to the correct repository store - look in repository.properties.

Can you also try SimpleExampleWithContent.java which resides in the Repository project.  This will also login as admin/admin, but directly using Alfresco's native API, rather than the JCR API.  This will determine if the issue in the JCR layer, or just a general authentication issue.

chi
Champ in-the-making
Champ in-the-making
within SimpleExample.java
The username/password is admin/admin

   Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));

I can login to the web client using admin/admin just now.
I did a search but I did not find repository.properties file.

When I run SimpleExampleWithContext.java until Repository project.

I got the following errors.

Speaking of Alfresco's native API and JCR API. Say if I am going to write a custom web client to do simple content management items such as login, navigation to the right fold then import a document.
Can I use either Alfresco's native API and JCR API?
I guess my question is when do I need to use Alfresco's native API and when I should use JCR API?

Thank you very much for your time.

15:07:04,859 ERROR [transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert "C:\DOCUME~1\testboy\LOCALS~1\Temp\2\Alfresco\ImageMagickContentTransformer_init_source_54659.gif"  "C:\DOCUME~1\testboy\LOCALS~1\Temp\2\Alfresco\ImageMagickContentTransformer_init_target_54660.png"
Feb 17, 2006 3:07:05 PM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Feb 17, 2006 3:07:06 PM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
15:07:07,406 ERROR [alfresco.smb.protocol] Error accessing Win32 NetBIOS, check DLL is on the path
15:07:07,515 ERROR [alfresco.ftp.protocol] FTP Socket error
java.net.BindException: Address already in use: JVM_Bind
   at java.net.PlainSocketImpl.socketBind(Native Method)
   at java.net.PlainSocketImpl.bind(Unknown Source)
   at java.net.ServerSocket.bind(Unknown Source)
   at java.net.ServerSocket.<init>(Unknown Source)
   at java.net.ServerSocket.<init>(Unknown Source)
   at org.alfresco.filesys.ftp.FTPNetworkServer.run(FTPNetworkServer.java:377)
   at java.lang.Thread.run(Unknown Source)
Feb 17, 2006 3:07:07 PM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=localhost,port=8100,tcpNoDelay=1"…
Feb 17, 2006 3:07:08 PM net.sf.joott.uno.UnoConnection connect
SEVERE: connection failed: com.sun.star.connection.NoConnectException: java.net.ConnectException: Connection refused: connect
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:93)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   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:37)
   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 $Proxy43.authenticate(Unknown Source)
   at org.alfresco.example.SimpleExampleWithContent.doExample(SimpleExampleWithContent.java:104)
   at org.alfresco.example.SimpleExampleWithContent.access$0(SimpleExampleWithContent.java:96)
   at org.alfresco.example.SimpleExampleWithContent$1.doWork(SimpleExampleWithContent.java:88)
   at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:129)
   at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:74)
   at org.alfresco.example.SimpleExampleWithContent.main(SimpleExampleWithContent.java:92)
Caused by: net.sf.acegisecurity.BadCredentialsException: Bad credentials presented
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.getUserFromBackend(DaoAuthenticationProvider.java:393)
   at net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider.authenticate(DaoAuthenticationProvider.java:225)
   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)
   … 24 more
15:07:08,609 INFO  [admin.patch.PatchExecuter] Checking for patches to apply …
15:07:08,687 INFO  [admin.patch.PatchExecuter] No patches were required.
15:07:08,687 INFO  [service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_06-b05; maximum heap size 63.563MB
15:07:08,687 WARN  [service.descriptor.DescriptorService] Alfresco JVM - WARNING - maximum heap size 63.563MB is less than recommended 512MB
15:07:08,687 INFO  [service.descriptor.DescriptorService] Alfresco started (Open Source) - v1.2.0 (RC2); repository v1.2.0 (RC1); schema 4

fraser_crichton
Champ in-the-making
Champ in-the-making
Hi, just wondering if there has been some resolution to the login problem with the JCR as I'm now facing the same error?

leon
Champ in-the-making
Champ in-the-making
To resolve this, just to change the "dir.root" of reposity.properties to an absolute path ,eg: C:/alfresco/tomcat/alf_data for windows platform or /opt/alfresco/tomcat/alf_data for Linux
Before you run the test again, it is necessary to package the resposity jar


I hope this is what you need