Search code examples
javacassandrahector

java.lang.ClassNotFoundException: org.apache.xbean.finder.archive.Archive error when running hector example code


I have included all the jars found in the hector-core-1.1-2 folder. A are there any other jars i haven't included. Things I have tried. 1) Clearing netbeans cache 2) Downloading org.apache.xbean.finder.archive.Archive.jar and including it in my path only to have another exception like org.objectweb.asm.ClassReader.accept(Unknown Source)..... about a class missing. 3) Reinstalling Netbeans. I think that was a stupid thing to do.

The exception

java.lang.ClassNotFoundException: org.apache.xbean.finder.archive.Archive
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at me.prettyprint.hom.CassandraPersistenceProvider.createScanner(CassandraPersistenceProvider.java:55)
at me.prettyprint.hom.CassandraPersistenceProvider.createContainerEntityManagerFactory(CassandraPersistenceProvider.java:49)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:206)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:120)
at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:224)
at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:495)
at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:233)

my question i guess is, what jars do i need to download in order to connect to cassandra from netbeans using hector and also hector object mapper?


Solution

  • You need to add xbean-finder.jar into your project.

    But for preventing such issues in the future, I would recommend using special search engines, f.e. http://search.maven.org. It is very helpful resource for searching of necessary jar-files, maven's dependencies, sources, javadocs and so on.

    P.S. Search string for your case:

    http://search.maven.org/#search|ga|1|fc%3Aorg.apache.xbean.finder.archive.Archive