You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by PJR69 <pe...@insta.fi> on 2012/12/19 11:05:53 UTC

Difference in KAR-deployment between Windows and Linux

I'm developing an application that uses Camel + CXF + ActiveMQ that I want to
ultimately run on Linux. I'm doing the developing on Windows 7, so I need
both Karaf win and Karaf linux instances.

For the development I've created a Karaf-setup on Windows that has the
CFX/Camel/ActiveMQ-features installed. I'm using the generate-features-xml
and create-kar plugins to generate the features.xml as well as the KAR. This
works fine on Windows, i.e. when I drop the KAR-file into the deploy-folder,
my single feature gets installed (features:list shows it being "installed")
and started and the configuration file inside the KAR gets unpacked to the
etc-folder. Everything runs very nice and smooth.

For the production I've created a Karaf-setup from the
karaf-2.3.0.tar.gz-package. Installed it into Linux-virtual machine connecte
to internet and then installed the same CFX/Camel/ActiveMQ-features as I did
on the windows-setup. Then I've targzipped the stuff, and created a
RPM-distro from it and installed it on my Linux-server. Karaf starts ok and
runs ok.

However, there are couple of differences when I drop the exact same KAR-file
into the deploy-folder on the Linux-setup:
1) The feature won't start automatically, i.e. it is left on
"uninstalled"-state.
2) When I install the feature, the mvn:resolver complaints that it can't
find my configuration (from the configfile-element in features.xml) file.
The configuration file is properly in the KAR inside local repo, it has been
installed there from my local repo (on my dev comp) with type "cfg" and
classifier "config" and it definitely is found and works ok on the
Windows-setup.

Not sure if issue 2) causes issue 1), possibly. What could be the reason why
the resolver can't find the config-file on Linux but can on Windows? As far
as I can tell, my Karaf-setups on Linux and Windows are petty darn close to
each other; I might have missed to install some feature on Linux that I did
on windows but can't really think of any relevant ones.

My main application is inside one of the dependent bundles of the feature
and starts running from the Activator.start. It always starts automatically
ok on the Windows-setup when dropping the KAR into deploy-folder but
obviously not on the Linux-setup as feature doesn't get installed.

Any ideas why this difference in behavior?



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093.html
Sent from the Karaf - User mailing list archive at Nabble.com.

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Ok, I found out the problem by looking at debug-level logging on Karaf when
trying to install the feature.

Karaf seems to be trying to fetch the dependencies from /home/.m2/...
folder. So NOT from inside the KAR-file where the jars are stored. I was
under the impression that the whole point of the KAR-file was to be able to
deploy a group of dependencies that would be resolved FROM the KAR itself.
Or from the repository-folder inside the KAR.

However, on my windows-environment the deployment worked because the
windows-computer had access to the maven repository that I use, or rather,
the .m2 folder inside my dev computer. The linux-computer had no access to
external maven repository nor did it have the .m2-folder.

So what's the deal here, should the dependencies inside the KAR-file be used
or not?

For example, inside the KAR-file there is:
/repository/joda-time/joda-time/2.0/joda-time-2.0.jar 

And in the features.xml I have
<feature...>
<bundle start="auto">mvn:joda-time/joda-time/2.0</bundle>
</feature>

So I'd expect the bundle inside the KAR to be used. But now, according to
the debug loggin it tries to find the joda-time-2.0.jar first from my
home/.m2, then it tries to access several other maven repos from the
internet which aren't visible to the linux computer where I run Karaf.

So what's up here?



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027111.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks Petri for the update.

Definitely something that we have to include/fix.

I will create the Jira and fix that for the next release.

Regards
JB

