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)
|
|