You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by stefang <st...@me.com> on 2020/01/20 14:10:46 UTC

Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Hi,

we are not able to run Christian's Example:

https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java


Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)

Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.

Stefan

 



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Alex Soto <al...@envieta.com>.
Yes, the PreHook is never called starting with Pax-JDBC 1.3.4 (1.3.3 works).


Best regards,
Alex soto




> On Jan 22, 2020, at 11:18 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> Alex, are you also using PreHook ?
> 
> It's maybe the PreHook whiteboard broken in Pax JDBC 1.4.4.
> 
> Regards
> JB
> 
> On 22/01/2020 17:11, Alex Soto wrote:
>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not
>> with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>
>>> <mailto:stefan.guenst@me.com <ma...@me.com>>> wrote:
>>> 
>>> Hi,
>>> 
>>> we are not able to run Christian's Example:
>>> 
>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>> 
>>> 
>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>> 
>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>> 
>>> Stefan
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org <ma...@apache.org>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend - http://www.talend.com <http://www.talend.com/>

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Alex, are you also using PreHook ?

It's maybe the PreHook whiteboard broken in Pax JDBC 1.4.4.

Regards
JB

On 22/01/2020 17:11, Alex Soto wrote:
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not
> with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com
>> <ma...@me.com>> wrote:
>>
>> Hi,
>>
>> we are not able to run Christian's Example:
>>
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>
>>
>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>
>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>
>> Stefan
>>
>>
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi JB,

that's true and sorry, we did not want to deny the dynamic flexibility at
all ...
as we use it also in our projects but need urgent a static alternative to
get more robust on special use cases.

Regards
Stefan



jbonofre wrote
> Hi,
> 
> I think it depends of the use case. I fully understand people like you
> using static distribution, but I also understand people using dynamic
> distribution.
> 
> So, I got your point and I agree. The huge advantage of Karaf is the
> flexibility: it can address very different use cases and topologies
> easily, using the same code model.
> 
> Regards
> JB
> 
>> Le 7 avr. 2020 à 15:35, stefang &lt;

> stefan.guenst@

> &gt; a écrit :
>> 
>> Hi JB,
>> 
>> we are very interested on that material because we think a static
>> distribution is the only way (after many years of Experience with Karaf)
>> to
>> get a robust and well defined Platform for the Enterprise .... 
>> 
>> Regards
>> Stefan 
>> 
>> 
>> 
>> jbonofre wrote
>>> That’s actually a great news ! It’s great to see people using static
>>> distribution !
>>> 
>>> By the way, we are working on new tooling to even easily create
>>> distribution (static or dynamic) !
>>> The purpose is to provide a much better dev experience.
>>> 
>>> I will prepare some materials to discuss on the mailing list (I would
>>> like
>>> to have something showable).
>>> 
>>> Regards
>>> JB
>>> 
>>>> Le 7 avr. 2020 à 13:30, stefang &lt;
>> 
>>> stefan.guenst@
>> 
>>> &gt; a écrit :
>>>> 
>>>> Hi JB,
>>>> 
>>>> thanks a lot for explaining this.
>>>> So we stay on 4.2.6 and waiting for 4.2.9 because static distribution
>>>> is
>>>> urgent to us as you know.
>>>> 
>>>> Regards
>>>> Stefan
>>>> 
>>>> 
>>>> 
>>>> jbonofre wrote
>>>>> Hi Stefan,
>>>>> 
>>>>> If the problem is related to PAX JDBC in static distribution, it’s not
>>>>> yet
>>>>> fully fixed.
>>>>> 
>>>>> All the details is in the Jira: the problem is about the resolver
>>>>> order.
>>>>> When using static distribution, all features are startup features,
>>>>> meaning
>>>>> that all is evaluated at same stage. As PAX JDBC has requirements from
>>>>> framework, the framework should be evaluated before pax-jdbc.
>>>>> It’s not a problem when using pax JDBC as boot feature in dynamic
>>>>> distribution as startup is evaluated first and then boot features.
>>>>> But with static distribution, again, all is at "same level"/startup.
>>>>> 
>>>>> My plan is to add an order on startup properties to be able to address
>>>>> resolution order in startup.
>>>>> 
>>>>> I plan to fix that for Karaf 4.2.9.
>>>>> 
>>>>> Regards
>>>>> JB
>>>>> 
>>>>>> Le 7 avr. 2020 à 12:47, stefang &lt;
>>>> 
>>>>> stefan.guenst@
>>>> 
>>>>> &gt; a écrit :
>>>>>> 
>>>>>> Hi Erwin,
>>>>>> 
>>>>>> we tried it with static distribution based on 4.2.8 Release without
>>>>>> any
>>>>>> luck
>>>>>> (4.2.6 without problems)
>>>>>> Anything we missed?
>>>>>> 
>>>>>> Regards 
>>>>>> 
>>>>>> Stefan 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Erwin Hogeweg wrote
>>>>>>> Hi Lukas,
>>>>>>> 
>>>>>>> Glad I could help.
>>>>>>> 
>>>>>>> Happy coding.
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
>>>>>> 
>>>>>>> Lukas.Roedl@.ac
>>>>>> 
>>>>>>> &gt; wrote:
>>>>>>>> 
>>>>>>>> Hi Erwin,
>>>>>>>> 
>>>>>>>> Thanks for your input – finally I had time to test it extensively
>>>>>>>> and
>>>>>>>> it’s working now!!!
>>>>>>>> In the end the source of error was sitting in front of the PC ;-)
>>>>>>>> 
>>>>>>>> The problem was that some dependencies where embedded into the
>>>>>>>> actual
>>>>>>>> bundle and at the same time these dependencies are also provided by
>>>>>>>> pax-jdbc via the feature.
>>>>>>>> (for details see [1])
>>>>>>>> 
>>>>>>>> So no actual problem with Pax-JDBC itself :-)
>>>>>>>> 
>>>>>>>> Thanks again!
>>>>>>>> 
>>>>>>>> Best, Lukas
>>>>>>>> 
>>>>>>>> [1]
>>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;;
>>>>>>>> 
>>>>>>>> Von: Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt; 
>>>>>>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>>>>>>> An: 
>>>>>> 
>>>>>>> user@.apache
>>>>>> 
>>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>>> working
>>>>>>>> 
>>>>>>>> Lukas ,
>>>>>>>> 
>>>>>>>> It looks like you missed my pom.xml changes…Once I applied those to
>>>>>>>> your
>>>>>>>> git version it worked again. I was unable to push the change to
>>>>>>>> GitHub
>>>>>>>> so
>>>>>>>> here they are again.
>>>>>>>> 
>>>>>>>> I reduced the maven-bundle-plugin to:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <groupId>
>>>>>>> org.apache.felix
>>>>>>> 
>>>>> 
>>> 
> </groupId>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <artifactId>
>>>>>>> maven-bundle-plugin
>>>>>>> 
>>>>> 
>>> 
> </artifactId>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <extensions>
>>>>>>> true
>>>>>>> 
>>>>> 
>>> 
> </extensions>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <configuration>
>>>>>>>> 
>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <obrRepository>
>>>>>>> NONE
>>>>>>> 
>>>>> 
>>> 
> </obrRepository>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <instructions>
>>>>>>>>      <_nouses>true
>>>>>>> 
>>>>> 
>>> 
> </_nouses>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <Bundle-SymbolicName>
>>>>>>> ${project.artifactId}
>>>>>>> 
>>>>> 
>>> 
> </Bundle-SymbolicName>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> </instructions>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> </configuration>
>>>>>>>> 
>>>>>>>> FWIW…  I am running OSX Catalina with Java-8.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
>>>>>> 
>>>>>>> Lukas.Roedl@.ac
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> Lukas.Roedl@.ac
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> @Erwin: Thanks for testing!
>>>>>>>> 
>>>>>>>> I tried to reproduce and incorporated your proposed changes in
>>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;;
>>>>>>>> 
>>>>>>>> But unfortunately I had no luck that the PreHook finally got
>>>>>>>> called.
>>>>>>>> 
>>>>>>>> Did you also change some other things?
>>>>>>>> 
>>>>>>>> Best,
>>>>>>>> Lukas
>>>>>>>> 
>>>>>>>> Von: Jean-Baptiste Onofré &lt;
>>>>>> 
>>>>>>> jb@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> jb@
>>>>>> 
>>>>>>> &gt;> 
>>>>>>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>>>>>>> An: 
>>>>>> 
>>>>>>> user@.apache
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> user@.apache
>>>>>> 
>>>>>>> &gt;
>>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>>> working
>>>>>>>> 
>>>>>>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>>>>>>> posted. 
>>>>>>>> 
>>>>>>>> Regards 
>>>>>>>> JB
>>>>>>>> 
>>>>>>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> a ?crit :
>>>>>>>> Lukas,
>>>>>>>> 
>>>>>>>> I believe I have some success by copying configuration from my env.
>>>>>>>> to
>>>>>>>> the prehook test.
>>>>>>>> 
>>>>>>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>>>>>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>>>> 'aes256-ctr' not available
>>>>>>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>>>>>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config -
>>>>>>>> 1.4.4
>>>>>>>> | Obtained service dependency:
>>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>>>>>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>>>> 'aes192-ctr' not available
>>>>>>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>>>> 1.4.4
>>>>>>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>>>> 1.4.4
>>>>>>>> | Executing pre hook for DataSource prehook-test
>>>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>>>>>>> 
>>>>>>>> I reduced the maven-bundle-plugin to:
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <groupId>
>>>>>>> org.apache.felix
>>>>>>> 
>>>>> 
>>> 
> </groupId>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <artifactId>
>>>>>>> maven-bundle-plugin
>>>>>>> 
>>>>> 
>>> 
> </artifactId>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <extensions>
>>>>>>> true
>>>>>>> 
>>>>> 
>>> 
> </extensions>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <configuration>
>>>>>>>> 
>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <obrRepository>
>>>>>>> NONE
>>>>>>> 
>>>>> 
>>> 
> </obrRepository>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <instructions>
>>>>>>>>      <_nouses>true
>>>>>>> 
>>>>> 
>>> 
> </_nouses>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> <Bundle-SymbolicName>
>>>>>>> ${project.artifactId}
>>>>>>> 
>>>>> 
>>> 
> </Bundle-SymbolicName>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> </instructions>
>>>>>>>> 
>>>>>>> 
>>>>> 
>>> 
> </configuration>
>>>>>>>> 
>>>>>>>> And I changed the component annotations to:
>>>>>>>> 
>>>>>>>> @Component(
>>>>>>>>  // scope = ServiceScope.SINGLETON,
>>>>>>>>  immediate = true,
>>>>>>>>  // service = PreHook.class,
>>>>>>>>  property = "name=prehook-test-hook"
>>>>>>>> )
>>>>>>>> public class PreHookTest implements PreHook {
>>>>>>>> ?
>>>>>>>> 
>>>>>>>> I may have thrown away too much, but at least this is a good
>>>>>>>> starting
>>>>>>>> point.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Lukas,
>>>>>>>> 
>>>>>>>> I am currently on the road but I will try this ASAP. 
>>>>>>>> 
>>>>>>>> Kind Regards,
>>>>>>>> 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
>>>>>> 
>>>>>>> Lukas.Roedl@.ac
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> Lukas.Roedl@.ac
>>>>>> 
>>>>>>> &gt;> escribi?:
>>>>>>>> 
>>>>>>>> ?
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>>>>>>> I?ve prepared a minimal example on
>>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;;
>>>>>>>> using
>>>>>>>> SQLite to
>>>>>>>> make it a bit more concrete.
>>>>>>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>>>>>>> 
>>>>>>>> The DataSource is specified in the file
>>>>>>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a
>>>>>>>> PreHook
>>>>>>>> defined the DataSource is published as expected:
>>>>>>>> 
>>>>>>>> dataSourceName = prehook-test
>>>>>>>> felix.fileinstall.filename =
>>>>>>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>>>>>>> objectClass = [javax.sql.DataSource]
>>>>>>>> osgi.jdbc.driver.name = sqlite
>>>>>>>> osgi.jndi.service.name = prehook-test
>>>>>>>> pax.jdbc.managed = true
>>>>>>>> service.bundleid = 16
>>>>>>>> service.factoryPid = org.ops4j.datasource
>>>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://service.id/&gt &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;; = 88
>>>>>>>> service.pid =
>>>>>>>> org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>>>>>>> service.scope = singleton
>>>>>>>> url = jdbc:sqlite:prehook-test.db
>>>>>>>> 
>>>>>>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?)
>>>>>>>> the
>>>>>>>> last log entry is ?Waiting for service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>>>>>>> event if the PreHook itself is started and active:
>>>>>>>> 
>>>>>>>> Pax JDBC - Test - PreHook (21) provides:
>>>>>>>> ----------------------------------------
>>>>>>>> component.id &lt;http://component.id/&gt;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;; =
>>>>>>>> 0
>>>>>>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>>>>>>> name = prehook-test-hook
>>>>>>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>>>> service.bundleid = 21
>>>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://service.id/&gt &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;; = 75
>>>>>>>> service.scope = bundle
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Can someone which doesn?t have problems with this, please take a
>>>>>>>> short
>>>>>>>> look, if there are some differences between the working
>>>>>>>> configurations
>>>>>>>> and this example?
>>>>>>>> 
>>>>>>>> Best,
>>>>>>>> Lukas
>>>>>>>> 
>>>>>>>> 
>>>>>>>> [1]
>>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;;
>>>>>>>> 
>>>>>>>> Von: Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> 
>>>>>>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>>>>>>> An: 
>>>>>> 
>>>>>>> user@.apache
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> user@.apache
>>>>>> 
>>>>>>> &gt;
>>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>>> working
>>>>>>>> 
>>>>>>>> Hi Alex,
>>>>>>>> 
>>>>>>>> Below a similar sequence from my log.
>>>>>>>> 
>>>>>>>> From your log it seems that the Derby DataSourceFactory is not
>>>>>>>> resolved.
>>>>>>>> I remember that at some point I changed the driver.name entry in
>>>>>>>> the
>>>>>>>> config to a driver.class entry. That is for a mySQL database though
>>>>>>>> but
>>>>>>>> but maybe?
>>>>>>>> 
>>>>>>>> Another silly question: Is your datasource functional if you leave
>>>>>>>> out
>>>>>>>> the preHook?
>>>>>>>> 
>>>>>>>> Obtained service dependency:
>>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>>> Waiting for service dependency:
>>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>>> Waiting for service dependency:
>>>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>>>> Waiting for service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>>> Waiting for service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>>> Obtained service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>>> Obtained service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>>>>>>> Obtained service dependency:
>>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Cheers, 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Yes,  the migration service is being registered:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Obtained service dependency:
>>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>>> Waiting for service dependency:
>>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>>> Waiting for service dependency:
>>>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>>>> Obtained service dependency:
>>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>>>>>>> Waiting for service dependency:
>>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>>>>>>> 
>>>>>>>> 
>>>>>>>> And
>>>>>>>> 
>>>>>>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>>>>>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>>>> ---------------------------------
>>>>>>>> component.id &lt;http://component.id/&gt;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://component.id/&gt &lt;http://component.id/&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://component.id/&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;; =
>>>>>>>> 29
>>>>>>>> component.name =
>>>>>>>> org.enquery.encryptedquery.querier.data.maint.Migration
>>>>>>>> name = querierDB
>>>>>>>> service.bundleid = 35
>>>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://service.id/&gt &lt;http://service.id/&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://service.id/&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;; =
>>>>>>>> 276
>>>>>>>> service.scope = bundle
>>>>>>>> Provided by : 
>>>>>>>> EncryptedQuery :: Querier :: Data (35)
>>>>>>>> Used by: 
>>>>>>>> OPS4J Pax JDBC Config (210)
>>>>>>>> 
>>>>>>>> Best regards,
>>>>>>>> Alex soto
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>>>>>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any
>>>>>>>> issues.
>>>>>>>> 
>>>>>>>> Stupid question, but can you confirm that the Migrator class is
>>>>>>>> instantiated and that the component is active?
>>>>>>>> 
>>>>>>>>             com.*.Migrator in bundle 129
>>>>>>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>>>>>>                 Id: 18, State:ACTIVE
>>>>>>>> 
>>>>>>>> Initially I missed some Package-Imports on the migrator bundle
>>>>>>>> which
>>>>>>>> left
>>>>>>>> the component in the SATISFIED (I believe) state. After scrolling
>>>>>>>> through
>>>>>>>> the logs I discovered a CNFE which pointed me in the right
>>>>>>>> direction.
>>>>>>>> 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>>>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>>>>>> 
>>>>>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>>>>>> remains
>>>>>>>> the same in my tests.  
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Best regards,
>>>>>>>> Alex soto
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Ignore the different datasource names. I messed up the ?replace
>>>>>>>> all?
>>>>>>>> :-)
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> erwin.hogeweg@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and
>>>>>>>> pax-jdbc-1.4.4.
>>>>>>>> 
>>>>>>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>>> Generic Driver Extender
>>>>>>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>>> Config
>>>>>>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>>> Pooling Support Base
>>>>>>>> 
>>>>>>>> [features-2-thread-1] INFO
>>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>>>>> [features-2-thread-1] INFO
>>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing
>>>>>>>> pre
>>>>>>>> hook for DataSource jdbc/mydatasource
>>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log
>>>>>>>> lock
>>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>>>>> seegate.DATABASECHANGELOG
>>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log
>>>>>>>> lock
>>>>>>>> [features-2-thread-1] INFO
>>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>>>>> [features-2-thread-1] INFO
>>>>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>>>>> DataSource
>>>>>>>> for seegate.pu
>>>>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>>>>> 
>>>>>>>> FWIW - I did change the exception handling in Migrator to better
>>>>>>>> see
>>>>>>>> when/if the migration fails:
>>>>>>>> 
>>>>>>>>  @Override
>>>>>>>>  public void prepare(DataSource ds) throwsSQLException {
>>>>>>>>      try (Connection connection =ds.getConnection()) {
>>>>>>>>          prepare(connection);
>>>>>>>>      } catch (LiquibaseException e) {
>>>>>>>>                  LOG.error(e.getClass().getName() + ": " +
>>>>>>>> e.getMessage());
>>>>>>>> //            throw new RuntimeException(e);
>>>>>>>>      }
>>>>>>>>  }
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Cheers,
>>>>>>>> 
>>>>>>>> Erwin
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> alex.soto@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>>>> 
>>>>>>>> Best regards,
>>>>>>>> Alex soto
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>>>>>> 
>>>>>>> stefan.guenst@
>>>>>> 
>>>>>>> &lt;mailto:
>>>>>> 
>>>>>>> stefan.guenst@
>>>>>> 
>>>>>>> &gt;> wrote:
>>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> we are not able to run Christian's Example:
>>>>>>>> 
>>>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&amp;gt&gt;;
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&amp;gt&gt;;
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>>>> 
>>>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>>>> 
>>>>>>>> Stefan
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> --
>>>>>>>> Sent from:
>>>>>>>> http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt;;;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt;;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt;
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;amp;gt&amp;amp;gt&amp;gt&gt;;;;
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt;;;
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

I think it depends of the use case. I fully understand people like you using static distribution, but I also understand people using dynamic distribution.

So, I got your point and I agree. The huge advantage of Karaf is the flexibility: it can address very different use cases and topologies easily, using the same code model.

Regards
JB