On 01/08/2013 08:50 AM, PJR69 wrote:
> Ok, finally I manage to resolve this!!!
>
> The issue lies with using a child-instance and incomplete configuration for pax mvn url resolver.
>
> Specifically, this property:
> org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
>      file:${karaf.home}/local-repo@snapshots
>
> in the org.ops4j.pax.url.mvn.cfg-file inside the child-instance etc-folder.
>
> I fixed this by modifying the above line to read:
> org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
>      file:${karaf.home}/local-repo@snapshots, file:${karaf.base}/${karaf.default.repository}@snapshots
>
> So, it seems that the KAR-deployer does unpack the files into the system-folder of the child-instance, BUT the mvn-url resolve doesn’t see that system-folder! It only sees the system-folder of the root instance!
>
> Once I modified the line as shown above and restart the child instance, my KAR-deployment started working just fine!!!
>
> Furthermore: This fix:
> #
> # Settings for the OSGi 4.3 Weaving
> # By default, we will not weave any classes. Change this setting to include classes
> # that you application needs to have woven.
> #
> org.apache.aries.proxy.weaving.enabled=none
> # Classes not to weave - Aries default + Xerces which is known to have issues.
> org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*
>
> appears only at the root-instance system.properties. If I create a child-instance, the system.properties-file generated there doesn’t include the above lines.
>
> So maybe fix these on the next release?
>
>
> -          Petri
>
>
> From: jbonofre [via Karaf] [mailto:ml-node+s922171n4027162h60@n3.nabble.com]
> Sent: 30. joulukuuta 2012 12:56
> To: Riipinen Petri
> Subject: Re: Difference in KAR-deployment between Windows and Linux
>
> Thanks for the details. I gonna test it.
>
> Regards
> JB
>
> On 12/30/2012 10:29 AM, PJR69 wrote:
>
>> I'm using the latest published version, 2.3.0.
>>
>> If it helps, I can create a test-KAR for you once I get back to office on
>> 7th of Jan. I can just include for example joda-time.jar into the KAR, that
>> is enough to demonstrate the issue.
>>
>> Note that I'm using child instances and NOT the root instance, so maybe
>> there is a difference?
>>
>> What I'm doing is this:
>> - Download Karaf 2.3.0 on a computer connected to internet.
>> - Create a child instance called "template"
>> - Start & connect to child instance and then add features to it, like CXF,
>> Camel and ActiveMQ.
>> - Then I shutdown the whole thing.
>> - Then I zip the Karaf folder and move it to internal computer without any
>> internet connection and unpack it there.
>> - Then I start the root instance, and clone the template to "prod1" and then
>> start it.
>> - And then I deploy the KAR-file into this prod1-instance. And as I said,
>> the jar-files inside the KAR do get unpacked into the prod1-instance system
>> folder, but the won't get activated, that's the problem. If I just deploy
>> all the bundles separately into the deploy-folder, everything works, but
>> that's not the way I'd like to make the deployment.
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> [hidden email]</user/SendEmail.jtp?type=node&node=4027162&i=0>
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027162.html
> To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
> To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
> NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027223.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Difference in KAR-deployment between Windows and Linux

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Petri,

FYI:

https://issues.apache.org/jira/browse/KARAF-2114
https://issues.apache.org/jira/browse/KARAF-2115

I gonna fix these issues, it will be included in next Karaf 2.3.1 and 3.0.0.

Thanks again for your report !

Regards
JB

On 01/08/2013 08:50 AM, PJR69 wrote:
> Ok, finally I manage to resolve this!!!
>
> The issue lies with using a child-instance and incomplete configuration for pax mvn url resolver.
>
> Specifically, this property:
> org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
>      file:${karaf.home}/local-repo@snapshots
>
> in the org.ops4j.pax.url.mvn.cfg-file inside the child-instance etc-folder.
>
> I fixed this by modifying the above line to read:
> org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
>      file:${karaf.home}/local-repo@snapshots, file:${karaf.base}/${karaf.default.repository}@snapshots
>
> So, it seems that the KAR-deployer does unpack the files into the system-folder of the child-instance, BUT the mvn-url resolve doesn’t see that system-folder! It only sees the system-folder of the root instance!
>
> Once I modified the line as shown above and restart the child instance, my KAR-deployment started working just fine!!!
>
> Furthermore: This fix:
> #
> # Settings for the OSGi 4.3 Weaving
> # By default, we will not weave any classes. Change this setting to include classes
> # that you application needs to have woven.
> #
> org.apache.aries.proxy.weaving.enabled=none
> # Classes not to weave - Aries default + Xerces which is known to have issues.
> org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*
>
> appears only at the root-instance system.properties. If I create a child-instance, the system.properties-file generated there doesn’t include the above lines.
>
> So maybe fix these on the next release?
>
>
> -          Petri
>
>
> From: jbonofre [via Karaf] [mailto:ml-node+s922171n4027162h60@n3.nabble.com]
> Sent: 30. joulukuuta 2012 12:56
> To: Riipinen Petri
> Subject: Re: Difference in KAR-deployment between Windows and Linux
>
> Thanks for the details. I gonna test it.
>
> Regards
> JB
>
> On 12/30/2012 10:29 AM, PJR69 wrote:
>
>> I'm using the latest published version, 2.3.0.
>>
>> If it helps, I can create a test-KAR for you once I get back to office on
>> 7th of Jan. I can just include for example joda-time.jar into the KAR, that
>> is enough to demonstrate the issue.
>>
>> Note that I'm using child instances and NOT the root instance, so maybe
>> there is a difference?
>>
>> What I'm doing is this:
>> - Download Karaf 2.3.0 on a computer connected to internet.
>> - Create a child instance called "template"
>> - Start & connect to child instance and then add features to it, like CXF,
>> Camel and ActiveMQ.
>> - Then I shutdown the whole thing.
>> - Then I zip the Karaf folder and move it to internal computer without any
>> internet connection and unpack it there.
>> - Then I start the root instance, and clone the template to "prod1" and then
>> start it.
>> - And then I deploy the KAR-file into this prod1-instance. And as I said,
>> the jar-files inside the KAR do get unpacked into the prod1-instance system
>> folder, but the won't get activated, that's the problem. If I just deploy
>> all the bundles separately into the deploy-folder, everything works, but
>> that's not the way I'd like to make the deployment.
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> [hidden email]</user/SendEmail.jtp?type=node&node=4027162&i=0>
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027162.html
> To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
> To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
> NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027223.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Ok, finally I manage to resolve this!!!

