10-06-2009 08:41 AM
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
// Retrieve Repository
Repository repository = (Repository)context.getBean("JCR.Repository");
// Login to workspace
// Note: Default workspace is the one used by Alfresco Web Client which contains all the Spaces
// and their documents
Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
But this code doesn't specify any ip or whatever. Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [alfresco/application-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [alfresco/application-context.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.docbyte.migration.action.Migrate.go(Migrate.java:19)
at com.docbyte.migration.action.Migrate.main(Migrate.java:15)
Caused by: java.io.FileNotFoundException: class path resource [alfresco/application-context.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
… 14 more
10-06-2009 01:13 PM
10-07-2009 03:16 AM
10-19-2009 08:39 AM
02-22-2010 09:35 AM
<alfresco-config>
<!– Overriding endpoints to reference a remote Alfresco server –>
<config evaluator="string-compare" condition="Remote">
<remote>
<endpoint>
<id>alfresco-noauth</id>
<name>Alfresco - unauthenticated access</name>
<description>Access to Alfresco Repository WebScripts that do not require authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://ec2-79-125-30-107.eu-west-1.compute.amazonaws.com/alfresco/s</endpoint-url>
<identity>none</identity>
</endpoint>
<endpoint>
<id>alfresco</id>
<name>Alfresco - user access</name>
<description>Access to Alfresco Repository WebScripts that require user authentication</description>
<connector-id>alfresco</connector-id>
<endpoint-url>http://ec2-79-125-30-107.eu-west-1.compute.amazonaws.com/alfresco/s</endpoint-url>
<identity>user</identity>
</endpoint>
<endpoint>
<id>alfresco-feed</id>
<name>Alfresco Feed</name>
<description>Alfresco Feed - supports basic HTTP authentication</description>
<connector-id>http</connector-id>
<endpoint-url>http://ec2-79-125-30-107.eu-west-1.compute.amazonaws.com/alfresco/s</endpoint-url>
<basic-auth>true</basic-auth>
<identity>user</identity>
</endpoint>
</remote>
</config>
</alfresco-config>
02-23-2010 05:07 AM
02-26-2010 10:08 AM
04-21-2010 07:01 AM
02-04-2011 05:03 AM
ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:alfresco/jcr-context.xml");
Repository repository = (Repository) context.getBean("JCR.Repository");
I tested the same code using java console program. there it is working fine. I am using netbeans for the development. please help me for getting a good solution….
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.