> Le 7 avr. 2020 à 15:35, stefang <st...@me.com> a écrit :
> 
> Hi JB,
> 
> we are very interested on that material because we think a static
> distribution is the only way (after many years of Experience with Karaf) to
> get a robust and well defined Platform for the Enterprise .... 
> 
> Regards
> Stefan 
> 
> 
> 
> jbonofre wrote
>> That’s actually a great news ! It’s great to see people using static
>> distribution !
>> 
>> By the way, we are working on new tooling to even easily create
>> distribution (static or dynamic) !
>> The purpose is to provide a much better dev experience.
>> 
>> I will prepare some materials to discuss on the mailing list (I would like
>> to have something showable).
>> 
>> Regards
>> JB
>> 
>>> Le 7 avr. 2020 à 13:30, stefang &lt;
> 
>> stefan.guenst@
> 
>> &gt; a écrit :
>>> 
>>> Hi JB,
>>> 
>>> thanks a lot for explaining this.
>>> So we stay on 4.2.6 and waiting for 4.2.9 because static distribution is
>>> urgent to us as you know.
>>> 
>>> Regards
>>> Stefan
>>> 
>>> 
>>> 
>>> jbonofre wrote
>>>> Hi Stefan,
>>>> 
>>>> If the problem is related to PAX JDBC in static distribution, it’s not
>>>> yet
>>>> fully fixed.
>>>> 
>>>> All the details is in the Jira: the problem is about the resolver order.
>>>> When using static distribution, all features are startup features,
>>>> meaning
>>>> that all is evaluated at same stage. As PAX JDBC has requirements from
>>>> framework, the framework should be evaluated before pax-jdbc.
>>>> It’s not a problem when using pax JDBC as boot feature in dynamic
>>>> distribution as startup is evaluated first and then boot features.
>>>> But with static distribution, again, all is at "same level"/startup.
>>>> 
>>>> My plan is to add an order on startup properties to be able to address
>>>> resolution order in startup.
>>>> 
>>>> I plan to fix that for Karaf 4.2.9.
>>>> 
>>>> Regards
>>>> JB
>>>> 
>>>>> Le 7 avr. 2020 à 12:47, stefang &lt;
>>> 
>>>> stefan.guenst@
>>> 
>>>> &gt; a écrit :
>>>>> 
>>>>> Hi Erwin,
>>>>> 
>>>>> we tried it with static distribution based on 4.2.8 Release without any
>>>>> luck
>>>>> (4.2.6 without problems)
>>>>> Anything we missed?
>>>>> 
>>>>> Regards 
>>>>> 
>>>>> Stefan 
>>>>> 
>>>>> 
>>>>> 
>>>>> Erwin Hogeweg wrote
>>>>>> Hi Lukas,
>>>>>> 
>>>>>> Glad I could help.
>>>>>> 
>>>>>> Happy coding.
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
>>>>> 
>>>>>> Lukas.Roedl@.ac
>>>>> 
>>>>>> &gt; wrote:
>>>>>>> 
>>>>>>> Hi Erwin,
>>>>>>> 
>>>>>>> Thanks for your input – finally I had time to test it extensively and
>>>>>>> it’s working now!!!
>>>>>>> In the end the source of error was sitting in front of the PC ;-)
>>>>>>> 
>>>>>>> The problem was that some dependencies where embedded into the actual
>>>>>>> bundle and at the same time these dependencies are also provided by
>>>>>>> pax-jdbc via the feature.
>>>>>>> (for details see [1])
>>>>>>> 
>>>>>>> So no actual problem with Pax-JDBC itself :-)
>>>>>>> 
>>>>>>> Thanks again!
>>>>>>> 
>>>>>>> Best, Lukas
>>>>>>> 
>>>>>>> [1]
>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12 <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt>;;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt>;;;
>>>>>>> 
>>>>>>> Von: Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt; 
>>>>>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>>>>>> An: 
>>>>> 
>>>>>> user@.apache
>>>>> 
>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>> working
>>>>>>> 
>>>>>>> Lukas ,
>>>>>>> 
>>>>>>> It looks like you missed my pom.xml changes…Once I applied those to
>>>>>>> your
>>>>>>> git version it worked again. I was unable to push the change to
>>>>>>> GitHub
>>>>>>> so
>>>>>>> here they are again.
>>>>>>> 
>>>>>>> I reduced the maven-bundle-plugin to:
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>> <groupId>
>>>>>> org.apache.felix
>>>>>> 
>>>> 
>> </groupId>
>>>>>>> 
>>>>>> 
>>>> 
>> <artifactId>
>>>>>> maven-bundle-plugin
>>>>>> 
>>>> 
>> </artifactId>
>>>>>>> 
>>>>>> 
>>>> 
>> <extensions>
>>>>>> true
>>>>>> 
>>>> 
>> </extensions>
>>>>>>> 
>>>>>> 
>>>> 
>> <configuration>
>>>>>>> 
>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>> <obrRepository>
>>>>>> NONE
>>>>>> 
>>>> 
>> </obrRepository>
>>>>>>> 
>>>>>> 
>>>> 
>> <instructions>
>>>>>>>      <_nouses>true
>>>>>> 
>>>> 
>> </_nouses>
>>>>>>> 
>>>>>> 
>>>> 
>> <Bundle-SymbolicName>
>>>>>> ${project.artifactId}
>>>>>> 
>>>> 
>> </Bundle-SymbolicName>
>>>>>>> 
>>>>>> 
>>>> 
>> </instructions>
>>>>>>> 
>>>>>> 
>>>> 
>> </configuration>
>>>>>>> 
>>>>>>> FWIW…  I am running OSX Catalina with Java-8.
>>>>>>> 
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
>>>>> 
>>>>>> Lukas.Roedl@.ac
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> Lukas.Roedl@.ac
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> @Erwin: Thanks for testing!
>>>>>>> 
>>>>>>> I tried to reproduce and incorporated your proposed changes in
>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90 <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt>;;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt>;;;
>>>>>>> 
>>>>>>> But unfortunately I had no luck that the PreHook finally got called.
>>>>>>> 
>>>>>>> Did you also change some other things?
>>>>>>> 
>>>>>>> Best,
>>>>>>> Lukas
>>>>>>> 
>>>>>>> Von: Jean-Baptiste Onofré &lt;
>>>>> 
>>>>>> jb@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> jb@
>>>>> 
>>>>>> &gt;> 
>>>>>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>>>>>> An: 
>>>>> 
>>>>>> user@.apache
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> user@.apache
>>>>> 
>>>>>> &gt;
>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>> working
>>>>>>> 
>>>>>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>>>>>> posted. 
>>>>>>> 
>>>>>>> Regards 
>>>>>>> JB
>>>>>>> 
>>>>>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> a ?crit :
>>>>>>> Lukas,
>>>>>>> 
>>>>>>> I believe I have some success by copying configuration from my env.
>>>>>>> to
>>>>>>> the prehook test.
>>>>>>> 
>>>>>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>>>>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>>> 'aes256-ctr' not available
>>>>>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>>>>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config -
>>>>>>> 1.4.4
>>>>>>> | Obtained service dependency:
>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>>>>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>>> 'aes192-ctr' not available
>>>>>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>>> 1.4.4
>>>>>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>>> 1.4.4
>>>>>>> | Executing pre hook for DataSource prehook-test
>>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>>>>>> 
>>>>>>> I reduced the maven-bundle-plugin to:
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>> <groupId>
>>>>>> org.apache.felix
>>>>>> 
>>>> 
>> </groupId>
>>>>>>> 
>>>>>> 
>>>> 
>> <artifactId>
>>>>>> maven-bundle-plugin
>>>>>> 
>>>> 
>> </artifactId>
>>>>>>> 
>>>>>> 
>>>> 
>> <extensions>
>>>>>> true
>>>>>> 
>>>> 
>> </extensions>
>>>>>>> 
>>>>>> 
>>>> 
>> <configuration>
>>>>>>> 
>>>>> 
>>>>>>> 
>>>>>> 
>>>> 
>> <obrRepository>
>>>>>> NONE
>>>>>> 
>>>> 
>> </obrRepository>
>>>>>>> 
>>>>>> 
>>>> 
>> <instructions>
>>>>>>>      <_nouses>true
>>>>>> 
>>>> 
>> </_nouses>
>>>>>>> 
>>>>>> 
>>>> 
>> <Bundle-SymbolicName>
>>>>>> ${project.artifactId}
>>>>>> 
>>>> 
>> </Bundle-SymbolicName>
>>>>>>> 
>>>>>> 
>>>> 
>> </instructions>
>>>>>>> 
>>>>>> 
>>>> 
>> </configuration>
>>>>>>> 
>>>>>>> And I changed the component annotations to:
>>>>>>> 
>>>>>>> @Component(
>>>>>>>  // scope = ServiceScope.SINGLETON,
>>>>>>>  immediate = true,
>>>>>>>  // service = PreHook.class,
>>>>>>>  property = "name=prehook-test-hook"
>>>>>>> )
>>>>>>> public class PreHookTest implements PreHook {
>>>>>>> ?
>>>>>>> 
>>>>>>> I may have thrown away too much, but at least this is a good starting
>>>>>>> point.
>>>>>>> 
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Lukas,
>>>>>>> 
>>>>>>> I am currently on the road but I will try this ASAP. 
>>>>>>> 
>>>>>>> Kind Regards,
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
>>>>> 
>>>>>> Lukas.Roedl@.ac
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> Lukas.Roedl@.ac
>>>>> 
>>>>>> &gt;> escribi?:
>>>>>>> 
>>>>>>> ?
>>>>>>> Hi,
>>>>>>> 
>>>>>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>>>>>> I?ve prepared a minimal example on
>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt>;;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt>;;;
>>>>>>> using
>>>>>>> SQLite to
>>>>>>> make it a bit more concrete.
>>>>>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>>>>>> 
>>>>>>> The DataSource is specified in the file
>>>>>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a
>>>>>>> PreHook
>>>>>>> defined the DataSource is published as expected:
>>>>>>> 
>>>>>>> dataSourceName = prehook-test
>>>>>>> felix.fileinstall.filename =
>>>>>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>>>>>> objectClass = [javax.sql.DataSource]
>>>>>>> osgi.jdbc.driver.name = sqlite
>>>>>>> osgi.jndi.service.name = prehook-test
>>>>>>> pax.jdbc.managed = true
>>>>>>> service.bundleid = 16
>>>>>>> service.factoryPid = org.ops4j.datasource
>>>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>
>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt <http://service.id/&amp;amp;gt&amp;gt&gt>;;; = 88
>>>>>>> service.pid =
>>>>>>> org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>>>>>> service.scope = singleton
>>>>>>> url = jdbc:sqlite:prehook-test.db
>>>>>>> 
>>>>>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?)
>>>>>>> the
>>>>>>> last log entry is ?Waiting for service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>>>>>> event if the PreHook itself is started and active:
>>>>>>> 
>>>>>>> Pax JDBC - Test - PreHook (21) provides:
>>>>>>> ----------------------------------------
>>>>>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>
>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt <http://component.id/&amp;amp;gt&amp;gt&gt>;;; = 0
>>>>>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>>>>>> name = prehook-test-hook
>>>>>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>>> service.bundleid = 21
>>>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>
>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt <http://service.id/&amp;amp;gt&amp;gt&gt>;;; = 75
>>>>>>> service.scope = bundle
>>>>>>> 
>>>>>>> 
>>>>>>> Can someone which doesn?t have problems with this, please take a
>>>>>>> short
>>>>>>> look, if there are some differences between the working
>>>>>>> configurations
>>>>>>> and this example?
>>>>>>> 
>>>>>>> Best,
>>>>>>> Lukas
>>>>>>> 
>>>>>>> 
>>>>>>> [1]
>>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt>;;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt>;
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt>
>>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt>;;;
>>>>>>> 
>>>>>>> Von: Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> 
>>>>>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>>>>>> An: 
>>>>> 
>>>>>> user@.apache
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> user@.apache
>>>>> 
>>>>>> &gt;
>>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>>> working
>>>>>>> 
>>>>>>> Hi Alex,
>>>>>>> 
>>>>>>> Below a similar sequence from my log.
>>>>>>> 
>>>>>>> From your log it seems that the Derby DataSourceFactory is not
>>>>>>> resolved.
>>>>>>> I remember that at some point I changed the driver.name entry in the
>>>>>>> config to a driver.class entry. That is for a mySQL database though
>>>>>>> but
>>>>>>> but maybe?
>>>>>>> 
>>>>>>> Another silly question: Is your datasource functional if you leave
>>>>>>> out
>>>>>>> the preHook?
>>>>>>> 
>>>>>>> Obtained service dependency:
>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>> Waiting for service dependency:
>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>> Waiting for service dependency:
>>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>>> Waiting for service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>> Waiting for service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>> Obtained service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>>> Obtained service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>>>>>> Obtained service dependency:
>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>>>>>> 
>>>>>>> 
>>>>>>> Cheers, 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Yes,  the migration service is being registered:
>>>>>>> 
>>>>>>> 
>>>>>>> Obtained service dependency:
>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>> Waiting for service dependency:
>>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>>> Waiting for service dependency:
>>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>>> Obtained service dependency:
>>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>>>>>> Waiting for service dependency:
>>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>>>>>> 
>>>>>>> 
>>>>>>> And
>>>>>>> 
>>>>>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>>>>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>>> ---------------------------------
>>>>>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;
>>>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>
>>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt <http://component.id/&amp;amp;gt&amp;gt&gt>;;; = 29
>>>>>>> component.name =
>>>>>>> org.enquery.encryptedquery.querier.data.maint.Migration
>>>>>>> name = querierDB
>>>>>>> service.bundleid = 35
>>>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;
>>>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>
>>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt <http://service.id/&amp;amp;gt&amp;gt&gt>;;; = 276
>>>>>>> service.scope = bundle
>>>>>>> Provided by : 
>>>>>>> EncryptedQuery :: Querier :: Data (35)
>>>>>>> Used by: 
>>>>>>> OPS4J Pax JDBC Config (210)
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>>>>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any
>>>>>>> issues.
>>>>>>> 
>>>>>>> Stupid question, but can you confirm that the Migrator class is
>>>>>>> instantiated and that the component is active?
>>>>>>> 
>>>>>>>             com.*.Migrator in bundle 129
>>>>>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>>>>>                 Id: 18, State:ACTIVE
>>>>>>> 
>>>>>>> Initially I missed some Package-Imports on the migrator bundle which
>>>>>>> left
>>>>>>> the component in the SATISFIED (I believe) state. After scrolling
>>>>>>> through
>>>>>>> the logs I discovered a CNFE which pointed me in the right direction.
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>>>>> 
>>>>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>>>>> remains
>>>>>>> the same in my tests.  
>>>>>>> 
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Ignore the different datasource names. I messed up the ?replace all?
>>>>>>> :-)
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> erwin.hogeweg@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>>>> 
>>>>>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>> Generic Driver Extender
>>>>>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>> Config
>>>>>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>>> Pooling Support Base
>>>>>>> 
>>>>>>> [features-2-thread-1] INFO
>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>>>> [features-2-thread-1] INFO
>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>>>>> hook for DataSource jdbc/mydatasource
>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log
>>>>>>> lock
>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>>>> seegate.DATABASECHANGELOG
>>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log
>>>>>>> lock
>>>>>>> [features-2-thread-1] INFO
>>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>>>> [features-2-thread-1] INFO
>>>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>>>> DataSource
>>>>>>> for seegate.pu
>>>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>>>> 
>>>>>>> FWIW - I did change the exception handling in Migrator to better see
>>>>>>> when/if the migration fails:
>>>>>>> 
>>>>>>>  @Override
>>>>>>>  public void prepare(DataSource ds) throwsSQLException {
>>>>>>>      try (Connection connection =ds.getConnection()) {
>>>>>>>          prepare(connection);
>>>>>>>      } catch (LiquibaseException e) {
>>>>>>>                  LOG.error(e.getClass().getName() + ": " +
>>>>>>> e.getMessage());
>>>>>>> //            throw new RuntimeException(e);
>>>>>>>      }
>>>>>>>  }
>>>>>>> 
>>>>>>> 
>>>>>>> Cheers,
>>>>>>> 
>>>>>>> Erwin
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> alex.soto@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>>>>> 
>>>>>> stefan.guenst@
>>>>> 
>>>>>> &lt;mailto:
>>>>> 
>>>>>> stefan.guenst@
>>>>> 
>>>>>> &gt;> wrote:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> we are not able to run Christian's Example:
>>>>>>> 
>>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt>;
>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt>;
>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt>;
>>>>>>> 
>>>>>>> 
>>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>>> 
>>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>>> 
>>>>>>> Stefan
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt>;;
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt>;
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt>
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt>;;;
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt>;;
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi JB,

we are very interested on that material because we think a static
distribution is the only way (after many years of Experience with Karaf) to
get a robust and well defined Platform for the Enterprise .... 

Regards
Stefan 
  


jbonofre wrote
> That’s actually a great news ! It’s great to see people using static
> distribution !
> 
> By the way, we are working on new tooling to even easily create
> distribution (static or dynamic) !
> The purpose is to provide a much better dev experience.
> 
> I will prepare some materials to discuss on the mailing list (I would like
> to have something showable).
> 
> Regards
> JB
> 
>> Le 7 avr. 2020 à 13:30, stefang &lt;

> stefan.guenst@