The issue lies with using a child-instance and incomplete configuration for pax mvn url resolver.

Specifically, this property:
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
    file:${karaf.home}/local-repo@snapshots

in the org.ops4j.pax.url.mvn.cfg-file inside the child-instance etc-folder.

I fixed this by modifying the above line to read:
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots,\
    file:${karaf.home}/local-repo@snapshots, file:${karaf.base}/${karaf.default.repository}@snapshots

So, it seems that the KAR-deployer does unpack the files into the system-folder of the child-instance, BUT the mvn-url resolve doesn’t see that system-folder! It only sees the system-folder of the root instance!

Once I modified the line as shown above and restart the child instance, my KAR-deployment started working just fine!!!

Furthermore: This fix:
#
# Settings for the OSGi 4.3 Weaving
# By default, we will not weave any classes. Change this setting to include classes
# that you application needs to have woven.
#
org.apache.aries.proxy.weaving.enabled=none
# Classes not to weave - Aries default + Xerces which is known to have issues.
org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*

appears only at the root-instance system.properties. If I create a child-instance, the system.properties-file generated there doesn’t include the above lines.

So maybe fix these on the next release?


-          Petri


From: jbonofre [via Karaf] [mailto:ml-node+s922171n4027162h60@n3.nabble.com]
Sent: 30. joulukuuta 2012 12:56
To: Riipinen Petri
Subject: Re: Difference in KAR-deployment between Windows and Linux

Thanks for the details. I gonna test it.

Regards
JB

On 12/30/2012 10:29 AM, PJR69 wrote:

> I'm using the latest published version, 2.3.0.
>
> If it helps, I can create a test-KAR for you once I get back to office on
> 7th of Jan. I can just include for example joda-time.jar into the KAR, that
> is enough to demonstrate the issue.
>
> Note that I'm using child instances and NOT the root instance, so maybe
> there is a difference?
>
> What I'm doing is this:
> - Download Karaf 2.3.0 on a computer connected to internet.
> - Create a child instance called "template"
> - Start & connect to child instance and then add features to it, like CXF,
> Camel and ActiveMQ.
> - Then I shutdown the whole thing.
> - Then I zip the Karaf folder and move it to internal computer without any
> internet connection and unpack it there.
> - Then I start the root instance, and clone the template to "prod1" and then
> start it.
> - And then I deploy the KAR-file into this prod1-instance. And as I said,
> the jar-files inside the KAR do get unpacked into the prod1-instance system
> folder, but the won't get activated, that's the problem. If I just deploy
> all the bundles separately into the deploy-folder, everything works, but
> that's not the way I'd like to make the deployment.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]</user/SendEmail.jtp?type=node&node=4027162&i=0>
http://blog.nanthrax.net
Talend - http://www.talend.com

________________________________
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027162.html
To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027223.html
Sent from the Karaf - User mailing list archive at Nabble.com.

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Did you have any luck with this?

I’m back at work now after holidays so if you need, I can now prepare a KAR for you for testing?


-          Petri

From: jbonofre [via Karaf] [mailto:ml-node+s922171n4027162h60@n3.nabble.com]
Sent: 30. joulukuuta 2012 12:56
To: Riipinen Petri
Subject: Re: Difference in KAR-deployment between Windows and Linux

