Re: How to install bundle Offline
I do it in production like had Christian described -- as production is "final" server, there are few servers before it - that have internet connection, so just rsync it for there to the production server once the "local" Maven repo is updated. But based on this thread, I will look into how to build a kar package, I did not put much effort into any other way as this works for me quite OK. Or even a Cave, but all this looks too complicated. Kind Regards, Miroslav V V sre., 9. okt. 2019 ob 18:13 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Good point, or even copy the repository somewhere on the machine and add > in etc/org.ops4j.pax.url.mvn.cfg. > > Regards > JB > > On 09/10/2019 17:51, Christian Schneider wrote: > > Another approach is to start with an empty maven repo on a machine with > > internet connect. > > Then install the feature in karaf. This will populate the local maven > repo. > > You can then copy the local maven repo to your machine without internet > > access. > > This is ideal for quickly testing. > > > > For a production setup a custom karaf distro that contains karaf + your > > features is a good solution. > > > > Christian > > > > Am Mi., 9. Okt. 2019 um 13:57 Uhr schrieb Jean-Baptiste Onofré > > mailto:j...@nanthrax.net>>: > > > > Hi, > > > > you can: > > > > 1. populate the Karaf system folder manually or using mvn > > deploy:deploy-file or mvn install:install-file > > 2. you can create a kar on a machine connected to Internet and then > > deploy the kar > > 3. you can install cave on a machine with Internet access and use as > > a proxy > > > > Probably the quickest approach is 1, you just populate the Karaf > system > > folder (which is basically a embedded Maven repository). > > > > Regards > > JB > > > > On 09/10/2019 13:09, imranrazakhan wrote: > > > I have karaf deployed but with no internet connectivity, Now i > have to > > > install jolokia on it but getting below error > > > > > > @root()> feature:install jolokia > > > > > Error executing command: Error: > > > > >Error downloading mvn:org.jolokia/jolokia-osgi/1.3.5 > > > > > > How i can install offline? > > > > > > > > > > > > -- > > > Sent from: > http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html > > > > > > > -- > > Jean-Baptiste Onofré > > jbono...@apache.org <mailto:jbono...@apache.org> > > http://blog.nanthrax.net > > Talend - http://www.talend.com > > > > > > > > -- > > -- > > Christian Schneider > > http://www.liquid-reality.de > > > > Computer Scientist > > http://www.adobe.com > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS miroslav.bera...@mibesis.si https://www.mibesis.si
Re: Karaf SSH invalid encoding
Hi JB, so I am now back in a mode, that ??? char is printed. Output is like this: karaf@root()> user-list # ? Id ? Email ? First name ? MSISDN ? 1 ? bla ? ? bla ? 2 ? bla ? ? bla ? 3 ? bla ? b...@bla.com ? bla ? 4 ? bla ? b...@bla.com ? bla ? Env variables are the same as before: karaf@root()> shell:echo $LANG en_US.UTF-8 karaf@root()> shell:echo $LC_ALL null karaf@root()> shell:echo $TERM xterm-256color Kind Regards, Miroslav V V pon., 12. nov. 2018 ob 10:49 je oseba Miroslav Beranič < miroslav.bera...@mibesis.si> napisala: > Hi JB, > > I get this ( from Linux shell ): > > [mm@mm1 ~]$ echo $LC_ALL > > [mm@mm1 ~]$ echo $LANG > en_US.UTF-8 > [mm@mm1 ~]$ echo $TERM > xterm-256color > [mm@mm1 ~]$ > > From inside Karaf's Shell: > > karaf@root()> shell:echo $LANG > en_US.UTF-8 > karaf@root()> shell:echo $LC_ALL > null > karaf@root()> shell:echo $TERM > xterm-256color > karaf@root()> > > This is when ??? is not present - it is working. I will post back when I > get/see ??? . > > Kind Regards, > Miroslav > > > > V V pon., 12. nov. 2018 ob 09:44 je oseba Jean-Baptiste Onofré < > j...@nanthrax.net> napisala: > >> Hi Miroslav, >> >> can you share the LC_ALL, LANG and TERM env variables when you have or >> don't have the issue ? >> >> Thanks, >> Regards >> JB >> >> On 12/11/2018 08:33, Miroslav Beranič wrote: >> > Hi all, >> > >> > I have the same issue on Apache Karaf 4.2.2 ( commit >> > da7ae8f76f2db1347200ff6bb4760e4ecbb1b454 ), I get/see ??? chars ( 95% of >> > the times ) when I redeploy application. >> > >> > Interesting thing is, this is on one instance only running RHEL 7.5. >> > Intermediate server environment ( beta server ). >> > >> > At this time, I solve this with server ( OS ) restart. >> > >> > But if someone has any other observation or hints to fix - I would be >> > glad to update :) >> > >> > Kind Regards, >> > Miroslav >> > >> > >> > V V pet., 9. nov. 2018 ob 05:42 je oseba Jean-Baptiste Onofré >> > mailto:j...@nanthrax.net>> napisala: >> > >> > Hi Nicolas, >> > >> > Let me check but AFAIR, null should use the default term encoding >> of the >> > system. >> > >> > Regards >> > JB >> > >> > On 08/11/2018 14:20, DUTERTRY Nicolas wrote: >> > > Hi, >> > > >> > > >> > > >> > > I’m using Karaf 4.2.1 on environments which doesn’t have a UTF-8 >> > > encoding for instance Windows 10 or AIX with ISO-8859-1 encoding. >> > > >> > > When I open a SSH session with the “client” script or with >> another SSH >> > > client, the non-ascii characters are not displayed correctly. >> > > >> > > For instance the result of the “bundle:list” command prints “?” >> > instead >> > > of “|” : >> > > >> > > >> > > >> > > karaf@root()> bundle:list >> > > >> > > START LEVEL 100 , List Threshold: 50 >> > > >> > > ID ? State ? Lvl ? Version ? Name >> > > >> > > >> > >> ? >> > > >> > > 23 ? Active ? 80 ? 4.2.1 ? Apache Karaf :: OSGi Services :: >> Event >> > > >> > > >> > > >> > > After some investigations I have found that the class >> > > org.apache.karaf.shell.ssh.SshTerminal has a hard coded UTF-8 >> value in >> > > its constructor : >> > > >> > > >> > > >> > > public SshTerminal(Environment environment, InputStream input, >> > > OutputStream output) throws IOException { >> > > >> > > super("Karaf SSH terminal", >> > > >> > > environment.getEnv().get(Environment.ENV_TERM), >> > > &g
Re: Karaf SSH invalid encoding
Hi JB, I get this ( from Linux shell ): [mm@mm1 ~]$ echo $LC_ALL [mm@mm1 ~]$ echo $LANG en_US.UTF-8 [mm@mm1 ~]$ echo $TERM xterm-256color [mm@mm1 ~]$ >From inside Karaf's Shell: karaf@root()> shell:echo $LANG en_US.UTF-8 karaf@root()> shell:echo $LC_ALL null karaf@root()> shell:echo $TERM xterm-256color karaf@root()> This is when ??? is not present - it is working. I will post back when I get/see ??? . Kind Regards, Miroslav V V pon., 12. nov. 2018 ob 09:44 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi Miroslav, > > can you share the LC_ALL, LANG and TERM env variables when you have or > don't have the issue ? > > Thanks, > Regards > JB > > On 12/11/2018 08:33, Miroslav Beranič wrote: > > Hi all, > > > > I have the same issue on Apache Karaf 4.2.2 ( commit > > da7ae8f76f2db1347200ff6bb4760e4ecbb1b454 ), I get/see ??? chars ( 95% of > > the times ) when I redeploy application. > > > > Interesting thing is, this is on one instance only running RHEL 7.5. > > Intermediate server environment ( beta server ). > > > > At this time, I solve this with server ( OS ) restart. > > > > But if someone has any other observation or hints to fix - I would be > > glad to update :) > > > > Kind Regards, > > Miroslav > > > > > > V V pet., 9. nov. 2018 ob 05:42 je oseba Jean-Baptiste Onofré > > mailto:j...@nanthrax.net>> napisala: > > > > Hi Nicolas, > > > > Let me check but AFAIR, null should use the default term encoding of > the > > system. > > > > Regards > > JB > > > > On 08/11/2018 14:20, DUTERTRY Nicolas wrote: > > > Hi, > > > > > > > > > > > > I’m using Karaf 4.2.1 on environments which doesn’t have a UTF-8 > > > encoding for instance Windows 10 or AIX with ISO-8859-1 encoding. > > > > > > When I open a SSH session with the “client” script or with another > SSH > > > client, the non-ascii characters are not displayed correctly. > > > > > > For instance the result of the “bundle:list” command prints “?” > > instead > > > of “|” : > > > > > > > > > > > > karaf@root()> bundle:list > > > > > > START LEVEL 100 , List Threshold: 50 > > > > > > ID ? State ? Lvl ? Version ? Name > > > > > > > > > ? > > > > > > 23 ? Active ? 80 ? 4.2.1 ? Apache Karaf :: OSGi Services :: > Event > > > > > > > > > > > > After some investigations I have found that the class > > > org.apache.karaf.shell.ssh.SshTerminal has a hard coded UTF-8 > value in > > > its constructor : > > > > > > > > > > > > public SshTerminal(Environment environment, InputStream input, > > > OutputStream output) throws IOException { > > > > > > super("Karaf SSH terminal", > > > > > > environment.getEnv().get(Environment.ENV_TERM), > > > > > > input, > > > > > > output, > > > > > > StandardCharsets.UTF_8); > > > > > > > > > > > > I have replaced StandardCharsets.UTF_8 with null and when running > > Karaf > > > with this modification, I do not have the character issue anymore. > > > > > > > > > > > > Do you think it is a valid correction ? I can open a jira ticket > > if you > > > want. > > > > > > > > > > > > Regards, > > > > > > -- > > > > > > Nicolas Dutertry > > > > > > > -- > > Jean-Baptiste Onofré > > jbono...@apache.org <mailto:jbono...@apache.org> > > http://blog.nanthrax.net > > Talend - http://www.talend.com > > > > > > > > -- > > Miroslav Beranič > > MIBESIS > > +386(0)40/814-843 > > miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> > > http://www.mibesis.si > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Karaf SSH invalid encoding
Hi all, I have the same issue on Apache Karaf 4.2.2 ( commit da7ae8f76f2db1347200ff6bb4760e4ecbb1b454 ), I get/see ??? chars ( 95% of the times ) when I redeploy application. Interesting thing is, this is on one instance only running RHEL 7.5. Intermediate server environment ( beta server ). At this time, I solve this with server ( OS ) restart. But if someone has any other observation or hints to fix - I would be glad to update :) Kind Regards, Miroslav V V pet., 9. nov. 2018 ob 05:42 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi Nicolas, > > Let me check but AFAIR, null should use the default term encoding of the > system. > > Regards > JB > > On 08/11/2018 14:20, DUTERTRY Nicolas wrote: > > Hi, > > > > > > > > I’m using Karaf 4.2.1 on environments which doesn’t have a UTF-8 > > encoding for instance Windows 10 or AIX with ISO-8859-1 encoding. > > > > When I open a SSH session with the “client” script or with another SSH > > client, the non-ascii characters are not displayed correctly. > > > > For instance the result of the “bundle:list” command prints “?” instead > > of “|” : > > > > > > > > karaf@root()> bundle:list > > > > START LEVEL 100 , List Threshold: 50 > > > > ID ? State ? Lvl ? Version ? Name > > > > ? > > > > 23 ? Active ? 80 ? 4.2.1 ? Apache Karaf :: OSGi Services :: Event > > > > > > > > After some investigations I have found that the class > > org.apache.karaf.shell.ssh.SshTerminal has a hard coded UTF-8 value in > > its constructor : > > > > > > > > public SshTerminal(Environment environment, InputStream input, > > OutputStream output) throws IOException { > > > > super("Karaf SSH terminal", > > > > environment.getEnv().get(Environment.ENV_TERM), > > > > input, > > > > output, > > > > StandardCharsets.UTF_8); > > > > > > > > I have replaced StandardCharsets.UTF_8 with null and when running Karaf > > with this modification, I do not have the character issue anymore. > > > > > > > > Do you think it is a valid correction ? I can open a jira ticket if you > > want. > > > > > > > > Regards, > > > > -- > > > > Nicolas Dutertry > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: No URL is defined for schema http://www.springframework.org/schema/osgi.
Hi JB, if I understood correct, I've looked up, how to install features at boot time. Is this what you were saying? So, what I did was: updated etc/org.apache.karaf.features.repos.cfg ( not really related, but added by feature file here ), and updated etc/org.apache.karaf.features.cfg to install cxf ( added at the end of featuresBoot property ): cxf/3.2.6, \ cxf-jaxrs-cdi/3.2.6 after Karaf startup I can see the CXF with all the dependencies was installed. But. When I installed the JPA/Hibernate feature ( part of my project ), I get following error: . . . 07:40:50.588 INFO [features-3-thread-1] org.apache.servicemix.bundles.dom4j/1.6.1.5 07:40:50.590 INFO [features-3-thread-1] org.apache.httpcomponents.httpclient/4.5.2 07:40:50.593 ERROR [Blueprint Extender: 3] Unable to start blueprint container for bundle framework.service/5.0.1.SNAPSHOT org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace: . . . 07:40:50.607 INFO [features-3-thread-1] org.hibernate.core/5.2.9.Final 07:40:50.641 INFO [features-3-thread-1] org.hibernate.osgi/5.2.9.Final 07:40:50.718 INFO [features-3-thread-1] Found provider for mm org.hibernate.jpa.HibernatePersistenceProvider 07:40:50.753 INFO [features-3-thread-1] HHH000204: Processing PersistenceUnitInfo [ name: mm ...] 07:40:50.839 INFO [features-3-thread-1] HHH000412: Hibernate Core {5.2.9.Final} 07:40:50.842 INFO [features-3-thread-1] HHH000206: hibernate.properties not found 07:40:50.902 INFO [features-3-thread-1] HCANN01: Hibernate Commons Annotations {5.0.1.Final} 07:40:52.418 ERROR [features-3-thread-1] Bundle framework.persistence [216] EventDispatcher: Error during dispatch. (java.lang.NoSuchMethodError: org.codehaus.stax2.ri.EmptyIterator.getInstance()Lorg/codehaus/stax2/ri/EmptyIterator;) java.lang.NoSuchMethodError: org.codehaus.stax2.ri.EmptyIterator.getInstance()Lorg/codehaus/stax2/ri/EmptyIterator; . . . So now not even JPA/Hibernate is not working any more. I must be doing something wrong. I guess "java.lang.NoSuchMethodError" is saying I did not compile class with the same dependency JAR as I use it in the runtime? Well, this does not look good. Darn. Kind Regards, Miroslav V V sob., 13. okt. 2018 ob 07:04 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi, > > to avoid such problem, you can use and prepare the boot features. I will > avoid some refresh and stick a init state. > > IMHO, it should help. > > Regards > JB > > On 12/10/2018 17:05, Miroslav Beranič wrote: > > Hi all, > > > > not quite done yet. > > > > So new day, new problems. After another round of try/error -- it worked, > > and did not work next day. > > > > Even "one xml deploy" bundle was not working. Now, I am more focused > > into the CXF project. > > > > I am quite sure, this "works today, does not work tomorrow" is due to > > bundle deploy order. I've found out, that there are multiple Xerces > > instances flying around. I had one, for some legacy SOAP client > > generated from WSDL using Axis 1.4. > > > > It had Xerces, after a lot of redeploys I've figured out that when > > Xerces bundle is deployed Karaf is not able to resolve/deploy bundle > > with Spring XML configuration. > > > > I am getting > > "org.osgi.service.blueprint.container.ComponentDefinitionException: > > Unsupported node namespace:" ( notice empty namespace ). When I do > > uninstall of the Xerces bundle -- and restart Spring XML configuration > > bundle, it works. Repeat Xerces bundle install, Spring XML configuration > > bundle fails to load. > > > > When cxf feature is installed bundle: > > 313 │ Active │ 30 │ 2.11.0.1 │ > > org.apache.servicemix.bundles.xerces > > is installed. I've exported bundles for the feature cxf and JAR file > > name is: org.apache.servicemix.bundles.xerces-2.11.0_1.jar > > > > This is also in line with my first voodoo , when I was asking if it is > > possible that some dependency makes a mess. I would say, this is the > > "main problem". > > > > Other issue was with ActiveMQ and Camel, and "class cast exceptions" for > > Spring's classes, also some nice pitfalls there ( all solved with > > correct bundle deploy order ). > > > > What I've notices is - order of the feature/bundle loading is the key > > and it is not easy. One "innocent" dependency and whole tree of > > un-wanted bundles is put into the Karaf. > > > > > > I would really really like to know, am I doing so much something extra > > and no one else has this issues? As all I am doing is loading bundle
Re: No URL is defined for schema http://www.springframework.org/schema/osgi.
Hi all, not quite done yet. So new day, new problems. After another round of try/error -- it worked, and did not work next day. Even "one xml deploy" bundle was not working. Now, I am more focused into the CXF project. I am quite sure, this "works today, does not work tomorrow" is due to bundle deploy order. I've found out, that there are multiple Xerces instances flying around. I had one, for some legacy SOAP client generated from WSDL using Axis 1.4. It had Xerces, after a lot of redeploys I've figured out that when Xerces bundle is deployed Karaf is not able to resolve/deploy bundle with Spring XML configuration. I am getting "org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace:" ( notice empty namespace ). When I do uninstall of the Xerces bundle -- and restart Spring XML configuration bundle, it works. Repeat Xerces bundle install, Spring XML configuration bundle fails to load. When cxf feature is installed bundle: 313 │ Active │ 30 │ 2.11.0.1 │ org.apache.servicemix.bundles.xerces is installed. I've exported bundles for the feature cxf and JAR file name is: org.apache.servicemix.bundles.xerces-2.11.0_1.jar This is also in line with my first voodoo , when I was asking if it is possible that some dependency makes a mess. I would say, this is the "main problem". Other issue was with ActiveMQ and Camel, and "class cast exceptions" for Spring's classes, also some nice pitfalls there ( all solved with correct bundle deploy order ). What I've notices is - order of the feature/bundle loading is the key and it is not easy. One "innocent" dependency and whole tree of un-wanted bundles is put into the Karaf. I would really really like to know, am I doing so much something extra and no one else has this issues? As all I am doing is loading bundle with spring xml configuration and SOAP server ( with CXF ) and all stops working. It is hard to believe this is "only my problem". The more likely thing is : I am doing all wrong. Also if this is true, I would really like to know what? How can it be, that if I load Apache CXF feature and in another bundle Spring XML Configuration, one "overrides" XML/XSD namespace resolution. To me this is interesting as I would really like to know, how is this connected and how this is even possible. So today's finding is: If you have errors like: No URL is defined for schema http://www.springframework.org/schema/osgi, org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace:, go and check if you have Xerces bundle installed. If so, try to uninstall it and restart failed bundle. My guess is - it will start to work. But what now. How to replace Xerces - it is like part of every web/xml related project. I have no answer for this. I've checked CXF source code, and noticed that Spring bundles and versions are not in sync ( version part of the Karaf - referencing CXF Karaf repository ) ... so I would suspect this will be another land mine I will blindly step on. But when things are working, when Karaf is able to load ( over Aries ) bundle with Spring XML configuration -- it works really well and it is really easy to make it work. That is one of the biggest frustration, as it is such a nice platform, but one wrong JAR and all stops working ... Kind Regards, Miroslav V V čet., 11. okt. 2018 ob 12:52 je oseba Miroslav Beranič < miroslav.bera...@mibesis.si> napisala: > Hi all, > > I found a solution. > > To repeat/clarify first: > - I am using Karaf 4.2.2 > - I am using "as much as I can" "built in" features > - I am using Spring 4.3 ( features from Karaf's spring-legacy > repository/features ) > - I am using Karaf's feature "aries-blueprint-spring" to get "Spring > Framework XSD namespace" support ( > http://www.springframework.org/schema/osgi ), part of the Aries project, > file located at > /aries/blueprint/blueprint-spring-extender/src/main/resources/org.apache.aries.blueprint.spring.extender/spring-osgi-1.2.xsd, > because of the implementation > org.apache.aries.blueprint.spring.extender.SpringOsgiNamespaceHandler, one > can reference XSD file as spring-osgi.xsd ( it is "renamed" to > spring-osgi-1.2.xsd ). > - I am using bundle from ServiceMix Bundles > org.apache.servicemix.bundles:org.apache.servicemix.bundles.spring-beans/4.3.18 > to get Spring Framework 4.3 XSD files, one can also use > http://www.springframework.org/schema/beans/spring-beans.xsd and will get > http://www.springframework.org/schema/beans/spring-beans-4.3.xsd ( if > bundle version 4.3 is the only one installed , it is in my case ). > - I am not using spring-dm feature from Karaf's repository > > Here, the fun part starts. As
Re: Pax JMS - ConcurrentModificationException
Hi all, it seems PAX JMS version 1.0.2 has concurrency problems. I am getting : karaf@root()> feature:install -r framework-demo org.osgi.framework.BundleException: Activator stop error in bundle org.ops4j.pax.jms.pax-jms-config [315]. at org.apache.felix.framework.Felix.stopBundle(Felix.java:2692) at org.apache.felix.framework.BundleImpl.stop(BundleImpl.java:1038) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.stopBundle(BundleInstallSupportImpl.java:167) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.stopBundle(FeaturesServiceImpl.java:1121) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:748) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442) at java.util.HashMap$KeyIterator.next(HashMap.java:1466) at org.ops4j.pax.jms.config.impl.ConnectionFactoryConfigManager.destroy(ConnectionFactoryConfigManager.java:180) at org.ops4j.pax.jms.config.impl.Activator.stop(Activator.java:79) at org.apache.felix.framework.util.SecureAction.stopActivator(SecureAction.java:719) at org.apache.felix.framework.Felix.stopBundle(Felix.java:2636) ... 10 more Error executing command: Activator stop error in bundle org.ops4j.pax.jms.pax-jms-config [315]. karaf@root()> list -t 0 -s | grep 315 315 │ Resolved │ 80 │ 1.0.2.SNAPSHOT │ org.ops4j.pax.jms.pax-jms-config As noted before, I've moved back to "stock" 1.0.2-SNAPSHOT PAX JMS Config bundle and getting error. I guess I will move to changed version, with use of ConcurrentHashMap. Kind Regards, Miroslav V V pon., 1. okt. 2018 ob 11:43 je oseba Miroslav Beranič < miroslav.bera...@mibesis.si> napisala: > Hi JB, > > agree, I guess I am more used to use ConcurrentHashMap than synchronized > keyword. Ok, will close PR. > > Kind Regards, > Miroslav > > > V V pon., 1. okt. 2018 ob 11:08 je oseba Jean-Baptiste Onofré < > j...@nanthrax.net> napisala: > >> Just to be clear, this fix is on Pax JDBC, but the same fix should be >> applied to Pax JMS. Synchronized is IMHO better and consistent more than >> using a ConcurrentHashMap. >> >> Regards >> JB >> >> On 01/10/2018 11:05, Jean-Baptiste Onofré wrote: >> > By the way, don't you think this commit: >> > >> > >> https://github.com/ops4j/org.ops4j.pax.jdbc/commit/6bfeccea774195316d4d2382b5235a7c4d1501e0 >> > >> > already fix the issue ? >> > >> > I think the synchronized on methods are enough, so I think your PR is >> > useless with this commit. >> > >> > Regards >> > JB >> > >> > On 01/10/2018 08:51, Miroslav Beranič wrote: >> >> Hi all, >> >> >> >> I was getting ( sometimes ) ConcurrentModificationException when using >> >> PAX JMS ( 1.0.2 ). It turned out to be synchronization fail in >> >> ConnectionFactoryConfigManager. I've made a fix by replace HashMap with >> >> ConcurrentHashMap ( and removed synchronized methods ). >> >> >> >> I write here, as I think Karaf is main user base of the PAX JMS >> library. >> >> >> >> Any comment is welcome. Fix is located at: >> >> >> >> https://github.com/ops4j/org.ops4j.pax.jms/pull/15 >> >> >> >> P.S: I've also updated the dependencies ( in my local branch, not part >> >> of the pull request ) - something to have in mind when/if doing local >> >> build ( working with Karaf 4.2.2 ). >> >> >> >> Kind Regards, >> >> Miroslav >> >> >> >> >> >> >> >> -- >> >> Miroslav Beranič >> >> MIBESIS >> >> +386(0)40/814-843 >> >> miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> >> >> http://www.mibesis.si >> > >> >> -- >> Jean-Baptiste Onofré >> jbono...@apache.org >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > -- > Miroslav Beranič > MIBESIS > +386(0)40/814-843 > miroslav.bera...@mibesis.si > http://www.mibesis.si > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: No URL is defined for schema http://www.springframework.org/schema/osgi.
che.aries.blueprint.parser.Parser.populate(Parser.java:331) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:351) [111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) [111:org.apache.aries.blueprint.core:1.9.0] ( notice the "empty" namespace ... ) After all the strange things done, to make it work again, I've started vanilla project ... and it worked. As expected. Simple as putting one xml inside bundle class path /META-INF/spring/context.xml. So, the fun part was -- I "wanted to clean up" config files and I moved XML files to /META-INF/mm/spring/*.xml and include/import them from context.xml. And this was the issue. It turned out, Blueprint/Spring support will fly out of the window, when http://www.springframework.org/schema/osgi is used in a XML file being referenced / included / imported. So to fix my issue, I have all the Spring XML files ( that have http://www.springframework.org/schema/osgi namespace ) stored inside folder /META-INF/spring/ and all other Spring-only namespaced files in other locations. Did not have the time to look over the source code why is this so, but to me, this is strange implementation. This is also not "pointed out" in the documentation or so, so ... fun fun fun. Took me days too long to figure this out. Kind Regards, Miroslav V V sre., 10. okt. 2018 ob 14:39 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Afair spring-dm doesn't support spring 4.3 either. It's up to spring 4.2. > so you have to install providing the target version. > > Further more you have to install spring-dm or blueprint spring extension. > > Regards > JB > Le 10 oct. 2018, à 15:34, "Miroslav Beranič" > a écrit: >> >> Hi both, >> >> I thought I wrote too much and lost focus. >> >> So, I already use spring-legacy repository, and I get spring-* 4.3.x. I >> already had all this working. I do not use spring-dm feature ( I see it is >> available, version 1.2.1, spring-dm and spring-dm-web, did not even notice >> it before ). >> >> I am using aries-blueprint-spring from Karaf's repository. >> >> aries-blueprint >> spring >> >> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.spring/${aries.blueprint.spring.version} >> >> >> mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.spring.extender/${aries.blueprint.spring.extender.version} >> >> >> >> First I install Spring 4.3 from spring-legacy, next I install >> aries-blueprint-spring ( as if not in this order, Spring 5.0.x is installed >> ). >> > >> >> To do "dry run". In practice this is "correct way" : >> spring-4.3.x from repository spring-legacy and aries-blueprint-spring >> from repository spring and I should be all green, or? >> >> Any idea what else could go wrong ... some other JMS/JPA/PAX/... >> dependency/feature to mix it up? >> >> My biggest pain is -- as I had working setup, and now I can not make it >> work anymore. I've reverted my work and Karaf, no luck - either way. >> >> >> Thanks for the directions. >> >> >> Kind Regards, >> Miroslav >> >> >> >> >> V V sre., 10. okt. 2018 ob 14:13 je oseba Guillaume Nodet < >> gno...@apache.org> napisala: >> >>> You can also install the aries-blueprint-spring feature which should >>> provide support for the spring namespaces. >>> >>> Le mer. 10 oct. 2018 à 14:07, Jean-Baptiste Onofré < j...@nanthrax.net> a >>> écrit : >>> >>>> Hi >>>> >>>> It's because your are using spring-dm which is deprecated and works >>>> only with spring up to 4. >>>> >>>> So you have to add the spring-legacy features repo and then you will >>>> have the spring-dm feature. >>>> >>>> Regards >>>> JB >>>> Le 10 oct. 2018, à 15:04, "Miroslav Beranič" < >>>> miroslav.bera...@mibesis.si> a écrit: >>>>> >>>>> Hi all, >>>>> >>>>> I've read some messages in this mailing list ( last I found was in >>>>> August 2018 ), but I think, I have something different scenario. >>>>> >>>>> So, up until today ( when I was doing clean environment setup ) I was >>>>> able to use define Spring Beans using XML ( as I am porting application, >>>>
Re: No URL is defined for schema http://www.springframework.org/schema/osgi.
Hi both, I thought I wrote too much and lost focus. So, I already use spring-legacy repository, and I get spring-* 4.3.x. I already had all this working. I do not use spring-dm feature ( I see it is available, version 1.2.1, spring-dm and spring-dm-web, did not even notice it before ). I am using aries-blueprint-spring from Karaf's repository. aries-blueprint spring mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.spring/${aries.blueprint.spring.version} mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.spring.extender/${aries.blueprint.spring.extender.version} First I install Spring 4.3 from spring-legacy, next I install aries-blueprint-spring ( as if not in this order, Spring 5.0.x is installed ). napisala: > You can also install the aries-blueprint-spring feature which should > provide support for the spring namespaces. > > Le mer. 10 oct. 2018 à 14:07, Jean-Baptiste Onofré a > écrit : > >> Hi >> >> It's because your are using spring-dm which is deprecated and works only >> with spring up to 4. >> >> So you have to add the spring-legacy features repo and then you will have >> the spring-dm feature. >> >> Regards >> JB >> Le 10 oct. 2018, à 15:04, "Miroslav Beranič" >> a écrit: >>> >>> Hi all, >>> >>> I've read some messages in this mailing list ( last I found was in >>> August 2018 ), but I think, I have something different scenario. >>> >>> So, up until today ( when I was doing clean environment setup ) I was >>> able to use define Spring Beans using XML ( as I am porting application, >>> this is like top feature ), but now - out of the blue, I've started to get >>> errors on deployment: >>> >>> 12:13:12.912 INFO [pool-33-thread-1] Generated blueprint for bundle >>> framework.service/5.0.1.SNAPSHOT at >>> /path/to/assemblies/apache-karaf/target/assembly/data/tmp/blueprint-spring-extender1831035315356717600.xml >>> 12:13:12.917 INFO [pool-33-thread-1] Bundle >>> framework.service/5.0.1.SNAPSHOT is waiting for namespace handlers [ >>> http://www.springframework.org/schema/osgi] >>> >>> 12:13:12.895 INFO [features-3-thread-1] >>> org.apache.aries.blueprint.spring.extender/0.4.0 >>> 12:13:12.935 WARN [Blueprint Extender: 1] No URL is defined for schema >>> http://www.springframework.org/schema/osgi. This schema will not be >>> validated >>> 12:13:12.969 ERROR [Blueprint Extender: 1] Unable to start blueprint >>> container for bundle framework.service/5.0.1.SNAPSHOT >>> org.osgi.service.blueprint.container.ComponentDefinitionException: >>> Unsupported node namespace: >>> at >>> org.apache.aries.blueprint.parser.Parser.getNamespaceHandler(Parser.java:1386) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.parser.Parser.getNamespaceHandler(Parser.java:1374) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.parser.Parser.decorateCustomNode(Parser.java:1361) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.parser.Parser.handleCustomAttributes(Parser.java:1340) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.parser.Parser.loadComponents(Parser.java:403) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.parser.Parser.populate(Parser.java:331) >>> ~[111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:351) >>> [111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) >>> [111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) >>> [?:?] >>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] >>> at >>> org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) >>> [111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45) >>> [111:org.apache.aries.blueprint.core:1.9.0] >>> at >>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:5
No URL is defined for schema http://www.springframework.org/schema/osgi.
Hi all, I've read some messages in this mailing list ( last I found was in August 2018 ), but I think, I have something different scenario. So, up until today ( when I was doing clean environment setup ) I was able to use define Spring Beans using XML ( as I am porting application, this is like top feature ), but now - out of the blue, I've started to get errors on deployment: 12:13:12.912 INFO [pool-33-thread-1] Generated blueprint for bundle framework.service/5.0.1.SNAPSHOT at /path/to/assemblies/apache-karaf/target/assembly/data/tmp/blueprint-spring-extender1831035315356717600.xml 12:13:12.917 INFO [pool-33-thread-1] Bundle framework.service/5.0.1.SNAPSHOT is waiting for namespace handlers [ http://www.springframework.org/schema/osgi] 12:13:12.895 INFO [features-3-thread-1] org.apache.aries.blueprint.spring.extender/0.4.0 12:13:12.935 WARN [Blueprint Extender: 1] No URL is defined for schema http://www.springframework.org/schema/osgi. This schema will not be validated 12:13:12.969 ERROR [Blueprint Extender: 1] Unable to start blueprint container for bundle framework.service/5.0.1.SNAPSHOT org.osgi.service.blueprint.container.ComponentDefinitionException: Unsupported node namespace: at org.apache.aries.blueprint.parser.Parser.getNamespaceHandler(Parser.java:1386) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.parser.Parser.getNamespaceHandler(Parser.java:1374) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.parser.Parser.decorateCustomNode(Parser.java:1361) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.parser.Parser.handleCustomAttributes(Parser.java:1340) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.parser.Parser.loadComponents(Parser.java:403) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.parser.Parser.populate(Parser.java:331) ~[111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:351) [111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) [111:org.apache.aries.blueprint.core:1.9.0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) [111:org.apache.aries.blueprint.core:1.9.0] at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:45) [111:org.apache.aries.blueprint.core:1.9.0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?] So, has something changed about Spring ( Spring DM ) from Karaf's point? I went over GIT commits ( for Karaf 4.2.2, last few weeks ), but did not find anything regarding Spring. I am using Spring 4.3.x ( from Karaf features ). I have spring-beans.xml inside /META-INF/spring/ folder, and I used http://www.springframework.org/schema/osgi namespace to "import" osgi:reference -- and this all worked like a charm. Now I get this error and no way to find any solution. I "kind of" gave up ( as I read JB's comments - why not use ( only ) Blueprint ), so I gave it a try. But than I was starting getting even more strange errors, for example Blueprint failed to set property defined in parent class, or create instance that takes Map as input into class constructor - as I failed to find matching property descriptor or class constructor. Than I went back to original question ... what has changed, that http://www.springframework.org/schema/osgi has stopped working ( as far as I know, spring-dm is even older ( based on the mailing messages I've read ) ), so I've uses aries-blueprint-spring. What am I missing? Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Pax JMS - ConcurrentModificationException
Hi JB, agree, I guess I am more used to use ConcurrentHashMap than synchronized keyword. Ok, will close PR. Kind Regards, Miroslav V V pon., 1. okt. 2018 ob 11:08 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Just to be clear, this fix is on Pax JDBC, but the same fix should be > applied to Pax JMS. Synchronized is IMHO better and consistent more than > using a ConcurrentHashMap. > > Regards > JB > > On 01/10/2018 11:05, Jean-Baptiste Onofré wrote: > > By the way, don't you think this commit: > > > > > https://github.com/ops4j/org.ops4j.pax.jdbc/commit/6bfeccea774195316d4d2382b5235a7c4d1501e0 > > > > already fix the issue ? > > > > I think the synchronized on methods are enough, so I think your PR is > > useless with this commit. > > > > Regards > > JB > > > > On 01/10/2018 08:51, Miroslav Beranič wrote: > >> Hi all, > >> > >> I was getting ( sometimes ) ConcurrentModificationException when using > >> PAX JMS ( 1.0.2 ). It turned out to be synchronization fail in > >> ConnectionFactoryConfigManager. I've made a fix by replace HashMap with > >> ConcurrentHashMap ( and removed synchronized methods ). > >> > >> I write here, as I think Karaf is main user base of the PAX JMS library. > >> > >> Any comment is welcome. Fix is located at: > >> > >> https://github.com/ops4j/org.ops4j.pax.jms/pull/15 > >> > >> P.S: I've also updated the dependencies ( in my local branch, not part > >> of the pull request ) - something to have in mind when/if doing local > >> build ( working with Karaf 4.2.2 ). > >> > >> Kind Regards, > >> Miroslav > >> > >> > >> > >> -- > >> Miroslav Beranič > >> MIBESIS > >> +386(0)40/814-843 > >> miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> > >> http://www.mibesis.si > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Pax JMS - ConcurrentModificationException
Hi all, I was getting ( sometimes ) ConcurrentModificationException when using PAX JMS ( 1.0.2 ). It turned out to be synchronization fail in ConnectionFactoryConfigManager. I've made a fix by replace HashMap with ConcurrentHashMap ( and removed synchronized methods ). I write here, as I think Karaf is main user base of the PAX JMS library. Any comment is welcome. Fix is located at: https://github.com/ops4j/org.ops4j.pax.jms/pull/15 P.S: I've also updated the dependencies ( in my local branch, not part of the pull request ) - something to have in mind when/if doing local build ( working with Karaf 4.2.2 ). Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Karaf Configuration Update
Hi JB, ( bow ) Thank you. Kind Regards, Miroslav V V čet., 13. sep. 2018 ob 11:16 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi, > > If you want to add to a specific configuration, you have to use a > ManagedService (or ManagedServiceFactory if it's a configuration factory). > > If you use scr with @Managed, it's a managed service listening change on > the org.apache.karaf.scheduler.quartz configuration (so > etc/org.apache.karaf.scheduler.quartz.cfg corresponding file). When you > want the configuration, the update() method is called. > > If you want to listen for any config change, you can implement a > ConfigurationListener. > > I will add a example showing this if you want. > > Regards > JB > > On 13/09/2018 11:06, Miroslav Beranič wrote: > > Hi all, > > > > I would like to hook into configuration change made in etc/* file. I put > > configuration file there and when I change it, I see in Karaf's log the > > change was picked up and also file was rewritten. > > > > But, how is this hooked in from the Java class ? > > > > > > I manual I've only found: > > Dynamic Configuration: Apache Karaf provides a set of commands focused > > on managing its own configuration. All configuration files are > > centralized in the etc folder. Any change in a configuration file is > > noticed and reloaded. > > > > Back at the scheduler I've seen this: > > @Managed("org.apache.karaf.scheduler.quartz") > > and implements org.osgi.service.cm.ManagedService > > > > That has method void updated(Dictionary var1) throws > > ConfigurationException; > > > > this is great, but this method is not called. > > > > Is there any example/code I can look at at take as an starting point? > > > > > > Kind Regards, > > Miroslav > > > > > > -- > > Miroslav Beranič > > MIBESIS > > +386(0)40/814-843 > > miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> > > http://www.mibesis.si > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Karaf Configuration Update
Hi all, I would like to hook into configuration change made in etc/* file. I put configuration file there and when I change it, I see in Karaf's log the change was picked up and also file was rewritten. But, how is this hooked in from the Java class ? I manual I've only found: Dynamic Configuration: Apache Karaf provides a set of commands focused on managing its own configuration. All configuration files are centralized in the etc folder. Any change in a configuration file is noticed and reloaded. Back at the scheduler I've seen this: @Managed("org.apache.karaf.scheduler.quartz") and implements org.osgi.service.cm.ManagedService That has method void updated(Dictionary var1) throws ConfigurationException; this is great, but this method is not called. Is there any example/code I can look at at take as an starting point? Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Bundle context - from inside POJO
JB, for top of my head - Quartz is passed only QuartzJob class, that gets created "when needed". Meaning - I can not pass any non-serializable data/object to the Job - as ( in my case ) Jobs are persistent in Oracle and scheduled/started at later time - in few minutes or few day, weeks, months ... In some cases also Karaf is restarted in between ( from the time Job was created and before it job is scheduled/started ) So usecase is: Quartz Job is created and scheduled ( meaning written to Oracle ) , due to time span or SW/HW failure Karaf is restarted - when times comes to start/schedule Quartz Job -- the environment is ( in most cases ) different in a way, I can not relay on any passed in object. I imagine also when running on distributed environment it would be a problem? ( I did not come to this at this point -- one more milestone ahead ). Thanks for the support (y) Kind Regards, Miroslav V V tor., 11. sep. 2018 ob 13:47 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > By the way, why don't you pass the bundle context to your job > implementation QuartzJob ? > > Regards > JB > > On 11/09/2018 13:46, Jean-Baptiste Onofré wrote: > > FrameworkUtil.getBundle(Foo.class).getBundleContext(); > > > > Regards > > JB > > > > On 11/09/2018 13:43, Miroslav Beranič wrote: > >> Hi all, > >> > >> some junior question, but would like to make it correct way. > >> > >> Is it possible and if it is, how - to get access to BundleContext ( and > >> other OSGi environment ) from some plain Java object ? > >> > >> for example > >> > >> there is an Activator or a Compontent ( class with annotation @Component > >> ) that has code like: > >> > >> MyClass inst = new MyClass(); > >> inst.doSomeAction(); > >> > >> How would it be possible to get access to BundleContext from inside of > >> the method doSomeAction() ? > >> > >> ( this is related to my Scheduler work - as I would need access to > >> BundleContext from inside of a Quartz job, job is executed later on some > >> day - and even Karaf restart can happen ) > >> > >> > >> Kind Regards, > >> Miroslav > >> > >> > >> > >> -- > >> Miroslav Beranič > >> MIBESIS > >> +386(0)40/814-843 > >> miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> > >> http://www.mibesis.si > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Bundle context - from inside POJO
Thank you JB. V V tor., 11. sep. 2018 ob 13:46 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > FrameworkUtil.getBundle(Foo.class).getBundleContext(); > > Regards > JB > > On 11/09/2018 13:43, Miroslav Beranič wrote: > > Hi all, > > > > some junior question, but would like to make it correct way. > > > > Is it possible and if it is, how - to get access to BundleContext ( and > > other OSGi environment ) from some plain Java object ? > > > > for example > > > > there is an Activator or a Compontent ( class with annotation @Component > > ) that has code like: > > > > MyClass inst = new MyClass(); > > inst.doSomeAction(); > > > > How would it be possible to get access to BundleContext from inside of > > the method doSomeAction() ? > > > > ( this is related to my Scheduler work - as I would need access to > > BundleContext from inside of a Quartz job, job is executed later on some > > day - and even Karaf restart can happen ) > > > > > > Kind Regards, > > Miroslav > > > > > > > > -- > > Miroslav Beranič > > MIBESIS > > +386(0)40/814-843 > > miroslav.bera...@mibesis.si <mailto:miroslav.bera...@mibesis.si> > > http://www.mibesis.si > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Bundle context - from inside POJO
Hi all, some junior question, but would like to make it correct way. Is it possible and if it is, how - to get access to BundleContext ( and other OSGi environment ) from some plain Java object ? for example there is an Activator or a Compontent ( class with annotation @Component ) that has code like: MyClass inst = new MyClass(); inst.doSomeAction(); How would it be possible to get access to BundleContext from inside of the method doSomeAction() ? ( this is related to my Scheduler work - as I would need access to BundleContext from inside of a Quartz job, job is executed later on some day - and even Karaf restart can happen ) Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Apache Karaf 4.2.2 ( 4.2.x ) Quartz support, with JDBC Persistence and C3P0 JDBC pool
JB, looks like I broke the build. [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:4.2.2-SNAPSHOT:verify (verify) on project standard: Verification failures: Verification failures: [ERROR] Feature resolution failed for [scheduler/4.2.2.SNAPSHOT] [ERROR] Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=scheduler; type=karaf.feature; version=4.2.2.SNAPSHOT; filter:="(&(osgi.identity=scheduler)(type=karaf.feature)(version>=4.2.2.SNAPSHOT))" [caused by: Unable to resolve scheduler/4.2.2.SNAPSHOT: missing requirement [scheduler/4.2.2.SNAPSHOT] osgi.identity; osgi.identity=org.apache.karaf.scheduler.core; type=osgi.bundle; version="[4.2.2.SNAPSHOT,4.2.2.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.scheduler.core/4.2.2.SNAPSHOT: missing requirement [org.apache.karaf.scheduler.core/4.2.2.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.quartz.management)(version>=2.2.0)(!(version>=3.0.0)))"]] [ERROR] Repositories: { [ERROR] file:/home/miroslav/Workspace/Apache/Karaf/karaf-4.2.x/assemblies/features/standard/target/feature/feature.xml [ERROR] mvn:org.apache.karaf.features/framework/4.2.2-SNAPSHOT/xml/features [ERROR] mvn:org.ops4j.pax.web/pax-web-features/7.2.3/xml/features [ERROR] } [ERROR] Resources: { [ERROR] mvn:org.apache.felix/org.apache.felix.configadmin/1.9.4 [ERROR] mvn:org.apache.felix/org.apache.felix.coordinator/1.0.2 [ERROR] mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4 [ERROR] mvn:org.apache.karaf.features/org.apache.karaf.features.core/4.2.2-SNAPSHOT [ERROR] mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.2-SNAPSHOT [ERROR] mvn:org.apache.karaf.scheduler/org.apache.karaf.scheduler.core/4.2.2-SNAPSHOT [ERROR] mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.11_1 [ERROR] mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.5.0 [ERROR] mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/2.5.0 [ERROR] mvn:org.fusesource.jansi/jansi/1.17.1 [ERROR] mvn:org.ops4j.pax.logging/pax-logging-api/1.10.1 [ERROR] mvn:org.ops4j.pax.logging/pax-logging-log4j2/1.10.1 [ERROR] mvn:org.ops4j.pax.url/pax-url-aether/2.5.4 [ERROR] } I will have to take a look at this more, I do not have time now, will continue later today or tomorrow. I guess I was to quick ... my bad. Kind Regards, Miroslav V V pet., 7. sep. 2018 ob 15:26 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > You created the PR on your base. > > It should be created based on https://github.com/apache/karaf. > > Regards > JB > > On 07/09/2018 15:20, Miroslav Beranič wrote: > > Hi JB, > > > > ( I guess I did ok ), > > > > I've created PR at: > > https://github.com/mibesis/apache-karaf/pull/1 > > > > Kind Regards, > > Miroslav > > > > > > > > V V pet., 7. sep. 2018 ob 14:56 je oseba Jean-Baptiste Onofré > > mailto:j...@nanthrax.net>> napisala: > > > > Oh sorry, PR means Pull Request on Github. > > > > You can find some details on the contribution guide: > > > > http://karaf.apache.org/community.html > > > > Don't hesitate to ping me (maybe you can join the Karaf Slack > channel). > > I would love to discuss with you about that. > > > > Regards > > JB > > > > On 07/09/2018 14:53, Miroslav Beranič wrote: > > > Hi JB, > > > > > > Scheduler with use on Cellar is my semi-next task, scheduled for > > > beginning of October. > > > > > > PR? Sorry, I am not into this, so PR stands for? > > > > > > Kind Regards, > > > Miroslav > > > > > > > > > > > > > > > V V pet., 7. sep. 2018 ob 14:48 je oseba Jean-Baptiste Onofré > > > mailto:j...@nanthrax.net> > > <mailto:j...@nanthrax.net > > <mailto:j...@nanthrax.net>>> napisala: > > > > > > Hi, > > > > > > thanks for the your detailed update on the scheduler. > > > > > > I did the change in Karaf 4.2.x to be able to support Quartz > > scheduler > > > in cluster mode (especially when used with Cellar). > > > > > > I worked fine when I tested, using dynamic import, so I'm a bit > > > surprised it doesn't work out of the box for you. > > > > > > Let me take a look on your patch file to identify the missing > > parts. In &
Re: Apache Karaf 4.2.2 ( 4.2.x ) Quartz support, with JDBC Persistence and C3P0 JDBC pool
Hi JB, ( I guess I did ok ), I've created PR at: https://github.com/mibesis/apache-karaf/pull/1 Kind Regards, Miroslav V V pet., 7. sep. 2018 ob 14:56 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Oh sorry, PR means Pull Request on Github. > > You can find some details on the contribution guide: > > http://karaf.apache.org/community.html > > Don't hesitate to ping me (maybe you can join the Karaf Slack channel). > I would love to discuss with you about that. > > Regards > JB > > On 07/09/2018 14:53, Miroslav Beranič wrote: > > Hi JB, > > > > Scheduler with use on Cellar is my semi-next task, scheduled for > > beginning of October. > > > > PR? Sorry, I am not into this, so PR stands for? > > > > Kind Regards, > > Miroslav > > > > > > > > > > V V pet., 7. sep. 2018 ob 14:48 je oseba Jean-Baptiste Onofré > > mailto:j...@nanthrax.net>> napisala: > > > > Hi, > > > > thanks for the your detailed update on the scheduler. > > > > I did the change in Karaf 4.2.x to be able to support Quartz > scheduler > > in cluster mode (especially when used with Cellar). > > > > I worked fine when I tested, using dynamic import, so I'm a bit > > surprised it doesn't work out of the box for you. > > > > Let me take a look on your patch file to identify the missing parts. > In > > the mean time, do you mind to prepare a PR ? > > > > Thanks ! > > Regards > > JB > > > > On 07/09/2018 14:22, Miroslav Beranič wrote: > > > Hi guys, > > > > > > I am working and talking about Apache Karaf version 4.2.2-SNAPSHOT > ( > > > current master on Github ). > > > > > > I was rally happy to see Scheduler service with Quartz as default > > > implementation. Without much thinking, I've hooked up Quartz with > > JDBC ( > > > I would really like Karaf Scheduler ( Quartz ) to use existing > > > Datasource and JPA but no luck ). > > > > > > When I moved forward, I did not care about JPA that much any more, > as > > > even JDBC was not working. To begin, this is what I've changed in > my > > > Karaf configuration: > > > > > > file: etc/org.apache.karaf.scheduler.quartz.cfg > > > org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX > > > > > > > org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate > > > org.quartz.jobStore.useProperties=false > > > org.quartz.jobStore.dataSource=MyQuartzDS > > > org.quartz.jobStore.isClustered=true > > > org.quartz.jobStore.tablePrefix=q_ # Oracle has 30 char limit on > > > identifier, I started to cry, when I saw error message in SQL > > terminal. > > > I use Oracle 12c1 > > > org.quartz.jobStore.clusterCheckinInterval=3 > > > > > > > > > org.quartz.dataSource.MyQuartzDS.driver=oracle.jdbc.driver.OracleDriver > > > > > org.quartz.dataSource.MyQuartzDS.URL=jdbc:oracle:thin:@ > //oracle.local:1521/test > > > org.quartz.dataSource.MyQuartzDS.user=APP > > > org.quartz.dataSource.MyQuartzDS.password=app > > > org.quartz.dataSource.MyQuartzDS.maxConnections=5 > > > org.quartz.dataSource.MyQuartzDS.validationQuery=select * from > dual; > > > > > > org.quartz.scheduler.jmx.export=true > > > org.quartz.scheduler.rmi.export=false > > > org.quartz.scheduler.rmi.proxy=false > > > > > > This seems to be legit. As I saw in > > > org.apache.karaf.scheduler.core.Activator#doStart method, all / > only > > > properties with key prefix "org.quartz" are forwarded to Quartz. > Looks > > > OK, but I guess "org.quartz." ( with a dot at the end ) would be > more > > > correct. But, minor issue. > > > > > > Lets start it up. Well, no - it will not. To not write all here, > all > > > error messages, all missing error messages, but strange behavior, > > let me > > > go to, what I think, is a solution. > > > > > > So steps to make your Karaf Scheduler ( 4.2.x ) work with Quartz > ( > > > 2.2.x ) , I did this: > > > > > > 1.) Karaf 4.2.2 is using Quartz 2.2.1,
Re: Apache Karaf 4.2.2 ( 4.2.x ) Quartz support, with JDBC Persistence and C3P0 JDBC pool
Hi JB, Scheduler with use on Cellar is my semi-next task, scheduled for beginning of October. PR? Sorry, I am not into this, so PR stands for? Kind Regards, Miroslav V V pet., 7. sep. 2018 ob 14:48 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi, > > thanks for the your detailed update on the scheduler. > > I did the change in Karaf 4.2.x to be able to support Quartz scheduler > in cluster mode (especially when used with Cellar). > > I worked fine when I tested, using dynamic import, so I'm a bit > surprised it doesn't work out of the box for you. > > Let me take a look on your patch file to identify the missing parts. In > the mean time, do you mind to prepare a PR ? > > Thanks ! > Regards > JB > > On 07/09/2018 14:22, Miroslav Beranič wrote: > > Hi guys, > > > > I am working and talking about Apache Karaf version 4.2.2-SNAPSHOT ( > > current master on Github ). > > > > I was rally happy to see Scheduler service with Quartz as default > > implementation. Without much thinking, I've hooked up Quartz with JDBC ( > > I would really like Karaf Scheduler ( Quartz ) to use existing > > Datasource and JPA but no luck ). > > > > When I moved forward, I did not care about JPA that much any more, as > > even JDBC was not working. To begin, this is what I've changed in my > > Karaf configuration: > > > > file: etc/org.apache.karaf.scheduler.quartz.cfg > > org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX > > > org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate > > org.quartz.jobStore.useProperties=false > > org.quartz.jobStore.dataSource=MyQuartzDS > > org.quartz.jobStore.isClustered=true > > org.quartz.jobStore.tablePrefix=q_ # Oracle has 30 char limit on > > identifier, I started to cry, when I saw error message in SQL terminal. > > I use Oracle 12c1 > > org.quartz.jobStore.clusterCheckinInterval=3 > > > > org.quartz.dataSource.MyQuartzDS.driver=oracle.jdbc.driver.OracleDriver > > org.quartz.dataSource.MyQuartzDS.URL=jdbc:oracle:thin:@ > //oracle.local:1521/test > > org.quartz.dataSource.MyQuartzDS.user=APP > > org.quartz.dataSource.MyQuartzDS.password=app > > org.quartz.dataSource.MyQuartzDS.maxConnections=5 > > org.quartz.dataSource.MyQuartzDS.validationQuery=select * from dual; > > > > org.quartz.scheduler.jmx.export=true > > org.quartz.scheduler.rmi.export=false > > org.quartz.scheduler.rmi.proxy=false > > > > This seems to be legit. As I saw in > > org.apache.karaf.scheduler.core.Activator#doStart method, all / only > > properties with key prefix "org.quartz" are forwarded to Quartz. Looks > > OK, but I guess "org.quartz." ( with a dot at the end ) would be more > > correct. But, minor issue. > > > > Lets start it up. Well, no - it will not. To not write all here, all > > error messages, all missing error messages, but strange behavior, let me > > go to, what I think, is a solution. > > > > So steps to make your Karaf Scheduler ( 4.2.x ) work with Quartz ( > > 2.2.x ) , I did this: > > > > 1.) Karaf 4.2.2 is using Quartz 2.2.1, that is OK, it could be upgraded > > to 2.3.0, but I do not need it ( as I am porting application from Quartz > > 1.8.5, this is way of my list of worries ) > > 2.) scheduler/pom.xml has package imports defined as: > > > > !com.mchange.*, > > !oracle.*, > > !org.quartz.*, > > !weblogic.*, > > !javax.transaction, > > javax.servlet*;resolution:=optional, > > org.jboss.*;resolution:=optional, > > * > > > > > > ( I really am not OSGi expert, and all, but this looked strange to me ), > > turned out be "true" ( I guess, as I am open to option, I am wrong, but > > end of the day - this works for me, so for me -t his is correct ) > > > > I changed this to: > > > > com.mchange.*;resolution:=optional, > > oracle.*;resolution:=optional, > > org.quartz.*, > > !weblogic.*, > > javax.transaction, > > javax.servlet*;resolution:=optional, > > org.jboss.*;resolution:=optional, > > * > > > > > > ( removed all the ! in front of the packages and added > > resolution:=optional, as not all users want persistent Quartz jobs , I > > guess ) > > > > This is not all, now, when I deploy to Karaf, all sort of issue is > > reported. Turned out I need to install > > org.apache.servicemix.bundles.quartz b
Apache Karaf 4.2.2 ( 4.2.x ) Quartz support, with JDBC Persistence and C3P0 JDBC pool
rm. I started to cry again. I did not test features, before I pushed for the migration. There is no way back, so what can be done now here. Let's see. I basically "re-wrote" Scheduler service in Karaf. What I did: 1.) Make sure Job data has only Serializable data - - ScheduleOptions was made Serializable, with addition to move Trigger creation from InternalScheduleOptions's constructor to method compile(). - getJobs() method from Scheduler interface returns String names and not Objects - Updated QuartzJobExecutor to remove non-serializable items from JobDataMap storage 2.) - Added custom StdScheduler and StdSchedulerFactory classes, to implemented changes - Added SchedulerStorage as support for "backward compatibility" and "short lived" jobs. This is not good place to use it. 3.) - Updated Scheduler Shell commands to use changed Scheduler API ( job names are as keys ) Patch file is in this email attachements, I've also pushed changes to my Github repository, with only this changes: https://github.com/mibesis/apache-karaf/tree/karaf-4.2.2-quartz-jdbc Anyone that is willing to use it -- please do, I would only ask Karf core development team to "make sure" Quartz Job data is always fill with Serializable data, as this makes all the difference and there is no need for method getJobs() from Sheculer to return Map as it can not make data Serializable -- to return Map is OK, as all API calls are made over keys, names, etc. I need few days, to come over this and coffee cups, it is Friday now, so I guess I will grab some cold drink ... it was big learing experiance for me, to make this work. So this is my first patch file, if there is something else needed or I can support in someway, let me know. ( I know SchedulerStorage is not perfect solution, but again: it works for me ; but I agree, this can be made better ) I know I do not say it much ( ever ) -- Apache Karaf is really great platform, it is just that I send email, when I have problems :D ... Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si Index: scheduler/pom.xml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 === --- scheduler/pom.xml (date 1536070286000) +++ scheduler/pom.xml (date 1536318876000) @@ -64,11 +64,11 @@ org.apache.karaf.scheduler;version=${project.version};-noimport:=true -!com.mchange.*, -!oracle.*, -!org.quartz.*, +com.mchange.*;resolution:=optional, +oracle.*;resolution:=optional, +org.quartz.*, !weblogic.*, -!javax.transaction, +javax.transaction, javax.servlet*;resolution:=optional, org.jboss.*;resolution:=optional, * Index: scheduler/src/main/java/org/apache/karaf/scheduler/ScheduleOptions.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 === --- scheduler/src/main/java/org/apache/karaf/scheduler/ScheduleOptions.java (date 1536070286000) +++ scheduler/src/main/java/org/apache/karaf/scheduler/ScheduleOptions.java (date 1536318876000) @@ -25,7 +25,7 @@ * * @since 2.3 */ -public interface ScheduleOptions { +public interface ScheduleOptions extends Serializable { /** * Add optional configuration for the job. Index: scheduler/src/main/java/org/apache/karaf/scheduler/Scheduler.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 === --- scheduler/src/main/java/org/apache/karaf/scheduler/Scheduler.java (date 1536070286000) +++ scheduler/src/main/java/org/apache/karaf/scheduler/Scheduler.java (date 1536318876000) @@ -98,7 +98,7 @@ */ boolean unschedule(String jobName); -Map getJobs() throws SchedulerError; +Map getJobs() throws SchedulerError; /** * Triggers a scheduled job. Index: scheduler/src/main/java/org/apache/karaf/scheduler/SchedulerStorage.java === --- scheduler/src/main/java/org/apache/karaf/scheduler/SchedulerStorage.java (date 1536318876000) +++ scheduler/src/main/java/org/apache/karaf/scheduler/SchedulerStorage.java (date 1536318876000) @@ -0,0 +1,15 @@ +package org.apache.karaf.scheduler; + +import java.io.Serializable; + +public interface SchedulerSt
Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )
Hi JB, thanks for the tip. So, another strange thing is: - when this block occures - feature fail to install, no other feature is possible to install, even some basic/simple one. Please see attachment, full log of what I did. In short ( last few lines ): . . . Done. karaf@root()> feature:install -v my-infrastructure-requirements-jms ( this is same as in previous feature definition ) Adding features: my-infrastructure-requirements-jms/[2.0.0,2.0.0] ^C~ # Fail here - waiting, but no return karaf@root()> feature:info my-infrastructure-requirements-jms Feature my-infrastructure-requirements-jms 2.0.0 Feature has no configuration Feature configuration files: /etc/org.apache.servicemix.activemq.service.cfg Feature depends on: aries-blueprint-spring 0.0.0 shell-compat [4.2.2, 5) activemq-broker [5.15.7, 6) activemq-cf [5.15.7, 6) activemq-blueprint [5.15.7, 6) jms [4.2.2, 5) camel [2.23.0, 3) camel-spring [2.23.0, 3) camel-jms [2.23.0, 3) camel-blueprint [2.23.0, 3) camel-cxf [2.23.0, 3) camel-jpa [2.23.0, 3) pax-jms-activemq [1.0.2, 2) Feature contains followed bundles: mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.camel/7.1.0-SNAPSHOT mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/7.1.0-SNAPSHOT Feature has no conditionals. karaf@root()> feature:install aries-blueprint-spring ^C~ # Fail here - after first waiting and no return, no additional feature is possible to install karaf@root()> So I am able to "block" Karaf from installing additional features with this, and this is not so nice "feature" to have in Karaf :) ( to be able to block feature install ) Kind Regards, Miroslav V V sre., 5. sep. 2018 ob 10:36 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > You should use feature:install -v -t to get details and simulation. > > Regards > JB > > On 05/09/2018 10:34, Miroslav Beranič wrote: > > HI JB, > > this can be, I would have to check for each feature, but as said: when > porting from Karaf 4.0.9 to 4.2.2, I guess this would have to be addressed > more verbose -- some kind of warning message or something. > > I will re-create feature file with suggested changes, but I stopped using > dependency/prerequisite attributes, as I found out I ran into different set > of problems. > > I had this kind of problems, when setting up JPA datasource - as conumers > complaint to on start on missing datasource - but bundles installed and > started. > > It is "strange" when command "feature:install foo" does not return to > terminal and there is no message in log file. > > Thanks, kind regards, > Miroslav > > > > V V sre., 5. sep. 2018 ob 10:08 je oseba Jean-Baptiste Onofré < > j...@nanthrax.net> napisala: > >> Hi >> >> the resolver behavior is not exactly the same if you do: >> >> feature:install foo >> >> or >> >> feature:install jms bar foo >> >> If you feature expects another feature providing a service, than, the >> "dependency" feature should be completely installed and started to provide >> the services before your feature is install. >> >> For instance, if you have: >> >> >> foo >> mvn:my/my/xx >> >> >> If "my" bundle has a requirement to a service provided by foo, then, you >> can have an issue as foo can be installed async. So, in that case, you >> should first install and start foo first. You can achieve this using >> prerequisite flag: >> >> >> foo >> mvn:my/my/xx >> >> >> Do you think you are in this case ? >> >> Regards >> JB >> >> On 05/09/2018 09:42, Miroslav Beranič wrote: >> >> Hi giys, >> >> I am tracking mailing list last few weeks, can be, I missed some mails. >> >> So, I think I have similar issue that what reported few days ago from >> Thiago, with title "Unable to deploy a Karaf kar file containing a >> ComponentFactory OSGi declarative service". >> >> I have application porting from ServiceMix 7.0.2 ( build from ServiceMix >> GitHub master ) to Karaf 4.2.x ( fist 4.2.1 and now 4.2.2, both Github >> source ). >> >> I have application in multiple Karaf Features. In ServiceMix 7.0.2 ( >> Karaf 4.0.9 ) I install application with on "super parent" feature, that is >> a tree of features ( XSD Feature namespace 1.0 ), so without dependencies >> or prerequisite attributes. >> >> Same set of features, when deployed in Karaf 4.2.x is "blocked", it stops >> in different steps, at different features. But this is in features of >> pre-defin
Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )
HI JB, this can be, I would have to check for each feature, but as said: when porting from Karaf 4.0.9 to 4.2.2, I guess this would have to be addressed more verbose -- some kind of warning message or something. I will re-create feature file with suggested changes, but I stopped using dependency/prerequisite attributes, as I found out I ran into different set of problems. I had this kind of problems, when setting up JPA datasource - as conumers complaint to on start on missing datasource - but bundles installed and started. It is "strange" when command "feature:install foo" does not return to terminal and there is no message in log file. Thanks, kind regards, Miroslav V V sre., 5. sep. 2018 ob 10:08 je oseba Jean-Baptiste Onofré < j...@nanthrax.net> napisala: > Hi > > the resolver behavior is not exactly the same if you do: > > feature:install foo > > or > > feature:install jms bar foo > > If you feature expects another feature providing a service, than, the > "dependency" feature should be completely installed and started to provide > the services before your feature is install. > > For instance, if you have: > > > foo > mvn:my/my/xx > > > If "my" bundle has a requirement to a service provided by foo, then, you > can have an issue as foo can be installed async. So, in that case, you > should first install and start foo first. You can achieve this using > prerequisite flag: > > > foo > mvn:my/my/xx > > > Do you think you are in this case ? > > Regards > JB > > On 05/09/2018 09:42, Miroslav Beranič wrote: > > Hi giys, > > I am tracking mailing list last few weeks, can be, I missed some mails. > > So, I think I have similar issue that what reported few days ago from > Thiago, with title "Unable to deploy a Karaf kar file containing a > ComponentFactory OSGi declarative service". > > I have application porting from ServiceMix 7.0.2 ( build from ServiceMix > GitHub master ) to Karaf 4.2.x ( fist 4.2.1 and now 4.2.2, both Github > source ). > > I have application in multiple Karaf Features. In ServiceMix 7.0.2 ( Karaf > 4.0.9 ) I install application with on "super parent" feature, that is a > tree of features ( XSD Feature namespace 1.0 ), so without dependencies or > prerequisite attributes. > > Same set of features, when deployed in Karaf 4.2.x is "blocked", it stops > in different steps, at different features. But this is in features of > pre-defined features, like JMS, JPA, Hibernate, ActiveMQ, ... > > Strange thing is, when I install one single feature at a time it works. > For example ( there is multiple such feature groups, just one here ): > > version="${project.version}"> > aries-blueprint-spring > shell-compat > activemq-broker > activemq-cf > activemq-blueprint > > mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.camel/7.1.0-SNAPSHOT > > mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/7.1.0-SNAPSHOT > > jms > camel > camel-spring > camel-jms > camel-blueprint > camel-cxf > camel-jpa > pax-jms-activemq > finalname="/etc/org.apache.servicemix.activemq.service.cfg"> > > mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/${project.version}/cfg/activemq-service > > > > So almost always it stops somewhere when installing this feature, but when > I install it one by one -- it works. ( it never installed when installing > "feature groups", this is the "feature group" it stops most of the time, > other is JPA related "feature group" ). > > so: feature:install my-infrastructure-requirements-jms > > has message in log: > 2018-09-05T09:16:08,539 | INFO | pipe-feature:install > my-infrastructure-requirements-jms | FeaturesServiceImpl | 11 > - org.apache.karaf.features.core - 4.2.2.SNAPSHOT | Adding features: > my-infrastructure-requirements-jms/[2.0.0,2.0.0] > > That is all there is ... and it waits here, for ever. So it seems there is > really a condition race. So when I saw mail from Thiago, I am even more > sure, this is true. > > Here is full feature file. Please note, I have some features, to "fix" > feature install order - spring is a mess, as it starts to install version > 5, as "best one" but this is not the case for me - as I want to use > ActiveMQ. ( you can see I also use "future" version of ActiveMQ 5.15.7 - my > own build with updated versions of dependencies in ActiveMQ, same behaviour &g
Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )
sion}/cfg/activemq-service scr jndi transaction pax-cdi my-infrastructure-requirements-spring-43 pax-jdbc-config cxf-transports-jms mvn:com.miroslav.my.infrastructure/data-source/${project.version} mvn:com.miroslav.my.infrastructure/toolbox/${project.version} mvn:com.miroslav.my.infrastructure/toolbox-shell-command/${project.version} mvn:com.miroslav.my.infrastructure.webservice/model/${project.version} mvn:com.miroslav.my.infrastructure.webservice/toolbox/${project.version} my-infrastructure-requirements-spring-43 my-infrastructure-requirements-jpa my-infrastructure-requirements-cxf my-infrastructure-requirements-jms my-infrastructure-datasource my-infrastructure-toolbox my-infrastructure-webservice If you need some more info, please let me know. ( this feature file is "a mess", as I did not know what is wrong ... so no need to judge it for its beauty please :D :D ) I am building ActiveMQ, Camel, Pax, Karaf, Hibernate ... SNAPSHOT versions daily and testing it. Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: ActiveMQ support
Hi all, an answer to myself and anyone that runs into same issue: It needs additional shell compatibility feature: $ feature:install shell-compat Works now. All solved. Kind Regards, Miroslav 2018-08-14 15:35 GMT+02:00 Miroslav Beranič : > Hi all, > > so I moved from ServiceMix 7 ( build from GitHub source repository ) to > Karaf 4.2.1-SNAPSHOT. > > I follow Karaf documentation at ( http://karaf.apache.org/ > manual/latest/#_jms ) where it is described under section 4.16.6. JMS. > > Basic Karaf commnds are ( should be ): > > karaf@root()> feature:repo-add activemq > Adding feature url mvn:org.apache.activemq/activemq-karaf/LATEST/xml/ > features > karaf@root()> feature:install activemq-broker > > I get failure: > Error executing command: Unable to resolve root: missing requirement > [root] osgi.identity; osgi.identity=activemq-broker; type=karaf.feature; > version="[5.15.5,5.15.5]"; filter:="(&(osgi.identity= > activemq-broker)(type=karaf.feature)(version>=5.15.5)(version<=5.15.5))" > [caused by: Unable to resolve activemq-broker/5.15.5: missing requirement > [activemq-broker/5.15.5] osgi.identity; osgi.identity=activemq; > type=karaf.feature; version="[5.15.5,5.15.5]" [caused by: Unable to resolve > activemq/5.15.5: missing requirement [activemq/5.15.5] osgi.identity; > osgi.identity=activemq-karaf; type=osgi.bundle; version="[5.15.5,5.15.5]"; > resolution:=mandatory [caused by: Unable to resolve activemq-karaf/5.15.5: > missing requirement [activemq-karaf/5.15.5] osgi.wiring.package; > filter:="(&(osgi.wiring.package=org.apache.felix.gogo. > commands)(version>=0.16.0)(!(version>=1.0.0)))"]]] > > So it says: > Unable to resolve activemq-karaf/5.15.5: missing requirement > [activemq-karaf/5.15.5] osgi.wiring.package; filter:="(&(osgi.wiring. > package=org.apache.felix.gogo.commands)(version>=0.16.0)(!( > version>=1.0.0)))"]]] > > As I understand it, it is missing Gogo shell commans package. As far as I > know, this was deprecated for quite some time, as I also had to migrate my > commands. But ... eather way, how is it possible to setup ActiveMQ, as it > is described in documentation. I do not see any repository to get old gogo > shell package. > > This is second failure, first one was missing Spring version 4, but I know > how to fix it ( when I fixed that issue, I ran into gogo missing package ). > > Karaf version 4.2.1-SNAPSHOT, ActiveMQ version 5.15.5, Java version 8. > > Kind Regards, > Miroslav > > > -- > Miroslav Beranič > MIBESIS > +386(0)40/814-843 > miroslav.bera...@mibesis.si > http://www.mibesis.si > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
ActiveMQ support
Hi all, so I moved from ServiceMix 7 ( build from GitHub source repository ) to Karaf 4.2.1-SNAPSHOT. I follow Karaf documentation at ( http://karaf.apache.org/manual/latest/#_jms ) where it is described under section 4.16.6. JMS. Basic Karaf commnds are ( should be ): karaf@root()> feature:repo-add activemq Adding feature url mvn:org.apache.activemq/activemq-karaf/LATEST/xml/features karaf@root()> feature:install activemq-broker I get failure: Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=activemq-broker; type=karaf.feature; version="[5.15.5,5.15.5]"; filter:="(&(osgi.identity=activemq-broker)(type=karaf.feature)(version>=5.15.5)(version<=5.15.5))" [caused by: Unable to resolve activemq-broker/5.15.5: missing requirement [activemq-broker/5.15.5] osgi.identity; osgi.identity=activemq; type=karaf.feature; version="[5.15.5,5.15.5]" [caused by: Unable to resolve activemq/5.15.5: missing requirement [activemq/5.15.5] osgi.identity; osgi.identity=activemq-karaf; type=osgi.bundle; version="[5.15.5,5.15.5]"; resolution:=mandatory [caused by: Unable to resolve activemq-karaf/5.15.5: missing requirement [activemq-karaf/5.15.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.felix.gogo.commands)(version>=0.16.0)(!(version>=1.0.0)))"]]] So it says: Unable to resolve activemq-karaf/5.15.5: missing requirement [activemq-karaf/5.15.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.felix.gogo.commands)(version>=0.16.0)(!(version>=1.0.0)))"]]] As I understand it, it is missing Gogo shell commans package. As far as I know, this was deprecated for quite some time, as I also had to migrate my commands. But ... eather way, how is it possible to setup ActiveMQ, as it is described in documentation. I do not see any repository to get old gogo shell package. This is second failure, first one was missing Spring version 4, but I know how to fix it ( when I fixed that issue, I ran into gogo missing package ). Karaf version 4.2.1-SNAPSHOT, ActiveMQ version 5.15.5, Java version 8. Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Apache Karaf 4.x JPA - Working example
Hi François, thank you for in-depth explanation. By Blueprint XML I mean: datasource.xml: http://www.osgi.org/xmlns/blueprint/v1.0.0"; xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0"; xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";> I see, I was looking at different feature name, I was referring to this feature ( that defines datasource ): osgi.jdbc.driver.class=org.h2.Driver databaseName=booking;create=true dataSourceName=booking osgi.service;objectClass=javax.sql.DataSource;effective:=active; osgi.jndi.service.name=booking You've updated: > Hi Miroslav, > > The changes are : > > - use the H2 drivers with class declaration > - add jndi feature > - add capabilities for Hibernate Persistence Provider > > The provider module emmebed the persistence.xml with the Persistence > provider declaration inside so it require the Persistence provider. > > We have : > - common feature : provide Hibernate Persistence capabilities > - provider feature : require Hibernate Persistence capabilities > > About feature xml and blueprint DSL, this not the same. The feature XML is > used to packaging bundles and bundles/feature dependencies, the blueprint > xml is used to manage your services instances and their services usage. > > Regards > > François > Le 25 juil. 2018 00:14, Miroslav Beranič a > écrit : > > Hi, > > @Jean-Baptiste Onofré, François: I can confirm, issues is fixed now. I can > get JPA example working. I see output in Karaf Shell. > > but :) > > > What was the fix ( so I can understand what was wrong, for any future > case, other projects ): > > I see examples/karaf-jpa-example/karaf-jpa-example- > features/src/main/feature/feature.xml ( I guess this is most of the fix ) > > version="${project.version}"> > transaction transaction feature> > +jndi > pax-jdbc-config > pax-jdbc-config > pax-jdbc-h2 pax-jdbc-h2 feature> > pax-jdbc-pool-dbcp2 > pax-jdbc-pool-dbcp2 > jdbc jdbc > jpa version="[2,3)">jpa > -hibernate > +hibernate > + > +osgi.service;objectClass=javax.persistence.spi. > PersistenceProvider;effective:=active;javax.persistence. > provider=org.hibernate.jpa.HibernatePersistenceProvider > + > > > So this three lines: > + > +osgi.service;objectClass=javax.persistence.spi. > PersistenceProvider;effective:=active;javax.persistence. > provider=org.hibernate.jpa.HibernatePersistenceProvider > + > > I have similar Bundle structure, but I have dedicated Bundle for > DataSource setup/configuration. How do I translate this "Feature DSL" to > "Blueprint DSL" ==> How would this translate into Blueprint XML? > > So changes look they make sense but, this is first time I see this to be > defined so explicit. This was my original complaint, as it always looked > like this piece of code was missing ( also in other available online > examples ). > > I also guess "effective:=active;" is important ( as I read the "I've > explained it already three times" forum post ) ( FW: > http://karaf.922171.n3.nabble.com/What-does-effective-active-mean- > td4047770.html ) > > Well, thank you both very much. Saved me tons of headache. > > Kind Regards, > Miroslav > > > 2018-07-24 20:51 GMT+02:00 Jean-Baptiste Onofré : > > Hi, > > François just fixed the JPA example of the DEV_GUIDE branch. > > I will add the corresponding examples itests tomorrow. > > Regards > JB > > On 20/07/2018 16:17, Miroslav Beranič wrote: > > Hi, > > > > I've upgraded my environment from ServiceMix 7.1.0-SNAPSHOT ( running > > Karaf 4.0.9 ) to Karaf 4.1.x ( GitHub ) branch and later on I've > > experimented with version 4.2.x. > > I was using linked linkes from Karaf home page ( > > https://karaf.apache.org/documentation.html ) to GitHub Examples - for > JPA. > > > > My main task is to get JPA 2 up and running, but I fail to do so. > > > > So on provided examples Github repository: > > https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/ka > ra
Re: Apache Karaf 4.x JPA - Working example
Hi, @Jean-Baptiste Onofré, François: I can confirm, issues is fixed now. I can get JPA example working. I see output in Karaf Shell. but :) What was the fix ( so I can understand what was wrong, for any future case, other projects ): I see examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml ( I guess this is most of the fix ) transaction transaction +jndi pax-jdbc-config pax-jdbc-config pax-jdbc-h2 pax-jdbc-h2 pax-jdbc-pool-dbcp2 pax-jdbc-pool-dbcp2 jdbc jdbc jpa jpa -hibernate +hibernate + + osgi.service;objectClass=javax.persistence.spi.PersistenceProvider;effective:=active;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider + So this three lines: + + osgi.service;objectClass=javax.persistence.spi.PersistenceProvider;effective:=active;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider + I have similar Bundle structure, but I have dedicated Bundle for DataSource setup/configuration. How do I translate this "Feature DSL" to "Blueprint DSL" ==> How would this translate into Blueprint XML? So changes look they make sense but, this is first time I see this to be defined so explicit. This was my original complaint, as it always looked like this piece of code was missing ( also in other available online examples ). I also guess "effective:=active;" is important ( as I read the "I've explained it already three times" forum post ) ( FW: http://karaf.922171.n3.nabble.com/What-does-effective-active-mean-td4047770.html ) Well, thank you both very much. Saved me tons of headache. Kind Regards, Miroslav 2018-07-24 20:51 GMT+02:00 Jean-Baptiste Onofré : > Hi, > > François just fixed the JPA example of the DEV_GUIDE branch. > > I will add the corresponding examples itests tomorrow. > > Regards > JB > > On 20/07/2018 16:17, Miroslav Beranič wrote: > > Hi, > > > > I've upgraded my environment from ServiceMix 7.1.0-SNAPSHOT ( running > > Karaf 4.0.9 ) to Karaf 4.1.x ( GitHub ) branch and later on I've > > experimented with version 4.2.x. > > I was using linked linkes from Karaf home page ( > > https://karaf.apache.org/documentation.html ) to GitHub Examples - for > JPA. > > > > My main task is to get JPA 2 up and running, but I fail to do so. > > > > So on provided examples Github repository: > > https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/ > karaf-jpa-example > > > > I've tested with Karaf 4.1.x and 4.2.x and in both version, Examples for > > JPA do now work - for me. > > > > For Karaf 4.2.x I've created PasteBin outputs ( please see ): > > 1.) https://pastebin.com/eJybVNhn > > 2.) https://pastebin.com/W2UhihdR > > > > In examples, I've noted that there is a reference to Hibernate > > 6.0.10.Final - this version is not released yet ( hibernate.org > > <http://hibernate.org> ), so I guess this is a wrong version, or ? as I > > see Karaf has build-in support for Hibernate 5.2.9.Final. > > > > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/ > karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml > > > > For Hibernate version I am looking at: > > https://github.com/apache/karaf/blob/master/pom.xml > > 5.2.9.Final > > > > So what I did was: > > > > 1.) checked out Karaf 4.1.x from Github > > 2.) checked out Karaf Examples ( DEV_GUIDE branch from Github ) > > > > 3.) Build Karaf with Maven: mvn -Pfastinstall and started Karaf with > > ./bin/karaf debug > > 4.) Build Karaf Examples ( changed version of Hibernate from > > 6.0.10.Final to 5.2.9.Final ) > > > > Read instruction from: > > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/ > karaf-jpa-example/README.md > > > > 5.) feature:repo-add > > mvn:org.apache.karaf.examples/karaf-jpa-example-features/4. > 2.1-SNAPSHOT/xml > > 6.) feature:install karaf-jpa-example-datasource > > 7.) feature:install karaf-jpa-example-provider > > > > Fail: > > > > Error executing command: Unable to resolve root: missing requirement > > [root] osgi.identity; osgi.identity=karaf-jpa-example-provider; > > type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; > > filter:="(&(osgi.identity=karaf-jpa-example-provider)( > type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))" > > [caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT: > > missing requirement
Re: java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator when running as Service on RedHat 7.5
Hi, first I've started Karaf with ./bin/karaf debug, and from Karaf Shell installed service with wrapper. Rebooted RHEL and logged into Karaf over ssh. It worked for me without any problem. Rgds, Miroslav V tor., 24. jul. 2018 20:58 je oseba Jean-Baptiste Onofré napisala: > Maybe it's related to: > > https://issues.apache.org/jira/browse/KARAF-5840 (I already have a fix > on a local branch) > > The problem only occurs when using the wrapper. > > @Oleg/Miroslav: do you use wrapper to start Karaf instead of bin/karaf ? > > Regards > JB > > On 24/07/2018 20:54, Francois Papon wrote: > > Hi, > > > > It's weird because I downloaded the binary and after extract it, I can > > see the org.apache.karaf.specs.locator-4.2.0.jar in the lib/endorsed > > directory. > > > > regards, > > > > François Papon > > fpa...@apache.org > > > > Le 24/07/2018 à 22:31, Oleg Cohen a écrit : > >> Hi Miroslav, > >> > >> I think I found the issue. You are right a JAR is missing. > >> > >> I built org.apache.karaf.specs.locator-4.2.0.jar and added it to the > >> boot/lib folder and the exception is now gone. > >> > >> Thank you! > >> Oleg > >> > >> > >>> On Jul 24, 2018, at 11:45 AM, Miroslav Beranič > >>> mailto:miroslav.bera...@mibesis.si>> > wrote: > >>> > >>> Hi Oleg, > >>> > >>> I've just downloaded package from: > >>> > >>> http://karaf.apache.org/download.html > >>> Binary Distribution : tar.gz [PGP] [SHA512] > >>> > >>> I've downloaded to /opt/ folder and unpacked the package. > >>> > >>> I am using RHEL 7.5, Oracle Java 8 ( 1.8.0.172 ) > >>> > >>> Next I've started Karf with: > >>> > >>> [root@framework apache-karaf-4.2.0]# ls -al > >>> total 424 > >>> drwxr-xr-x. 9 root root156 jul 24 17:35 . > >>> drwxr-xr-x. 4 root root110 jul 24 17:35 .. > >>> drwxr-xr-x. 3 root root282 apr 5 06:29 bin > >>> drwxr-xr-x. 3 root root 17 apr 5 06:29 data > >>> drwxr-xr-x. 9 root root123 apr 5 06:29 demos > >>> drwxr-xr-x. 2 root root 20 apr 5 06:29 deploy > >>> drwxr-xr-x. 3 root root 4096 apr 5 06:29 etc > >>> drwxr-xr-x. 5 root root 59 apr 5 06:29 lib > >>> -rw-r--r--. 1 root root 27754 apr 5 06:29 LICENSE > >>> -rw-r--r--. 1 root root 1829 apr 5 06:29 NOTICE > >>> -rw-r--r--. 1 root root 4025 apr 5 06:29 README > >>> -rw-r--r--. 1 root root 390829 apr 5 06:29 RELEASE-NOTES > >>> drwxr-xr-x. 3 root root 31 apr 5 06:29 system > >>> [root@framework apache-karaf-4.2.0]# JAVA_HOME=/opt/jdk ./bin/karaf > debug > >>> Listening for transport dt_socket at address: 5005 > >>> __ __ > >>>/ //_/ __ _/ __/ > >>> / ,< / __ `/ ___/ __ `/ /_ > >>> / /| |/ /_/ / / / /_/ / __/ > >>> /_/ |_|\__,_/_/ \__,_/_/ > >>> > >>> Apache Karaf (4.2.0) > >>> > >>> Hit '' for a list of available commands > >>> and '[cmd] --help' for help on a specific command. > >>> Hit '' or type 'system:shutdown' or 'logout' to shutdown Karaf. > >>> > >>> karaf@root()> feature:install > >>> > service-wrapper > >>> > >>> karaf@root()> wrapper:install > >>> Creating file: /opt/apache-karaf-4.2.0/bin/karaf-wrapper > >>> Creating file: /opt/apache-karaf-4.2.0/bin/karaf-service > >>> Creating file: /opt/apache-karaf-4.2.0/bin/karaf.service > >>> Creating file: /opt/apache-karaf-4.2.0/etc/karaf-wrapper.conf > >>> Creating missing directory: /opt/apache-karaf-4.2.0/lib/wrapper > >>> Creating file: /opt/apache-karaf-4.2.0/lib/wrapper/libwrapper.so > >>> Creating file: /opt/apache-karaf-4.2.0/lib/wrapper/karaf-wrapper.jar > >>> Creating file: > /opt/apache-karaf-4.2.0/lib/wrapper/karaf-wrapper-main.jar > >>> > >>> Setup complete. You may wish to tweak the JVM properties in the > >>> wrapper configuration file: > >>> /opt/apache-karaf-4.2.0/etc/karaf-wrapper.conf > >>> before installing and starting the service. > >>> > >>> > >>> RedHat/Fedora/CentOS Linux system detected (SystemV): > &g
Re: java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator when running as Service on RedHat 7.5
i Miroslav, > > Java is version 1.8 > > ava version "1.8.0_172" > Java(TM) SE Runtime Environment (build 1.8.0_172-b11) > Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode) > > Thank you! > Oleg > > > On Jul 24, 2018, at 11:30 AM, Miroslav Beranič < > miroslav.bera...@mibesis.si> wrote: > > Hi Oleg, > > one more question - what version of Java do you use? > > Kind Regards, > Miroslav > > > 2018-07-24 17:28 GMT+02:00 Miroslav Beranič : > >> Hi Oleg, >> >> well, I've never installed from here ( I did not even looked before). >> Will try it for my self also. In Git repository I used 4.1.x and 4.2.x. >> >> I guess 4.1.x is more "stable" for production. I've just started using >> 4.2. I was on 4.0.9 till previous week. I am doing upgrade across nodes. >> >> >> Kind Regards, >> Miroslav >> >> >> 2018-07-24 17:21 GMT+02:00 Oleg Cohen : >> >>> Hi Miroslav, >>> >>> I got apache-karaf-4.2.0.tar.gz binary distribution from here >>> http://karaf.apache.org/download.html >>> >>> I can definitely try building from Git. Let me try … >>> >>> Thank you! >>> Oleg >>> >>> On Jul 24, 2018, at 11:17 AM, Miroslav Beranič < >>> miroslav.bera...@mibesis.si> wrote: >>> >>> Hi Oleg, >>> >>> where from did you deployed Karaf? You build it from the source or some >>> pre-compiled package/distribution? >>> >>> In general this is saying you are missing JAR ( but I guess you know >>> already this ). >>> >>> ( I've deployed multiple times - in past week - Karaf on RHEL 7.5 and I >>> had no such problem - but I was building from the GitHub git repository ) >>> >>> Kind Regards, >>> Miroslav >>> >>> >>> 2018-07-24 17:11 GMT+02:00 Oleg Cohen : >>> >>>> Greetings, >>>> >>>> I have deployed Karaf v4.2.0 into a Linux RH 7.5 server. >>>> >>>> When I run Karaf as a service I get the following error in the log >>>> multiple times: >>>> >>>> >>>> 2018-07-24T11:07:12,176 | ERROR | features-3-thread-1 | Felix >>>> | - - | Bundle org.apache.felix.framework [0] >>>> EventDispatcher: Error during dispatch. (*java.lang.NoClassDefFoundError: >>>> org/apache/karaf/specs/locator/OsgiLocator*) >>>> java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator >>>> /OsgiLocator >>>> at org.apache.karaf.specs.activator.Activator.register(Activator.java:124) >>>> ~[?:?] >>>> at >>>> org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:96) >>>> ~[?:?] >>>> at org.apache.felix.framework.EventDispatcher.invokeBundleListe >>>> nerCallback(EventDispatcher.java:915) ~[?:?] >>>> at >>>> org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) >>>> ~[?:?] >>>> at >>>> org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) >>>> ~[?:?] >>>> at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) >>>> ~[?:?] >>>> at >>>> org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1289) >>>> ~[?:?] >>>> at >>>> org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:512) >>>> ~[?:?] >>>> at org.apache.felix.framework.Felix.resolveBundles(Felix.java:4108) >>>> ~[?:?] >>>> at org.apache.felix.framework.FrameworkWiringImpl.resolveBundle >>>> s(FrameworkWiringImpl.java:133) ~[?:?] >>>> at org.apache.karaf.features.internal.service.BundleInstallSupp >>>> ortImpl.resolveBundles(BundleInstallSupportImpl.java:240) ~[?:?] >>>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>>> pl.resolveBundles(FeaturesServiceImpl.java:1131) ~[?:?] >>>> at >>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:982) >>>> ~[?:?] >>>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>>> pl.doProvision(FeaturesServiceImpl.java:1025) ~[?:?] >>>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>>> pl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?] >>>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] >>>> at >>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >>>> [?:?] >>>> at >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >>>> [?:?] >>>> at java.lang.Thread.run(Thread.java:748) [?:?] >>>> >>>> I would appreciate help with fixing this problem of finding a >>>> workaround! >>>> >>>> Best, >>>> Oleg >>>> >>> >>> >>> >>> -- >>> Miroslav Beranič >>> MIBESIS >>> +386(0)40/814-843 >>> miroslav.bera...@mibesis.si >>> http://www.mibesis.si >>> >>> >>> >> >> >> -- >> Miroslav Beranič >> MIBESIS >> +386(0)40/814-843 >> miroslav.bera...@mibesis.si >> http://www.mibesis.si >> > > > > -- > Miroslav Beranič > MIBESIS > +386(0)40/814-843 > miroslav.bera...@mibesis.si > http://www.mibesis.si > > > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator when running as Service on RedHat 7.5
Hi Oleg, one more question - what version of Java do you use? Kind Regards, Miroslav 2018-07-24 17:28 GMT+02:00 Miroslav Beranič : > Hi Oleg, > > well, I've never installed from here ( I did not even looked before). > Will try it for my self also. In Git repository I used 4.1.x and 4.2.x. > > I guess 4.1.x is more "stable" for production. I've just started using > 4.2. I was on 4.0.9 till previous week. I am doing upgrade across nodes. > > > Kind Regards, > Miroslav > > > 2018-07-24 17:21 GMT+02:00 Oleg Cohen : > >> Hi Miroslav, >> >> I got apache-karaf-4.2.0.tar.gz binary distribution from here >> http://karaf.apache.org/download.html >> >> I can definitely try building from Git. Let me try … >> >> Thank you! >> Oleg >> >> On Jul 24, 2018, at 11:17 AM, Miroslav Beranič < >> miroslav.bera...@mibesis.si> wrote: >> >> Hi Oleg, >> >> where from did you deployed Karaf? You build it from the source or some >> pre-compiled package/distribution? >> >> In general this is saying you are missing JAR ( but I guess you know >> already this ). >> >> ( I've deployed multiple times - in past week - Karaf on RHEL 7.5 and I >> had no such problem - but I was building from the GitHub git repository ) >> >> Kind Regards, >> Miroslav >> >> >> 2018-07-24 17:11 GMT+02:00 Oleg Cohen : >> >>> Greetings, >>> >>> I have deployed Karaf v4.2.0 into a Linux RH 7.5 server. >>> >>> When I run Karaf as a service I get the following error in the log >>> multiple times: >>> >>> >>> 2018-07-24T11:07:12,176 | ERROR | features-3-thread-1 | Felix >>> | - - | Bundle org.apache.felix.framework [0] >>> EventDispatcher: Error during dispatch. (*java.lang.NoClassDefFoundError: >>> org/apache/karaf/specs/locator/OsgiLocator*) >>> java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator >>> /OsgiLocator >>> at org.apache.karaf.specs.activator.Activator.register(Activator.java:124) >>> ~[?:?] >>> at >>> org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:96) >>> ~[?:?] >>> at org.apache.felix.framework.EventDispatcher.invokeBundleListe >>> nerCallback(EventDispatcher.java:915) ~[?:?] >>> at >>> org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) >>> ~[?:?] >>> at >>> org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) >>> ~[?:?] >>> at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) >>> ~[?:?] >>> at >>> org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1289) >>> ~[?:?] >>> at >>> org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:512) >>> ~[?:?] >>> at org.apache.felix.framework.Felix.resolveBundles(Felix.java:4108) >>> ~[?:?] >>> at org.apache.felix.framework.FrameworkWiringImpl.resolveBundle >>> s(FrameworkWiringImpl.java:133) ~[?:?] >>> at org.apache.karaf.features.internal.service.BundleInstallSupp >>> ortImpl.resolveBundles(BundleInstallSupportImpl.java:240) ~[?:?] >>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>> pl.resolveBundles(FeaturesServiceImpl.java:1131) ~[?:?] >>> at >>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:982) >>> ~[?:?] >>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>> pl.doProvision(FeaturesServiceImpl.java:1025) ~[?:?] >>> at org.apache.karaf.features.internal.service.FeaturesServiceIm >>> pl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?] >>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >>> [?:?] >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >>> [?:?] >>> at java.lang.Thread.run(Thread.java:748) [?:?] >>> >>> I would appreciate help with fixing this problem of finding a workaround! >>> >>> Best, >>> Oleg >>> >> >> >> >> -- >> Miroslav Beranič >> MIBESIS >> +386(0)40/814-843 >> miroslav.bera...@mibesis.si >> http://www.mibesis.si >> >> >> > > > -- > Miroslav Beranič > MIBESIS > +386(0)40/814-843 > miroslav.bera...@mibesis.si > http://www.mibesis.si > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator when running as Service on RedHat 7.5
Hi Oleg, well, I've never installed from here ( I did not even looked before). Will try it for my self also. In Git repository I used 4.1.x and 4.2.x. I guess 4.1.x is more "stable" for production. I've just started using 4.2. I was on 4.0.9 till previous week. I am doing upgrade across nodes. Kind Regards, Miroslav 2018-07-24 17:21 GMT+02:00 Oleg Cohen : > Hi Miroslav, > > I got apache-karaf-4.2.0.tar.gz binary distribution from here > http://karaf.apache.org/download.html > > I can definitely try building from Git. Let me try … > > Thank you! > Oleg > > On Jul 24, 2018, at 11:17 AM, Miroslav Beranič < > miroslav.bera...@mibesis.si> wrote: > > Hi Oleg, > > where from did you deployed Karaf? You build it from the source or some > pre-compiled package/distribution? > > In general this is saying you are missing JAR ( but I guess you know > already this ). > > ( I've deployed multiple times - in past week - Karaf on RHEL 7.5 and I > had no such problem - but I was building from the GitHub git repository ) > > Kind Regards, > Miroslav > > > 2018-07-24 17:11 GMT+02:00 Oleg Cohen : > >> Greetings, >> >> I have deployed Karaf v4.2.0 into a Linux RH 7.5 server. >> >> When I run Karaf as a service I get the following error in the log >> multiple times: >> >> >> 2018-07-24T11:07:12,176 | ERROR | features-3-thread-1 | Felix >>| - - | Bundle org.apache.felix.framework [0] >> EventDispatcher: Error during dispatch. (*java.lang.NoClassDefFoundError: >> org/apache/karaf/specs/locator/OsgiLocator*) >> java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator >> /OsgiLocator >> at org.apache.karaf.specs.activator.Activator.register(Activator.java:124) >> ~[?:?] >> at >> org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:96) >> ~[?:?] >> at org.apache.felix.framework.EventDispatcher.invokeBundleListe >> nerCallback(EventDispatcher.java:915) ~[?:?] >> at >> org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) >> ~[?:?] >> at >> org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) >> ~[?:?] >> at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) >> ~[?:?] >> at >> org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1289) >> ~[?:?] >> at >> org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:512) >> ~[?:?] >> at org.apache.felix.framework.Felix.resolveBundles(Felix.java:4108) >> ~[?:?] >> at org.apache.felix.framework.FrameworkWiringImpl.resolveBundle >> s(FrameworkWiringImpl.java:133) ~[?:?] >> at org.apache.karaf.features.internal.service.BundleInstallSupp >> ortImpl.resolveBundles(BundleInstallSupportImpl.java:240) ~[?:?] >> at org.apache.karaf.features.internal.service.FeaturesServiceIm >> pl.resolveBundles(FeaturesServiceImpl.java:1131) ~[?:?] >> at >> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:982) >> ~[?:?] >> at org.apache.karaf.features.internal.service.FeaturesServiceIm >> pl.doProvision(FeaturesServiceImpl.java:1025) ~[?:?] >> at org.apache.karaf.features.internal.service.FeaturesServiceIm >> pl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?] >> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] >> at >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >> [?:?] >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >> [?:?] >> at java.lang.Thread.run(Thread.java:748) [?:?] >> >> I would appreciate help with fixing this problem of finding a workaround! >> >> Best, >> Oleg >> > > > > -- > Miroslav Beranič > MIBESIS > +386(0)40/814-843 > miroslav.bera...@mibesis.si > http://www.mibesis.si > > > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator when running as Service on RedHat 7.5
Hi Oleg, where from did you deployed Karaf? You build it from the source or some pre-compiled package/distribution? In general this is saying you are missing JAR ( but I guess you know already this ). ( I've deployed multiple times - in past week - Karaf on RHEL 7.5 and I had no such problem - but I was building from the GitHub git repository ) Kind Regards, Miroslav 2018-07-24 17:11 GMT+02:00 Oleg Cohen : > Greetings, > > I have deployed Karaf v4.2.0 into a Linux RH 7.5 server. > > When I run Karaf as a service I get the following error in the log > multiple times: > > > 2018-07-24T11:07:12,176 | ERROR | features-3-thread-1 | Felix >| - - | Bundle org.apache.felix.framework [0] > EventDispatcher: Error during dispatch. (*java.lang.NoClassDefFoundError: > org/apache/karaf/specs/locator/OsgiLocator*) > java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator > at org.apache.karaf.specs.activator.Activator.register(Activator.java:124) > ~[?:?] > at org.apache.karaf.specs.activator.Activator. > bundleChanged(Activator.java:96) ~[?:?] > at org.apache.felix.framework.EventDispatcher. > invokeBundleListenerCallback(EventDispatcher.java:915) ~[?:?] > at > org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:834) > ~[?:?] > at > org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:516) > ~[?:?] > at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) > ~[?:?] > at > org.apache.felix.framework.StatefulResolver.fireResolvedEvents(StatefulResolver.java:1289) > ~[?:?] > at > org.apache.felix.framework.StatefulResolver.resolve(StatefulResolver.java:512) > ~[?:?] > at org.apache.felix.framework.Felix.resolveBundles(Felix.java:4108) ~[?:?] > at > org.apache.felix.framework.FrameworkWiringImpl.resolveBundles(FrameworkWiringImpl.java:133) > ~[?:?] > at org.apache.karaf.features.internal.service.BundleInstallSupportImpl. > resolveBundles(BundleInstallSupportImpl.java:240) ~[?:?] > at org.apache.karaf.features.internal.service.FeaturesServiceImpl. > resolveBundles(FeaturesServiceImpl.java:1131) ~[?:?] > at > org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:982) > ~[?:?] > at org.apache.karaf.features.internal.service.FeaturesServiceImpl. > doProvision(FeaturesServiceImpl.java:1025) ~[?:?] > at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$ > doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?] > at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > [?:?] > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > [?:?] > at java.lang.Thread.run(Thread.java:748) [?:?] > > I would appreciate help with fixing this problem of finding a workaround! > > Best, > Oleg > -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si
Re: Apache Karaf 4.x JPA - Working example
ovider/4.2.1.SNAPSHOT: missing requirement [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider; effective:=active]] at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?] at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392) ~[?:?] at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378) ~[?:?] at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332) ~[?:?] at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257) ~[?:?] at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388) ~[?:?] at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025) ~[?:?] at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:?] at java.lang.Thread.run(Thread.java:748) [?:?] Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.identity; osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider; type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider; effective:=active] at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?] ... 12 more Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider; effective:=active at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?] at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343) ~[?:?] ... 12 more And now -- I do not know what is wrong and do not know what is wrong. Kind Regards, Miroslav 2018-07-24 9:44 GMT+02:00 Jean-Baptiste Onofré : > Thanks for the report. > > Let me double check. > > Regards > JB > Le 24 juil. 2018, à 09:42, "Miroslav Beranič" > a écrit: > >> Hi, >> >> dear Jean-Baptiste Onofré. I am talking about this repository. It does >> not work. >> >> I've checked out https://github.com/jbonofre/karaf/tree/DEV_GUIDE >> >> $ git clone -b DEV_GUIDE https://github.com/jbonofre/karaf/tree/DEV_GUIDE >> karaf_dev_guide >> >> Build it with maven: >> >> $ mvn -DskipTests -Pfastinstall clean install >> >> Went to the distribution/assembly: >> >> $ cd assemblies/apache-karaf/target/assembly/ >> >> and started Karaf from here: >> >> $ JAVA_HOME=/opt/jdk ./bin/karaf debug >> Listening for transport dt_socket at address: 5005 >> __ __ >>/ //_/ __ _/ __/ >> / ,< / __ `/ ___/ __ `/ /_ >> / /| |/ /_/ / / / /_/ / __/ >> /_/ |_|\__,_/_/ \__,_/_/ >> >> Apache Karaf (4.2.1-SNAPSHOT) >> >> From here, first and only thing I do is: >> >> karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/ >> karaf-jpa-example-features/4.2.1-SNAPSHOT/xml >> karaf@root()> feature:install karaf-jpa-example-datasource >> >> >> >> karaf@root()> feature:install karaf-jpa-example-provider >> org.apache.felix.resolver.reason.ReasonException: Unable to resolve >> root: missing requirement [root] osgi.identity; >> osgi.identity=karaf-jpa-example-provider; >> type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; >> filter:="(&(osgi.identity=karaf-jpa-example-provider)( >> type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))" >> [caused by: Unable to
Re: Apache Karaf 4.x JPA - Working example
.karaf-jpa-example-provider; type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider; effective:=active]] This are all the steps described on: https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/karaf-jpa-example So my question is only: what is not this working? What am I doing wrong - are there any pre-requirements ? Kind Regards, Miroslav 2018-07-20 18:08 GMT+02:00 Jean-Baptiste Onofré : > Hi, > > the examples are for 4.2.x only not 4.1.x. > > All versions are contained in the JPA example itself, using hibernate > provided by Karaf 4.2.1. > > Regards > JB > > On 20/07/2018 16:17, Miroslav Beranič wrote: > > Hi, > > > > I've upgraded my environment from ServiceMix 7.1.0-SNAPSHOT ( running > > Karaf 4.0.9 ) to Karaf 4.1.x ( GitHub ) branch and later on I've > > experimented with version 4.2.x. > > I was using linked linkes from Karaf home page ( > > https://karaf.apache.org/documentation.html ) to GitHub Examples - for > JPA. > > > > My main task is to get JPA 2 up and running, but I fail to do so. > > > > So on provided examples Github repository: > > https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/ > karaf-jpa-example > > > > I've tested with Karaf 4.1.x and 4.2.x and in both version, Examples for > > JPA do now work - for me. > > > > For Karaf 4.2.x I've created PasteBin outputs ( please see ): > > 1.) https://pastebin.com/eJybVNhn > > 2.) https://pastebin.com/W2UhihdR > > > > In examples, I've noted that there is a reference to Hibernate > > 6.0.10.Final - this version is not released yet ( hibernate.org > > <http://hibernate.org> ), so I guess this is a wrong version, or ? as I > > see Karaf has build-in support for Hibernate 5.2.9.Final. > > > > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/ > karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml > > > > For Hibernate version I am looking at: > > https://github.com/apache/karaf/blob/master/pom.xml > > 5.2.9.Final > > > > So what I did was: > > > > 1.) checked out Karaf 4.1.x from Github > > 2.) checked out Karaf Examples ( DEV_GUIDE branch from Github ) > > > > 3.) Build Karaf with Maven: mvn -Pfastinstall and started Karaf with > > ./bin/karaf debug > > 4.) Build Karaf Examples ( changed version of Hibernate from > > 6.0.10.Final to 5.2.9.Final ) > > > > Read instruction from: > > https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/ > karaf-jpa-example/README.md > > > > 5.) feature:repo-add > > mvn:org.apache.karaf.examples/karaf-jpa-example-features/4. > 2.1-SNAPSHOT/xml > > 6.) feature:install karaf-jpa-example-datasource > > 7.) feature:install karaf-jpa-example-provider > > > > Fail: > > > > Error executing command: Unable to resolve root: missing requirement > > [root] osgi.identity; osgi.identity=karaf-jpa-example-provider; > > type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; > > filter:="(&(osgi.identity=karaf-jpa-example-provider)( > type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))" > > [caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT: > > missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT] > > osgi.identity; > > osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider; > > type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; > > resolution:=mandatory [caused by: Unable to resolve > > org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT: > > missing requirement > > [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] > > osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; > > javax.persistence.provider=org.hibernate.jpa. > HibernatePersistenceProvider; > > effective:=active]] > > > > I am using Linux x64, Oracle Java 8 172 x64. > > > > What I am doing wrong. I've mixed different version of Hibernate, Karaf, > > ... and noting. Always some more or less strange error. > > > > Plus there is an issue: what version of maven-bundle-plugin should/must > > be used? I've tried 3.01 and 3.2.0. When I use 3.0.1 I have to up
Apache Karaf 4.x JPA - Working example
Hi, I've upgraded my environment from ServiceMix 7.1.0-SNAPSHOT ( running Karaf 4.0.9 ) to Karaf 4.1.x ( GitHub ) branch and later on I've experimented with version 4.2.x. I was using linked linkes from Karaf home page ( https://karaf.apache.org/documentation.html ) to GitHub Examples - for JPA. My main task is to get JPA 2 up and running, but I fail to do so. So on provided examples Github repository: https://github.com/jbonofre/karaf/tree/DEV_GUIDE/examples/karaf-jpa-example I've tested with Karaf 4.1.x and 4.2.x and in both version, Examples for JPA do now work - for me. For Karaf 4.2.x I've created PasteBin outputs ( please see ): 1.) https://pastebin.com/eJybVNhn 2.) https://pastebin.com/W2UhihdR In examples, I've noted that there is a reference to Hibernate 6.0.10.Final - this version is not released yet ( hibernate.org ), so I guess this is a wrong version, or ? as I see Karaf has build-in support for Hibernate 5.2.9.Final. https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/karaf-jpa-example/karaf-jpa-example-features/src/main/feature/feature.xml For Hibernate version I am looking at: https://github.com/apache/karaf/blob/master/pom.xml 5.2.9.Final So what I did was: 1.) checked out Karaf 4.1.x from Github 2.) checked out Karaf Examples ( DEV_GUIDE branch from Github ) 3.) Build Karaf with Maven: mvn -Pfastinstall and started Karaf with ./bin/karaf debug 4.) Build Karaf Examples ( changed version of Hibernate from 6.0.10.Final to 5.2.9.Final ) Read instruction from: https://github.com/jbonofre/karaf/blob/DEV_GUIDE/examples/karaf-jpa-example/README.md 5.) feature:repo-add mvn:org.apache.karaf.examples/karaf-jpa-example-features/4.2.1-SNAPSHOT/xml 6.) feature:install karaf-jpa-example-datasource 7.) feature:install karaf-jpa-example-provider Fail: Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=karaf-jpa-example-provider; type=karaf.feature; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; filter:="(&(osgi.identity=karaf-jpa-example-provider)(type=karaf.feature)(version>=4.2.1.SNAPSHOT)(version<=4.2.1.SNAPSHOT))" [caused by: Unable to resolve karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.identity; osgi.identity=org.apache.karaf.examples.karaf-jpa-example-provider; type=osgi.bundle; version="[4.2.1.SNAPSHOT,4.2.1.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT: missing requirement [org.apache.karaf.examples.karaf-jpa-example-provider/4.2.1.SNAPSHOT] osgi.service; objectClass=javax.persistence.spi.PersistenceProvider; javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider; effective:=active]] I am using Linux x64, Oracle Java 8 172 x64. What I am doing wrong. I've mixed different version of Hibernate, Karaf, ... and noting. Always some more or less strange error. Plus there is an issue: what version of maven-bundle-plugin should/must be used? I've tried 3.01 and 3.2.0. When I use 3.0.1 I have to update if I use 3.2.0 I get error that javassist is not resolved: Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=. ... osgi.wiring.package; filter:="(&(osgi.wiring.package=javassist.util.proxy)(version>=3.22.0)(!(version>=4.0.0)))"]]] So all in all I can not and did not find and singe point of truth what is valid example or way of doing JPA 2 with Hibernate. I guess I am doing something wrong as all examples make it so simple but ... no luck. All I did is clean ( new computer - virtual ) checkout from git, build and deploy - and fail. I would like to migrate existing code using JPA 1 to JPA 2 ( 2.2 ? ) but ... this is difficult task to complete ( this is after one week of pain and frustration ). I've done examples from https://github.com/cschneider/Karaf-Tutorial also, but no luck. More-or-less same problems. 1.) What versions of Maven plugins should I use? 2.) What versions of JPA? 3.) What versions of Hibernate? 4.) What example should I follow ( URL / Git and branch ) ? This are my top questions. Kind Regards, Miroslav -- Miroslav Beranič MIBESIS +386(0)40/814-843 miroslav.bera...@mibesis.si http://www.mibesis.si