Hi Erwin,

good you found your problem ;)

Thanks for the update.

Regards
JB

On 11/24/2016 04:10 PM, Erwin Hogeweg wrote:
Pffff….

Of course this was a USER error.

The bundle filename contained SNAPSHOT, but I had the bundle installed
without version, just group and artifact ID… so is wasn’t picked up in
the BundleWatcherImpl.isMavenSnapshotUrl() call.

After installing it with the /1.0.0-SNAPSHOT included, the watch
function works like a charm…

I think this is what JB said, but it didn’t sink in… Sometimes I am
getting really tired of myself :-)


Anyway, thanks all for your suggestions and a Happy Thanksgiving everyone.

Erwin


On Nov 23, 2016, at 11:05, Erwin Hogeweg <erwin.hoge...@me.com
<mailto:erwin.hoge...@me.com>> wrote:

JB,

I guess your SNAPSHOT is on a remote repo. For now, watch just works
with SNAPSHOT updated in your local .m2/repository.
Are you sure that only SNAPSHOT bundles are watched?

If I look in the BundleWatchImpl class I see this:

...
for (String bundleURL : watchURLs) {
  // Transform into regexp
  bundleURL = bundleURL.replaceAll("\\*", ".*");
  for (Bundle bundle :
bundleService.selectBundles(Collections.singletonList(bundleURL),
false)) {
  if (isMavenSnapshotUrl(getLocation(bundle))) {
    watchedBundles.add(bundle);
  }
}

And when I execute /watch —list/ I indeed get ALL bundles.
...
*                                           205 OPS4J Pax JDBC Pooling
Support Base
*                                           206 OPS4J Pax JDBC Pooling
Support using Commons-DBCP2
*                                           207 Stax2 API

*                                           208 Woodstox XML-processor

*                                           210 ErwinsTest Bundle


I enabled debug logging for the BundleWatcherImpl, but I don’t see any
other log msgs than the start and stop.

karaf@root>2016-11-23 10:59:49,088 | DEBUG | Thread-71        |
BundleWatcherImpl                | 23 - org.apache.karaf.bundle.core -
4.0.7 | Bundle watcher thread stopped
...
karaf@root>2016-11-23 10:59:52,294 | DEBUG | Thread-72        |
BundleWatcherImpl                | 23 - org.apache.karaf.bundle.core -
4.0.7 | Bundle watcher thread started


Regards,

Erwin



Regards
JB

On 11/23/2016 12:13 AM, Erwin Hogeweg wrote:
Hi,

Is there a reason why bundle:watch won’t work in the following scenario?

- Install and start SNAPSHOT bundle from maven.
- execute bundle:'watch —start <bid>'
- rebuild bundle with ‘clean install’

Expect bundle to be updated, but nothing happens… (Executing 'update
<bid>' does load the new version….)

I changed the watch interval to 1 second thinking that maybe I was
too impatient… to no avail. I vaguely remember some msgs here re.
bundle:watch, but I couldn’t find them anymore. I also didn’t see
any open issues in Jira. So I am a tad confused now. Can’t imagine
this isn’t working, so I must be missing something very obvious.

Any insight is greatly appreciated.


Erwin


--
Jean-Baptiste Onofré
jbono...@apache.org <mailto:jbono...@apache.org>
http://blog.nanthrax.net
Talend - http://www.talend.com



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

Reply via email to