Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
Thank you for advice jbonofre. I tried but the datasource is on the cluster. I've checked with command cluster:config-list. I also did the tests on cross and star topology. Sync and manually adding config to cluster configs will not solve the problem. I don't have any idea what else could be

Logging color is always white when using Log4j 1 with Karaf 4.1.2

2017-12-07 Thread roelens8
I am having an issue when using Log4j 1 (via pax-logging-service, version 1.10.1) with Karaf 4.1.2, where the logging color in the Karaf console (when tailing the logs) is always white instead of the usual default colors of purple for warn, red for error and blue for trace and info, etc. I have

Re: How's config connected to a bundle

2017-12-07 Thread Steinar Bang
> Timothy Ward : > That does look like it should be working - what do the scr commands > display when you look at your component? I've got it working now: the trick was to use the fully qualified class name as the PID. But thanks for the heads up on the "scr:*"

Re: How's config connected to a bundle

2017-12-07 Thread Steinar Bang
> David Jencks : > I’d expect your component with a specified PID to work, are you sure > it didn’t? It turns out that DS cannot reliably set the bundle > location; when it tried to it turns out there is an unavoidable race > condition. Therefore DS does not try to

Re: Two Karaf instances using one database

2017-12-07 Thread Jean-Baptiste Onofré
I'm pretty sure the cfg is not on the second instance (you can check with config:list). That's why the data source is not there. As I said to sync the cfg you have to use cluster:config* commands or you have to enable config.listener=true in etc/org.apache.karaf.cellar.node.cfg file BEFORE

Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
I've checked the features on both Karaf instances and all is the same. About creating cfg, I tried to sync cfg file as you say JBonofre but still nothing. I assume that after sync the cfg file should appear on second Karaf but nothing happens. Still I don't have nothing in 'ds-name' and jndi:names

Re: Two Karaf instances using one database

2017-12-07 Thread Jean-Baptiste Onofré
I guess you deploy the cfg file by hand (creating the cfg by hand). In that case, to sync the cfg file on the second instance, you have to enable the local config listener in the cellar node cfg file (it's disable by default). Regards JB On Dec 7, 2017, 19:44, at 19:44, Dominik Marciniszyn

Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
Yes I have on one machine both instances. I think I have got the same required features, I will check once again. The jdbc oracle drivers for sure are the same. -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Two Karaf instances using one database

2017-12-07 Thread Francois Papon
Your instance are deployed on the same machine (just to confirm because your database url is localhost) ? Do you have the same feature installed and started, same jdbc oracle drivers ? It seems like bundle or feature are missing in your second instance. Le 07/12/2017 à 15:44, Dominik

Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
Only on first Karaf instance everything works well. On the second I see nothing. I was trying to declare other datasource but it won't help. I mean other datasource name. My config for ds looks: osgi.jdbc.driver.name=oracle-pool-xa url=jdbc:oracle:thin:@localhost:1521:XE user=user

Re: Two Karaf instances using one database

2017-12-07 Thread Francois Papon
How do you declare the datasource ? (config properties file) Do you see the datasource list with karaf commands ? karaf@root()> jdbc:ds-list Name  │ Product │ Version │ URL │ Status Le 07/12/2017 à 15:30, Dominik Marciniszyn a écrit : > In persistence.xml I have got: > >

Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
In persistence.xml I have got: org.hibernate.jpa.HibernatePersistenceProvider osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=my_persistence_unit) META-INF/orm.xml ...

Re: Two Karaf instances using one database

2017-12-07 Thread Francois Papon
Hi, What datasource is declared in the *persistence.xml* of your bundle who use JPA ? Have you deployed your bundle manually on each instance or using Cellar ? Le 07/12/2017 à 14:25, Dominik Marciniszyn a écrit : > The error from logs from second instance: > > 11:18:36,520 | ERROR |

Re: Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
The error from logs from second instance: 11:18:36,520 | ERROR | FelixStartLevel | Felix | Bundle org.apache.aries.jpa.container [88] EventDispatcher: Error during dispatch. (java.lang.IllegalArgumentException: No DataSource supplied in persistence.xml) java.lang.IllegalArgumentException: No

Re: Two Karaf instances using one database

2017-12-07 Thread Jean-Baptiste Onofré
Hi Can I get the log of the second instance please ? Thanks Regards JB On Dec 7, 2017, 17:56, at 17:56, Dominik Marciniszyn wrote: >Hi, > >I have got two karaf instances with my programs. Both of them uses the >same >database. I run them in DOSGI with

Two Karaf instances using one database

2017-12-07 Thread Dominik Marciniszyn
Hi, I have got two karaf instances with my programs. Both of them uses the same database. I run them in DOSGI with Karaf-Cellar-DOSGI. First instance runs well, but second has got problem with jndi. The first instance see my DB, but second don't. I was trying to configure HA/Lock configuration

Re: How's config connected to a bundle

2017-12-07 Thread Timothy Ward
Hi Steinar, That does look like it should be working - what do the scr commands display when you look at your component? Note that your component will be activated without any configuration (for example if your configuration doesn’t exist when the component’s bundle is started) because it is