scala - Using Squeryl inside a OSGi container -
has gotten squeryl work inside osgi environment, on karaf 3.03.
so far have gotten individual dependencies load, scala libraries, squeryl , jdbc driver.the installed bundles this:
51 | resolved | 80 | 0.3.0.snapshot | ac.za.cput.pe.model 52 | active | 80 | 2.11.6.v20150224-172222-092690e7bf | scala standard library 53 | active | 80 | 0 | wrap_mvn_org.squeryl_squeryl_2.10_0.9.5-6 54 | active | 80 | 2.10.0.v20121205-112020-vfinal-18481cef9b | scala standard library 55 | active | 80 | 0 | wrap_mvn_cglib_cglib-nodep_2.2 56 | active | 80 | 0 | wrap_mvn_org.scala-lang_scalap_2.10.0 57 | active | 80 | 2.10.0.v20121205-112020-vfinal-18481cef9b | scala compiler 58 | active | 80 | 2.10.0.v20121205-112020-vfinal-18481cef9b | scala reflect 59 | active | 80 | 0 | wrap_mvn_postgresql_postgresql_9.1-901-1.jdbc4
in bundle have code looks this:
class.forname("org.postgresql.driver") sessionfactory.concretefactory = some(()=> session.create( java.sql.drivermanager.getconnection("jdbc:postgresql://localhost:5432/pe","postgres" ,"12345"),new postgresqladapter ) )
which tries create squeryl session factory.
however when start karaf, error getting:
java.lang.linkageerror: loader constraint violation: when resolving method "org.squeryl.sessionfactory$.concretefactory_$eq(lscala/option;)v" class loader (instance of org/apache/felix/framework/bundlewiringimpl$bundleclassloaderjava5) of current class, ac/za/cput/pe/model/activator/activator, , class loader (instance of org/apache/felix/framework/bundlewiringimpl$bundleclassloaderjava5) resolved class, org/squeryl/sessionfactory$, have different class objects type concretefactory_$eq used in signature
does have ideas?, few hours jumping out of balcony :(
looks lot got different jars included. first make sure have dependencies correctly imported. second make sure don't embed dependencies partially in own bundles. error message clear issue.
you compiled different version 1 provided during runtime. might because of either wrong import (make sure version matches) or include different version of package in bundle.
Comments
Post a Comment