jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jenni P <jenni....@gmail.com>
Subject Getting NoSuchMethodError at jackrabbit session.login() mehtod
Date Tue, 04 May 2010 13:05:38 GMT
Hi All,
    I am getting NoSuchMethodError at Session session = repository.login(*
new* SimpleCredentials("username", "password".toCharArray())); when running
my below application. I have added below jar files to my application.Below
is the sample application downloaded from the location
http://jackrabbit.apache.org/first-hops.html
I am new to the Jackrabbit. Please guide me to run the application
successfully.
Thanks in advance.

*JAR FILES ADDED TO APPLICATION*:
jackrabbit-jcr-commons-2.0.0.jar,jackrabbit-api-2.0.0.jar,
jackrabbit-core-2.0.0.jar, jackrabbit-jca-2.0.0.jar, jcr-1.0.jar,
lucene-core-3.0.1.jar.

*ERROR* :

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.lucene.analysis.standard.StandardAnalyzer.<init>([Ljava/lang/String;)V

at org.apache.jackrabbit.core.query.lucene.JackrabbitAnalyzer.<init>(*
JackrabbitAnalyzer.java:41*)

at org.apache.jackrabbit.core.query.lucene.SearchIndex.<init>(*
SearchIndex.java:205*)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(*Native Method*)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.apache.jackrabbit.core.config.BeanConfig.newInstance(*
BeanConfig.java:186*)

at
org.apache.jackrabbit.core.config.RepositoryConfigurationParser$1.getQueryHandler(
*RepositoryConfigurationParser.java:627*)

at org.apache.jackrabbit.core.config.RepositoryConfig.getQueryHandler(*
RepositoryConfig.java:930*)

at org.apache.jackrabbit.core.SearchManager.<init>(*SearchManager.java:173*)

at org.apache.jackrabbit.core.RepositoryImpl.getSystemSearchManager(*
RepositoryImpl.java:698*)

at org.apache.jackrabbit.core.RepositoryImpl.access$400(*
RepositoryImpl.java:125*)

at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(
*RepositoryImpl.java:1868*)

at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doPostInitialize(
*RepositoryImpl.java:2077*)

at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(*
RepositoryImpl.java:1996*)

at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(*
RepositoryImpl.java:535*)

at org.apache.jackrabbit.core.RepositoryImpl.<init>(*RepositoryImpl.java:366
*)

at org.apache.jackrabbit.core.RepositoryImpl.create(*RepositoryImpl.java:673
*)

at org.apache.jackrabbit.core.TransientRepository$2.getRepository(*
TransientRepository.java:231*)

at org.apache.jackrabbit.core.TransientRepository.startRepository(*
TransientRepository.java:259*)

at org.apache.jackrabbit.core.TransientRepository.login(*
TransientRepository.java:355*)

at org.apache.jackrabbit.commons.AbstractRepository.login(*
AbstractRepository.java:123*)

at FirstHop.main(*FirstHop.java:20*)
*APPLICATION CODE:*

*

import* javax.jcr.Repository;

*import* javax.jcr.Session;
*

import* javax.jcr.SimpleCredentials;
*

import* javax.jcr.Node;
*

import* org.apache.jackrabbit.core.TransientRepository;

/**

* Second hop example. Stores, retrieves, and removes example content.

*/
*

public* *class* SecondHop {

*public* *static* *void* main(String[] args) *throws* Exception {

Repository repository = *new* TransientRepository();

Session session = repository.login(*new* SimpleCredentials("username",
"password".toCharArray()));

*try* {

Node root = session.getRootNode();

// Store content

Node hello = root.addNode("hello");

Node world = hello.addNode("world");

world.setProperty("message", "Hello, World!");

session.save();

// Retrieve content

Node node = root.getNode("hello/world");

System.*out*.println(node.getPath());

System.*out*.println(node.getProperty("message").getString());

// Remove content

root.getNode("hello").remove();

session.save();

String name = repository.getDescriptor(Repository.*REP_VENDOR_URL_DESC*);

System.*out*.println("name "+name);

} *finally* {

session.logout();

}

}

}


Thanks,

Jenni

Mime
View raw message