> &gt; a écrit :
>> 
>> Hi JB,
>> 
>> thanks a lot for explaining this.
>> So we stay on 4.2.6 and waiting for 4.2.9 because static distribution is
>> urgent to us as you know.
>> 
>> Regards
>> Stefan
>> 
>> 
>> 
>> jbonofre wrote
>>> Hi Stefan,
>>> 
>>> If the problem is related to PAX JDBC in static distribution, it’s not
>>> yet
>>> fully fixed.
>>> 
>>> All the details is in the Jira: the problem is about the resolver order.
>>> When using static distribution, all features are startup features,
>>> meaning
>>> that all is evaluated at same stage. As PAX JDBC has requirements from
>>> framework, the framework should be evaluated before pax-jdbc.
>>> It’s not a problem when using pax JDBC as boot feature in dynamic
>>> distribution as startup is evaluated first and then boot features.
>>> But with static distribution, again, all is at "same level"/startup.
>>> 
>>> My plan is to add an order on startup properties to be able to address
>>> resolution order in startup.
>>> 
>>> I plan to fix that for Karaf 4.2.9.
>>> 
>>> Regards
>>> JB
>>> 
>>>> Le 7 avr. 2020 à 12:47, stefang &lt;
>> 
>>> stefan.guenst@
>> 
>>> &gt; a écrit :
>>>> 
>>>> Hi Erwin,
>>>> 
>>>> we tried it with static distribution based on 4.2.8 Release without any
>>>> luck
>>>> (4.2.6 without problems)
>>>> Anything we missed?
>>>> 
>>>> Regards 
>>>> 
>>>> Stefan 
>>>> 
>>>> 
>>>> 
>>>> Erwin Hogeweg wrote
>>>>> Hi Lukas,
>>>>> 
>>>>> Glad I could help.
>>>>> 
>>>>> Happy coding.
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
>>>> 
>>>>> Lukas.Roedl@.ac
>>>> 
>>>>> &gt; wrote:
>>>>>> 
>>>>>> Hi Erwin,
>>>>>> 
>>>>>> Thanks for your input – finally I had time to test it extensively and
>>>>>> it’s working now!!!
>>>>>> In the end the source of error was sitting in front of the PC ;-)
>>>>>> 
>>>>>> The problem was that some dependencies where embedded into the actual
>>>>>> bundle and at the same time these dependencies are also provided by
>>>>>> pax-jdbc via the feature.
>>>>>> (for details see [1])
>>>>>> 
>>>>>> So no actual problem with Pax-JDBC itself :-)
>>>>>> 
>>>>>> Thanks again!
>>>>>> 
>>>>>> Best, Lukas
>>>>>> 
>>>>>> [1]
>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;amp;gt&amp;gt&gt;;;
>>>>>> 
>>>>>> Von: Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt; 
>>>>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>>>>> An: 
>>>> 
>>>>> user@.apache
>>>> 
>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>> working
>>>>>> 
>>>>>> Lukas ,
>>>>>> 
>>>>>> It looks like you missed my pom.xml changes…Once I applied those to
>>>>>> your
>>>>>> git version it worked again. I was unable to push the change to
>>>>>> GitHub
>>>>>> so
>>>>>> here they are again.
>>>>>> 
>>>>>> I reduced the maven-bundle-plugin to:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>> 
> <groupId>
>>>>> org.apache.felix
>>>>> 
>>> 
> </groupId>
>>>>>> 
>>>>> 
>>> 
> <artifactId>
>>>>> maven-bundle-plugin
>>>>> 
>>> 
> </artifactId>
>>>>>> 
>>>>> 
>>> 
> <extensions>
>>>>> true
>>>>> 
>>> 
> </extensions>
>>>>>> 
>>>>> 
>>> 
> <configuration>
>>>>>> 
>>>> 
>>>>>> 
>>>>> 
>>> 
> <obrRepository>
>>>>> NONE
>>>>> 
>>> 
> </obrRepository>
>>>>>> 
>>>>> 
>>> 
> <instructions>
>>>>>>       <_nouses>true
>>>>> 
>>> 
> </_nouses>
>>>>>> 
>>>>> 
>>> 
> <Bundle-SymbolicName>
>>>>> ${project.artifactId}
>>>>> 
>>> 
> </Bundle-SymbolicName>
>>>>>> 
>>>>> 
>>> 
> </instructions>
>>>>>> 
>>>>> 
>>> 
> </configuration>
>>>>>> 
>>>>>> FWIW…  I am running OSX Catalina with Java-8.
>>>>>> 
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
>>>> 
>>>>> Lukas.Roedl@.ac
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> Lukas.Roedl@.ac
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> @Erwin: Thanks for testing!
>>>>>> 
>>>>>> I tried to reproduce and incorporated your proposed changes in
>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;amp;gt&amp;gt&gt;;;
>>>>>> 
>>>>>> But unfortunately I had no luck that the PreHook finally got called.
>>>>>> 
>>>>>> Did you also change some other things?
>>>>>> 
>>>>>> Best,
>>>>>> Lukas
>>>>>> 
>>>>>> Von: Jean-Baptiste Onofré &lt;
>>>> 
>>>>> jb@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> jb@
>>>> 
>>>>> &gt;> 
>>>>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>>>>> An: 
>>>> 
>>>>> user@.apache
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> user@.apache
>>>> 
>>>>> &gt;
>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>> working
>>>>>> 
>>>>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>>>>> posted. 
>>>>>> 
>>>>>> Regards 
>>>>>> JB
>>>>>> 
>>>>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> a ?crit :
>>>>>> Lukas,
>>>>>> 
>>>>>> I believe I have some success by copying configuration from my env.
>>>>>> to
>>>>>> the prehook test.
>>>>>> 
>>>>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>>>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>> 'aes256-ctr' not available
>>>>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>>>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config -
>>>>>> 1.4.4
>>>>>> | Obtained service dependency:
>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>>>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>>> 'aes192-ctr' not available
>>>>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>> 1.4.4
>>>>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>>> 1.4.4
>>>>>> | Executing pre hook for DataSource prehook-test
>>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>>>>> 
>>>>>> I reduced the maven-bundle-plugin to:
>>>>>> 
>>>>>> 
>>>>> 
>>> 
> <groupId>
>>>>> org.apache.felix
>>>>> 
>>> 
> </groupId>
>>>>>> 
>>>>> 
>>> 
> <artifactId>
>>>>> maven-bundle-plugin
>>>>> 
>>> 
> </artifactId>
>>>>>> 
>>>>> 
>>> 
> <extensions>
>>>>> true
>>>>> 
>>> 
> </extensions>
>>>>>> 
>>>>> 
>>> 
> <configuration>
>>>>>> 
>>>> 
>>>>>> 
>>>>> 
>>> 
> <obrRepository>
>>>>> NONE
>>>>> 
>>> 
> </obrRepository>
>>>>>> 
>>>>> 
>>> 
> <instructions>
>>>>>>       <_nouses>true
>>>>> 
>>> 
> </_nouses>
>>>>>> 
>>>>> 
>>> 
> <Bundle-SymbolicName>
>>>>> ${project.artifactId}
>>>>> 
>>> 
> </Bundle-SymbolicName>
>>>>>> 
>>>>> 
>>> 
> </instructions>
>>>>>> 
>>>>> 
>>> 
> </configuration>
>>>>>> 
>>>>>> And I changed the component annotations to:
>>>>>> 
>>>>>> @Component(
>>>>>>   // scope = ServiceScope.SINGLETON,
>>>>>>   immediate = true,
>>>>>>   // service = PreHook.class,
>>>>>>   property = "name=prehook-test-hook"
>>>>>> )
>>>>>> public class PreHookTest implements PreHook {
>>>>>> ?
>>>>>> 
>>>>>> I may have thrown away too much, but at least this is a good starting
>>>>>> point.
>>>>>> 
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Lukas,
>>>>>> 
>>>>>> I am currently on the road but I will try this ASAP. 
>>>>>> 
>>>>>> Kind Regards,
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
>>>> 
>>>>> Lukas.Roedl@.ac
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> Lukas.Roedl@.ac
>>>> 
>>>>> &gt;> escribi?:
>>>>>> 
>>>>>> ?
>>>>>> Hi,
>>>>>> 
>>>>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>>>>> I?ve prepared a minimal example on
>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;amp;gt&amp;gt&gt;;;
>>>>>> using
>>>>>> SQLite to
>>>>>> make it a bit more concrete.
>>>>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>>>>> 
>>>>>> The DataSource is specified in the file
>>>>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a
>>>>>> PreHook
>>>>>> defined the DataSource is published as expected:
>>>>>> 
>>>>>> dataSourceName = prehook-test
>>>>>> felix.fileinstall.filename =
>>>>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>>>>> objectClass = [javax.sql.DataSource]
>>>>>> osgi.jdbc.driver.name = sqlite
>>>>>> osgi.jndi.service.name = prehook-test
>>>>>> pax.jdbc.managed = true
>>>>>> service.bundleid = 16
>>>>>> service.factoryPid = org.ops4j.datasource
>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;; = 88
>>>>>> service.pid =
>>>>>> org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>>>>> service.scope = singleton
>>>>>> url = jdbc:sqlite:prehook-test.db
>>>>>> 
>>>>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?)
>>>>>> the
>>>>>> last log entry is ?Waiting for service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>>>>> event if the PreHook itself is started and active:
>>>>>> 
>>>>>> Pax JDBC - Test - PreHook (21) provides:
>>>>>> ----------------------------------------
>>>>>> component.id &lt;http://component.id/&gt; &lt;http://component.id/&gt
>>>>>> &lt;http://component.id/&amp;gt&gt;; &lt;http://component.id/&gt
>>>>>> &lt;http://component.id/&amp;gt&gt;
>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;; = 0
>>>>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>>>>> name = prehook-test-hook
>>>>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>> service.bundleid = 21
>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;; = 75
>>>>>> service.scope = bundle
>>>>>> 
>>>>>> 
>>>>>> Can someone which doesn?t have problems with this, please take a
>>>>>> short
>>>>>> look, if there are some differences between the working
>>>>>> configurations
>>>>>> and this example?
>>>>>> 
>>>>>> Best,
>>>>>> Lukas
>>>>>> 
>>>>>> 
>>>>>> [1]
>>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt
>>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;amp;gt&amp;gt&gt;;;
>>>>>> 
>>>>>> Von: Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> 
>>>>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>>>>> An: 
>>>> 
>>>>> user@.apache
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> user@.apache
>>>> 
>>>>> &gt;
>>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>>> working
>>>>>> 
>>>>>> Hi Alex,
>>>>>> 
>>>>>> Below a similar sequence from my log.
>>>>>> 
>>>>>> From your log it seems that the Derby DataSourceFactory is not
>>>>>> resolved.
>>>>>> I remember that at some point I changed the driver.name entry in the
>>>>>> config to a driver.class entry. That is for a mySQL database though
>>>>>> but
>>>>>> but maybe?
>>>>>> 
>>>>>> Another silly question: Is your datasource functional if you leave
>>>>>> out
>>>>>> the preHook?
>>>>>> 
>>>>>> Obtained service dependency:
>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>> Waiting for service dependency:
>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>> Waiting for service dependency:
>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>> Waiting for service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>> Waiting for service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>> Obtained service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>>> Obtained service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>>>>> Obtained service dependency:
>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>>>>> 
>>>>>> 
>>>>>> Cheers, 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Yes,  the migration service is being registered:
>>>>>> 
>>>>>> 
>>>>>> Obtained service dependency:
>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>> Waiting for service dependency:
>>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>>> Waiting for service dependency:
>>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>>> Obtained service dependency:
>>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>>>>> Waiting for service dependency:
>>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>>>>> 
>>>>>> 
>>>>>> And
>>>>>> 
>>>>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>>>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>>>>> ---------------------------------
>>>>>> component.id &lt;http://component.id/&gt; &lt;http://component.id/&gt
>>>>>> &lt;http://component.id/&amp;gt&gt;; &lt;http://component.id/&gt
>>>>>> &lt;http://component.id/&amp;gt&gt;
>>>>>> &lt;http://component.id/&amp;gt&gt
>>>>>> &lt;http://component.id/&amp;amp;gt&amp;gt&gt;;; = 29
>>>>>> component.name =
>>>>>> org.enquery.encryptedquery.querier.data.maint.Migration
>>>>>> name = querierDB
>>>>>> service.bundleid = 35
>>>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;; &lt;http://service.id/&gt
>>>>>> &lt;http://service.id/&amp;gt&gt;
>>>>>> &lt;http://service.id/&amp;gt&gt
>>>>>> &lt;http://service.id/&amp;amp;gt&amp;gt&gt;;; = 276
>>>>>> service.scope = bundle
>>>>>> Provided by : 
>>>>>> EncryptedQuery :: Querier :: Data (35)
>>>>>> Used by: 
>>>>>> OPS4J Pax JDBC Config (210)
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>>>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any
>>>>>> issues.
>>>>>> 
>>>>>> Stupid question, but can you confirm that the Migrator class is
>>>>>> instantiated and that the component is active?
>>>>>> 
>>>>>>              com.*.Migrator in bundle 129
>>>>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>>>>                  Id: 18, State:ACTIVE
>>>>>> 
>>>>>> Initially I missed some Package-Imports on the migrator bundle which
>>>>>> left
>>>>>> the component in the SATISFIED (I believe) state. After scrolling
>>>>>> through
>>>>>> the logs I discovered a CNFE which pointed me in the right direction.
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>>>> 
>>>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>>>> remains
>>>>>> the same in my tests.  
>>>>>> 
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Ignore the different datasource names. I messed up the ?replace all?
>>>>>> :-)
>>>>>> 
>>>>>> 
>>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> erwin.hogeweg@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>>> 
>>>>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>> Generic Driver Extender
>>>>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>> Config
>>>>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>>> Pooling Support Base
>>>>>> 
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>>>> hook for DataSource jdbc/mydatasource
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log
>>>>>> lock
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>>> seegate.DATABASECHANGELOG
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log
>>>>>> lock
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>>> [features-2-thread-1] INFO
>>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>>> DataSource
>>>>>> for seegate.pu
>>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>>> 
>>>>>> FWIW - I did change the exception handling in Migrator to better see
>>>>>> when/if the migration fails:
>>>>>> 
>>>>>>   @Override
>>>>>>   public void prepare(DataSource ds) throwsSQLException {
>>>>>>       try (Connection connection =ds.getConnection()) {
>>>>>>           prepare(connection);
>>>>>>       } catch (LiquibaseException e) {
>>>>>>                   LOG.error(e.getClass().getName() + ": " +
>>>>>> e.getMessage());
>>>>>> //            throw new RuntimeException(e);
>>>>>>       }
>>>>>>   }
>>>>>> 
>>>>>> 
>>>>>> Cheers,
>>>>>> 
>>>>>> Erwin
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> alex.soto@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>>>> 
>>>>> stefan.guenst@
>>>> 
>>>>> &lt;mailto:
>>>> 
>>>>> stefan.guenst@
>>>> 
>>>>> &gt;> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> we are not able to run Christian's Example:
>>>>>> 
>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>> 
>>>>>> 
>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>> 
>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>> 
>>>>>> Stefan
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;amp;gt&amp;gt&gt;;;
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
That’s actually a great news ! It’s great to see people using static distribution !

By the way, we are working on new tooling to even easily create distribution (static or dynamic) !
The purpose is to provide a much better dev experience.

I will prepare some materials to discuss on the mailing list (I would like to have something showable).

Regards
JB

> Le 7 avr. 2020 à 13:30, stefang <st...@me.com> a écrit :
> 
> Hi JB,
> 
> thanks a lot for explaining this.
> So we stay on 4.2.6 and waiting for 4.2.9 because static distribution is
> urgent to us as you know.
> 
> Regards
> Stefan
> 
> 
> 
> jbonofre wrote
>> Hi Stefan,
>> 
>> If the problem is related to PAX JDBC in static distribution, it’s not yet
>> fully fixed.
>> 
>> All the details is in the Jira: the problem is about the resolver order.
>> When using static distribution, all features are startup features, meaning
>> that all is evaluated at same stage. As PAX JDBC has requirements from
>> framework, the framework should be evaluated before pax-jdbc.
>> It’s not a problem when using pax JDBC as boot feature in dynamic
>> distribution as startup is evaluated first and then boot features.
>> But with static distribution, again, all is at "same level"/startup.
>> 
>> My plan is to add an order on startup properties to be able to address
>> resolution order in startup.
>> 
>> I plan to fix that for Karaf 4.2.9.
>> 
>> Regards
>> JB
>> 
>>> Le 7 avr. 2020 à 12:47, stefang &lt;
> 
>> stefan.guenst@
> 
>> &gt; a écrit :
>>> 
>>> Hi Erwin,
>>> 
>>> we tried it with static distribution based on 4.2.8 Release without any
>>> luck
>>> (4.2.6 without problems)
>>> Anything we missed?
>>> 
>>> Regards 
>>> 
>>> Stefan 
>>> 
>>> 
>>> 
>>> Erwin Hogeweg wrote
>>>> Hi Lukas,
>>>> 
>>>> Glad I could help.
>>>> 
>>>> Happy coding.
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
>>> 
>>>> Lukas.Roedl@.ac
>>> 
>>>> &gt; wrote:
>>>>> 
>>>>> Hi Erwin,
>>>>> 
>>>>> Thanks for your input – finally I had time to test it extensively and
>>>>> it’s working now!!!
>>>>> In the end the source of error was sitting in front of the PC ;-)
>>>>> 
>>>>> The problem was that some dependencies where embedded into the actual
>>>>> bundle and at the same time these dependencies are also provided by
>>>>> pax-jdbc via the feature.
>>>>> (for details see [1])
>>>>> 
>>>>> So no actual problem with Pax-JDBC itself :-)
>>>>> 
>>>>> Thanks again!
>>>>> 
>>>>> Best, Lukas
>>>>> 
>>>>> [1]
>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12 <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>;
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt>;;
>>>>> 
>>>>> Von: Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt; 
>>>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>>>> An: 
>>> 
>>>> user@.apache
>>> 
>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>> working
>>>>> 
>>>>> Lukas ,
>>>>> 
>>>>> It looks like you missed my pom.xml changes…Once I applied those to
>>>>> your
>>>>> git version it worked again. I was unable to push the change to GitHub
>>>>> so
>>>>> here they are again.
>>>>> 
>>>>> I reduced the maven-bundle-plugin to:
>>>>> 
>>>>> 
>>>>> 
>>>> 
>> <groupId>
>>>> org.apache.felix
>>>> 
>> </groupId>
>>>>> 
>>>> 
>> <artifactId>
>>>> maven-bundle-plugin
>>>> 
>> </artifactId>
>>>>> 
>>>> 
>> <extensions>
>>>> true
>>>> 
>> </extensions>
>>>>> 
>>>> 
>> <configuration>
>>>>> 
>>> 
>>>>> 
>>>> 
>> <obrRepository>
>>>> NONE
>>>> 
>> </obrRepository>
>>>>> 
>>>> 
>> <instructions>
>>>>>       <_nouses>true
>>>> 
>> </_nouses>
>>>>> 
>>>> 
>> <Bundle-SymbolicName>
>>>> ${project.artifactId}
>>>> 
>> </Bundle-SymbolicName>
>>>>> 
>>>> 
>> </instructions>
>>>>> 
>>>> 
>> </configuration>
>>>>> 
>>>>> FWIW…  I am running OSX Catalina with Java-8.
>>>>> 
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
>>> 
>>>> Lukas.Roedl@.ac
>>> 
>>>> &lt;mailto:
>>> 
>>>> Lukas.Roedl@.ac
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> @Erwin: Thanks for testing!
>>>>> 
>>>>> I tried to reproduce and incorporated your proposed changes in
>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90 <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>;
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt>;;
>>>>> 
>>>>> But unfortunately I had no luck that the PreHook finally got called.
>>>>> 
>>>>> Did you also change some other things?
>>>>> 
>>>>> Best,
>>>>> Lukas
>>>>> 
>>>>> Von: Jean-Baptiste Onofré &lt;
>>> 
>>>> jb@
>>> 
>>>> &lt;mailto:
>>> 
>>>> jb@
>>> 
>>>> &gt;> 
>>>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>>>> An: 
>>> 
>>>> user@.apache
>>> 
>>>> &lt;mailto:
>>> 
>>>> user@.apache
>>> 
>>>> &gt;
>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>> working
>>>>> 
>>>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>>>> posted. 
>>>>> 
>>>>> Regards 
>>>>> JB
>>>>> 
>>>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> a ?crit :
>>>>> Lukas,
>>>>> 
>>>>> I believe I have some success by copying configuration from my env. to
>>>>> the prehook test.
>>>>> 
>>>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>> 'aes256-ctr' not available
>>>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config -
>>>>> 1.4.4
>>>>> | Obtained service dependency:
>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>>> 'aes192-ctr' not available
>>>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>> 1.4.4
>>>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>>> 1.4.4
>>>>> | Executing pre hook for DataSource prehook-test
>>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>>>> 
>>>>> I reduced the maven-bundle-plugin to:
>>>>> 
>>>>> 
>>>> 
>> <groupId>
>>>> org.apache.felix
>>>> 
>> </groupId>
>>>>> 
>>>> 
>> <artifactId>
>>>> maven-bundle-plugin
>>>> 
>> </artifactId>
>>>>> 
>>>> 
>> <extensions>
>>>> true
>>>> 
>> </extensions>
>>>>> 
>>>> 
>> <configuration>
>>>>> 
>>> 
>>>>> 
>>>> 
>> <obrRepository>
>>>> NONE
>>>> 
>> </obrRepository>
>>>>> 
>>>> 
>> <instructions>
>>>>>       <_nouses>true
>>>> 
>> </_nouses>
>>>>> 
>>>> 
>> <Bundle-SymbolicName>
>>>> ${project.artifactId}
>>>> 
>> </Bundle-SymbolicName>
>>>>> 
>>>> 
>> </instructions>
>>>>> 
>>>> 
>> </configuration>
>>>>> 
>>>>> And I changed the component annotations to:
>>>>> 
>>>>> @Component(
>>>>>   // scope = ServiceScope.SINGLETON,
>>>>>   immediate = true,
>>>>>   // service = PreHook.class,
>>>>>   property = "name=prehook-test-hook"
>>>>> )
>>>>> public class PreHookTest implements PreHook {
>>>>> ?
>>>>> 
>>>>> I may have thrown away too much, but at least this is a good starting
>>>>> point.
>>>>> 
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Lukas,
>>>>> 
>>>>> I am currently on the road but I will try this ASAP. 
>>>>> 
>>>>> Kind Regards,
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
>>> 
>>>> Lukas.Roedl@.ac
>>> 
>>>> &lt;mailto:
>>> 
>>>> Lukas.Roedl@.ac
>>> 
>>>> &gt;> escribi?:
>>>>> 
>>>>> ?
>>>>> Hi,
>>>>> 
>>>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>>>> I?ve prepared a minimal example on
>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>;
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt>;; using
>>>>> SQLite to
>>>>> make it a bit more concrete.
>>>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>>>> 
>>>>> The DataSource is specified in the file
>>>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook
>>>>> defined the DataSource is published as expected:
>>>>> 
>>>>> dataSourceName = prehook-test
>>>>> felix.fileinstall.filename =
>>>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>>>> objectClass = [javax.sql.DataSource]
>>>>> osgi.jdbc.driver.name = sqlite
>>>>> osgi.jndi.service.name = prehook-test
>>>>> pax.jdbc.managed = true
>>>>> service.bundleid = 16
>>>>> service.factoryPid = org.ops4j.datasource
>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; = 88
>>>>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>>>> service.scope = singleton
>>>>> url = jdbc:sqlite:prehook-test.db
>>>>> 
>>>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the
>>>>> last log entry is ?Waiting for service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>>>> event if the PreHook itself is started and active:
>>>>> 
>>>>> Pax JDBC - Test - PreHook (21) provides:
>>>>> ----------------------------------------
>>>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;; = 0
>>>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>>>> name = prehook-test-hook
>>>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>>>> service.bundleid = 21
>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; = 75
>>>>> service.scope = bundle
>>>>> 
>>>>> 
>>>>> Can someone which doesn?t have problems with this, please take a short
>>>>> look, if there are some differences between the working configurations
>>>>> and this example?
>>>>> 
>>>>> Best,
>>>>> Lukas
>>>>> 
>>>>> 
>>>>> [1]
>>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>;
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>
>>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt>;;
>>>>> 
>>>>> Von: Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> 
>>>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>>>> An: 
>>> 
>>>> user@.apache
>>> 
>>>> &lt;mailto:
>>> 
>>>> user@.apache
>>> 
>>>> &gt;
>>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>>> working
>>>>> 
>>>>> Hi Alex,
>>>>> 
>>>>> Below a similar sequence from my log.
>>>>> 
>>>>> From your log it seems that the Derby DataSourceFactory is not
>>>>> resolved.
>>>>> I remember that at some point I changed the driver.name entry in the
>>>>> config to a driver.class entry. That is for a mySQL database though but
>>>>> but maybe?
>>>>> 
>>>>> Another silly question: Is your datasource functional if you leave out
>>>>> the preHook?
>>>>> 
>>>>> Obtained service dependency:
>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>> Waiting for service dependency:
>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>> Waiting for service dependency:
>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>> Waiting for service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>> Waiting for service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>> Obtained service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>>> Obtained service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>>>> Obtained service dependency:
>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>>>> 
>>>>> 
>>>>> Cheers, 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
>>> 
>>>> alex.soto@
>>> 
>>>> &lt;mailto:
>>> 
>>>> alex.soto@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Yes,  the migration service is being registered:
>>>>> 
>>>>> 
>>>>> Obtained service dependency:
>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>> Waiting for service dependency:
>>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>>> Waiting for service dependency:
>>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>>> Obtained service dependency:
>>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>>>> Waiting for service dependency:
>>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>>>> 
>>>>> 
>>>>> And
>>>>> 
>>>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>>>> ---------------------------------
>>>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; &lt;http://component.id/&gt <http://component.id/&gt>
>>>>> &lt;http://component.id/&amp;gt&gt <http://component.id/&amp;gt&gt>;; = 29
>>>>> component.name =
>>>>> org.enquery.encryptedquery.querier.data.maint.Migration
>>>>> name = querierDB
>>>>> service.bundleid = 35
>>>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; &lt;http://service.id/&gt <http://service.id/&gt>
>>>>> &lt;http://service.id/&amp;gt&gt <http://service.id/&amp;gt&gt>;; = 276
>>>>> service.scope = bundle
>>>>> Provided by : 
>>>>> EncryptedQuery :: Querier :: Data (35)
>>>>> Used by: 
>>>>> OPS4J Pax JDBC Config (210)
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any
>>>>> issues.
>>>>> 
>>>>> Stupid question, but can you confirm that the Migrator class is
>>>>> instantiated and that the component is active?
>>>>> 
>>>>>              com.*.Migrator in bundle 129
>>>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>>>                  Id: 18, State:ACTIVE
>>>>> 
>>>>> Initially I missed some Package-Imports on the migrator bundle which
>>>>> left
>>>>> the component in the SATISFIED (I believe) state. After scrolling
>>>>> through
>>>>> the logs I discovered a CNFE which pointed me in the right direction.
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>> 
>>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>>> 
>>>> alex.soto@
>>> 
>>>> &lt;mailto:
>>> 
>>>> alex.soto@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>>> 
>>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>>> remains
>>>>> the same in my tests.  
>>>>> 
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Ignore the different datasource names. I messed up the ?replace all?
>>>>> :-)
>>>>> 
>>>>> 
>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &lt;mailto:
>>> 
>>>> erwin.hogeweg@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>> 
>>>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>> Generic Driver Extender
>>>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>> Config
>>>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>>> Pooling Support Base
>>>>> 
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>>> hook for DataSource jdbc/mydatasource
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>> seegate.DATABASECHANGELOG
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO
>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>> DataSource
>>>>> for seegate.pu
>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>> 
>>>>> FWIW - I did change the exception handling in Migrator to better see
>>>>> when/if the migration fails:
>>>>> 
>>>>>   @Override
>>>>>   public void prepare(DataSource ds) throwsSQLException {
>>>>>       try (Connection connection =ds.getConnection()) {
>>>>>           prepare(connection);
>>>>>       } catch (LiquibaseException e) {
>>>>>                   LOG.error(e.getClass().getName() + ": " +
>>>>> e.getMessage());
>>>>> //            throw new RuntimeException(e);
>>>>>       }
>>>>>   }
>>>>> 
>>>>> 
>>>>> Cheers,
>>>>> 
>>>>> Erwin
>>>>> 
>>>>> 
>>>>> 
>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>>> 
>>>> alex.soto@
>>> 
>>>> &lt;mailto:
>>> 
>>>> alex.soto@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>>> 
>>>> stefan.guenst@
>>> 
>>>> &lt;mailto:
>>> 
>>>> stefan.guenst@
>>> 
>>>> &gt;> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> we are not able to run Christian's Example:
>>>>> 
>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>> 
>>>>> 
>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>> 
>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>> 
>>>>> Stefan
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>
>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt>;;
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi JB,

thanks a lot for explaining this.
So we stay on 4.2.6 and waiting for 4.2.9 because static distribution is
urgent to us as you know.

