[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Optional package import resolving problem

Title: Optional package import resolving problem
Hi Everyone,

I am using
org.eclipse.osgi_3.5.0.v20090127-1630 and starting a small container with the OSGi Framework launch configuration. In this container I have the Spring framework and its minimal dependencies. All bundles start OK.

The Spring framwork ORM bundle has imports for the hibernate packages, all marked as optional. The hibernate (and only one bundle is in the container that exports hibernate bundles) bundle is started before the spring framework bundles using the run levels on the launch configuration.

The problem is that only some of the optional hibernate imports are actually resolved in the spring orm bundle. I can find no explanation for that behaviour at all. This is what is being exported by the hibernate bundle:

Snip...
 org.hibernate                         {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.action                  {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.bytecode                {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.bytecode.cglib          {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.bytecode.javassist      {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.bytecode.util           {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.cache                   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.cache.entry             {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.cfg                     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.classic                 {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.collection              {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.connection              {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.context                 {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.criterion               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.dialect                 {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.dialect.function        {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.dialect.lock            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.engine                  {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.engine.loading          {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.engine.query            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.engine.query.sql        {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.engine.transaction      {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.event                   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.event.def               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.exception               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql                     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.antlr               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.ast                 {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.ast.exec            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.ast.tree            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.ast.util            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.hql.classic             {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.id                      {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.id.enhanced             {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.id.insert               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.impl                    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.intercept               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.intercept.cglib         {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.intercept.javassist     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.jdbc                    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.jmx                     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader                  {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.collection       {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.criteria         {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.custom           {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.custom.sql       {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.entity           {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.loader.hql              {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.lob                     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.mapping                 {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.metadata                {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.param                   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.persister               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.persister.collection    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.persister.entity        {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.pretty                  {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.property                {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy                   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy.dom4j             {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy.map               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy.pojo              {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy.pojo.cglib        {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.proxy.pojo.javassist    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.secure                  {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.sql                     {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.stat                    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tool.hbm2ddl            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tool.instrument         {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tool.instrument.cglib   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tool.instrument.javassist{version=3.2.6.ga-SNAPSHOT}
  org.hibernate.transaction             {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.transform               {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tuple                   {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tuple.component         {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.tuple.entity            {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.type                    {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.usertype                {version=3.2.6.ga-SNAPSHOT}
  org.hibernate.util                    {version=3.2.6.ga-SNAPSHOT}
...snip

This is what is being imported by the spring orm bundle:

org.hibernate                         {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.cache                   {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.cfg                     {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.classic                 {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.connection              {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.context                 {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.criterion               {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.dialect                 {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.ejb                     {version=[3.3.0.ga, 4.0.0), resolution:=optional}
  org.hibernate.engine                  {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.event                   {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.event.def               {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.exception               {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.impl                    {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.jdbc                    {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.persister.entity        {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.tool.hbm2ddl            {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.transaction             {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.transform               {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.type                    {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.usertype                {version=[3.2.6.ga, 4.0.0), resolution:=optional}
  org.hibernate.util                    {version=[3.2.6.ga, 4.0.0), resolution:=optional}

The OSGi console tells me what is actually bound in the container:

osgi> b 20
org.springframework.orm_2.5.6.SEC01 [20]
  Id=20, Status=ACTIVE      Data Root=/Users/dlaidlaw/Infor/workspaces/framework/.metadata/.plugins/org.eclipse.pde.core/SpringHibernateContainer/org.eclipse.osgi/bundles/20/data
  No registered services.
  No services in use.
  Exported packages
    org.springframework.orm; version="2.5.6.SEC01"[exported]
    org.springframework.orm.hibernate3; version="2.5.6.SEC01"[exported]
    org.springframework.orm.hibernate3.annotation; version="2.5.6.SEC01"[exported]
    org.springframework.orm.hibernate3.support; version="2.5.6.SEC01"[exported]
    org.springframework.orm.ibatis; version="2.5.6.SEC01"[exported]
    org.springframework.orm.ibatis.support; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jdo; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jdo.support; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jpa; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jpa.persistenceunit; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jpa.support; version="2.5.6.SEC01"[exported]
    org.springframework.orm.jpa.vendor; version="2.5.6.SEC01"[exported]
    org.springframework.orm.toplink; version="2.5.6.SEC01"[exported]
    org.springframework.orm.toplink.support; version="2.5.6.SEC01"[exported]
  Imported packages
    javax.naming; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090127-1630 [0]>
    javax.persistence; version="1.99.0"<com.springsource.javax.persistence_1.99.0 [1]>
    javax.persistence.spi; version="1.99.0"<com.springsource.javax.persistence_1.99.0 [1]>
    javax.sql; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090127-1630 [0]>
    javax.transaction; version="1.1.0"<com.springsource.javax.transaction_1.1.0 [23]>
    javax.xml.parsers; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090127-1630 [0]>
    org.aopalliance.intercept; version="1.0.0"<com.springsource.org.aopalliance_1.0.0 [10]>
    org.apache.commons.logging; version="1.1.1"<org.ops4j.pax.logging.pax-logging-api_1.3.0 [9]>
    org.hibernate.cfg; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.classic; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.connection; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.dialect; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.event; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.event.def; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.exception; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.persister.entity; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.tool.hbm2ddl; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.transform; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.type; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.hibernate.usertype; version="3.2.6.ga-SNAPSHOT"<com.infor.org.hibernate_3.2.6.ga-SNAPSHOT [26]>
    org.springframework.aop.scope; version="2.5.6.SEC01"<org.springframework.aop_2.5.6.SEC01 [27]>
    org.springframework.aop.support; version="2.5.6.SEC01"<org.springframework.aop_2.5.6.SEC01 [27]>
    org.springframework.beans; version="2.5.6.SEC01"<org.springframework.beans_2.5.6.SEC01 [17]>
    org.springframework.beans.factory; version="2.5.6.SEC01"<org.springframework.beans_2.5.6.SEC01 [17]>
    org.springframework.beans.factory.annotation; version="2.5.6.SEC01"<org.springframework.beans_2.5.6.SEC01 [17]>
    org.springframework.beans.factory.config; version="2.5.6.SEC01"<org.springframework.beans_2.5.6.SEC01 [17]>
    org.springframework.beans.factory.support; version="2.5.6.SEC01"<org.springframework.beans_2.5.6.SEC01 [17]>
    org.springframework.context; version="2.5.6.SEC01"<org.springframework.context_2.5.6.SEC01 [7]>
    org.springframework.context.weaving; version="2.5.6.SEC01"<org.springframework.context_2.5.6.SEC01 [7]>
    org.springframework.core; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.core.io; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.core.io.support; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.core.type; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.core.type.classreading; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.core.type.filter; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.dao; version="2.5.6.SEC01"<org.springframework.transaction_2.5.6.SEC01 [22]>
    org.springframework.dao.support; version="2.5.6.SEC01"<org.springframework.transaction_2.5.6.SEC01 [22]>
    org.springframework.instrument.classloading; version="2.5.6.SEC01"<org.springframework.context_2.5.6.SEC01 [7]>
    org.springframework.jdbc; version="2.5.6.SEC01"<org.springframework.jdbc_2.5.6.SEC01 [18]>
    org.springframework.jdbc.datasource; version="2.5.6.SEC01"<org.springframework.jdbc_2.5.6.SEC01 [18]>
    org.springframework.jdbc.datasource.lookup; version="2.5.6.SEC01"<org.springframework.jdbc_2.5.6.SEC01 [18]>
    org.springframework.jdbc.support; version="2.5.6.SEC01"<org.springframework.jdbc_2.5.6.SEC01 [18]>
    org.springframework.jdbc.support.lob; version="2.5.6.SEC01"<org.springframework.jdbc_2.5.6.SEC01 [18]>
    org.springframework.jndi; version="2.5.6.SEC01"<org.springframework.context_2.5.6.SEC01 [7]>
    org.springframework.transaction; version="2.5.6.SEC01"<org.springframework.transaction_2.5.6.SEC01 [22]>
    org.springframework.transaction.jta; version="2.5.6.SEC01"<org.springframework.transaction_2.5.6.SEC01 [22]>
    org.springframework.transaction.support; version="2.5.6.SEC01"<org.springframework.transaction_2.5.6.SEC01 [22]>
    org.springframework.ui; version="2.5.6.SEC01"<org.springframework.context_2.5.6.SEC01 [7]>
    org.springframework.util; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.springframework.util.xml; version="2.5.6.SEC01"<org.springframework.core_2.5.6.SEC01 [6]>
    org.w3c.dom; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090127-1630 [0]>
    org.xml.sax; version="0.0.0"<org.eclipse.osgi_3.5.0.v20090127-1630 [0]>
  No fragment bundles
  Named class space
    org.springframework.orm; bundle-version="2.5.6.SEC01"[provided]
  No required bundles

Note that only 12 of the 22 imports are actually bound. But the hibernate bundle exports all of those 22 imports. The diag command on spring orm says:

osgi> diag 20
initial@reference:file:org.springframework.orm-2.5.6.SEC01.jar/ [20]
  Direct constraints which are unresolved:
    Missing imported package com.ibatis.common.util_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.common.xml_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.client_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.client.event_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.engine.builder.xml_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.engine.impl_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.engine.transaction_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.engine.transaction.external_[2.3.0.677,3.0.0).
    Missing imported package com.ibatis.sqlmap.engine.type_[2.3.0.677,3.0.0).
    Missing imported package javax.jdo_[2.0.0,3.0.0).
    Missing imported package javax.jdo.datastore_[2.0.0,3.0.0).
    Missing imported package javax.servlet_[2.4.0,3.0.0).
    Missing imported package javax.servlet.http_[2.4.0,3.0.0).
    Missing imported package oracle.toplink.essentials.ejb.cmp3_[2.0.0.b41-beta2,3.0.0).
    Missing imported package oracle.toplink.essentials.expressions_[2.0.0.b41-beta2,3.0.0).
    Missing imported package oracle.toplink.essentials.internal.databaseaccess_[2.0.0.b41-beta2,3.0.0).
    Missing imported package oracle.toplink.essentials.internal.sessions_[2.0.0.b41-beta2,3.0.0).
    Missing imported package oracle.toplink.essentials.sessions_[2.0.0.b41-beta2,3.0.0).
    Missing imported package oracle.toplink.exceptions_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.expressions_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.internal.databaseaccess_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.jndi_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.logging_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.publicinterface_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.queryframework_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.sessionbroker_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.sessions_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.threetier_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.tools.sessionconfiguration_[10.1.3,11.0.0).
    Missing imported package oracle.toplink.tools.sessionmanagement_[10.1.3,11.0.0).
    Missing imported package org.apache.openjpa.persistence_[1.0.2,2.0.0).
    Missing imported package org.eclipse.persistence.expressions_[1.0.0,2.0.0).
    Missing imported package org.eclipse.persistence.internal.databaseaccess_[1.0.0,2.0.0).
    Missing imported package org.eclipse.persistence.internal.sessions_[1.0.0,2.0.0).
    Missing imported package org.eclipse.persistence.jpa_[1.0.0,2.0.0).
    Missing imported package org.eclipse.persistence.sessions_[1.0.0,2.0.0).
    Missing imported package org.hibernate.ejb_[3.3.0.ga,4.0.0).
    Missing imported package org.springframework.web.context_[2.5.6.SEC01,2.5.6.SEC01].
    Missing imported package org.springframework.web.context.request_[2.5.6.SEC01,2.5.6.SEC01].
    Missing imported package org.springframework.web.context.support_[2.5.6.SEC01,2.5.6.SEC01].
    Missing imported package org.springframework.web.filter_[2.5.6.SEC01,2.5.6.SEC01].

Can anyone explain why the other packages would not be resolved?

--
Best Regards,

Don Laidlaw | Sr. Research Engineer |
Infor | office: +1 902-576-5185 | mobile: +1 902-401-6771 | don.laidlaw@xxxxxxxxx