Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
Hi,

I'm experiencing a problem with deploying a bundle into Karaf 2.1.2 by copying 
it into the karaf_home/deploy folder.
Basically I copy three bundles: commons-cli-1.2.jar, groovy-all-1.7.5.jar and 
easyb-0.9.8.jar

I turned the default log level of karaf to debug, but I don't see any hints 
about why it fails.
In the logs I see that commons-cli-1.2.jar   groovy-all-1.7.5.jar are 
installed and started successfully:
12:34:20,897 | DEBUG | Event Dispatcher | cli  | ?  
 ? | 32 - org.apache.commons.cli - 1.2 | 
BundleEvent INSTALLED
12:34:20,899 | DEBUG | Event Dispatcher | cli  | ?  
 ? | 32 - org.apache.commons.cli - 1.2 | 
BundleEvent RESOLVED
12:34:20,900 | DEBUG | raf-2.1.2/deploy | BlueprintExtender| 
rint.container.BlueprintExtender  210 | 7 - org.apache.aries.blueprint - 
0.2.0.incubating | Scanning bundle org.apache.commons.cli for blueprint 
application
12:34:20,900 | DEBUG | raf-2.1.2/deploy | BlueprintExtender| 
rint.container.BlueprintExtender  276 | 7 - org.apache.aries.blueprint - 
0.2.0.incubating | No blueprint application found in bundle 
org.apache.commons.cli
12:34:20,900 | DEBUG | Event Dispatcher | cli  | ?  
 ? | 32 - org.apache.commons.cli - 1.2 | 
BundleEvent STARTED
12:34:31,155 | DEBUG | Event Dispatcher | groovy-all   | ?  
 ? | 33 - groovy-all - 1.7.5 | BundleEvent 
INSTALLED
12:34:31,189 | DEBUG | Event Dispatcher | groovy-all   | ?  
 ? | 33 - groovy-all - 1.7.5 | BundleEvent 
RESOLVED
12:34:31,208 | DEBUG | raf-2.1.2/deploy | BlueprintExtender| 
rint.container.BlueprintExtender  210 | 7 - org.apache.aries.blueprint - 
0.2.0.incubating | Scanning bundle groovy-all for blueprint application
12:34:31,214 | DEBUG | raf-2.1.2/deploy | BlueprintExtender| 
rint.container.BlueprintExtender  276 | 7 - org.apache.aries.blueprint - 
0.2.0.incubating | No blueprint application found in bundle groovy-all
12:34:31,214 | DEBUG | Event Dispatcher | groovy-all   | ?  
 ? | 33 - groovy-all - 1.7.5 | BundleEvent 
STARTED

However, there is nothing for the third bundle easyb-0.9.8.jar

Note that this really is a bundle and it is possible to explicitly install it 
using:
osgi:install file:/tmp/jki/apache-karaf-2.1.2/deploy/easyb-0.9.8.jar
Also starting it with its then assigned bundle id and using it works fine.