Regards
Stefan



jbonofre wrote
> Hi Stefan,
> 
> If the problem is related to PAX JDBC in static distribution, it’s not yet
> fully fixed.
> 
> All the details is in the Jira: the problem is about the resolver order.
> When using static distribution, all features are startup features, meaning
> that all is evaluated at same stage. As PAX JDBC has requirements from
> framework, the framework should be evaluated before pax-jdbc.
> It’s not a problem when using pax JDBC as boot feature in dynamic
> distribution as startup is evaluated first and then boot features.
> But with static distribution, again, all is at "same level"/startup.
> 
> My plan is to add an order on startup properties to be able to address
> resolution order in startup.
> 
> I plan to fix that for Karaf 4.2.9.
> 
> Regards
> JB
> 
>> Le 7 avr. 2020 à 12:47, stefang &lt;

> stefan.guenst@

> &gt; a écrit :
>> 
>> Hi Erwin,
>> 
>> we tried it with static distribution based on 4.2.8 Release without any
>> luck
>> (4.2.6 without problems)
>> Anything we missed?
>> 
>> Regards 
>> 
>> Stefan 
>> 
>> 
>> 
>> Erwin Hogeweg wrote
>>> Hi Lukas,
>>> 
>>> Glad I could help.
>>> 
>>> Happy coding.
>>> 
>>> Erwin
>>> 
>>> 
>>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
>> 
>>> Lukas.Roedl@.ac
>> 
>>> &gt; wrote:
>>>> 
>>>> Hi Erwin,
>>>> 
>>>> Thanks for your input – finally I had time to test it extensively and
>>>> it’s working now!!!
>>>> In the end the source of error was sitting in front of the PC ;-)
>>>> 
>>>> The problem was that some dependencies where embedded into the actual
>>>> bundle and at the same time these dependencies are also provided by
>>>> pax-jdbc via the feature.
>>>> (for details see [1])
>>>> 
>>>> So no actual problem with Pax-JDBC itself :-)
>>>> 
>>>> Thanks again!
>>>> 
>>>> Best, Lukas
>>>> 
>>>> [1]
>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt;
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&amp;gt&gt;;
>>>> 
>>>> Von: Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &gt; 
>>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>>> An: 
>> 
>>> user@.apache
>> 
>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>> working
>>>> 
>>>> Lukas ,
>>>> 
>>>> It looks like you missed my pom.xml changes…Once I applied those to
>>>> your
>>>> git version it worked again. I was unable to push the change to GitHub
>>>> so
>>>> here they are again.
>>>> 
>>>> I reduced the maven-bundle-plugin to:
>>>> 
>>>> 
>>>> 
>>> 
> <groupId>
>>> org.apache.felix
>>> 
> </groupId>
>>>> 
>>> 
> <artifactId>
>>> maven-bundle-plugin
>>> 
> </artifactId>
>>>> 
>>> 
> <extensions>
>>> true
>>> 
> </extensions>
>>>> 
>>> 
> <configuration>
>>>> 
>> 
>>>> 
>>> 
> <obrRepository>
>>> NONE
>>> 
> </obrRepository>
>>>> 
>>> 
> <instructions>
>>>>        <_nouses>true
>>> 
> </_nouses>
>>>> 
>>> 
> <Bundle-SymbolicName>
>>> ${project.artifactId}
>>> 
> </Bundle-SymbolicName>
>>>> 
>>> 
> </instructions>
>>>> 
>>> 
> </configuration>
>>>> 
>>>> FWIW…  I am running OSX Catalina with Java-8.
>>>> 
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
>> 
>>> Lukas.Roedl@.ac
>> 
>>> &lt;mailto:
>> 
>>> Lukas.Roedl@.ac
>> 
>>> &gt;> wrote:
>>>> 
>>>> @Erwin: Thanks for testing!
>>>> 
>>>> I tried to reproduce and incorporated your proposed changes in
>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt;
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&amp;gt&gt;;
>>>> 
>>>> But unfortunately I had no luck that the PreHook finally got called.
>>>> 
>>>> Did you also change some other things?
>>>> 
>>>> Best,
>>>> Lukas
>>>> 
>>>> Von: Jean-Baptiste Onofré &lt;
>> 
>>> jb@
>> 
>>> &lt;mailto:
>> 
>>> jb@
>> 
>>> &gt;> 
>>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>>> An: 
>> 
>>> user@.apache
>> 
>>> &lt;mailto:
>> 
>>> user@.apache
>> 
>>> &gt;
>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>> working
>>>> 
>>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>>> posted. 
>>>> 
>>>> Regards 
>>>> JB
>>>> 
>>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> a ?crit :
>>>> Lukas,
>>>> 
>>>> I believe I have some success by copying configuration from my env. to
>>>> the prehook test.
>>>> 
>>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>> 'aes256-ctr' not available
>>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config -
>>>> 1.4.4
>>>> | Obtained service dependency:
>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>>> 'aes192-ctr' not available
>>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>> 1.4.4
>>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config -
>>>> 1.4.4
>>>> | Executing pre hook for DataSource prehook-test
>>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>>> 
>>>> I reduced the maven-bundle-plugin to:
>>>> 
>>>> 
>>> 
> <groupId>
>>> org.apache.felix
>>> 
> </groupId>
>>>> 
>>> 
> <artifactId>
>>> maven-bundle-plugin
>>> 
> </artifactId>
>>>> 
>>> 
> <extensions>
>>> true
>>> 
> </extensions>
>>>> 
>>> 
> <configuration>
>>>> 
>> 
>>>> 
>>> 
> <obrRepository>
>>> NONE
>>> 
> </obrRepository>
>>>> 
>>> 
> <instructions>
>>>>        <_nouses>true
>>> 
> </_nouses>
>>>> 
>>> 
> <Bundle-SymbolicName>
>>> ${project.artifactId}
>>> 
> </Bundle-SymbolicName>
>>>> 
>>> 
> </instructions>
>>>> 
>>> 
> </configuration>
>>>> 
>>>> And I changed the component annotations to:
>>>> 
>>>>  @Component(
>>>>    // scope = ServiceScope.SINGLETON,
>>>>    immediate = true,
>>>>    // service = PreHook.class,
>>>>    property = "name=prehook-test-hook"
>>>> )
>>>> public class PreHookTest implements PreHook {
>>>> ?
>>>> 
>>>> I may have thrown away too much, but at least this is a good starting
>>>> point.
>>>> 
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Lukas,
>>>> 
>>>> I am currently on the road but I will try this ASAP. 
>>>> 
>>>> Kind Regards,
>>>> 
>>>> Erwin
>>>> 
>>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
>> 
>>> Lukas.Roedl@.ac
>> 
>>> &lt;mailto:
>> 
>>> Lukas.Roedl@.ac
>> 
>>> &gt;> escribi?:
>>>> 
>>>> ?
>>>> Hi,
>>>> 
>>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>>> I?ve prepared a minimal example on
>>>> https://github.com/roedll/pax-jdbc-pre-hook-test
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt;
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&amp;gt&gt;; using
>>>> SQLite to
>>>> make it a bit more concrete.
>>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>>> 
>>>> The DataSource is specified in the file
>>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook
>>>> defined the DataSource is published as expected:
>>>> 
>>>> dataSourceName = prehook-test
>>>> felix.fileinstall.filename =
>>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>>> objectClass = [javax.sql.DataSource]
>>>> osgi.jdbc.driver.name = sqlite
>>>> osgi.jndi.service.name = prehook-test
>>>> pax.jdbc.managed = true
>>>> service.bundleid = 16
>>>> service.factoryPid = org.ops4j.datasource
>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>> &lt;http://service.id/&amp;gt&gt;; = 88
>>>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>>> service.scope = singleton
>>>> url = jdbc:sqlite:prehook-test.db
>>>> 
>>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the
>>>> last log entry is ?Waiting for service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>>> event if the PreHook itself is started and active:
>>>> 
>>>> Pax JDBC - Test - PreHook (21) provides:
>>>> ----------------------------------------
>>>> component.id &lt;http://component.id/&gt; &lt;http://component.id/&gt
>>>> &lt;http://component.id/&amp;gt&gt;; = 0
>>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>>> name = prehook-test-hook
>>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>>> service.bundleid = 21
>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>> &lt;http://service.id/&amp;gt&gt;; = 75
>>>> service.scope = bundle
>>>> 
>>>> 
>>>> Can someone which doesn?t have problems with this, please take a short
>>>> look, if there are some differences between the working configurations
>>>> and this example?
>>>> 
>>>> Best,
>>>> Lukas
>>>> 
>>>> 
>>>> [1]
>>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt;
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt
>>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&amp;gt&gt;;
>>>> 
>>>> Von: Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> 
>>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>>> An: 
>> 
>>> user@.apache
>> 
>>> &lt;mailto:
>> 
>>> user@.apache
>> 
>>> &gt;
>>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
>>>> working
>>>> 
>>>> Hi Alex,
>>>> 
>>>> Below a similar sequence from my log.
>>>> 
>>>> From your log it seems that the Derby DataSourceFactory is not
>>>> resolved.
>>>> I remember that at some point I changed the driver.name entry in the
>>>> config to a driver.class entry. That is for a mySQL database though but
>>>> but maybe?
>>>> 
>>>> Another silly question: Is your datasource functional if you leave out
>>>> the preHook?
>>>> 
>>>> Obtained service dependency:
>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>> Waiting for service dependency:
>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>> Waiting for service dependency:
>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>> Waiting for service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>> Waiting for service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>> Obtained service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>>> Obtained service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>>> Obtained service dependency:
>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>>> 
>>>> 
>>>> Cheers, 
>>>> Erwin
>>>> 
>>>> 
>>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
>> 
>>> alex.soto@
>> 
>>> &lt;mailto:
>> 
>>> alex.soto@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Yes,  the migration service is being registered:
>>>> 
>>>> 
>>>> Obtained service dependency:
>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>> Waiting for service dependency:
>>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>>> Waiting for service dependency:
>>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>>> Obtained service dependency:
>>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>>> Waiting for service dependency:
>>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>>> 
>>>> 
>>>> And
>>>> 
>>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>>> ---------------------------------
>>>> component.id &lt;http://component.id/&gt; &lt;http://component.id/&gt
>>>> &lt;http://component.id/&amp;gt&gt;; = 29
>>>> component.name =
>>>> org.enquery.encryptedquery.querier.data.maint.Migration
>>>> name = querierDB
>>>> service.bundleid = 35
>>>> service.id &lt;http://service.id/&gt; &lt;http://service.id/&gt
>>>> &lt;http://service.id/&amp;gt&gt;; = 276
>>>> service.scope = bundle
>>>> Provided by : 
>>>> EncryptedQuery :: Querier :: Data (35)
>>>> Used by: 
>>>> OPS4J Pax JDBC Config (210)
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any
>>>> issues.
>>>> 
>>>> Stupid question, but can you confirm that the Migrator class is
>>>> instantiated and that the component is active?
>>>> 
>>>>               com.*.Migrator in bundle 129
>>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>>                   Id: 18, State:ACTIVE
>>>> 
>>>> Initially I missed some Package-Imports on the migrator bundle which
>>>> left
>>>> the component in the SATISFIED (I believe) state. After scrolling
>>>> through
>>>> the logs I discovered a CNFE which pointed me in the right direction.
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>> 
>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>> 
>>> alex.soto@
>> 
>>> &lt;mailto:
>> 
>>> alex.soto@
>> 
>>> &gt;> wrote:
>>>> 
>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>> 
>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>> remains
>>>> the same in my tests.  
>>>> 
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Ignore the different datasource names. I messed up the ?replace all?
>>>> :-)
>>>> 
>>>> 
>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>> &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>> 
>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>> 
>>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>> Generic Driver Extender
>>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>> Config
>>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>>> Pooling Support Base
>>>> 
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>> hook for DataSource jdbc/mydatasource
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>> seegate.DATABASECHANGELOG
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>> finished. Publishing DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO
>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>> DataSource
>>>> for seegate.pu
>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>> 
>>>> FWIW - I did change the exception handling in Migrator to better see
>>>> when/if the migration fails:
>>>> 
>>>>    @Override
>>>>    public void prepare(DataSource ds) throwsSQLException {
>>>>        try (Connection connection =ds.getConnection()) {
>>>>            prepare(connection);
>>>>        } catch (LiquibaseException e) {
>>>>                    LOG.error(e.getClass().getName() + ": " +
>>>> e.getMessage());
>>>> //            throw new RuntimeException(e);
>>>>        }
>>>>    }
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Erwin
>>>> 
>>>> 
>>>> 
>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>> 
>>> alex.soto@
>> 
>>> &lt;mailto:
>> 
>>> alex.soto@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>> 
>>> stefan.guenst@
>> 
>>> &lt;mailto:
>> 
>>> stefan.guenst@
>> 
>>> &gt;> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> we are not able to run Christian's Example:
>>>> 
>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>> 
>>>> 
>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>> 
>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>> 
>>>> Stefan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt
>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&amp;gt&gt;;
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi Stefan,

If the problem is related to PAX JDBC in static distribution, it’s not yet fully fixed.

All the details is in the Jira: the problem is about the resolver order. When using static distribution, all features are startup features, meaning that all is evaluated at same stage. As PAX JDBC has requirements from framework, the framework should be evaluated before pax-jdbc.
It’s not a problem when using pax JDBC as boot feature in dynamic distribution as startup is evaluated first and then boot features.
But with static distribution, again, all is at "same level"/startup.

My plan is to add an order on startup properties to be able to address resolution order in startup.

I plan to fix that for Karaf 4.2.9.

Regards
JB

> Le 7 avr. 2020 à 12:47, stefang <st...@me.com> a écrit :
> 
> Hi Erwin,
> 
> we tried it with static distribution based on 4.2.8 Release without any luck
> (4.2.6 without problems)
> Anything we missed?
> 
> Regards 
> 
> Stefan 
> 
> 
> 
> Erwin Hogeweg wrote
>> Hi Lukas,
>> 
>> Glad I could help.
>> 
>> Happy coding.
>> 
>> Erwin
>> 
>> 
>>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;
> 
>> Lukas.Roedl@.ac
> 
>> &gt; wrote:
>>> 
>>> Hi Erwin,
>>> 
>>> Thanks for your input – finally I had time to test it extensively and
>>> it’s working now!!!
>>> In the end the source of error was sitting in front of the PC ;-)
>>> 
>>> The problem was that some dependencies where embedded into the actual
>>> bundle and at the same time these dependencies are also provided by
>>> pax-jdbc via the feature.
>>> (for details see [1])
>>> 
>>> So no actual problem with Pax-JDBC itself :-)
>>> 
>>> Thanks again!
>>> 
>>> Best, Lukas
>>> 
>>> [1]
>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12 <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12>
>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt>;
>>> 
>>> Von: Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &gt; 
>>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>>> An: 
> 
>> user@.apache
> 
>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>> 
>>> Lukas ,
>>> 
>>> It looks like you missed my pom.xml changes…Once I applied those to your
>>> git version it worked again. I was unable to push the change to GitHub so
>>> here they are again.
>>> 
>>> I reduced the maven-bundle-plugin to:
>>> 
>>> 
>>> 
>> <groupId>
>> org.apache.felix
>> </groupId>
>>> 
>> <artifactId>
>> maven-bundle-plugin
>> </artifactId>
>>> 
>> <extensions>
>> true
>> </extensions>
>>> 
>> <configuration>
>>> 
> 
>>> 
>> <obrRepository>
>> NONE
>> </obrRepository>
>>> 
>> <instructions>
>>>        <_nouses>true
>> </_nouses>
>>> 
>> <Bundle-SymbolicName>
>> ${project.artifactId}
>> </Bundle-SymbolicName>
>>> 
>> </instructions>
>>> 
>> </configuration>
>>> 
>>> FWIW…  I am running OSX Catalina with Java-8.
>>> 
>>> 
>>> Erwin
>>> 
>>> 
>>> 
>>> 
>>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;
> 
>> Lukas.Roedl@.ac
> 
>> &lt;mailto:
> 
>> Lukas.Roedl@.ac
> 
>> &gt;> wrote:
>>> 
>>> @Erwin: Thanks for testing!
>>> 
>>> I tried to reproduce and incorporated your proposed changes in
>>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90 <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90>
>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt>;
>>> 
>>> But unfortunately I had no luck that the PreHook finally got called.
>>> 
>>> Did you also change some other things?
>>> 
>>> Best,
>>> Lukas
>>> 
>>> Von: Jean-Baptiste Onofré &lt;
> 
>> jb@
> 
>> &lt;mailto:
> 
>> jb@
> 
>> &gt;> 
>>> Gesendet: Dienstag, 18. Februar 2020 20:02
>>> An: 
> 
>> user@.apache
> 
>> &lt;mailto:
> 
>> user@.apache
> 
>> &gt;
>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>> 
>>> Thanks for the update. I will investigate tomorrow. I will keep you
>>> posted. 
>>> 
>>> Regards 
>>> JB
>>> 
>>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> a ?crit :
>>> Lukas,
>>> 
>>> I believe I have some success by copying configuration from my env. to
>>> the prehook test.
>>> 
>>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>> 'aes256-ctr' not available
>>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>>> | Obtained service dependency:
>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>>> 'aes192-ctr' not available
>>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>>> | Found DataSourceFactory. Creating DataSource prehook-test
>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>>> | Executing pre hook for DataSource prehook-test
>>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>> 
>>> I reduced the maven-bundle-plugin to:
>>> 
>>> 
>> <groupId>
>> org.apache.felix
>> </groupId>
>>> 
>> <artifactId>
>> maven-bundle-plugin
>> </artifactId>
>>> 
>> <extensions>
>> true
>> </extensions>
>>> 
>> <configuration>
>>> 
> 
>>> 
>> <obrRepository>
>> NONE
>> </obrRepository>
>>> 
>> <instructions>
>>>        <_nouses>true
>> </_nouses>
>>> 
>> <Bundle-SymbolicName>
>> ${project.artifactId}
>> </Bundle-SymbolicName>
>>> 
>> </instructions>
>>> 
>> </configuration>
>>> 
>>> And I changed the component annotations to:
>>> 
>>>  @Component(
>>>    // scope = ServiceScope.SINGLETON,
>>>    immediate = true,
>>>    // service = PreHook.class,
>>>    property = "name=prehook-test-hook"
>>> )
>>> public class PreHookTest implements PreHook {
>>> ?
>>> 
>>> I may have thrown away too much, but at least this is a good starting
>>> point.
>>> 
>>> 
>>> Erwin
>>> 
>>> 
>>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>> 
>>> Lukas,
>>> 
>>> I am currently on the road but I will try this ASAP. 
>>> 
>>> Kind Regards,
>>> 
>>> Erwin
>>> 
>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;
> 
>> Lukas.Roedl@.ac
> 
>> &lt;mailto:
> 
>> Lukas.Roedl@.ac
> 
>> &gt;> escribi?:
>>> 
>>> ?
>>> Hi,
>>> 
>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>>> I?ve prepared a minimal example on
>>> https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test>
>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt <https://github.com/roedll/pax-jdbc-pre-hook-test&gt>; using SQLite to
>>> make it a bit more concrete.
>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>> 
>>> The DataSource is specified in the file
>>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook
>>> defined the DataSource is published as expected:
>>> 
>>> dataSourceName = prehook-test
>>> felix.fileinstall.filename =
>>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>>> objectClass = [javax.sql.DataSource]
>>> osgi.jdbc.driver.name = sqlite
>>> osgi.jndi.service.name = prehook-test
>>> pax.jdbc.managed = true
>>> service.bundleid = 16
>>> service.factoryPid = org.ops4j.datasource
>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; = 88
>>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>>> service.scope = singleton
>>> url = jdbc:sqlite:prehook-test.db
>>> 
>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the
>>> last log entry is ?Waiting for service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>>> event if the PreHook itself is started and active:
>>> 
>>> Pax JDBC - Test - PreHook (21) provides:
>>> ----------------------------------------
>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; = 0
>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>>> name = prehook-test-hook
>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>>> service.bundleid = 21
>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; = 75
>>> service.scope = bundle
>>> 
>>> 
>>> Can someone which doesn?t have problems with this, please take a short
>>> look, if there are some differences between the working configurations
>>> and this example?
>>> 
>>> Best,
>>> Lukas
>>> 
>>> 
>>> [1]
>>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt>;
>>> 
>>> Von: Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> 
>>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>>> An: 
> 
>> user@.apache
> 
>> &lt;mailto:
> 
>> user@.apache
> 
>> &gt;
>>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>> 
>>> Hi Alex,
>>> 
>>> Below a similar sequence from my log.
>>> 
>>> From your log it seems that the Derby DataSourceFactory is not resolved.
>>> I remember that at some point I changed the driver.name entry in the
>>> config to a driver.class entry. That is for a mySQL database though but
>>> but maybe?
>>> 
>>> Another silly question: Is your datasource functional if you leave out
>>> the preHook?
>>> 
>>> Obtained service dependency:
>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>> Waiting for service dependency:
>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>> Waiting for service dependency:
>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>> Waiting for service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>> Waiting for service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>> Obtained service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>>> Obtained service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>>> Obtained service dependency:
>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>> 
>>> 
>>> Cheers, 
>>> Erwin
>>> 
>>> 
>>> On Jan 23, 2020, at 13:22, Alex Soto &lt;
> 
>> alex.soto@
> 
>> &lt;mailto:
> 
>> alex.soto@
> 
>> &gt;> wrote:
>>> 
>>> Yes,  the migration service is being registered:
>>> 
>>> 
>>> Obtained service dependency:
>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>> Waiting for service dependency:
>>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>>> Waiting for service dependency:
>>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>>> Obtained service dependency:
>>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>>> Waiting for service dependency:
>>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>> 
>>> 
>>> And
>>> 
>>> service:list org.ops4j.pax.jdbc.hook.PreHook
>>> [org.ops4j.pax.jdbc.hook.PreHook]
>>> ---------------------------------
>>> component.id <http://component.id/> &lt;http://component.id/&gt <http://component.id/&gt>; = 29
>>> component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>>> name = querierDB
>>> service.bundleid = 35
>>> service.id <http://service.id/> &lt;http://service.id/&gt <http://service.id/&gt>; = 276
>>> service.scope = bundle
>>> Provided by : 
>>> EncryptedQuery :: Querier :: Data (35)
>>> Used by: 
>>> OPS4J Pax JDBC Config (210)
>>> 
>>> Best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>> 
>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.
>>> 
>>> Stupid question, but can you confirm that the Migrator class is
>>> instantiated and that the component is active?
>>> 
>>>               com.*.Migrator in bundle 129
>>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>>                   Id: 18, State:ACTIVE
>>> 
>>> Initially I missed some Package-Imports on the migrator bundle which left
>>> the component in the SATISFIED (I believe) state. After scrolling through
>>> the logs I discovered a CNFE which pointed me in the right direction.
>>> 
>>> Erwin
>>> 
>>> 
>>> 
>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
> 
>> alex.soto@
> 
>> &lt;mailto:
> 
>> alex.soto@
> 
>> &gt;> wrote:
>>> 
>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>> 
>>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains
>>> the same in my tests.  
>>> 
>>> 
>>> Best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>> 
>>> Ignore the different datasource names. I messed up the ?replace all? :-)
>>> 
>>> 
>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>> &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>> 
>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>> 
>>> 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>> Generic Driver Extender
>>> 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>> Config
>>> 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>>> Pooling Support Base
>>> 
>>> [features-2-thread-1] INFO
>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>> [features-2-thread-1] INFO
>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>> hook for DataSource jdbc/mydatasource
>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>> [features-2-thread-1] INFO
>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>> finished. Publishing DataSource jdbc/mydatasource
>>> [features-2-thread-1] INFO
>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource
>>> for seegate.pu
>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>> 
>>> FWIW - I did change the exception handling in Migrator to better see
>>> when/if the migration fails:
>>> 
>>>    @Override
>>>    public void prepare(DataSource ds) throwsSQLException {
>>>        try (Connection connection =ds.getConnection()) {
>>>            prepare(connection);
>>>        } catch (LiquibaseException e) {
>>>                    LOG.error(e.getClass().getName() + ": " +
>>> e.getMessage());
>>> //            throw new RuntimeException(e);
>>>        }
>>>    }
>>> 
>>> 
>>> Cheers,
>>> 
>>> Erwin
>>> 
>>> 
>>> 
>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
> 
>> alex.soto@
> 
>> &lt;mailto:
> 
>> alex.soto@
> 
>> &gt;> wrote:
>>> 
>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>> 
>>> Best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
> 
>> stefan.guenst@
> 
>> &lt;mailto:
> 
>> stefan.guenst@
> 
>> &gt;> wrote:
>>> 
>>> Hi,
>>> 
>>> we are not able to run Christian's Example:
>>> 
>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>> 
>>> 
>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>> 
>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>> 
>>> Stefan
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt>;
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi Erwin,

