jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jenni Pothu" <Jen...@virtusa.com>
Subject RE: Getting noSuchMethodError in jackrabbit session.login() method
Date Wed, 05 May 2010 04:53:10 GMT
Hi Justin,
      Thanks for your reply Justin. I have download the jar files from
location http://jackrabbit.apache.org/downloads.html. And tried my
application by adding the lucene-core-2.4.1.jar and removed the
lucene-core-3.0.1.jar. Still getting error but it is different from
previous error. Below is the error. Do I need to change anything in
repository.xml for my application. Please help me to run the application
successfully.

Exception in thread "main" java.lang.NullPointerException: dispatcher
	at
org.apache.jackrabbit.core.observation.ObservationManagerImpl.<init>(Obs
ervationManagerImpl.java:97)
	at
org.apache.jackrabbit.core.WorkspaceImpl.getObservationManager(Workspace
Impl.java:748)
	at
org.apache.jackrabbit.core.SessionImpl.removeRegisteredEventListeners(Se
ssionImpl.java:1189)
	at
org.apache.jackrabbit.core.SessionImpl.logout(SessionImpl.java:1217)
	at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.doDispose(Reposi
toryImpl.java:2183)
	at
org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.dispose(Reposito
ryImpl.java:2138)
	at
org.apache.jackrabbit.core.RepositoryImpl.doShutdown(RepositoryImpl.java
:1175)
	at
org.apache.jackrabbit.core.RepositoryImpl.shutdown(RepositoryImpl.java:1
127)
	at
org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(Reposito
ryImpl.java:544)
	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(Transient
Repository.java:231)
	at
org.apache.jackrabbit.core.TransientRepository.startRepository(Transient
Repository.java:259)
	at
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository
.java:355)
	at
org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepositor
y.java:123)
	at FirstHop.main(FirstHop.java:20)

Thanks,
Jenni

	

-----Original Message-----
From: Justin Edelson [mailto:justinedelson@gmail.com] 
Sent: Tuesday, May 04, 2010 7:01 PM
To: users@jackrabbit.apache.org
Subject: Re: Getting noSuchMethodError in jackrabbit session.login()
method

Where'd you derive that list of JAR files from? AFAIK, Jackrabbit
depends upon lucene-core-2.4.1, not 3.0.1. Also, you should be using the
JCR 2.0 JAR (although this wouldn't be the cause of this exception).

Justin

On 5/4/10 9:22 AM, Jenni P wrote:
> 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.getQue
ryHandler(
> *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:36
6
> *)
> 
> at
org.apache.jackrabbit.core.RepositoryImpl.create(*RepositoryImpl.java:67
3
> *)
> 
> 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
> 


--------------------------------------------------------------------------------------------

This message, including any attachments, contains confidential information 
intended for a specific individual and purpose, and is intended for the addressee only. Any
unauthorized disclosure, use, dissemination, copying, or distribution of 
this message or any of its attachments or the information contained in this e-mail, or the
taking of any action based on it, is strictly prohibited. If you are not the intended recipient,
please notify the sender immediately by return e-mail and delete this message.

--------------------------------------------------------------------------------------------

Mime
View raw message