Announcement Announcement Module
Collapse
No announcement yet.
Import-Bundle problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 :com.alibaba.b2b.dubbo.play.card.api;version="1.0. 0.SNAP
    SHOT",com.springsource.com.ibatis;version="2.3.4.7 26",com.springsourc
    e.oracle.jdbc;version="10.2.0.2",com.springsource. org.apache.commons.
    dbcp;version="1.2.2.osgi".

    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 'com.alibaba.d
    ubbo.demo.play.card-1.0.0.SNAPSHOT-com.alibaba.b2b.dubbo.play.card.service'.
    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 [com.alibaba.playcard.dal.ibatis.internal.IbatisUse rDao]: Constructor threw exception; nested exception is java
    .lang.NoClassDefFoundError: com/ibatis/sqlmap/client/SqlMapExecutor

    I am confused, I hava already pack the com.springsource.com.ibatis-2.3.4.726.jar 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 com.springsource.com.ibatis 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 com.springsource.com.ibatis bundle or the class loading delegation isn't making it to the com.springsource.com.ibatis 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.

    Comment

    Working...
    X