JackRabbitを初めて使用し、FirstHop.javaを実行しようとしていますが、iamが次のエラーを受け取ります。
コード
import javax.jcr.Repository;
import javax.jcr.Session;
import org.apache.jackrabbit.core.TransientRepository;
public class FirstHop {
public static void main(String[] args) throws Exception
{
Repository repository = (Repository) new TransientRepository();
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.");
}
finally
{
session.logout();
}
}
}
log4j:WARN No appenders could be found for logger (org.apache.jackrabbit.core.TransientRepository).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.jackrabbit.spi.Path.resolve(Lorg/apache/jackrabbit/spi/Path$Element;)Lorg/apache/jackrabbit/spi/Path;
at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.<clinit>(InternalVersionManagerImpl.java:86)
at org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:492)
at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:311)
at org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:589)
at org.apache.jackrabbit.core.TransientRepository$2.getRepository(TransientRepository.java:232)
at org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:280)
at org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:376)
at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:111)
at com.ksh.FirstHop.main(FirstHop.java:23)
私は次のjarファイルを使用しています。
- commons-dbcp-1.2.jar
- commons-pool-1.5.jar
- jackrabbit-api-2.3.5.jar
- jackrabbit-core-2.4.2.jar
- jackrabbit-jcr-commons-2.3.5.jar
- jackrabbit-spi-2.1.3-.jar
- jackrabbit-spi-2.3.5.jar
- jackrabbit-spi-commons-2.3.5.jar
- jackrabbit-standalone-1.5.0.jar 10.jcr-2.0.jar 11.org.apache.sling.jcr.jackrabbit.api-2.0.2-incubator.jar
ありがとう。