The classloader in use is of bundle 148 not 128. Does the bundle 148 actually import the needed package ?
On Fri, Nov 25, 2011 at 18:38, Charles Moulliard <[email protected]> wrote: > Hi, > > I have a very strange problem in this part of the code of openejb > using apache geronimo xbean > > My bundle imports/exports well the following package : > > karaf@root> packages:exports | grep org.apache.openejb.resource.jdbc > 128 org.apache.openejb.resource.jdbc; version=4.0.0.beta-2-SNAPSHOT > > karaf@root> packages:imports | grep org.apache.openejb.resource.jdbc > Apache OpenEJB :: Container :: Core (128): > org.apache.openejb.resource.jdbc; version=4.0.0.beta-2-SNAPSHOT > Apache OpenEJB :: Container :: Core (128): > org.apache.openejb.resource.jdbc; version=4.0.0.beta-2-SNAPSHOT > > but when Apache Xbean through org.apache.xbean.recipe.RecipeHelper > method is called > > public Class getType() { > if (typeClass != null || typeName != null) { > Class type = typeClass; > if (type == null) { > try { > type = RecipeHelper.loadClass(typeName); > } catch (ClassNotFoundException e) { > throw new ConstructionException("Type class could > not be found: " + typeName); > } > } > > return type; > } > > return null; > } > > --> > > public static Class loadClass(String name) throws ClassNotFoundException { > ClassLoader classLoader = > ExecutionContext.getContext().getClassLoader(); > Class<?> type = Class.forName(name, true, classLoader); > return type; > } > > It generates the following error > > Caused by: org.apache.xbean.recipe.ConstructionException: Type class > could not be found: org.apache.openejb.resource.jdbc.DataSourceFactory > at org.apache.xbean.recipe.ObjectRecipe.getType(ObjectRecipe.java:355) > at > org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:266) > at > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96) > at > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61) > at > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49) > at > org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1418) > at > org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:395) > at > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:318) > > See screenshot for the classloader used (felix) > http://cl.ly/1W2N083K3f0U022A151v > > Any hep is welcome ? > > Regards, > > Charles Moulliard > > Apache Committer > > Blog : http://cmoulliard.blogspot.com > Twitter : http://twitter.com/cmoulliard > Linkedin : http://www.linkedin.com/in/charlesmoulliard > Skype: cmoulliard > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com
