[jboss-dev-forums] [Design the new POJO MicroContainer] - classloading dependencies

jhalliday do-not-reply at jboss.com
Tue Feb 10 05:02:58 EST 2009


I'm trying to deploy a .jar in AS 5. It contains a bean, let's call it fooBean, that links against class barClass. barClass is not in the .jar, it's in barModule. So at first I try


  | <bean name="fooBean" class="fooBean">
  |        <depends>barModule</depends>
  | 

which results in a ClassDefNotFound. Apparantly MC tries to classload the fooBean even though barModule does not yet exist. So I rant a bit about how unintuitive that is, then try to add a jboss-classloading.xml:


  | <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY">
  |    <requirements>
  |        <package name="org.jboss.bar"/>
  |    </requirements>
  | </classloading>
  | 

which at least prevents deployment until barModule is present, but then throws


  | java.lang.NullPointerException
  | 	at org.jboss.classloading.spi.dependency.ClassLoadingSpace.resolve(ClassLoadingSpace.java:325)
  | 	at org.jboss.classloading.spi.dependency.Module.resolveModule(Module.java:737)
  | 	at org.jboss.classloading.spi.dependency.RequirementDependencyItem.resolve(RequirementDependencyItem.java:87)
  | 

Apparently barModule.getClassLoadingSpace() returns null.

So now I'm stuck. What's the correct way to solve this dependency problem?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208429#4208429

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4208429



More information about the jboss-dev-forums mailing list