Mybatis and osgi

classic Classic list List threaded Threaded
46 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Mybatis and osgi

Riccardo Cossu
Hello,
I'm trying to use mybatis in an osgi enviroment (namely apache felix,
but I think this is a general issue); I already have a working bundle
for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
mybatis jar in a bundle.

I'm always getting an error at the first query I try:

No suitable driver found for jdbc:jtds:sqlserver://<host and database
name>

Surely it is a classloader problem, that ibatis classloader has no
access to driver classes.
I also tried to add a:

DynamicImport-Package: *

to the bundle manifest with no luck.

Has anyone tried to use mybatis in osgi enviroment?

Thanks for your help,
Riccardo

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
I finally managed to make it work; the point here is not to let
mybatis bundle have access to the jdbc driver, but to let the client
bundle have it!
In other words there is no need for Dynamic-Import in mybatis bundle;
all that is needed is to put the driver package in the package-import
directive of the client bundle, eventually as an optional dependency.

No other tricks seem necessary to make it work.

Thanks anyway, this issue is closed :-)

On 16 Set, 17:05, Riccardo <[hidden email]> wrote:

> Hello,
> I'm trying to use mybatis in an osgi enviroment (namely apache felix,
> but I think this is a general issue); I already have a working bundle
> for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
> mybatis jar in a bundle.
>
> I'm always getting an error at the first query I try:
>
> No suitable driver found for jdbc:jtds:sqlserver://<host and database
> name>
>
> Surely it is a classloader problem, that ibatis classloader has no
> access to driver classes.
> I also tried to add a:
>
> DynamicImport-Package: *
>
> to the bundle manifest with no luck.
>
> Has anyone tried to use mybatis in osgi enviroment?
>
> Thanks for your help,
> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Ciao Riccardo,
and thanks to you for sharing the hint ;)
Ciao,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]> wrote:

> I finally managed to make it work; the point here is not to let
> mybatis bundle have access to the jdbc driver, but to let the client
> bundle have it!
> In other words there is no need for Dynamic-Import in mybatis bundle;
> all that is needed is to put the driver package in the package-import
> directive of the client bundle, eventually as an optional dependency.
>
> No other tricks seem necessary to make it work.
>
> Thanks anyway, this issue is closed :-)
>
> On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>> Hello,
>> I'm trying to use mybatis in an osgi enviroment (namely apache felix,
>> but I think this is a general issue); I already have a working bundle
>> for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
>> mybatis jar in a bundle.
>>
>> I'm always getting an error at the first query I try:
>>
>> No suitable driver found for jdbc:jtds:sqlserver://<host and database
>> name>
>>
>> Surely it is a classloader problem, that ibatis classloader has no
>> access to driver classes.
>> I also tried to add a:
>>
>> DynamicImport-Package: *
>>
>> to the bundle manifest with no luck.
>>
>> Has anyone tried to use mybatis in osgi enviroment?
>>
>> Thanks for your help,
>> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
Ciao Simone,
I have two proposals:
- is it possible to release mybatis as an osgi-ready bundle  (it's
just a matter of a few lines in the manifest, no code adjustment
should be necessary)?
- would a little tutorial on how to use mybatis in an osgi enviroment
fit in the user guide or wiki?

I would gladly contribute to both issues, not immediately, but
starting about no sooner than mid-november.

Bye,
Riccardo

On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:

> Ciao Riccardo,
> and thanks to you for sharing the hint ;)
> Ciao,
> Simo
>
> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
>
>
> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]> wrote:
> > I finally managed to make it work; the point here is not to let
> > mybatis bundle have access to the jdbc driver, but to let the client
> > bundle have it!
> > In other words there is no need for Dynamic-Import in mybatis bundle;
> > all that is needed is to put the driver package in the package-import
> > directive of the client bundle, eventually as an optional dependency.
>
> > No other tricks seem necessary to make it work.
>
> > Thanks anyway, this issue is closed :-)
>
> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
> >> Hello,
> >> I'm trying to use mybatis in an osgi enviroment (namely apache felix,
> >> but I think this is a general issue); I already have a working bundle
> >> for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
> >> mybatis jar in a bundle.
>
> >> I'm always getting an error at the first query I try:
>
> >> No suitable driver found for jdbc:jtds:sqlserver://<host and database
> >> name>
>
> >> Surely it is a classloader problem, that ibatis classloader has no
> >> access to driver classes.
> >> I also tried to add a:
>
> >> DynamicImport-Package: *
>
> >> to the bundle manifest with no luck.
>
> >> Has anyone tried to use mybatis in osgi enviroment?
>
> >> Thanks for your help,
> >> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Ciao Riccardo,
of course any contribution will be much more than appreciated, feel
free to raise issues on the MyBatis whenever you want. I know a little
osgi but I don't have any experience, AFAIK the Felix maven plugin is
able to add all the needed infos in the MANIFEST.
It would be very nice adding the osgi support also in the mybatis
subproject, I hope this will be the chance for a long collaboration :)
Take care, looking forward to see your contribs ;)
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]> wrote:

> Ciao Simone,
> I have two proposals:
> - is it possible to release mybatis as an osgi-ready bundle  (it's
> just a matter of a few lines in the manifest, no code adjustment
> should be necessary)?
> - would a little tutorial on how to use mybatis in an osgi enviroment
> fit in the user guide or wiki?
>
> I would gladly contribute to both issues, not immediately, but
> starting about no sooner than mid-november.
>
> Bye,
> Riccardo
>
> On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>> Ciao Riccardo,
>> and thanks to you for sharing the hint ;)
>> Ciao,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>
>>
>>
>> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]> wrote:
>> > I finally managed to make it work; the point here is not to let
>> > mybatis bundle have access to the jdbc driver, but to let the client
>> > bundle have it!
>> > In other words there is no need for Dynamic-Import in mybatis bundle;
>> > all that is needed is to put the driver package in the package-import
>> > directive of the client bundle, eventually as an optional dependency.
>>
>> > No other tricks seem necessary to make it work.
>>
>> > Thanks anyway, this issue is closed :-)
>>
>> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>> >> Hello,
>> >> I'm trying to use mybatis in an osgi enviroment (namely apache felix,
>> >> but I think this is a general issue); I already have a working bundle
>> >> for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
>> >> mybatis jar in a bundle.
>>
>> >> I'm always getting an error at the first query I try:
>>
>> >> No suitable driver found for jdbc:jtds:sqlserver://<host and database
>> >> name>
>>
>> >> Surely it is a classloader problem, that ibatis classloader has no
>> >> access to driver classes.
>> >> I also tried to add a:
>>
>> >> DynamicImport-Package: *
>>
>> >> to the bundle manifest with no luck.
>>
>> >> Has anyone tried to use mybatis in osgi enviroment?
>>
>> >> Thanks for your help,
>> >> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Andrea Selva
Ciao Simone and Riccardo,
 and if instead of only exporting myBatis package in the OSGi, the myBatis will export also some basic OSGi services in two flavour, Spring DM and plain OSGi Services?
 Andrea

On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]> wrote:
Ciao Riccardo,
of course any contribution will be much more than appreciated, feel
free to raise issues on the MyBatis whenever you want. I know a little
osgi but I don't have any experience, AFAIK the Felix maven plugin is
able to add all the needed infos in the MANIFEST.
It would be very nice adding the osgi support also in the mybatis
subproject, I hope this will be the chance for a long collaboration :)
Take care, looking forward to see your contribs ;)
On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]> wrote:
> Ciao Simone,
> I have two proposals:
> - is it possible to release mybatis as an osgi-ready bundle  (it's
> just a matter of a few lines in the manifest, no code adjustment
> should be necessary)?
> - would a little tutorial on how to use mybatis in an osgi enviroment
> fit in the user guide or wiki?
>
> I would gladly contribute to both issues, not immediately, but
> starting about no sooner than mid-november.
>
> Bye,
> Riccardo
>
> On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>> Ciao Riccardo,
>> and thanks to you for sharing the hint ;)
>> Ciao,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>
>>
>>
>> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]> wrote:
>> > I finally managed to make it work; the point here is not to let
>> > mybatis bundle have access to the jdbc driver, but to let the client
>> > bundle have it!
>> > In other words there is no need for Dynamic-Import in mybatis bundle;
>> > all that is needed is to put the driver package in the package-import
>> > directive of the client bundle, eventually as an optional dependency.
>>
>> > No other tricks seem necessary to make it work.
>>
>> > Thanks anyway, this issue is closed :-)
>>
>> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>> >> Hello,
>> >> I'm trying to use mybatis in an osgi enviroment (namely apache felix,
>> >> but I think this is a general issue); I already have a working bundle
>> >> for the jdbc driver I'm using (namely jtds) and I used BND to "osgify"
>> >> mybatis jar in a bundle.
>>
>> >> I'm always getting an error at the first query I try:
>>
>> >> No suitable driver found for jdbc:jtds:sqlserver://<host and database
>> >> name>
>>
>> >> Surely it is a classloader problem, that ibatis classloader has no
>> >> access to driver classes.
>> >> I also tried to add a:
>>
>> >> DynamicImport-Package: *
>>
>> >> to the bundle manifest with no luck.
>>
>> >> Has anyone tried to use mybatis in osgi enviroment?
>>
>> >> Thanks for your help,
>> >> Riccardo

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Ciao Andrea,
it seems Italian community is growing fast in the last time :) I think
that having 2 targets sounds much better, feel fee to raise issues and
attach patches, every contribution is appreciated.
Have a nice day,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:

> Ciao Simone and Riccardo,
>  and if instead of only exporting myBatis package in the OSGi, the myBatis
> will export also some basic OSGi services in two flavour, Spring DM and
> plain OSGi Services?
>  Andrea
>
> On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Ciao Riccardo,
>> of course any contribution will be much more than appreciated, feel
>> free to raise issues on the MyBatis whenever you want. I know a little
>> osgi but I don't have any experience, AFAIK the Felix maven plugin is
>> able to add all the needed infos in the MANIFEST.
>> It would be very nice adding the osgi support also in the mybatis
>> subproject, I hope this will be the chance for a long collaboration :)
>> Take care, looking forward to see your contribs ;)
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
>> wrote:
>> > Ciao Simone,
>> > I have two proposals:
>> > - is it possible to release mybatis as an osgi-ready bundle  (it's
>> > just a matter of a few lines in the manifest, no code adjustment
>> > should be necessary)?
>> > - would a little tutorial on how to use mybatis in an osgi enviroment
>> > fit in the user guide or wiki?
>> >
>> > I would gladly contribute to both issues, not immediately, but
>> > starting about no sooner than mid-november.
>> >
>> > Bye,
>> > Riccardo
>> >
>> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>> >> Ciao Riccardo,
>> >> and thanks to you for sharing the hint ;)
>> >> Ciao,
>> >> Simo
>> >>
>> >> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >>
>> >>
>> >>
>> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
>> >> wrote:
>> >> > I finally managed to make it work; the point here is not to let
>> >> > mybatis bundle have access to the jdbc driver, but to let the client
>> >> > bundle have it!
>> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
>> >> > all that is needed is to put the driver package in the package-import
>> >> > directive of the client bundle, eventually as an optional dependency.
>> >>
>> >> > No other tricks seem necessary to make it work.
>> >>
>> >> > Thanks anyway, this issue is closed :-)
>> >>
>> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>> >> >> Hello,
>> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
>> >> >> felix,
>> >> >> but I think this is a general issue); I already have a working
>> >> >> bundle
>> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
>> >> >> "osgify"
>> >> >> mybatis jar in a bundle.
>> >>
>> >> >> I'm always getting an error at the first query I try:
>> >>
>> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>> >> >> database
>> >> >> name>
>> >>
>> >> >> Surely it is a classloader problem, that ibatis classloader has no
>> >> >> access to driver classes.
>> >> >> I also tried to add a:
>> >>
>> >> >> DynamicImport-Package: *
>> >>
>> >> >> to the bundle manifest with no luck.
>> >>
>> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >>
>> >> >> Thanks for your help,
>> >> >> Riccardo
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
I agree about the two targets, but I never used Spring Osgi, so I
can't contribute about that at the moment.

Felix Plugin can generate the manifest because it is based on BND, but
in my experience it tends to produce a little bloated manifest; it
would probably be better to start with it but to hand-revise it to
produce a lighter one. The result can then be added without problems
to the usual manifest.

It's nice to see we are all italians on this thread and I know quite a
few teams in Bologna who have used ibatis/mybatis; I started just a
couple of days ago :-)

Bye,
Riccardo

On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:

> Ciao Andrea,
> it seems Italian community is growing fast in the last time :) I think
> that having 2 targets sounds much better, feel fee to raise issues and
> attach patches, every contribution is appreciated.
> Have a nice day,
> Simo
>
> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
>
>
> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:
> > Ciao Simone and Riccardo,
> >  and if instead of only exporting myBatis package in the OSGi, the myBatis
> > will export also some basic OSGi services in two flavour, Spring DM and
> > plain OSGi Services?
> >  Andrea
>
> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
> > wrote:
>
> >> Ciao Riccardo,
> >> of course any contribution will be much more than appreciated, feel
> >> free to raise issues on the MyBatis whenever you want. I know a little
> >> osgi but I don't have any experience, AFAIK the Felix maven plugin is
> >> able to add all the needed infos in the MANIFEST.
> >> It would be very nice adding the osgi support also in the mybatis
> >> subproject, I hope this will be the chance for a long collaboration :)
> >> Take care, looking forward to see your contribs ;)
> >> Simo
>
> >>http://people.apache.org/~simonetripodi/
> >>http://www.99soft.org/
>
> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
> >> wrote:
> >> > Ciao Simone,
> >> > I have two proposals:
> >> > - is it possible to release mybatis as an osgi-ready bundle  (it's
> >> > just a matter of a few lines in the manifest, no code adjustment
> >> > should be necessary)?
> >> > - would a little tutorial on how to use mybatis in an osgi enviroment
> >> > fit in the user guide or wiki?
>
> >> > I would gladly contribute to both issues, not immediately, but
> >> > starting about no sooner than mid-november.
>
> >> > Bye,
> >> > Riccardo
>
> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
> >> >> Ciao Riccardo,
> >> >> and thanks to you for sharing the hint ;)
> >> >> Ciao,
> >> >> Simo
>
> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>
> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
> >> >> wrote:
> >> >> > I finally managed to make it work; the point here is not to let
> >> >> > mybatis bundle have access to the jdbc driver, but to let the client
> >> >> > bundle have it!
> >> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
> >> >> > all that is needed is to put the driver package in the package-import
> >> >> > directive of the client bundle, eventually as an optional dependency.
>
> >> >> > No other tricks seem necessary to make it work.
>
> >> >> > Thanks anyway, this issue is closed :-)
>
> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
> >> >> >> Hello,
> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
> >> >> >> felix,
> >> >> >> but I think this is a general issue); I already have a working
> >> >> >> bundle
> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
> >> >> >> "osgify"
> >> >> >> mybatis jar in a bundle.
>
> >> >> >> I'm always getting an error at the first query I try:
>
> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
> >> >> >> database
> >> >> >> name>
>
> >> >> >> Surely it is a classloader problem, that ibatis classloader has no
> >> >> >> access to driver classes.
> >> >> >> I also tried to add a:
>
> >> >> >> DynamicImport-Package: *
>
> >> >> >> to the bundle manifest with no luck.
>
> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>
> >> >> >> Thanks for your help,
> >> >> >> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Ciao Riccardo,
I don't have experiences on both so you'll be the main heads on this :)
OK for the manifest bundle info, they can be easily added using the
jar plugin and I don't see any blocking issue on relying only on it.
Looking forward to your contribs, have a nice weekend!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]> wrote:

> I agree about the two targets, but I never used Spring Osgi, so I
> can't contribute about that at the moment.
>
> Felix Plugin can generate the manifest because it is based on BND, but
> in my experience it tends to produce a little bloated manifest; it
> would probably be better to start with it but to hand-revise it to
> produce a lighter one. The result can then be added without problems
> to the usual manifest.
>
> It's nice to see we are all italians on this thread and I know quite a
> few teams in Bologna who have used ibatis/mybatis; I started just a
> couple of days ago :-)
>
> Bye,
> Riccardo
>
> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>> Ciao Andrea,
>> it seems Italian community is growing fast in the last time :) I think
>> that having 2 targets sounds much better, feel fee to raise issues and
>> attach patches, every contribution is appreciated.
>> Have a nice day,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>
>>
>>
>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:
>> > Ciao Simone and Riccardo,
>> >  and if instead of only exporting myBatis package in the OSGi, the myBatis
>> > will export also some basic OSGi services in two flavour, Spring DM and
>> > plain OSGi Services?
>> >  Andrea
>>
>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
>> > wrote:
>>
>> >> Ciao Riccardo,
>> >> of course any contribution will be much more than appreciated, feel
>> >> free to raise issues on the MyBatis whenever you want. I know a little
>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin is
>> >> able to add all the needed infos in the MANIFEST.
>> >> It would be very nice adding the osgi support also in the mybatis
>> >> subproject, I hope this will be the chance for a long collaboration :)
>> >> Take care, looking forward to see your contribs ;)
>> >> Simo
>>
>> >>http://people.apache.org/~simonetripodi/
>> >>http://www.99soft.org/
>>
>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
>> >> wrote:
>> >> > Ciao Simone,
>> >> > I have two proposals:
>> >> > - is it possible to release mybatis as an osgi-ready bundle  (it's
>> >> > just a matter of a few lines in the manifest, no code adjustment
>> >> > should be necessary)?
>> >> > - would a little tutorial on how to use mybatis in an osgi enviroment
>> >> > fit in the user guide or wiki?
>>
>> >> > I would gladly contribute to both issues, not immediately, but
>> >> > starting about no sooner than mid-november.
>>
>> >> > Bye,
>> >> > Riccardo
>>
>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>> >> >> Ciao Riccardo,
>> >> >> and thanks to you for sharing the hint ;)
>> >> >> Ciao,
>> >> >> Simo
>>
>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>
>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
>> >> >> wrote:
>> >> >> > I finally managed to make it work; the point here is not to let
>> >> >> > mybatis bundle have access to the jdbc driver, but to let the client
>> >> >> > bundle have it!
>> >> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
>> >> >> > all that is needed is to put the driver package in the package-import
>> >> >> > directive of the client bundle, eventually as an optional dependency.
>>
>> >> >> > No other tricks seem necessary to make it work.
>>
>> >> >> > Thanks anyway, this issue is closed :-)
>>
>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>> >> >> >> Hello,
>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
>> >> >> >> felix,
>> >> >> >> but I think this is a general issue); I already have a working
>> >> >> >> bundle
>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
>> >> >> >> "osgify"
>> >> >> >> mybatis jar in a bundle.
>>
>> >> >> >> I'm always getting an error at the first query I try:
>>
>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>> >> >> >> database
>> >> >> >> name>
>>
>> >> >> >> Surely it is a classloader problem, that ibatis classloader has no
>> >> >> >> access to driver classes.
>> >> >> >> I also tried to add a:
>>
>> >> >> >> DynamicImport-Package: *
>>
>> >> >> >> to the bundle manifest with no luck.
>>
>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>
>> >> >> >> Thanks for your help,
>> >> >> >> Riccardo
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Hi Riccardo and Andrea,
are you still interested on contributing on the OSGi side? Community
is also requesting OSGi support[1] and IMHO the interest around that
technology will increase
very quickly.
Thanks in advance!
Simo

[1] http://code.google.com/p/mybatis/issues/detail?id=178

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
<[hidden email]> wrote:

> Ciao Riccardo,
> I don't have experiences on both so you'll be the main heads on this :)
> OK for the manifest bundle info, they can be easily added using the
> jar plugin and I don't see any blocking issue on relying only on it.
> Looking forward to your contribs, have a nice weekend!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]> wrote:
>> I agree about the two targets, but I never used Spring Osgi, so I
>> can't contribute about that at the moment.
>>
>> Felix Plugin can generate the manifest because it is based on BND, but
>> in my experience it tends to produce a little bloated manifest; it
>> would probably be better to start with it but to hand-revise it to
>> produce a lighter one. The result can then be added without problems
>> to the usual manifest.
>>
>> It's nice to see we are all italians on this thread and I know quite a
>> few teams in Bologna who have used ibatis/mybatis; I started just a
>> couple of days ago :-)
>>
>> Bye,
>> Riccardo
>>
>> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>>> Ciao Andrea,
>>> it seems Italian community is growing fast in the last time :) I think
>>> that having 2 targets sounds much better, feel fee to raise issues and
>>> attach patches, every contribution is appreciated.
>>> Have a nice day,
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>>
>>>
>>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:
>>> > Ciao Simone and Riccardo,
>>> >  and if instead of only exporting myBatis package in the OSGi, the myBatis
>>> > will export also some basic OSGi services in two flavour, Spring DM and
>>> > plain OSGi Services?
>>> >  Andrea
>>>
>>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
>>> > wrote:
>>>
>>> >> Ciao Riccardo,
>>> >> of course any contribution will be much more than appreciated, feel
>>> >> free to raise issues on the MyBatis whenever you want. I know a little
>>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin is
>>> >> able to add all the needed infos in the MANIFEST.
>>> >> It would be very nice adding the osgi support also in the mybatis
>>> >> subproject, I hope this will be the chance for a long collaboration :)
>>> >> Take care, looking forward to see your contribs ;)
>>> >> Simo
>>>
>>> >>http://people.apache.org/~simonetripodi/
>>> >>http://www.99soft.org/
>>>
>>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
>>> >> wrote:
>>> >> > Ciao Simone,
>>> >> > I have two proposals:
>>> >> > - is it possible to release mybatis as an osgi-ready bundle  (it's
>>> >> > just a matter of a few lines in the manifest, no code adjustment
>>> >> > should be necessary)?
>>> >> > - would a little tutorial on how to use mybatis in an osgi enviroment
>>> >> > fit in the user guide or wiki?
>>>
>>> >> > I would gladly contribute to both issues, not immediately, but
>>> >> > starting about no sooner than mid-november.
>>>
>>> >> > Bye,
>>> >> > Riccardo
>>>
>>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>>> >> >> Ciao Riccardo,
>>> >> >> and thanks to you for sharing the hint ;)
>>> >> >> Ciao,
>>> >> >> Simo
>>>
>>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
>>> >> >> wrote:
>>> >> >> > I finally managed to make it work; the point here is not to let
>>> >> >> > mybatis bundle have access to the jdbc driver, but to let the client
>>> >> >> > bundle have it!
>>> >> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
>>> >> >> > all that is needed is to put the driver package in the package-import
>>> >> >> > directive of the client bundle, eventually as an optional dependency.
>>>
>>> >> >> > No other tricks seem necessary to make it work.
>>>
>>> >> >> > Thanks anyway, this issue is closed :-)
>>>
>>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>>> >> >> >> Hello,
>>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
>>> >> >> >> felix,
>>> >> >> >> but I think this is a general issue); I already have a working
>>> >> >> >> bundle
>>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
>>> >> >> >> "osgify"
>>> >> >> >> mybatis jar in a bundle.
>>>
>>> >> >> >> I'm always getting an error at the first query I try:
>>>
>>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>>> >> >> >> database
>>> >> >> >> name>
>>>
>>> >> >> >> Surely it is a classloader problem, that ibatis classloader has no
>>> >> >> >> access to driver classes.
>>> >> >> >> I also tried to add a:
>>>
>>> >> >> >> DynamicImport-Package: *
>>>
>>> >> >> >> to the bundle manifest with no luck.
>>>
>>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>>
>>> >> >> >> Thanks for your help,
>>> >> >> >> Riccardo
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Andrea Selva
Hi Simone!
Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped in a bundle from another bundle, it seems that the xml file contained in my client bundle can't be loaded from mybatis classpath.The problem should be that the resourse loading fail when my module (with myBatis wrapped into) init the myBatis with it's configuration file. I'm investiganting. Has anynoe  got  the same problem?
Despite this problems I'm interested.
 Andrea

On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi <[hidden email]> wrote:
Hi Riccardo and Andrea,
are you still interested on contributing on the OSGi side? Community
is also requesting OSGi support[1] and IMHO the interest around that
technology will increase
very quickly.
Thanks in advance!
Simo

[1] http://code.google.com/p/mybatis/issues/detail?id=178
On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
<[hidden email]> wrote:
> Ciao Riccardo,
> I don't have experiences on both so you'll be the main heads on this :)
> OK for the manifest bundle info, they can be easily added using the
> jar plugin and I don't see any blocking issue on relying only on it.
> Looking forward to your contribs, have a nice weekend!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]> wrote:
>> I agree about the two targets, but I never used Spring Osgi, so I
>> can't contribute about that at the moment.
>>
>> Felix Plugin can generate the manifest because it is based on BND, but
>> in my experience it tends to produce a little bloated manifest; it
>> would probably be better to start with it but to hand-revise it to
>> produce a lighter one. The result can then be added without problems
>> to the usual manifest.
>>
>> It's nice to see we are all italians on this thread and I know quite a
>> few teams in Bologna who have used ibatis/mybatis; I started just a
>> couple of days ago :-)
>>
>> Bye,
>> Riccardo
>>
>> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>>> Ciao Andrea,
>>> it seems Italian community is growing fast in the last time :) I think
>>> that having 2 targets sounds much better, feel fee to raise issues and
>>> attach patches, every contribution is appreciated.
>>> Have a nice day,
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>>
>>>
>>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:
>>> > Ciao Simone and Riccardo,
>>> >  and if instead of only exporting myBatis package in the OSGi, the myBatis
>>> > will export also some basic OSGi services in two flavour, Spring DM and
>>> > plain OSGi Services?
>>> >  Andrea
>>>
>>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
>>> > wrote:
>>>
>>> >> Ciao Riccardo,
>>> >> of course any contribution will be much more than appreciated, feel
>>> >> free to raise issues on the MyBatis whenever you want. I know a little
>>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin is
>>> >> able to add all the needed infos in the MANIFEST.
>>> >> It would be very nice adding the osgi support also in the mybatis
>>> >> subproject, I hope this will be the chance for a long collaboration :)
>>> >> Take care, looking forward to see your contribs ;)
>>> >> Simo
>>>
>>> >>http://people.apache.org/~simonetripodi/
>>> >>http://www.99soft.org/
>>>
>>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
>>> >> wrote:
>>> >> > Ciao Simone,
>>> >> > I have two proposals:
>>> >> > - is it possible to release mybatis as an osgi-ready bundle  (it's
>>> >> > just a matter of a few lines in the manifest, no code adjustment
>>> >> > should be necessary)?
>>> >> > - would a little tutorial on how to use mybatis in an osgi enviroment
>>> >> > fit in the user guide or wiki?
>>>
>>> >> > I would gladly contribute to both issues, not immediately, but
>>> >> > starting about no sooner than mid-november.
>>>
>>> >> > Bye,
>>> >> > Riccardo
>>>
>>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>>> >> >> Ciao Riccardo,
>>> >> >> and thanks to you for sharing the hint ;)
>>> >> >> Ciao,
>>> >> >> Simo
>>>
>>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
>>> >> >> wrote:
>>> >> >> > I finally managed to make it work; the point here is not to let
>>> >> >> > mybatis bundle have access to the jdbc driver, but to let the client
>>> >> >> > bundle have it!
>>> >> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
>>> >> >> > all that is needed is to put the driver package in the package-import
>>> >> >> > directive of the client bundle, eventually as an optional dependency.
>>>
>>> >> >> > No other tricks seem necessary to make it work.
>>>
>>> >> >> > Thanks anyway, this issue is closed :-)
>>>
>>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>>> >> >> >> Hello,
>>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
>>> >> >> >> felix,
>>> >> >> >> but I think this is a general issue); I already have a working
>>> >> >> >> bundle
>>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
>>> >> >> >> "osgify"
>>> >> >> >> mybatis jar in a bundle.
>>>
>>> >> >> >> I'm always getting an error at the first query I try:
>>>
>>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>>> >> >> >> database
>>> >> >> >> name>
>>>
>>> >> >> >> Surely it is a classloader problem, that ibatis classloader has no
>>> >> >> >> access to driver classes.
>>> >> >> >> I also tried to add a:
>>>
>>> >> >> >> DynamicImport-Package: *
>>>
>>> >> >> >> to the bundle manifest with no luck.
>>>
>>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>>
>>> >> >> >> Thanks for your help,
>>> >> >> >> Riccardo
>

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
Hello Simone,
I actually did little progress with Osgi and Mybatis; I'm using it in a production site but I'm not loading mappings from an external bundle. This way it is simpler because all you have to do is "osgify" the mybatis jar using bnd and a little extra setup which I'm not sure I did correctly (I had to do a Class.forName for the jdbc driver to have it correctly loaded and added DynamicImport * to mybatis manifest - I think there may be a better way, but it's the only way I could make it work).
Maybe I can write down this procedure in more extent and have some feedback from the community to reach a better undestranding, but I don't think I'm a the point of writing something for the user guide and I'm in a tight schedule so I don't think I will have much time to experiment in the near future.

Bye,
Riccardo

On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva <[hidden email]> wrote:
Hi Simone!
Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped in a bundle from another bundle, it seems that the xml file contained in my client bundle can't be loaded from mybatis classpath.The problem should be that the resourse loading fail when my module (with myBatis wrapped into) init the myBatis with it's configuration file. I'm investiganting. Has anynoe  got  the same problem?
Despite this problems I'm interested.
 Andrea


On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi <[hidden email]> wrote:
Hi Riccardo and Andrea,
are you still interested on contributing on the OSGi side? Community
is also requesting OSGi support[1] and IMHO the interest around that
technology will increase
very quickly.
Thanks in advance!
Simo

[1] http://code.google.com/p/mybatis/issues/detail?id=178
On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
<[hidden email]> wrote:
> Ciao Riccardo,
> I don't have experiences on both so you'll be the main heads on this :)
> OK for the manifest bundle info, they can be easily added using the
> jar plugin and I don't see any blocking issue on relying only on it.
> Looking forward to your contribs, have a nice weekend!
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
>
>
> On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]> wrote:
>> I agree about the two targets, but I never used Spring Osgi, so I
>> can't contribute about that at the moment.
>>
>> Felix Plugin can generate the manifest because it is based on BND, but
>> in my experience it tends to produce a little bloated manifest; it
>> would probably be better to start with it but to hand-revise it to
>> produce a lighter one. The result can then be added without problems
>> to the usual manifest.
>>
>> It's nice to see we are all italians on this thread and I know quite a
>> few teams in Bologna who have used ibatis/mybatis; I started just a
>> couple of days ago :-)
>>
>> Bye,
>> Riccardo
>>
>> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>>> Ciao Andrea,
>>> it seems Italian community is growing fast in the last time :) I think
>>> that having 2 targets sounds much better, feel fee to raise issues and
>>> attach patches, every contribution is appreciated.
>>> Have a nice day,
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>>
>>>
>>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva <[hidden email]> wrote:
>>> > Ciao Simone and Riccardo,
>>> >  and if instead of only exporting myBatis package in the OSGi, the myBatis
>>> > will export also some basic OSGi services in two flavour, Spring DM and
>>> > plain OSGi Services?
>>> >  Andrea
>>>
>>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi <[hidden email]>
>>> > wrote:
>>>
>>> >> Ciao Riccardo,
>>> >> of course any contribution will be much more than appreciated, feel
>>> >> free to raise issues on the MyBatis whenever you want. I know a little
>>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin is
>>> >> able to add all the needed infos in the MANIFEST.
>>> >> It would be very nice adding the osgi support also in the mybatis
>>> >> subproject, I hope this will be the chance for a long collaboration :)
>>> >> Take care, looking forward to see your contribs ;)
>>> >> Simo
>>>
>>> >>http://people.apache.org/~simonetripodi/
>>> >>http://www.99soft.org/
>>>
>>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo <[hidden email]>
>>> >> wrote:
>>> >> > Ciao Simone,
>>> >> > I have two proposals:
>>> >> > - is it possible to release mybatis as an osgi-ready bundle  (it's
>>> >> > just a matter of a few lines in the manifest, no code adjustment
>>> >> > should be necessary)?
>>> >> > - would a little tutorial on how to use mybatis in an osgi enviroment
>>> >> > fit in the user guide or wiki?
>>>
>>> >> > I would gladly contribute to both issues, not immediately, but
>>> >> > starting about no sooner than mid-november.
>>>
>>> >> > Bye,
>>> >> > Riccardo
>>>
>>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]> wrote:
>>> >> >> Ciao Riccardo,
>>> >> >> and thanks to you for sharing the hint ;)
>>> >> >> Ciao,
>>> >> >> Simo
>>>
>>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>>
>>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo <[hidden email]>
>>> >> >> wrote:
>>> >> >> > I finally managed to make it work; the point here is not to let
>>> >> >> > mybatis bundle have access to the jdbc driver, but to let the client
>>> >> >> > bundle have it!
>>> >> >> > In other words there is no need for Dynamic-Import in mybatis bundle;
>>> >> >> > all that is needed is to put the driver package in the package-import
>>> >> >> > directive of the client bundle, eventually as an optional dependency.
>>>
>>> >> >> > No other tricks seem necessary to make it work.
>>>
>>> >> >> > Thanks anyway, this issue is closed :-)
>>>
>>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>>> >> >> >> Hello,
>>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely apache
>>> >> >> >> felix,
>>> >> >> >> but I think this is a general issue); I already have a working
>>> >> >> >> bundle
>>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND to
>>> >> >> >> "osgify"
>>> >> >> >> mybatis jar in a bundle.
>>>
>>> >> >> >> I'm always getting an error at the first query I try:
>>>
>>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>>> >> >> >> database
>>> >> >> >> name>
>>>
>>> >> >> >> Surely it is a classloader problem, that ibatis classloader has no
>>> >> >> >> access to driver classes.
>>> >> >> >> I also tried to add a:
>>>
>>> >> >> >> DynamicImport-Package: *
>>>
>>> >> >> >> to the bundle manifest with no luck.
>>>
>>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>>
>>> >> >> >> Thanks for your help,
>>> >> >> >> Riccardo
>


Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Hi guys,
I just uploaded a snapshot that *should* support OSGi, I'd like to ask
you if you're available to test it; to obtain the artifact using
Maven, add the repository in your pom:

    <repositories>
        ...
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        ...
    </repositories>

then add the following dependency:

    <dependency>
      ...
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.0.4-SNAPSHOT</version>
      ...
    </dependency>

Please let me know, many thanks in advance!!!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
<[hidden email]> wrote:

> Hello Simone,
> I actually did little progress with Osgi and Mybatis; I'm using it in a
> production site but I'm not loading mappings from an external bundle. This
> way it is simpler because all you have to do is "osgify" the mybatis jar
> using bnd and a little extra setup which I'm not sure I did correctly (I had
> to do a Class.forName for the jdbc driver to have it correctly loaded and
> added DynamicImport * to mybatis manifest - I think there may be a better
> way, but it's the only way I could make it work).
> Maybe I can write down this procedure in more extent and have some feedback
> from the community to reach a better undestranding, but I don't think I'm a
> the point of writing something for the user guide and I'm in a tight
> schedule so I don't think I will have much time to experiment in the near
> future.
> Bye,
> Riccardo
>
> On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva <[hidden email]>
> wrote:
>>
>> Hi Simone!
>> Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped in a
>> bundle from another bundle, it seems that the xml file contained in my
>> client bundle can't be loaded from mybatis classpath.The problem should be
>> that the resourse loading fail when my module (with myBatis wrapped into)
>> init the myBatis with it's configuration file. I'm investiganting. Has
>> anynoe  got  the same problem?
>> Despite this problems I'm interested.
>>  Andrea
>>
>> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi <[hidden email]>
>> wrote:
>>>
>>> Hi Riccardo and Andrea,
>>> are you still interested on contributing on the OSGi side? Community
>>> is also requesting OSGi support[1] and IMHO the interest around that
>>> technology will increase
>>> very quickly.
>>> Thanks in advance!
>>> Simo
>>>
>>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>>> <[hidden email]> wrote:
>>> > Ciao Riccardo,
>>> > I don't have experiences on both so you'll be the main heads on this :)
>>> > OK for the manifest bundle info, they can be easily added using the
>>> > jar plugin and I don't see any blocking issue on relying only on it.
>>> > Looking forward to your contribs, have a nice weekend!
>>> > Simo
>>> >
>>> > http://people.apache.org/~simonetripodi/
>>> > http://www.99soft.org/
>>> >
>>> >
>>> >
>>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]>
>>> > wrote:
>>> >> I agree about the two targets, but I never used Spring Osgi, so I
>>> >> can't contribute about that at the moment.
>>> >>
>>> >> Felix Plugin can generate the manifest because it is based on BND, but
>>> >> in my experience it tends to produce a little bloated manifest; it
>>> >> would probably be better to start with it but to hand-revise it to
>>> >> produce a lighter one. The result can then be added without problems
>>> >> to the usual manifest.
>>> >>
>>> >> It's nice to see we are all italians on this thread and I know quite a
>>> >> few teams in Bologna who have used ibatis/mybatis; I started just a
>>> >> couple of days ago :-)
>>> >>
>>> >> Bye,
>>> >> Riccardo
>>> >>
>>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>>> >>> Ciao Andrea,
>>> >>> it seems Italian community is growing fast in the last time :) I
>>> >>> think
>>> >>> that having 2 targets sounds much better, feel fee to raise issues
>>> >>> and
>>> >>> attach patches, every contribution is appreciated.
>>> >>> Have a nice day,
>>> >>> Simo
>>> >>>
>>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>>> >>> <[hidden email]> wrote:
>>> >>> > Ciao Simone and Riccardo,
>>> >>> >  and if instead of only exporting myBatis package in the OSGi, the
>>> >>> > myBatis
>>> >>> > will export also some basic OSGi services in two flavour, Spring DM
>>> >>> > and
>>> >>> > plain OSGi Services?
>>> >>> >  Andrea
>>> >>>
>>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>>> >>> > <[hidden email]>
>>> >>> > wrote:
>>> >>>
>>> >>> >> Ciao Riccardo,
>>> >>> >> of course any contribution will be much more than appreciated,
>>> >>> >> feel
>>> >>> >> free to raise issues on the MyBatis whenever you want. I know a
>>> >>> >> little
>>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin
>>> >>> >> is
>>> >>> >> able to add all the needed infos in the MANIFEST.
>>> >>> >> It would be very nice adding the osgi support also in the mybatis
>>> >>> >> subproject, I hope this will be the chance for a long
>>> >>> >> collaboration :)
>>> >>> >> Take care, looking forward to see your contribs ;)
>>> >>> >> Simo
>>> >>>
>>> >>> >>http://people.apache.org/~simonetripodi/
>>> >>> >>http://www.99soft.org/
>>> >>>
>>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>>> >>> >> <[hidden email]>
>>> >>> >> wrote:
>>> >>> >> > Ciao Simone,
>>> >>> >> > I have two proposals:
>>> >>> >> > - is it possible to release mybatis as an osgi-ready bundle
>>> >>> >> >  (it's
>>> >>> >> > just a matter of a few lines in the manifest, no code adjustment
>>> >>> >> > should be necessary)?
>>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>>> >>> >> > enviroment
>>> >>> >> > fit in the user guide or wiki?
>>> >>>
>>> >>> >> > I would gladly contribute to both issues, not immediately, but
>>> >>> >> > starting about no sooner than mid-november.
>>> >>>
>>> >>> >> > Bye,
>>> >>> >> > Riccardo
>>> >>>
>>> >>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]>
>>> >>> >> > wrote:
>>> >>> >> >> Ciao Riccardo,
>>> >>> >> >> and thanks to you for sharing the hint ;)
>>> >>> >> >> Ciao,
>>> >>> >> >> Simo
>>> >>>
>>> >>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>> >>>
>>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>>> >>> >> >> <[hidden email]>
>>> >>> >> >> wrote:
>>> >>> >> >> > I finally managed to make it work; the point here is not to
>>> >>> >> >> > let
>>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to let the
>>> >>> >> >> > client
>>> >>> >> >> > bundle have it!
>>> >>> >> >> > In other words there is no need for Dynamic-Import in mybatis
>>> >>> >> >> > bundle;
>>> >>> >> >> > all that is needed is to put the driver package in the
>>> >>> >> >> > package-import
>>> >>> >> >> > directive of the client bundle, eventually as an optional
>>> >>> >> >> > dependency.
>>> >>>
>>> >>> >> >> > No other tricks seem necessary to make it work.
>>> >>>
>>> >>> >> >> > Thanks anyway, this issue is closed :-)
>>> >>>
>>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>>> >>> >> >> >> Hello,
>>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely
>>> >>> >> >> >> apache
>>> >>> >> >> >> felix,
>>> >>> >> >> >> but I think this is a general issue); I already have a
>>> >>> >> >> >> working
>>> >>> >> >> >> bundle
>>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND
>>> >>> >> >> >> to
>>> >>> >> >> >> "osgify"
>>> >>> >> >> >> mybatis jar in a bundle.
>>> >>>
>>> >>> >> >> >> I'm always getting an error at the first query I try:
>>> >>>
>>> >>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>>> >>> >> >> >> database
>>> >>> >> >> >> name>
>>> >>>
>>> >>> >> >> >> Surely it is a classloader problem, that ibatis classloader
>>> >>> >> >> >> has no
>>> >>> >> >> >> access to driver classes.
>>> >>> >> >> >> I also tried to add a:
>>> >>>
>>> >>> >> >> >> DynamicImport-Package: *
>>> >>>
>>> >>> >> >> >> to the bundle manifest with no luck.
>>> >>>
>>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>> >>>
>>> >>> >> >> >> Thanks for your help,
>>> >>> >> >> >> Riccardo
>>> >
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Andrea Selva
Hi Simone
I'll give a try in the next days, I've a project that could be a test, so I'm very happy of this news.
I'll give my feedback as soon as possible
 Andrea

On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi <[hidden email]> wrote:
Hi guys,
I just uploaded a snapshot that *should* support OSGi, I'd like to ask
you if you're available to test it; to obtain the artifact using
Maven, add the repository in your pom:

   <repositories>
       ...
       <repository>
           <id>sonatype-nexus-snapshots</id>
           <name>Sonatype Nexus Snapshots</name>
           <url>https://oss.sonatype.org/content/repositories/snapshots</url>
           <releases>
               <enabled>false</enabled>
           </releases>
           <snapshots>
               <enabled>true</enabled>
           </snapshots>
       </repository>
       ...
   </repositories>

then add the following dependency:

   <dependency>
     ...
     <groupId>org.mybatis</groupId>
     <artifactId>mybatis</artifactId>
     <version>3.0.4-SNAPSHOT</version>
     ...
   </dependency>

Please let me know, many thanks in advance!!!
On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
<[hidden email]> wrote:
> Hello Simone,
> I actually did little progress with Osgi and Mybatis; I'm using it in a
> production site but I'm not loading mappings from an external bundle. This
> way it is simpler because all you have to do is "osgify" the mybatis jar
> using bnd and a little extra setup which I'm not sure I did correctly (I had
> to do a Class.forName for the jdbc driver to have it correctly loaded and
> added DynamicImport * to mybatis manifest - I think there may be a better
> way, but it's the only way I could make it work).
> Maybe I can write down this procedure in more extent and have some feedback
> from the community to reach a better undestranding, but I don't think I'm a
> the point of writing something for the user guide and I'm in a tight
> schedule so I don't think I will have much time to experiment in the near
> future.
> Bye,
> Riccardo
>
> On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva <[hidden email]>
> wrote:
>>
>> Hi Simone!
>> Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped in a
>> bundle from another bundle, it seems that the xml file contained in my
>> client bundle can't be loaded from mybatis classpath.The problem should be
>> that the resourse loading fail when my module (with myBatis wrapped into)
>> init the myBatis with it's configuration file. I'm investiganting. Has
>> anynoe  got  the same problem?
>> Despite this problems I'm interested.
>>  Andrea
>>
>> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi <[hidden email]>
>> wrote:
>>>
>>> Hi Riccardo and Andrea,
>>> are you still interested on contributing on the OSGi side? Community
>>> is also requesting OSGi support[1] and IMHO the interest around that
>>> technology will increase
>>> very quickly.
>>> Thanks in advance!
>>> Simo
>>>
>>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>>> <[hidden email]> wrote:
>>> > Ciao Riccardo,
>>> > I don't have experiences on both so you'll be the main heads on this :)
>>> > OK for the manifest bundle info, they can be easily added using the
>>> > jar plugin and I don't see any blocking issue on relying only on it.
>>> > Looking forward to your contribs, have a nice weekend!
>>> > Simo
>>> >
>>> > http://people.apache.org/~simonetripodi/
>>> > http://www.99soft.org/
>>> >
>>> >
>>> >
>>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]>
>>> > wrote:
>>> >> I agree about the two targets, but I never used Spring Osgi, so I
>>> >> can't contribute about that at the moment.
>>> >>
>>> >> Felix Plugin can generate the manifest because it is based on BND, but
>>> >> in my experience it tends to produce a little bloated manifest; it
>>> >> would probably be better to start with it but to hand-revise it to
>>> >> produce a lighter one. The result can then be added without problems
>>> >> to the usual manifest.
>>> >>
>>> >> It's nice to see we are all italians on this thread and I know quite a
>>> >> few teams in Bologna who have used ibatis/mybatis; I started just a
>>> >> couple of days ago :-)
>>> >>
>>> >> Bye,
>>> >> Riccardo
>>> >>
>>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>>> >>> Ciao Andrea,
>>> >>> it seems Italian community is growing fast in the last time :) I
>>> >>> think
>>> >>> that having 2 targets sounds much better, feel fee to raise issues
>>> >>> and
>>> >>> attach patches, every contribution is appreciated.
>>> >>> Have a nice day,
>>> >>> Simo
>>> >>>
>>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>>> >>> <[hidden email]> wrote:
>>> >>> > Ciao Simone and Riccardo,
>>> >>> >  and if instead of only exporting myBatis package in the OSGi, the
>>> >>> > myBatis
>>> >>> > will export also some basic OSGi services in two flavour, Spring DM
>>> >>> > and
>>> >>> > plain OSGi Services?
>>> >>> >  Andrea
>>> >>>
>>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>>> >>> > <[hidden email]>
>>> >>> > wrote:
>>> >>>
>>> >>> >> Ciao Riccardo,
>>> >>> >> of course any contribution will be much more than appreciated,
>>> >>> >> feel
>>> >>> >> free to raise issues on the MyBatis whenever you want. I know a
>>> >>> >> little
>>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven plugin
>>> >>> >> is
>>> >>> >> able to add all the needed infos in the MANIFEST.
>>> >>> >> It would be very nice adding the osgi support also in the mybatis
>>> >>> >> subproject, I hope this will be the chance for a long
>>> >>> >> collaboration :)
>>> >>> >> Take care, looking forward to see your contribs ;)
>>> >>> >> Simo
>>> >>>
>>> >>> >>http://people.apache.org/~simonetripodi/
>>> >>> >>http://www.99soft.org/
>>> >>>
>>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>>> >>> >> <[hidden email]>
>>> >>> >> wrote:
>>> >>> >> > Ciao Simone,
>>> >>> >> > I have two proposals:
>>> >>> >> > - is it possible to release mybatis as an osgi-ready bundle
>>> >>> >> >  (it's
>>> >>> >> > just a matter of a few lines in the manifest, no code adjustment
>>> >>> >> > should be necessary)?
>>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>>> >>> >> > enviroment
>>> >>> >> > fit in the user guide or wiki?
>>> >>>
>>> >>> >> > I would gladly contribute to both issues, not immediately, but
>>> >>> >> > starting about no sooner than mid-november.
>>> >>>
>>> >>> >> > Bye,
>>> >>> >> > Riccardo
>>> >>>
>>> >>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]>
>>> >>> >> > wrote:
>>> >>> >> >> Ciao Riccardo,
>>> >>> >> >> and thanks to you for sharing the hint ;)
>>> >>> >> >> Ciao,
>>> >>> >> >> Simo
>>> >>>
>>> >>> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>>> >>>
>>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>>> >>> >> >> <[hidden email]>
>>> >>> >> >> wrote:
>>> >>> >> >> > I finally managed to make it work; the point here is not to
>>> >>> >> >> > let
>>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to let the
>>> >>> >> >> > client
>>> >>> >> >> > bundle have it!
>>> >>> >> >> > In other words there is no need for Dynamic-Import in mybatis
>>> >>> >> >> > bundle;
>>> >>> >> >> > all that is needed is to put the driver package in the
>>> >>> >> >> > package-import
>>> >>> >> >> > directive of the client bundle, eventually as an optional
>>> >>> >> >> > dependency.
>>> >>>
>>> >>> >> >> > No other tricks seem necessary to make it work.
>>> >>>
>>> >>> >> >> > Thanks anyway, this issue is closed :-)
>>> >>>
>>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]> wrote:
>>> >>> >> >> >> Hello,
>>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely
>>> >>> >> >> >> apache
>>> >>> >> >> >> felix,
>>> >>> >> >> >> but I think this is a general issue); I already have a
>>> >>> >> >> >> working
>>> >>> >> >> >> bundle
>>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used BND
>>> >>> >> >> >> to
>>> >>> >> >> >> "osgify"
>>> >>> >> >> >> mybatis jar in a bundle.
>>> >>>
>>> >>> >> >> >> I'm always getting an error at the first query I try:
>>> >>>
>>> >>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host and
>>> >>> >> >> >> database
>>> >>> >> >> >> name>
>>> >>>
>>> >>> >> >> >> Surely it is a classloader problem, that ibatis classloader
>>> >>> >> >> >> has no
>>> >>> >> >> >> access to driver classes.
>>> >>> >> >> >> I also tried to add a:
>>> >>>
>>> >>> >> >> >> DynamicImport-Package: *
>>> >>>
>>> >>> >> >> >> to the bundle manifest with no luck.
>>> >>>
>>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>>> >>>
>>> >>> >> >> >> Thanks for your help,
>>> >>> >> >> >> Riccardo
>>> >
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Thanks a lot Andrea,
very appreciated, I'm still in the middle of the process to get
familiar with OSGi so any feedbacks from whom is more expert is
welcome :)
Have a nice day, ciao ;)
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]> wrote:

> Hi Simone
> I'll give a try in the next days, I've a project that could be a test, so
> I'm very happy of this news.
> I'll give my feedback as soon as possible
>  Andrea
>
> On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Hi guys,
>> I just uploaded a snapshot that *should* support OSGi, I'd like to ask
>> you if you're available to test it; to obtain the artifact using
>> Maven, add the repository in your pom:
>>
>>    <repositories>
>>        ...
>>        <repository>
>>            <id>sonatype-nexus-snapshots</id>
>>            <name>Sonatype Nexus Snapshots</name>
>>
>>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>>            <releases>
>>                <enabled>false</enabled>
>>            </releases>
>>            <snapshots>
>>                <enabled>true</enabled>
>>            </snapshots>
>>        </repository>
>>        ...
>>    </repositories>
>>
>> then add the following dependency:
>>
>>    <dependency>
>>      ...
>>      <groupId>org.mybatis</groupId>
>>      <artifactId>mybatis</artifactId>
>>      <version>3.0.4-SNAPSHOT</version>
>>      ...
>>    </dependency>
>>
>> Please let me know, many thanks in advance!!!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> <[hidden email]> wrote:
>> > Hello Simone,
>> > I actually did little progress with Osgi and Mybatis; I'm using it in a
>> > production site but I'm not loading mappings from an external bundle.
>> > This
>> > way it is simpler because all you have to do is "osgify" the mybatis jar
>> > using bnd and a little extra setup which I'm not sure I did correctly (I
>> > had
>> > to do a Class.forName for the jdbc driver to have it correctly loaded
>> > and
>> > added DynamicImport * to mybatis manifest - I think there may be a
>> > better
>> > way, but it's the only way I could make it work).
>> > Maybe I can write down this procedure in more extent and have some
>> > feedback
>> > from the community to reach a better undestranding, but I don't think
>> > I'm a
>> > the point of writing something for the user guide and I'm in a tight
>> > schedule so I don't think I will have much time to experiment in the
>> > near
>> > future.
>> > Bye,
>> > Riccardo
>> >
>> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva <[hidden email]>
>> > wrote:
>> >>
>> >> Hi Simone!
>> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped
>> >> in a
>> >> bundle from another bundle, it seems that the xml file contained in my
>> >> client bundle can't be loaded from mybatis classpath.The problem should
>> >> be
>> >> that the resourse loading fail when my module (with myBatis wrapped
>> >> into)
>> >> init the myBatis with it's configuration file. I'm investiganting. Has
>> >> anynoe  got  the same problem?
>> >> Despite this problems I'm interested.
>> >>  Andrea
>> >>
>> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hi Riccardo and Andrea,
>> >>> are you still interested on contributing on the OSGi side? Community
>> >>> is also requesting OSGi support[1] and IMHO the interest around that
>> >>> technology will increase
>> >>> very quickly.
>> >>> Thanks in advance!
>> >>> Simo
>> >>>
>> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >>>
>> >>> http://people.apache.org/~simonetripodi/
>> >>> http://www.99soft.org/
>> >>>
>> >>>
>> >>>
>> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >>> <[hidden email]> wrote:
>> >>> > Ciao Riccardo,
>> >>> > I don't have experiences on both so you'll be the main heads on this
>> >>> > :)
>> >>> > OK for the manifest bundle info, they can be easily added using the
>> >>> > jar plugin and I don't see any blocking issue on relying only on it.
>> >>> > Looking forward to your contribs, have a nice weekend!
>> >>> > Simo
>> >>> >
>> >>> > http://people.apache.org/~simonetripodi/
>> >>> > http://www.99soft.org/
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]>
>> >>> > wrote:
>> >>> >> I agree about the two targets, but I never used Spring Osgi, so I
>> >>> >> can't contribute about that at the moment.
>> >>> >>
>> >>> >> Felix Plugin can generate the manifest because it is based on BND,
>> >>> >> but
>> >>> >> in my experience it tends to produce a little bloated manifest; it
>> >>> >> would probably be better to start with it but to hand-revise it to
>> >>> >> produce a lighter one. The result can then be added without
>> >>> >> problems
>> >>> >> to the usual manifest.
>> >>> >>
>> >>> >> It's nice to see we are all italians on this thread and I know
>> >>> >> quite a
>> >>> >> few teams in Bologna who have used ibatis/mybatis; I started just a
>> >>> >> couple of days ago :-)
>> >>> >>
>> >>> >> Bye,
>> >>> >> Riccardo
>> >>> >>
>> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>> >>> >>> Ciao Andrea,
>> >>> >>> it seems Italian community is growing fast in the last time :) I
>> >>> >>> think
>> >>> >>> that having 2 targets sounds much better, feel fee to raise issues
>> >>> >>> and
>> >>> >>> attach patches, every contribution is appreciated.
>> >>> >>> Have a nice day,
>> >>> >>> Simo
>> >>> >>>
>> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >>> >>>
>> >>> >>>
>> >>> >>>
>> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >>> >>> <[hidden email]> wrote:
>> >>> >>> > Ciao Simone and Riccardo,
>> >>> >>> >  and if instead of only exporting myBatis package in the OSGi,
>> >>> >>> > the
>> >>> >>> > myBatis
>> >>> >>> > will export also some basic OSGi services in two flavour, Spring
>> >>> >>> > DM
>> >>> >>> > and
>> >>> >>> > plain OSGi Services?
>> >>> >>> >  Andrea
>> >>> >>>
>> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >>> >>> > <[hidden email]>
>> >>> >>> > wrote:
>> >>> >>>
>> >>> >>> >> Ciao Riccardo,
>> >>> >>> >> of course any contribution will be much more than appreciated,
>> >>> >>> >> feel
>> >>> >>> >> free to raise issues on the MyBatis whenever you want. I know a
>> >>> >>> >> little
>> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven
>> >>> >>> >> plugin
>> >>> >>> >> is
>> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >>> >>> >> It would be very nice adding the osgi support also in the
>> >>> >>> >> mybatis
>> >>> >>> >> subproject, I hope this will be the chance for a long
>> >>> >>> >> collaboration :)
>> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >>> >>> >> Simo
>> >>> >>>
>> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >>> >>> >>http://www.99soft.org/
>> >>> >>>
>> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >>> >>> >> <[hidden email]>
>> >>> >>> >> wrote:
>> >>> >>> >> > Ciao Simone,
>> >>> >>> >> > I have two proposals:
>> >>> >>> >> > - is it possible to release mybatis as an osgi-ready bundle
>> >>> >>> >> >  (it's
>> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >>> >>> >> > adjustment
>> >>> >>> >> > should be necessary)?
>> >>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>> >>> >>> >> > enviroment
>> >>> >>> >> > fit in the user guide or wiki?
>> >>> >>>
>> >>> >>> >> > I would gladly contribute to both issues, not immediately,
>> >>> >>> >> > but
>> >>> >>> >> > starting about no sooner than mid-november.
>> >>> >>>
>> >>> >>> >> > Bye,
>> >>> >>> >> > Riccardo
>> >>> >>>
>> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]>
>> >>> >>> >> > wrote:
>> >>> >>> >> >> Ciao Riccardo,
>> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >>> >>> >> >> Ciao,
>> >>> >>> >> >> Simo
>> >>> >>>
>> >>> >>> >>
>> >>> >>> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >>> >>>
>> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >>> >>> >> >> <[hidden email]>
>> >>> >>> >> >> wrote:
>> >>> >>> >> >> > I finally managed to make it work; the point here is not
>> >>> >>> >> >> > to
>> >>> >>> >> >> > let
>> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to let
>> >>> >>> >> >> > the
>> >>> >>> >> >> > client
>> >>> >>> >> >> > bundle have it!
>> >>> >>> >> >> > In other words there is no need for Dynamic-Import in
>> >>> >>> >> >> > mybatis
>> >>> >>> >> >> > bundle;
>> >>> >>> >> >> > all that is needed is to put the driver package in the
>> >>> >>> >> >> > package-import
>> >>> >>> >> >> > directive of the client bundle, eventually as an optional
>> >>> >>> >> >> > dependency.
>> >>> >>>
>> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >>> >>>
>> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >>> >>>
>> >>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]>
>> >>> >>> >> >> > wrote:
>> >>> >>> >> >> >> Hello,
>> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely
>> >>> >>> >> >> >> apache
>> >>> >>> >> >> >> felix,
>> >>> >>> >> >> >> but I think this is a general issue); I already have a
>> >>> >>> >> >> >> working
>> >>> >>> >> >> >> bundle
>> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used
>> >>> >>> >> >> >> BND
>> >>> >>> >> >> >> to
>> >>> >>> >> >> >> "osgify"
>> >>> >>> >> >> >> mybatis jar in a bundle.
>> >>> >>>
>> >>> >>> >> >> >> I'm always getting an error at the first query I try:
>> >>> >>>
>> >>> >>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host
>> >>> >>> >> >> >> and
>> >>> >>> >> >> >> database
>> >>> >>> >> >> >> name>
>> >>> >>>
>> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >>> >>> >> >> >> classloader
>> >>> >>> >> >> >> has no
>> >>> >>> >> >> >> access to driver classes.
>> >>> >>> >> >> >> I also tried to add a:
>> >>> >>>
>> >>> >>> >> >> >> DynamicImport-Package: *
>> >>> >>>
>> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >>> >>>
>> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >>> >>>
>> >>> >>> >> >> >> Thanks for your help,
>> >>> >>> >> >> >> Riccardo
>> >>> >
>> >>
>> >
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
Hello Simone and thanks for your effort.
I tried the bundle you supplied but it has a dependency on net.sf.cglib.proxy, which would require to "osgify" a cglib jar and deploy it as well.
Is it necessary to add the dependency on cglib from 3.0.2 to 3.0.4? Removing the dependency on cglib on the manifest it seems to work (not tested deeply but seems ok for my app - although I cannot risk to deploy it to the client!)

Bye,
Riccardo

On Tue, Dec 7, 2010 at 9:40 AM, Simone Tripodi <[hidden email]> wrote:
Thanks a lot Andrea,
very appreciated, I'm still in the middle of the process to get
familiar with OSGi so any feedbacks from whom is more expert is
welcome :)
Have a nice day, ciao ;)
On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]> wrote:
> Hi Simone
> I'll give a try in the next days, I've a project that could be a test, so
> I'm very happy of this news.
> I'll give my feedback as soon as possible
>  Andrea
>
> On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Hi guys,
>> I just uploaded a snapshot that *should* support OSGi, I'd like to ask
>> you if you're available to test it; to obtain the artifact using
>> Maven, add the repository in your pom:
>>
>>    <repositories>
>>        ...
>>        <repository>
>>            <id>sonatype-nexus-snapshots</id>
>>            <name>Sonatype Nexus Snapshots</name>
>>
>>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>>            <releases>
>>                <enabled>false</enabled>
>>            </releases>
>>            <snapshots>
>>                <enabled>true</enabled>
>>            </snapshots>
>>        </repository>
>>        ...
>>    </repositories>
>>
>> then add the following dependency:
>>
>>    <dependency>
>>      ...
>>      <groupId>org.mybatis</groupId>
>>      <artifactId>mybatis</artifactId>
>>      <version>3.0.4-SNAPSHOT</version>
>>      ...
>>    </dependency>
>>
>> Please let me know, many thanks in advance!!!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> <[hidden email]> wrote:
>> > Hello Simone,
>> > I actually did little progress with Osgi and Mybatis; I'm using it in a
>> > production site but I'm not loading mappings from an external bundle.
>> > This
>> > way it is simpler because all you have to do is "osgify" the mybatis jar
>> > using bnd and a little extra setup which I'm not sure I did correctly (I
>> > had
>> > to do a Class.forName for the jdbc driver to have it correctly loaded
>> > and
>> > added DynamicImport * to mybatis manifest - I think there may be a
>> > better
>> > way, but it's the only way I could make it work).
>> > Maybe I can write down this procedure in more extent and have some
>> > feedback
>> > from the community to reach a better undestranding, but I don't think
>> > I'm a
>> > the point of writing something for the user guide and I'm in a tight
>> > schedule so I don't think I will have much time to experiment in the
>> > near
>> > future.
>> > Bye,
>> > Riccardo
>> >
>> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva <[hidden email]>
>> > wrote:
>> >>
>> >> Hi Simone!
>> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib wrapped
>> >> in a
>> >> bundle from another bundle, it seems that the xml file contained in my
>> >> client bundle can't be loaded from mybatis classpath.The problem should
>> >> be
>> >> that the resourse loading fail when my module (with myBatis wrapped
>> >> into)
>> >> init the myBatis with it's configuration file. I'm investiganting. Has
>> >> anynoe  got  the same problem?
>> >> Despite this problems I'm interested.
>> >>  Andrea
>> >>
>> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> <[hidden email]>
>> >> wrote:
>> >>>
>> >>> Hi Riccardo and Andrea,
>> >>> are you still interested on contributing on the OSGi side? Community
>> >>> is also requesting OSGi support[1] and IMHO the interest around that
>> >>> technology will increase
>> >>> very quickly.
>> >>> Thanks in advance!
>> >>> Simo
>> >>>
>> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >>>
>> >>> http://people.apache.org/~simonetripodi/
>> >>> http://www.99soft.org/
>> >>>
>> >>>
>> >>>
>> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >>> <[hidden email]> wrote:
>> >>> > Ciao Riccardo,
>> >>> > I don't have experiences on both so you'll be the main heads on this
>> >>> > :)
>> >>> > OK for the manifest bundle info, they can be easily added using the
>> >>> > jar plugin and I don't see any blocking issue on relying only on it.
>> >>> > Looking forward to your contribs, have a nice weekend!
>> >>> > Simo
>> >>> >
>> >>> > http://people.apache.org/~simonetripodi/
>> >>> > http://www.99soft.org/
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo <[hidden email]>
>> >>> > wrote:
>> >>> >> I agree about the two targets, but I never used Spring Osgi, so I
>> >>> >> can't contribute about that at the moment.
>> >>> >>
>> >>> >> Felix Plugin can generate the manifest because it is based on BND,
>> >>> >> but
>> >>> >> in my experience it tends to produce a little bloated manifest; it
>> >>> >> would probably be better to start with it but to hand-revise it to
>> >>> >> produce a lighter one. The result can then be added without
>> >>> >> problems
>> >>> >> to the usual manifest.
>> >>> >>
>> >>> >> It's nice to see we are all italians on this thread and I know
>> >>> >> quite a
>> >>> >> few teams in Bologna who have used ibatis/mybatis; I started just a
>> >>> >> couple of days ago :-)
>> >>> >>
>> >>> >> Bye,
>> >>> >> Riccardo
>> >>> >>
>> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]> wrote:
>> >>> >>> Ciao Andrea,
>> >>> >>> it seems Italian community is growing fast in the last time :) I
>> >>> >>> think
>> >>> >>> that having 2 targets sounds much better, feel fee to raise issues
>> >>> >>> and
>> >>> >>> attach patches, every contribution is appreciated.
>> >>> >>> Have a nice day,
>> >>> >>> Simo
>> >>> >>>
>> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >>> >>>
>> >>> >>>
>> >>> >>>
>> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >>> >>> <[hidden email]> wrote:
>> >>> >>> > Ciao Simone and Riccardo,
>> >>> >>> >  and if instead of only exporting myBatis package in the OSGi,
>> >>> >>> > the
>> >>> >>> > myBatis
>> >>> >>> > will export also some basic OSGi services in two flavour, Spring
>> >>> >>> > DM
>> >>> >>> > and
>> >>> >>> > plain OSGi Services?
>> >>> >>> >  Andrea
>> >>> >>>
>> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >>> >>> > <[hidden email]>
>> >>> >>> > wrote:
>> >>> >>>
>> >>> >>> >> Ciao Riccardo,
>> >>> >>> >> of course any contribution will be much more than appreciated,
>> >>> >>> >> feel
>> >>> >>> >> free to raise issues on the MyBatis whenever you want. I know a
>> >>> >>> >> little
>> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven
>> >>> >>> >> plugin
>> >>> >>> >> is
>> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >>> >>> >> It would be very nice adding the osgi support also in the
>> >>> >>> >> mybatis
>> >>> >>> >> subproject, I hope this will be the chance for a long
>> >>> >>> >> collaboration :)
>> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >>> >>> >> Simo
>> >>> >>>
>> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >>> >>> >>http://www.99soft.org/
>> >>> >>>
>> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >>> >>> >> <[hidden email]>
>> >>> >>> >> wrote:
>> >>> >>> >> > Ciao Simone,
>> >>> >>> >> > I have two proposals:
>> >>> >>> >> > - is it possible to release mybatis as an osgi-ready bundle
>> >>> >>> >> >  (it's
>> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >>> >>> >> > adjustment
>> >>> >>> >> > should be necessary)?
>> >>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>> >>> >>> >> > enviroment
>> >>> >>> >> > fit in the user guide or wiki?
>> >>> >>>
>> >>> >>> >> > I would gladly contribute to both issues, not immediately,
>> >>> >>> >> > but
>> >>> >>> >> > starting about no sooner than mid-november.
>> >>> >>>
>> >>> >>> >> > Bye,
>> >>> >>> >> > Riccardo
>> >>> >>>
>> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi <[hidden email]>
>> >>> >>> >> > wrote:
>> >>> >>> >> >> Ciao Riccardo,
>> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >>> >>> >> >> Ciao,
>> >>> >>> >> >> Simo
>> >>> >>>
>> >>> >>> >>
>> >>> >>> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >>> >>>
>> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >>> >>> >> >> <[hidden email]>
>> >>> >>> >> >> wrote:
>> >>> >>> >> >> > I finally managed to make it work; the point here is not
>> >>> >>> >> >> > to
>> >>> >>> >> >> > let
>> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to let
>> >>> >>> >> >> > the
>> >>> >>> >> >> > client
>> >>> >>> >> >> > bundle have it!
>> >>> >>> >> >> > In other words there is no need for Dynamic-Import in
>> >>> >>> >> >> > mybatis
>> >>> >>> >> >> > bundle;
>> >>> >>> >> >> > all that is needed is to put the driver package in the
>> >>> >>> >> >> > package-import
>> >>> >>> >> >> > directive of the client bundle, eventually as an optional
>> >>> >>> >> >> > dependency.
>> >>> >>>
>> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >>> >>>
>> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >>> >>>
>> >>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]>
>> >>> >>> >> >> > wrote:
>> >>> >>> >> >> >> Hello,
>> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment (namely
>> >>> >>> >> >> >> apache
>> >>> >>> >> >> >> felix,
>> >>> >>> >> >> >> but I think this is a general issue); I already have a
>> >>> >>> >> >> >> working
>> >>> >>> >> >> >> bundle
>> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used
>> >>> >>> >> >> >> BND
>> >>> >>> >> >> >> to
>> >>> >>> >> >> >> "osgify"
>> >>> >>> >> >> >> mybatis jar in a bundle.
>> >>> >>>
>> >>> >>> >> >> >> I'm always getting an error at the first query I try:
>> >>> >>>
>> >>> >>> >> >> >> No suitable driver found for jdbc:jtds:sqlserver://<host
>> >>> >>> >> >> >> and
>> >>> >>> >> >> >> database
>> >>> >>> >> >> >> name>
>> >>> >>>
>> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >>> >>> >> >> >> classloader
>> >>> >>> >> >> >> has no
>> >>> >>> >> >> >> access to driver classes.
>> >>> >>> >> >> >> I also tried to add a:
>> >>> >>>
>> >>> >>> >> >> >> DynamicImport-Package: *
>> >>> >>>
>> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >>> >>>
>> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >>> >>>
>> >>> >>> >> >> >> Thanks for your help,
>> >>> >>> >> >> >> Riccardo
>> >>> >
>> >>
>> >
>> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Hi Riccardo!!!
thanks a lot for your feedbacks, much much more than appreciated!!!
Unfortunately CGLIB is out of our control, and seems that CGLIB team
is not so active (last release was pushed in the far 2008!), so I
think we should follow the Google Guice's way and repackage cglib as
internal stuff. I'll have a deep look on it during the weekend.
Thanks once again, looking forward to fix that issue!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Tue, Dec 7, 2010 at 4:19 PM, Riccardo Cossu <[hidden email]> wrote:

> Hello Simone and thanks for your effort.
> I tried the bundle you supplied but it has a dependency
> on net.sf.cglib.proxy, which would require to "osgify" a cglib jar and
> deploy it as well.
> Is it necessary to add the dependency on cglib from 3.0.2 to 3.0.4? Removing
> the dependency on cglib on the manifest it seems to work (not tested deeply
> but seems ok for my app - although I cannot risk to deploy it to the
> client!)
> Bye,
> Riccardo
>
> On Tue, Dec 7, 2010 at 9:40 AM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Thanks a lot Andrea,
>> very appreciated, I'm still in the middle of the process to get
>> familiar with OSGi so any feedbacks from whom is more expert is
>> welcome :)
>> Have a nice day, ciao ;)
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]>
>> wrote:
>> > Hi Simone
>> > I'll give a try in the next days, I've a project that could be a test,
>> > so
>> > I'm very happy of this news.
>> > I'll give my feedback as soon as possible
>> >  Andrea
>> >
>> > On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Hi guys,
>> >> I just uploaded a snapshot that *should* support OSGi, I'd like to ask
>> >> you if you're available to test it; to obtain the artifact using
>> >> Maven, add the repository in your pom:
>> >>
>> >>    <repositories>
>> >>        ...
>> >>        <repository>
>> >>            <id>sonatype-nexus-snapshots</id>
>> >>            <name>Sonatype Nexus Snapshots</name>
>> >>
>> >>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>> >>            <releases>
>> >>                <enabled>false</enabled>
>> >>            </releases>
>> >>            <snapshots>
>> >>                <enabled>true</enabled>
>> >>            </snapshots>
>> >>        </repository>
>> >>        ...
>> >>    </repositories>
>> >>
>> >> then add the following dependency:
>> >>
>> >>    <dependency>
>> >>      ...
>> >>      <groupId>org.mybatis</groupId>
>> >>      <artifactId>mybatis</artifactId>
>> >>      <version>3.0.4-SNAPSHOT</version>
>> >>      ...
>> >>    </dependency>
>> >>
>> >> Please let me know, many thanks in advance!!!
>> >> Simo
>> >>
>> >> http://people.apache.org/~simonetripodi/
>> >> http://www.99soft.org/
>> >>
>> >>
>> >>
>> >> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> >> <[hidden email]> wrote:
>> >> > Hello Simone,
>> >> > I actually did little progress with Osgi and Mybatis; I'm using it in
>> >> > a
>> >> > production site but I'm not loading mappings from an external bundle.
>> >> > This
>> >> > way it is simpler because all you have to do is "osgify" the mybatis
>> >> > jar
>> >> > using bnd and a little extra setup which I'm not sure I did correctly
>> >> > (I
>> >> > had
>> >> > to do a Class.forName for the jdbc driver to have it correctly loaded
>> >> > and
>> >> > added DynamicImport * to mybatis manifest - I think there may be a
>> >> > better
>> >> > way, but it's the only way I could make it work).
>> >> > Maybe I can write down this procedure in more extent and have some
>> >> > feedback
>> >> > from the community to reach a better undestranding, but I don't think
>> >> > I'm a
>> >> > the point of writing something for the user guide and I'm in a tight
>> >> > schedule so I don't think I will have much time to experiment in the
>> >> > near
>> >> > future.
>> >> > Bye,
>> >> > Riccardo
>> >> >
>> >> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva
>> >> > <[hidden email]>
>> >> > wrote:
>> >> >>
>> >> >> Hi Simone!
>> >> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib
>> >> >> wrapped
>> >> >> in a
>> >> >> bundle from another bundle, it seems that the xml file contained in
>> >> >> my
>> >> >> client bundle can't be loaded from mybatis classpath.The problem
>> >> >> should
>> >> >> be
>> >> >> that the resourse loading fail when my module (with myBatis wrapped
>> >> >> into)
>> >> >> init the myBatis with it's configuration file. I'm investiganting.
>> >> >> Has
>> >> >> anynoe  got  the same problem?
>> >> >> Despite this problems I'm interested.
>> >> >>  Andrea
>> >> >>
>> >> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> >> <[hidden email]>
>> >> >> wrote:
>> >> >>>
>> >> >>> Hi Riccardo and Andrea,
>> >> >>> are you still interested on contributing on the OSGi side?
>> >> >>> Community
>> >> >>> is also requesting OSGi support[1] and IMHO the interest around
>> >> >>> that
>> >> >>> technology will increase
>> >> >>> very quickly.
>> >> >>> Thanks in advance!
>> >> >>> Simo
>> >> >>>
>> >> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >> >>>
>> >> >>> http://people.apache.org/~simonetripodi/
>> >> >>> http://www.99soft.org/
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >> >>> <[hidden email]> wrote:
>> >> >>> > Ciao Riccardo,
>> >> >>> > I don't have experiences on both so you'll be the main heads on
>> >> >>> > this
>> >> >>> > :)
>> >> >>> > OK for the manifest bundle info, they can be easily added using
>> >> >>> > the
>> >> >>> > jar plugin and I don't see any blocking issue on relying only on
>> >> >>> > it.
>> >> >>> > Looking forward to your contribs, have a nice weekend!
>> >> >>> > Simo
>> >> >>> >
>> >> >>> > http://people.apache.org/~simonetripodi/
>> >> >>> > http://www.99soft.org/
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo
>> >> >>> > <[hidden email]>
>> >> >>> > wrote:
>> >> >>> >> I agree about the two targets, but I never used Spring Osgi, so
>> >> >>> >> I
>> >> >>> >> can't contribute about that at the moment.
>> >> >>> >>
>> >> >>> >> Felix Plugin can generate the manifest because it is based on
>> >> >>> >> BND,
>> >> >>> >> but
>> >> >>> >> in my experience it tends to produce a little bloated manifest;
>> >> >>> >> it
>> >> >>> >> would probably be better to start with it but to hand-revise it
>> >> >>> >> to
>> >> >>> >> produce a lighter one. The result can then be added without
>> >> >>> >> problems
>> >> >>> >> to the usual manifest.
>> >> >>> >>
>> >> >>> >> It's nice to see we are all italians on this thread and I know
>> >> >>> >> quite a
>> >> >>> >> few teams in Bologna who have used ibatis/mybatis; I started
>> >> >>> >> just a
>> >> >>> >> couple of days ago :-)
>> >> >>> >>
>> >> >>> >> Bye,
>> >> >>> >> Riccardo
>> >> >>> >>
>> >> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]>
>> >> >>> >> wrote:
>> >> >>> >>> Ciao Andrea,
>> >> >>> >>> it seems Italian community is growing fast in the last time :)
>> >> >>> >>> I
>> >> >>> >>> think
>> >> >>> >>> that having 2 targets sounds much better, feel fee to raise
>> >> >>> >>> issues
>> >> >>> >>> and
>> >> >>> >>> attach patches, every contribution is appreciated.
>> >> >>> >>> Have a nice day,
>> >> >>> >>> Simo
>> >> >>> >>>
>> >> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>>
>> >> >>> >>>
>> >> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >> >>> >>> <[hidden email]> wrote:
>> >> >>> >>> > Ciao Simone and Riccardo,
>> >> >>> >>> >  and if instead of only exporting myBatis package in the
>> >> >>> >>> > OSGi,
>> >> >>> >>> > the
>> >> >>> >>> > myBatis
>> >> >>> >>> > will export also some basic OSGi services in two flavour,
>> >> >>> >>> > Spring
>> >> >>> >>> > DM
>> >> >>> >>> > and
>> >> >>> >>> > plain OSGi Services?
>> >> >>> >>> >  Andrea
>> >> >>> >>>
>> >> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >> >>> >>> > <[hidden email]>
>> >> >>> >>> > wrote:
>> >> >>> >>>
>> >> >>> >>> >> Ciao Riccardo,
>> >> >>> >>> >> of course any contribution will be much more than
>> >> >>> >>> >> appreciated,
>> >> >>> >>> >> feel
>> >> >>> >>> >> free to raise issues on the MyBatis whenever you want. I
>> >> >>> >>> >> know a
>> >> >>> >>> >> little
>> >> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven
>> >> >>> >>> >> plugin
>> >> >>> >>> >> is
>> >> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >> >>> >>> >> It would be very nice adding the osgi support also in the
>> >> >>> >>> >> mybatis
>> >> >>> >>> >> subproject, I hope this will be the chance for a long
>> >> >>> >>> >> collaboration :)
>> >> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >> >>> >>> >> Simo
>> >> >>> >>>
>> >> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >> >>> >>> >>http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >> >>> >>> >> <[hidden email]>
>> >> >>> >>> >> wrote:
>> >> >>> >>> >> > Ciao Simone,
>> >> >>> >>> >> > I have two proposals:
>> >> >>> >>> >> > - is it possible to release mybatis as an osgi-ready
>> >> >>> >>> >> > bundle
>> >> >>> >>> >> >  (it's
>> >> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >> >>> >>> >> > adjustment
>> >> >>> >>> >> > should be necessary)?
>> >> >>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>> >> >>> >>> >> > enviroment
>> >> >>> >>> >> > fit in the user guide or wiki?
>> >> >>> >>>
>> >> >>> >>> >> > I would gladly contribute to both issues, not immediately,
>> >> >>> >>> >> > but
>> >> >>> >>> >> > starting about no sooner than mid-november.
>> >> >>> >>>
>> >> >>> >>> >> > Bye,
>> >> >>> >>> >> > Riccardo
>> >> >>> >>>
>> >> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi
>> >> >>> >>> >> > <[hidden email]>
>> >> >>> >>> >> > wrote:
>> >> >>> >>> >> >> Ciao Riccardo,
>> >> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >> >>> >>> >> >> Ciao,
>> >> >>> >>> >> >> Simo
>> >> >>> >>>
>> >> >>> >>> >>
>> >> >>> >>> >> >>
>> >> >>> >>> >> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >> >>> >>> >> >> <[hidden email]>
>> >> >>> >>> >> >> wrote:
>> >> >>> >>> >> >> > I finally managed to make it work; the point here is
>> >> >>> >>> >> >> > not
>> >> >>> >>> >> >> > to
>> >> >>> >>> >> >> > let
>> >> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to
>> >> >>> >>> >> >> > let
>> >> >>> >>> >> >> > the
>> >> >>> >>> >> >> > client
>> >> >>> >>> >> >> > bundle have it!
>> >> >>> >>> >> >> > In other words there is no need for Dynamic-Import in
>> >> >>> >>> >> >> > mybatis
>> >> >>> >>> >> >> > bundle;
>> >> >>> >>> >> >> > all that is needed is to put the driver package in the
>> >> >>> >>> >> >> > package-import
>> >> >>> >>> >> >> > directive of the client bundle, eventually as an
>> >> >>> >>> >> >> > optional
>> >> >>> >>> >> >> > dependency.
>> >> >>> >>>
>> >> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >> >>> >>>
>> >> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >> >>> >>>
>> >> >>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]>
>> >> >>> >>> >> >> > wrote:
>> >> >>> >>> >> >> >> Hello,
>> >> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment
>> >> >>> >>> >> >> >> (namely
>> >> >>> >>> >> >> >> apache
>> >> >>> >>> >> >> >> felix,
>> >> >>> >>> >> >> >> but I think this is a general issue); I already have a
>> >> >>> >>> >> >> >> working
>> >> >>> >>> >> >> >> bundle
>> >> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used
>> >> >>> >>> >> >> >> BND
>> >> >>> >>> >> >> >> to
>> >> >>> >>> >> >> >> "osgify"
>> >> >>> >>> >> >> >> mybatis jar in a bundle.
>> >> >>> >>>
>> >> >>> >>> >> >> >> I'm always getting an error at the first query I try:
>> >> >>> >>>
>> >> >>> >>> >> >> >> No suitable driver found for
>> >> >>> >>> >> >> >> jdbc:jtds:sqlserver://<host
>> >> >>> >>> >> >> >> and
>> >> >>> >>> >> >> >> database
>> >> >>> >>> >> >> >> name>
>> >> >>> >>>
>> >> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >> >>> >>> >> >> >> classloader
>> >> >>> >>> >> >> >> has no
>> >> >>> >>> >> >> >> access to driver classes.
>> >> >>> >>> >> >> >> I also tried to add a:
>> >> >>> >>>
>> >> >>> >>> >> >> >> DynamicImport-Package: *
>> >> >>> >>>
>> >> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >> >>> >>>
>> >> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >> >>> >>>
>> >> >>> >>> >> >> >> Thanks for your help,
>> >> >>> >>> >> >> >> Riccardo
>> >> >>> >
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Andrea Selva
Hi Riccardo and Simone,
only one question about cglib. myBatis 2.x used java proxy for normal lazy loading, cglib was only a configurable option. In myBatis3 is true the same, or it must have cglib in the classpath?
If cglib is an option also for myBatis3 the problem could be fixed at first in the myBatis osgi.bnd declaring that imported package as optional (Import-Package: net.sf.cglib.proxy;resolution:=optional), else the mybatis could link the already OSGified version of cglin from spring team (https://ebr.springsource.com/repository/app/search?query=cglib)
 Andrea


On Wed, Dec 8, 2010 at 8:35 AM, Simone Tripodi <[hidden email]> wrote:
Hi Riccardo!!!
thanks a lot for your feedbacks, much much more than appreciated!!!
Unfortunately CGLIB is out of our control, and seems that CGLIB team
is not so active (last release was pushed in the far 2008!), so I
think we should follow the Google Guice's way and repackage cglib as
internal stuff. I'll have a deep look on it during the weekend.
Thanks once again, looking forward to fix that issue!
On Tue, Dec 7, 2010 at 4:19 PM, Riccardo Cossu <[hidden email]> wrote:
> Hello Simone and thanks for your effort.
> I tried the bundle you supplied but it has a dependency
> on net.sf.cglib.proxy, which would require to "osgify" a cglib jar and
> deploy it as well.
> Is it necessary to add the dependency on cglib from 3.0.2 to 3.0.4? Removing
> the dependency on cglib on the manifest it seems to work (not tested deeply
> but seems ok for my app - although I cannot risk to deploy it to the
> client!)
> Bye,
> Riccardo
>
> On Tue, Dec 7, 2010 at 9:40 AM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Thanks a lot Andrea,
>> very appreciated, I'm still in the middle of the process to get
>> familiar with OSGi so any feedbacks from whom is more expert is
>> welcome :)
>> Have a nice day, ciao ;)
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]>
>> wrote:
>> > Hi Simone
>> > I'll give a try in the next days, I've a project that could be a test,
>> > so
>> > I'm very happy of this news.
>> > I'll give my feedback as soon as possible
>> >  Andrea
>> >
>> > On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Hi guys,
>> >> I just uploaded a snapshot that *should* support OSGi, I'd like to ask
>> >> you if you're available to test it; to obtain the artifact using
>> >> Maven, add the repository in your pom:
>> >>
>> >>    <repositories>
>> >>        ...
>> >>        <repository>
>> >>            <id>sonatype-nexus-snapshots</id>
>> >>            <name>Sonatype Nexus Snapshots</name>
>> >>
>> >>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>> >>            <releases>
>> >>                <enabled>false</enabled>
>> >>            </releases>
>> >>            <snapshots>
>> >>                <enabled>true</enabled>
>> >>            </snapshots>
>> >>        </repository>
>> >>        ...
>> >>    </repositories>
>> >>
>> >> then add the following dependency:
>> >>
>> >>    <dependency>
>> >>      ...
>> >>      <groupId>org.mybatis</groupId>
>> >>      <artifactId>mybatis</artifactId>
>> >>      <version>3.0.4-SNAPSHOT</version>
>> >>      ...
>> >>    </dependency>
>> >>
>> >> Please let me know, many thanks in advance!!!
>> >> Simo
>> >>
>> >> http://people.apache.org/~simonetripodi/
>> >> http://www.99soft.org/
>> >>
>> >>
>> >>
>> >> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> >> <[hidden email]> wrote:
>> >> > Hello Simone,
>> >> > I actually did little progress with Osgi and Mybatis; I'm using it in
>> >> > a
>> >> > production site but I'm not loading mappings from an external bundle.
>> >> > This
>> >> > way it is simpler because all you have to do is "osgify" the mybatis
>> >> > jar
>> >> > using bnd and a little extra setup which I'm not sure I did correctly
>> >> > (I
>> >> > had
>> >> > to do a Class.forName for the jdbc driver to have it correctly loaded
>> >> > and
>> >> > added DynamicImport * to mybatis manifest - I think there may be a
>> >> > better
>> >> > way, but it's the only way I could make it work).
>> >> > Maybe I can write down this procedure in more extent and have some
>> >> > feedback
>> >> > from the community to reach a better undestranding, but I don't think
>> >> > I'm a
>> >> > the point of writing something for the user guide and I'm in a tight
>> >> > schedule so I don't think I will have much time to experiment in the
>> >> > near
>> >> > future.
>> >> > Bye,
>> >> > Riccardo
>> >> >
>> >> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva
>> >> > <[hidden email]>
>> >> > wrote:
>> >> >>
>> >> >> Hi Simone!
>> >> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib
>> >> >> wrapped
>> >> >> in a
>> >> >> bundle from another bundle, it seems that the xml file contained in
>> >> >> my
>> >> >> client bundle can't be loaded from mybatis classpath.The problem
>> >> >> should
>> >> >> be
>> >> >> that the resourse loading fail when my module (with myBatis wrapped
>> >> >> into)
>> >> >> init the myBatis with it's configuration file. I'm investiganting.
>> >> >> Has
>> >> >> anynoe  got  the same problem?
>> >> >> Despite this problems I'm interested.
>> >> >>  Andrea
>> >> >>
>> >> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> >> <[hidden email]>
>> >> >> wrote:
>> >> >>>
>> >> >>> Hi Riccardo and Andrea,
>> >> >>> are you still interested on contributing on the OSGi side?
>> >> >>> Community
>> >> >>> is also requesting OSGi support[1] and IMHO the interest around
>> >> >>> that
>> >> >>> technology will increase
>> >> >>> very quickly.
>> >> >>> Thanks in advance!
>> >> >>> Simo
>> >> >>>
>> >> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >> >>>
>> >> >>> http://people.apache.org/~simonetripodi/
>> >> >>> http://www.99soft.org/
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >> >>> <[hidden email]> wrote:
>> >> >>> > Ciao Riccardo,
>> >> >>> > I don't have experiences on both so you'll be the main heads on
>> >> >>> > this
>> >> >>> > :)
>> >> >>> > OK for the manifest bundle info, they can be easily added using
>> >> >>> > the
>> >> >>> > jar plugin and I don't see any blocking issue on relying only on
>> >> >>> > it.
>> >> >>> > Looking forward to your contribs, have a nice weekend!
>> >> >>> > Simo
>> >> >>> >
>> >> >>> > http://people.apache.org/~simonetripodi/
>> >> >>> > http://www.99soft.org/
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo
>> >> >>> > <[hidden email]>
>> >> >>> > wrote:
>> >> >>> >> I agree about the two targets, but I never used Spring Osgi, so
>> >> >>> >> I
>> >> >>> >> can't contribute about that at the moment.
>> >> >>> >>
>> >> >>> >> Felix Plugin can generate the manifest because it is based on
>> >> >>> >> BND,
>> >> >>> >> but
>> >> >>> >> in my experience it tends to produce a little bloated manifest;
>> >> >>> >> it
>> >> >>> >> would probably be better to start with it but to hand-revise it
>> >> >>> >> to
>> >> >>> >> produce a lighter one. The result can then be added without
>> >> >>> >> problems
>> >> >>> >> to the usual manifest.
>> >> >>> >>
>> >> >>> >> It's nice to see we are all italians on this thread and I know
>> >> >>> >> quite a
>> >> >>> >> few teams in Bologna who have used ibatis/mybatis; I started
>> >> >>> >> just a
>> >> >>> >> couple of days ago :-)
>> >> >>> >>
>> >> >>> >> Bye,
>> >> >>> >> Riccardo
>> >> >>> >>
>> >> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]>
>> >> >>> >> wrote:
>> >> >>> >>> Ciao Andrea,
>> >> >>> >>> it seems Italian community is growing fast in the last time :)
>> >> >>> >>> I
>> >> >>> >>> think
>> >> >>> >>> that having 2 targets sounds much better, feel fee to raise
>> >> >>> >>> issues
>> >> >>> >>> and
>> >> >>> >>> attach patches, every contribution is appreciated.
>> >> >>> >>> Have a nice day,
>> >> >>> >>> Simo
>> >> >>> >>>
>> >> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>>
>> >> >>> >>>
>> >> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >> >>> >>> <[hidden email]> wrote:
>> >> >>> >>> > Ciao Simone and Riccardo,
>> >> >>> >>> >  and if instead of only exporting myBatis package in the
>> >> >>> >>> > OSGi,
>> >> >>> >>> > the
>> >> >>> >>> > myBatis
>> >> >>> >>> > will export also some basic OSGi services in two flavour,
>> >> >>> >>> > Spring
>> >> >>> >>> > DM
>> >> >>> >>> > and
>> >> >>> >>> > plain OSGi Services?
>> >> >>> >>> >  Andrea
>> >> >>> >>>
>> >> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >> >>> >>> > <[hidden email]>
>> >> >>> >>> > wrote:
>> >> >>> >>>
>> >> >>> >>> >> Ciao Riccardo,
>> >> >>> >>> >> of course any contribution will be much more than
>> >> >>> >>> >> appreciated,
>> >> >>> >>> >> feel
>> >> >>> >>> >> free to raise issues on the MyBatis whenever you want. I
>> >> >>> >>> >> know a
>> >> >>> >>> >> little
>> >> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix maven
>> >> >>> >>> >> plugin
>> >> >>> >>> >> is
>> >> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >> >>> >>> >> It would be very nice adding the osgi support also in the
>> >> >>> >>> >> mybatis
>> >> >>> >>> >> subproject, I hope this will be the chance for a long
>> >> >>> >>> >> collaboration :)
>> >> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >> >>> >>> >> Simo
>> >> >>> >>>
>> >> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >> >>> >>> >>http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >> >>> >>> >> <[hidden email]>
>> >> >>> >>> >> wrote:
>> >> >>> >>> >> > Ciao Simone,
>> >> >>> >>> >> > I have two proposals:
>> >> >>> >>> >> > - is it possible to release mybatis as an osgi-ready
>> >> >>> >>> >> > bundle
>> >> >>> >>> >> >  (it's
>> >> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >> >>> >>> >> > adjustment
>> >> >>> >>> >> > should be necessary)?
>> >> >>> >>> >> > - would a little tutorial on how to use mybatis in an osgi
>> >> >>> >>> >> > enviroment
>> >> >>> >>> >> > fit in the user guide or wiki?
>> >> >>> >>>
>> >> >>> >>> >> > I would gladly contribute to both issues, not immediately,
>> >> >>> >>> >> > but
>> >> >>> >>> >> > starting about no sooner than mid-november.
>> >> >>> >>>
>> >> >>> >>> >> > Bye,
>> >> >>> >>> >> > Riccardo
>> >> >>> >>>
>> >> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi
>> >> >>> >>> >> > <[hidden email]>
>> >> >>> >>> >> > wrote:
>> >> >>> >>> >> >> Ciao Riccardo,
>> >> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >> >>> >>> >> >> Ciao,
>> >> >>> >>> >> >> Simo
>> >> >>> >>>
>> >> >>> >>> >>
>> >> >>> >>> >> >>
>> >> >>> >>> >> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >>> >>>
>> >> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >> >>> >>> >> >> <[hidden email]>
>> >> >>> >>> >> >> wrote:
>> >> >>> >>> >> >> > I finally managed to make it work; the point here is
>> >> >>> >>> >> >> > not
>> >> >>> >>> >> >> > to
>> >> >>> >>> >> >> > let
>> >> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but to
>> >> >>> >>> >> >> > let
>> >> >>> >>> >> >> > the
>> >> >>> >>> >> >> > client
>> >> >>> >>> >> >> > bundle have it!
>> >> >>> >>> >> >> > In other words there is no need for Dynamic-Import in
>> >> >>> >>> >> >> > mybatis
>> >> >>> >>> >> >> > bundle;
>> >> >>> >>> >> >> > all that is needed is to put the driver package in the
>> >> >>> >>> >> >> > package-import
>> >> >>> >>> >> >> > directive of the client bundle, eventually as an
>> >> >>> >>> >> >> > optional
>> >> >>> >>> >> >> > dependency.
>> >> >>> >>>
>> >> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >> >>> >>>
>> >> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >> >>> >>>
>> >> >>> >>> >> >> > On 16 Set, 17:05, Riccardo <[hidden email]>
>> >> >>> >>> >> >> > wrote:
>> >> >>> >>> >> >> >> Hello,
>> >> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment
>> >> >>> >>> >> >> >> (namely
>> >> >>> >>> >> >> >> apache
>> >> >>> >>> >> >> >> felix,
>> >> >>> >>> >> >> >> but I think this is a general issue); I already have a
>> >> >>> >>> >> >> >> working
>> >> >>> >>> >> >> >> bundle
>> >> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I used
>> >> >>> >>> >> >> >> BND
>> >> >>> >>> >> >> >> to
>> >> >>> >>> >> >> >> "osgify"
>> >> >>> >>> >> >> >> mybatis jar in a bundle.
>> >> >>> >>>
>> >> >>> >>> >> >> >> I'm always getting an error at the first query I try:
>> >> >>> >>>
>> >> >>> >>> >> >> >> No suitable driver found for
>> >> >>> >>> >> >> >> jdbc:jtds:sqlserver://<host
>> >> >>> >>> >> >> >> and
>> >> >>> >>> >> >> >> database
>> >> >>> >>> >> >> >> name>
>> >> >>> >>>
>> >> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >> >>> >>> >> >> >> classloader
>> >> >>> >>> >> >> >> has no
>> >> >>> >>> >> >> >> access to driver classes.
>> >> >>> >>> >> >> >> I also tried to add a:
>> >> >>> >>>
>> >> >>> >>> >> >> >> DynamicImport-Package: *
>> >> >>> >>>
>> >> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >> >>> >>>
>> >> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >> >>> >>>
>> >> >>> >>> >> >> >> Thanks for your help,
>> >> >>> >>> >> >> >> Riccardo
>> >> >>> >
>> >> >>
>> >> >
>> >> >
>> >
>> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Simone Tripodi
Ciao Andrea,
thanks for the hint, I'm in the middle of the process - I couldn't
wait for the weekend ;) - to repackage cglib in the mybatis bundle,
since it is just internal stuff, following exactly the same Google
Guice's approach.
I'll let you know ASAP the new bundle is ready.
Thanks for the support!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Wed, Dec 8, 2010 at 11:20 AM, Andrea Selva <[hidden email]> wrote:

> Hi Riccardo and Simone,
> only one question about cglib. myBatis 2.x used java proxy for normal lazy
> loading, cglib was only a configurable option. In myBatis3 is true the same,
> or it must have cglib in the classpath?
> If cglib is an option also for myBatis3 the problem could be fixed at first
> in the myBatis osgi.bnd declaring that imported package as optional
> (Import-Package: net.sf.cglib.proxy;resolution:=optional), else the mybatis
> could link the already OSGified version of cglin from spring team
> (https://ebr.springsource.com/repository/app/search?query=cglib)
>  Andrea
>
>
> On Wed, Dec 8, 2010 at 8:35 AM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Hi Riccardo!!!
>> thanks a lot for your feedbacks, much much more than appreciated!!!
>> Unfortunately CGLIB is out of our control, and seems that CGLIB team
>> is not so active (last release was pushed in the far 2008!), so I
>> think we should follow the Google Guice's way and repackage cglib as
>> internal stuff. I'll have a deep look on it during the weekend.
>> Thanks once again, looking forward to fix that issue!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Dec 7, 2010 at 4:19 PM, Riccardo Cossu <[hidden email]>
>> wrote:
>> > Hello Simone and thanks for your effort.
>> > I tried the bundle you supplied but it has a dependency
>> > on net.sf.cglib.proxy, which would require to "osgify" a cglib jar and
>> > deploy it as well.
>> > Is it necessary to add the dependency on cglib from 3.0.2 to 3.0.4?
>> > Removing
>> > the dependency on cglib on the manifest it seems to work (not tested
>> > deeply
>> > but seems ok for my app - although I cannot risk to deploy it to the
>> > client!)
>> > Bye,
>> > Riccardo
>> >
>> > On Tue, Dec 7, 2010 at 9:40 AM, Simone Tripodi
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Thanks a lot Andrea,
>> >> very appreciated, I'm still in the middle of the process to get
>> >> familiar with OSGi so any feedbacks from whom is more expert is
>> >> welcome :)
>> >> Have a nice day, ciao ;)
>> >> Simo
>> >>
>> >> http://people.apache.org/~simonetripodi/
>> >> http://www.99soft.org/
>> >>
>> >>
>> >>
>> >> On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]>
>> >> wrote:
>> >> > Hi Simone
>> >> > I'll give a try in the next days, I've a project that could be a
>> >> > test,
>> >> > so
>> >> > I'm very happy of this news.
>> >> > I'll give my feedback as soon as possible
>> >> >  Andrea
>> >> >
>> >> > On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi
>> >> > <[hidden email]>
>> >> > wrote:
>> >> >>
>> >> >> Hi guys,
>> >> >> I just uploaded a snapshot that *should* support OSGi, I'd like to
>> >> >> ask
>> >> >> you if you're available to test it; to obtain the artifact using
>> >> >> Maven, add the repository in your pom:
>> >> >>
>> >> >>    <repositories>
>> >> >>        ...
>> >> >>        <repository>
>> >> >>            <id>sonatype-nexus-snapshots</id>
>> >> >>            <name>Sonatype Nexus Snapshots</name>
>> >> >>
>> >> >>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>> >> >>            <releases>
>> >> >>                <enabled>false</enabled>
>> >> >>            </releases>
>> >> >>            <snapshots>
>> >> >>                <enabled>true</enabled>
>> >> >>            </snapshots>
>> >> >>        </repository>
>> >> >>        ...
>> >> >>    </repositories>
>> >> >>
>> >> >> then add the following dependency:
>> >> >>
>> >> >>    <dependency>
>> >> >>      ...
>> >> >>      <groupId>org.mybatis</groupId>
>> >> >>      <artifactId>mybatis</artifactId>
>> >> >>      <version>3.0.4-SNAPSHOT</version>
>> >> >>      ...
>> >> >>    </dependency>
>> >> >>
>> >> >> Please let me know, many thanks in advance!!!
>> >> >> Simo
>> >> >>
>> >> >> http://people.apache.org/~simonetripodi/
>> >> >> http://www.99soft.org/
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> >> >> <[hidden email]> wrote:
>> >> >> > Hello Simone,
>> >> >> > I actually did little progress with Osgi and Mybatis; I'm using it
>> >> >> > in
>> >> >> > a
>> >> >> > production site but I'm not loading mappings from an external
>> >> >> > bundle.
>> >> >> > This
>> >> >> > way it is simpler because all you have to do is "osgify" the
>> >> >> > mybatis
>> >> >> > jar
>> >> >> > using bnd and a little extra setup which I'm not sure I did
>> >> >> > correctly
>> >> >> > (I
>> >> >> > had
>> >> >> > to do a Class.forName for the jdbc driver to have it correctly
>> >> >> > loaded
>> >> >> > and
>> >> >> > added DynamicImport * to mybatis manifest - I think there may be a
>> >> >> > better
>> >> >> > way, but it's the only way I could make it work).
>> >> >> > Maybe I can write down this procedure in more extent and have some
>> >> >> > feedback
>> >> >> > from the community to reach a better undestranding, but I don't
>> >> >> > think
>> >> >> > I'm a
>> >> >> > the point of writing something for the user guide and I'm in a
>> >> >> > tight
>> >> >> > schedule so I don't think I will have much time to experiment in
>> >> >> > the
>> >> >> > near
>> >> >> > future.
>> >> >> > Bye,
>> >> >> > Riccardo
>> >> >> >
>> >> >> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva
>> >> >> > <[hidden email]>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> Hi Simone!
>> >> >> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib
>> >> >> >> wrapped
>> >> >> >> in a
>> >> >> >> bundle from another bundle, it seems that the xml file contained
>> >> >> >> in
>> >> >> >> my
>> >> >> >> client bundle can't be loaded from mybatis classpath.The problem
>> >> >> >> should
>> >> >> >> be
>> >> >> >> that the resourse loading fail when my module (with myBatis
>> >> >> >> wrapped
>> >> >> >> into)
>> >> >> >> init the myBatis with it's configuration file. I'm
>> >> >> >> investiganting.
>> >> >> >> Has
>> >> >> >> anynoe  got  the same problem?
>> >> >> >> Despite this problems I'm interested.
>> >> >> >>  Andrea
>> >> >> >>
>> >> >> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> >> >> <[hidden email]>
>> >> >> >> wrote:
>> >> >> >>>
>> >> >> >>> Hi Riccardo and Andrea,
>> >> >> >>> are you still interested on contributing on the OSGi side?
>> >> >> >>> Community
>> >> >> >>> is also requesting OSGi support[1] and IMHO the interest around
>> >> >> >>> that
>> >> >> >>> technology will increase
>> >> >> >>> very quickly.
>> >> >> >>> Thanks in advance!
>> >> >> >>> Simo
>> >> >> >>>
>> >> >> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >> >> >>>
>> >> >> >>> http://people.apache.org/~simonetripodi/
>> >> >> >>> http://www.99soft.org/
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >> >> >>> <[hidden email]> wrote:
>> >> >> >>> > Ciao Riccardo,
>> >> >> >>> > I don't have experiences on both so you'll be the main heads
>> >> >> >>> > on
>> >> >> >>> > this
>> >> >> >>> > :)
>> >> >> >>> > OK for the manifest bundle info, they can be easily added
>> >> >> >>> > using
>> >> >> >>> > the
>> >> >> >>> > jar plugin and I don't see any blocking issue on relying only
>> >> >> >>> > on
>> >> >> >>> > it.
>> >> >> >>> > Looking forward to your contribs, have a nice weekend!
>> >> >> >>> > Simo
>> >> >> >>> >
>> >> >> >>> > http://people.apache.org/~simonetripodi/
>> >> >> >>> > http://www.99soft.org/
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo
>> >> >> >>> > <[hidden email]>
>> >> >> >>> > wrote:
>> >> >> >>> >> I agree about the two targets, but I never used Spring Osgi,
>> >> >> >>> >> so
>> >> >> >>> >> I
>> >> >> >>> >> can't contribute about that at the moment.
>> >> >> >>> >>
>> >> >> >>> >> Felix Plugin can generate the manifest because it is based on
>> >> >> >>> >> BND,
>> >> >> >>> >> but
>> >> >> >>> >> in my experience it tends to produce a little bloated
>> >> >> >>> >> manifest;
>> >> >> >>> >> it
>> >> >> >>> >> would probably be better to start with it but to hand-revise
>> >> >> >>> >> it
>> >> >> >>> >> to
>> >> >> >>> >> produce a lighter one. The result can then be added without
>> >> >> >>> >> problems
>> >> >> >>> >> to the usual manifest.
>> >> >> >>> >>
>> >> >> >>> >> It's nice to see we are all italians on this thread and I
>> >> >> >>> >> know
>> >> >> >>> >> quite a
>> >> >> >>> >> few teams in Bologna who have used ibatis/mybatis; I started
>> >> >> >>> >> just a
>> >> >> >>> >> couple of days ago :-)
>> >> >> >>> >>
>> >> >> >>> >> Bye,
>> >> >> >>> >> Riccardo
>> >> >> >>> >>
>> >> >> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]>
>> >> >> >>> >> wrote:
>> >> >> >>> >>> Ciao Andrea,
>> >> >> >>> >>> it seems Italian community is growing fast in the last time
>> >> >> >>> >>> :)
>> >> >> >>> >>> I
>> >> >> >>> >>> think
>> >> >> >>> >>> that having 2 targets sounds much better, feel fee to raise
>> >> >> >>> >>> issues
>> >> >> >>> >>> and
>> >> >> >>> >>> attach patches, every contribution is appreciated.
>> >> >> >>> >>> Have a nice day,
>> >> >> >>> >>> Simo
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >> >> >>> >>> <[hidden email]> wrote:
>> >> >> >>> >>> > Ciao Simone and Riccardo,
>> >> >> >>> >>> >  and if instead of only exporting myBatis package in the
>> >> >> >>> >>> > OSGi,
>> >> >> >>> >>> > the
>> >> >> >>> >>> > myBatis
>> >> >> >>> >>> > will export also some basic OSGi services in two flavour,
>> >> >> >>> >>> > Spring
>> >> >> >>> >>> > DM
>> >> >> >>> >>> > and
>> >> >> >>> >>> > plain OSGi Services?
>> >> >> >>> >>> >  Andrea
>> >> >> >>> >>>
>> >> >> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >> >> >>> >>> > <[hidden email]>
>> >> >> >>> >>> > wrote:
>> >> >> >>> >>>
>> >> >> >>> >>> >> Ciao Riccardo,
>> >> >> >>> >>> >> of course any contribution will be much more than
>> >> >> >>> >>> >> appreciated,
>> >> >> >>> >>> >> feel
>> >> >> >>> >>> >> free to raise issues on the MyBatis whenever you want. I
>> >> >> >>> >>> >> know a
>> >> >> >>> >>> >> little
>> >> >> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix
>> >> >> >>> >>> >> maven
>> >> >> >>> >>> >> plugin
>> >> >> >>> >>> >> is
>> >> >> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >> >> >>> >>> >> It would be very nice adding the osgi support also in the
>> >> >> >>> >>> >> mybatis
>> >> >> >>> >>> >> subproject, I hope this will be the chance for a long
>> >> >> >>> >>> >> collaboration :)
>> >> >> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >> >> >>> >>> >> Simo
>> >> >> >>> >>>
>> >> >> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >> >> >>> >>> >>http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >> >> >>> >>> >> <[hidden email]>
>> >> >> >>> >>> >> wrote:
>> >> >> >>> >>> >> > Ciao Simone,
>> >> >> >>> >>> >> > I have two proposals:
>> >> >> >>> >>> >> > - is it possible to release mybatis as an osgi-ready
>> >> >> >>> >>> >> > bundle
>> >> >> >>> >>> >> >  (it's
>> >> >> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >> >> >>> >>> >> > adjustment
>> >> >> >>> >>> >> > should be necessary)?
>> >> >> >>> >>> >> > - would a little tutorial on how to use mybatis in an
>> >> >> >>> >>> >> > osgi
>> >> >> >>> >>> >> > enviroment
>> >> >> >>> >>> >> > fit in the user guide or wiki?
>> >> >> >>> >>>
>> >> >> >>> >>> >> > I would gladly contribute to both issues, not
>> >> >> >>> >>> >> > immediately,
>> >> >> >>> >>> >> > but
>> >> >> >>> >>> >> > starting about no sooner than mid-november.
>> >> >> >>> >>>
>> >> >> >>> >>> >> > Bye,
>> >> >> >>> >>> >> > Riccardo
>> >> >> >>> >>>
>> >> >> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi
>> >> >> >>> >>> >> > <[hidden email]>
>> >> >> >>> >>> >> > wrote:
>> >> >> >>> >>> >> >> Ciao Riccardo,
>> >> >> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >> >> >>> >>> >> >> Ciao,
>> >> >> >>> >>> >> >> Simo
>> >> >> >>> >>>
>> >> >> >>> >>> >>
>> >> >> >>> >>> >> >>
>> >> >> >>> >>> >> >> >>
>> >> >> >>> >>> >> >> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >> >> >>> >>> >> >> <[hidden email]>
>> >> >> >>> >>> >> >> wrote:
>> >> >> >>> >>> >> >> > I finally managed to make it work; the point here is
>> >> >> >>> >>> >> >> > not
>> >> >> >>> >>> >> >> > to
>> >> >> >>> >>> >> >> > let
>> >> >> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but
>> >> >> >>> >>> >> >> > to
>> >> >> >>> >>> >> >> > let
>> >> >> >>> >>> >> >> > the
>> >> >> >>> >>> >> >> > client
>> >> >> >>> >>> >> >> > bundle have it!
>> >> >> >>> >>> >> >> > In other words there is no need for Dynamic-Import
>> >> >> >>> >>> >> >> > in
>> >> >> >>> >>> >> >> > mybatis
>> >> >> >>> >>> >> >> > bundle;
>> >> >> >>> >>> >> >> > all that is needed is to put the driver package in
>> >> >> >>> >>> >> >> > the
>> >> >> >>> >>> >> >> > package-import
>> >> >> >>> >>> >> >> > directive of the client bundle, eventually as an
>> >> >> >>> >>> >> >> > optional
>> >> >> >>> >>> >> >> > dependency.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > On 16 Set, 17:05, Riccardo
>> >> >> >>> >>> >> >> > <[hidden email]>
>> >> >> >>> >>> >> >> > wrote:
>> >> >> >>> >>> >> >> >> Hello,
>> >> >> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment
>> >> >> >>> >>> >> >> >> (namely
>> >> >> >>> >>> >> >> >> apache
>> >> >> >>> >>> >> >> >> felix,
>> >> >> >>> >>> >> >> >> but I think this is a general issue); I already
>> >> >> >>> >>> >> >> >> have a
>> >> >> >>> >>> >> >> >> working
>> >> >> >>> >>> >> >> >> bundle
>> >> >> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I
>> >> >> >>> >>> >> >> >> used
>> >> >> >>> >>> >> >> >> BND
>> >> >> >>> >>> >> >> >> to
>> >> >> >>> >>> >> >> >> "osgify"
>> >> >> >>> >>> >> >> >> mybatis jar in a bundle.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> I'm always getting an error at the first query I
>> >> >> >>> >>> >> >> >> try:
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> No suitable driver found for
>> >> >> >>> >>> >> >> >> jdbc:jtds:sqlserver://<host
>> >> >> >>> >>> >> >> >> and
>> >> >> >>> >>> >> >> >> database
>> >> >> >>> >>> >> >> >> name>
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >> >> >>> >>> >> >> >> classloader
>> >> >> >>> >>> >> >> >> has no
>> >> >> >>> >>> >> >> >> access to driver classes.
>> >> >> >>> >>> >> >> >> I also tried to add a:
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> DynamicImport-Package: *
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Thanks for your help,
>> >> >> >>> >>> >> >> >> Riccardo
>> >> >> >>> >
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Mybatis and osgi

Riccardo Cossu
I'm currently using mybatis 3.0.2 in osgi enviroment whithout cglib, so I guess Andrea's advice (to declare it optional) should be correct, unless cglib became required in 3.0.4 (which was not in 3.0.2).
Also packing cglib with mybatis may be a good idea since osgi uses different classloaders for every bundle so there should be no conflict.

Bye and good Immacolata :-)
Riccardo

On Wed, Dec 8, 2010 at 1:27 PM, Simone Tripodi <[hidden email]> wrote:
Ciao Andrea,
thanks for the hint, I'm in the middle of the process - I couldn't
wait for the weekend ;) - to repackage cglib in the mybatis bundle,
since it is just internal stuff, following exactly the same Google
Guice's approach.
I'll let you know ASAP the new bundle is ready.
Thanks for the support!
On Wed, Dec 8, 2010 at 11:20 AM, Andrea Selva <[hidden email]> wrote:
> Hi Riccardo and Simone,
> only one question about cglib. myBatis 2.x used java proxy for normal lazy
> loading, cglib was only a configurable option. In myBatis3 is true the same,
> or it must have cglib in the classpath?
> If cglib is an option also for myBatis3 the problem could be fixed at first
> in the myBatis osgi.bnd declaring that imported package as optional
> (Import-Package: net.sf.cglib.proxy;resolution:=optional), else the mybatis
> could link the already OSGified version of cglin from spring team
> (https://ebr.springsource.com/repository/app/search?query=cglib)
>  Andrea
>
>
> On Wed, Dec 8, 2010 at 8:35 AM, Simone Tripodi <[hidden email]>
> wrote:
>>
>> Hi Riccardo!!!
>> thanks a lot for your feedbacks, much much more than appreciated!!!
>> Unfortunately CGLIB is out of our control, and seems that CGLIB team
>> is not so active (last release was pushed in the far 2008!), so I
>> think we should follow the Google Guice's way and repackage cglib as
>> internal stuff. I'll have a deep look on it during the weekend.
>> Thanks once again, looking forward to fix that issue!
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Tue, Dec 7, 2010 at 4:19 PM, Riccardo Cossu <[hidden email]>
>> wrote:
>> > Hello Simone and thanks for your effort.
>> > I tried the bundle you supplied but it has a dependency
>> > on net.sf.cglib.proxy, which would require to "osgify" a cglib jar and
>> > deploy it as well.
>> > Is it necessary to add the dependency on cglib from 3.0.2 to 3.0.4?
>> > Removing
>> > the dependency on cglib on the manifest it seems to work (not tested
>> > deeply
>> > but seems ok for my app - although I cannot risk to deploy it to the
>> > client!)
>> > Bye,
>> > Riccardo
>> >
>> > On Tue, Dec 7, 2010 at 9:40 AM, Simone Tripodi
>> > <[hidden email]>
>> > wrote:
>> >>
>> >> Thanks a lot Andrea,
>> >> very appreciated, I'm still in the middle of the process to get
>> >> familiar with OSGi so any feedbacks from whom is more expert is
>> >> welcome :)
>> >> Have a nice day, ciao ;)
>> >> Simo
>> >>
>> >> http://people.apache.org/~simonetripodi/
>> >> http://www.99soft.org/
>> >>
>> >>
>> >>
>> >> On Tue, Dec 7, 2010 at 9:12 AM, Andrea Selva <[hidden email]>
>> >> wrote:
>> >> > Hi Simone
>> >> > I'll give a try in the next days, I've a project that could be a
>> >> > test,
>> >> > so
>> >> > I'm very happy of this news.
>> >> > I'll give my feedback as soon as possible
>> >> >  Andrea
>> >> >
>> >> > On Mon, Dec 6, 2010 at 11:02 PM, Simone Tripodi
>> >> > <[hidden email]>
>> >> > wrote:
>> >> >>
>> >> >> Hi guys,
>> >> >> I just uploaded a snapshot that *should* support OSGi, I'd like to
>> >> >> ask
>> >> >> you if you're available to test it; to obtain the artifact using
>> >> >> Maven, add the repository in your pom:
>> >> >>
>> >> >>    <repositories>
>> >> >>        ...
>> >> >>        <repository>
>> >> >>            <id>sonatype-nexus-snapshots</id>
>> >> >>            <name>Sonatype Nexus Snapshots</name>
>> >> >>
>> >> >>  <url>https://oss.sonatype.org/content/repositories/snapshots</url>
>> >> >>            <releases>
>> >> >>                <enabled>false</enabled>
>> >> >>            </releases>
>> >> >>            <snapshots>
>> >> >>                <enabled>true</enabled>
>> >> >>            </snapshots>
>> >> >>        </repository>
>> >> >>        ...
>> >> >>    </repositories>
>> >> >>
>> >> >> then add the following dependency:
>> >> >>
>> >> >>    <dependency>
>> >> >>      ...
>> >> >>      <groupId>org.mybatis</groupId>
>> >> >>      <artifactId>mybatis</artifactId>
>> >> >>      <version>3.0.4-SNAPSHOT</version>
>> >> >>      ...
>> >> >>    </dependency>
>> >> >>
>> >> >> Please let me know, many thanks in advance!!!
>> >> >> Simo
>> >> >>
>> >> >> http://people.apache.org/~simonetripodi/
>> >> >> http://www.99soft.org/
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Sat, Nov 20, 2010 at 7:24 PM, Riccardo Cossu
>> >> >> <[hidden email]> wrote:
>> >> >> > Hello Simone,
>> >> >> > I actually did little progress with Osgi and Mybatis; I'm using it
>> >> >> > in
>> >> >> > a
>> >> >> > production site but I'm not loading mappings from an external
>> >> >> > bundle.
>> >> >> > This
>> >> >> > way it is simpler because all you have to do is "osgify" the
>> >> >> > mybatis
>> >> >> > jar
>> >> >> > using bnd and a little extra setup which I'm not sure I did
>> >> >> > correctly
>> >> >> > (I
>> >> >> > had
>> >> >> > to do a Class.forName for the jdbc driver to have it correctly
>> >> >> > loaded
>> >> >> > and
>> >> >> > added DynamicImport * to mybatis manifest - I think there may be a
>> >> >> > better
>> >> >> > way, but it's the only way I could make it work).
>> >> >> > Maybe I can write down this procedure in more extent and have some
>> >> >> > feedback
>> >> >> > from the community to reach a better undestranding, but I don't
>> >> >> > think
>> >> >> > I'm a
>> >> >> > the point of writing something for the user guide and I'm in a
>> >> >> > tight
>> >> >> > schedule so I don't think I will have much time to experiment in
>> >> >> > the
>> >> >> > near
>> >> >> > future.
>> >> >> > Bye,
>> >> >> > Riccardo
>> >> >> >
>> >> >> > On Sat, Nov 20, 2010 at 11:14 AM, Andrea Selva
>> >> >> > <[hidden email]>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> Hi Simone!
>> >> >> >> Yes, at the moment I'm stuck at step 0, using the mybatis lib
>> >> >> >> wrapped
>> >> >> >> in a
>> >> >> >> bundle from another bundle, it seems that the xml file contained
>> >> >> >> in
>> >> >> >> my
>> >> >> >> client bundle can't be loaded from mybatis classpath.The problem
>> >> >> >> should
>> >> >> >> be
>> >> >> >> that the resourse loading fail when my module (with myBatis
>> >> >> >> wrapped
>> >> >> >> into)
>> >> >> >> init the myBatis with it's configuration file. I'm
>> >> >> >> investiganting.
>> >> >> >> Has
>> >> >> >> anynoe  got  the same problem?
>> >> >> >> Despite this problems I'm interested.
>> >> >> >>  Andrea
>> >> >> >>
>> >> >> >> On Fri, Nov 19, 2010 at 9:59 AM, Simone Tripodi
>> >> >> >> <[hidden email]>
>> >> >> >> wrote:
>> >> >> >>>
>> >> >> >>> Hi Riccardo and Andrea,
>> >> >> >>> are you still interested on contributing on the OSGi side?
>> >> >> >>> Community
>> >> >> >>> is also requesting OSGi support[1] and IMHO the interest around
>> >> >> >>> that
>> >> >> >>> technology will increase
>> >> >> >>> very quickly.
>> >> >> >>> Thanks in advance!
>> >> >> >>> Simo
>> >> >> >>>
>> >> >> >>> [1] http://code.google.com/p/mybatis/issues/detail?id=178
>> >> >> >>>
>> >> >> >>> http://people.apache.org/~simonetripodi/
>> >> >> >>> http://www.99soft.org/
>> >> >> >>>
>> >> >> >>>
>> >> >> >>>
>> >> >> >>> On Fri, Sep 17, 2010 at 3:23 PM, Simone Tripodi
>> >> >> >>> <[hidden email]> wrote:
>> >> >> >>> > Ciao Riccardo,
>> >> >> >>> > I don't have experiences on both so you'll be the main heads
>> >> >> >>> > on
>> >> >> >>> > this
>> >> >> >>> > :)
>> >> >> >>> > OK for the manifest bundle info, they can be easily added
>> >> >> >>> > using
>> >> >> >>> > the
>> >> >> >>> > jar plugin and I don't see any blocking issue on relying only
>> >> >> >>> > on
>> >> >> >>> > it.
>> >> >> >>> > Looking forward to your contribs, have a nice weekend!
>> >> >> >>> > Simo
>> >> >> >>> >
>> >> >> >>> > http://people.apache.org/~simonetripodi/
>> >> >> >>> > http://www.99soft.org/
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>> >
>> >> >> >>> > On Fri, Sep 17, 2010 at 2:54 PM, Riccardo
>> >> >> >>> > <[hidden email]>
>> >> >> >>> > wrote:
>> >> >> >>> >> I agree about the two targets, but I never used Spring Osgi,
>> >> >> >>> >> so
>> >> >> >>> >> I
>> >> >> >>> >> can't contribute about that at the moment.
>> >> >> >>> >>
>> >> >> >>> >> Felix Plugin can generate the manifest because it is based on
>> >> >> >>> >> BND,
>> >> >> >>> >> but
>> >> >> >>> >> in my experience it tends to produce a little bloated
>> >> >> >>> >> manifest;
>> >> >> >>> >> it
>> >> >> >>> >> would probably be better to start with it but to hand-revise
>> >> >> >>> >> it
>> >> >> >>> >> to
>> >> >> >>> >> produce a lighter one. The result can then be added without
>> >> >> >>> >> problems
>> >> >> >>> >> to the usual manifest.
>> >> >> >>> >>
>> >> >> >>> >> It's nice to see we are all italians on this thread and I
>> >> >> >>> >> know
>> >> >> >>> >> quite a
>> >> >> >>> >> few teams in Bologna who have used ibatis/mybatis; I started
>> >> >> >>> >> just a
>> >> >> >>> >> couple of days ago :-)
>> >> >> >>> >>
>> >> >> >>> >> Bye,
>> >> >> >>> >> Riccardo
>> >> >> >>> >>
>> >> >> >>> >> On 17 Set, 11:31, Simone Tripodi <[hidden email]>
>> >> >> >>> >> wrote:
>> >> >> >>> >>> Ciao Andrea,
>> >> >> >>> >>> it seems Italian community is growing fast in the last time
>> >> >> >>> >>> :)
>> >> >> >>> >>> I
>> >> >> >>> >>> think
>> >> >> >>> >>> that having 2 targets sounds much better, feel fee to raise
>> >> >> >>> >>> issues
>> >> >> >>> >>> and
>> >> >> >>> >>> attach patches, every contribution is appreciated.
>> >> >> >>> >>> Have a nice day,
>> >> >> >>> >>> Simo
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>> http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>>
>> >> >> >>> >>> On Fri, Sep 17, 2010 at 11:22 AM, Andrea Selva
>> >> >> >>> >>> <[hidden email]> wrote:
>> >> >> >>> >>> > Ciao Simone and Riccardo,
>> >> >> >>> >>> >  and if instead of only exporting myBatis package in the
>> >> >> >>> >>> > OSGi,
>> >> >> >>> >>> > the
>> >> >> >>> >>> > myBatis
>> >> >> >>> >>> > will export also some basic OSGi services in two flavour,
>> >> >> >>> >>> > Spring
>> >> >> >>> >>> > DM
>> >> >> >>> >>> > and
>> >> >> >>> >>> > plain OSGi Services?
>> >> >> >>> >>> >  Andrea
>> >> >> >>> >>>
>> >> >> >>> >>> > On Fri, Sep 17, 2010 at 11:08 AM, Simone Tripodi
>> >> >> >>> >>> > <[hidden email]>
>> >> >> >>> >>> > wrote:
>> >> >> >>> >>>
>> >> >> >>> >>> >> Ciao Riccardo,
>> >> >> >>> >>> >> of course any contribution will be much more than
>> >> >> >>> >>> >> appreciated,
>> >> >> >>> >>> >> feel
>> >> >> >>> >>> >> free to raise issues on the MyBatis whenever you want. I
>> >> >> >>> >>> >> know a
>> >> >> >>> >>> >> little
>> >> >> >>> >>> >> osgi but I don't have any experience, AFAIK the Felix
>> >> >> >>> >>> >> maven
>> >> >> >>> >>> >> plugin
>> >> >> >>> >>> >> is
>> >> >> >>> >>> >> able to add all the needed infos in the MANIFEST.
>> >> >> >>> >>> >> It would be very nice adding the osgi support also in the
>> >> >> >>> >>> >> mybatis
>> >> >> >>> >>> >> subproject, I hope this will be the chance for a long
>> >> >> >>> >>> >> collaboration :)
>> >> >> >>> >>> >> Take care, looking forward to see your contribs ;)
>> >> >> >>> >>> >> Simo
>> >> >> >>> >>>
>> >> >> >>> >>> >>http://people.apache.org/~simonetripodi/
>> >> >> >>> >>> >>http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>> >> On Fri, Sep 17, 2010 at 10:12 AM, Riccardo
>> >> >> >>> >>> >> <[hidden email]>
>> >> >> >>> >>> >> wrote:
>> >> >> >>> >>> >> > Ciao Simone,
>> >> >> >>> >>> >> > I have two proposals:
>> >> >> >>> >>> >> > - is it possible to release mybatis as an osgi-ready
>> >> >> >>> >>> >> > bundle
>> >> >> >>> >>> >> >  (it's
>> >> >> >>> >>> >> > just a matter of a few lines in the manifest, no code
>> >> >> >>> >>> >> > adjustment
>> >> >> >>> >>> >> > should be necessary)?
>> >> >> >>> >>> >> > - would a little tutorial on how to use mybatis in an
>> >> >> >>> >>> >> > osgi
>> >> >> >>> >>> >> > enviroment
>> >> >> >>> >>> >> > fit in the user guide or wiki?
>> >> >> >>> >>>
>> >> >> >>> >>> >> > I would gladly contribute to both issues, not
>> >> >> >>> >>> >> > immediately,
>> >> >> >>> >>> >> > but
>> >> >> >>> >>> >> > starting about no sooner than mid-november.
>> >> >> >>> >>>
>> >> >> >>> >>> >> > Bye,
>> >> >> >>> >>> >> > Riccardo
>> >> >> >>> >>>
>> >> >> >>> >>> >> > On 16 Set, 19:12, Simone Tripodi
>> >> >> >>> >>> >> > <[hidden email]>
>> >> >> >>> >>> >> > wrote:
>> >> >> >>> >>> >> >> Ciao Riccardo,
>> >> >> >>> >>> >> >> and thanks to you for sharing the hint ;)
>> >> >> >>> >>> >> >> Ciao,
>> >> >> >>> >>> >> >> Simo
>> >> >> >>> >>>
>> >> >> >>> >>> >>
>> >> >> >>> >>> >> >>
>> >> >> >>> >>> >> >> >>
>> >> >> >>> >>> >> >> >> >> >>http://people.apache.org/~simonetripodi/http://www.99soft.org/
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> On Thu, Sep 16, 2010 at 5:59 PM, Riccardo
>> >> >> >>> >>> >> >> <[hidden email]>
>> >> >> >>> >>> >> >> wrote:
>> >> >> >>> >>> >> >> > I finally managed to make it work; the point here is
>> >> >> >>> >>> >> >> > not
>> >> >> >>> >>> >> >> > to
>> >> >> >>> >>> >> >> > let
>> >> >> >>> >>> >> >> > mybatis bundle have access to the jdbc driver, but
>> >> >> >>> >>> >> >> > to
>> >> >> >>> >>> >> >> > let
>> >> >> >>> >>> >> >> > the
>> >> >> >>> >>> >> >> > client
>> >> >> >>> >>> >> >> > bundle have it!
>> >> >> >>> >>> >> >> > In other words there is no need for Dynamic-Import
>> >> >> >>> >>> >> >> > in
>> >> >> >>> >>> >> >> > mybatis
>> >> >> >>> >>> >> >> > bundle;
>> >> >> >>> >>> >> >> > all that is needed is to put the driver package in
>> >> >> >>> >>> >> >> > the
>> >> >> >>> >>> >> >> > package-import
>> >> >> >>> >>> >> >> > directive of the client bundle, eventually as an
>> >> >> >>> >>> >> >> > optional
>> >> >> >>> >>> >> >> > dependency.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > No other tricks seem necessary to make it work.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > Thanks anyway, this issue is closed :-)
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> > On 16 Set, 17:05, Riccardo
>> >> >> >>> >>> >> >> > <[hidden email]>
>> >> >> >>> >>> >> >> > wrote:
>> >> >> >>> >>> >> >> >> Hello,
>> >> >> >>> >>> >> >> >> I'm trying to use mybatis in an osgi enviroment
>> >> >> >>> >>> >> >> >> (namely
>> >> >> >>> >>> >> >> >> apache
>> >> >> >>> >>> >> >> >> felix,
>> >> >> >>> >>> >> >> >> but I think this is a general issue); I already
>> >> >> >>> >>> >> >> >> have a
>> >> >> >>> >>> >> >> >> working
>> >> >> >>> >>> >> >> >> bundle
>> >> >> >>> >>> >> >> >> for the jdbc driver I'm using (namely jtds) and I
>> >> >> >>> >>> >> >> >> used
>> >> >> >>> >>> >> >> >> BND
>> >> >> >>> >>> >> >> >> to
>> >> >> >>> >>> >> >> >> "osgify"
>> >> >> >>> >>> >> >> >> mybatis jar in a bundle.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> I'm always getting an error at the first query I
>> >> >> >>> >>> >> >> >> try:
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> No suitable driver found for
>> >> >> >>> >>> >> >> >> jdbc:jtds:sqlserver://<host
>> >> >> >>> >>> >> >> >> and
>> >> >> >>> >>> >> >> >> database
>> >> >> >>> >>> >> >> >> name>
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Surely it is a classloader problem, that ibatis
>> >> >> >>> >>> >> >> >> classloader
>> >> >> >>> >>> >> >> >> has no
>> >> >> >>> >>> >> >> >> access to driver classes.
>> >> >> >>> >>> >> >> >> I also tried to add a:
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> DynamicImport-Package: *
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> to the bundle manifest with no luck.
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Has anyone tried to use mybatis in osgi enviroment?
>> >> >> >>> >>>
>> >> >> >>> >>> >> >> >> Thanks for your help,
>> >> >> >>> >>> >> >> >> Riccardo
>> >> >> >>> >
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >
>> >> >
>> >
>> >
>
>

123