Thanks for the details. I gonna test it.

Regards
JB

On 12/30/2012 10:29 AM, PJR69 wrote:

> I'm using the latest published version, 2.3.0.
>
> If it helps, I can create a test-KAR for you once I get back to office on
> 7th of Jan. I can just include for example joda-time.jar into the KAR, that
> is enough to demonstrate the issue.
>
> Note that I'm using child instances and NOT the root instance, so maybe
> there is a difference?
>
> What I'm doing is this:
> - Download Karaf 2.3.0 on a computer connected to internet.
> - Create a child instance called "template"
> - Start & connect to child instance and then add features to it, like CXF,
> Camel and ActiveMQ.
> - Then I shutdown the whole thing.
> - Then I zip the Karaf folder and move it to internal computer without any
> internet connection and unpack it there.
> - Then I start the root instance, and clone the template to "prod1" and then
> start it.
> - And then I deploy the KAR-file into this prod1-instance. And as I said,
> the jar-files inside the KAR do get unpacked into the prod1-instance system
> folder, but the won't get activated, that's the problem. If I just deploy
> all the bundles separately into the deploy-folder, everything works, but
> that's not the way I'd like to make the deployment.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

--
Jean-Baptiste Onofré
[hidden email]</user/SendEmail.jtp?type=node&node=4027162&i=0>
http://blog.nanthrax.net
Talend - http://www.talend.com

________________________________
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027162.html
To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027213.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the details. I gonna test it.

Regards
JB

On 12/30/2012 10:29 AM, PJR69 wrote:
> I'm using the latest published version, 2.3.0.
>
> If it helps, I can create a test-KAR for you once I get back to office on
> 7th of Jan. I can just include for example joda-time.jar into the KAR, that
> is enough to demonstrate the issue.
>
> Note that I'm using child instances and NOT the root instance, so maybe
> there is a difference?
>
> What I'm doing is this:
> - Download Karaf 2.3.0 on a computer connected to internet.
> - Create a child instance called "template"
> - Start & connect to child instance and then add features to it, like CXF,
> Camel and ActiveMQ.
> - Then I shutdown the whole thing.
> - Then I zip the Karaf folder and move it to internal computer without any
> internet connection and unpack it there.
> - Then I start the root instance, and clone the template to "prod1" and then
> start it.
> - And then I deploy the KAR-file into this prod1-instance. And as I said,
> the jar-files inside the KAR do get unpacked into the prod1-instance system
> folder, but the won't get activated, that's the problem. If I just deploy
> all the bundles separately into the deploy-folder, everything works, but
> that's not the way I'd like to make the deployment.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
I'm using the latest published version, 2.3.0.

If it helps, I can create a test-KAR for you once I get back to office on
7th of Jan. I can just include for example joda-time.jar into the KAR, that
is enough to demonstrate the issue.

Note that I'm using child instances and NOT the root instance, so maybe
there is a difference?

What I'm doing is this:
- Download Karaf 2.3.0 on a computer connected to internet.
- Create a child instance called "template"
- Start & connect to child instance and then add features to it, like CXF,
Camel and ActiveMQ.
- Then I shutdown the whole thing.
- Then I zip the Karaf folder and move it to internal computer without any
internet connection and unpack it there.
- Then I start the root instance, and clone the template to "prod1" and then
start it.
- And then I deploy the KAR-file into this prod1-instance. And as I said,
the jar-files inside the KAR do get unpacked into the prod1-instance system
folder, but the won't get activated, that's the problem. If I just deploy
all the bundles separately into the deploy-folder, everything works, but
that's not the way I'd like to make the deployment.



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027161.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

could you remember me which Karaf version do you use ?
I gonna make a try with a sample KAR.

Regards
JB

On 12/29/2012 10:49 AM, PJR69 wrote:
> Any ideas with this problem? Why aren't the bundles unpacked under the
> system-folder seen & activated by the container?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027158.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Any ideas with this problem? Why aren't the bundles unpacked under the
system-folder seen & activated by the container?



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027158.html
Sent from the Karaf - User mailing list archive at Nabble.com.

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Ok, I verified this:
- I removed the KAR from the deploy-folder.
- I deleted all subfolders under the instance/myinstance/system-folder
- I dropped the KAR to the deploy-folder

-> Sure enough, all the bundles inside the KAR-file were unpacked under the
system-folder, so the KAR-deployer seems to do it's job.

Now, for some reason the pax-url-resolver just won't use the system-folder
to pick up the dependencies... At least on the child instance.

