cancel
Showing results for 
Search instead for 
Did you mean: 

Problem executing JCR within Alfresco.war

elmayan
Champ in-the-making
Champ in-the-making
Hy I am newly trying to learn on how to use Alfresco Repository via a JCR client,
So I created a servlet based on the SimpleExample.javaof the Alfresco SDK  1.4 JCRSamples project, and I integrated it into the Alfresco application of the Tomcat server, in the webapps/alfresco… (I am using Alfresco Community 1.4 on Windows).
When I am trying to access to my servlet (in order to execute a simple browse of the content of the repository for a user), I obtain this errors:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftsIndexerTrigger' defined in class path resource [alfresco/scheduled-jobs-context.xml]: Initialization of bean failed; nested exception is org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'ftsIndexerJobDetail' and group: 'DEFAULT', because one already exists with this identification.
caused by:
org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'ftsIndexerJobDetail' and group: 'DEFAULT', because one already exists with this identification.

## Can I just run an example of the JCR client in the alfresco.war, or I am maybe obliged todo it another from another application!!!!
Can someone explain to me How make use of the build simpleExample of the Alfresco SDK 1.4 JCRSample Project step by step???
Thank you in advance! Smiley Surprisedops:
7 REPLIES 7

ribz33
Champ on-the-rise
Champ on-the-rise

elmayan
Champ in-the-making
Champ in-the-making
Sorry but The example of Alfresco SDK JCRSamples or even the otherone FirstJCRClient isn't clear enough. It is clear that I must copy the configuration files : custom-repository.properties and custom-repository-context.xml to the  directory classpath:/alfresco/extension, but how do i execute the class file FirstJCRClient.class???
How do I integrate it to the web application alfresco!!!!! or to another web application???? Smiley Surprisedops:

ribz33
Champ on-the-rise
Champ on-the-rise
sdk use an embedded alfresco … that mean you dont need to use any war.

To run example just execute "main" classes in your eclipse. If you have well import sdk in your eclipse that would work fine.

elmayan
Champ in-the-making
Champ in-the-making
I thank you for your advises mister ribz33, but when I execute the any SDK examples, I obtain the error below:

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:213)
   at org.alfresco.jcr.repository.RepositoryImpl.login(RepositoryImpl.java:238)
   at org.alfresco.sample.jcr.SimpleExample.main(SimpleExample.java:63)
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:104)
   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)

Why do I get this error???
I did see in this forum that a lot of other persons had the same issues.
Is it a problem due to Serialization????

:wink:  anyway thanks again

ribz33
Champ on-the-rise
Champ on-the-rise
bad credentials means that alfresco don't succeed to authenticate you. So :

- Look if login/pwd is correct (default: admin/admin)
Or more probably :
- Look if you had give good path for alf_data and well define database access in custom-repository.properties of all examples.
(you need to uncomment db.driver and db.url for your database)

Pierre H.

bindiya
Champ in-the-making
Champ in-the-making
Can you please tell me how did u manage to execute code for acessing repository within alfresco.war?

Thanks
Bindiya

rdanner
Champ in-the-making
Champ in-the-making
Can you please tell me how did u manage to execute code for acessing repository within alfresco.war?

Thanks
Bindiya

What have you tried so far?