You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by cooshal <ku...@gmail.com> on 2019/05/08 12:50:12 UTC
Re: Features Core bundle stuck in "Resolved" state
Hi:
although this post is quite old, was there a definite solution to this
problem?
My problem is similar, such that my bundle requires the osgi service (I got
this while trying to do feature:install ... )
osgi.service; effective:=active;
filter:="(&(objectClass=javax.jms.ConnectionFactory)(osgi.jndi.service.name=jms/msg.consumer))"]]
The "jms/msg.consumer" is already available in the service registry, and
these bundles work properly when I deploy them by dropping in the deploy
folder or install them via bundle:install.
Additionally, I can see this jms/msg.consumer in the service:list
javax.jms.ConnectionFactory as well. To check, if it is functional, I tried
jms:browse to browse one of the queues. It works fine enough.
But, I am trying to install this bundle as part of a feature as (provided
that the broker and db services are pre-installed in this custom karaf
distribution):
<feature name="custom-stats" description="Stats Bundle" version="1.1.1">
<bundle>file:D:/temp/stats-bundle.jar</bundle>
</feature>
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
See my answer to the other thread ;)
Regards
JB
On 24/05/2019 16:52, cooshal wrote:
> Hi:
>
> with availability="optional", I am able to install these bundles with
> "feature:install", but I wanted to add one particular bundle (that uses both
> jdbc and jms as well) as a bootFeature, and again it fails to resolve the
> jms services. Could be because the JMS service has not yet been
> instantiated. But shouldn't the bundle wait for the dependency?
>
> I tried removing Import-Service using
> "<_removeheaders>Import-Service</_removeheaders>". But, this had no effect.
>
> How can I provide a capability to a feature? Should I do it in the feature
> file or the maven bundle plugin?
>
> Regards,
> Cooshal.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Features Core bundle stuck in "Resolved" state
Posted by cooshal <ku...@gmail.com>.
Hi:
with availability="optional", I am able to install these bundles with
"feature:install", but I wanted to add one particular bundle (that uses both
jdbc and jms as well) as a bootFeature, and again it fails to resolve the
jms services. Could be because the JMS service has not yet been
instantiated. But shouldn't the bundle wait for the dependency?
I tried removing Import-Service using
"<_removeheaders>Import-Service</_removeheaders>". But, this had no effect.
How can I provide a capability to a feature? Should I do it in the feature
file or the maven bundle plugin?
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by cooshal <ku...@gmail.com>.
Hi:
that's what I think as well. If these bundles work when deployed manually
and fail to install while provisioning through features, then I suspect that
something specific has to be configured in the features file.
My feature is plain and simple as:
<feature name="stats-mbean" description="Stats MBEAN" version="1.0.0">
<bundle>file:D:/temp/stats-mbean-1.0.0.jar</bundle>
</feature>
The db and broker services are already running and are available in the
service registry. I am not able to provision this just via features. Totally
strange. I have tried this on numerous fresh karaf instances.
I will check if I have messed up something else (so far I do not see
anything but normal config stuffs).
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
if the services are there, and the property match, it works for sure ;)
Regards
JB
On 08/05/2019 16:23, cooshal wrote:
> I have two Datasources here. That's why I needed to use the filter. I am
> creating the datasources from "etc/org.ops4j.datasource-*.cfg" config files.
> And it works completely fine this way (if I do it manually). I just wanted
> to provision it through feature files in one-go. So, in the current
> environment, I have two DataSources running, and they are selectively
> consumed by the jndi service names.
>
> I checked service:list javax.sql.DataSource, and it lists two different data
> sources, as I had expected.
>
> Thanks !
>
> Regards,
> Cooshal.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Features Core bundle stuck in "Resolved" state
Posted by cooshal <ku...@gmail.com>.
I have two Datasources here. That's why I needed to use the filter. I am
creating the datasources from "etc/org.ops4j.datasource-*.cfg" config files.
And it works completely fine this way (if I do it manually). I just wanted
to provision it through feature files in one-go. So, in the current
environment, I have two DataSources running, and they are selectively
consumed by the jndi service names.
I checked service:list javax.sql.DataSource, and it lists two different data
sources, as I had expected.
Thanks !
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
If you created the datasource with jdbc:ds-create, by default the name
is jdbc/dw-datasource that's why I asked about the name.
You can remove the filter to see if the DataSource is found. If not, I
would recommend to check if you don't other bundles than system that
provide package javax.sql.
Regards
JB
On 08/05/2019 16:09, cooshal wrote:
> yes. I have checked the JNDI names. They are listed there with the ClassName
> "com.zaxxer.hikari.HikariDataSource".
>
> To check if I have a valid connection, I tried out "jdbc:tables
> dw-datasource". This works fine enough.
>
> Some information:
> I am using pax-jdbc here. The service reference is used in the blueprint.
>
> <reference id="dw" interface="javax.sql.DataSource"
> filter="(osgi.jndi.service.name=dw-datasource)" />
>
> If I install this bundle manually (by copying into the deploy folder or via
> bundle:install <path>), it works perfectly fine.
>
> Do I need to treat pax-jdbc connections specially?
>
> Regards,
> Cooshal.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Features Core bundle stuck in "Resolved" state
Posted by cooshal <ku...@gmail.com>.
yes. I have checked the JNDI names. They are listed there with the ClassName
"com.zaxxer.hikari.HikariDataSource".
To check if I have a valid connection, I tried out "jdbc:tables
dw-datasource". This works fine enough.
Some information:
I am using pax-jdbc here. The service reference is used in the blueprint.
<reference id="dw" interface="javax.sql.DataSource"
filter="(osgi.jndi.service.name=dw-datasource)" />
If I install this bundle manually (by copying into the deploy folder or via
bundle:install <path>), it works perfectly fine.
Do I need to treat pax-jdbc connections specially?
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, the JMS issue looks good.
For the datasource, are you sure about the JNDI name ?
Did you check the actual name with jdbc:ds-list command ?
Regards
JB
On 08/05/2019 15:45, cooshal wrote:
> Hi JB:
>
> thank you for the tip. My bundle requires both jms and jdbc services. I
> guess the jms issue is resolved (I borrowed the jms version appender from
> your commit in Decanter ;) ).
>
> I simply added the following line, and the jms issue is not showing up,
> which could mean that it is resolved:
>
> <Import-Package>
> javax.jms;version="[1,3)", *
> </Import-Package>
>
> Interesting thing is, I have another bundle that depends only on jdbc
> service, and that bundle gets started successfully. While, for this bundle,
> I am getting the error below:
>
> missing requirement for .... osgi.service; effective:=active;
> filter:="(&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name=dw-datasource))"]]
>
> Regards,
> Cooshal.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Features Core bundle stuck in "Resolved" state
Posted by cooshal <ku...@gmail.com>.
Hi JB:
thank you for the tip. My bundle requires both jms and jdbc services. I
guess the jms issue is resolved (I borrowed the jms version appender from
your commit in Decanter ;) ).
I simply added the following line, and the jms issue is not showing up,
which could mean that it is resolved:
<Import-Package>
javax.jms;version="[1,3)", *
</Import-Package>
Interesting thing is, I have another bundle that depends only on jdbc
service, and that bundle gets started successfully. While, for this bundle,
I am getting the error below:
missing requirement for .... osgi.service; effective:=active;
filter:="(&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name=dw-datasource))"]]
Regards,
Cooshal.
--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Re: Features Core bundle stuck in "Resolved" state
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
I would recommend to check the javax.jms import package ;)
Pax JMS uses JMS 2.0 package. If your bundle uses JMS 1.1, even if the
ConnectionFactory service is available, as they are not from the same
package, it won't work.
I fixed similar issue in Decanter JMS last week.
Regards
JB
On 08/05/2019 14:50, cooshal wrote:
> Hi:
>
> although this post is quite old, was there a definite solution to this
> problem?
>
> My problem is similar, such that my bundle requires the osgi service (I got
> this while trying to do feature:install ... )
>
> osgi.service; effective:=active;
> filter:="(&(objectClass=javax.jms.ConnectionFactory)(osgi.jndi.service.name=jms/msg.consumer))"]]
>
> The "jms/msg.consumer" is already available in the service registry, and
> these bundles work properly when I deploy them by dropping in the deploy
> folder or install them via bundle:install.
>
> Additionally, I can see this jms/msg.consumer in the service:list
> javax.jms.ConnectionFactory as well. To check, if it is functional, I tried
> jms:browse to browse one of the queues. It works fine enough.
>
> But, I am trying to install this bundle as part of a feature as (provided
> that the broker and db services are pre-installed in this custom karaf
> distribution):
>
> <feature name="custom-stats" description="Stats Bundle" version="1.1.1">
> <bundle>file:D:/temp/stats-bundle.jar</bundle>
> </feature>
>
> Regards,
> Cooshal.
>
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com