Maybe I should configure something on the pax.url-configuration to enable it
to see the system-folder also?



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027114.html
Sent from the Karaf - User mailing list archive at Nabble.com.

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
One more observation: It looks like dropping the KAR has actually unpacked the contained bundles under the system-folder of the instance that I'm using (FYI: I'm trying to deploy this to a child instance, not the root), at least joda-time was under the system-folder. So I'm assuming the jars should be found there then...

Hmm... Might there be a problem of locating the bundles from the system-folder of a child-instance?


-          Petri

From: PJR69 [via Karaf] [mailto:ml-node+s922171n4027112h10@n3.nabble.com]
Sent: 20. joulukuuta 2012 12:22
To: Riipinen Petri
Subject: Re: Difference in KAR-deployment between Windows and Linux

Sorry, can't really share the KAR-file due to security reasons, but this is simply what I do:

- I'm using the generate-features-xml-plugin to create the features.xml file with my maven dependencies.
- Then I'm using create-kar to create the KAR-file by using the generated features.xml-file.

I end up with one zipped KAR-file which has the following folders on the root:
/META-INF
/repository (and under here the dependencies in maven-layout subfolders, about 8 bundles total)

Under the /repository I have for example the features.xml behind a certain folder path and all the dependencies from the features.xml are also in their proper folders as maven layout dictates.

There isn't anything special in the log that I can see of, just that the maven resolver tries to find the dependencies from a list of repositories but obviously can't find them.
________________________________
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027112.html
To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
Insta lahjoittaa t?n? vuonna joulukortti- ja lahjavarat sotaveteraanien hyv?ksi. Rauhallista Joulua ja Onnellista Uutta Vuotta 2013!

____________________________________________________________________________________________

Instead of sending Christmas Cards and gifts, Insta has made a contribution to veterans' recreational activities. Best wishes for a peaceful Christmas and a Happy New Year 2013!




--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027113.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Sorry, can't really share the KAR-file due to security reasons, but this is
simply what I do:

- I'm using the generate-features-xml-plugin to create the features.xml file
with my maven dependencies.
- Then I'm using create-kar to create the KAR-file by using the generated
features.xml-file.

I end up with one zipped KAR-file which has the following folders on the
root:
/META-INF 
/repository (and under here the dependencies in maven-layout subfolders,
about 8 bundles total)

Under the /repository I have for example the features.xml behind a certain
folder path and all the dependencies from the features.xml are also in their
proper folders as maven layout dictates.

There isn't anything special in the log that I can see of, just that the
maven resolver tries to find the dependencies from a list of repositories
but obviously can't find them.



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027112.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Petri,

is your KAR follow the following structure:
- the kar file should contain a repository folder
- the repository contains a Maven structure 
(groupId/artifactId/version/artifactId-version.jar)
- this repository folder is packaged as a zip file

Did you try to remove the local-repository folder in KARAF_HOME (it will 
force the deployment of the kar file) ?
My advice is to test:
- stop Karaf
- remove the local-repository folder
- start Karaf
- drop your KAR in the deploy folder

Do you have something special in the log file ?
Could you share your kar file ?

Thanks,
Regards
JB

On 12/20/2012 11:02 AM, PJR69 wrote:
> Hi again,
>
> Ok, my final discovery with Karaf 2.3.0 is that:
>
> 1.       When I drop my KAR-file into Windows-Karaf -> It gets installed and starts running fine.
>
> 2.       When I drop the SAME KAR-file into Linux-karaf -> It doesn't find any bundles from the included repository inside the KAR-file. I see my feature with features-list, but when I try to install it, it spits out an error not being able to resolve the first mvn:-dependency in the features.xml and stops there.
>
> Any ideas what might be the difference between the Windows vs Linux environments with respect of not being able to
>
> For example, I have joda-time/joda-time-2.0.jar inside the KAR-file -> This gets deployed and activated fine on Windows, but not on Linux. This is the first dependency where the installation stops. If I drop joda-time-2.0.jar by itself to the deploy-folder, it gets picked up and activated just fine.
>
>
> -          Petri
>
>
> From: PJR69 [via Karaf] [mailto:ml-node+s922171n4027094h52@n3.nabble.com]
> Sent: 19. joulukuuta 2012 12:09
> To: Riipinen Petri
> Subject: Re: Difference in KAR-deployment between Windows and Linux
>
> Actually, for what it's worth, there maybe something deeper problem here:
>
> I'm using the google guava-osgi 10.0.1 library -> When I drop this file into windows-karaf deploy folder, it gets started ok and it has no external dependencies.
>
> However, when I drop this into the deploy folder of the linux-karaf setup -> It just gets installed and doesn't move to Active-state. I try to start it manually but it just remain sin Installed-state.
>
> Hmm.... I have Sun JDK 1.7 installed on the Linux-machine and nothing else, could this maybe be the problem?
>
> I'm guessing that the problem causing this (guave-osgi not being Activated) is the one that's causing the feature not being installed and bundles activate automatically?
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027094.html
> To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
> To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
> NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> ________________________________
> Insta lahjoittaa t?n? vuonna joulukortti- ja lahjavarat sotaveteraanien hyv?ksi. Rauhallista Joulua ja Onnellista Uutta Vuotta 2013!
>
> ____________________________________________________________________________________________
>
> Instead of sending Christmas Cards and gifts, Insta has made a contribution to veterans' recreational activities. Best wishes for a peaceful Christmas and a Happy New Year 2013!
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027108.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

RE: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Hi again,

Ok, my final discovery with Karaf 2.3.0 is that:

1.       When I drop my KAR-file into Windows-Karaf -> It gets installed and starts running fine.

2.       When I drop the SAME KAR-file into Linux-karaf -> It doesn't find any bundles from the included repository inside the KAR-file. I see my feature with features-list, but when I try to install it, it spits out an error not being able to resolve the first mvn:-dependency in the features.xml and stops there.

Any ideas what might be the difference between the Windows vs Linux environments with respect of not being able to

For example, I have joda-time/joda-time-2.0.jar inside the KAR-file -> This gets deployed and activated fine on Windows, but not on Linux. This is the first dependency where the installation stops. If I drop joda-time-2.0.jar by itself to the deploy-folder, it gets picked up and activated just fine.


-          Petri


From: PJR69 [via Karaf] [mailto:ml-node+s922171n4027094h52@n3.nabble.com]
Sent: 19. joulukuuta 2012 12:09
To: Riipinen Petri
Subject: Re: Difference in KAR-deployment between Windows and Linux

Actually, for what it's worth, there maybe something deeper problem here:

I'm using the google guava-osgi 10.0.1 library -> When I drop this file into windows-karaf deploy folder, it gets started ok and it has no external dependencies.

However, when I drop this into the deploy folder of the linux-karaf setup -> It just gets installed and doesn't move to Active-state. I try to start it manually but it just remain sin Installed-state.

Hmm.... I have Sun JDK 1.7 installed on the Linux-machine and nothing else, could this maybe be the problem?

I'm guessing that the problem causing this (guave-osgi not being Activated) is the one that's causing the feature not being installed and bundles activate automatically?
________________________________
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027094.html
To start a new topic under Karaf - User, email ml-node+s922171n930749h57@n3.nabble.com<ma...@n3.nabble.com>
To unsubscribe from Karaf - User, click here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=930749&code=cGV0cmkucmlpcGluZW5AaW5zdGEuZml8OTMwNzQ5fDU5NTY5OTMzOA==>.
NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
Insta lahjoittaa t?n? vuonna joulukortti- ja lahjavarat sotaveteraanien hyv?ksi. Rauhallista Joulua ja Onnellista Uutta Vuotta 2013!

____________________________________________________________________________________________

Instead of sending Christmas Cards and gifts, Insta has made a contribution to veterans' recreational activities. Best wishes for a peaceful Christmas and a Happy New Year 2013!




--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027108.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Difference in KAR-deployment between Windows and Linux

Posted by PJR69 <pe...@insta.fi>.
Actually, for what it's worth, there maybe something deeper problem here:

I'm using the google guava-osgi 10.0.1 library -> When I drop this file into
windows-karaf deploy folder, it gets started ok and it has no external
dependencies.

However, when I drop this into the deploy folder of the linux-karaf setup ->
It just gets installed and doesn't move to Active-state. I try to start it
manually but it just remain sin Installed-state.

Hmm.... I have Sun JDK 1.7 installed on the Linux-machine and nothing else,
could this maybe be the problem?

I'm guessing that the problem causing this (guave-osgi not being Activated)
is the one that's causing the feature not being installed and bundles
activate automatically?



--
View this message in context: http://karaf.922171.n3.nabble.com/Difference-in-KAR-deployment-between-Windows-and-Linux-tp4027093p4027094.html
Sent from the Karaf - User mailing list archive at Nabble.com.