we tried it with static distribution based on 4.2.8 Release without any luck
(4.2.6 without problems)
Anything we missed?

Regards 

Stefan 



Erwin Hogeweg wrote
> Hi Lukas,
> 
> Glad I could help.
> 
> Happy coding.
> 
> Erwin
> 
> 
>> On Mar 18, 2020, at 12:13, Roedl Lukas &lt;

> Lukas.Roedl@.ac

> &gt; wrote:
>> 
>> Hi Erwin,
>>  
>> Thanks for your input – finally I had time to test it extensively and
>> it’s working now!!!
>> In the end the source of error was sitting in front of the PC ;-)
>>  
>> The problem was that some dependencies where embedded into the actual
>> bundle and at the same time these dependencies are also provided by
>> pax-jdbc via the feature.
>> (for details see [1])
>>  
>> So no actual problem with Pax-JDBC itself :-)
>>  
>> Thanks again!
>>  
>> Best, Lukas
>>  
>> [1]
>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12
>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12&gt;
>>  
>> Von: Erwin Hogeweg &lt;

> erwin.hogeweg@

> &gt; 
>> Gesendet: Mittwoch, 19. Februar 2020 12:53
>> An: 

> user@.apache

>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>  
>> Lukas ,
>>  
>> It looks like you missed my pom.xml changes…Once I applied those to your
>> git version it worked again. I was unable to push the change to GitHub so
>> here they are again.
>>  
>> I reduced the maven-bundle-plugin to:
>> 
>> 
>>   
> <groupId>
> org.apache.felix
> </groupId>
>>     
> <artifactId>
> maven-bundle-plugin
> </artifactId>
>>     
> <extensions>
> true
> </extensions>
>>     
> <configuration>
>>       

>>       
> <obrRepository>
> NONE
> </obrRepository>
>>       
> <instructions>
>>         <_nouses>true
> </_nouses>
>>         
> <Bundle-SymbolicName>
> ${project.artifactId}
> </Bundle-SymbolicName>
>>       
> </instructions>
>>     
> </configuration>
>>  
>> FWIW…  I am running OSX Catalina with Java-8.
>> 
>> 
>> Erwin
>> 
>> 
>> 
>> 
>> On Feb 19, 2020, at 05:36, Roedl Lukas &lt;

> Lukas.Roedl@.ac

>  &lt;mailto:

> Lukas.Roedl@.ac

> &gt;> wrote:
>>  
>> @Erwin: Thanks for testing!
>>  
>> I tried to reproduce and incorporated your proposed changes in
>> https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90
>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90&gt;
>>  
>> But unfortunately I had no luck that the PreHook finally got called.
>>  
>> Did you also change some other things?
>>  
>> Best,
>> Lukas
>>  
>> Von: Jean-Baptiste Onofré &lt;

> jb@

>  &lt;mailto:

> jb@

> &gt;> 
>> Gesendet: Dienstag, 18. Februar 2020 20:02
>> An: 

> user@.apache

>  &lt;mailto:

> user@.apache

> &gt;
>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>  
>> Thanks for the update. I will investigate tomorrow. I will keep you
>> posted. 
>>  
>> Regards 
>> JB
>>  
>> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> a ?crit :
>> Lukas,
>>  
>> I believe I have some success by copying configuration from my env. to
>> the prehook test.
>>  
>> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                     
>> | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
>> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                        
>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>> 'aes256-ctr' not available
>> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 |
>> ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>> | Obtained service dependency:
>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
>> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                        
>> | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher
>> 'aes192-ctr' not available
>> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>> | Found DataSourceFactory. Creating DataSource prehook-test
>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
>> DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4
>> | Executing pre hook for DataSource prehook-test
>> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                     
>> | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>>  
>> I reduced the maven-bundle-plugin to:
>>  
>>   
> <groupId>
> org.apache.felix
> </groupId>
>>     
> <artifactId>
> maven-bundle-plugin
> </artifactId>
>>     
> <extensions>
> true
> </extensions>
>>     
> <configuration>
>>       

>>       
> <obrRepository>
> NONE
> </obrRepository>
>>       
> <instructions>
>>         <_nouses>true
> </_nouses>
>>         
> <Bundle-SymbolicName>
> ${project.artifactId}
> </Bundle-SymbolicName>
>>       
> </instructions>
>>     
> </configuration>
>>  
>> And I changed the component annotations to:
>>  
>>   @Component(
>>     // scope = ServiceScope.SINGLETON,
>>     immediate = true,
>>     // service = PreHook.class,
>>     property = "name=prehook-test-hook"
>> )
>> public class PreHookTest implements PreHook {
>> ?
>>  
>> I may have thrown away too much, but at least this is a good starting
>> point.
>>  
>>  
>> Erwin
>>  
>>  
>> On Feb 17, 2020, at 13:55, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>  
>> Lukas,
>>  
>> I am currently on the road but I will try this ASAP. 
>>  
>> Kind Regards,
>>  
>> Erwin
>>  
>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas &lt;

> Lukas.Roedl@.ac

>  &lt;mailto:

> Lukas.Roedl@.ac

> &gt;> escribi?:
>> 
>> ?
>> Hi,
>>  
>> We?ve similar problems with a Pax JDBC Pre Hook getting called.
>> I?ve prepared a minimal example on
>> https://github.com/roedll/pax-jdbc-pre-hook-test
>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test&gt; using SQLite to
>> make it a bit more concrete.
>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>  
>> The DataSource is specified in the file
>> ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook
>> defined the DataSource is published as expected:
>>  
>> dataSourceName = prehook-test
>> felix.fileinstall.filename =
>> file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>> objectClass = [javax.sql.DataSource]
>> osgi.jdbc.driver.name = sqlite
>> osgi.jndi.service.name = prehook-test
>> pax.jdbc.managed = true
>> service.bundleid = 16
>> service.factoryPid = org.ops4j.datasource
>> service.id &lt;http://service.id/&gt; = 88
>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>> service.scope = singleton
>> url = jdbc:sqlite:prehook-test.db
>>  
>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the
>> last log entry is ?Waiting for service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
>> event if the PreHook itself is started and active:
>>  
>> Pax JDBC - Test - PreHook (21) provides:
>> ----------------------------------------
>> component.id &lt;http://component.id/&gt; = 0
>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>> name = prehook-test-hook
>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>> service.bundleid = 21
>> service.id &lt;http://service.id/&gt; = 75
>> service.scope = bundle
>>  
>>  
>> Can someone which doesn?t have problems with this, please take a short
>> look, if there are some differences between the working configurations
>> and this example?
>>  
>> Best,
>> Lukas
>>  
>>  
>> [1]
>> https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg
>> &lt;https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg&gt;
>>  
>> Von: Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> 
>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>> An: 

> user@.apache

>  &lt;mailto:

> user@.apache

> &gt;
>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>  
>> Hi Alex,
>>  
>> Below a similar sequence from my log.
>>  
>> From your log it seems that the Derby DataSourceFactory is not resolved.
>> I remember that at some point I changed the driver.name entry in the
>> config to a driver.class entry. That is for a mySQL database though but
>> but maybe?
>>  
>> Another silly question: Is your datasource functional if you leave out
>> the preHook?
>>  
>> Obtained service dependency:
>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency:
>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency:
>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>> Waiting for service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Waiting for service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Obtained service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Obtained service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>> Obtained service dependency:
>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>  
>>  
>> Cheers, 
>> Erwin
>>  
>> 
>> On Jan 23, 2020, at 13:22, Alex Soto &lt;

> alex.soto@

>  &lt;mailto:

> alex.soto@

> &gt;> wrote:
>>  
>> Yes,  the migration service is being registered:
>>  
>>  
>> Obtained service dependency:
>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency:
>> (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency:
>> (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>> Obtained service dependency:
>> (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>> Waiting for service dependency:
>> (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>  
>>  
>> And
>>  
>> service:list org.ops4j.pax.jdbc.hook.PreHook
>> [org.ops4j.pax.jdbc.hook.PreHook]
>> ---------------------------------
>>  component.id &lt;http://component.id/&gt; = 29
>>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>>  name = querierDB
>>  service.bundleid = 35
>>  service.id &lt;http://service.id/&gt; = 276
>>  service.scope = bundle
>> Provided by : 
>>  EncryptedQuery :: Querier :: Data (35)
>> Used by: 
>>  OPS4J Pax JDBC Config (210)
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>>  
>> 
>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>  
>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.
>>  
>> Stupid question, but can you confirm that the Migrator class is
>> instantiated and that the component is active?
>>  
>>                com.*.Migrator in bundle 129
>> (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>                    Id: 18, State:ACTIVE
>> 
>> Initially I missed some Package-Imports on the migrator bundle which left
>> the component in the SATISFIED (I believe) state. After scrolling through
>> the logs I discovered a CNFE which pointed me in the right direction.
>>  
>> Erwin
>>  
>>  
>> 
>> On Jan 22, 2020, at 12:53, Alex Soto &lt;

> alex.soto@

>  &lt;mailto:

> alex.soto@

> &gt;> wrote:
>>  
>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>  
>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains
>> the same in my tests.  
>>  
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>>  
>> 
>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>  
>> Ignore the different datasource names. I messed up the ?replace all? :-)
>>  
>> 
>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>  
>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>  
>>  12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>> Generic Driver Extender
>>  13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>> Config
>>  14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
>> Pooling Support Base
>>  
>> [features-2-thread-1] INFO
>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO
>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>> hook for DataSource jdbc/mydatasource
>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>> [features-2-thread-1] INFO
>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>> finished. Publishing DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO
>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource
>> for seegate.pu
>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>> 
>> FWIW - I did change the exception handling in Migrator to better see
>> when/if the migration fails:
>>  
>>     @Override
>>     public void prepare(DataSource ds) throwsSQLException {
>>         try (Connection connection =ds.getConnection()) {
>>             prepare(connection);
>>         } catch (LiquibaseException e) {
>>                     LOG.error(e.getClass().getName() + ": " +
>> e.getMessage());
>> //            throw new RuntimeException(e);
>>         }
>>     }
>>  
>>  
>> Cheers,
>>  
>> Erwin
>> 
>> 
>> 
>> On Jan 22, 2020, at 11:11, Alex Soto &lt;

> alex.soto@

>  &lt;mailto:

> alex.soto@

> &gt;> wrote:
>>  
>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>>  
>> 
>> On Jan 20, 2020, at 9:10 AM, stefang &lt;

> stefan.guenst@

>  &lt;mailto:

> stefan.guenst@

> &gt;> wrote:
>>  
>> Hi,
>> 
>> we are not able to run Christian's Example:
>> 
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>> 
>> 
>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>> 
>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>> 
>> Stefan
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Hi Lukas,

Glad I could help.

Happy coding.

Erwin


> On Mar 18, 2020, at 12:13, Roedl Lukas <Lu...@ait.ac.at> wrote:
> 
> Hi Erwin,
>  
> Thanks for your input – finally I had time to test it extensively and it’s working now!!!
> In the end the source of error was sitting in front of the PC ;-)
>  
> The problem was that some dependencies where embedded into the actual bundle and at the same time these dependencies are also provided by pax-jdbc via the feature.
> (for details see [1])
>  
> So no actual problem with Pax-JDBC itself :-)
>  
> Thanks again!
>  
> Best, Lukas
>  
> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12 <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12>
>  
> Von: Erwin Hogeweg <er...@me.com> 
> Gesendet: Mittwoch, 19. Februar 2020 12:53
> An: user@karaf.apache.org
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Lukas ,
>  
> It looks like you missed my pom.xml changes…Once I applied those to your git version it worked again. I was unable to push the change to GitHub so here they are again.
>  
> I reduced the maven-bundle-plugin to:
> 
> 
>   <groupId>org.apache.felix</groupId>
>     <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <!-- Do not generate that OBR file in the local maven cache -->
>       <obrRepository>NONE</obrRepository>
>       <instructions>
>         <_nouses>true</_nouses>
>         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>       </instructions>
>     </configuration>
>  
> FWIW…  I am running OSX Catalina with Java-8.
> 
> 
> Erwin
> 
> 
> 
> 
> On Feb 19, 2020, at 05:36, Roedl Lukas <Lukas.Roedl@ait.ac.at <ma...@ait.ac.at>> wrote:
>  
> @Erwin: Thanks for testing!
>  
> I tried to reproduce and incorporated your proposed changes in https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90 <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90>
>  
> But unfortunately I had no luck that the PreHook finally got called.
>  
> Did you also change some other things?
>  
> Best,
> Lukas
>  
> Von: Jean-Baptiste Onofré <jb@nanthrax.net <ma...@nanthrax.net>> 
> Gesendet: Dienstag, 18. Februar 2020 20:02
> An: user@karaf.apache.org <ma...@karaf.apache.org>
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Thanks for the update. I will investigate tomorrow. I will keep you posted. 
>  
> Regards 
> JB
>  
> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> a ?crit :
> Lukas,
>  
> I believe I have some success by copying configuration from my env. to the prehook test.
>  
> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not available
> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not available
> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Found DataSourceFactory. Creating DataSource prehook-test
> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Executing pre hook for DataSource prehook-test
> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>  
> I reduced the maven-bundle-plugin to:
>  
>   <groupId>org.apache.felix</groupId>
>     <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <!-- Do not generate that OBR file in the local maven cache -->
>       <obrRepository>NONE</obrRepository>
>       <instructions>
>         <_nouses>true</_nouses>
>         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>       </instructions>
>     </configuration>
>  
> And I changed the component annotations to:
>  
>   @Component(
>     // scope = ServiceScope.SINGLETON,
>     immediate = true,
>     // service = PreHook.class,
>     property = "name=prehook-test-hook"
> )
> public class PreHookTest implements PreHook {
> ?
>  
> I may have thrown away too much, but at least this is a good starting point.
>  
>  
> Erwin
>  
>  
> On Feb 17, 2020, at 13:55, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Lukas,
>  
> I am currently on the road but I will try this ASAP. 
>  
> Kind Regards,
>  
> Erwin
>  
> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lukas.Roedl@ait.ac.at <ma...@ait.ac.at>> escribi?:
> 
> ?
> Hi,
>  
> We?ve similar problems with a Pax JDBC Pre Hook getting called.
> I?ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test> using SQLite to make it a bit more concrete.
> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>  
> The DataSource is specified in the file ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook defined the DataSource is published as expected:
>  
> dataSourceName = prehook-test
> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
> objectClass = [javax.sql.DataSource]
> osgi.jdbc.driver.name = sqlite
> osgi.jndi.service.name = prehook-test
> pax.jdbc.managed = true
> service.bundleid = 16
> service.factoryPid = org.ops4j.datasource
> service.id <http://service.id/> = 88
> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
> service.scope = singleton
> url = jdbc:sqlite:prehook-test.db
>  
> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the last log entry is ?Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))? event if the PreHook itself is started and active:
>  
> Pax JDBC - Test - PreHook (21) provides:
> ----------------------------------------
> component.id <http://component.id/> = 0
> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
> name = prehook-test-hook
> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
> service.bundleid = 21
> service.id <http://service.id/> = 75
> service.scope = bundle
>  
>  
> Can someone which doesn?t have problems with this, please take a short look, if there are some differences between the working configurations and this example?
>  
> Best,
> Lukas
>  
>  
> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>  
> Von: Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> 
> Gesendet: Donnerstag, 23. Januar 2020 22:40
> An: user@karaf.apache.org <ma...@karaf.apache.org>
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Hi Alex,
>  
> Below a similar sequence from my log.
>  
> From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe?
>  
> Another silly question: Is your datasource functional if you leave out the preHook?
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
> Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>  
>  
> Cheers, 
> Erwin
>  
> 
> On Jan 23, 2020, at 13:22, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Yes,  the migration service is being registered:
>  
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>  
>  
> And
>  
> service:list org.ops4j.pax.jdbc.hook.PreHook
> [org.ops4j.pax.jdbc.hook.PreHook]
> ---------------------------------
>  component.id <http://component.id/> = 29
>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>  name = querierDB
>  service.bundleid = 35
>  service.id <http://service.id/> = 276
>  service.scope = bundle
> Provided by : 
>  EncryptedQuery :: Querier :: Data (35)
> Used by: 
>  OPS4J Pax JDBC Config (210)
>  
> Best regards,
> Alex soto
> 
> 
> 
>  
> 
> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.
>  
> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>  
>                com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>                    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>  
> Erwin
>  
>  
> 
> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
> The hook is not being called stating with Pax-JDBC 1.3.4.
>  
> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>  
>  
> Best regards,
> Alex soto
> 
> 
> 
>  
> 
> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Ignore the different datasource names. I messed up the ?replace all? :-)
>  
> 
> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>  
>  12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Generic Driver Extender
>  13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Config
>  14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Pooling Support Base
>  
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
> 
> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>  
>     @Override
>     public void prepare(DataSource ds) throwsSQLException {
>         try (Connection connection =ds.getConnection()) {
>             prepare(connection);
>         } catch (LiquibaseException e) {
>                     LOG.error(e.getClass().getName() + ": " + e.getMessage());
> //            throw new RuntimeException(e);
>         }
>     }
>  
>  
> Cheers,
>  
> Erwin
> 
> 
> 
> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>  
> Best regards,
> Alex soto
> 
> 
> 
>  
> 
> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>  
> Hi,
> 
> we are not able to run Christian's Example:
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
> 
> 
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
> 
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
> 
> Stefan
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

AW: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Roedl Lukas <Lu...@ait.ac.at>.
Hi Erwin,

Thanks for your input – finally I had time to test it extensively and it’s working now!!!
In the end the source of error was sitting in front of the PC ;-)

The problem was that some dependencies where embedded into the actual bundle and at the same time these dependencies are also provided by pax-jdbc via the feature.
(for details see [1])

So no actual problem with Pax-JDBC itself :-)

Thanks again!

Best, Lukas

