Controlling order of featuresRepositories in custom distribution...

2019-03-22 Thread James Carman
When including a features repository as a "runtime" dependency, it
will be added to the featuresRepositories list in the
org.apache.karaf.features.cfg file.  Is there any way to control the
order in which those show up in the featuresRepositories list?  We are
wanting to use CXF 3.3.1 and Camel 2.23.1, but regardless of what
order we include those two feature repository dependencies, Camel
shows up before CXF.  Normally this wouldn't be a big deal, but Camel
is also dragging CXF 3.2.7's feature repository along with it, which
will be used to resolve any of the CXF features if we try to install
them.

Thanks,

James


Re: Help with an exception during custom server startup

2019-01-14 Thread James Carman
I had to add aries-blueprint to fix this I believe.

On Sun, Jan 13, 2019 at 12:14 PM Jean-Baptiste Onofré 
wrote:

> Hi,
>
> Your pom.xml is not fully correct:
>
> 1. The framework features is missing:
>
> 
> org.apache.karaf.features
> framework
> features
> xml
> runtime
> 
>
> You have the kar, but your forgot the framework.
>
> 2. You should not use the standard meta feature for custom distribution.
> Instead, you should set the full features set. In your case:
>
> 
> org.apache.karaf.tooling
> karaf-maven-plugin
> true
> ${karaf.version}
> 
> 
> wrapper
> 
> 
> eventadmin
> 
> 
> wrap
> shell
> feature
> jaas
> ssh
> management
> bundle
> config
> deployer
> diagnostic
> feature
> instance
> kar
> log
> package
> service
> system
> shell-compat
> aries-blueprint
> activemq-blueprint
> activemq-broker-noweb
> 
> 
> 
>
> Regards
> JB
>
> On 13/01/2019 17:56, Jakub Herkel wrote:
> > I have tried to create a custom karaf distribution but I have had a
> > problem with an exception during startup.
> >
> > org.apache.karaf.features.core[org.apache.karaf.features.internal.servi
> > ce.FeaturesServiceImpl] : Unknown protocol: mvn
> > java.net.MalformedURLException: Unknown protocol: mvn
> >   at java.net.URL.(URL.java:627)
> >   at java.net.URL.(URL.java:490)
> >   at java.net.URL.(URL.java:439)
> >   at
> > org.apache.karaf.features.internal.service.FeatureConfigInstaller.insta
> > llConfigurationFile(FeatureConfigInstaller.java:230)
> >   at
> > org.apache.karaf.features.internal.service.FeatureConfigInstaller.insta
> > llFeatureConfigs(FeatureConfigInstaller.java:147)
> >   at
> > org.apache.karaf.features.internal.service.BundleInstallSupportImpl.ins
> > tallConfigs(BundleInstallSupportImpl.java:297)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.installC
> > onfigs(FeaturesServiceImpl.java:1141)
> >   at
> > org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.jav
> > a:926)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvis
> > ion(FeaturesServiceImpl.java:1025)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$d
> > oProvisionInThread$13(FeaturesServiceImpl.java:964)
> >   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> >   at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.ja
> > va:1149)
> >   at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j
> > ava:624)
> >   at java.lang.Thread.run(Thread.java:748)
> > Caused by: java.lang.IllegalStateException: Unknown protocol: mvn
> >   at
> > org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHa
> > ndlersStreamHandlerProxy.java:373)
> >   at java.net.URL.(URL.java:622)
> >   ... 13 more
> > org.apache.karaf.features.core[org.apache.karaf.features.internal.servi
> > ce.BootFeaturesInstaller] : Error installing boot features
> > java.net.MalformedURLException: Unknown protocol: mvn
> >   at java.net.URL.(URL.java:627)
> >   at java.net.URL.(URL.java:490)
> >   at java.net.URL.(URL.java:439)
> >   at
> > org.apache.karaf.features.internal.service.FeatureConfigInstaller.insta
> > llConfigurationFile(FeatureConfigInstaller.java:230)
> >   at
> > org.apache.karaf.features.internal.service.FeatureConfigInstaller.insta
> > llFeatureConfigs(FeatureConfigInstaller.java:147)
> >   at
> > org.apache.karaf.features.internal.service.BundleInstallSupportImpl.ins
> > tallConfigs(BundleInstallSupportImpl.java:297)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.installC
> > onfigs(FeaturesServiceImpl.java:1141)
> >   at
> > org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.jav
> > a:926)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvis
> > ion(FeaturesServiceImpl.java:1025)
> >   at
> > org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$d
> > oProvisionInThread$13(FeaturesServiceImpl.java:964)
> >   at java.util.concurrent

Re: Startup timing Windows vs. Mac

2018-12-09 Thread James Carman
Silly question, but are we talking about comparable hardware (or identical)
between the two?

On Tue, Nov 20, 2018 at 10:36 PM Oleg Cohen 
wrote:

> Hi JB,
>
> I don’t think the antivirus is an issue in my case.
>
> I did disable Windows Defender. My test case is with a single bundle that
> is installed via this command:
>
> install reference:file://$eclipse_projects/sample.bundle.a
>
> The location $eclipse_projects points to the local file system where
> Eclipse projects for bundles reside.
>
> From Active state I run command *update sample.bundle.a*
>
> I see that the entire bundle start part of the update consists of two
> parts. Right after the activation process starts I see a delay. No logging
> occurs, even with the log level set to TRACE. Then log output starts
> showing initialization of my bundle’s components/services.
>
> The latter part runs quick on both Windows and Mac and take about 1 sec.
> However, the former part that is silent and takes about 5 sec on Mac and 20
> sec on Windows. So, 4 times slower on Windows.
>
> What happens with the bundle at the start? Are files copied? I do suspect
> it has something to do with the file IO.
>
> Thank you,
> Oleg
>
>
> On Nov 20, 2018, at 10:57 AM, Jean-Baptiste Onofré 
> wrote:
>
> Yes, first, please try with the antivirus disabled.
>
> Regards
> JB
>
> On 20/11/2018 16:26, Oleg Cohen wrote:
>
> Hi JB,
>
> Yes, it is Windows. It is exactly the same set of bundles and the same
> Maven repository. Yes, there is Antivirus. I can try testing with disabling
> it temporarily.
>
> How can I see what is being resolved/checked/updated/downloaded? I do
> notice that Karaf has these long pauses. I am sure I can run pretty much
> against the local repo.
>
> I would appreciate any pointers on how to speed up the startup!
>
> Best regards,
> Oleg
>
> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré 
> wrote:
>
> Hi Oleg,
>
> So Windows is longer than Mac (not surprising ;)).
>
> Did you check in term of bundles resolution ? Do the two systems use the
> same Maven repository and network to resolve the artifacts.
>
> I already saw such issue due to the Windows antivirus: it verified any
> artifacts downloaded by Karaf and it takes time.
>
> Do you have antivirus on the Windows system ?
>
> Regards
> JB
>
> On 19/11/2018 21:12, Oleg Cohen wrote:
>
> Greetings,
>
> I have two systems: one Mac and one Windows. I have noticed that exactly
> the same application with a number of bundles, both 3rd party and my own,
> take significantly longer (1.5 vs 6 mins) on Windows compared to Mac. Both
> systems are pretty powerful and have similar resources. I was wondering if
> anybody has noticed the same. What would be the best way to analyze the
> startup performance and identify bottlenecks?
>
> Thank you,
> Oleg
>
>
> --
> Jean-Baptiste Onofré
> 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
>
>
>


Re: Pax Exam - Examine the Karaf logs as part of test

2017-03-08 Thread James Carman
Another approach to make sure your bundle started properly is to use
@Inject to inject any services that are started/exposed by your bundle.
Your @Test won't run until everything is injected properly:

https://ops4j1.jira.com/wiki/display/PAXEXAM4/Getting+Started+with+OSGi+Tests

On Wed, Mar 8, 2017 at 3:59 PM JT  wrote:

> Hi,
>
> I don't know if I am doing something wrong but when I use LogReaderService
> and get the logs using getLog(), the Enumeration is of size 100 and I don't
> find the expected message in there, even though I know it has been logged
> (by manually inspecting the logs). I also know the log is greater than 100
> entries in size and 100 does seem to convenient a size. Do I need some sort
> of additional configuration to the logging?  (I aleady set LogLevel to INFO
> in KarafDistributionconfiguration.
>
> Thanks, Kerry
>
> On 07/03/17 20:23, Jean-Baptiste Onofré wrote:
> > Hi Kerry,
> >
> > you can access the LogService LRU (as the log:display command does).
> >
> > Anyway, I would recommend to use bundle service to check the state
> instead of log.
> >
> > Regards
> > JB
> >
> > On 03/07/2017 09:13 PM, JT wrote:
> >> Hi,
> >>
> >> I'm just starting to use Pax exam with Karaf and I am writing a very
> >> simple test. All I want it to do is to examine the log files of Karaf to
> >> see if a specific bundle has successfully deployed. The bundle contains
> >> a native library and I load this using a Blueprint bean. If the library
> >> loads then a 'load successful' entry is written to the logs.
> >>
> >> Is there any easy way of examining the logs in the test?
> >>
> >> Thanks, Kerry
> >>
> >
>
>


Re: Karaf 4.1?

2017-02-22 Thread James Carman
4.1.0 is already out.

https://repo1.maven.org/maven2/org/apache/karaf/apache-karaf/4.1.0/

On Wed, Feb 22, 2017 at 4:42 PM Leschke, Scott  wrote:

> Are we looking at a release of 4.1 soon?  I realize it’s sort of a “it’ll
> be done when it’s done” situation but I’ve seen a number of people mention
> it recently but since the download page isn’t showing it I assume they’re
> using a snapshot.  The tone of the recent discussion leads me to believe it
> may be imminent.
>
>
>
> Regards,
>
>
>
> Scott
>


Re: Karaf feature how-to?

2017-02-13 Thread James Carman
Sorry for top-posting, but I'm on my phone.  Yeah, ideally, the plugin
would translate perfectly from the Maven world into the Karaf world, but
that just hasn't been my experience, so I just do it by hand and, for me,
it's not a huge burden.  Yes, there are times when things get screwed up,
but it hasn't annoyed me enough at this point to sit down and write a
patch. :)  This is just my experience.  Others may have been able to get
better mileage out of the plugin.  If so, I'm all for automation!

James


On Mon, Feb 13, 2017 at 12:20 PM Thomas Vandahl  wrote:

> Hi James,
>
> On 12.02.17 14:39, James Carman wrote:
> > I always build my features by hand.  It's just easier, IMHO.  A few
> > errors on the console telling you what's missing, and you're off to the
> > races.  You can also try using PAX exam to test your features, but I've
> > found that to be more trouble than it's worth (it always chooses to fail
> > when I'm trying to do something important, like cut a release).
>
> You are probably right, but something inside me refuses to accept that
> if my dependency management are good enough for Maven they still are not
> good enough for Karaf. This manual editing adds a possibility for failure.
>
> Bye, Thomas
>


Re: Karaf feature how-to?

2017-02-12 Thread James Carman
I always build my features by hand.  It's just easier, IMHO.  A few errors
on the console telling you what's missing, and you're off to the races.
You can also try using PAX exam to test your features, but I've found that
to be more trouble than it's worth (it always chooses to fail when I'm
trying to do something important, like cut a release).


On Sun, Feb 12, 2017 at 8:31 AM Thomas Vandahl  wrote:

> Hi Jean-Baptiste,
>
> On 05.02.17 16:36, Thomas Vandahl wrote:
> > Reading this makes me think that the list of Maven dependencies
> > (including transitive ones) should be sufficient to resolve everything.
> > Is this a valid assumption to make? The karaf-maven-plugin gives me for
> > example
> >
> > mvn:org.apache.camel/camel-blueprint/2.18.1
> >
> > Is this identical to
> >
> > camel-blueprint
> >
> > and if not, how do I get the plugin to generate the latter from a
> > dependency entry in the POM? Is this possible at all or do I need to
> > manage the feature dependencies manually?
>
> Ok, I got my feature artifact to verify successfully. Upgrading to Karaf
> 4.0.8 helped a lot. The error messages are much more helpful.
>
> However, it was *not* possible to get the feature to verify without
> adding feature dependencies to the feature.xml-template such as
> aries-blueprint, aries-proxy, eventadmin and spring - even though most
> of them were listed as wrapped bundles in the dependency tree. Moreover,
> I had to add the standard-feature-descriptor and the
> spring-feature-descriptor as "runtime"-dependencies to the POM.
>
> One last thing I learned was that a bundle dependency of
> camel-ftp/2.18.1 is obviously not identical to a feature dependency of
> camel-ftp. In the first case, the Karaf Maven plugin complains about a
> missing dependency to com.jcraft.jsch.*, in the second case, it doesn't.
>
> I now have a verified feature file but when I try to install it in a
> clean Karaf 4.0.8 instance, all cores go up to 100% and nothing else
> happens. No entries in the log file, no network activity, just CPU. I
> gave up after a little bit over an hour.
>
> Could you please explain how this is supposed to work and what debug
> approach would be the best? I can provide my code examples if you want,
> I'm just a bit reluctant to post them here.
>
> Bye, Thomas.
>
>


Re: Karaf provisioning services?

2016-12-05 Thread James Carman
FeatureService is what you should use.

On Mon, Dec 5, 2016 at 4:36 PM Scott Lewis  wrote:

> Are there any OSGi services in Karaf that allow for programmatic install
> of Karaf features?   If so, are there any examples of usage and/or docs
> of these services?
>
> Thanksinadvance,
>
> Scott
>
>
>


Re: Bundle auto-restart

2016-12-03 Thread James Carman
I would say you might want to figure out the timing issues and perhaps do
things differently. Are you using blueprint, declarative services, or just
plain OSGi? What is the interdependency? Services?

On Sat, Dec 3, 2016 at 7:32 AM Aymen Furter 
wrote:

> Yes, like a retry!
>
> I ran into issues having bundles that bring each other into Failure state
> during deployment.
> (If you restart all bundles afterwards it works fine)
>
> The solution is obviously to fix this inside the bundles (Usually OSGi
> related problems) you are developing.
>
> However, especially on a dev machine it would be nice if there would be an
> "auto restart if bundle goes into Failure state after x amount of time for
> n tries". If there is no such option (or if you would say there is no need
> for that option) that's a valuable and helpful answer for me aswell ;-)
>
> best regards
> Aymen
>
> Like a "retry"? What type of temporary failure are you looking to handle
> gracefully?
>
> On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter < aymen.fur...@prodyna.com>aymen.fur...@prodyna.com aymen.fur...@prodyna.com>> wrote:
> Hi,
>
> Yes exactly!
>
> best regards
> Aymen
> > Hi,
> >
> > I guess you mean "automatically" ? Without any action from the user.
> >
> > Right ?
> >
> > Regards
> > JB
> >
> > On 12/02/2016 04:22 PM, Aymen Furter wrote:
> >> Hi all,
> >>
> >> One small question:
> >> Is there a way in karaf to automatically restart a bundle, if it is in
> >> "Failure" state?
> >>
> >> best regards
> >> Aymen
> >>
> >>
>
>
>
>


Re: Bundle auto-restart

2016-12-02 Thread James Carman
Like a "retry"? What type of temporary failure are you looking to handle
gracefully?

On Fri, Dec 2, 2016 at 6:24 PM Aymen Furter 
wrote:

> Hi,
>
> Yes exactly!
>
> best regards
> Aymen
> > Hi,
> >
> > I guess you mean "automatically" ? Without any action from the user.
> >
> > Right ?
> >
> > Regards
> > JB
> >
> > On 12/02/2016 04:22 PM, Aymen Furter wrote:
> >> Hi all,
> >>
> >> One small question:
> >> Is there a way in karaf to automatically restart a bundle, if it is in
> >> "Failure" state?
> >>
> >> best regards
> >> Aymen
> >>
> >>
>
>
> --
> Aymen Furter
> IT-Consultant / Software Engineer
>
> PRODYNA (Schweiz) AG
> Freie Strasse 2
> 4001 Basel
>
> T +41 44 532 35 90
> F +41 44 532 35 91
> M +41 79 618 44 30
>
> aymen.fur...@prodyna.com
> www.prodyna.ch
>
>
> Sitz der Gesellschaft / Corporate Headquarters : PRODYNA (Schweiz) AG,
> Basel, Schweiz
> Registereintragung / Registration: Handelsregister Kanton Basel-Stadt
> CH-270.3.014.934-7
>
>


Re: Karaf 4.0.7 and ActiveMQ 5.14.1

2016-11-06 Thread James Carman
Did you just install the "vanilla" ActiveMQ feature?

On Sun, Nov 6, 2016 at 1:13 PM jochenw 
wrote:

> Hi,
>
> when installing ActiveMQ 5.14.1 in Karaf 4.0.7, starting the broker results
> in an error while reading activemq.xml. Steps to reprocude it:
> - fresh Karaf 4.0.7, standard composition
> - repo-add activemq
> - feature:install activemq-broker-noweb
> - remove the start=false from activemq.xml
> - restart Karaf
>
> The first exception is attached below. After that, the broker cannot start
> (Cannot find the declaration of element 'beans'). In a slightly different
> configuration, I have seen an error message that it cannot fine the
> spring-beans schema. That all happens from Activemq 5.13.4 onwards. 5.13.3
> works.
>
> Is there some easy solution?
>
> Best Regards,
> Jochen
>
>
> 2016-11-06 19:05:06,672 | WARN  | ctivemq.server]) |
> XmlBeanDefinitionReader
> | 78 - org.apache.servicemix.bundles.spring-beans - 3.2.17.RELEASE_1 |
> Ignored XML validation warning
> java.net.ConnectException: Connection timed out: connect
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)[:]
> at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown
> Source)[:]
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)[:]
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown
> Source)[:]
> at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)[:]
> at
>
> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
> Source)[:]
> at
>
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)[:]
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)[:]
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)[:]
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)[:]
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)[:]
> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)[:]
> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
> Source)[:]
> at
>
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:389)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)[78:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1]
> at
>
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)[79:org.apache.servicemix.bundles.spring-context:3.2.17.RELEASE_1]
> at
>
> org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplic

Re: Getting the maven plugin to fill in versions of bundles

2016-11-02 Thread James Carman
Yep, same here.  I never use the plugin for generating features.xml files.

On Wed, Nov 2, 2016 at 1:13 PM Charlie Mordant  wrote:

> Hi,
>
> I personnally set dependency version via maven   in my poms,
> and use the maven filter capability to fill karaf feature bundles version.
>
> Please take a look at this pom where I configure all my dependency
> Management:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.poms/net.osgiliath.pom.repositories/net.osgiliath.pom.reporting/net.osgiliath.pom.plugins/net.osgiliath.pom.dependency-management/pom.xml
>
> This pom to create a feature and filtering feature.xml:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.activemq/pom.xml
>
> And one of the according feature.xml:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.activemq/src/main/resources/net.osgiliath.feature.activemq.xml
>
> Regards,
>
> 2016-11-01 20:46 GMT+01:00 Jean-Baptiste Onofré :
>
> Hi,
>
> it will use the version from the dependencies set.
>
> Regards
> JB
>
>
> On 11/01/2016 06:17 PM, Benson Margulies wrote:
>
> Folks,
>
> I had this idea that I could set up a template in a
> src/main/feature.xml and have the karaf-maven-plugin fill in the
> versions. This idea is suggested, but not precisely promised, by the
> documentation.
>
> Something like:
>
> mvn:org.ops4j.pax.logging/pax-logging-api/
>
> and the version would appear. I know I can put in a property
> reference, but I want the version number as resolved by maven from the
> dependency graph. Is there a way that I am missing?
>
> --benson
>
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>


