-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Search - UnsupportedClassVersionError
PostPosted: Wed May 16, 2007 9:33 am 
Newbie

Joined: Tue May 15, 2007 8:50 am
Posts: 3
Location: Bangalore
Hibernate Version:3.2.4
Search Version:hibernate-search-3.0.0.Beta1
Lucene Version:lucene-2.1.0-src

I'm trying to use the following code:

Class abc [] = {Message.class};
try{
//Getting the Hibernate Session
Session secondSession = HibernateUtil.getSessionFactory().openSession();
Transaction secondTransaction = secondSession.beginTransaction();

//Getting the full text session
FullTextSession fullTextSession = Search.createFullTextSession(secondSession);
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("title", new StopAnalyzer() );
org.apache.lucene.search.Query luceneQuery = parser.parse( "nom:Greeting" );
org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, abc );
//return a list of managed objects
result = (fullTextQuery).list();
Iterator i = result.iterator();
while(i.hasNext())
{
System.out.println("WoW..Got it Huh :)>>> : "+i.next());
}

secondTransaction.commit();
secondSession.close();


}

I'm getting the following error:
java.lang.UnsupportedClassVersionError: org/hibernate/search/Search (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at hello.HelloWorld.getValues(HelloWorld.java:143)
at hello.HelloWorld.main(HelloWorld.java:18)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 8:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Seems like you are not running JDK 5

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 18, 2007 12:16 am 
Newbie

Joined: Tue May 15, 2007 8:50 am
Posts: 3
Location: Bangalore
Yep, U r correct. I got it now. I'm able to run it.
Thanks Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.