Page 1 of 1

Cannot log in; unable to start repository

PostPosted:Tue Oct 11, 2011 5:43 pm
by jgiordano
Hello,

I am running OpenKM 5.1 on Windows XP. When JBoss is starting up, I see errors similar to this:
Code: Select all
2011-10-11 13:05:21,750 ERROR [org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager] failed to read bundle: deadbeef-cafe-babe-cafe-babecafebabe: java.lang.IllegalArgumentException: Invalid namespace index: 1231614
2011-10-11 13:05:21,781 ERROR [org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager] failed to read bundle: deadbeef-cafe-babe-cafe-babecafebabe: java.lang.IllegalArgumentException: Invalid namespace index: 1236653
2011-10-11 13:05:21,781 ERROR [org.apache.jackrabbit.core.RepositoryImpl] Failed to initialize workspace 'default'
javax.jcr.ItemNotFoundException: failed to build path of deadbeef-cafe-babe-cafe-babecafebabe: deadbeef-cafe-babe-cafe-babecafebabe: deadbeef-cafe-babe-cafe-babecafebabe
...
2011-10-11 13:05:22,250 ERROR [org.apache.jackrabbit.core.RepositoryImpl] Unable to start repository, forcing shutdown...
2011-10-11 13:05:22,250 INFO  [org.apache.jackrabbit.core.RepositoryImpl] Shutting down repository...
2011-10-11 13:05:22,250 INFO  [org.apache.jackrabbit.core.query.lucene.IndexMerger] IndexMerger terminated
...
2011-10-11 13:05:22,937 INFO  [org.apache.jackrabbit.core.RepositoryImpl] Repository has been shutdown
2011-10-11 13:05:22,937 ERROR [org.apache.jackrabbit.core.RepositoryImpl] failed to start Repository: failed to build path of deadbeef-cafe-babe-cafe-babecafebabe: deadbeef-cafe-babe-cafe-babecafebabe
The login page comes up normally, but when I enter a valid user name and password and click Login, I get the error message, "java.lang.ClassCastException: javax.jcr.ItemNotFoundException cannot be cast to javax.jcr.LoginException." Any idea how to fix this? Any and all help is greatly appreciated.

Re: Cannot log in; unable to start repository

PostPosted:Sat Oct 15, 2011 6:43 am
by jllort
Seems it has been a problem with repository creation ( or some problem with repository ). It's new installation ? Which java version are you using and finally with OpenKM version are you trying ?

Re: Cannot log in; unable to start repository

PostPosted:Mon Oct 17, 2011 3:12 pm
by jgiordano
I was able to reproduce the problem with a new installation of OpenKM. It happens after an external process accesses the repository; somehow, it leaves the repository in a state where OpenKM cannot access it, but the external process still can. The external process logs in to the repository, accesses some content, then logs out. I was able to solve the problem by overwriting the entire repository with the repository from a fresh install. Obviously, we lost all our documents in the process, but that was OK since it was just a development environment. In general, we can prevent the problem by not allowing the external process to access the repository, but, if possible, I would like to know if there is a better way to solve the problem than overwriting the repository, in case this problem ever happens in production.

This is a fairly new installation of OpenKM 5.1.7 running on Java 1.6. Thanks for your help.

Re: Cannot log in; unable to start repository

PostPosted:Thu Oct 20, 2011 9:24 pm
by jllort
I want to understand what's "external process accesses the repository", could you explain better.

Re: Cannot log in; unable to start repository

PostPosted:Mon Oct 24, 2011 2:11 pm
by jgiordano
It was just a test application. Here is the code:
Code: Select all
public static void main(String[] args) throws Exception { 
		
		String repositoryPath = "C:\\jboss-4.2.3.GA\\repository";
		File repositoryFile = new File(repositoryPath);
		RepositoryConfig config = RepositoryConfig.create(repositoryFile);
		Repository repository = RepositoryImpl.create(config);
		
		Session session = repository.login();
		
		try { 
			String user = session.getUserID(); 
			String name = repository.getDescriptor(Repository.REP_NAME_DESC); 
			System.out.println("Logged in as " + user + " to a " + name + " repository."); 
			
			Node rn = session.getRootNode();
			Node okmRootNode = rn.getNode("okm:root");
			Node docNode = okmRootNode.getNode("File 1.txt");
			System.out.println(docNode.toString());
		} finally { 
			session.logout(); 
			System.out.println("Logged out.");
		} 
	} 

Re: Cannot log in; unable to start repository

PostPosted:Mon Oct 24, 2011 5:45 pm
by jllort
Ufff, only can be one repository instance started at same time ... if you want this kind of testing must starting repository from the source code too.
If you've got aplication server started and then execute it, really you'll got problems.

Let's advance in other direction, what's your finally purpose ?

Re: Cannot log in; unable to start repository

PostPosted:Mon Oct 24, 2011 5:52 pm
by jgiordano
Thanks for your reply. We just wanted to see if it was possible for an application to access the repository independently of OpenKM, but it is not a big requirement; I believe we can accomplish everything we need to do with workflows. I was just surprised that after this little test app accessed the repository, OpenKM was no longer able to access it, even after restarting jboss and the server itself. I assume that some information is persisted to the database, and that it was overwritten when we copied the empty repository over it. In general, is there a better way to fix that problem than overwriting the repository?

Re: Cannot log in; unable to start repository

PostPosted:Tue Oct 25, 2011 9:00 am
by jllort
In fact there's only one repository instance, what you're trying is like two database instance serverces have opened the same files ( same database ) that's not good scenario. The idea of having esposed all API is basically to accessing core services on a transparent way.