Skip to content

mybatis-spring OSGi imports - Spring batch should be optional #9

@szhem

Description

@szhem

The old issue is still actual for _mybatis-spring 1.2.0_

Here is the log

JBossFuse:admin@root> start 127
Error executing command: Error starting bundles:
        Unable to start bundle 127: Unresolved constraint in bundle org.mybatis.mybatis-spring [127]: Unable to resolve 127.0: missing requirement [127.0] osgi.wiring.package; (osgi.wiring.package=org.springframework.batch.item)
JBossFuse:admin@root> headers 127

MyBatis-Spring (127)
--------------------
Specification-Title = MyBatis-Spring
Archiver-Version = Plexus Archiver
Tool = Bnd-1.50.0
Specification-Version = 1.2.0
Specification-Vendor = MyBatis.org
Implementation-Version = 1.2.0
Build-Jdk = 1.6.0_37
Implementation-Build-Date = 2013-02-20 20:58:18+0100
Implementation-Vendor-Id = org.mybatis
Created-By = Apache Maven Bundle Plugin
Implementation-Title = MyBatis-Spring
Manifest-Version = 1.0
Bnd-LastModified = 1361390302535
X-Compile-Target-JDK = 1.5
Include-Resource = META-INF/LICENSE=LICENSE,META-INF/NOTICE=NOTICE,META-INF/spring.handlers=src/main/java/META-INF/spring.handlers,META-INF/spring.schemas=src/main/java/META-INF/spring.schemas,org/mybatis/spring/config/mybatis-spring-1.2.xsd=src/main/java/org/mybatis/spring/config/mybatis-spring-1.2.xsd
Built-By = stripodi
X-Compile-Source-JDK = 1.5
Implementation-Vendor = MyBatis.org

Bundle-Vendor = MyBatis.org
Bundle-Name = MyBatis-Spring
Bundle-DocURL = http://www.mybatis.org/spring/
Bundle-Description = An easy-to-use Spring3 bridge for MyBatis sql mapping framework.
Bundle-SymbolicName = org.mybatis.mybatis-spring
Bundle-Version = 1.2.0
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

DynamicImport-Package =
        *
Import-Package =
        javax.sql,
        org.apache.commons.logging,
        org.apache.ibatis.builder.xml,
        org.apache.ibatis.exceptions,
        org.apache.ibatis.executor,
        org.apache.ibatis.logging,
        org.apache.ibatis.mapping,
        org.apache.ibatis.plugin,
        org.apache.ibatis.reflection,
        org.apache.ibatis.reflection.factory,
        org.apache.ibatis.reflection.wrapper,
        org.apache.ibatis.session,
        org.apache.ibatis.transaction,
        org.apache.ibatis.type,
        org.springframework.batch;resolution:=optional,
        org.springframework.batch.item,
        org.springframework.batch.item.database,
        org.springframework.beans,
        org.springframework.beans.factory,
        org.springframework.beans.factory.annotation,
        org.springframework.beans.factory.config,
        org.springframework.beans.factory.support,
        org.springframework.beans.factory.xml,
        org.springframework.context,
        org.springframework.context.annotation,
        org.springframework.context.event,
        org.springframework.context.support,
        org.springframework.core,
        org.springframework.core.annotation,
        org.springframework.core.io,
        org.springframework.core.type,
        org.springframework.core.type.classreading,
        org.springframework.core.type.filter,
        org.springframework.dao,
        org.springframework.dao.support,
        org.springframework.jdbc.datasource,
        org.springframework.jdbc.support,
        org.springframework.transaction.support,
        org.springframework.util,
        org.w3c.dom
Export-Package =
        org.mybatis.spring.annotation;version=1.2.0,
        org.mybatis.spring.mapper;version=1.2.0,
        org.mybatis.spring.batch;version=1.2.0,
        org.mybatis.spring.transaction;version=1.2.0,
        org.mybatis.spring.config;version=1.2.0,
        org.mybatis.spring;version=1.2.0,
        org.mybatis.spring.support;version=1.2.0

As you can see

    org.springframework.batch;resolution:=optional,
    org.springframework.batch.item,
    org.springframework.batch.item.database,

only org.springframework.batch has optional resolution.

The pom.xml should be changed like the following

<osgi.import>org.springframework.batch*;resolution:=optional,*</osgi.import> 

Pay attention to additional * after the package name.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions