You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Steinar Bang <sb...@dod.no> on 2020/07/26 08:46:43 UTC

Problems finding javax.activation.DataSource in karaf

Platform: amd64, debian 10.4 "buster", java 11, karaf 4.2.9

I'm trying to load liquibase 3.10.1 from a feature, and liquibase-core
tries to find javax.activation.DataSource and fails with a
ClassNotFoundException[1].

The feature I'm trying to load, is liquibase-sample from [2] which in
turn loads feature liquibase-sample-hook from the same feature
repository. And in turn liquibase-sample-hook tries to load
liquibase-core from [3].

Feature liquibase-core from [3] is the one I'm trying to create a new
version of: I'm trying to upgrade my liquibase karaf feature[4] from
liquibase 3.8.0 to 3.10.1.

As far as I can tell the liquibase-core 3.10.1 manifest[5] does not
import javax.activation directly?  Is this the problem?

There is nothing in the liquibase 3.10.1 java source that references
javax.activation.DataSource, so I'm guessing the class has to come from
some transitive reference?

Does anyone know what to do to fix this?  Rebundling of liquibase-core?
Is there another way that doesn't involve changing liquibase-core
itself?

Perhaps the same "party trick" I'm using to redirect the liquibase
logging to the karaf log (instead of printing to the console)?  I.e
attaching a fragment to liquibase-core to get it "inside" the bundle.

What happens if I put a version of javax.activation inside a fragment
and attch it to liquibase-core?  Will it conflict with the version of
liquibase-core exposed by the servicemix version of javax.activation
used by karaf?

Thanks!

References:
 [1] <https://gist.github.com/steinarb/52290fca04c772f0fa76b8927125b9df>
 [2] <https://gist.github.com/steinarb/8e39910a0ef16068016c4dde4ff3cc95>
 [3] <https://gist.github.com/steinarb/a0780f69cddf3fbe2df7dcd93cbce4a1>
 [4] <https://github.com/steinarb/liquibase-karaf-feature#a-karaf-feature-for-liquibase-core>
 [5] <https://gist.github.com/steinarb/76bd466ba6a85885234287fe26c1b70a>


Re: Problems finding javax.activation.DataSource in karaf

Posted by Jakub Herkel <jh...@gmail.com>.
I can see the same problem with Java 11, but this issue is presented also
with servicemix 7.0.1 and java 1.8.

On Sun, Sep 27, 2020 at 7:15 PM Steinar Bang <sb...@dod.no> wrote:

> >>>>> Steinar Bang <sb...@dod.no>:
> >>>>> Jean-Baptiste Onofre <jb...@nanthrax.net>:
>
> >> Hopefully, 3.10.2 will be released soon ;)
>
> > It was actually released on July 27, but I didn't get around to trying
> > with 3.10.2 until today.
>
> > Unfortunately, even though the locally built 3.10.2-SNAPSHOT didn't have
> > the issue, the released 3.10.2 have the issue...:-/
>
> > The issue is still open:
> >  https://github.com/liquibase/liquibase/issues/1254
>
> I've added some comments to the issue during the day
>  https://github.com/liquibase/liquibase/issues/1254#issuecomment-699602066
>  https://github.com/liquibase/liquibase/issues/1254#issuecomment-699606171
>  https://github.com/liquibase/liquibase/issues/1254#issuecomment-699608015
>  https://github.com/liquibase/liquibase/issues/1254#issuecomment-699611630
>  https://github.com/liquibase/liquibase/issues/1254#issuecomment-699654812
>
> But the short story is that I think this is an problem with building on
> Java 1.8 and running on Java 11.
>
>
>

Re: Problems finding javax.activation.DataSource in karaf

Posted by Steinar Bang <sb...@dod.no>.
>>>>> Steinar Bang <sb...@dod.no>:
>>>>> Jean-Baptiste Onofre <jb...@nanthrax.net>:

>> Hopefully, 3.10.2 will be released soon ;)

> It was actually released on July 27, but I didn't get around to trying
> with 3.10.2 until today.

> Unfortunately, even though the locally built 3.10.2-SNAPSHOT didn't have
> the issue, the released 3.10.2 have the issue...:-/

> The issue is still open:
>  https://github.com/liquibase/liquibase/issues/1254