[1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/bundle-headers.diff#L10-L12

Von: Erwin Hogeweg <er...@me.com>
Gesendet: Mittwoch, 19. Februar 2020 12:53
An: user@karaf.apache.org
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Lukas ,

It looks like you missed my pom.xml changes…Once I applied those to your git version it worked again. I was unable to push the change to GitHub so here they are again.

I reduced the maven-bundle-plugin to:


  <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <!-- Do not generate that OBR file in the local maven cache -->
      <obrRepository>NONE</obrRepository>
      <instructions>
        <_nouses>true</_nouses>
        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
      </instructions>
    </configuration>

FWIW…  I am running OSX Catalina with Java-8.


Erwin




On Feb 19, 2020, at 05:36, Roedl Lukas <Lu...@ait.ac.at>> wrote:

@Erwin: Thanks for testing!

I tried to reproduce and incorporated your proposed changes in https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90

But unfortunately I had no luck that the PreHook finally got called.

Did you also change some other things?

Best,
Lukas

Von: Jean-Baptiste Onofré <jb...@nanthrax.net>>
Gesendet: Dienstag, 18. Februar 2020 20:02
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Thanks for the update. I will investigate tomorrow. I will keep you posted.

Regards
JB

Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg <er...@me.com>> a ?crit :
Lukas,

I believe I have some success by copying configuration from my env. to the prehook test.

2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not available
2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not available
2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Found DataSourceFactory. Creating DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Executing pre hook for DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?

I reduced the maven-bundle-plugin to:

  <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <!-- Do not generate that OBR file in the local maven cache -->
      <obrRepository>NONE</obrRepository>
      <instructions>
        <_nouses>true</_nouses>
        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
      </instructions>
    </configuration>

And I changed the component annotations to:

  @Component(
    // scope = ServiceScope.SINGLETON,
    immediate = true,
    // service = PreHook.class,
    property = "name=prehook-test-hook"
)
public class PreHookTest implements PreHook {
?

I may have thrown away too much, but at least this is a good starting point.


Erwin


On Feb 17, 2020, at 13:55, Erwin Hogeweg <er...@me.com>> wrote:

Lukas,

I am currently on the road but I will try this ASAP.

Kind Regards,

Erwin

El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lu...@ait.ac.at>> escribi?:
?
Hi,

We?ve similar problems with a Pax JDBC Pre Hook getting called.
I?ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test using SQLite to make it a bit more concrete.
Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.

The DataSource is specified in the file ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook defined the DataSource is published as expected:

dataSourceName = prehook-test
felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
objectClass = [javax.sql.DataSource]
osgi.jdbc.driver.name = sqlite
osgi.jndi.service.name = prehook-test
pax.jdbc.managed = true
service.bundleid = 16
service.factoryPid = org.ops4j.datasource
service.id<http://service.id/> = 88
service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
service.scope = singleton
url = jdbc:sqlite:prehook-test.db

With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the last log entry is ?Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))? event if the PreHook itself is started and active:

Pax JDBC - Test - PreHook (21) provides:
----------------------------------------
component.id<http://component.id/> = 0
component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
name = prehook-test-hook
objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
service.bundleid = 21
service.id<http://service.id/> = 75
service.scope = bundle


Can someone which doesn?t have problems with this, please take a short look, if there are some differences between the working configurations and this example?

Best,
Lukas


[1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg

Von: Erwin Hogeweg <er...@me.com>>
Gesendet: Donnerstag, 23. Januar 2020 22:40
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Hi Alex,

Below a similar sequence from my log.

From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe?

Another silly question: Is your datasource functional if you leave out the preHook?

Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))


Cheers,
Erwin

On Jan 23, 2020, at 13:22, Alex Soto <al...@envieta.com>> wrote:

Yes,  the migration service is being registered:


Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))


And

service:list org.ops4j.pax.jdbc.hook.PreHook
[org.ops4j.pax.jdbc.hook.PreHook]
---------------------------------
 component.id<http://component.id/> = 29
 component.name = org.enquery.encryptedquery.querier.data.maint.Migration
 name = querierDB
 service.bundleid = 35
 service.id<http://service.id/> = 276
 service.scope = bundle
Provided by :
 EncryptedQuery :: Querier :: Data (35)
Used by:
 OPS4J Pax JDBC Config (210)

Best regards,
Alex soto



On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <er...@me.com>> wrote:

Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.

Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?

               com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
                   Id: 18, State:ACTIVE

Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.

Erwin


On Jan 22, 2020, at 12:53, Alex Soto <al...@envieta.com>> wrote:

I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
The hook is not being called stating with Pax-JDBC 1.3.4.

Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.


Best regards,
Alex soto



On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <er...@me.com>> wrote:

Ignore the different datasource names. I messed up the ?replace all? :-)

On Jan 22, 2020, at 12:36, Erwin Hogeweg <er...@me.com>> wrote:

It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.

 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Generic Driver Extender
 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Config
 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Pooling Support Base

[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)

FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:

    @Override
    public void prepare(DataSource ds) throwsSQLException {
        try (Connection connection =ds.getConnection()) {
            prepare(connection);
        } catch (LiquibaseException e) {
                    LOG.error(e.getClass().getName() + ": " + e.getMessage());
//            throw new RuntimeException(e);
        }
    }


Cheers,

Erwin


On Jan 22, 2020, at 11:11, Alex Soto <al...@envieta.com>> wrote:

Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.

Best regards,
Alex soto



On Jan 20, 2020, at 9:10 AM, stefang <st...@me.com>> wrote:

Hi,

we are not able to run Christian's Example:

https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java


Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)

Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.

Stefan





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Lukas ,

It looks like you missed my pom.xml changes…Once I applied those to your git version it worked again. I was unable to push the change to GitHub so here they are again.

> I reduced the maven-bundle-plugin to:
> 
>   <groupId>org.apache.felix</groupId>
>     <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <!-- Do not generate that OBR file in the local maven cache -->
>       <obrRepository>NONE</obrRepository>
>       <instructions>
>         <_nouses>true</_nouses>
>         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>       </instructions>
>     </configuration>

FWIW…  I am running OSX Catalina with Java-8.

Erwin


> On Feb 19, 2020, at 05:36, Roedl Lukas <Lu...@ait.ac.at> wrote:
> 
> @Erwin: Thanks for testing!
>  
> I tried to reproduce and incorporated your proposed changes in https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90 <https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90>
>  
> But unfortunately I had no luck that the PreHook finally got called.
>  
> Did you also change some other things?
>  
> Best,
> Lukas
>  
> Von: Jean-Baptiste Onofré <jb@nanthrax.net <ma...@nanthrax.net>> 
> Gesendet: Dienstag, 18. Februar 2020 20:02
> An: user@karaf.apache.org <ma...@karaf.apache.org>
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Thanks for the update. I will investigate tomorrow. I will keep you posted. 
>  
> Regards 
> JB
>  
> Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> a ?crit :
> Lukas,
>  
> I believe I have some success by copying configuration from my env. to the prehook test.
>  
> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not available
> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not available
> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Found DataSourceFactory. Creating DataSource prehook-test
> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Executing pre hook for DataSource prehook-test
> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?
>  
> I reduced the maven-bundle-plugin to:
>  
>   <groupId>org.apache.felix</groupId>
>     <artifactId>maven-bundle-plugin</artifactId>
>     <extensions>true</extensions>
>     <configuration>
>       <!-- Do not generate that OBR file in the local maven cache -->
>       <obrRepository>NONE</obrRepository>
>       <instructions>
>         <_nouses>true</_nouses>
>         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
>       </instructions>
>     </configuration>
>  
> And I changed the component annotations to:
>  
>   @Component(
>     // scope = ServiceScope.SINGLETON,
>     immediate = true,
>     // service = PreHook.class,
>     property = "name=prehook-test-hook"
> )
> public class PreHookTest implements PreHook {
> ?
>  
> I may have thrown away too much, but at least this is a good starting point.
>  
>  
> Erwin
>  
>  
> On Feb 17, 2020, at 13:55, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Lukas,
>  
> I am currently on the road but I will try this ASAP. 
>  
> Kind Regards,
>  
> Erwin
>  
> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lukas.Roedl@ait.ac.at <ma...@ait.ac.at>> escribi?:
> 
> ?
> Hi,
>  
> We?ve similar problems with a Pax JDBC Pre Hook getting called.
> I?ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test> using SQLite to make it a bit more concrete.
> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>  
> The DataSource is specified in the file ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook defined the DataSource is published as expected:
>  
> dataSourceName = prehook-test
> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
> objectClass = [javax.sql.DataSource]
> osgi.jdbc.driver.name = sqlite
> osgi.jndi.service.name = prehook-test
> pax.jdbc.managed = true
> service.bundleid = 16
> service.factoryPid = org.ops4j.datasource
> service.id <http://service.id/> = 88
> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
> service.scope = singleton
> url = jdbc:sqlite:prehook-test.db
>  
> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the last log entry is ?Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))? event if the PreHook itself is started and active:
>  
> Pax JDBC - Test - PreHook (21) provides:
> ----------------------------------------
> component.id <http://component.id/> = 0
> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
> name = prehook-test-hook
> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
> service.bundleid = 21
> service.id <http://service.id/> = 75
> service.scope = bundle
>  
>  
> Can someone which doesn?t have problems with this, please take a short look, if there are some differences between the working configurations and this example?
>  
> Best,
> Lukas
>  
>  
> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>  
> Von: Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> 
> Gesendet: Donnerstag, 23. Januar 2020 22:40
> An: user@karaf.apache.org <ma...@karaf.apache.org>
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Hi Alex,
>  
> Below a similar sequence from my log.
>  
> From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe?
>  
> Another silly question: Is your datasource functional if you leave out the preHook?
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
> Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>  
>  
> Cheers, 
> Erwin
>  
> 
> On Jan 23, 2020, at 13:22, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Yes,  the migration service is being registered:
>  
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>  
>  
> And
>  
> service:list org.ops4j.pax.jdbc.hook.PreHook
> [org.ops4j.pax.jdbc.hook.PreHook]
> ---------------------------------
>  component.id <http://component.id/> = 29
>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>  name = querierDB
>  service.bundleid = 35
>  service.id <http://service.id/> = 276
>  service.scope = bundle
> Provided by : 
>  EncryptedQuery :: Querier :: Data (35)
> Used by: 
>  OPS4J Pax JDBC Config (210)
>  
> Best regards,
> Alex soto
> 
> 
>  
> 
> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.
>  
> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>  
>                com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>                    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>  
> Erwin
>  
>  
> 
> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
> The hook is not being called stating with Pax-JDBC 1.3.4.
>  
> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>  
>  
> Best regards,
> Alex soto
> 
> 
>  
> 
> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Ignore the different datasource names. I messed up the ?replace all? :-)
>  
> 
> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>  
>  12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Generic Driver Extender
>  13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Config
>  14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Pooling Support Base
>  
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
> 
> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>  
>     @Override
>     public void prepare(DataSource ds) throwsSQLException {
>         try (Connection connection =ds.getConnection()) {
>             prepare(connection);
>         } catch (LiquibaseException e) {
>                     LOG.error(e.getClass().getName() + ": " + e.getMessage());
> //            throw new RuntimeException(e);
>         }
>     }
>  
>  
> Cheers,
>  
> Erwin
> 
> 
> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>  
> Best regards,
> Alex soto
> 
> 
>  
> 
> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>  
> Hi,
> 
> we are not able to run Christian's Example:
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
> 
> 
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
> 
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
> 
> Stefan
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

AW: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Roedl Lukas <Lu...@ait.ac.at>.
@Erwin: Thanks for testing!

I tried to reproduce and incorporated your proposed changes in https://github.com/roedll/pax-jdbc-pre-hook-test/commit/1a427187148461da564326ceae36622c5f943e90

But unfortunately I had no luck that the PreHook finally got called.

Did you also change some other things?

Best,
Lukas

Von: Jean-Baptiste Onofré <jb...@nanthrax.net>
Gesendet: Dienstag, 18. Februar 2020 20:02
An: user@karaf.apache.org
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Thanks for the update. I will investigate tomorrow. I will keep you posted.

Regards
JB

Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg <er...@me.com>> a ?crit :
Lukas,

I believe I have some success by copying configuration from my env. to the prehook test.

2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not available
2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not available
2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Found DataSourceFactory. Creating DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Executing pre hook for DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?

I reduced the maven-bundle-plugin to:

  <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <!-- Do not generate that OBR file in the local maven cache -->
      <obrRepository>NONE</obrRepository>
      <instructions>
        <_nouses>true</_nouses>
        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
      </instructions>
    </configuration>

And I changed the component annotations to:

  @Component(
    // scope = ServiceScope.SINGLETON,
    immediate = true,
    // service = PreHook.class,
    property = "name=prehook-test-hook"
)
public class PreHookTest implements PreHook {
?

I may have thrown away too much, but at least this is a good starting point.


Erwin


On Feb 17, 2020, at 13:55, Erwin Hogeweg <er...@me.com>> wrote:

Lukas,

I am currently on the road but I will try this ASAP.

Kind Regards,

Erwin

El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lu...@ait.ac.at>> escribi?:
?
Hi,

We?ve similar problems with a Pax JDBC Pre Hook getting called.
I?ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test using SQLite to make it a bit more concrete.
Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.

The DataSource is specified in the file ?org.ops4j.datasource-prehook-test.cfg? (see [1]) and without a PreHook defined the DataSource is published as expected:

dataSourceName = prehook-test
felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
objectClass = [javax.sql.DataSource]
osgi.jdbc.driver.name = sqlite
osgi.jndi.service.name = prehook-test
pax.jdbc.managed = true
service.bundleid = 16
service.factoryPid = org.ops4j.datasource
service.id<http://service.id/> = 88
service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
service.scope = singleton
url = jdbc:sqlite:prehook-test.db

With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the last log entry is ?Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))? event if the PreHook itself is started and active:

Pax JDBC - Test - PreHook (21) provides:
----------------------------------------
component.id<http://component.id/> = 0
component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
name = prehook-test-hook
objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
service.bundleid = 21
service.id<http://service.id/> = 75
service.scope = bundle


Can someone which doesn?t have problems with this, please take a short look, if there are some differences between the working configurations and this example?

Best,
Lukas


[1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg

Von: Erwin Hogeweg <er...@me.com>>
Gesendet: Donnerstag, 23. Januar 2020 22:40
An: user@karaf.apache.org<ma...@karaf.apache.org>
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Hi Alex,

Below a similar sequence from my log.

From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe?

Another silly question: Is your datasource functional if you leave out the preHook?

Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))


Cheers,
Erwin

On Jan 23, 2020, at 13:22, Alex Soto <al...@envieta.com>> wrote:

Yes,  the migration service is being registered:


Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))


And

service:list org.ops4j.pax.jdbc.hook.PreHook
[org.ops4j.pax.jdbc.hook.PreHook]
---------------------------------
 component.id<http://component.id/> = 29
 component.name = org.enquery.encryptedquery.querier.data.maint.Migration
 name = querierDB
 service.bundleid = 35
 service.id<http://service.id/> = 276
 service.scope = bundle
Provided by :
 EncryptedQuery :: Querier :: Data (35)
Used by:
 OPS4J Pax JDBC Config (210)


Best regards,
Alex soto


On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <er...@me.com>> wrote:

Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.

Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?

               com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
                   Id: 18, State:ACTIVE

Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.

Erwin


On Jan 22, 2020, at 12:53, Alex Soto <al...@envieta.com>> wrote:

I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
The hook is not being called stating with Pax-JDBC 1.3.4.

Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.



Best regards,
Alex soto


On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <er...@me.com>> wrote:

Ignore the different datasource names. I messed up the ?replace all? :-)

On Jan 22, 2020, at 12:36, Erwin Hogeweg <er...@me.com>> wrote:

It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.

 12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Generic Driver Extender
 13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Config
 14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Pooling Support Base

[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)

FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:

    @Override
    public void prepare(DataSource ds) throwsSQLException {
        try (Connection connection =ds.getConnection()) {
            prepare(connection);
        } catch (LiquibaseException e) {
                    LOG.error(e.getClass().getName() + ": " + e.getMessage());
//            throw new RuntimeException(e);
        }
    }


Cheers,

Erwin

On Jan 22, 2020, at 11:11, Alex Soto <al...@envieta.com>> wrote:

Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.


Best regards,
Alex soto


On Jan 20, 2020, at 9:10 AM, stefang <st...@me.com>> wrote:

Hi,

we are not able to run Christian's Example:

https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java


Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)

Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.

Stefan





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update. I will investigate tomorrow. I will keep you posted.

  

Regards

JB

  

Le mar. 18 f?vr. 2020 ? 17:01, Erwin Hogeweg <er...@me.com> a ?crit :  

> Lukas,

>

>  
>

>

> I believe I have some success by copying configuration from my env. to the
prehook test.

>

>  
>

>

> 2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest
| 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...

>

> 2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils
| 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not
available

>

> 2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper
| 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency:
(&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))

>

> 2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils
| 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not
available

>

> 2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 |
DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 |
Found DataSourceFactory. Creating DataSource prehook-test

>

> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 |
DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 |
Executing pre hook for DataSource prehook-test

>

> 2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest
| 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() ?

>

>  
>

>

> I reduced the maven-bundle-plugin to:

>

>  
>

>

>   <groupId>org.apache.felix</groupId>

>

>     <artifactId>maven-bundle-plugin</artifactId>

>

>     <extensions>true</extensions>

>

>     <configuration>

>

>       <!-- Do not generate that OBR file in the local maven cache -->

>

>       <obrRepository>NONE</obrRepository>

>

>       <instructions>

>

>         <_nouses>true</_nouses>

>

>         <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

>

>       </instructions>

>

>     </configuration>

>

>  
>

>

> And I changed the component annotations to:

>

>  
>

>

>   @Component(

>

>     // scope = ServiceScope.SINGLETON,

>

>     immediate = true,

>

>     // service = PreHook.class,

>

>     property = "name=prehook-test-hook"

>

> )

>

> public class PreHookTest implements PreHook {

>

> ?

>

>  
>

>

> I may have thrown away too much, but at least this is a good starting point.

>

>  
>

>

>  
>

>

> Erwin

>

>  
>

>

>  
>

>

>> On Feb 17, 2020, at 13:55, Erwin Hogeweg
<[erwin.hogeweg@me.com](mailto:erwin.hogeweg@me.com)> wrote:

>>

>>  
>

>>

>> Lukas,

>>

>>  
>

>>

>> I am currently on the road but I will try this ASAP.  
>

>>

>>  
>

>>

>> Kind Regards,

>>

>>  
>

>>

>> Erwin

>>

>>  
>

>>

>>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas
<[Lukas.Roedl@ait.ac.at](mailto:Lukas.Roedl@ait.ac.at)> escribi?:  
>  
>

>>

>>> ?

>>>

>>> Hi,

>>>

>>>  
>>>

>>> We?ve similar problems with a Pax JDBC Pre Hook getting called.

>>>

>>> I?ve prepared a minimal example on [https://github.com/roedll/pax-jdbc-
pre-hook-test](https://github.com/roedll/pax-jdbc-pre-hook-test) using SQLite
to make it a bit more concrete.

>>>

>>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.

>>>

>>>  
>>>

>>> The DataSource is specified in the file ?org.ops4j.datasource-prehook-
test.cfg? (see [1]) and without a PreHook defined the DataSource is published
as expected:

>>>

>>>  
>>>

>>> dataSourceName = prehook-test

>>>

>>> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-
test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg

>>>

>>> objectClass = [javax.sql.DataSource]

>>>

>>> osgi.jdbc.driver.name = sqlite

>>>

>>> osgi.jndi.service.name = prehook-test

>>>

>>> pax.jdbc.managed = true

>>>

>>> service.bundleid = 16

>>>

>>> service.factoryPid = org.ops4j.datasource

>>>

>>> [service.id](http://service.id/) = 88

>>>

>>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda

>>>

>>> service.scope = singleton

>>>

>>> url = jdbc:sqlite:prehook-test.db

>>>

>>>  
>>>

>>> With the PreHook specified (like ?ops4j.preHook=prehook-test-hook?) the
last log entry is ?Waiting for service dependency:
(&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))?
event if the PreHook itself is started and active:

>>>

>>>  
>>>

>>> Pax JDBC - Test - PreHook (21) provides:

>>>

>>> \--------------------------------\--------

>>>

>>> [component.id](http://component.id/) = 0

>>>

>>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest

>>>

>>> name = prehook-test-hook

>>>

>>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]

>>>

>>> service.bundleid = 21

>>>

>>> [service.id](http://service.id/) = 75

>>>

>>> service.scope = bundle

>>>

>>>  
>>>

>>>  
>>>

>>> Can someone which doesn?t have problems with this, please take a short
look, if there are some differences between the working configurations and
this example?

>>>

>>>  
>>>

>>> Best,

>>>

>>> Lukas

>>>

>>>  
>>>

>>>  
>>>

>>> [1] [https://github.com/roedll/pax-jdbc-pre-hook-
test/blob/master/framework/src/main/filtered-
resources/etc/org.ops4j.datasource-prehook-
test.cfg](https://github.com/roedll/pax-jdbc-pre-hook-
test/blob/master/framework/src/main/filtered-
resources/etc/org.ops4j.datasource-prehook-test.cfg)

>>>

>>>  
>>>

>>>  **Von:**  Erwin Hogeweg
<[erwin.hogeweg@me.com](mailto:erwin.hogeweg@me.com)>  
>  **Gesendet:**  Donnerstag, 23. Januar 2020 22:40  
>  **An:**  [user@karaf.apache.org](mailto:user@karaf.apache.org)  
>  **Betreff:**  Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not
working

>>>

>>>  
>>>

>>> Hi Alex,

>>>

>>>  
>>>

>>> Below a similar sequence from my log.

>>>

>>>  
>>>

>>> From your log it seems that the Derby DataSourceFactory is not resolved. I
remember that at some point I changed the driver.name entry in the config to a
driver.class entry. That is for a mySQL database though but but maybe?

>>>

>>>  
>>>

>>> Another silly question: Is your datasource functional if you leave out the
preHook?

>>>

>>>  
>>>

>>> Obtained service dependency:
(objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)

>>>

>>> Waiting for service dependency:
(objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)

>>>

>>> Waiting for service dependency:
(&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))

>>>

>>> Waiting for service dependency:
(&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))

>>>

>>> Waiting for service dependency:
(&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))

>>>

>>> Obtained service dependency:
(&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))

>>>

>>> Obtained service dependency:
(&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))

>>>

>>>  **Obtained service dependency: (
&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))**

>>>

>>>  
>>>

>>>  
>>>

>>> Cheers,

>>>

>>> Erwin

>>>

>>>  
>  
>

>>>

>>>> On Jan 23, 2020, at 13:22, Alex Soto
<[alex.soto@envieta.com](mailto:alex.soto@envieta.com)> wrote:

>>>>

>>>>  
>>>>

>>>> Yes,  the migration service is being registered:

>>>>

>>>>  
>>>>

>>>>  
>>>>

>>>>> Obtained service dependency:
(objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)

>>>>>

>>>>> Waiting for service dependency:
(objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)

>>>>>

>>>>> Waiting for service dependency:
(&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))

