EmmanuelOga / hypergraphdb

Automatically exported from code.google.com/p/hypergraphdb
1 stars 0 forks source link

java.lang.NoSuchMethodError at HyperGraph open at 1.2 version maven build #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Follow install for maven at http://www.hypergraphdb.org/downloads
2.add simple code HyperGraph graph = new HyperGraph ("data");graph.close();
3.Build and execute project

What is the expected output? What do you see instead?

HTTP ERROR: 500

java.lang.NoSuchMethodError: 
org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sl
eepycat/je/DatabaseEntry;)V
RequestURI=/testhgdb/index

Caused by:

org.hypergraphdb.HGException: java.lang.NoSuchMethodError: 
org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sl
eepycat/je/DatabaseEntry;)V
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:392)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:210)
    at org.hypergraphdb.HyperGraph.(HyperGraph.java:197)
    at gr.uom.testhgdb.Index.doGet(Index.java:25)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.NoSuchMethodError: 
org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sl
eepycat/je/DatabaseEntry;)V
    at org.hypergraphdb.storage.bje.BJEStorageImplementation.store(BJEStorageImplementation.java:234)
    at org.hypergraphdb.HGStore.store(HGStore.java:119)
    at org.hypergraphdb.HGTypeSystem.addPrimitiveTypeToStore(HGTypeSystem.java:187)
    at org.hypergraphdb.HGTypeSystem.bootstrap(HGTypeSystem.java:236)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:352)
    ... 22 more
Caused by:

java.lang.NoSuchMethodError: 
org.hypergraphdb.storage.bje.LinkBinding.objectToEntry(Ljava/lang/Object;Lcom/sl
eepycat/je/DatabaseEntry;)V
    at org.hypergraphdb.storage.bje.BJEStorageImplementation.store(BJEStorageImplementation.java:234)
    at org.hypergraphdb.HGStore.store(HGStore.java:119)
    at org.hypergraphdb.HGTypeSystem.addPrimitiveTypeToStore(HGTypeSystem.java:187)
    at org.hypergraphdb.HGTypeSystem.bootstrap(HGTypeSystem.java:236)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:352)
    at org.hypergraphdb.HyperGraph.open(HyperGraph.java:210)
    at org.hypergraphdb.HyperGraph.(HyperGraph.java:197)
    at gr.uom.testhgdb.Index.doGet(Index.java:25)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Powered by Jetty:/

What version of the product are you using? On what operating system?
1.2
windows 8 x64

Please provide any additional information below.
build at maven , with jetty plugin
on eclipse 

Original issue reported on code.google.com by chgi...@gmail.com on 7 Jul 2013 at 1:35

Attachments:

GoogleCodeExporter commented 9 years ago
This error happens when there is a mixup between the native (C language) and 
the Java edition of BerkeleyDB. The native jar is named something like 
db-5.xx.xx.jar while the Java edition will be je-5.0.34.jar. The two libraries 
have similar packages but different and incompatible classes, so when both are 
present in the classpath, things go awry. 

I made a simple project out of your files. Simplified the pom to remove web 
related libs and put Index.java in src/main/java.

then I just run:

mvn exec:java -Dexec.mainClass=Index

and it works.

If my assumption is correct, I have to idea how you ended up with both native 
and java edition dependencies, but that would be the first thing to analyze.

Original comment by borislav...@gmail.com on 8 Jul 2013 at 6:13

Attachments:

GoogleCodeExporter commented 9 years ago
You are right! i check the Maven Dependencies that a load at eclipse and i spot 
db-5.3.15.jar and je-5.0.34.jar.I go to hgdb maven  and check the pom i fibd 
out that db-5.3.15.jar so call by hgbdbnative which is a dependency of hgdbowl 
and je-5.0.34.jar is a dependency of hgbdbje 

i need hgdb to store owl only, so i delete the the hgdbje this remove the 
je.jar i have not test it yet, but  i believe this will solve me problem 

Thank for your time
Chris Givanoudis  

Original comment by chgi...@gmail.com on 8 Jul 2013 at 7:43

GoogleCodeExporter commented 9 years ago
Chris,

Yes, that should solve your problem. If you use native, remember to specify the 
java.library.path to the DLL (or .so) with the native code. 

Note also that you could use the Java edition  (i.e. hgbdbje and je-5.0.34) to 
store OWL. I'm not sure why the OWL project pom contains native as a 
dependency, but there's no particular reason. Could be one or the other.

Original comment by borislav...@gmail.com on 8 Jul 2013 at 7:57

GoogleCodeExporter commented 9 years ago

Original comment by borislav...@gmail.com on 16 Sep 2013 at 6:39