I've added some comments to the issue during the day
 https://github.com/liquibase/liquibase/issues/1254#issuecomment-699602066
 https://github.com/liquibase/liquibase/issues/1254#issuecomment-699606171
 https://github.com/liquibase/liquibase/issues/1254#issuecomment-699608015
 https://github.com/liquibase/liquibase/issues/1254#issuecomment-699611630
 https://github.com/liquibase/liquibase/issues/1254#issuecomment-699654812

But the short story is that I think this is an problem with building on
Java 1.8 and running on Java 11.



Re: Problems finding javax.activation.DataSource in karaf

Posted by Steinar Bang <sb...@dod.no>.
>>>>> Jean-Baptiste Onofre <jb...@nanthrax.net>:

> Hopefully, 3.10.2 will be released soon ;)

It was actually released on July 27, but I didn't get around to trying
with 3.10.2 until today.

Unfortunately, even though the locally built 3.10.2-SNAPSHOT didn't have
the issue, the released 3.10.2 have the issue...:-/

The issue is still open:
 https://github.com/liquibase/liquibase/issues/1254


Re: Problems finding javax.activation.DataSource in karaf

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hopefully, 3.10.2 will be released soon ;)

Regards
JB

> Le 28 juil. 2020 à 09:42, Steinar Bang <sb...@dod.no> a écrit :
> 
>>>>>> Jakub Herkel <jh...@gmail.com>:
> 
>> Probably you have the same problem as me, see
>> https://github.com/liquibase/liquibase/issues/1254
> 
> Yup.  Looks like the same.
> 
> Note: 3.10.2-local-SNAPSHOT did not have this issue, and does not import
> javax.activation, so I guess the need for javax.activation has been
> removed somehow.
> 
> So we're just have to hope for 3.10.2...:-)
> 


Re: Problems finding javax.activation.DataSource in karaf

Posted by Steinar Bang <sb...@dod.no>.
>>>>> Jakub Herkel <jh...@gmail.com>:

> Probably you have the same problem as me, see
> https://github.com/liquibase/liquibase/issues/1254

Yup.  Looks like the same.

Note: 3.10.2-local-SNAPSHOT did not have this issue, and does not import
javax.activation, so I guess the need for javax.activation has been
removed somehow.

So we're just have to hope for 3.10.2...:-)


Re: Problems finding javax.activation.DataSource in karaf

Posted by Jakub Herkel <jh...@gmail.com>.
Probably you have the same problem as me, see
https://github.com/liquibase/liquibase/issues/1254

Jakub

On Sun, Jul 26, 2020 at 2:07 PM Steinar Bang <sb...@dod.no> wrote:

> Hm... I built liquibase-core 3.10.2-local-SNAPSHOT locally and tried it
> out with my karaf feature, with the expectation of getting the same
> ClassNotFoundException in karaf.log.
>
> The plan then, was add a package import for javax.activation, and if
> that worked, to create an JIRA for the issue and provide a PR.
>
> But 3.10.2-local-SNAPSHOT loads just fine and the liquibase changelog is
> applied.  I.e.: stuff works as intended.
>
> Damn! :-)
>
> I've skimmed through the git commit history since the 3.10.1 release,
> but I haven't seen anything obvious there (there are a lot of merges
> from branches with changes far back in history).  I could use "git
> bisect" to find the commit changing things, but that seems like
> overkill.
>
> From the commit history it looks like the 3.10.2 release is imminent so
> I'll wait for that and see, I guess...?
>
>

Re: Problems finding javax.activation.DataSource in karaf

Posted by Steinar Bang <sb...@dod.no>.
Hm... I built liquibase-core 3.10.2-local-SNAPSHOT locally and tried it
out with my karaf feature, with the expectation of getting the same
ClassNotFoundException in karaf.log.

The plan then, was add a package import for javax.activation, and if
that worked, to create an JIRA for the issue and provide a PR.

But 3.10.2-local-SNAPSHOT loads just fine and the liquibase changelog is
applied.  I.e.: stuff works as intended.

Damn! :-)

I've skimmed through the git commit history since the 3.10.1 release,
but I haven't seen anything obvious there (there are a lot of merges
from branches with changes far back in history).  I could use "git
bisect" to find the commit changing things, but that seems like
overkill.

From the commit history it looks like the 3.10.2 release is imminent so
I'll wait for that and see, I guess...?