>>>>>

>>>>> Obtained service dependency:
(&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))

>>>>>

>>>>> Waiting for service dependency:
(&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))

>>>>

>>>>  
>>>>

>>>>  
>>>>

>>>> And

>>>>

>>>>  
>>>>

>>>>> service:list org.ops4j.pax.jdbc.hook.PreHook

>>>>>

>>>>> [org.ops4j.pax.jdbc.hook.PreHook]

>>>>>

>>>>> \---------------------------------

>>>>>

>>>>>  [component.id](http://component.id/) = 29

>>>>>

>>>>>  component.name =
org.enquery.encryptedquery.querier.data.maint.Migration

>>>>>

>>>>>  name = querierDB

>>>>>

>>>>>  service.bundleid = 35

>>>>>

>>>>>  [service.id](http://service.id/) = 276

>>>>>

>>>>>  service.scope = bundle

>>>>>

>>>>> Provided by :

>>>>>

>>>>>  EncryptedQuery :: Querier :: Data (35)

>>>>>

>>>>> Used by:

>>>>>

>>>>>  OPS4J Pax JDBC Config (210)

>>>>

>>>>  
>>>>

>>>> Best regards,  
> Alex soto  
>  
>  
>

>>>>

>>>>  
>  
>

>>>>

>>>>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg
<[erwin.hogeweg@me.com](mailto:erwin.hogeweg@me.com)> wrote:

>>>>>

>>>>>  
>>>>>

>>>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn?t run into any issues.

>>>>>

>>>>>  
>>>>>

>>>>> Stupid question, but can you confirm that the Migrator class is
instantiated and that the component is active?

>>>>>

>>>>>  
>>>>>

>>>>>                com.*.Migrator in bundle 129
(db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.  
>                    Id: 18, State:ACTIVE  
>  
> Initially I missed some Package-Imports on the migrator bundle which left
the component in the SATISFIED (I believe) state. After scrolling through the
logs I discovered a CNFE which pointed me in the right direction.

>>>>>

>>>>>  
>>>>>

>>>>> Erwin

>>>>>

>>>>>  
>>>>>

>>>>>  
>  
>

>>>>>

>>>>>> On Jan 22, 2020, at 12:53, Alex Soto
<[alex.soto@envieta.com](mailto:alex.soto@envieta.com)> wrote:

>>>>>>

>>>>>>  
>>>>>>

>>>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.

>>>>>>

>>>>>> The hook is not being called stating with Pax-JDBC 1.3.4.

>>>>>>

>>>>>>  
>>>>>>

>>>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
remains the same in my tests.  
>>>>>>

>>>>>>  
>>>>>>

>>>>>>  
>>>>>>

>>>>>> Best regards,  
> Alex soto  
>  
>  
>

>>>>>>

>>>>>>  
>  
>

>>>>>>

>>>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg
<[erwin.hogeweg@me.com](mailto:erwin.hogeweg@me.com)> wrote:

>>>>>>>

>>>>>>>  
>>>>>>>

>>>>>>> Ignore the different datasource names. I messed up the ?replace all?
:-)

>>>>>>>

>>>>>>>  
>  
>

>>>>>>>

>>>>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg
<[erwin.hogeweg@me.com](mailto:erwin.hogeweg@me.com)> wrote:

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>>  12 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC
Generic Driver Extender  
>  13 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Config  
>  14 ? Active   ?  80 ? 1.4.4                        ? OPS4J Pax JDBC Pooling
Support Base

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>> [features-2-thread-1] INFO
org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
DataSourceFactory. Creating DataSource jdbc/mydatasource  
> [features-2-thread-1] INFO
org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for
DataSource jdbc/mydatasource  
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock  
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG  
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock  
> [features-2-thread-1] INFO
org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished.
Publishing DataSource jdbc/mydatasource  
> [features-2-thread-1] INFO
org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for
seegate.pu
osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)  
>  
> FWIW - I did change the exception handling in Migrator to better see when/if
the migration fails:

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>>     @Override

>>>>>>>>

>>>>>>>>     public void prepare(DataSource ds) throwsSQLException {

>>>>>>>>

>>>>>>>>         try (Connection connection =ds.getConnection()) {

>>>>>>>>

>>>>>>>>             prepare(connection);

>>>>>>>>

>>>>>>>>         } catch (LiquibaseException e) {

>>>>>>>>

>>>>>>>>                     LOG.error(e.getClass().getName() + ": " +
e.getMessage());

>>>>>>>>

>>>>>>>> //            throw new RuntimeException(e);

>>>>>>>>

>>>>>>>>         }

>>>>>>>>

>>>>>>>>     }

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>> Cheers,

>>>>>>>>

>>>>>>>>  
>>>>>>>>

>>>>>>>> Erwin  
>  
>  
>

>>>>>>>>

>>>>>>>>> On Jan 22, 2020, at 11:11, Alex Soto
<[alex.soto@envieta.com](mailto:alex.soto@envieta.com)> wrote:

>>>>>>>>>

>>>>>>>>>  
>>>>>>>>>

>>>>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.

>>>>>>>>>

>>>>>>>>>  
>>>>>>>>>

>>>>>>>>> Best regards,  
> Alex soto  
>  
>  
>

>>>>>>>>>

>>>>>>>>>  
>  
>

>>>>>>>>>

>>>>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang
<[stefan.guenst@me.com](mailto:stefan.guenst@me.com)> wrote:

>>>>>>>>>>

>>>>>>>>>>  
>>>>>>>>>>

>>>>>>>>>> Hi,  
>  
> we are not able to run Christian's Example:  
>  
> [https://github.com/cschneider/Karaf-
Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java](https://github.com/cschneider/Karaf-
Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java)  
>  
>  
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)  
>  
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.  
>  
> Stefan  
>  
>  
>  
>  
>  
> \--  
> Sent from: [http://karaf.922171.n3.nabble.com/Karaf-
User-f930749.html](http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html)

>

>  
>


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Lukas,

I believe I have some success by copying configuration from my env. to the prehook test.

2020-02-18T10:35:05,924 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Starting PreHookTest ...
2020-02-18T10:35:05,928 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes256-ctr' not available
2020-02-18T10:35:05,931 | INFO  | features-3-thread-1 | ServiceTrackerHelper             | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=sqlite))
2020-02-18T10:35:05,931 | WARN  | activator-1-thread-1 | SshUtils                         | 38 - org.apache.karaf.shell.ssh - 4.2.8 | Configured cipher 'aes192-ctr' not available
2020-02-18T10:35:05,932 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Found DataSourceFactory. Creating DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | DataSourceRegistration           | 16 - org.ops4j.pax.jdbc.config - 1.4.4 | Executing pre hook for DataSource prehook-test
2020-02-18T10:35:05,953 | INFO  | features-3-thread-1 | PreHookTest                      | 50 - prehook - 1.0.0.SNAPSHOT | Called PreHookTest.prepare() …

I reduced the maven-bundle-plugin to:

  <groupId>org.apache.felix</groupId>
    <artifactId>maven-bundle-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
      <!-- Do not generate that OBR file in the local maven cache -->
      <obrRepository>NONE</obrRepository>
      <instructions>
        <_nouses>true</_nouses>
        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
      </instructions>
    </configuration>

And I changed the component annotations to:

  @Component(
    // scope = ServiceScope.SINGLETON,
    immediate = true,
    // service = PreHook.class,
    property = "name=prehook-test-hook"
)
public class PreHookTest implements PreHook {
…

I may have thrown away too much, but at least this is a good starting point.


Erwin


> On Feb 17, 2020, at 13:55, Erwin Hogeweg <er...@me.com> wrote:
> 
> Lukas,
> 
> I am currently on the road but I will try this ASAP. 
> 
> Kind Regards,
> 
> Erwin
> 
>> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lukas.Roedl@ait.ac.at <ma...@ait.ac.at>> escribió:
>> 
>> 
>> Hi,
>>  
>> We’ve similar problems with a Pax JDBC Pre Hook getting called.
>> I’ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test> using SQLite to make it a bit more concrete.
>> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>>  
>> The DataSource is specified in the file “org.ops4j.datasource-prehook-test.cfg” (see [1]) and without a PreHook defined the DataSource is published as expected:
>>  
>> dataSourceName = prehook-test
>> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
>> objectClass = [javax.sql.DataSource]
>> osgi.jdbc.driver.name = sqlite
>> osgi.jndi.service.name = prehook-test
>> pax.jdbc.managed = true
>> service.bundleid = 16
>> service.factoryPid = org.ops4j.datasource
>> service.id <http://service.id/> = 88
>> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
>> service.scope = singleton
>> url = jdbc:sqlite:prehook-test.db
>>  
>> With the PreHook specified (like “ops4j.preHook=prehook-test-hook”) the last log entry is “Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))” event if the PreHook itself is started and active:
>>  
>> Pax JDBC - Test - PreHook (21) provides:
>> ----------------------------------------
>> component.id <http://component.id/> = 0
>> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
>> name = prehook-test-hook
>> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
>> service.bundleid = 21
>> service.id <http://service.id/> = 75
>> service.scope = bundle
>>  
>>  
>> Can someone which doesn’t have problems with this, please take a short look, if there are some differences between the working configurations and this example?
>>  
>> Best,
>> Lukas
>>  
>>  
>> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>>  
>> Von: Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> 
>> Gesendet: Donnerstag, 23. Januar 2020 22:40
>> An: user@karaf.apache.org <ma...@karaf.apache.org>
>> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>>  
>> Hi Alex,
>>  
>> Below a similar sequence from my log.
>>  
>> From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe…
>>  
>> Another silly question: Is your datasource functional if you leave out the preHook?
>>  
>> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
>> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
>> Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>>  
>>  
>> Cheers, 
>> Erwin
>> 
>> 
>> On Jan 23, 2020, at 13:22, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>  
>> Yes,  the migration service is being registered:
>>  
>>  
>> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
>> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
>> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
>> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>>  
>>  
>> And
>>  
>> service:list org.ops4j.pax.jdbc.hook.PreHook
>> [org.ops4j.pax.jdbc.hook.PreHook]
>> ---------------------------------
>>  component.id <http://component.id/> = 29
>>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>>  name = querierDB
>>  service.bundleid = 35
>>  service.id <http://service.id/> = 276
>>  service.scope = bundle
>> Provided by : 
>>  EncryptedQuery :: Querier :: Data (35)
>> Used by: 
>>  OPS4J Pax JDBC Config (210)
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>> 
>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>  
>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
>>  
>> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>>  
>>                com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>>                    Id: 18, State:ACTIVE
>> 
>> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>>  
>> Erwin
>>  
>> 
>> 
>> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>  
>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>  
>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>>  
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>> 
>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>  
>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>> 
>> 
>> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>  
>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>  
>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>>  
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>> 
>> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>>  
>>     @Override
>>     public void prepare(DataSource ds) throwsSQLException {
>>         try (Connection connection =ds.getConnection()) {
>>             prepare(connection);
>>         } catch (LiquibaseException e) {
>>                     LOG.error(e.getClass().getName() + ": " + e.getMessage());
>> //            throw new RuntimeException(e);
>>         }
>>     }
>>  
>>  
>> Cheers,
>>  
>> Erwin
>> 
>> 
>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>  
>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>  
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>> 
>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>  
>> Hi,
>> 
>> we are not able to run Christian's Example:
>> 
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>> 
>> 
>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>> 
>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>> 
>> Stefan
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Lukas,

I am currently on the road but I will try this ASAP. 

Kind Regards,

Erwin

> El feb. 17, 2020, a la(s) 08:55, Roedl Lukas <Lu...@ait.ac.at> escribió:
> 
> 
> Hi,
>  
> We’ve similar problems with a Pax JDBC Pre Hook getting called.
> I’ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test using SQLite to make it a bit more concrete.
> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>  
> The DataSource is specified in the file “org.ops4j.datasource-prehook-test.cfg” (see [1]) and without a PreHook defined the DataSource is published as expected:
>  
> dataSourceName = prehook-test
> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
> objectClass = [javax.sql.DataSource]
> osgi.jdbc.driver.name = sqlite
> osgi.jndi.service.name = prehook-test
> pax.jdbc.managed = true
> service.bundleid = 16
> service.factoryPid = org.ops4j.datasource
> service.id = 88
> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
> service.scope = singleton
> url = jdbc:sqlite:prehook-test.db
>  
> With the PreHook specified (like “ops4j.preHook=prehook-test-hook”) the last log entry is “Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))” event if the PreHook itself is started and active:
>  
> Pax JDBC - Test - PreHook (21) provides:
> ----------------------------------------
> component.id = 0
> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
> name = prehook-test-hook
> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
> service.bundleid = 21
> service.id = 75
> service.scope = bundle
>  
>  
> Can someone which doesn’t have problems with this, please take a short look, if there are some differences between the working configurations and this example?
>  
> Best,
> Lukas
>  
>  
> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg
>  
> Von: Erwin Hogeweg <er...@me.com> 
> Gesendet: Donnerstag, 23. Januar 2020 22:40
> An: user@karaf.apache.org
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Hi Alex,
>  
> Below a similar sequence from my log.
>  
> From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe…
>  
> Another silly question: Is your datasource functional if you leave out the preHook?
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
> Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>  
>  
> Cheers, 
> Erwin
> 
> 
> On Jan 23, 2020, at 13:22, Alex Soto <al...@envieta.com> wrote:
>  
> Yes,  the migration service is being registered:
>  
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>  
>  
> And
>  
> service:list org.ops4j.pax.jdbc.hook.PreHook
> [org.ops4j.pax.jdbc.hook.PreHook]
> ---------------------------------
>  component.id = 29
>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>  name = querierDB
>  service.bundleid = 35
>  service.id = 276
>  service.scope = bundle
> Provided by : 
>  EncryptedQuery :: Querier :: Data (35)
> Used by: 
>  OPS4J Pax JDBC Config (210)
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <er...@me.com> wrote:
>  
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
>  
> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>  
>                com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>                    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>  
> Erwin
>  
> 
> 
> On Jan 22, 2020, at 12:53, Alex Soto <al...@envieta.com> wrote:
>  
> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
> The hook is not being called stating with Pax-JDBC 1.3.4.
>  
> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>  
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <er...@me.com> wrote:
>  
> Ignore the different datasource names. I messed up the ‘replace all’ :-)
> 
> 
> On Jan 22, 2020, at 12:36, Erwin Hogeweg <er...@me.com> wrote:
>  
> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>  
>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>  
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
> 
> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>  
>     @Override
>     public void prepare(DataSource ds) throws SQLException {
>         try (Connection connection = ds.getConnection()) {
>             prepare(connection);
>         } catch (LiquibaseException e) {
>                     LOG.error(e.getClass().getName() + ": " + e.getMessage());
> //            throw new RuntimeException(e);
>         }
>     }
>  
>  
> Cheers,
>  
> Erwin
> 
> 
> On Jan 22, 2020, at 11:11, Alex Soto <al...@envieta.com> wrote:
>  
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 20, 2020, at 9:10 AM, stefang <st...@me.com> wrote:
>  
> Hi,
> 
> we are not able to run Christian's Example:
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
> 
> 
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
> 
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
> 
> Stefan
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>  
>  
>  
>  
>  
>  
>  

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Thanks for sharing,

As said in a previous email, I’m testing and I will fix in Pax JDBC if required.

Regards
JB

> Le 17 févr. 2020 à 14:55, Roedl Lukas <Lu...@ait.ac.at> a écrit :
> 
> Hi,
>  
> We’ve similar problems with a Pax JDBC Pre Hook getting called.
> I’ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test <https://github.com/roedll/pax-jdbc-pre-hook-test> using SQLite to make it a bit more concrete.
> Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.
>  
> The DataSource is specified in the file “org.ops4j.datasource-prehook-test.cfg” (see [1]) and without a PreHook defined the DataSource is published as expected:
>  
> dataSourceName = prehook-test
> felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
> objectClass = [javax.sql.DataSource]
> osgi.jdbc.driver.name = sqlite
> osgi.jndi.service.name = prehook-test
> pax.jdbc.managed = true
> service.bundleid = 16
> service.factoryPid = org.ops4j.datasource
> service.id <http://service.id/> = 88
> service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
> service.scope = singleton
> url = jdbc:sqlite:prehook-test.db
>  
> With the PreHook specified (like “ops4j.preHook=prehook-test-hook”) the last log entry is “Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))” event if the PreHook itself is started and active:
>  
> Pax JDBC - Test - PreHook (21) provides:
> ----------------------------------------
> component.id <http://component.id/> = 0
> component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
> name = prehook-test-hook
> objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
> service.bundleid = 21
> service.id <http://service.id/> = 75
> service.scope = bundle
>  
>  
> Can someone which doesn’t have problems with this, please take a short look, if there are some differences between the working configurations and this example?
>  
> Best,
> Lukas
>  
>  
> [1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg <https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg>
>  
> Von: Erwin Hogeweg <er...@me.com> 
> Gesendet: Donnerstag, 23. Januar 2020 22:40
> An: user@karaf.apache.org
> Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working
>  
> Hi Alex,
>  
> Below a similar sequence from my log.
>  
> From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe…
>  
> Another silly question: Is your datasource functional if you leave out the preHook?
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
> Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))
>  
>  
> Cheers, 
> Erwin
> 
> 
> On Jan 23, 2020, at 13:22, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Yes,  the migration service is being registered:
>  
>  
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
>  
>  
> And
>  
> service:list org.ops4j.pax.jdbc.hook.PreHook
> [org.ops4j.pax.jdbc.hook.PreHook]
> ---------------------------------
>  component.id <http://component.id/> = 29
>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>  name = querierDB
>  service.bundleid = 35
>  service.id <http://service.id/> = 276
>  service.scope = bundle
> Provided by : 
>  EncryptedQuery :: Querier :: Data (35)
> Used by: 
>  OPS4J Pax JDBC Config (210)
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
>  
> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>  
>                com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>                    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>  
> Erwin
>  
> 
> 
> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
> The hook is not being called stating with Pax-JDBC 1.3.4.
>  
> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>  
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> Ignore the different datasource names. I messed up the ‘replace all’ :-)
> 
> 
> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>  
> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>  
>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>  
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
> 
> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>  
>     @Override
>     public void prepare(DataSource ds) throws SQLException {
>         try (Connection connection = ds.getConnection()) {
>             prepare(connection);
>         } catch (LiquibaseException e) {
>                     LOG.error(e.getClass().getName() + ": " + e.getMessage());
> //            throw new RuntimeException(e);
>         }
>     }
>  
>  
> Cheers,
>  
> Erwin
> 
> 
> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>  
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>  
> Best regards,
> Alex soto
> 
> 
> 
> 
> 
> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>  
> Hi,
> 
> we are not able to run Christian's Example:
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
> 
> 
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
> 
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
> 
> Stefan
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>

AW: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Roedl Lukas <Lu...@ait.ac.at>.
Hi,

We’ve similar problems with a Pax JDBC Pre Hook getting called.
I’ve prepared a minimal example on https://github.com/roedll/pax-jdbc-pre-hook-test using SQLite to make it a bit more concrete.
Apache Karaf 4.2.8 in combination with Pax JDBC 1.4.4 is used.

The DataSource is specified in the file “org.ops4j.datasource-prehook-test.cfg” (see [1]) and without a PreHook defined the DataSource is published as expected:

dataSourceName = prehook-test
felix.fileinstall.filename = file:/X:/pax-jdbc-pre-hook-test/framework/target/assembly/etc/org.ops4j.datasource-prehook-test.cfg
objectClass = [javax.sql.DataSource]
osgi.jdbc.driver.name = sqlite
osgi.jndi.service.name = prehook-test
pax.jdbc.managed = true
service.bundleid = 16
service.factoryPid = org.ops4j.datasource
service.id = 88
service.pid = org.ops4j.datasource.5a7b2e4b-4781-4b60-b707-74a48e210bda
service.scope = singleton
url = jdbc:sqlite:prehook-test.db

With the PreHook specified (like “ops4j.preHook=prehook-test-hook”) the last log entry is “Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=prehook-test-hook))” event if the PreHook itself is started and active:

Pax JDBC - Test - PreHook (21) provides:
----------------------------------------
component.id = 0
component.name = at.roedll.pax.jdbc.pre.hook.test.PreHookTest
name = prehook-test-hook
objectClass = [org.ops4j.pax.jdbc.hook.PreHook]
service.bundleid = 21
service.id = 75
service.scope = bundle


Can someone which doesn’t have problems with this, please take a short look, if there are some differences between the working configurations and this example?

Best,
Lukas


[1] https://github.com/roedll/pax-jdbc-pre-hook-test/blob/master/framework/src/main/filtered-resources/etc/org.ops4j.datasource-prehook-test.cfg

Von: Erwin Hogeweg <er...@me.com>
Gesendet: Donnerstag, 23. Januar 2020 22:40
An: user@karaf.apache.org
Betreff: Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Hi Alex,

Below a similar sequence from my log.

From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe…

Another silly question: Is your datasource functional if you leave out the preHook?

Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))


Cheers,
Erwin


On Jan 23, 2020, at 13:22, Alex Soto <al...@envieta.com>> wrote:

Yes,  the migration service is being registered:


Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))


And

service:list org.ops4j.pax.jdbc.hook.PreHook
[org.ops4j.pax.jdbc.hook.PreHook]
---------------------------------
 component.id<http://component.id/> = 29
 component.name = org.enquery.encryptedquery.querier.data.maint.Migration
 name = querierDB
 service.bundleid = 35
 service.id<http://service.id/> = 276
 service.scope = bundle
Provided by :
 EncryptedQuery :: Querier :: Data (35)
Used by:
 OPS4J Pax JDBC Config (210)

Best regards,
Alex soto




On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <er...@me.com>> wrote:

Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.

Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?

               com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
                   Id: 18, State:ACTIVE

Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.

Erwin



On Jan 22, 2020, at 12:53, Alex Soto <al...@envieta.com>> wrote:

I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
The hook is not being called stating with Pax-JDBC 1.3.4.

Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.