Re: Getting the maven plugin to fill in versions of bundles

2016-11-01 Thread James Carman
I use a property to define my dependency version and my bundle reference.

On Tue, Nov 1, 2016 at 1:17 PM Benson Margulies 
wrote:

> Folks,
>
> I had this idea that I could set up a template in a
> src/main/feature.xml and have the karaf-maven-plugin fill in the
> versions. This idea is suggested, but not precisely promised, by the
> documentation.
>
> Something like:
>
> mvn:org.ops4j.pax.logging/pax-logging-api/
>
> and the version would appear. I know I can put in a property
> reference, but I want the version number as resolved by maven from the
> dependency graph. Is there a way that I am missing?
>
> --benson
>


Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
Honestly, we haven't been using K4 much.  I'm going to try to bring up one
of our more troubling scenarios in K3 (< 3.0.8) and see what happens in
K4.  Thanks for the explanation, Guillaume!  Hopefully K4 "just works"! :)



On Fri, Aug 26, 2016 at 10:05 AM Guillaume Nodet  wrote:

> Yeah, that's actually the only case where the bundle is is important afaik.
>
> However, when using Karaf 4 feature service, things are slightly different
> : let's say you have 2 features, each feature containing a bundle which
> export the same package but in different version.  If a single bundle can
> be used (that would mean they are flagged as dependencies), the feature
> service will only install one bundle.  At the end, if bundles flagged as
> dependencies won't be used in the wiring, they won't be installed at all.
>
> 2016-08-26 15:21 GMT+02:00 James Carman :
>
>> The bundle id is important, especially when trying to resolve the same
>> packages from multiple bundles, because the lower bundle id is supposed to
>> be chosen when there are multiple options for the same dependency range.
>> That's what I'm trying to control mostly.
>>
>>
>> On Fri, Aug 26, 2016 at 8:59 AM Guillaume Nodet 
>> wrote:
>>
>>> The installation order is not really relevent, what is important is the
>>> startup order.
>>> Once the list of bundles has been computed, the features service does
>>> the following:
>>>#1: stop bundles that needs to be updated or uninstalled in order
>>>#2: uninstall needed bundles
>>>#3: update regions
>>>#4: update bundles
>>>#5: install bundles
>>>#6: save state
>>>#7: install configuration
>>>#8: refresh bundles
>>>#9: start bundles in order
>>>#10: send events
>>>
>>> For point #9, bundles are split in multiple sets according to their
>>> their order, and in each set, they are sorted in a way that will try to
>>> ensure the bundles are correctly and fully resolved (see FELIX-2949,
>>> because Felix resolver is not greedy).
>>>
>>> What's the problem you're trying to solve exactly ?
>>>
>>> 2016-08-26 13:56 GMT+02:00 James Carman :
>>>
>>>> Wonderful. Something needs to be done about that, then.
>>>>
>>>> On Fri, Aug 26, 2016 at 7:55 AM Guillaume Nodet 
>>>> wrote:
>>>>
>>>>> No, that's true for 2.x and 3.x.
>>>>> 4.x converts the feature list to a list of requirements, builds
>>>>> resources, launch the OSGi resolver, check the current state and apply the
>>>>> difference.
>>>>>
>>>>>
>>>>> 2016-08-26 13:52 GMT+02:00 James Carman :
>>>>>
>>>>>> It iterates through what you hand it, doesn't it?
>>>>>>
>>>>>> On Fri, Aug 26, 2016 at 7:50 AM Guillaume Nodet 
>>>>>> wrote:
>>>>>>
>>>>>>> Yeah, BootFeaturesInstaller keeps the order and pass a LinkedHashSet
>>>>>>> to the FeaturesServiceImpl, but that one does not care about the order 
>>>>>>> by
>>>>>>> design.
>>>>>>>
>>>>>>>
>>>>>>> 2016-08-26 13:46 GMT+02:00 James Carman 
>>>>>>> :
>>>>>>>
>>>>>>>> We change the code to use a list ordered set, so the order is
>>>>>>>> preserved. It has been applied to all branches
>>>>>>>>
>>>>>>>> On Fri, Aug 26, 2016 at 7:45 AM Guillaume Nodet 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Afaik karaf-4642 only really applies to 3.x unless you use stages
>>>>>>>>> with one feature per stage.
>>>>>>>>> Features in a single stage are installed all at once, so the order
>>>>>>>>> is lost.
>>>>>>>>> A simple proof is to look at the list of bundles installed with a
>>>>>>>>> bare karaf 4.x install : the order of the installed bundles is 
>>>>>>>>> unrelated to
>>>>>>>>> the order of the features listed in the configuration, that's because 
>>>>>>>>> a
>>>>>>>>> single stage is used.
>>>>>>>>>
>>>>>>>>> 2016-08-26 13:14 

Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
The bundle id is important, especially when trying to resolve the same
packages from multiple bundles, because the lower bundle id is supposed to
be chosen when there are multiple options for the same dependency range.
That's what I'm trying to control mostly.

On Fri, Aug 26, 2016 at 8:59 AM Guillaume Nodet  wrote:

> The installation order is not really relevent, what is important is the
> startup order.
> Once the list of bundles has been computed, the features service does the
> following:
>#1: stop bundles that needs to be updated or uninstalled in order
>#2: uninstall needed bundles
>#3: update regions
>#4: update bundles
>#5: install bundles
>#6: save state
>#7: install configuration
>#8: refresh bundles
>#9: start bundles in order
>#10: send events
>
> For point #9, bundles are split in multiple sets according to their their
> order, and in each set, they are sorted in a way that will try to ensure
> the bundles are correctly and fully resolved (see FELIX-2949, because Felix
> resolver is not greedy).
>
> What's the problem you're trying to solve exactly ?
>
> 2016-08-26 13:56 GMT+02:00 James Carman :
>
>> Wonderful. Something needs to be done about that, then.
>>
>> On Fri, Aug 26, 2016 at 7:55 AM Guillaume Nodet 
>> wrote:
>>
>>> No, that's true for 2.x and 3.x.
>>> 4.x converts the feature list to a list of requirements, builds
>>> resources, launch the OSGi resolver, check the current state and apply the
>>> difference.
>>>
>>>
>>> 2016-08-26 13:52 GMT+02:00 James Carman :
>>>
>>>> It iterates through what you hand it, doesn't it?
>>>>
>>>> On Fri, Aug 26, 2016 at 7:50 AM Guillaume Nodet 
>>>> wrote:
>>>>
>>>>> Yeah, BootFeaturesInstaller keeps the order and pass a LinkedHashSet
>>>>> to the FeaturesServiceImpl, but that one does not care about the order by
>>>>> design.
>>>>>
>>>>>
>>>>> 2016-08-26 13:46 GMT+02:00 James Carman :
>>>>>
>>>>>> We change the code to use a list ordered set, so the order is
>>>>>> preserved. It has been applied to all branches
>>>>>>
>>>>>> On Fri, Aug 26, 2016 at 7:45 AM Guillaume Nodet 
>>>>>> wrote:
>>>>>>
>>>>>>> Afaik karaf-4642 only really applies to 3.x unless you use stages
>>>>>>> with one feature per stage.
>>>>>>> Features in a single stage are installed all at once, so the order
>>>>>>> is lost.
>>>>>>> A simple proof is to look at the list of bundles installed with a
>>>>>>> bare karaf 4.x install : the order of the installed bundles is 
>>>>>>> unrelated to
>>>>>>> the order of the features listed in the configuration, that's because a
>>>>>>> single stage is used.
>>>>>>>
>>>>>>> 2016-08-26 13:14 GMT+02:00 James Carman 
>>>>>>> :
>>>>>>>
>>>>>>>> That's not entirely true. The featuresBoot ordering has been fixed
>>>>>>>> by
>>>>>>>> karaf-4642.
>>>>>>>>
>>>>>>>> On Fri, Aug 26, 2016 at 3:42 AM Guillaume Nodet 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> The only way to influence the start order of bundles is to specify
>>>>>>>>> the start level on the feature or on the feature's bundles using the
>>>>>>>>> start-level attribute (see
>>>>>>>>> https://github.com/apache/karaf/blob/karaf-4.0.x/assemblies/features/standard/src/main/feature/feature.xml
>>>>>>>>> for some examples).
>>>>>>>>>
>>>>>>>>> In Karaf 4.x, the features are resolved and installed in a single
>>>>>>>>> pass, so the order is lost.
>>>>>>>>>
>>>>>>>>> 2016-08-26 4:58 GMT+02:00 oski_bear :
>>>>>>>>>
>>>>>>>>>> Hello, I'm a long-time user of Karaf 2.4.0 trying to migrate my
>>>>>>>>>> application
>>>>>>>>>> to Karaf 4.0.5. One thing I've noticed is that in this new
>>>>>>>>>

Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
Wonderful. Something needs to be done about that, then.
On Fri, Aug 26, 2016 at 7:55 AM Guillaume Nodet  wrote:

> No, that's true for 2.x and 3.x.
> 4.x converts the feature list to a list of requirements, builds resources,
> launch the OSGi resolver, check the current state and apply the difference.
>
>
> 2016-08-26 13:52 GMT+02:00 James Carman :
>
>> It iterates through what you hand it, doesn't it?
>>
>> On Fri, Aug 26, 2016 at 7:50 AM Guillaume Nodet 
>> wrote:
>>
>>> Yeah, BootFeaturesInstaller keeps the order and pass a LinkedHashSet to
>>> the FeaturesServiceImpl, but that one does not care about the order by
>>> design.
>>>
>>>
>>> 2016-08-26 13:46 GMT+02:00 James Carman :
>>>
>>>> We change the code to use a list ordered set, so the order is
>>>> preserved. It has been applied to all branches
>>>>
>>>> On Fri, Aug 26, 2016 at 7:45 AM Guillaume Nodet 
>>>> wrote:
>>>>
>>>>> Afaik karaf-4642 only really applies to 3.x unless you use stages with
>>>>> one feature per stage.
>>>>> Features in a single stage are installed all at once, so the order is
>>>>> lost.
>>>>> A simple proof is to look at the list of bundles installed with a bare
>>>>> karaf 4.x install : the order of the installed bundles is unrelated to the
>>>>> order of the features listed in the configuration, that's because a single
>>>>> stage is used.
>>>>>
>>>>> 2016-08-26 13:14 GMT+02:00 James Carman :
>>>>>
>>>>>> That's not entirely true. The featuresBoot ordering has been fixed by
>>>>>> karaf-4642.
>>>>>>
>>>>>> On Fri, Aug 26, 2016 at 3:42 AM Guillaume Nodet 
>>>>>> wrote:
>>>>>>
>>>>>>> The only way to influence the start order of bundles is to specify
>>>>>>> the start level on the feature or on the feature's bundles using the
>>>>>>> start-level attribute (see
>>>>>>> https://github.com/apache/karaf/blob/karaf-4.0.x/assemblies/features/standard/src/main/feature/feature.xml
>>>>>>> for some examples).
>>>>>>>
>>>>>>> In Karaf 4.x, the features are resolved and installed in a single
>>>>>>> pass, so the order is lost.
>>>>>>>
>>>>>>> 2016-08-26 4:58 GMT+02:00 oski_bear :
>>>>>>>
>>>>>>>> Hello, I'm a long-time user of Karaf 2.4.0 trying to migrate my
>>>>>>>> application
>>>>>>>> to Karaf 4.0.5. One thing I've noticed is that in this new version
>>>>>>>> of Karaf
>>>>>>>> there doesn't seem to be any way to specify the order in which
>>>>>>>> bundles are
>>>>>>>> ordered.
>>>>>>>>
>>>>>>>> For example, if I specify "bootFeatures" in the karaf-maven-plugin
>>>>>>>> they
>>>>>>>> don't start in the order that I list them. Additionally, when I
>>>>>>>> create my
>>>>>>>> own features they don't load in the order they are written and the
>>>>>>>> container
>>>>>>>> does not seem to respect the start levels.
>>>>>>>>
>>>>>>>> Am I missing something here? Is there a way to enforce a certain
>>>>>>>> order in
>>>>>>>> the boot features with the karaf-maven-plugin? Is there a way to
>>>>>>>> force an
>>>>>>>> order when defining a feature?
>>>>>>>>
>>>>>>>> Please help me understand.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://karaf.922171.n3.nabble.com/Karaf-4-0-5-bundle-startup-order-tp4047689.html
>>>>>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> 
>>>>>>> Guillaume Nodet
>>>>>>> 
>>>>>>> Red Hat, Open Source Integration
>>>>>>>
>>>>>>> Email: gno...@redhat.com
>>>>>>> Web: http://fusesource.com
>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 
>>>>> Guillaume Nodet
>>>>> 
>>>>> Red Hat, Open Source Integration
>>>>>
>>>>> Email: gno...@redhat.com
>>>>> Web: http://fusesource.com
>>>>> Blog: http://gnodet.blogspot.com/
>>>>>
>>>>>
>>>
>>>
>>> --
>>> 
>>> Guillaume Nodet
>>> 
>>> Red Hat, Open Source Integration
>>>
>>> Email: gno...@redhat.com
>>> Web: http://fusesource.com
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>
>
> --
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
>
> Email: gno...@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>


Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
It iterates through what you hand it, doesn't it?

On Fri, Aug 26, 2016 at 7:50 AM Guillaume Nodet  wrote:

> Yeah, BootFeaturesInstaller keeps the order and pass a LinkedHashSet to
> the FeaturesServiceImpl, but that one does not care about the order by
> design.
>
>
> 2016-08-26 13:46 GMT+02:00 James Carman :
>
>> We change the code to use a list ordered set, so the order is preserved.
>> It has been applied to all branches
>>
>> On Fri, Aug 26, 2016 at 7:45 AM Guillaume Nodet 
>> wrote:
>>
>>> Afaik karaf-4642 only really applies to 3.x unless you use stages with
>>> one feature per stage.
>>> Features in a single stage are installed all at once, so the order is
>>> lost.
>>> A simple proof is to look at the list of bundles installed with a bare
>>> karaf 4.x install : the order of the installed bundles is unrelated to the
>>> order of the features listed in the configuration, that's because a single
>>> stage is used.
>>>
>>> 2016-08-26 13:14 GMT+02:00 James Carman :
>>>
>>>> That's not entirely true. The featuresBoot ordering has been fixed by
>>>> karaf-4642.
>>>>
>>>> On Fri, Aug 26, 2016 at 3:42 AM Guillaume Nodet 
>>>> wrote:
>>>>
>>>>> The only way to influence the start order of bundles is to specify the
>>>>> start level on the feature or on the feature's bundles using the
>>>>> start-level attribute (see
>>>>> https://github.com/apache/karaf/blob/karaf-4.0.x/assemblies/features/standard/src/main/feature/feature.xml
>>>>> for some examples).
>>>>>
>>>>> In Karaf 4.x, the features are resolved and installed in a single
>>>>> pass, so the order is lost.
>>>>>
>>>>> 2016-08-26 4:58 GMT+02:00 oski_bear :
>>>>>
>>>>>> Hello, I'm a long-time user of Karaf 2.4.0 trying to migrate my
>>>>>> application
>>>>>> to Karaf 4.0.5. One thing I've noticed is that in this new version of
>>>>>> Karaf
>>>>>> there doesn't seem to be any way to specify the order in which
>>>>>> bundles are
>>>>>> ordered.
>>>>>>
>>>>>> For example, if I specify "bootFeatures" in the karaf-maven-plugin
>>>>>> they
>>>>>> don't start in the order that I list them. Additionally, when I
>>>>>> create my
>>>>>> own features they don't load in the order they are written and the
>>>>>> container
>>>>>> does not seem to respect the start levels.
>>>>>>
>>>>>> Am I missing something here? Is there a way to enforce a certain
>>>>>> order in
>>>>>> the boot features with the karaf-maven-plugin? Is there a way to
>>>>>> force an
>>>>>> order when defining a feature?
>>>>>>
>>>>>> Please help me understand.
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://karaf.922171.n3.nabble.com/Karaf-4-0-5-bundle-startup-order-tp4047689.html
>>>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 
>>>>> Guillaume Nodet
>>>>> 
>>>>> Red Hat, Open Source Integration
>>>>>
>>>>> Email: gno...@redhat.com
>>>>> Web: http://fusesource.com
>>>>> Blog: http://gnodet.blogspot.com/
>>>>>
>>>>>
>>>
>>>
>>> --
>>> 
>>> Guillaume Nodet
>>> 
>>> Red Hat, Open Source Integration
>>>
>>> Email: gno...@redhat.com
>>> Web: http://fusesource.com
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>
>
> --
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
>
> Email: gno...@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>


Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
We change the code to use a list ordered set, so the order is preserved. It
has been applied to all branches

On Fri, Aug 26, 2016 at 7:45 AM Guillaume Nodet  wrote:

> Afaik karaf-4642 only really applies to 3.x unless you use stages with one
> feature per stage.
> Features in a single stage are installed all at once, so the order is lost.
> A simple proof is to look at the list of bundles installed with a bare
> karaf 4.x install : the order of the installed bundles is unrelated to the
> order of the features listed in the configuration, that's because a single
> stage is used.
>
> 2016-08-26 13:14 GMT+02:00 James Carman :
>
>> That's not entirely true. The featuresBoot ordering has been fixed by
>> karaf-4642.
>>
>> On Fri, Aug 26, 2016 at 3:42 AM Guillaume Nodet 
>> wrote:
>>
>>> The only way to influence the start order of bundles is to specify the
>>> start level on the feature or on the feature's bundles using the
>>> start-level attribute (see
>>> https://github.com/apache/karaf/blob/karaf-4.0.x/assemblies/features/standard/src/main/feature/feature.xml
>>> for some examples).
>>>
>>> In Karaf 4.x, the features are resolved and installed in a single pass,
>>> so the order is lost.
>>>
>>> 2016-08-26 4:58 GMT+02:00 oski_bear :
>>>
>>>> Hello, I'm a long-time user of Karaf 2.4.0 trying to migrate my
>>>> application
>>>> to Karaf 4.0.5. One thing I've noticed is that in this new version of
>>>> Karaf
>>>> there doesn't seem to be any way to specify the order in which bundles
>>>> are
>>>> ordered.
>>>>
>>>> For example, if I specify "bootFeatures" in the karaf-maven-plugin they
>>>> don't start in the order that I list them. Additionally, when I create
>>>> my
>>>> own features they don't load in the order they are written and the
>>>> container
>>>> does not seem to respect the start levels.
>>>>
>>>> Am I missing something here? Is there a way to enforce a certain order
>>>> in
>>>> the boot features with the karaf-maven-plugin? Is there a way to force
>>>> an
>>>> order when defining a feature?
>>>>
>>>> Please help me understand.
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://karaf.922171.n3.nabble.com/Karaf-4-0-5-bundle-startup-order-tp4047689.html
>>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>>
>>> --
>>> 
>>> Guillaume Nodet
>>> 
>>> Red Hat, Open Source Integration
>>>
>>> Email: gno...@redhat.com
>>> Web: http://fusesource.com
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>
>
> --
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
>
> Email: gno...@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>


Re: Karaf 4.0.5 bundle startup order

2016-08-26 Thread James Carman
That's not entirely true. The featuresBoot ordering has been fixed by
karaf-4642.

On Fri, Aug 26, 2016 at 3:42 AM Guillaume Nodet  wrote:

> The only way to influence the start order of bundles is to specify the
> start level on the feature or on the feature's bundles using the
> start-level attribute (see
> https://github.com/apache/karaf/blob/karaf-4.0.x/assemblies/features/standard/src/main/feature/feature.xml
> for some examples).
>
> In Karaf 4.x, the features are resolved and installed in a single pass, so
> the order is lost.
>
> 2016-08-26 4:58 GMT+02:00 oski_bear :
>
>> Hello, I'm a long-time user of Karaf 2.4.0 trying to migrate my
>> application
>> to Karaf 4.0.5. One thing I've noticed is that in this new version of
>> Karaf
>> there doesn't seem to be any way to specify the order in which bundles are
>> ordered.
>>
>> For example, if I specify "bootFeatures" in the karaf-maven-plugin they
>> don't start in the order that I list them. Additionally, when I create my
>> own features they don't load in the order they are written and the
>> container
>> does not seem to respect the start levels.
>>
>> Am I missing something here? Is there a way to enforce a certain order in
>> the boot features with the karaf-maven-plugin? Is there a way to force an
>> order when defining a feature?
>>
>> Please help me understand.
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Karaf-4-0-5-bundle-startup-order-tp4047689.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
>
> Email: gno...@redhat.com
> Web: http://fusesource.com
> Blog: http://gnodet.blogspot.com/
>
>


Re: Detecting persistent-id sharing...

2016-08-23 Thread James Carman
H. I'll have to see if that applies. Thanks!

On Tue, Aug 23, 2016 at 9:24 PM Nick Baker  wrote:

> We actually just had an occurrence of the “spinning” blueprint due to a
>  but it wasn’t two bundles. It
> was one bundle referenced in two features! Removing the reference from one
> and adding a feature dependency instead “fixed” it for us.
>
>
>
> -Nick
>
>
>
> *From: *James Carman 
> *Reply-To: *"user@karaf.apache.org" 
> *Date: *Tuesday, August 23, 2016 at 9:14 PM
> *To: *"user@karaf.apache.org" 
> *Subject: *Re: Detecting persistent-id sharing...
>
>
>
> No ideas?
>
> On Sun, Aug 21, 2016 at 9:44 AM James Carman 
> wrote:
>
> And, yes, that is exactly what I am talking about. A property placeholder
> is defined in two different blueprint containers in two different bundles.
> They both try to use the same configuration and it starts this "spinning"
> process
>
>
>
> On Sun, Aug 21, 2016 at 1:55 AM Jean-Baptiste Onofré 
> wrote:
>
> Hi James,
>
> you mean that you use  in two blueprint
> descriptors using the same persistent-id ?
>
> Are the blueprint descriptors in two containers (two bundles) or the
> same one ?
>
> Regards
> JB
>
> On 08/20/2016 09:43 PM, James Carman wrote:
> > We have a situation where we don't really know where we have the issue
> > of two Blueprint bundles attempting to share the same persistent-id.  We
> > just see the "spinning" symptom, so we assume that it's there.  Is there
> > any command that can help me narrow it down?
> >
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>


Re: Detecting persistent-id sharing...

2016-08-23 Thread James Carman
No ideas?
On Sun, Aug 21, 2016 at 9:44 AM James Carman 
wrote:

> And, yes, that is exactly what I am talking about. A property placeholder
> is defined in two different blueprint containers in two different bundles.
> They both try to use the same configuration and it starts this "spinning"
> process
>
> On Sun, Aug 21, 2016 at 1:55 AM Jean-Baptiste Onofré 
> wrote:
>
>> Hi James,
>>
>> you mean that you use  in two blueprint
>> descriptors using the same persistent-id ?
>>
>> Are the blueprint descriptors in two containers (two bundles) or the
>> same one ?
>>
>> Regards
>> JB
>>
>> On 08/20/2016 09:43 PM, James Carman wrote:
>> > We have a situation where we don't really know where we have the issue
>> > of two Blueprint bundles attempting to share the same persistent-id.  We
>> > just see the "spinning" symptom, so we assume that it's there.  Is there
>> > any command that can help me narrow it down?
>> >
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>


Re: Detecting persistent-id sharing...

2016-08-21 Thread James Carman
And, yes, that is exactly what I am talking about. A property placeholder
is defined in two different blueprint containers in two different bundles.
They both try to use the same configuration and it starts this "spinning"
process

On Sun, Aug 21, 2016 at 1:55 AM Jean-Baptiste Onofré 
wrote:

> Hi James,
>
> you mean that you use  in two blueprint
> descriptors using the same persistent-id ?
>
> Are the blueprint descriptors in two containers (two bundles) or the
> same one ?
>
> Regards
> JB
>
> On 08/20/2016 09:43 PM, James Carman wrote:
> > We have a situation where we don't really know where we have the issue
> > of two Blueprint bundles attempting to share the same persistent-id.  We
> > just see the "spinning" symptom, so we assume that it's there.  Is there
> > any command that can help me narrow it down?
> >
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Re: Detecting persistent-id sharing...

2016-08-21 Thread James Carman
I think they are in two separate bundles. This isn't something that is
intentional. We have our system set up as plug-ins. So, I don't know who is
the offender. We just add the plug-ins to our container and they get
registered using the whiteboard pattern

On Sun, Aug 21, 2016 at 1:55 AM Jean-Baptiste Onofré 
wrote:

> Hi James,
>
> you mean that you use  in two blueprint
> descriptors using the same persistent-id ?
>
> Are the blueprint descriptors in two containers (two bundles) or the
> same one ?
>
> Regards
> JB
>
> On 08/20/2016 09:43 PM, James Carman wrote:
> > We have a situation where we don't really know where we have the issue
> > of two Blueprint bundles attempting to share the same persistent-id.  We
> > just see the "spinning" symptom, so we assume that it's there.  Is there
> > any command that can help me narrow it down?
> >
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Detecting persistent-id sharing...

2016-08-20 Thread James Carman
We have a situation where we don't really know where we have the issue of
two Blueprint bundles attempting to share the same persistent-id.  We just
see the "spinning" symptom, so we assume that it's there.  Is there any
command that can help me narrow it down?


Re: Introducing blueprint-test

2016-08-15 Thread James Carman
This is cool, Matt! I am sure a lot of us have already gone through this
hassle, but I have not seen it formalized yet. Good work!

On Mon, Aug 15, 2016 at 9:51 AM Matt Pavlovich  wrote:

> This blueprint-test is useful for testing blueprints that do *not*
> contain Camel routes.  The camel-test-blueprint requires a Camel route to
> startup, so it can't be used as a general purpose blueprint test library.
> -Matt Pavlovich
>
>
> On 8/14/16 7:59 AM, Jean-Baptiste Onofré wrote:
>
> What's the purpose exactly ?
>
> I wrote a blog about camel blueprint testing already a while ago ?
>
> Regards
> JB
> On Aug 12, 2016, at 10:11, Matt Pavlovich  wrote:
>>
>> I've taken Camel Test Blueprint and removed all the Camel parts to have
>> a self-contained library that allows for quick testing of blueprint
>> files. Thought folks here might find it handy (please excuse the
>> x-post). I opened a JIRA with Aries Blueprint for inclusion into upstream.
>>
>> Code:https://github.com/mattrpav/blueprint-test
>>
>> Aries JIRA:https://issues.apache.org/jira/browse/ARIES-1592
>>
>> -Matt
>>
>>
>>
>


Re: 4.0.6 release

2016-08-15 Thread James Carman
That's great!  Thanks again, JB.  Let us know if there's something we can
help with.  :)


On Mon, Aug 15, 2016 at 9:32 AM Jean-Baptiste Onofré 
wrote:

> Hi James
>
> I plan to cut the release and submit to vote on Thursday. I have some work
> in progress.
>
> Regards
> JB
> On Aug 15, 2016, at 14:22, James Carman 
> wrote:
>>
>>


Re: 4.0.6 release

2016-08-15 Thread James Carman
JB,

What's the current plan on 4.0.6?  I can hold off a release of my custom
container if it's happening relatively soon.  We'd love to have the proper
boot feature ordering stuff.  Thanks for getting 3.0.8 out so quickly, btw!

Thanks,

James

On Thu, Aug 4, 2016 at 9:17 AM Jean-Baptiste Onofré  wrote:

> Hi Jason,
>
> The plan is 3.0.8 end of this week and 4.0.6 end of next week (or
> beginning of the following one).
>
> Regards
> JB
>
> On 08/04/2016 03:00 PM, Jason Smith wrote:
> > Hello! Are there any updates on when 4.0.6 will be released?  Thanks
> >
> >
> >
> > -  Jason
> >
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>


Staged Boot Features Causes Exception in CXF Clients...

2016-08-06 Thread James Carman
We were playing around with setting up stages for our boot features (until
3.0.8 comes out which fixes the ordering).  When we use stages, we start
getting exceptions:

"No conduit initiator was found for the namespace
http://cxf.apache.org/transports/http";

I assume this has something to do with a thread context classloader, but
wanted to know if anyone else has ever encountered (and hopefully fixed)
the issue.  Removing the parenthesis (the stages) from the featuresBoot
makes the problem go away.

Thanks,

James


Re: More entropy on bundle startup.

2016-07-14 Thread James Carman
You are using featuresBoot?  Do you have featuresBootAsynchronous=false in
your org.apache.karaf.features.cfg file?

On Thu, Jul 14, 2016 at 9:33 AM Benson Margulies 
wrote:

> I don't think so, no. I do not do any dynamic installation. I use the
> Maven plugin to make an assembly with all the features I need. I then
> observe that the startup order is not deterministic from machine to
> machine, and it is particularly prone to change when I stop and start
> the container without clearing out the data directory.
>
>
> On Thu, Jul 14, 2016 at 1:39 AM, Jean-Baptiste Onofré 
> wrote:
> > Hi Benson,
> >
> > I guess you are using the deploy folder, so the fileinstall deployer,
> right
> > ?
> >
> > Regards
> > JB
> >
> >
> > On 07/13/2016 10:56 PM, Benson Margulies wrote:
> >>
> >> Folks,
> >>
> >> We've had a couple of incidents of latent problems stemming from
> >> invalid assumptions on bundle start order. Everything seems to be
> >> fine, then some trivial change reveals that we've failed to ensure
> >> that service 'a' is available before component 'b' needs it. by and
> >> large, we use DS to get this right, but there are a few cases where it
> >> does not serve.
> >>
> >> I am wondering: is there some way to get _more_ randomness out of the
> >> startup process, to shake out mistakes like this?
> >>
> >> thanks,
> >> benson
> >>
> >
> > --
> > Jean-Baptiste Onofré
> > jbono...@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
>


Re: JAX-RS Annotations and Apache Karaf 4.0.5

2016-07-02 Thread James Carman
There's Jersey, the reference implementation

On Sat, Jul 2, 2016 at 8:00 PM  wrote:

> >
> > Very interesting. Thank you for this.
> >
> >> [1] https://wiki.eclipse.org/Distribution_Providers
> >> [2] https://wiki.eclipse.org/EIG:Remote_Services_Admin
> >> [3]
> >>
> https://wiki.eclipse.org/Tutorial:_Exposing_a_Jax_REST_service_as_an_OSGi_Remote_Service
> >> [4] https://github.com/ECF/JaxRSProviders
> >> [5] https://www.eclipse.org/ecf/
> >
> >
> > Question: is there a more light-weight JAX-RS implementation out there?
>
> The only other jaxrs impls that I know about are resteasy and restlet.
> Might be new/others of course.
>
>
>
>


Re: JAX-RS Annotations and Apache Karaf 4.0.5

2016-07-02 Thread James Carman
On Sat, Jul 2, 2016 at 4:13 AM David Leangen  wrote:

>
>
> Question: is there a more light-weight JAX-RS implementation out there? I
> am not happy about how bloated CFX seems to be. I don’t like having to pull
> in that long list of dependencies. For something as “simple” as REST, it
> sure complicates my system. Bleh.
>
>
This is the list of dependencies for the "cxf-jaxrs" feature version 3.1.6
in Karaf:

feature "cxf-specs":

mvn:org.apache.geronimo.specs/geronimo-osgi-registry/1.1 start-level=9
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.6.0
start-level=10
mvn:javax.annotation/javax.annotation-api/1.2 start-level=10
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/2.6.0
start-level=10
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/2.6.0
start-level=10
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.6.0
start-level=10
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.saaj-api-1.3/2.6.0
start-level=10
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-2.0.1/2.6.0
start-level=10
mvn:javax.mail/mail/1.4.4 start-level=10
mvn:org.codehaus.woodstox/stax2-api/3.1.4 start-level=20
mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1 start-level=20
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.11_1
start-level=20
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/2.2.11_1
start-level=20

feature "cxf-core":

mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.1 start-level=30
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5
start-level=25
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.fastinfoset/1.2.13_1
start-level=30
mvn:org.apache.cxf/cxf-core/3.1.6 start-level=40
mvn:org.apache.cxf/cxf-rt-management/3.1.6 start-level=40

feature "cxf-http":

mvn:org.apache.cxf/cxf-rt-transports-http/3.1.6 start-level=40

feature "cxf-jaxrs":

mvn:org.codehaus.jettison/jettison/1.3.7 start-level=30
mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.1.6 start-level=40
mvn:org.apache.cxf/cxf-rt-rs-extension-search/3.1.6 start-level=40
mvn:org.apache.cxf/cxf-rt-rs-service-description/3.1.6 start-level=40
mvn:org.apache.cxf/cxf-rt-frontend-jaxrs/3.1.6 start-level=40
mvn:org.apache.cxf/cxf-rt-rs-client/3.1.6 start-level=40

Most of that is the "spec" stuff.  I wouldn't really consider that too
bloated.  It's extremely easy to install using Karaf features:

feature:repo-add cxf 3.1.6
feature:install cxf-jaxrs


Re: JAX-RS Annotations and Apache Karaf 4.0.5

2016-06-30 Thread James Carman
Consider using CXF. Very well tested.
On Thu, Jun 30, 2016 at 8:46 AM Artur Lojewski  wrote:

> OK,
>
> thanks both of you for your response! I forgot to mention that I am using
> the 'OSGi JAX-RS Connector' v5.3.1 from EclipseSource.
>
> So one can use the config admin to set the 'root' path as follows:
>
> /config:property-set -p com.eclipsesource.jaxrs.connector root /foo/
>
> This works for root paths like '/abc', '/ab' and '/a' - but not '/' alone!
> When I use '/' as root path value I cannot call http://localhost/abd/def.
> This seems to be a bug in the implementation.
>
> Moreover, configuring the 2nd config admin parameter 'publishDelay' results
> in a ClassCastException...
>
> So I guess I have to contact Holger Staudacher (OSGi JAX-RS Connector /
> GitHub).
>
> Thanks for your help!
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/JAX-RS-Annotations-and-Apache-Karaf-4-0-5-tp4047001p4047014.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: Different log level for different Karaf Bundles

2016-06-30 Thread James Carman
Are you perhaps looking for the "additivity" flag?

https://logging.apache.org/log4j/1.2/manual.html

On Thu, Jun 30, 2016 at 8:33 AM Bengt Rodehav  wrote:

> You can do this by using MDC combined with filters (I implemented that in
> Pax logging a few years back).
>
> E g if you use this root logger:
>
> log4j.rootLogger=INFO, stdout, info, error, bundle, context, osgi:*
>
> And you define the "bundle" log as follows:
>
> log4j.appender.bundle=org.apache.log4j.sift.MDCSiftingAppender
> log4j.appender.bundle.key=bundle.name
> log4j.appender.bundle.default=karaf
> log4j.appender.bundle.appender=org.apache.log4j.RollingFileAppender
> log4j.appender.bundle.appender.MaxFileSize=1MB
> log4j.appender.bundle.appender.MaxBackupIndex=2
> log4j.appender.bundle.appender.layout=org.apache.log4j.PatternLayout
> log4j.appender.bundle.appender.layout.ConversionPattern=%d{ISO8601} |
> %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
> log4j.appender.bundle.appender.file=${logdir}/bundles/$\\{bundle.name
> \\}.log
> log4j.appender.bundle.appender.append=true
> log4j.appender.bundle.threshold=INFO
>
> You will end up with a separate log file per bundle (named with the
> bundle's name). I use a custom variable (${logdir}) to specify where to
> create the log file but you can do as you wish. In this case these log
> files will be at INFO level.
>
> Sometimes I want TRACE logging on a specific bundle. I can then do as
> follows:
>
> log4j.rootLogger=TRACE, stdout, info, error, bundle, context, osgi:*,
> bundle_trace
>
> log4j.appender.bundle_trace=org.apache.log4j.sift.MDCSiftingAppender
> log4j.appender.bundle_trace.key=bundle.name
> log4j.appender.bundle_trace.default=karaf
> log4j.appender.bundle_trace.appender=org.apache.log4j.RollingFileAppender
> log4j.appender.bundle_trace.appender.MaxFileSize=10MB
> log4j.appender.bundle_trace.appender.MaxBackupIndex=2
> log4j.appender.bundle_trace.appender.layout=org.apache.log4j.PatternLayout
> log4j.appender.bundle_trace.appender.layout.ConversionPattern=%d{ISO8601}
> | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
> log4j.appender.bundle_trace.appender.file=${logdir}/bundles/trace/$\\{
> bundle.name\\}.log
> log4j.appender.bundle_trace.appender.append=true
> log4j.appender.bundle_trace.threshold=TRACE
> log4j.appender.bundle_trace.filter.a=org.apache.log4j.filter.MDCMatchFilter
> log4j.appender.bundle_trace.filter.a.exactMatch=false
> log4j.appender.bundle_trace.filter.a.keyToMatch=bundle.name
>
> log4j.appender.bundle_trace.filter.a.valueToMatch=org.apache.aries.blueprint.core
> # DenyAllFilter should always be the last filter
> log4j.appender.bundle_trace.filter.z=org.apache.log4j.varia.DenyAllFilter
>
> In the above example I create a separate TRACE log for the bundle with the
> name "org.apache.aries.blueprint.core".
>
> It is also possible to configure custom logging for a particular camel
> context which we do in our integration platform based on Karaf and Camel.
>
> /Bengt
>
>
>
>
>
>
>
>
>
>
> 2016-06-30 13:59 GMT+02:00 Jean-Baptiste Onofré :
>
>> Then it's different sift appenders that you have to define.
>>
>> Generally speaking, you don't need sift for what you want: if your
>> bundles use different loggers, then, just create the logger category in the
>> pax-logging config.
>>
>> Regards
>> JB
>>
>> On 06/30/2016 01:56 PM, Debraj Manna wrote:
>>
>>>
>>> Yeah if I enable sifting appender let's say with a config  and add it to
>>> rootLogger
>>>
>>> log4j.appender.sift.threshold=DEBUG
>>>
>>>
>>> Then this will make log level DEBUGfor all bundles. I am trying to ask
>>> is let's say I have two bundles1& bundles2and I want bundle1 's log
>>> level to be DEBUGand bundle2log level to be ERROR.
>>>
>>>
>>> On Thu, Jun 30, 2016 at 2:12 PM, Jean-Baptiste Onofré >> > wrote:
>>>
>>> Hi,
>>>
>>> I don't see the sift appender enable for the root logger.
>>>
>>> You should have:
>>>
>>> log4j.rootLogger=DEBUG, async, sift, osgi:*
>>>
>>> Regards
>>> JB
>>>
>>> On 06/30/2016 08:23 AM, Debraj Manna wrote:
>>>
>>> In |Karaf 3.0.5| running under |Servicemix 6.1.0| my
>>> |org.ops4j.pax.logging.cfg| looks like below:-
>>>
>>> |# Root logger log4j.rootLogger=DEBUG, async, osgi:*
>>> log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer #
>>> To
>>> avoid flooding the log when using DEBUG level on an ssh
>>> connection and
>>> doing log:tail
>>> log4j.logger.org.apache.sshd.server.channel.ChannelSession =
>>> INFO #
>>> CONSOLE appender not used by default
>>> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>>> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} |
>>> %-5.5p |
>>> %-16.16t | %-32.32c{1} | %X{bundle.id 
>>> } -
>>> %X{bundle.name  

Re: hibernate validator feature

2015-11-07 Thread James Carman
I usually do not try to work with hibernate validator that way. I expose
OSGi services. When I am at a computer later, I can show you an example.

On Sat, Nov 7, 2015 at 2:29 PM Benson Margulies 
wrote:

> I created a simple pax-exam test of the hibernate-validator feature, and I
> get:
>
> javax.validation.ValidationException: Unable to create a
> Configuration, because no Bean Validation provider could be found. Add
> a provider like Hibernate Validator (RI) to your classpath.
>
> Any suggestions?
>
> @ProbeBuilder
> public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) {
> probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*");
> return probe;
> }
>
> @Configuration
> public Option[] configure() throws Exception {
> loadProps();
> karafDebug = false;
>
> return options(karafDistributionConfiguration()
> .frameworkUrl(
> maven()
> .groupId("org.apache.karaf")
> .artifactId("apache-karaf")
> .type("zip")
> .version(karafVersion))
> .karafVersion(karafVersion).name("Apache Karaf")
> .unpackDirectory(new File("target/pax"))
> .useDeployFolder(false),
> keepRuntimeFolder(),
> configureConsole().ignoreLocalConsole(),
> logLevel(LogLevelOption.LogLevel.INFO),
> features(maven().groupId("org.apache.karaf.features")
> .artifactId("enterprise")
> .version(karafVersion)
> .classifier("features")
> .type("xml"),
> "hibernate-validator"),
> when(karafDebug).useOptions(debugConfiguration()),
> junitBundles(),
> systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
>
> systemProperty("org.ops4j.pax.exam.rbc.rmi.host").value("localhost")
> );
> }
>


NCSA Logging?

2015-10-01 Thread James Carman
Has anyone tried turning on NCSA logging in Karaf using Pax Web settings
file org.ops4j.pax.web.cfg?  When I turn it on, I see in the logs that it
is indeed starting and I see an empty log file created, but all of my CXF
endpoints stop responding.  Any ideas?


Re: BouncyCastle

2015-07-27 Thread James Carman
We're probably going to have to monkey with the MANIFEST.MF file to get the
right imports.

On Mon, Jul 27, 2015 at 10:30 AM Benson Margulies 
wrote:

> Yes, I did that. It does not bring BC into the classpath of the shell
> service.
>
> See the git repo, and see what you can do with it.
>
>
> On Mon, Jul 27, 2015 at 10:13 AM, James Carman
>  wrote:
> > With PAX-Exam, you can install bundles into Karaf.  Look at the option
> type
> > mavenBundle() used here:
> >
> >
> https://github.com/ops4j/org.ops4j.pax.exam2/blob/master/samples/exam-itest-sample-karaf/src/test/java/org/ops4j/pax/exam/sample/karaf/CalculatorITest.java
> >
> >
> > On Mon, Jul 27, 2015 at 9:54 AM Benson Margulies 
> > wrote:
> >>
> >> James, I'm not sure that adding bundles on the test changes what's
> >> available on the server side, but I'll try it.
> >>
> >> On Mon, Jul 27, 2015 at 8:19 AM, James Carman
> >>  wrote:
> >> > Your pax exam test should be able to install the bundles it needs.
> >> >
> >> > On Mon, Jul 27, 2015 at 8:01 AM Benson Margulies <
> ben...@basistech.com>
> >> > wrote:
> >> >>
> >> >> I did write a pax-exam test, which fails because BC is missing.
> >> >>
> >> >> I think I can make the server side use PEM keys without BC, in spite
> of
> >> >> Mina.
>


Re: BouncyCastle

2015-07-27 Thread James Carman
With PAX-Exam, you can install bundles into Karaf.  Look at the option type
mavenBundle() used here:

https://github.com/ops4j/org.ops4j.pax.exam2/blob/master/samples/exam-itest-sample-karaf/src/test/java/org/ops4j/pax/exam/sample/karaf/CalculatorITest.java


On Mon, Jul 27, 2015 at 9:54 AM Benson Margulies 
wrote:

> James, I'm not sure that adding bundles on the test changes what's
> available on the server side, but I'll try it.
>
> On Mon, Jul 27, 2015 at 8:19 AM, James Carman
>  wrote:
> > Your pax exam test should be able to install the bundles it needs.
> >
> > On Mon, Jul 27, 2015 at 8:01 AM Benson Margulies 
> > wrote:
> >>
> >> I did write a pax-exam test, which fails because BC is missing.
> >>
> >> I think I can make the server side use PEM keys without BC, in spite of
> >> Mina.
>


Re: BouncyCastle

2015-07-27 Thread James Carman
Your pax exam test should be able to install the bundles it needs.
On Mon, Jul 27, 2015 at 8:01 AM Benson Margulies 
wrote:

> I did write a pax-exam test, which fails because BC is missing.
>
> I think I can make the server side use PEM keys without BC, in spite of
> Mina.
>


Re: BouncyCastle

2015-07-27 Thread James Carman
You can write a PAX exam-based test. I wasn't working yesterday, so I
haven't looked yet.
On Mon, Jul 27, 2015 at 6:38 AM Benson Margulies 
wrote:

> Yes, but if I'm making a patch to attach to a JIRA., what do I do?
> @Ignore and assume that someone who wants to test will comment it out
> and drop bcpg and comment it in?
>
>
> On Mon, Jul 27, 2015 at 4:58 AM, Jean-Baptiste Onofré 
> wrote:
> > You have the bcpg (BouncyCastly) bundles available at ServiceMix that you
> > can deploy in Karaf (or use as standalone).
> >
> > Regards
> > JB
> >
> >
> > On 07/27/2015 03:49 AM, Benson Margulies wrote:
> >>
> >> PEM key-reading in Mina requires BouncyCastle.
> >>
> >> So, the test I wrote to try out PEM keys in Karaf fails, because
> >> there's no BC in the default build.
> >>
> >> Any suggestions? I hate to offer a patch without a test.
> >>
> >> I wish that MINA had PEM reading support that didn't depend on BC.
> >>
> >
> > --
> > Jean-Baptiste Onofré
> > jbono...@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
>


Re: ssh keys

2015-07-26 Thread James Carman
My GitHub id is jwcarman.
On Sun, Jul 26, 2015 at 8:05 AM James Carman 
wrote:

> Perhaps we just make a custom provider that tries all three types?
> On Sun, Jul 26, 2015 at 8:03 AM Benson Margulies 
> wrote:
>
>> I could use help with the testing.
>>
>> https://github.com/bimargulies/karaf/tree/karaf-3882-pem
>>
>> I'm trying to make an itest, if you want to take that part, send me
>> your github ID and I'll add you to my repo.
>>
>>
>> On Sun, Jul 26, 2015 at 7:45 AM, James Carman
>>  wrote:
>> > Yeah it'd be good to be able to specify the provider in the cfg file.
>> I'd
>> > help with that patch if you want a partner in crime. :)
>> > On Sun, Jul 26, 2015 at 7:43 AM Benson Margulies 
>> > wrote:
>> >>
>> >> On Sun, Jul 26, 2015 at 7:33 AM, James Carman
>> >>  wrote:
>> >> > That was me. I just googled for the same error message and it looked
>> >> > like
>> >> > they needed to be using PEM files. JB gave you different advice to
>> check
>> >> > the
>> >> > key size and perhaps algorithm choices in the shell.cfg file. He's
>> most
>> >> > likely right as he knows karaf inside and out and I was guessing :)
>> >>
>> >> Sorry for the misattribution.
>> >>
>> >> GIven that the code at
>> >> org.apache.karaf.shell.ssh.Activator#createSshServer uses
>> >> SimpleGeneratorHostKeyProvider, this isn't going to work. I read the
>> >> relevant source. That class ignores JB's values when reading, and then
>> >> generates a key if it can't read. It only reads from serialized Java.
>> >>
>> >> I feel a patch coming on.
>> >>
>> >>
>> >> > On Sun, Jul 26, 2015 at 7:29 AM Benson Margulies <
>> ben...@basistech.com>
>> >> > wrote:
>> >> >>
>> >> >> JB, according to the thread you linked, somehow I have to convince
>> >> >> Karaf to use PEMGeneratorHostKeyProvider. I'll regenerate the key
>> and
>> >> >> see if by some happy accident it somehow tries to use it to read the
>> >> >> key.
>> >> >>
>> >> >>
>> >> >> On Sun, Jul 26, 2015 at 12:26 AM, Jean-Baptiste Onofré
>> >> >> 
>> >> >> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > can you check in etc/org.apache.karaf.shell.cfg that the keySize
>> and
>> >> >> > algorithm properties match you generated key.
>> >> >> >
>> >> >> > As the default is DSA (in etc/org.apache.karaf.shell.cfg), and as
>> you
>> >> >> > created a RSA key, I bet the problem is there.
>> >> >> >
>> >> >> > Regards
>> >> >> > JB
>> >> >> >
>> >> >> > On 07/26/2015 04:35 AM, Benson Margulies wrote:
>> >> >> >>
>> >> >> >> 2015-07-26 02:27:19,841 | WARN  | c]-nio2-thread-1 |
>> >> >> >> SimpleGeneratorHostKeyProvider   | 128 - org.apache.sshd.core -
>> >> >> >> 0.14.0
>> >> >> >> | Unable to read key /opt/karaf/apache-karaf/etc/ssh/docker:
>> >> >> >> java.io.StreamCorruptedException: invalid stream header:
>> 2D2D2D2D
>> >> >> >>
>> >> >> >> That's an ssh RSA private key, generated with ssh-keygen. Does it
>> >> >> >> have
>> >> >> >> to be PEM, or DSA, or both, or something?
>> >> >> >>
>> >> >> >
>> >> >> > --
>> >> >> > Jean-Baptiste Onofré
>> >> >> > jbono...@apache.org
>> >> >> > http://blog.nanthrax.net
>> >> >> > Talend - http://www.talend.com
>>
>


Re: ssh keys

2015-07-26 Thread James Carman
Perhaps we just make a custom provider that tries all three types?
On Sun, Jul 26, 2015 at 8:03 AM Benson Margulies 
wrote:

> I could use help with the testing.
>
> https://github.com/bimargulies/karaf/tree/karaf-3882-pem
>
> I'm trying to make an itest, if you want to take that part, send me
> your github ID and I'll add you to my repo.
>
>
> On Sun, Jul 26, 2015 at 7:45 AM, James Carman
>  wrote:
> > Yeah it'd be good to be able to specify the provider in the cfg file. I'd
> > help with that patch if you want a partner in crime. :)
> > On Sun, Jul 26, 2015 at 7:43 AM Benson Margulies 
> > wrote:
> >>
> >> On Sun, Jul 26, 2015 at 7:33 AM, James Carman
> >>  wrote:
> >> > That was me. I just googled for the same error message and it looked
> >> > like
> >> > they needed to be using PEM files. JB gave you different advice to
> check
> >> > the
> >> > key size and perhaps algorithm choices in the shell.cfg file. He's
> most
> >> > likely right as he knows karaf inside and out and I was guessing :)
> >>
> >> Sorry for the misattribution.
> >>
> >> GIven that the code at
> >> org.apache.karaf.shell.ssh.Activator#createSshServer uses
> >> SimpleGeneratorHostKeyProvider, this isn't going to work. I read the
> >> relevant source. That class ignores JB's values when reading, and then
> >> generates a key if it can't read. It only reads from serialized Java.
> >>
> >> I feel a patch coming on.
> >>
> >>
> >> > On Sun, Jul 26, 2015 at 7:29 AM Benson Margulies <
> ben...@basistech.com>
> >> > wrote:
> >> >>
> >> >> JB, according to the thread you linked, somehow I have to convince
> >> >> Karaf to use PEMGeneratorHostKeyProvider. I'll regenerate the key and
> >> >> see if by some happy accident it somehow tries to use it to read the
> >> >> key.
> >> >>
> >> >>
> >> >> On Sun, Jul 26, 2015 at 12:26 AM, Jean-Baptiste Onofré
> >> >> 
> >> >> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > can you check in etc/org.apache.karaf.shell.cfg that the keySize
> and
> >> >> > algorithm properties match you generated key.
> >> >> >
> >> >> > As the default is DSA (in etc/org.apache.karaf.shell.cfg), and as
> you
> >> >> > created a RSA key, I bet the problem is there.
> >> >> >
> >> >> > Regards
> >> >> > JB
> >> >> >
> >> >> > On 07/26/2015 04:35 AM, Benson Margulies wrote:
> >> >> >>
> >> >> >> 2015-07-26 02:27:19,841 | WARN  | c]-nio2-thread-1 |
> >> >> >> SimpleGeneratorHostKeyProvider   | 128 - org.apache.sshd.core -
> >> >> >> 0.14.0
> >> >> >> | Unable to read key /opt/karaf/apache-karaf/etc/ssh/docker:
> >> >> >> java.io.StreamCorruptedException: invalid stream header: 2D2D2D2D
> >> >> >>
> >> >> >> That's an ssh RSA private key, generated with ssh-keygen. Does it
> >> >> >> have
> >> >> >> to be PEM, or DSA, or both, or something?
> >> >> >>
> >> >> >
> >> >> > --
> >> >> > Jean-Baptiste Onofré
> >> >> > jbono...@apache.org
> >> >> > http://blog.nanthrax.net
> >> >> > Talend - http://www.talend.com
>


Re: ssh keys

2015-07-26 Thread James Carman
Yeah it'd be good to be able to specify the provider in the cfg file. I'd
help with that patch if you want a partner in crime. :)
On Sun, Jul 26, 2015 at 7:43 AM Benson Margulies 
wrote:

> On Sun, Jul 26, 2015 at 7:33 AM, James Carman
>  wrote:
> > That was me. I just googled for the same error message and it looked like
> > they needed to be using PEM files. JB gave you different advice to check
> the
> > key size and perhaps algorithm choices in the shell.cfg file. He's most
> > likely right as he knows karaf inside and out and I was guessing :)
>
> Sorry for the misattribution.
>
> GIven that the code at
> org.apache.karaf.shell.ssh.Activator#createSshServer uses
> SimpleGeneratorHostKeyProvider, this isn't going to work. I read the
> relevant source. That class ignores JB's values when reading, and then
> generates a key if it can't read. It only reads from serialized Java.
>
> I feel a patch coming on.
>
>
> > On Sun, Jul 26, 2015 at 7:29 AM Benson Margulies 
> > wrote:
> >>
> >> JB, according to the thread you linked, somehow I have to convince
> >> Karaf to use PEMGeneratorHostKeyProvider. I'll regenerate the key and
> >> see if by some happy accident it somehow tries to use it to read the
> >> key.
> >>
> >>
> >> On Sun, Jul 26, 2015 at 12:26 AM, Jean-Baptiste Onofré  >
> >> wrote:
> >> > Hi,
> >> >
> >> > can you check in etc/org.apache.karaf.shell.cfg that the keySize and
> >> > algorithm properties match you generated key.
> >> >
> >> > As the default is DSA (in etc/org.apache.karaf.shell.cfg), and as you
> >> > created a RSA key, I bet the problem is there.
> >> >
> >> > Regards
> >> > JB
> >> >
> >> > On 07/26/2015 04:35 AM, Benson Margulies wrote:
> >> >>
> >> >> 2015-07-26 02:27:19,841 | WARN  | c]-nio2-thread-1 |
> >> >> SimpleGeneratorHostKeyProvider   | 128 - org.apache.sshd.core -
> 0.14.0
> >> >> | Unable to read key /opt/karaf/apache-karaf/etc/ssh/docker:
> >> >> java.io.StreamCorruptedException: invalid stream header: 2D2D2D2D
> >> >>
> >> >> That's an ssh RSA private key, generated with ssh-keygen. Does it
> have
> >> >> to be PEM, or DSA, or both, or something?
> >> >>
> >> >
> >> > --
> >> > Jean-Baptiste Onofré
> >> > jbono...@apache.org
> >> > http://blog.nanthrax.net
> >> > Talend - http://www.talend.com
>


Re: ssh keys

2015-07-26 Thread James Carman
That was me. I just googled for the same error message and it looked like
they needed to be using PEM files. JB gave you different advice to check
the key size and perhaps algorithm choices in the shell.cfg file. He's most
likely right as he knows karaf inside and out and I was guessing :)
On Sun, Jul 26, 2015 at 7:29 AM Benson Margulies 
wrote:

> JB, according to the thread you linked, somehow I have to convince
> Karaf to use PEMGeneratorHostKeyProvider. I'll regenerate the key and
> see if by some happy accident it somehow tries to use it to read the
> key.
>
>
> On Sun, Jul 26, 2015 at 12:26 AM, Jean-Baptiste Onofré 
> wrote:
> > Hi,
> >
> > can you check in etc/org.apache.karaf.shell.cfg that the keySize and
> > algorithm properties match you generated key.
> >
> > As the default is DSA (in etc/org.apache.karaf.shell.cfg), and as you
> > created a RSA key, I bet the problem is there.
> >
> > Regards
> > JB
> >
> > On 07/26/2015 04:35 AM, Benson Margulies wrote:
> >>
> >> 2015-07-26 02:27:19,841 | WARN  | c]-nio2-thread-1 |
> >> SimpleGeneratorHostKeyProvider   | 128 - org.apache.sshd.core - 0.14.0
> >> | Unable to read key /opt/karaf/apache-karaf/etc/ssh/docker:
> >> java.io.StreamCorruptedException: invalid stream header: 2D2D2D2D
> >>
> >> That's an ssh RSA private key, generated with ssh-keygen. Does it have
> >> to be PEM, or DSA, or both, or something?
> >>
> >
> > --
> > Jean-Baptiste Onofré
> > jbono...@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
>


Re: ssh keys

2015-07-25 Thread James Carman
Try PEM
http://apache-mina.10907.n7.nabble.com/Serious-issue-in-SimpleGeneratorHostKeyProvider-class-td41924.html

On Sat, Jul 25, 2015 at 10:35 PM Benson Margulies 
wrote:

> 2015-07-26 02:27:19,841 | WARN  | c]-nio2-thread-1 |
> SimpleGeneratorHostKeyProvider   | 128 - org.apache.sshd.core - 0.14.0
> | Unable to read key /opt/karaf/apache-karaf/etc/ssh/docker:
> java.io.StreamCorruptedException: invalid stream header: 2D2D2D2D
>
> That's an ssh RSA private key, generated with ssh-keygen. Does it have
> to be PEM, or DSA, or both, or something?
>


Re: Karaf Custom Distribution and the deploy folder

2015-07-21 Thread James Carman
I would recommend using features for this. If you do, you can make your
assembly project dependent (use runtime scope) on the feature and it will
pull it into the system repo of your distribution. Then you can include it
as a boot feature.

On Tue, Jul 21, 2015 at 9:55 AM Marc Durand  wrote:

> Thanks you JB and James.  For anyone else trying to do this in the future,
> this worked for me:
>
>  
> org.apache.maven.plugins
> maven-dependency-plugin
> 
>
>   copy
>   generate-resources
>   
>  copy
>   
>   
>  
> 
>...
>...
>...
> 
>  
>
> ${project.build.directory}/assembly/deploy
>   
>
> 
>  
>
> Marc
>
> On Tue, Jul 21, 2015 at 9:00 AM, Jean-Baptiste Onofré 
> wrote:
>
>> It should be possible using dependency plugin execution, in
>> generate-resources phase, and after using the resource plugin.
>>
>> Regards
>> JB
>>
>> On 07/21/2015 02:54 PM, Marc Durand wrote:
>>
>>> Thanks for your response James.  I would like to get artifacts from a
>>> maven repository and include them in the deploy folder.  From what I
>>> understand, the resources configuration cannot pull from a maven repo.
>>>
>>> Marc
>>>
>>> On Tue, Jul 21, 2015 at 8:10 AM, James Carman
>>> mailto:ja...@carmanconsulting.com>> wrote:
>>>
>>> You can use resources in your project.
>>>
>>> On Tue, Jul 21, 2015 at 7:07 AM Marc Durand >> <mailto:marc.dur...@gmail.com>> wrote:
>>>
>>> Hi JB, sorry it wasn't clear.  I want to create a custom
>>> distribution and include some files in the deploy folder.
>>> Thanks,
>>> Marc
>>>
>>> On Jul 21, 2015 2:05 AM, "Jean-Baptiste Onofré" >> <mailto:j...@nanthrax.net>> wrote:
>>>
>>> Hi Marc,
>>>
>>> Not sure to follow you: did you drop jar file in the deploy
>>> folder ?
>>> Or do you want to create a custom distribution including
>>> some file in the deploy folder ?
>>>
>>> Regards
>>> JB
>>>
>>> On 07/20/2015 06:02 PM, Marc Durand wrote:
>>>
>>> I have a Karaf custom distribution and I am unable to
>>> figure out how to add
>>> files into the "deploy" folder which is possible
>>> according to:
>>>
>>> http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html
>>>
>>> I have tried to add my bundles as dependancies in the
>>> pom.xml but there was
>>> no effect.  How would I go about doing this?
>>>
>>> Thanks in advance,
>>> Marc
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>>
>>> http://karaf.922171.n3.nabble.com/Karaf-Custom-Distribution-and-the-deploy-folder-tp4041510.html
>>> Sent from the Karaf - User mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> --
>>> 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
>>
>
>


Re: Karaf Custom Distribution and the deploy folder

2015-07-21 Thread James Carman
You can use resources in your project.
On Tue, Jul 21, 2015 at 7:07 AM Marc Durand  wrote:

> Hi JB, sorry it wasn't clear.  I want to create a custom distribution and
> include some files in the deploy folder.
> Thanks,
> Marc
> On Jul 21, 2015 2:05 AM, "Jean-Baptiste Onofré"  wrote:
>
>> Hi Marc,
>>
>> Not sure to follow you: did you drop jar file in the deploy folder ?
>> Or do you want to create a custom distribution including some file in the
>> deploy folder ?
>>
>> Regards
>> JB
>>
>> On 07/20/2015 06:02 PM, Marc Durand wrote:
>>
>>> I have a Karaf custom distribution and I am unable to figure out how to
>>> add
>>> files into the "deploy" folder which is possible according to:
>>>
>>> http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html
>>>
>>> I have tried to add my bundles as dependancies in the pom.xml but there
>>> was
>>> no effect.  How would I go about doing this?
>>>
>>> Thanks in advance,
>>> Marc
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Karaf-Custom-Distribution-and-the-deploy-folder-tp4041510.html
>>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>


Re: installing activemq and seeing very strange behavior

2015-07-17 Thread James Carman
Yes, we ran into it too, but noweb did start for us. Let us know if you
find the version where it goes wonky.
On Fri, Jul 17, 2015 at 7:19 PM Pratt, Jason 
wrote:

>  I did try that, its still having the same effect. I am going to try
> version 5.10.2 next and keep downgrading until I find one that works with
> 3.0.4
>
> This is very frustrating.
>
>
>
> *From:* James Carman [mailto:ja...@carmanconsulting.com]
> *Sent:* Friday, July 17, 2015 4:53 PM
> *To:* user@karaf.apache.org
> *Subject:* Re: installing activemq and seeing very strange behavior
>
>
>
> Try installing the activemq-broker-noweb feature. Something is wrong with
> the webconsole it seems.
>
> On Fri, Jul 17, 2015 at 6:43 PM Pratt, Jason 
> wrote:
>
>  I’ve confirmed this happening on other team members pc’s as well. I
> assume there is an undocumented trick to getting activemq to install
> properly?
>
>
>
> *From:* Pratt, Jason [mailto:jason.pr...@windriver.com]
> *Sent:* Friday, July 17, 2015 1:17 PM
> *To:* user@karaf.apache.org
> *Subject:* installing activemq and seeing very strange behavior
>
>
>
> Hello – While installing ActiveMQ via a KAR I am seeing strange behavior.
> Tailing the log to watch the install, I experience:
>
> 1.  Log entry saying the Blueprint container is being destroyed
>
> 2.  Exiting the log to the main Karaf shell
>
> 3.  Then seeing the initial banner loading anywhere from 2 – 5 times
>
> 4.  Final error is a PermGen, but I have that set to 1024M and 2G
> respectively
>
>
>
> What would be causing this?
>
>
>
>
>
> 2015-07-17 13:10:43,537 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.system.command
>
> 2015-07-17 13:10:43,577 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.bundle.core
>
> 2015-07-17 13:10:43,647 | INFO  | xFrameworkWiring |
> Activator| 122 -
> org.ops4j.pax.web.pax-web-extender-war - 3.2.3 | Destroying extension for
> bundle org.apache.activemq.activemq-web-console
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring | activemq-web-console
> - 204}  | 108 - org.eclipse.jetty.aggregate.jetty-all-server -
> 8.1.17.v20150415 | Destroying Spring FrameworkServlet 'dispatcher'
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> XmlWebApplicationContext | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Closing
> WebApplicationContext for namespace 'dispatcher-servlet': startup date [Fri
> Jul 17 13:10:41 PDT 2015]; parent: Root WebApplicationContext
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> DefaultListableBeanFactory   | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Destroying singletons
> in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@5f8bdda8:
> defining beans
> [handlerMapping,/createDestination.action,/deleteDestination.action,/createSubscriber.action,/deleteSubscriber.action,/sendMessage.action,/purgeDestination.action,/deleteMessage.action,/copyMessage.action,/moveMessage.action,/deleteJob
>
> .action,exceptionResolver]; parent:
> org.springframework.beans.factory.support.DefaultListableBeanFactory@63eb624a
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> XmlWebApplicationContext | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Closing Root
> WebApplicationContext: startup date [Fri Jul 17 13:10:41 PDT 2015]; root of
> context hierarchy
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> DefaultListableBeanFactory   | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Destroying singletons
> in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@63eb624a:
> defining beans
> [queueBrowser,messageQuery,queueConsumerQuery,queueProducerQuery,topicProducerQuery,topicSubscriberQuery,connectionQuery,placeholderConfig,sessionPool,configuration,brokerQuery,connectionFactory];
> root of factory hierarchy
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> ContextHandler   | 108 -
> org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 | stopped
> HttpServiceContext{httpContext=WebAppHttpContext{org.apache.activemq.activemq-web-console
> - 204}}
>
> 2015-07-17 13:10:43,667 | INFO  | xFrameworkWiring |
> HttpServiceFactoryImpl   | 116 - org.ops4j.pax.web.pax-web-runtime
> - 3.2.3 | Unbinding bundle: [org.apache.activemq.activemq-web-console [204]]
>
&

Re: installing activemq and seeing very strange behavior

2015-07-17 Thread James Carman
Try installing the activemq-broker-noweb feature. Something is wrong with
the webconsole it seems.
On Fri, Jul 17, 2015 at 6:43 PM Pratt, Jason 
wrote:

>  I’ve confirmed this happening on other team members pc’s as well. I
> assume there is an undocumented trick to getting activemq to install
> properly?
>
>
>
> *From:* Pratt, Jason [mailto:jason.pr...@windriver.com]
> *Sent:* Friday, July 17, 2015 1:17 PM
> *To:* user@karaf.apache.org
> *Subject:* installing activemq and seeing very strange behavior
>
>
>
> Hello – While installing ActiveMQ via a KAR I am seeing strange behavior.
> Tailing the log to watch the install, I experience:
>
> 1.  Log entry saying the Blueprint container is being destroyed
>
> 2.  Exiting the log to the main Karaf shell
>
> 3.  Then seeing the initial banner loading anywhere from 2 – 5 times
>
> 4.  Final error is a PermGen, but I have that set to 1024M and 2G
> respectively
>
>
>
> What would be causing this?
>
>
>
>
>
> 2015-07-17 13:10:43,537 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.system.command
>
> 2015-07-17 13:10:43,577 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.bundle.core
>
> 2015-07-17 13:10:43,647 | INFO  | xFrameworkWiring |
> Activator| 122 -
> org.ops4j.pax.web.pax-web-extender-war - 3.2.3 | Destroying extension for
> bundle org.apache.activemq.activemq-web-console
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring | activemq-web-console
> - 204}  | 108 - org.eclipse.jetty.aggregate.jetty-all-server -
> 8.1.17.v20150415 | Destroying Spring FrameworkServlet 'dispatcher'
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> XmlWebApplicationContext | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Closing
> WebApplicationContext for namespace 'dispatcher-servlet': startup date [Fri
> Jul 17 13:10:41 PDT 2015]; parent: Root WebApplicationContext
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> DefaultListableBeanFactory   | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Destroying singletons
> in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@5f8bdda8:
> defining beans
> [handlerMapping,/createDestination.action,/deleteDestination.action,/createSubscriber.action,/deleteSubscriber.action,/sendMessage.action,/purgeDestination.action,/deleteMessage.action,/copyMessage.action,/moveMessage.action,/deleteJob
>
> .action,exceptionResolver]; parent:
> org.springframework.beans.factory.support.DefaultListableBeanFactory@63eb624a
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> XmlWebApplicationContext | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Closing Root
> WebApplicationContext: startup date [Fri Jul 17 13:10:41 PDT 2015]; root of
> context hierarchy
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> DefaultListableBeanFactory   | 204 -
> org.apache.activemq.activemq-web-console - 5.11.1 | Destroying singletons
> in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@63eb624a:
> defining beans
> [queueBrowser,messageQuery,queueConsumerQuery,queueProducerQuery,topicProducerQuery,topicSubscriberQuery,connectionQuery,placeholderConfig,sessionPool,configuration,brokerQuery,connectionFactory];
> root of factory hierarchy
>
> 2015-07-17 13:10:43,657 | INFO  | xFrameworkWiring |
> ContextHandler   | 108 -
> org.eclipse.jetty.aggregate.jetty-all-server - 8.1.17.v20150415 | stopped
> HttpServiceContext{httpContext=WebAppHttpContext{org.apache.activemq.activemq-web-console
> - 204}}
>
> 2015-07-17 13:10:43,667 | INFO  | xFrameworkWiring |
> HttpServiceFactoryImpl   | 116 - org.ops4j.pax.web.pax-web-runtime
> - 3.2.3 | Unbinding bundle: [org.apache.activemq.activemq-web-console [204]]
>
> 2015-07-17 13:10:43,687 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.kar.command
>
> 2015-07-17 13:10:43,707 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.camel.karaf.camel-karaf-commands
>
> 2015-07-17 13:10:43,767 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.aries.blueprint.core -
> 1.4.3 | Destroying BlueprintContainer for bundle
> org.apache.karaf.webconsole.http
>
> 2015-07-17 13:10:43,767 | INFO  | xFrameworkWiring |
> HttpPlugin   | 148 - org.apache.karaf.webconsole.http -
> 3.0.4 | Http plugin deactivated
>
> 2015-07-17 13:10:43,777 | INFO  | xFrameworkWiring |
> BlueprintExtender| 15 - org.apache.a

Re: Karaf 4.0.0 - Assembly failure => org.eclipse.osgi => freeze

2015-06-29 Thread James Carman
Do you have an example pom.xml file somewhere we can grab and try this?

On Mon, Jun 29, 2015 at 7:28 AM CLEMENT Jean-Philippe <
jean-philippe.clem...@fr.thalesgroup.com> wrote:

> The error message is not crystal clear. I’m not too sure what is missing.
> Seems to be “kernel” but it was assembled as a boot feature.
>
>
>
> JP
>
>
>
> [@@ OPEN @@]
>
>
>
> *De :* CLEMENT Jean-Philippe [mailto:
> jean-philippe.clem...@fr.thalesgroup.com]
> *Envoyé :* lundi 29 juin 2015 10:51
> *À :* user@karaf.apache.org
> *Objet :* RE: Karaf 4.0.0 - Assembly failure => org.eclipse.osgi => freeze
>
>
>
> Please find attached the log after a clean install and freeze.
>
>
>
> JP
>
>
>
> [@@ OPEN @@]
>
>
>
> *De :* Achim Nierbeck [mailto:bcanh...@googlemail.com
> ]
> *Envoyé :* lundi 29 juin 2015 10:34
> *À :* user@karaf.apache.org
> *Objet :* Re: Karaf 4.0.0 - Assembly failure => org.eclipse.osgi => freeze
>
>
>
> Hi,
>
>
>
> could you show us a bit more about the strange trace?
>
>
>
> The "." instead of "-" is expected as OSGi versions aren't allowed to have
> a "-" in it. So the maven-bundle plugin converts this to a dot.
>
>
>
> regards, Achim
>
>
>
>
>
> 2015-06-29 10:30 GMT+02:00 CLEMENT Jean-Philippe <
> jean-philippe.clem...@fr.thalesgroup.com>:
>
> Now the config.properties is fixed, Karaf starts then freezes. The log
> contains a strange trace complaining about a missing artifact.
>
> The trace is strange because of the artifact version which is looked at:
> 0.0.3.SNAPSHOT instead of 0.0.3-SNAPSHOT as defined.
>
> Another strange thing is I found a ".SNAPSHOT" in the generated
> MANIFEST.MF of the branding (under target/classes/META-INF): 0.0.1.SNPASHOT
> instead of 0.0.1-SNAPSHOT.
>
> Please help :)
>
> JP
>
> [@@ OPEN @@]
>
>
> -Message d'origine-
> De : CLEMENT Jean-Philippe [mailto:
> jean-philippe.clem...@fr.thalesgroup.com]
> Envoyé : lundi 29 juin 2015 10:16
> À : user@karaf.apache.org
> Objet : RE: Karaf 4.0.0 - Assembly failure => org.eclipse.osgi
>
> Haha!
>
> I did override the config.properties in the assembly in order to enable
> Equinox instead of Felix. This file mentions the equinox version!
>
> Thank you :)
>
> JP
>
> [@@ OPEN @@]
>
>
> -Message d'origine-
> De : Christian Schneider [mailto:cschneider...@gmail.com] De la part de
> Christian Schneider Envoyé : lundi 29 juin 2015 10:03 À :
> user@karaf.apache.org Objet : Re: Karaf 4.0.0 - Assembly failure =>
> org.eclipse.osgi
>
> org.eclipse.osgi is the equinox framework. You should not install this as
> a bundle. Instead switch karaf to use equinox instead of felix in the
> config.properties.
>
> Christian
>
> On 29.06.2015 09:56, CLEMENT Jean-Philippe wrote:
> > Found a thread which seems to suggest to remove "standard" from boot
> features. What I did. Assembly leads to success but during the runtime
> Karaf quickly fails with the message:
> > Could not resolve
> > mvn:org.eclipse/org.eclipse.osgi/3.8.2.v20130124-134944
> >
> > Two things seem wrong. I don't catch why it did not complain during the
> assembly as the assembly should embed it. Second is that this artifact is
> in our local repository.
> >
> > Help is welcome :)
> >
> > Regards,
> > JP
> >
> > [@@ OPEN @@]
> >
> >
> > -Message d'origine-
> > De : CLEMENT Jean-Philippe
> > [mailto:jean-philippe.clem...@fr.thalesgroup.com]
> > Envoyé : lundi 29 juin 2015 09:27
> > À : user@karaf.apache.org
> > Objet : Karaf 4.0.0 - Assembly failure
> >
> > Hi Jamie and all at Karaf,
> >
> > Glad to head Karaf 4.0.0 has been released!
> >
> > I just gave it a try but Maven fails during the assembly.
> >
> > The assembly was ok with Karaf 3.0.2, I just changed 3.0.2 versions to
> 4.0.0. The message is:
> > [ERROR] Failed to execute goal
> > org.apache.karaf.tooling:karaf-maven-plugin:4.0.0:assembly
> > (default-assembly) on project my-assembly: Unable to build assembly:
> > Could not find matching feature for standard -> [Help 1]
> >
> > Do you have a clue why?
> >
> > Thank you,
> > JP
> >
> > [@@ OPEN @@]
> >
> >
> > -Message d'origine-
> > De : Jamie G. [mailto:jamie.goody...@gmail.com] Envoyé : samedi 27 juin
> 2015 03:20 À : user@karaf.apache.org Objet : [ANN] Apache Karaf 4.0.0
> Released!
> >
> > The Karaf team is pleased to announce the release of Apache Karaf
> version 4.0.0.
> >
> > Apache Karaf is a small OSGi distribution which provides a ready to use
> container for server side applications.
> >
> > Apache Karaf 4.0.0 is the first production ready version of the new
> > 4.0.0 branch.
> > It's a major step forward, including a complete new features resolver, a
> large set of new features, improvements, and bug fixes.
> >
> > http://karaf.apache.org/
> >
> > This release is available from
> > http://karaf.apache.org/index/community/download.html#Karaf4.0.0 and
> >
> > Maven:
> >
> >   
> >   org.apache.karaf
> >   apache-karaf
> >   4.0.0
> >   
> >
> > Download Note:
> > Our mirrors are still syncing the new kits, if your primary mirror does
> not have the kit p

Re: Service ranking only has effect during bundle startup?

2015-06-03 Thread James Carman
Try using a ServiceTracker.

https://osgi.org/javadoc/r4v42/org/osgi/util/tracker/ServiceTracker.html#getServiceReference()

On Wed, May 20, 2015 at 8:01 AM nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Hi
>
> Are there any way to specify service loading so that the highest
> available ranked service will always be used no matter which state the
> bundle are in, currently it only loads the highest available service
> on load of the bundle.
>
> This means if I have 3 bundles, A,B and C. C uses either A or B. B are
> ranked 2 and A are ranked 1.
>
> If I go ahead and start karaf load bundle A,B and then C. C will be
> refering to B. If I stop B, C then points to A. If I then start B,
> bundle C still points to A. When bundle B are started I want bundle C
> to point to automatically pickup service B.
>
> How can I achieve this?
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>


Re: Problems with Blueprint services

2015-05-19 Thread James Carman
Yes, the Private-Package is what was messing things up, I believe.  That
setting is one that can get you in trouble.  What it does is it brings
anything on your classpath matching those patterns into your bundle and
doesn't export them.  If multiple people do that with a particular package,
then they will all have their own "flavor" of the classes in that package.
For example, in my osgi-sandbox project, I have this Private-Package
setting:

{local-packages],org.apache.commons.lang3

Then, my MANIFEST looks like:

Manifest-Version: 1.0

Bnd-LastModified: 1432042463489

Build-Jdk: 1.8.0_45

Build-Time: 2015-05-19T13:34:21Z

Built-By: jcarman

Bundle-DocURL: http://www.carmanconsulting.com

Bundle-ManifestVersion: 2

Bundle-Name: OSGi Sandbox :: Manifest Testing :: Private Package

Bundle-SymbolicName: com.carmanconsulting.sandbox.osgi.private-package

Bundle-Vendor: Carman Consulting, Inc.

Bundle-Version: 1.0.0.SNAPSHOT

Created-By: Apache Maven Bundle Plugin

Embed-Directory: lib

Export-Package: com.carmanconsulting.sandbox.osgi.manifest;version="1.0.

 0"

Implementation-Title: OSGi Sandbox :: Manifest Testing :: Private Packag

 e

Implementation-Vendor: Carman Consulting, Inc.

Implementation-Vendor-Id: com.carmanconsulting.sandbox.osgi

Implementation-Version: 1.0-SNAPSHOT

Import-Package:

 org.apache.commons.lang3.builder;version="[3.1,4)",

 org.apache.commons.lang3.exception;version="[3.1,4)",

 org.apache.commons.lang3.math;version="[3.1,4)",

 org.apache.commons.lang3.mutable;version="[3.1,4)",

 org.apache.commons.lang3.text.translate;version="[3.1,4)"

Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))"

Specification-Title: OSGi Sandbox :: Manifest Testing :: Private Package

Specification-Vendor: Carman Consulting, Inc.

Specification-Version: 1.0-SNAPSHOT

Tool: Bnd-2.3.0.201405100607


The jar file contains:


META-INF/MANIFEST.MF

META-INF/

META-INF/maven/

META-INF/maven/com.carmanconsulting.sandbox.osgi/

META-INF/maven/com.carmanconsulting.sandbox.osgi/private-package/

META-INF/maven/com.carmanconsulting.sandbox.osgi/private-package/pom.properties

META-INF/maven/com.carmanconsulting.sandbox.osgi/private-package/pom.xml

com/

com/carmanconsulting/

com/carmanconsulting/sandbox/

com/carmanconsulting/sandbox/osgi/

com/carmanconsulting/sandbox/osgi/manifest/

com/carmanconsulting/sandbox/osgi/manifest/ProductionClass.class

org/

org/apache/

org/apache/commons/

org/apache/commons/lang3/

org/apache/commons/lang3/AnnotationUtils$1.class

org/apache/commons/lang3/AnnotationUtils.class

org/apache/commons/lang3/ArrayUtils.class

org/apache/commons/lang3/BitField.class

org/apache/commons/lang3/BooleanUtils.class

org/apache/commons/lang3/CharEncoding.class

org/apache/commons/lang3/CharRange$1.class

org/apache/commons/lang3/CharRange$CharacterIterator.class

org/apache/commons/lang3/CharRange.class

org/apache/commons/lang3/CharSequenceUtils.class

org/apache/commons/lang3/CharSet.class

org/apache/commons/lang3/CharSetUtils.class

org/apache/commons/lang3/CharUtils.class

org/apache/commons/lang3/ClassUtils.class

org/apache/commons/lang3/EnumUtils.class

org/apache/commons/lang3/JavaVersion.class

org/apache/commons/lang3/LocaleUtils$SyncAvoid.class

org/apache/commons/lang3/LocaleUtils.class

org/apache/commons/lang3/ObjectUtils$Null.class

org/apache/commons/lang3/ObjectUtils.class

org/apache/commons/lang3/RandomStringUtils.class

org/apache/commons/lang3/Range$ComparableComparator.class

org/apache/commons/lang3/Range.class

org/apache/commons/lang3/SerializationException.class

org/apache/commons/lang3/SerializationUtils$ClassLoaderAwareObjectInputStream.class

org/apache/commons/lang3/SerializationUtils.class

org/apache/commons/lang3/StringEscapeUtils$CsvEscaper.class

org/apache/commons/lang3/StringEscapeUtils$CsvUnescaper.class

org/apache/commons/lang3/StringEscapeUtils.class

org/apache/commons/lang3/StringUtils$InitStripAccents.class

org/apache/commons/lang3/StringUtils.class

org/apache/commons/lang3/SystemUtils.class

org/apache/commons/lang3/Validate.class

On Tue, May 19, 2015 at 8:15 AM Jean-Baptiste Onofré 
wrote:

> Maybe you embedded the interface in each provider and consumer bundles ?
>
> Regards
> JB
>
> On 05/19/2015 02:12 PM, nino martinez wael wrote:
> > I must have messed something up while trying to make it work..
> >
> > On Tue, May 19, 2015 at 2:08 PM, James Carman
> >  wrote:
> >> Nice I made no customizations to the bundle plugin.  The settings in the
> >> parent pom reflect the default settings.
> >>
> >> On Tue, May 19, 2015 at 8:06 AM nino martinez wael
> >>  wrote:
> >>>
> >>> +1 for James helping out :) it is working now..
> >>>
> >>> On Tue, May 19, 2015 at 1:47 PM, James Carman
> >>>  

Re: Problems with Blueprint services

2015-05-19 Thread James Carman
You weren't installing all required bundles in your test either.
On Tue, May 19, 2015 at 8:12 AM nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> I must have messed something up while trying to make it work..
>
> On Tue, May 19, 2015 at 2:08 PM, James Carman
>  wrote:
> > Nice I made no customizations to the bundle plugin.  The settings in the
> > parent pom reflect the default settings.
> >
> > On Tue, May 19, 2015 at 8:06 AM nino martinez wael
> >  wrote:
> >>
> >> +1 for James helping out :) it is working now..
> >>
> >> On Tue, May 19, 2015 at 1:47 PM, James Carman
> >>  wrote:
> >> > Nino,
> >> >
> >> > https://github.com/nmwael/osgi2versions/pull/1
> >> >
> >> > Enjoy! :)
> >> >
> >> >
> >> >
> >> > On Tue, May 19, 2015 at 2:58 AM nino martinez wael
> >> >  wrote:
> >> >>
> >> >> Okay to avoid further confusion, I've put up my project here :
> >> >> https://github.com/nmwael/osgi2versions
> >> >>
> >> >> just run maven clean install -Dmaven.test.skip
> >> >> then go in your favorite ide and run the test getHelloService() in
> >> >> com.netdesign.osgi.examples.rest.endpoint located in the module
> >> >> webservice_rest_test that should both give you the exception and
> bring
> >> >> up an karaf with the installed non working bundles.
> >> >>
> >> >> I'll check the final manifests..
> >> >>
> >> >> On Mon, May 18, 2015 at 4:41 PM, Kevin Schmidt 
> >> >> wrote:
> >> >> > Seeing your two manifests would possibly reveal the issue.
> >> >> >
> >> >> > At its simplest, your bundle with the interface in it should have:
> >> >> >
> >> >> > Export-Package: com.netdesign.osgi.examples.rest.domain
> >> >> >
> >> >> > And the bundle with the service implementation should have:
> >> >> >
> >> >> > Import-Package: com.netdesign.osgi.examples.rest.domain
> >> >> >
> >> >> > Like others have said, just letting the Maven bundle plugin do all
> >> >> > this
> >> >> > for
> >> >> > you is the easiest way to go.
> >> >> >
> >> >> > On Mon, May 18, 2015 at 7:27 AM, nino martinez wael
> >> >> >  wrote:
> >> >> >>
> >> >> >> I Will try to manually do it.. Currently it runs in an pax exam
> >> >> >> test..
> >> >> >>
> >> >> >> On May 18, 2015 3:29 PM,  wrote:
> >> >> >>>
> >> >> >>> Faced a similar ClassCastException some time back. Not sure
> whether
> >> >> >>> it
> >> >> >>> really make sense but just stating it here for your information.
> I
> >> >> >>> had
> >> >> >>> the
> >> >> >>> service interfaces in one bundle (A), implementations in another
> >> >> >>> bundle (B)
> >> >> >>> and a number of consumers. Noticed the ClassCastException a few
> >> >> >>> times
> >> >> >>> if I
> >> >> >>> issue a start command to A while starting B and consumers. This
> was
> >> >> >>> happening with Karaf 3.0.0.
> >> >> >>>
> >> >> >>> -Original Message-
> >> >> >>> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> >> >> >>> Sent: Monday, May 18, 2015 6:48 PM
> >> >> >>> To: user@karaf.apache.org
> >> >> >>> Subject: Re: Problems with Blueprint services
> >> >> >>>
> >> >> >>> Yes that is what I think i am doing.. If it helps I can clone my
> >> >> >>> git
> >> >> >>> to
> >> >> >>> somewhere reachable? IT is a very basic example project just
> >> >> >>> demonstrating a
> >> >> >>> cxf rest front with 2 backend services with ranking.
> >> >> >>>
> >> >> >>> On Mon, May 18, 2015 at 3:11 PM,   wrote:
> >> >> >>> > You want to export the interface from t

Re: Problems with Blueprint services

2015-05-19 Thread James Carman
Nice I made no customizations to the bundle plugin.  The settings in the
parent pom reflect the default settings.

On Tue, May 19, 2015 at 8:06 AM nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> +1 for James helping out :) it is working now..
>
> On Tue, May 19, 2015 at 1:47 PM, James Carman
>  wrote:
> > Nino,
> >
> > https://github.com/nmwael/osgi2versions/pull/1
> >
> > Enjoy! :)
> >
> >
> >
> > On Tue, May 19, 2015 at 2:58 AM nino martinez wael
> >  wrote:
> >>
> >> Okay to avoid further confusion, I've put up my project here :
> >> https://github.com/nmwael/osgi2versions
> >>
> >> just run maven clean install -Dmaven.test.skip
> >> then go in your favorite ide and run the test getHelloService() in
> >> com.netdesign.osgi.examples.rest.endpoint located in the module
> >> webservice_rest_test that should both give you the exception and bring
> >> up an karaf with the installed non working bundles.
> >>
> >> I'll check the final manifests..
> >>
> >> On Mon, May 18, 2015 at 4:41 PM, Kevin Schmidt 
> >> wrote:
> >> > Seeing your two manifests would possibly reveal the issue.
> >> >
> >> > At its simplest, your bundle with the interface in it should have:
> >> >
> >> > Export-Package: com.netdesign.osgi.examples.rest.domain
> >> >
> >> > And the bundle with the service implementation should have:
> >> >
> >> > Import-Package: com.netdesign.osgi.examples.rest.domain
> >> >
> >> > Like others have said, just letting the Maven bundle plugin do all
> this
> >> > for
> >> > you is the easiest way to go.
> >> >
> >> > On Mon, May 18, 2015 at 7:27 AM, nino martinez wael
> >> >  wrote:
> >> >>
> >> >> I Will try to manually do it.. Currently it runs in an pax exam
> test..
> >> >>
> >> >> On May 18, 2015 3:29 PM,  wrote:
> >> >>>
> >> >>> Faced a similar ClassCastException some time back. Not sure whether
> it
> >> >>> really make sense but just stating it here for your information. I
> had
> >> >>> the
> >> >>> service interfaces in one bundle (A), implementations in another
> >> >>> bundle (B)
> >> >>> and a number of consumers. Noticed the ClassCastException a few
> times
> >> >>> if I
> >> >>> issue a start command to A while starting B and consumers. This was
> >> >>> happening with Karaf 3.0.0.
> >> >>>
> >> >>> -Original Message-
> >> >>> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> >> >>> Sent: Monday, May 18, 2015 6:48 PM
> >> >>> To: user@karaf.apache.org
> >> >>> Subject: Re: Problems with Blueprint services
> >> >>>
> >> >>> Yes that is what I think i am doing.. If it helps I can clone my git
> >> >>> to
> >> >>> somewhere reachable? IT is a very basic example project just
> >> >>> demonstrating a
> >> >>> cxf rest front with 2 backend services with ranking.
> >> >>>
> >> >>> On Mon, May 18, 2015 at 3:11 PM,   wrote:
> >> >>> > You want to export the interface from the API bundle, import it
> into
> >> >>> > the service bundle, let BP and the Maven plugin take care of
> exports
> >> >>> >
> >> >>> >
> >> >>> >
> >> >>> > On Mon, May 18, 2015 at 7:09 AM, nino martinez wael
> >> >>> >  wrote:
> >> >>> >>
> >> >>> >> I did use * exports initially but did change it.
> >> >>> >>
> >> >>> >> To
> >> >>> >>
> >> >>> >>
> com.netdesign.osgi.examples.rest.backendb.* >> >>> >> ervice> and commented out the export package part.
> >> >>> >>
> >> >>> >>
> >> >>> >>
> >> >>> >> On Mon, May 18, 2015 at 2:55 PM,  wrote:
> >> >>> >> > I’m guessing you are using * exports and the API and Impl
> bundle
> >> >>> >> > export the same interface.
> >> >>> >> >
> >&g

Re: Problems with Blueprint services

2015-05-19 Thread James Carman
Nino,

https://github.com/nmwael/osgi2versions/pull/1

Enjoy! :)



On Tue, May 19, 2015 at 2:58 AM nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Okay to avoid further confusion, I've put up my project here :
> https://github.com/nmwael/osgi2versions
>
> just run maven clean install -Dmaven.test.skip
> then go in your favorite ide and run the test getHelloService() in
> com.netdesign.osgi.examples.rest.endpoint located in the module
> webservice_rest_test that should both give you the exception and bring
> up an karaf with the installed non working bundles.
>
> I'll check the final manifests..
>
> On Mon, May 18, 2015 at 4:41 PM, Kevin Schmidt 
> wrote:
> > Seeing your two manifests would possibly reveal the issue.
> >
> > At its simplest, your bundle with the interface in it should have:
> >
> > Export-Package: com.netdesign.osgi.examples.rest.domain
> >
> > And the bundle with the service implementation should have:
> >
> > Import-Package: com.netdesign.osgi.examples.rest.domain
> >
> > Like others have said, just letting the Maven bundle plugin do all this
> for
> > you is the easiest way to go.
> >
> > On Mon, May 18, 2015 at 7:27 AM, nino martinez wael
> >  wrote:
> >>
> >> I Will try to manually do it.. Currently it runs in an pax exam test..
> >>
> >> On May 18, 2015 3:29 PM,  wrote:
> >>>
> >>> Faced a similar ClassCastException some time back. Not sure whether it
> >>> really make sense but just stating it here for your information. I had
> the
> >>> service interfaces in one bundle (A), implementations in another
> bundle (B)
> >>> and a number of consumers. Noticed the ClassCastException a few times
> if I
> >>> issue a start command to A while starting B and consumers. This was
> >>> happening with Karaf 3.0.0.
> >>>
> >>> -Original Message-
> >>> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> >>> Sent: Monday, May 18, 2015 6:48 PM
> >>> To: user@karaf.apache.org
> >>> Subject: Re: Problems with Blueprint services
> >>>
> >>> Yes that is what I think i am doing.. If it helps I can clone my git to
> >>> somewhere reachable? IT is a very basic example project just
> demonstrating a
> >>> cxf rest front with 2 backend services with ranking.
> >>>
> >>> On Mon, May 18, 2015 at 3:11 PM,   wrote:
> >>> > You want to export the interface from the API bundle, import it into
> >>> > the service bundle, let BP and the Maven plugin take care of exports
> >>> >
> >>> >
> >>> >
> >>> > On Mon, May 18, 2015 at 7:09 AM, nino martinez wael
> >>> >  wrote:
> >>> >>
> >>> >> I did use * exports initially but did change it.
> >>> >>
> >>> >> To
> >>> >>
> com.netdesign.osgi.examples.rest.backendb.* >>> >> ervice> and commented out the export package part.
> >>> >>
> >>> >>
> >>> >>
> >>> >> On Mon, May 18, 2015 at 2:55 PM,  wrote:
> >>> >> > I’m guessing you are using * exports and the API and Impl bundle
> >>> >> > export the same interface.
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > On Mon, May 18, 2015 at 3:09 AM, nino martinez wael
> >>> >> >  wrote:
> >>> >> >>
> >>> >> >> Setter is correct:
> >>> >> >>
> >>> >> >> https://paste.apache.org/e5ld
> >>> >> >>
> >>> >> >> And BackendBImplement does implement the interface
> >>> >> >>
> >>> >> >> https://paste.apache.org/4pOv
> >>> >> >>
> >>> >> >> Heres the interface:
> >>> >> >>
> >>> >> >> package com.netdesign.osgi.examples.rest.domain;
> >>> >> >>
> >>> >> >> /**
> >>> >> >> * Created by nmw on 14-05-2015.
> >>> >> >> */
> >>> >> >> public interface MessageProvider {
> >>> >> >>
> >>> >> >> String getMessage();
> >>> >> >> }
> >>> >> >>
> >>> >> >>
> >>> >> >> I've probably made some simple mistake..Other than that im
> >>> >> >> thinking of class loader conflicts..
> >>> >> >>
> >>> >> >> On Mon, May 18, 2015 at 10:03 AM, Jean-Baptiste Onofré
> >>> >> >> 
> >>> >> >> wrote:
> >>> >> >> > Hi,
> >>> >> >> >
> >>> >> >> > Check if the setter has the correct type. Check also if the
> >>> >> >> > BackendBImplement implements MessageProvider.
> >>> >> >> >
> >>> >> >> > Regards
> >>> >> >> > JB
> >>> >> >> >
> >>> >> >> >
> >>> >> >> > On 05/18/2015 09:40 AM, nino martinez wael wrote:
> >>> >> >> >>
> >>> >> >> >> Hi im having a little difficulty getting my services to get
> >>> >> >> >> "injected"
> >>> >> >> >> via a blueprint, the service are injected but when trying to
> >>> >> >> >> use it, it fails with this exception:
> >>> >> >> >>
> >>> >> >> >> Proxyac192a6f_60ad_44a3_8470_75b9a9054462 cannot be cast to
> >>> >> >> >> com.netdesign.osgi.examples.rest.domain.MessageProvider
> >>> >> >> >> java.lang.ClassCastException
> >>> >> >> >>
> >>> >> >> >> Service registration (in one bundle, interfaces in a shared
> >>> >> >> >> bundle):
> >>> >> >> >>
> >>> >> >> >>  >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >>
> >>> >> >> >>
> class="com.netdesign.osgi.examples.rest.backendb.BackendBImplementation"
> >>> >> >> >> />
> >>> >> >> >>  >>> >> >> >>
> >>> >> >> >>
> interface="com.netdesign.osgi.examples.rest.domain.MessagePr

Re: Problems with Blueprint services

2015-05-18 Thread James Carman
On Mon, May 18, 2015 at 9:11 AM  wrote:

> You want to export the interface from the API bundle, import it
> into the service bundle, let BP and the Maven plugin take care of exports
>
>
+1, definitely use the maven-bundle-plugin to manage your MANIFEST.  Most
of the time it "just works" without any customization.


Re: Is there a way to access current blueprint container?

2015-05-15 Thread James Carman
On Tue, May 12, 2015 at 10:17 AM ellirael  wrote:

> I'm trying to get blueprint service proxy inside vaadin UI.
> My current solution is to create BlueprintContainer Vaadin aware servlet
> with BlueprintContainer property. Then register my servlet with whiteboard
> pattern injecting blueprintContainer in it. Then in UI access my service
> proxies like this:
> VaadinBlueprintAwareServlet vaadinServlet = (VaadinBlueprintAwareServlet)
> VaadinBlueprintAwareServlet.getCurrent();
> personService = (PersonService)
> vaadinServlet.getBlueprintContainer.getComponentInstance("personService");
>


You are running Vaadin inside Karaf as a regular webapp?

>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040320.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: JTA TransactionManager not found

2015-05-15 Thread James Carman
The "transaction" feature will set up a transaction manager (the geronimo
one) and expose services that supports many of the popular ways to handle
transactions:

javax.transaction.TransactionManager,
javax.transaction.TransactionSynchronizationRegistry,
javax.transaction.UserTransaction,
org.apache.geronimo.transaction.manager.RecoverableTransactionManager,
org.springframework.transaction.PlatformTransactionManager

On Fri, May 15, 2015 at 1:13 PM sebersole  wrote:

> I have not.  I will try that now.  I think the developers of that branch
> inadvertently set up the tests to use JTA.  As I said these pass on master
> as is (no explicit JTA support), so that has to be it.  Great to know about
> the "transaction" feature as I would like to test JTA support as well.
> Thanks!
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/JTA-TransactionManager-not-found-tp4040381p4040387.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: JTA TransactionManager not found

2015-05-15 Thread James Carman
Have you tried turning on the "transaction" feature in Karaf?

On Fri, May 15, 2015 at 10:56 AM sebersole  wrote:

> I am trying to investigate why locating the JTA TransactionManager suddenly
> stopped working.  This is part of the Hibernate OSGi integration testing,
> so
> I do not have an "app" per-se.  I also unfortunately do not have a ton of
> OSGi experience and/or knowledge.  Now that all the disclaimers are out of
> the way ;)
>
> Ultimately the new failure boils down to a call to this code:
>
> public  T getServiceImpl(Class contract) {
> final ServiceTracker serviceTracker = getServiceTracker(
> contract.getName() );
> try {
> return (T) serviceTracker.waitForService( 1000 );
> }
> catch (Exception e) {
> LOG.unableToDiscoverOsgiService(
> contract.getName(), e );
> return null;
> }
> }
>
>
> passing in javax.transaction.TransactionManager.  The Hibernate bundles
> define javax.transaction as an import:
>
> Import-Package: ..., javax.transaction;version="[1.1,2)", ...
>
>
> and the feature I am using defines JTA as a bundle:
>
>
> mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1
>
> This code used to work.  It is failing on someone's topic branch, for
> reasons we cannot explain.  As far as I know, defining the import of
> `javax.transaction;version="[1.1,2)"` in the OSGi headers ought to be
> enough
> for JTA to be there.  What am I missing?
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/JTA-TransactionManager-not-found-tp4040381.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: Is there a way to access current blueprint container?

2015-05-12 Thread James Carman
How about we approach this another way?  What exactly are you trying to do?

On Tue, May 12, 2015 at 9:58 AM ellirael  wrote:

> The place where I need BlueprintContainer reference is the class which
> object
> creation maintained by another container. I cannot let blueprint do it.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040317.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: Is there a way to access current blueprint container?

2015-05-12 Thread James Carman
The BlueprintContainer is exposed as a service, too.

On Tue, May 12, 2015 at 8:46 AM ellirael  wrote:

> Type is BluePrintContainer? Interface?
>
> How to do it inside my code without injection?
> My objects lifecycle controlled from another container.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040307.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>


Re: Configuration in Service(Factory) is not updated properly

2015-05-12 Thread James Carman
A, that's definitely some sort of nasty race condition.  I'm willing to
jump in and help debug it.  Do you have a simple example yet that
illustrates the issue?

On Tue, May 12, 2015 at 8:38 AM Thomas  wrote:

> Hi James,
>
> thank you for your answer. No, the configuration is only used for one
> service. We debugged a little bit further and saw a strange behavior. The
> breakpoint was in the ConfigurationSupport.configurationEvent(event) method
> (see line 278 in
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.felix/org.apache.felix.scr/1.8.2/org/apache/felix/scr/impl/config/ConfigurationSupport.java#ConfigurationSupport
> )  The target and oldTargetPID looked like this:
>
> successful case:
> targetPID: org.test.my.component.myComponent
> oldTargetPID: org.test.my.component.myComponent
>
> unsuccessful case:
> targetPid: org.test.my.component.myComponent
> oldTargetPID:
> org.test.my.component.myComponent.1f309340-04f9-4be6-b354-be67081a9232
>
> For some reason, sometimes the pid is the factory pid and sometimes the
> normal pid. Any ideas?
>
> Best regards,
> Thomas
>
> 2015-05-12 13:56 GMT+02:00 James Carman :
>
>> You aren't sharing one configuration file for multiple services are you?
>> On Tue, May 12, 2015 at 3:11 AM Thomas 
>> wrote:
>>
>>> Hey again,
>>>
>>> we investigate a little bit, but couldn't find the final solution. But
>>> we could extract some logs that might be helpful for someone with deeper
>>> knowledge of karaf/felix here? As I mentioned before, the problem appears
>>> only from time to time. We compared the logs from a successful and a failed
>>> update:
>>>
>>> successful update: http://pastebin.com/EPVzenPL
>>> failed update: http://pastebin.com/MYWi1TAc
>>>
>>> The problem seems to be the configadmin. In both cases, after updating
>>> the configuration there are 5 update events (CM_UPDATED). Every time (and
>>> we tested that a couple of times) the last event is for the SCR bundle, the
>>> update is successful. In every other case, the config update wasn't
>>> successful. Is it possible that there is some kind of race condition, maybe
>>> with the artifact installer?
>>>
>>> Thanks in advance and best regards,
>>> Thomas
>>>
>>> 2015-05-08 14:04 GMT+02:00 Thomas :
>>>
>>>> Hi,
>>>>
>>>> we recently updated the Karaf version from 2.3.5 to 2.4.2 in our
>>>> application. Since this change, the configuration update mechanism isn't
>>>> working properly anymore for us. I tried to update one property through
>>>> archaius and through the ssh interface (config:edit ...). I can see the
>>>> changed value in the configuration overview (Status -> Configuration) if I
>>>> open the webconsole, but the service itself has still the old value (OSGI
>>>> -> Services). It seems like the modify method isn't called.
>>>>
>>>> The strange thing is, from time to time it works. We have some
>>>> integration tests and some tests (which modifies the config) are green. The
>>>> same code worked fine with the old karaf version. Does anybody have an idea
>>>> if there is an issue with the config admin?
>>>>
>>>> Our Service looks like this: http://pastebin.com/5SWvTDQy ... We use
>>>> this as a ServiceFactory. Does anybody has an idea why the modify method
>>>> isn't called (every time)?
>>>>
>>>> Best regards,
>>>> Thomas
>>>>
>>>
>>>
>


Re: Configuration in Service(Factory) is not updated properly

2015-05-12 Thread James Carman
You aren't sharing one configuration file for multiple services are you?
On Tue, May 12, 2015 at 3:11 AM Thomas  wrote:

> Hey again,
>
> we investigate a little bit, but couldn't find the final solution. But we
> could extract some logs that might be helpful for someone with deeper
> knowledge of karaf/felix here? As I mentioned before, the problem appears
> only from time to time. We compared the logs from a successful and a failed
> update:
>
> successful update: http://pastebin.com/EPVzenPL
> failed update: http://pastebin.com/MYWi1TAc
>
> The problem seems to be the configadmin. In both cases, after updating the
> configuration there are 5 update events (CM_UPDATED). Every time (and we
> tested that a couple of times) the last event is for the SCR bundle, the
> update is successful. In every other case, the config update wasn't
> successful. Is it possible that there is some kind of race condition, maybe
> with the artifact installer?
>
> Thanks in advance and best regards,
> Thomas
>
> 2015-05-08 14:04 GMT+02:00 Thomas :
>
>> Hi,
>>
>> we recently updated the Karaf version from 2.3.5 to 2.4.2 in our
>> application. Since this change, the configuration update mechanism isn't
>> working properly anymore for us. I tried to update one property through
>> archaius and through the ssh interface (config:edit ...). I can see the
>> changed value in the configuration overview (Status -> Configuration) if I
>> open the webconsole, but the service itself has still the old value (OSGI
>> -> Services). It seems like the modify method isn't called.
>>
>> The strange thing is, from time to time it works. We have some
>> integration tests and some tests (which modifies the config) are green. The
>> same code worked fine with the old karaf version. Does anybody have an idea
>> if there is an issue with the config admin?
>>
>> Our Service looks like this: http://pastebin.com/5SWvTDQy ... We use
>> this as a ServiceFactory. Does anybody has an idea why the modify method
>> isn't called (every time)?
>>
>> Best regards,
>> Thomas
>>
>
>


Re: Hibernate OSGi Integration

2015-05-06 Thread James Carman
The newer versions of Hibernate are definitely more OSGi-friendly, so I
would start there if you are "green-fielding" your project and have that
opportunity.


On Tue, May 5, 2015 at 11:58 PM Jens J Parappallil <
jens.parappal...@ibsplc.com> wrote:

>  Hi,
>
>
>
> I am planning to integrate hibernate in my project, I have many bundles
> which has entity classes present ( and exported ) . I am planning to have a
> core bundle which holds the hibernate session factory etc and manages the
> persistence stuff.
>
>
>
> I am thinking how this works out in an OSGi environment where the bundles
> ( having entity classes ) can come and go. The hibernate session factory is
> a singleton , to be created ones and used. Can it wok with annotated
> entities coming and going ?
>
>
>
> This is more of a hibernate question , but any of you guys have envisioned
> such a usage pattern and made it work ?
>
>
>
> Thanks
>
> Jens
>
>
> DISCLAIMER: "The information in this e-mail and any attachment is
> intended only for the person to whom it is addressed and may contain
> confidential and/or privileged material. If you have received this e-mail
> in error, kindly contact the sender and destroy all copies of the original
> communication. IBS makes no warranty, express or implied, nor guarantees
> the accuracy, adequacy or completeness of the information contained in this
> email or any attachment and is not liable for any errors, defects,
> omissions, viruses or for resultant loss or damage, if any, direct or
> indirect."
>


Re: Karaf and Docker

2015-04-18 Thread James Carman
Serge,

We had some pretty good discussions during JB's talk (hope we didn't hijack
it too much, JB).  I don't think this topic really has anything to do with
Docker, necessarily.  Docker is merely a tool people employ to implement a
deployment strategy.  I think it basically boils down to the notion that in
the "cloud era", it's simpler and cheaper to spin up a new node configured
the way you want.  Cloud-enabled applications need to be "cloneable" in
this way already, so you kind of get this benefit for free.

This doesn't mean we can't use OSGi to piece together these nodes.  OSGi
isn't only about being able to runtime-refresh your modules.  There are
many other benefits of the OSGi programming model that make it suitable for
building statically-configured applications as well.

Just my $0.02

James

On Mon, Apr 13, 2015 at 3:49 PM, Serge Huber  wrote:

> Interesting discussion indeed.
>
> I'm currently at ApacheCon US and I've taken a few opportunities to
> promote Apache Karaf which surprisingly few people know about. But again
> what I was describing earlier is really a frequent feedback : is modularity
> worth the trouble when I can built "micro-services" that are actually
> running in docker containers ? Although I am convinced that the two are not
> in opposition, I think it would be great to have a killer use case to
> demonstrate what the benefits of using Karaf would be.
>
> I'm really looking forward to meeting Jean-Baptiste in person ! I love
> Karaf and I hope to be able to exchange with him a few experiences around
> it.
>
> Regards,
>   Serge
>
> - -- --- -=[ shuber at jahia dot com ]= --- -- -
> CTO & Co-founder - Jahia Solutions Group, 9 Routes de Jeunes, 1227
> Acacias, Switzerland
> twitter: @sergehuber 
>
> 
> JahiaOne , our international user conference is
> back! June 10-12 in Paris - Grab your tickets now
> !
>
> Jahia is a leading open source User eXperience Platform (UXP) vendor,
> relentlessly working at transforming a siloed industry into a user-driven
> one, beyond technology constraints - http://www.jahia.com
>
>
> On Mon, Apr 13, 2015 at 2:42 PM, Achim Nierbeck 
> wrote:
>
>> Hey,
>>
>> yes I fully agree, also with the Spring-Boot stuff.
>> as already stated on the other thread, I think there are certain cases
>> where Docker images are useful.
>> For a POC, for CI I think a Docker Image is useful. In the end if you
>> want to run it in Production I rather have the Ansible setup.
>>
>> regards, Achim
>>
>>
>> 2015-04-13 17:02 GMT+02:00 Jean-Baptiste Onofré :
>>
>>> Hi Ed,
>>>
>>> I can't agree more ;)
>>> I fully agree about your points.
>>>
>>> I quite have the same view on Spring Boot ;)
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 04/13/2015 04:32 PM, Ed Welch wrote:
>>>
 I've really enjoyed following this thread, and I have to say, as a
 Docker skeptic surrounded by people who want to bash my brains in with
 docker images, it's nice to hear some feedback from people who seem to have
 a healthy dose of skepticism like I do...

 So rather than rehash all the things I agree with that have been said
 so far, I wanted to comment a few things I hadn't seen:

 The biggest discussion point I bring up with my peers regarding docker
 that I've been using to kind of hold the floodgates back:  Who is
 responsible for updates to the underlying docker image OS?  Our
 organization is fairly segmented, we have a linux operations group, we have
 a development group.  If our development group deploys 50 docker images,
 all with a variety of distros inside them, different versions of
 everything... What happens if there is a big vulnerability found
 (think/remember bash).  Is our linux team now on the hook to learn docker
 and handle digging through dozens to hundreds of potentially very different
 docker images ( which would make you want to force standardization of your
 docker images on a particular distro at a minimum ), or does the dev team
 now own this responsibility?  This is a hard question for our company to
 answer...

 My other comment, is actually regarding what I think is the most
 fantastic use case I've seen for docker, which was written up by Roland
 Huss on his blog: https://ro14nd.de/Jolokia-Docker-Image/
 Using docker as part of your automated integration tests is a really
 neat idea, especially if you work on a project that has to maintain support
 for piles of application servers, operating systems, and versions of java.
 I think there is some real opportunity here as was previously mentioned, to
 build a docker image that sets up the OS, java, and karaf, and then at test
 time you deploy your app and run your tests.  With this kind of model you
 can just keep adding new docker images to your test suite and retire old
 ones w

Re: Mandatory Configuration from configAdmin

2015-02-17 Thread James Carman
What about using a ManagedServiceFactory instead?

On Tue, Feb 17, 2015 at 11:12 AM, SvS  wrote:
> Hi JB,
>
> Is a jira issue created?
>
> Is there a way to see that all the configurations for a bundle is loaded by
> the config admin? In may case it is a service factory.
>
> Regards,
> SvS
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Mandatory-Configuration-from-configAdmin-tp4031442p4038601.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Cannot start Karaf

2014-10-13 Thread James Carman
Karaf will need to be able to write to that directory by default.
What user are you using to run karaf?  Does he have permissions to
write to /usr/local/java/apache-karaf-3.0.2?


On Mon, Oct 13, 2014 at 8:51 AM, David Leangen  wrote:
>
> Hi,
>
> Just another idea that crosses my mind.
> Did you place the extracted Karaf folder in some restricted folders?
> Where does it actually reside in?
>
>
> Not sure exactly what you mean by “restricted”, but it resides in
> /usr/local/java.]
>
> This is where I install all my apache apps. No problems so far, except for
> karaf. :-)
>
>
> Cheers,
> =David
>
>
>
> 2014-10-13 14:43 GMT+02:00 Jean-Baptiste Onofré :
>>
>> KARAF_HOME is the location where you uncompressed Karaf.
>>
>> For instance, if you uncompressed Karaf in /opt/apache-karaf (and so, you
>> have /opt/apache-karaf/bin, /opt/apache-karaf/lib, etc), KARAF_HOME is
>> /opt/apache-karaf.
>> However, by default, KARAF_HOME is defined relatively to the bin/karaf.
>>
>> By the way, do you use the default shell on Mac OS ?
>>
>> Regards
>> JB
>>
>>
>> On 10/13/2014 02:35 PM, David Leangen wrote:
>>>
>>>
 OK, I think we narrow the problem.

 I bet your KARAF_HOME is defined by empty or it's not correct (I guess
 that /usr/local/lib folder is not your actual KARAF_HOME).

 I would advise to unset KARAF_BASE, KARAF_HOME, etc to let the bin/karaf
 script to define it for you.
>>>
>>>
>>> Sure.
>>>
>>> What, very precisely, should be KARAF_HOME?
>>>
>>> =David
>>>
>>>
>>>
 On 10/13/2014 02:14 PM, David Leangen wrote:
>
>
> Hi,
>
>> in the bin/karaf script, can you confirm that you have something like:
>>
>> exec “$JAVA” […]
>
>
> Yes.
>
>
>> Do you define some env variables like KARAF_BASE/KARAF_HOME/KARAF_ETC,
>> ?
>
>
> I tried both. Same results.
>
>
>> A possible cause is that KARAF_HOME is not well setted or a CLASSPATH
>> system variable interfere. In bin/karaf, we do:
>>
>> for file in "$KARAF_HOME"/lib/karaf*.jar
>> do
>> if [ -z "$CLASSPATH" ]; then
>> CLASSPATH="$file"
>> else
>> CLASSPATH="$CLASSPATH:$file"
>> fi
>> done
>> to load the karaf*.jar file from the Karaf lib folder.
>
>
> Yes, I can see this in the bin/karaf file.
>
> For the fun of it, I added the line “echo $file” in the for loop. In
> the output, all I see is “/usr/local/lib/karaf*.jar. Weird.
>
>
> Cheers,
> =David
>
>
>
>> On 10/13/2014 01:56 PM, David Leangen wrote:
>>>
>>>
 Really weird,
>>>
>>>
>>> :-)
>>>
>>>
 Can you do a java -version and send the result.
>>>
>>>
>>> java version "1.7.0_67"
>>> Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
>>> Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
>>>
 Can you also send the data/log/karaf.log to me ?
>>>
>>>
>>> There is no file (assuming that it is in $KARAF_HOME, i.e. the
>>> directory
>>> where Karaf is installed).
>>>
>>> Cheers,
>>> =David
>>>
>>>
>>>
 On 10/13/2014 01:47 PM, David Leangen wrote:
>
>
>> It looks like the lib folder doesn’t contain the
>> karaf-jmx-boot.jar
>> file (providing the MBeanServerBuilder).
>> Can you check that this jar is in the lib folder ?
>
>
> Yes, it is there.
>
>> Do you have something in bin/setenv ?
>
>
> No, using defaults.
>
>> By the way, can you try with Java7 (instead of Java6) ?
>
>
> I installed Java7. Same problem. :-(
>
>
> Cheers,
> =David
>
>
>
>> On 10/13/2014 10:39 AM, David Leangen wrote:
>>>
>>>
>>> Wow! Impressive response. :-) Thank you!
>>>
 Can you make a try with 3.0.2 (currently on staging) ?
>>>
>>>
>>> Tried. Same problem. :-(
>>>
 which version of Java are you using?
 Please note with Karaf 3.0.1 it's still recommended to use Java7
>>>
>>>
>>> Hmmm. I am still a luddite with 1.6 (more precisely
>>> 1.6.0_65-b14-462-11M4609).
>>>
 I’m running 3.0.1 on Mac out of the box. You’ll likely need to
 describe more about your circumstances, e.g. the JVM used, what
 commands you’ve run (to start Karaf and at it’s own command
 line),
 what bundles you’ve installed (if any), the complete stack
 trace, etc?
>>>
>>>
>>> I ran “karaf” with the default (i.e. “out-of-the-box”)
>>> installation, and
>>> before Karaf could start, it died with the following:
>>>
>>>

Re: Why this library hell? Hibernate + Spring = Mess

2013-01-29 Thread James Carman

On Jan 29, 2013, at 8:33 AM, Gonzalo Aguilar  
wrote:

> 
> I will consider in the future but not right now. Thank you for pushing
> OpenJPA anyway.
> 

I wouldn't say I was "pushing" OpenJPA by any means.  Let's just call it some 
friendly advice from someone who went through the pain of getting Hibernate 
working in an OSGi container. :)  Good luck!  The way I was able to get it 
working was to create one big jar with everything in it and manually set up the 
package exports/imports.  Getting your mind wrapped around the OSGi weirdness 
is definitely a learning curve (I'm not totally there yet I don't think).  If 
you get it working, perhaps you can create a Gist or something and shoot us 
back an email so that future folks having the same struggles as us can benefit. 
 Wish I would have done that.  :(



Re: Why this library hell? Hibernate + Spring = Mess

2013-01-29 Thread James Carman
Yes, OpenJPA will save you a lot of headaches, since it is designed to work in 
an OSGi environment.  

On Jan 29, 2013, at 6:19 AM, Bram Pouwelse  wrote:

> Hi Gonzalo,
> 
> I've used Hibernate in Karaf in the past got it al working based on on
> Hibernate bundles created as described in this blog post:
> http://iocanel.blogspot.nl/2010/07/wicket-spring-3-jpa2-hibernate-osgi.html
> 
> I was able to update these bundles to Hibernate 3.6.2 but switched to
> OpenJPA after all.
> 
> Regards,
> Bram
> 
> 
> 
> 2013/1/29 Jean-Baptiste Onofré :
>> Hi Gonzalo,
>> 
>> my comments inline:
>> 
>> 
>>> First.
>>> Why do we have to repackage every library is not in the form of
>>> bundle?
>>> It would be easier, more manageable, to wrap missing libraries (not
>>> in the form of a bundle) around a container that describes its contents.
>>> This way something like, say, apache.commons does not need to be
>>> unpacked and packed with a new manifiest. This method will break signing
>>> if any, but proposed one does not.
>> 
>> A lot of library (like commons) are already bundles.
>> The problem using wrap is that most of the time the OSGi statements are not
>> correct. That's why creating a bundle is required.
>> 
>> 
>>> 
>>> 
>>> Second.
>>> This project (in this case OSGi-> Felix) is supposed to be created
>>> to resolve library mess. But I can only find references to peculiarities
>>> to the implementation of the class loaders that makes every old project
>>> incompatible without modifications. Say Hibernate. Do I have to use
>>> packages that only springsource Enterprise provides? This is a little
>>> pain because if the bundle is not there, is not anywhere.
>> 
>> Karaf is an OSGi container. Classloaders are handled in a different way in
>> OSGi.
>> 
>> 
>>> 
>>> 
>>> Third.
>>> After fighting with dependencies for a long time. I repackaged
>>> hibernate, spring and friend into a new package. And found that nothing
>>> works together. I was smart enough to get spring 3.0.7-RELEASE that
>>> comes with karaf. But found following problem that I'm not able to
>>> solve:
>> 
>> Creating a "big" bundle mean that you create a single classloader. It works
>> but it's ugly IMHO.
>> Fragment can do the trick too.
>> 
>> I'm not sure to follow your issues with Hibernate and Spring.
>> 
>> Regards
>> JB
>> 
>> 
>> 
>>> 
>>> 
>>> But the class org/hibernate/cfg/Configuration is packaged with the rest.
>>> And it must find it. Where is the problem?
>>> 
>>> I tried package different versions of hibernate that is the thing that I
>>> can touch. Because Spring is too much to repackage it. So I have to
>>> stick with the two versions included in the container, 3.0.7-RELEASE and
>>> 3.1 whatever.
>>> 
>>> Any help on how to make it work?
>>> 
>>> 
>>> I read everywhere: Switch to openJPA it does bundles and works better
>>> with OSGi. But I just have much built on hibernate and don't want to
>>> switch. I want to learn how to make every project work. Don't want to
>>> have to do a switch to another project everytime I have some missing
>>> package (bundle) that makes the project not to work on osgi.
>>> 
>>> Thank you in advance.
>>> It will be a great project once this kind of problems are solved.  In
>>> effect cxf works great!
>>> 
>>> 
>>> ---
>>> 
>>> Exception in thread "SpringOsgiExtenderThread-4"
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean with name 'crmSessionFactoryBean' defined in URL
>>> [bundle://196.0:0/META-INF/spring/hibernate-spring-beans.xml]:
>>> Instantiation of bean failed; nested exception is
>>> org.springframework.beans.BeanInstantiationException: Could not
>>> instantiate bean class
>>> [org.springframework.orm.hibernate3.LocalSessionFactoryBean]:
>>> Constructor threw exception; nested exception is
>>> java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
>>> at
>>> 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:964)
>>> at
>>> 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:910)
>>> at
>>> 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
>>> at
>>> 
>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
>>> at org.springframework.beans.factory.support.AbstractBeanFactory
>>> $1.getObject(AbstractBeanFactory.java:293)
>>> at
>>> 
>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>> at
>>> 
>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
>>> at
>>> 
>>> org.springfra

Re: features-maven-plugin ignores configuration?

2012-11-22 Thread James Carman
In all honesty, I've had much better luck hand-crafting my
features.xml files.  Then, you don't have to worry about marking
dependencies as "provided" and what not to get it looking exactly like
you want it.  We tried using the plugin for the longest time because
it just seemed easier, but after we finally switched to manual, I'll
never go back!  That's my $0.02.

On Thu, Nov 22, 2012 at 4:39 AM, Benjamin Debeerst
 wrote:
> Thanks JB,
>
> I've tried your pom (copy-paste-execute), but without success - the same 
> error occures. Both on my windows (XP) machine and on a debian system I had 
> no luck (first I was suspecting some IO trouble on the windows machine, thats 
> why I gave the debian system a try).
>
> [ERROR] Failed to execute goal 
> org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar (default-cli) 
> on project test-features: Could not interpret features
> XML file: /home/debeerstb/temp/test-kar/target/feature/feature.xml (No such 
> file or directory) : 
> file:/home/debeerstb/temp/test-kar/target/feature/feature.xml -> [Help 1]
>
> (Of course on the Windows system I didn't try the absolute path 
> /tmp/fatures.xml but other absolute or relative paths)
>
> The plugin always looks for the features file in taget/feature/feature.xml. 
> When I put the features file there on beforehand, the build works. But that's 
> not really what I wanna do.
>
> I'm running on maven 3.0.4 btw.
>
> I put my own pom and features.xml below for completeness, but since I used 
> your exact pom this time I don't think that will help.
>
> Regards,
> Benjamin
>
>
> 
> http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>   4.0.0
>   com.example
>   test-features
>   1.0.0-SNAPSHOT
>   pom
>
>   
> 
>   
> org.apache.karaf.tooling
> features-maven-plugin
> 2.3.0
> 
>   
> create-kar
> 
>   create-kar
> 
> 
>   
> ${project.basedir}\src\main\resources\features.xml
> 
>   
> 
>   
> 
>   
> 
>
>
> and the features.xml:
>
> 
> 
> 
> mvn:joda-time/joda-time/2.1
> 
> 
>
>
>  Original-Nachricht 
>> Datum: Wed, 21 Nov 2012 17:28:42 +0100
>> Von: "Jean-Baptiste Onofré" 
>> An: user@karaf.apache.org
>> Betreff: Re: features-maven-plugin ignores configuration?
>
>> Hi Benjamin,
>>
>> I checked in the code (on the 2.3.x branch), and the featuresFile
>> attribute is used, for instance:
>>
>> [...]
>> RepositoryImpl featuresRepo = new RepositoryImpl(featuresFile.toURI());
>> [...]
>> jarArchiver.addFile(featuresFile, repositoryPath +
>> layout.pathOf(featureArtifact));
>>
>> I just made a try with the following pom.xml:
>>
>> 
>> http://maven.apache.org/POM/4.0.0";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/xsd/maven-4.0.0.xsd";>
>>
>>4.0.0
>>
>>net.nanthrax
>>test-features
>>1.0-SNAPSHOT
>>pom
>>
>>
>>  
>>
>>  org.apache.karaf.tooling
>>  features-maven-plugin
>>  2.3.0
>>  
>>
>>  create-kar
>>  
>>create-kar
>>  
>>  
>>/tmp/features.xml
>>  
>>
>>  
>>
>>  
>>
>> 
>>
>> and the plugin use my features.xml from the tmp folder.
>>
>> Could you share you pom.xml ?
>>
>> Regards
>> JB
>>
>> On 11/21/2012 04:36 PM, Benjamin Debeerst wrote:
>> > Hi all,
>> >
>> > I've been setting up a pom to create a kar-file for distribution. I
>> found JB's blog post very helpful:
>> >
>> http://blog.nanthrax.net/2011/12/do-you-know-the-apache-karaf-maven-plugins/
>> >
>> > I recognized it's very old and updated the plugin version to 2.3.0
>> (release). You find my pom at the end of the email.
>> >
>> > The maven execution mvn features:create-kar fails with the following
>> message:
>> >
>> > [ERROR] Failed to execute goal
>> org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar 
>> (default-cli) on project test-features: Could not
>> interpret features
>> > XML file: D:\temp\test-kar\target\feature\feature.xml (Das System kann
>> den angegebenen Pfad nicht finden) :
>> file:/D:/temp/test-kar/target/feature/feature.xml
>> >
>> > It does not find the feature xml. But it looks at the wrong place.
>> D:\temp\test-kar\ is the project folder. The feature xml is thus in
>> D:\temp\test-kar\src\main\resources, as defined in the pom.
>> >
>> > When I run mvn with the -X switch, I see this:
>> > [DEBUG] Configuring mojo
>> org.apache.karaf.tooling:features-maven-plugin:2.3.0:create-kar from plugin 
>> realm
>> ClassRealm[plugin>org.apache.karaf.tooling:feature

Re: Does maven-bundle-plugin merge its 'instructions' settings?

2012-10-30 Thread James Carman
I think you have to mark the plugin as "inherited" in the child pom file also.

On Tue, Oct 30, 2012 at 2:48 AM, Dan Tran  wrote:
> sorry, i meant maven-bundle-plugin.  and your answer is exactly what I
> am looking for
>
> big thanks
>
> -Dan
>
> On Mon, Oct 29, 2012 at 11:13 PM, Andreas Pieber  wrote:
>> Hey Dan,
>>
>> Do you really mean the maven-plugin-plugin or the maven-bundle-plugin (as  I
>> assume since you referenced the Felix group).
>>
>> In case you mean the maven-bundle-plugin it depends which properties you
>> mean. AFAIK different properties are merged, same properties are merged.
>> E.g. if you define a package-export and bundle-import in the parent, but
>> package-import and package-export in the client, the bundle-import will be
>> taken from the parent, package-import and export from the child.
>>
>> Hope this helps.
>>
>> Kind regards,
>> Andreas
>>
>> On Tue, Oct 30, 2012 at 6:26 AM, Dan Tran  wrote:
>>>
>>> Hi,
>>>
>>> This question should go to felix group, but I think we have experts
>>> here who many be able to help me with this question
>>>
>>> Currently I have maven-plugin-plugin configure at the parent pom
>>> outside of my projects.
>>>
>>> once a while I need to override the 'instructions' settings from sub
>>> project. The question here should I just add/set the 'changed' portion
>>> and assume maven-bundle-plugin would merge the 'changed' portion to
>>> the one already defined at my parent pom?
>>>
>>> Thanks
>>>
>>> -Dan
>>
>>


Re: JPA Usage: Strategy for using Hibernate + Postgresql

2012-10-29 Thread James Carman
Yeah, that's a bit of a gotcha.  That should be highlighted a bit more.

On Mon, Oct 29, 2012 at 9:13 AM, dealbitte  wrote:
> Solved the problem. I made a configuration error in maven .pom file
>
> added the line
> META-INF/persistence.xml
> to maven-bundle-plugin
>
> regards.
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/JPA-Usage-Strategy-for-using-Hibernate-Postgresql-tp4026586p4026602.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: JPA Usage: Strategy for using Hibernate + Postgresql

2012-10-26 Thread James Carman
OpenJPA is much more OSGi-friendly.  You might give that a go.  We've
switched and never looked back.

On Fri, Oct 26, 2012 at 6:48 AM, dealbitte  wrote:
> Hi
>
> I am trying to set up Hibernate and Postgresql in conjunction with Karaf. I
> have a maven project (archetype: osgi)  that depends on Hibernate and
> Postgresql and I want to install this project in karaf. I would like to know
> if there are design patterns to set up a JPA provider (like Hibernate) along
> with a database (like Postgres).
>
> I installed hibernate dependencies, via feature file shown below
>
>   
> wrap:mvn:org.hibernate/hibernate-core/4.1.7.Final
>
> wrap:mvn:org.hibernate/hibernate-entitymanager/4.1.7.Final
>
> wrap:mvn:org.hibernate.javax.persistence/hibernate-jpa-2.0-api/1.0.1.Final
>
> wrap:mvn:org.hibernate.common/hibernate-commons-annotations/4.0.1.Final
> wrap:mvn:org.jboss.logging/jboss-logging/3.1.0.GA
>   
>
> When I tried to install my bundle, it complains about missing
> 'hibernate.cfg.xml' even though this is available inside the bundle.
>
> I am looking for some examples, tutorials that can help to understand the
> usage of JPA provider with database. I am not restricted to Hibernate and
> Postgres.
>
> regards,
> Rakesh
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/JPA-Usage-Strategy-for-using-Hibernate-Postgresql-tp4026586.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Re: [ANN] Welcome Brian Topping as a new Karaf committer

2012-09-03 Thread James Carman
Congrats, Brian!

On Mon, Sep 3, 2012 at 3:28 PM, Brian Topping  wrote:
> Thanks JB, I'm looking forward to it!
>
> On Sep 3, 2012, at 4:51 PM, Jean-Baptiste Onofré  wrote:
>
>> Hi,
>>
>> The Karaf team is pleased to announce Brian Topping as a new Karaf committer.
>>
>> Welcome aboard Brian, and I'm looking forward for your new contribution.
>>
>> Regards
>> JB
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>


Re: ClassNotFoundException thrown by my module

2012-08-14 Thread James Carman
I would advise against using the imports. That will tie your bundle
directly to the database vendor. If you use jndi then you have a layer of
abstraction.
On Aug 14, 2012 7:16 AM, "Julien Martin"  wrote:

> Thanks James,
> Your advice is interesting. I am definitely going to test this feature.
> However, what I'd really like to do now is understand how to configure the
> package Imports/Exports.
> Regards,
> J.
>
> 2012/8/14 James Carman 
>
>> You might try defining your data source in a simple XML file (either
>> Spring or preferably blueprint) in your deploy directory.  Then, you
>> don't have to worry about the imports.  Karaf will automatically set
>> up dynamic importing for you on any module deployed this way.  Then,
>> you just refer to your data source via JNDI (don't forget to install
>> the jndi feature).
>>
>> On Tue, Aug 14, 2012 at 4:33 AM, Julien Martin  wrote:
>> > Hi Ioannis,
>> > What is the exact package are you referring to?
>> > What about the odd behavior I noticed and was mentioning above?
>> > Regards,
>> > Julien.
>> >
>> >
>> >
>> > 2012/8/14 Ioannis Canellos 
>> >>
>> >> Bitronix uses the Thread Context Class Loader in order to load the
>> driver
>> >> class, so there is no need for you to configure bitronix or
>> spring-batch to
>> >> directly import that package.
>> >>
>> >> Instead you should make sure that these mysql packages are imported by
>> the
>> >> bundle that contains the spring context and I think that it should
>> just work
>> >> (I am not 100% sure that spring set the TCCL to the current bundle,
>> but I
>> >> think that springdm does that by default).
>> >>
>> >> --
>> >> Ioannis Canellos
>> >> FuseSource
>> >>
>> >> Blog: http://iocanel.blogspot.com
>> >> Twitter: iocanel
>> >>
>> >>
>> >
>>
>
>


Re: ClassNotFoundException thrown by my module

2012-08-14 Thread James Carman
You might try defining your data source in a simple XML file (either
Spring or preferably blueprint) in your deploy directory.  Then, you
don't have to worry about the imports.  Karaf will automatically set
up dynamic importing for you on any module deployed this way.  Then,
you just refer to your data source via JNDI (don't forget to install
the jndi feature).

On Tue, Aug 14, 2012 at 4:33 AM, Julien Martin  wrote:
> Hi Ioannis,
> What is the exact package are you referring to?
> What about the odd behavior I noticed and was mentioning above?
> Regards,
> Julien.
>
>
>
> 2012/8/14 Ioannis Canellos 
>>
>> Bitronix uses the Thread Context Class Loader in order to load the driver
>> class, so there is no need for you to configure bitronix or spring-batch to
>> directly import that package.
>>
>> Instead you should make sure that these mysql packages are imported by the
>> bundle that contains the spring context and I think that it should just work
>> (I am not 100% sure that spring set the TCCL to the current bundle, but I
>> think that springdm does that by default).
>>
>> --
>> Ioannis Canellos
>> FuseSource
>>
>> Blog: http://iocanel.blogspot.com
>> Twitter: iocanel
>>
>>
>