Somehow it seems like it is ignored by the process that watches the 
karaf_home/deploy folder :-(

Any ideas what the problem is or how I can figure out the root cause.

Cheers
  Juergen
--
Jürgen Kindler


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
P.S.: I've configured Karaf to use Equinox, not Felix.

Cheers
  Juergen

--
Jürgen Kindler


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Guillaume Nodet
Can you give the output of osgi:headers for the easyb bundle once
installed manually ?
FileInstall only installs correct jars and r4 compatible bundle.  This
means that the MANIFEST.MF
has to be the first or second entry in the jar (eventually after META-INF/ )

On Thu, Jan 6, 2011 at 13:09, Jürgen Kindler jkind...@talend.com wrote:
 Hi,

 I’m experiencing a problem with deploying a bundle into Karaf 2.1.2 by
 copying it into the karaf_home/deploy folder.
 Basically I copy three bundles: commons-cli-1.2.jar, groovy-all-1.7.5.jar
 and easyb-0.9.8.jar

 I turned the default log level of karaf to debug, but I don’t see any hints
 about why it fails.
 In the logs I see that commons-cli-1.2.jar   groovy-all-1.7.5.jar are
 installed and started successfully:
 12:34:20,897 | DEBUG | Event Dispatcher | cli  |
 ?   ? | 32 - org.apache.commons.cli - 1.2 |
 BundleEvent INSTALLED
 12:34:20,899 | DEBUG | Event Dispatcher | cli  |
 ?   ? | 32 - org.apache.commons.cli - 1.2 |
 BundleEvent RESOLVED
 12:34:20,900 | DEBUG | raf-2.1.2/deploy | BlueprintExtender    |
 rint.container.BlueprintExtender  210 | 7 - org.apache.aries.blueprint -
 0.2.0.incubating | Scanning bundle org.apache.commons.cli for blueprint
 application
 12:34:20,900 | DEBUG | raf-2.1.2/deploy | BlueprintExtender    |
 rint.container.BlueprintExtender  276 | 7 - org.apache.aries.blueprint -
 0.2.0.incubating | No blueprint application found in bundle
 org.apache.commons.cli
 12:34:20,900 | DEBUG | Event Dispatcher | cli  |
 ?   ? | 32 - org.apache.commons.cli - 1.2 |
 BundleEvent STARTED
 12:34:31,155 | DEBUG | Event Dispatcher | groovy-all   |
 ?   ? | 33 - groovy-all - 1.7.5 |
 BundleEvent INSTALLED
 12:34:31,189 | DEBUG | Event Dispatcher | groovy-all   |
 ?   ? | 33 - groovy-all - 1.7.5 |
 BundleEvent RESOLVED
 12:34:31,208 | DEBUG | raf-2.1.2/deploy | BlueprintExtender    |
 rint.container.BlueprintExtender  210 | 7 - org.apache.aries.blueprint -
 0.2.0.incubating | Scanning bundle groovy-all for blueprint application
 12:34:31,214 | DEBUG | raf-2.1.2/deploy | BlueprintExtender    |
 rint.container.BlueprintExtender  276 | 7 - org.apache.aries.blueprint -
 0.2.0.incubating | No blueprint application found in bundle groovy-all
 12:34:31,214 | DEBUG | Event Dispatcher | groovy-all   |
 ?   ? | 33 - groovy-all - 1.7.5 |
 BundleEvent STARTED

 However, there is nothing for the third bundle easyb-0.9.8.jar

 Note that this really is a bundle and it is possible to explicitly install
 it using:
 osgi:install file:/tmp/jki/apache-karaf-2.1.2/deploy/easyb-0.9.8.jar
 Also starting it with its then assigned bundle id and using it works fine.

 Somehow it seems like it is ignored by the process that watches the
 karaf_home/deploy folder :-(

 Any ideas what the problem is or how I can figure out the root cause.

 Cheers
   Juergen
 --
 Jürgen Kindler




-- 
Cheers,
Guillaume Nodet

Blog: http://gnodet.blogspot.com/

Open Source SOA
http://fusesource.com


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
Hi Guillaume,

I'm currently checking the consistency of the jar.

Anyway after installing, it looks like this (so the jar cannot be completely 
broken):
ka...@root list
START LEVEL 100 , List Threshold: 50
   ID   State Blueprint  Level  Name
[  32] [Active ] [] [   60] Commons CLI (1.2)
[  33] [Active ] [] [   60] Groovy Runtime (1.7.5)
[  35] [Installed  ] [] [   60] Easyb (0.9.8)
ka...@root bundle 35
ClassLoader  null
RegisteredServices   null
ServicesInUsenull
Fragmentsnull
LoaderProxy  easyb; bundle-version=0.9.8
ProtectionDomain null
Key  35
Location file:/tmp/jki/apache-karaf-2.1.2/deploy/easyb-0.9.8.jar
State2
Version  0.9.8
LastModified 1294318503212
Headers  [Manifest-Version=1.0, 
Bundle-RequiredExecutionEnvironment=J2SE-1.5, Bundle-Name=Easyb, 
Ant-Version=Apache Ant 1.8.1, 
Import-Package=groovy.lang;version=1.7.5,groovy.text;version=1.7.5,groovy.xml;version=1.7.5,org.codehaus.groovy.reflection;version=1.7.5,org.codehaus.groovy.runtime;version=1.7.5,org.codehaus.groovy.runtime.callsite;version=1.7.5,org.codehaus.groovy.runtime.typehandling;version=1.7.5,org.apache.commons.cli;version=1.2,
 Bundle-SymbolicName=easyb, 
Export-Package=org.easyb;version=0.9.8,org.easyb.ant;version=0.9.8,org.easyb.delegates;version=0.9.8,org.easyb.domain;version=0.9.8,org.easyb.exception;version=0.9.8,org.easyb.listener;version=0.9.8,org.easyb.plugin;version=0.9.8,org.easyb.report;version=0.9.8,org.easyb.result;version=0.9.8,org.easyb.util;version=0.9.8,
 Bundle-Version=0.9.8, Created-By=1.6.0_22-b04-307-9M3263 (Apple Inc.), 
Bundle-ManifestVersion=2]
Frameworkorg.eclipse.osgi.framework.internal.core.framew...@152d950
BundleContextnull
BundleId 35
SymbolicName easyb
BundleData   easyb_0.9.8
BundleDescriptioneasyb_0.9.8
KeyHashCode  35
ResolutionFailureException org.osgi.framework.BundleException: The bundle 
easyb_0.9.8 [35] could not be resolved
StateChangingnull

ka...@root osgi:headers 35

Easyb (35)
--
Manifest-Version = 1.0
Ant-Version = Apache Ant 1.8.1
Created-By = 1.6.0_22-b04-307-9M3263 (Apple Inc.)

Bundle-RequiredExecutionEnvironment = J2SE-1.5
Bundle-Name = Easyb
Bundle-SymbolicName = easyb
Bundle-Version = 0.9.8
Bundle-ManifestVersion = 2

Import-Package =
groovy.lang;version=1.7.5,
groovy.text;version=1.7.5,
groovy.xml;version=1.7.5,
org.codehaus.groovy.reflection;version=1.7.5,
org.codehaus.groovy.runtime;version=1.7.5,
org.codehaus.groovy.runtime.callsite;version=1.7.5,
org.codehaus.groovy.runtime.typehandling;version=1.7.5,
org.apache.commons.cli;version=1.2
Export-Package =
org.easyb;version=0.9.8,
org.easyb.ant;version=0.9.8,
org.easyb.delegates;version=0.9.8,
org.easyb.domain;version=0.9.8,
org.easyb.exception;version=0.9.8,
org.easyb.listener;version=0.9.8,
org.easyb.plugin;version=0.9.8,
org.easyb.report;version=0.9.8,
org.easyb.result;version=0.9.8,
org.easyb.util;version=0.9.8


On 1/6/11 13:26, Guillaume Nodet gno...@gmail.com wrote:

Can you give the output of osgi:headers for the easyb bundle once
installed manually ?
FileInstall only installs correct jars and r4 compatible bundle.  This
means that the MANIFEST.MF
has to be the first or second entry in the jar (eventually after META-INF/ )


--
Jürgen Kindler


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
I've checked the jar now as well:
 jar -tf easyb-0.9.8.jar
META-INF/
META-INF/MANIFEST.MF
META-INF/services/
META-INF/services/org.easyb.plugin.SyntaxExtension
org/
org/easyb/
org/easyb/ant/
org/easyb/ant/AbstractJavaTask.class
org/easyb/ant/AbstractStoryTask.class
org/easyb/ant/BehaviorRunnerTask.class
org/easyb/ant/CommandRunner.class
org/easyb/ant/CommandRunnerImpl.class
org/easyb/ant/Report.class

Looks ok for me ... %-|

--
Jürgen Kindler


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
X'-(

Seems like the archive was broken anyway ... I re-jar'd it and now it works 
':-) (phew)

--
Jürgen Kindler


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jean-Baptiste Onofré

Hi Jürgen,

I got the same issue:
- the jar resulting to felix maven plugin was fine
- the maven assembly plugin corrupt the jar during copy goal

I have updated to the latest assembly plugin version. Maybe you have the 
same behavior ?


Regards
JB

On 01/06/2011 02:52 PM, Jürgen Kindler wrote:

X’-(

Seems like the archive was broken anyway ... I re-jar’d it and now it
works ‘:-) (phew)

--
*Jürgen Kindler
*


Re: Problems with Karaf hotdeploy

2011-01-06 Thread Jürgen Kindler
JB, no... I guess in my case the problem is called muCommander :-(
I added the metadata manually by replacing the manifest directly inside 
muCommander.
Usually this works fine

On 1/6/11 14:54, Jean-Baptiste Onofré j...@nanthrax.net wrote:

Hi Jürgen,

I got the same issue:
- the jar resulting to felix maven plugin was fine
- the maven assembly plugin corrupt the jar during copy goal

I have updated to the latest assembly plugin version. Maybe you have the
same behavior ?

--
Jürgen Kindler


Re: My bundle using a properties file

2011-01-06 Thread karafman



Don, 



Assuming you are talking about a normal Java properties file (key=value on 
every line) Karaf uses something called the Configuration Admin service for 
this.  What you would do is place your properties file in the {KARAF_HOME}/etc 
directory and rename it so that it has a .cfg extension (remove any characters 
that are not included in this: [a-z, A-Z,.] from the file name also).  Then, 
you would create a spring file that looks like this: 





beans xmlns= http://www.springframework.org/schema/beans  

  xmlns:xsi= http://www.w3.org/XMLSchema-instance  

  xmlns:ctx= http://www.springframework.org/schema/context  

  xmlns:osgix= 
http://www.springframework.org/schema/osgi-compendium  

  xmlns:osgi= http://www.springframework.org/schema/context  

  xsi:schemaLocation= 

  http://www.springframework.og/schema/beans 
http://www.springframework.og/schema/beans/spring-beans.xsd 

  http://www.springframework.og/schema/context 
http://www.springframework.og/schema/context/spring-context.xsd 

  http://www.springframework.og/schema/osgi-compendium 
http://www.springframework.og/schema/osgi-compendium/spring-osgi-compendium.xsd 

  http://www.springframework.og/schema/osgi 
http://www.springframework.og/schema/osgi/psring-osgi.xsd  

 

!-- The persistent ID is the name of your properties file, minus 
the .cfg extension -- 

osgix:cm-properties id=myProperties 
persistent-id=my.properties.file/ 

    osgi:property-placeholder properties-ref=myProperties / 



/beans 



Put this into a spring.xml file and place it in your   
resources/META-INF/spring  directory.  This will make all of the properties in 
that file available for injection using the same syntax as you would use with 
standard Java properties. 



I hope this helps! 





v/r, 



Karafman 


- Original Message - 
From: DonDiego761 [via Karaf] 
ml-node+2206312-1942807629-228...@n3.nabble.com 
To: karafman mvangeert...@comcast.net 
Sent: Thursday, January 6, 2011 10:54:41 AM 
Subject: My bundle using a properties file 

Hi, 

I have a problem with my bundle which is using a external properties file. 

I have the exception: 
java.io.FileNotFoundException: ServletContext resource 
[/path/to/my/file/file.properties] cannot be resolved to absolute file path - 
web application archive not expanded? 

Note that my properties file is loaded by a class created from Spring context. 

How to read a external property file? 

Regards, 






View message @ 
http://karaf.922171.n3.nabble.com/My-bundle-using-a-properties-file-tp2206312p2206312.html
 
To start a new topic under Karaf - User, email 
ml-node+930749-917263437-228...@n3.nabble.com 
To unsubscribe from Karaf - User, click here .

-
Karafman
Slayer of the JEE
Pounder of the Perl Programmer

-- 
View this message in context: 
http://karaf.922171.n3.nabble.com/My-bundle-using-a-properties-file-tp2206312p2207060.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Aggregating provisioning files

2011-01-06 Thread karafman

My application is divided functionally between a bunch of areas.  When we
deploy these, each functional area will have its own dependencies.  As a
result, I'd like to maintain features.xml files for each individual area,
and on compiling the application, aggregate all the features.xml files into
a single provisioning file for the entire application. 

Is there a way to do this?  



-
Karafman
Slayer of the JEE
Pounder of the Perl Programmer

-- 
View this message in context: 
http://karaf.922171.n3.nabble.com/Aggregating-provisioning-files-tp2207656p2207656.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Aggregating provisioning files

2011-01-06 Thread Achim Nierbeck
Have you taken a look at the kar file approach?

This would be a zip file which includes bundles and a feature xml.
I think this sounds like what you need, but I'm unsure if it supports
multiple
features.xml files. But it might already help to build multiple zip
files with
bundles and feature.xml file.

cheers, Achim
 My application is divided functionally between a bunch of areas.  When we
 deploy these, each functional area will have its own dependencies.  As a
 result, I'd like to maintain features.xml files for each individual area,
 and on compiling the application, aggregate all the features.xml files into
 a single provisioning file for the entire application. 

 Is there a way to do this?  



 -
 Karafman
 Slayer of the JEE
 Pounder of the Perl Programmer




Re: Aggregating provisioning files

2011-01-06 Thread Andreas Pieber
I solve this problem by having one feature file and only deliver/install the
features required for the different customers from the one core feature file. 
But y do you want to aggregate them? Isn't it enough for you to simply take only
those feature files you require?

kind regards,
andreas

On Thu, Jan 06, 2011 at 11:40:21AM -0800, karafman wrote:
 
 My application is divided functionally between a bunch of areas.  When we
 deploy these, each functional area will have its own dependencies.  As a
 result, I'd like to maintain features.xml files for each individual area,
 and on compiling the application, aggregate all the features.xml files into
 a single provisioning file for the entire application. 
 
 Is there a way to do this?  
 
 
 
 -
 Karafman
 Slayer of the JEE
 Pounder of the Perl Programmer
 
 -- 
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Aggregating-provisioning-files-tp2207656p2207656.html
 Sent from the Karaf - User mailing list archive at Nabble.com.


pgpM65U6FO6Bs.pgp
Description: PGP signature