Best regards,
Alex soto




On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <er...@me.com>> wrote:

Ignore the different datasource names. I messed up the ‘replace all’ :-)


On Jan 22, 2020, at 12:36, Erwin Hogeweg <er...@me.com>> wrote:

It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.

 12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
 13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
 14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base

[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)

FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:

    @Override
    public void prepare(DataSource ds) throws SQLException {
        try (Connection connection = ds.getConnection()) {
            prepare(connection);
        } catch (LiquibaseException e) {
                    LOG.error(e.getClass().getName() + ": " + e.getMessage());
//            throw new RuntimeException(e);
        }
    }


Cheers,

Erwin


On Jan 22, 2020, at 11:11, Alex Soto <al...@envieta.com>> wrote:

Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.

Best regards,
Alex soto




On Jan 20, 2020, at 9:10 AM, stefang <st...@me.com>> wrote:

Hi,

we are not able to run Christian's Example:

https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java


Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)

Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.

Stefan





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html








Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Hi Alex,

Below a similar sequence from my log.

From your log it seems that the Derby DataSourceFactory is not resolved. I remember that at some point I changed the driver.name entry in the config to a driver.class entry. That is for a mySQL database though but but maybe…

Another silly question: Is your datasource functional if you leave out the preHook?

Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Waiting for service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.pool.common.PooledDataSourceFactory)(pool=dbcp2)(xa=false))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=seegate))
Obtained service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.class=com.mysql.jdbc.Driver))


Cheers, 
Erwin

> On Jan 23, 2020, at 13:22, Alex Soto <al...@envieta.com> wrote:
> 
> Yes,  the migration service is being registered:
> 
> 
> Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
> Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
> Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
> Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))
> 
> 
> And
> 
> service:list org.ops4j.pax.jdbc.hook.PreHook
> [org.ops4j.pax.jdbc.hook.PreHook]
> ---------------------------------
>  component.id <http://component.id/> = 29
>  component.name = org.enquery.encryptedquery.querier.data.maint.Migration
>  name = querierDB
>  service.bundleid = 35
>  service.id <http://service.id/> = 276
>  service.scope = bundle
> Provided by : 
>  EncryptedQuery :: Querier :: Data (35)
> Used by: 
>  OPS4J Pax JDBC Config (210)
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
>> 
>> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
>> 
>> 	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
>> 	    Id: 18, State:ACTIVE
>> 
>> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
>> 
>> Erwin
>> 
>> 
>>> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>> 
>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>> 
>>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>>> 
>>> 
>>> Best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>>> 
>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>> 
>>>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>>>> 
>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>>> 
>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>> 
>>>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>>>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>>>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>>>>> 
>>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>> 
>>>>> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>>>>> 
>>>>>     @Override
>>>>>     public void prepare(DataSource ds) throws SQLException {
>>>>>         try (Connection connection = ds.getConnection()) {
>>>>>             prepare(connection);
>>>>>         } catch (LiquibaseException e) {
>>>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>>>> //            throw new RuntimeException(e);
>>>>>         }
>>>>>     }
>>>>> 
>>>>> 
>>>>> Cheers,
>>>>> 
>>>>> Erwin
>>>>> 
>>>>>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>>>>> 
>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> we are not able to run Christian's Example:
>>>>>>> 
>>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>>>>> 
>>>>>>> 
>>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>>> 
>>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>>> 
>>>>>>> Stefan
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Alex Soto <al...@envieta.com>.
Yes,  the migration service is being registered:


Obtained service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (objectClass=org.ops4j.pax.jdbc.config.ConfigLoader)
Waiting for service dependency: (&(pool=*)(!(pax.jdbc.managed=true))(|(objectClass=javax.sql.DataSource)(objectClass=javax.sql.XADataSource)))
Obtained service dependency: (&(objectClass=org.ops4j.pax.jdbc.hook.PreHook)(name=querierDB))
Waiting for service dependency: (&(objectClass=org.osgi.service.jdbc.DataSourceFactory)(osgi.jdbc.driver.name=derby))


And

service:list org.ops4j.pax.jdbc.hook.PreHook
[org.ops4j.pax.jdbc.hook.PreHook]
---------------------------------
 component.id = 29
 component.name = org.enquery.encryptedquery.querier.data.maint.Migration
 name = querierDB
 service.bundleid = 35
 service.id = 276
 service.scope = bundle
Provided by : 
 EncryptedQuery :: Querier :: Data (35)
Used by: 
 OPS4J Pax JDBC Config (210)

Best regards,
Alex soto




> On Jan 22, 2020, at 1:06 PM, Erwin Hogeweg <er...@me.com> wrote:
> 
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
> 
> Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?
> 
> 	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
> 	    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.
> 
> Erwin
> 
> 
>> On Jan 22, 2020, at 12:53, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>> 
>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>> The hook is not being called stating with Pax-JDBC 1.3.4.
>> 
>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>> 
>>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>>> 
>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>>> 
>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>> 
>>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>>>> 
>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>> 
>>>> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>>>> 
>>>>     @Override
>>>>     public void prepare(DataSource ds) throws SQLException {
>>>>         try (Connection connection = ds.getConnection()) {
>>>>             prepare(connection);
>>>>         } catch (LiquibaseException e) {
>>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>>> //            throw new RuntimeException(e);
>>>>         }
>>>>     }
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Erwin
>>>> 
>>>>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>>>> 
>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> we are not able to run Christian's Example:
>>>>>> 
>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>>>> 
>>>>>> 
>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>> 
>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>> 
>>>>>> Stefan
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>>> 
>>>> 
>>> 
>> 
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi JB,

can your share your working example?

Regards 
Stefan 


jbonofre wrote
> I will add an example in Karaf internal using PreHook but it works for
> me on my own example.
> 
> Regards
> JB
> 
> On 23/01/2020 10:45, stefang wrote:
>> Hi Erwin,
>> 
>> can you please check the reference example from Christian in your
>> environment ?
>> 
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>> 
>> regards
>> Stefan
>>  
>> 
>> 
>> Erwin Hogeweg wrote
>>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any
>>> issues.
>>>
>>> Stupid question, but can you confirm that the Migrator class is
>>> instantiated and that the component is active?
>>>
>>> 	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230)
>>> enabled, 1 instance.
>>> 	    Id: 18, State:ACTIVE
>>>
>>> Initially I missed some Package-Imports on the migrator bundle which
>>> left
>>> the component in the SATISFIED (I believe) state. After scrolling
>>> through
>>> the logs I discovered a CNFE which pointed me in the right direction.
>>>
>>> Erwin
>>>
>>>
>>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
>> 
>>> alex.soto@
>> 
>>> &gt; wrote:
>>>>
>>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>>
>>>> Something must have changed in Pax-JDBC 1.3.4 as everything else
>>>> remains
>>>> the same in my tests.  
>>>>
>>>>
>>>> Best regards,
>>>> Alex soto
>>>>
>>>>
>>>>
>>>>
>>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>>  &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>>>
>>>>> Ignore the different datasource names. I messed up the ‘replace all’
>>>>> :-)
>>>>>
>>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
>> 
>>> erwin.hogeweg@
>> 
>>>  &lt;mailto:
>> 
>>> erwin.hogeweg@
>> 
>>> &gt;> wrote:
>>>>>>
>>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>>>
>>>>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>>> Generic Driver Extender
>>>>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>>> Config
>>>>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>>> Pooling Support Base
>>>>>>
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>>>> hook for DataSource jdbc/mydatasource
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log
>>>>>> lock
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>>> seegate.DATABASECHANGELOG
>>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log
>>>>>> lock
>>>>>> [features-2-thread-1] INFO
>>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>>> [features-2-thread-1] INFO
>>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>>> DataSource for seegate.pu
>>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>>>
>>>>>> FWIW - I did change the exception handling in Migrator to better see
>>>>>> when/if the migration fails:
>>>>>>
>>>>>>     @Override
>>>>>>     public void prepare(DataSource ds) throws SQLException {
>>>>>>         try (Connection connection = ds.getConnection()) {
>>>>>>             prepare(connection);
>>>>>>         } catch (LiquibaseException e) {
>>>>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>>>>> //            throw new RuntimeException(e);
>>>>>>         }
>>>>>>     }
>>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Erwin
>>>>>>
>>>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
>> 
>>> alex.soto@
>> 
>>>  &lt;mailto:
>> 
>>> alex.soto@
>> 
>>> &gt;> wrote:
>>>>>>>
>>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
>> 
>>> stefan.guenst@
>> 
>>>  &lt;mailto:
>> 
>>> stefan.guenst@
>> 
>>> &gt;> wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> we are not able to run Christian's Example:
>>>>>>>>
>>>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>>>>
>>>>>>>>
>>>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>>>>
>>>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>>>>
>>>>>>>> Stefan
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sent from:
>>>>>>>> http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>>>>
>>>>>>
>>>>>
>>>>
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> 
> 
> -- 
> Jean-Baptiste Onofré

> jbonofre@

> http://blog.nanthrax.net
> Talend - http://www.talend.com





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I will add an example in Karaf internal using PreHook but it works for
me on my own example.

Regards
JB

On 23/01/2020 10:45, stefang wrote:
> Hi Erwin,
> 
> can you please check the reference example from Christian in your
> environment ?
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
> 
> regards
> Stefan
>  
> 
> 
> Erwin Hogeweg wrote
>> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
>> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
>>
>> Stupid question, but can you confirm that the Migrator class is
>> instantiated and that the component is active?
>>
>> 	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230)
>> enabled, 1 instance.
>> 	    Id: 18, State:ACTIVE
>>
>> Initially I missed some Package-Imports on the migrator bundle which left
>> the component in the SATISFIED (I believe) state. After scrolling through
>> the logs I discovered a CNFE which pointed me in the right direction.
>>
>> Erwin
>>
>>
>>> On Jan 22, 2020, at 12:53, Alex Soto &lt;
> 
>> alex.soto@
> 
>> &gt; wrote:
>>>
>>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>>> The hook is not being called stating with Pax-JDBC 1.3.4.
>>>
>>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains
>>> the same in my tests.  
>>>
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>>
>>>
>>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>>  &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>>>
>>>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>>>>
>>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;
> 
>> erwin.hogeweg@
> 
>>  &lt;mailto:
> 
>> erwin.hogeweg@
> 
>> &gt;> wrote:
>>>>>
>>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>>>
>>>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>> Generic Driver Extender
>>>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>> Config
>>>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>>> Pooling Support Base
>>>>>
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>>> hook for DataSource jdbc/mydatasource
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>>> seegate.DATABASECHANGELOG
>>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>>> [features-2-thread-1] INFO
>>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>>> finished. Publishing DataSource jdbc/mydatasource
>>>>> [features-2-thread-1] INFO
>>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>>> DataSource for seegate.pu
>>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>>>
>>>>> FWIW - I did change the exception handling in Migrator to better see
>>>>> when/if the migration fails:
>>>>>
>>>>>     @Override
>>>>>     public void prepare(DataSource ds) throws SQLException {
>>>>>         try (Connection connection = ds.getConnection()) {
>>>>>             prepare(connection);
>>>>>         } catch (LiquibaseException e) {
>>>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>>>> //            throw new RuntimeException(e);
>>>>>         }
>>>>>     }
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Erwin
>>>>>
>>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;
> 
>> alex.soto@
> 
>>  &lt;mailto:
> 
>> alex.soto@
> 
>> &gt;> wrote:
>>>>>>
>>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>>>
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;
> 
>> stefan.guenst@
> 
>>  &lt;mailto:
> 
>> stefan.guenst@
> 
>> &gt;> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> we are not able to run Christian's Example:
>>>>>>>
>>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>>>
>>>>>>>
>>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>>>
>>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>>>
>>>>>>> Stefan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>>>
>>>>>
>>>>
>>>
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by stefang <st...@me.com>.
Hi Erwin,

can you please check the reference example from Christian in your
environment ?

https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java

regards
Stefan
 


Erwin Hogeweg wrote
> Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to
> karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.
> 
> Stupid question, but can you confirm that the Migrator class is
> instantiated and that the component is active?
> 
> 	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230)
> enabled, 1 instance.
> 	    Id: 18, State:ACTIVE
> 
> Initially I missed some Package-Imports on the migrator bundle which left
> the component in the SATISFIED (I believe) state. After scrolling through
> the logs I discovered a CNFE which pointed me in the right direction.
> 
> Erwin
> 
> 
>> On Jan 22, 2020, at 12:53, Alex Soto &lt;

> alex.soto@

> &gt; wrote:
>> 
>> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
>> The hook is not being called stating with Pax-JDBC 1.3.4.
>> 
>> Something must have changed in Pax-JDBC 1.3.4 as everything else remains
>> the same in my tests.  
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>> 
>>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>>> 
>>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg &lt;

> erwin.hogeweg@

>  &lt;mailto:

> erwin.hogeweg@

> &gt;> wrote:
>>>> 
>>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>>> 
>>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>> Generic Driver Extender
>>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>> Config
>>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC
>>>> Pooling Support Base
>>>> 
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found
>>>> DataSourceFactory. Creating DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre
>>>> hook for DataSource jdbc/mydatasource
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>>> INFO 1/22/20 12:32 PM: liquibase: Reading from
>>>> seegate.DATABASECHANGELOG
>>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>>> [features-2-thread-1] INFO
>>>> org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook
>>>> finished. Publishing DataSource jdbc/mydatasource
>>>> [features-2-thread-1] INFO
>>>> org.apache.aries.jpa.container.impl.DataSourceTracker - Found
>>>> DataSource for seegate.pu
>>>> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>>> 
>>>> FWIW - I did change the exception handling in Migrator to better see
>>>> when/if the migration fails:
>>>> 
>>>>     @Override
>>>>     public void prepare(DataSource ds) throws SQLException {
>>>>         try (Connection connection = ds.getConnection()) {
>>>>             prepare(connection);
>>>>         } catch (LiquibaseException e) {
>>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>>> //            throw new RuntimeException(e);
>>>>         }
>>>>     }
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Erwin
>>>> 
>>>>> On Jan 22, 2020, at 11:11, Alex Soto &lt;

> alex.soto@

>  &lt;mailto:

> alex.soto@

> &gt;> wrote:
>>>>> 
>>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with
>>>>> Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Jan 20, 2020, at 9:10 AM, stefang &lt;

> stefan.guenst@

>  &lt;mailto:

> stefan.guenst@

> &gt;> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> we are not able to run Christian's Example:
>>>>>> 
>>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>>>>> &lt;https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java&gt;
>>>>>> 
>>>>>> 
>>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>>> 
>>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>>> 
>>>>>> Stefan
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>>>>> &lt;http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html&gt;
>>>>> 
>>>> 
>>> 
>>





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Just this week I upgraded from karaf-1.2.6 and pax-jdbc-1.3.1 to karaf-1.2.8-SNAPSHOT and pax-jdbc-1.4.4 and I didn’t run into any issues.

Stupid question, but can you confirm that the Migrator class is instantiated and that the component is active?

	com.*.Migrator in bundle 129 (db.init:1.0.0.SNAPSHOT_20200122-1230) enabled, 1 instance.
	    Id: 18, State:ACTIVE

Initially I missed some Package-Imports on the migrator bundle which left the component in the SATISFIED (I believe) state. After scrolling through the logs I discovered a CNFE which pointed me in the right direction.

Erwin


> On Jan 22, 2020, at 12:53, Alex Soto <al...@envieta.com> wrote:
> 
> I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
> The hook is not being called stating with Pax-JDBC 1.3.4.
> 
> Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  
> 
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> Ignore the different datasource names. I messed up the ‘replace all’ :-)
>> 
>>> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>>> 
>>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>>> 
>>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>>> 
>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
>>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
>>> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>>> 
>>> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>>> 
>>>     @Override
>>>     public void prepare(DataSource ds) throws SQLException {
>>>         try (Connection connection = ds.getConnection()) {
>>>             prepare(connection);
>>>         } catch (LiquibaseException e) {
>>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>>> //            throw new RuntimeException(e);
>>>         }
>>>     }
>>> 
>>> 
>>> Cheers,
>>> 
>>> Erwin
>>> 
>>>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>>> 
>>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> we are not able to run Christian's Example:
>>>>> 
>>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>>> 
>>>>> 
>>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>>> 
>>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>>> 
>>>>> Stefan
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>>> 
>>> 
>> 
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Alex Soto <al...@envieta.com>.
I tested with Karaf 4.2.7 and various versions of Pax-JDBC.
The hook is not being called stating with Pax-JDBC 1.3.4.

Something must have changed in Pax-JDBC 1.3.4 as everything else remains the same in my tests.  


Best regards,
Alex soto




> On Jan 22, 2020, at 12:39 PM, Erwin Hogeweg <er...@me.com> wrote:
> 
> Ignore the different datasource names. I messed up the ‘replace all’ :-)
> 
>> On Jan 22, 2020, at 12:36, Erwin Hogeweg <erwin.hogeweg@me.com <ma...@me.com>> wrote:
>> 
>> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
>> 
>>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
>> 
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
>> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
>> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
>> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
>> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
>> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
>> 
>> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
>> 
>>     @Override
>>     public void prepare(DataSource ds) throws SQLException {
>>         try (Connection connection = ds.getConnection()) {
>>             prepare(connection);
>>         } catch (LiquibaseException e) {
>>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
>> //            throw new RuntimeException(e);
>>         }
>>     }
>> 
>> 
>> Cheers,
>> 
>> Erwin
>> 
>>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>>> 
>>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>>> 
>>> Best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>>> 
>>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> we are not able to run Christian's Example:
>>>> 
>>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>>> 
>>>> 
>>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>>> 
>>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>>> 
>>>> Stefan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>>> 
>> 
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
Ignore the different datasource names. I messed up the ‘replace all’ :-)

> On Jan 22, 2020, at 12:36, Erwin Hogeweg <er...@me.com> wrote:
> 
> It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.
> 
>  12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
>  13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
>  14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base
> 
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
> INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
> INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
> INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
> [features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
> [features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)
> 
> FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:
> 
>     @Override
>     public void prepare(DataSource ds) throws SQLException {
>         try (Connection connection = ds.getConnection()) {
>             prepare(connection);
>         } catch (LiquibaseException e) {
>         	LOG.error(e.getClass().getName() + ": " + e.getMessage());
> //            throw new RuntimeException(e);
>         }
>     }
> 
> 
> Cheers,
> 
> Erwin
> 
>> On Jan 22, 2020, at 11:11, Alex Soto <alex.soto@envieta.com <ma...@envieta.com>> wrote:
>> 
>> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>>> 
>>> Hi,
>>> 
>>> we are not able to run Christian's Example:
>>> 
>>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>>> 
>>> 
>>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>> 
>>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>> 
>>> Stefan
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
>> 
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Erwin Hogeweg <er...@me.com>.
It seems to work for me with Karaf-4.2.8-SNAPSHOT and pax-jdbc-1.4.4.

 12 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Generic Driver Extender
 13 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Config
 14 │ Active   │  80 │ 1.4.4                        │ OPS4J Pax JDBC Pooling Support Base

[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Found DataSourceFactory. Creating DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Executing pre hook for DataSource jdbc/mydatasource
INFO 1/22/20 12:32 PM: liquibase: Successfully acquired change log lock
INFO 1/22/20 12:32 PM: liquibase: Reading from seegate.DATABASECHANGELOG
INFO 1/22/20 12:32 PM: liquibase: Successfully released change log lock
[features-2-thread-1] INFO org.ops4j.pax.jdbc.config.impl.DataSourceRegistration - Pre hook finished. Publishing DataSource jdbc/mydatasource
[features-2-thread-1] INFO org.apache.aries.jpa.container.impl.DataSourceTracker - Found DataSource for seegate.pu osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/mydatasource)

FWIW - I did change the exception handling in Migrator to better see when/if the migration fails:

    @Override
    public void prepare(DataSource ds) throws SQLException {
        try (Connection connection = ds.getConnection()) {
            prepare(connection);
        } catch (LiquibaseException e) {
        	LOG.error(e.getClass().getName() + ": " + e.getMessage());
//            throw new RuntimeException(e);
        }
    }


Cheers,

Erwin

> On Jan 22, 2020, at 11:11, Alex Soto <al...@envieta.com> wrote:
> 
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com <ma...@me.com>> wrote:
>> 
>> Hi,
>> 
>> we are not able to run Christian's Example:
>> 
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java <https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java>
>> 
>> 
>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>> 
>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>> 
>> Stefan
>> 
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 


Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
The Karaf JDBC example itest passed.

So, it's maybe a different use case. Can you please create a Jira at
Karaf (I will link with a Jira at Pax JDBC) ?

Thanks,
Regards
JB

On 22/01/2020 17:11, Alex Soto wrote:
> Same is happening to me, it works with Pax-JDBC 1.3.0, but not
> with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.
> 
> Best regards,
> Alex soto
> 
> 
> 
> 
>> On Jan 20, 2020, at 9:10 AM, stefang <stefan.guenst@me.com
>> <ma...@me.com>> wrote:
>>
>> Hi,
>>
>> we are not able to run Christian's Example:
>>
>> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
>>
>>
>> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
>>
>> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
>>
>> Stefan
>>
>>
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.2.8-SNAPSHOT - pax-jdbc 1.4.4 - prehook not working

Posted by Alex Soto <al...@envieta.com>.
Same is happening to me, it works with Pax-JDBC 1.3.0, but not with Pax-JDBC 1.4.0, which is the one included in Karaf 4.2.7.

Best regards,
Alex soto




> On Jan 20, 2020, at 9:10 AM, stefang <st...@me.com> wrote:
> 
> Hi,
> 
> we are not able to run Christian's Example:
> 
> https://github.com/cschneider/Karaf-Tutorial/blob/master/liquibase/service/src/main/java/net/lr/tutorial/db/service/Migrator.java
> 
> 
> Must be something todo with pax-jdbc 1.4.4 (wich comes with 4.2.8)
> 
> Karaf 4.2.6 (pax-jdbc 1.3.5)works fine.
> 
> Stefan
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html