Announcement Announcement Module
No announcement yet.
Import-Bundle problem Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import-Bundle problem

    Recently,I write a demo programm.It has two bundles,play.card.api & play.card.service. play.card.service import some bundles;version="1.0. 0.SNAP
    SHOT",;version=" 26",com.springsourc;version="",com.springsource. org.apache.commons.

    I pack the two bundles as a par and copy the dependent bundles to the $DM_HOME/repository/bundles/usr/, the application works well.

    When a pack the two bundles plus the dependent bundles into a par. This time when deploy my application, I got exceptions:
    [2009-06-23 15:49:47.719] server-dm-14 <SPDE0020E> Application context creation failure for bundle ''.
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'userService.osgi': Invocation of init
    method failed; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationExce ption: Erro
    r creating bean with name 'userService' defined in URL [bundleentry://124/META-INF/spring/playcard-dal.xml]: Cannot resolve r
    eference to bean 'userDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanC
    reationException: Error creating bean with name 'userDao' defined in URL [bundleentry://124/META-INF/spring/playcard-dal.xml]
    : Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantia
    te bean class [ rDao]: Constructor threw exception; nested exception is java
    .lang.NoClassDefFoundError: com/ibatis/sqlmap/client/SqlMapExecutor

    I am confused, I hava already pack the bundle into to the par.
    Does the bundles in repository directory different from the bundles in a par?

  • #2
    I'm confused too. You have understood correctly and something's not working the way it normally does.

    play.card.service's import-bundle for should be satisfied by the version packaged in the PAR file. It would seem to be satisfied because there wasn't a resolution error.

    Then it seems that the com.ibatis.sqlmap.client.SqlMapExecutor class cannot be loaded from the bundle or the class loading delegation isn't making it to the bundle's class loader. So it seems the wiring is wrong, contrary to the lack of a resolution error.

    If you would like to dig into this yourself, please turn on global trace at debug level and then look for the expansion and scoping of the import-bundle. I'd start by searching trace.log for the import of the com.ibatis.sqlmap.client.

    If you don't like the sound of that, please cut down the example as much as you can easily do and then raise a bug on dm Server's JIRA.

    Please post back if you need more info. on any of this.