jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xing007008 <xing007...@163.com>
Subject How to fix the error
Date Sun, 21 Sep 2008 00:43:32 GMT

ERROR:

java.lang.NoSuchMethodError:
org.apache.lucene.store.FSDirectory.getDirectory(Ljava/io/File;Lorg/apache/lucene/store/LockFactory;)Lorg/apache/lucene/store/FSDirectory;
	at
org.apache.jackrabbit.core.query.lucene.PersistentIndex.(PersistentIndex.java:63)
	at org.apache.jackrabbit.core.query.lucene.MultiIndex.(MultiIndex.java:278)
	at
org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:423)
	at
org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:48)
	at
org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:573)
	at org.apache.jackrabbit.core.SearchManager.(SearchManager.java:255)
	at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1600)
	at
org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:599)
	at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:408)
	at org.apache.jackrabbit.core.RepositoryImpl.(RepositoryImpl.java:304)
	at
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550)
	at
org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:245)
	at
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:265)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:333)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:363)
	at
cn.ctit.repository.jcr.JcrRepositoryTest.setUp(JcrRepositoryTest.java:28)
	at junit.framework.TestCase.runBare(TestCase.java:125)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)



JAVA CODE:

package jcr;

import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;

import junit.framework.TestCase;

import org.apache.jackrabbit.core.TransientRepository;

/**
 * Validate that we can create and communicate with a repository.
 */
public class JcrRepositoryTest extends TestCase {

	private String repositoryConfig = "repository.xml";

	private String repositoryHome = "repository";

	Repository repository;

	Session session;

	@Override
	protected void setUp() throws Exception {
		Repository repository = new
TransientRepository(repositoryConfig,repositoryHome);
		session = repository.login(new
SimpleCredentials("testUserName","testPassword".toCharArray()));
	}

	@Override
	protected void tearDown() throws Exception {
		session.logout();
		session = null;
		repository = null;
	}

	public void testRepositoryConnection() throws Exception {
		//System.out.println("OK");
		Node root = session.getRootNode();
		String messageText = "Hello, World!";
		// Store content
		Node hello = root.addNode("hello");
		Node world = hello.addNode("world");
		world.setProperty("message", messageText);
		session.save();
		// Retrieve content
		Node node = root.getNode("hello/world");
		assertEquals("failed to retrieve created node", "/hello/world", node
				.getPath());
		assertEquals("message discovered not the same as the message stored",
				messageText, node.getProperty("message").getString());
		// Remove content
		root.getNode("hello").remove();
		session.save();
	}

}



-- 
View this message in context: http://www.nabble.com/How-to-fix-the-error-tp19590547p19590547.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message