11-14-2008 07:43 AM
Exception in thread "main" javax.jcr.RepositoryException: Only one active session per thread.
I've tried it with JackRabbit and there is everything ok - can i do the same with Alfresco?
11-14-2008 07:59 AM
11-16-2008 06:56 AM
import java.io.IOException;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class MyRepository {
private static final String PASSWORD = "admin";
private static final String LOGIN = "admin";
private Repository repository;
MyRepository(){
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");
repository = (Repository) context.getBean("JCR.Repository");
}
public Session getSession() throws IOException, RepositoryException {
System.out.println("Login… Getting new session… ");
return repository.login(new SimpleCredentials(LOGIN, PASSWORD.toCharArray()));
}
}
Session session = repository.getSession();
[java] net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A v
alid SecureContext was not provided in the RequestContext
[java] at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.cr
edentialsNotFound(AbstractSecurityInterceptor.java:477)
[java] at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.be
foreInvocation(AbstractSecurityInterceptor.java:355)
[java] at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecur
ityInterceptor.invoke(MethodSecurityInterceptor.java:77)
[java] at org.springframework.aop.framework.ReflectiveMethodInvocation.
proceed(ReflectiveMethodInvocation.java:176)
[java] at org.alfresco.repo.security.permissions.impl.ExceptionTranslat
orMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
[java] at org.springframework.aop.framework.ReflectiveMethodInvocation.
proceed(ReflectiveMethodInvocation.java:176)
[java] at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditCom
ponentImpl.java:256)
[java] at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditCompone
ntImpl.java:191)
[java] at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMe
thodInterceptor.java:69)
[java] at org.springframework.aop.framework.ReflectiveMethodInvocation.
proceed(ReflectiveMethodInvocation.java:176)
[java] at org.springframework.transaction.interceptor.TransactionInterc
eptor.invoke(TransactionInterceptor.java:107)
[java] MultiAccessTest stop…5
[java] at org.springframework.aop.framework.ReflectiveMethodInvocation.
proceed(ReflectiveMethodInvocation.java:176)
[java] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(J
dkDynamicAopProxy.java:210)
[java] at $Proxy21.getCurrentUserName(Unknown Source)
[java] at org.alfresco.jcr.util.JCRProxyFactory$SessionConte xtInvocatio
nHandler.invoke(JCRProxyFactory.java:124)
[java] at $Proxy84.getRootNode(Unknown Source)
[java] at pl.swmind.jcr.test.UploadTest.execute(Unknown Source)
[java] at pl.swmind.jcr.test.SingleTest.start(Unknown Source)
[java] at pl.swmind.jcr.test.MultiAccessTest.run(Unknown Source)
11-21-2008 09:30 AM
11-21-2008 10:29 AM
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.