Re: Exception starting karaf custom distro "minimal example" from docs

2017-06-13 Thread Achim Nierbeck
regarding your "maven" confidence ... do you happen to have a "Proxy"
connected to your maven setup?
In rare cases, or flaky internet connections your bundles might not have
been a jar at all, but a http error code ;)
This happens in rare cases.
Best to do a mvn clean install -U for updating all dependencies.

regards, Achim


2017-06-13 15:26 GMT+02:00 :

> > On 13 June 2017 at 12:32 Jean-Baptiste Onofré  wrote:
> >
> >
> > I don't understand why you have the pax-web feature.
> >
> > Do you have it defined in bootFeatures ? Or do you install it by hand ?
> >
> > I can confirm that I don't have pax-web feature on my custom distro.
>
> So I created a completely fresh directory, deleted the contents of my .m2
> maven repository cache, created a pom.xml file with your example contents
> in, and ran "mvn clean install".
>
> I ran target/assembly/bin/karaf.bat.
> feature:list then lists pax-http as "started".
>
> Interestingly though I have no exceptions in the log file.
>
> Well that's interesting.
> Worryingly, deleting my .m2 directory contents seems to have altered the
> behaviour. Going back to my original example, it now works closer to how I
> would expect.
> I admit my knowledge of Maven is low, but it's a cache isn't it?
> Re-downloading the dependencies ought not to have changed anything? That
> worries me.
>
> The good news is that this seems to have fixed things. I no longer have
> odd exceptions in the log.
>
> Confidence in Karaf has increased, confidence in maven lowered!
> Thanks for the help.
>



-- 

Apache Member
Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
blog 
Co-Author of Apache Karaf Cookbook 

Software Architect / Project Manager / Scrum Master


Re: Exception starting karaf custom distro "minimal example" from docs

2017-06-13 Thread tom
> On 13 June 2017 at 12:32 Jean-Baptiste Onofré  wrote:
> 
> 
> I don't understand why you have the pax-web feature.
> 
> Do you have it defined in bootFeatures ? Or do you install it by hand ?
> 
> I can confirm that I don't have pax-web feature on my custom distro.

So I created a completely fresh directory, deleted the contents of my .m2 maven 
repository cache, created a pom.xml file with your example contents in, and ran 
"mvn clean install".

I ran target/assembly/bin/karaf.bat.
feature:list then lists pax-http as "started".

Interestingly though I have no exceptions in the log file.

Well that's interesting. 
Worryingly, deleting my .m2 directory contents seems to have altered the 
behaviour. Going back to my original example, it now works closer to how I 
would expect. 
I admit my knowledge of Maven is low, but it's a cache isn't it? Re-downloading 
the dependencies ought not to have changed anything? That worries me.

The good news is that this seems to have fixed things. I no longer have odd 
exceptions in the log.

Confidence in Karaf has increased, confidence in maven lowered!
Thanks for the help.


Re: Exception starting karaf custom distro "minimal example" from docs

2017-06-13 Thread Jean-Baptiste Onofré

I don't understand why you have the pax-web feature.

Do you have it defined in bootFeatures ? Or do you install it by hand ?

I can confirm that I don't have pax-web feature on my custom distro.

Regards
JB

On 06/13/2017 11:13 AM, t...@quarendon.net wrote:



On 13 June 2017 at 09:08 Jean-Baptiste Onofré  wrote:


Hi Tom,

Here's a pom.xml to do what you want:


As far as I can see that's the same as the "minimal example" in the docs.
If I use your example, I still get errors:

2017-06-13T09:46:01,692 | ERROR | FelixDispatchQueue | 
pax-web-extender-whiteboard  | 118 - 
org.ops4j.pax.web.pax-web-extender-whiteboard - 6.0.3 | FrameworkEvent ERROR - 
org.ops4j.pax.web.pax-web-extender-whiteboard
org.osgi.framework.BundleException: Activator start error in bundle 
org.ops4j.pax.web.pax-web-extender-whiteboard [118].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2288) 
[?:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144) [?:?]
at 
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371) [?:?]
at 
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
 [?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.ClassCastException: 
org.apache.felix.httplite.osgi.HttpServiceImpl cannot be cast to 
org.osgi.service.http.HttpService

and
2017-06-13T09:50:23,076 | ERROR | paxweb-config-2-thread-1 | Felix  
  |  -  -  | Bundle org.apache.felix.inventory [36] 
EventDispatcher: Error during dispatch. (java.lang.ClassCastException: 
org.apache.felix.httplite.osgi.HttpServiceImpl cannot be cast to 
org.osgi.service.http.HttpService)

and

2017-06-13T09:50:23,076 | ERROR | FelixDispatchQueue | inventory
| 36 - org.apache.felix.inventory - 1.0.4 | FrameworkEvent ERROR - 
org.apache.felix.inventory
java.lang.ClassCastException: org.apache.felix.httplite.osgi.HttpServiceImpl 
cannot be cast to org.osgi.service.http.HttpService

etc.

The "javax.servlet two chains" issue has gone. However that comes back if I specify "enterprise" instead of 
"standard" in my "bootFeatures" (investigating I had a "org.apache.karaf.features.cfg" file that 
specified some things that I had inherited from another example -- deleted that now).


This clearly indicates to be that there are just some incompatible bundles 
there. org.ops4j.pax.web.pax-web-extender-whiteboard is expecting 
org.apache.felix.httplite.osgi.HttpServiceImpl to be a 
org.osgi.service.http.HttpService when it's not, or at least not the same 
org.osgi.service.http.HttpService class.


Closing Karaf down and then starting it up again though, it still just hangs 
with no output of any kind, no logging.



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


Re: Exception starting karaf custom distro "minimal example" from docs

2017-06-13 Thread tom

> On 13 June 2017 at 09:08 Jean-Baptiste Onofré  wrote:
> 
> 
> Hi Tom,
> 
> Here's a pom.xml to do what you want:

As far as I can see that's the same as the "minimal example" in the docs. 
If I use your example, I still get errors:

2017-06-13T09:46:01,692 | ERROR | FelixDispatchQueue | 
pax-web-extender-whiteboard  | 118 - 
org.ops4j.pax.web.pax-web-extender-whiteboard - 6.0.3 | FrameworkEvent ERROR - 
org.ops4j.pax.web.pax-web-extender-whiteboard
org.osgi.framework.BundleException: Activator start error in bundle 
org.ops4j.pax.web.pax-web-extender-whiteboard [118].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2288) 
[?:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144) [?:?]
at 
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371) [?:?]
at 
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
 [?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.ClassCastException: 
org.apache.felix.httplite.osgi.HttpServiceImpl cannot be cast to 
org.osgi.service.http.HttpService

and
2017-06-13T09:50:23,076 | ERROR | paxweb-config-2-thread-1 | Felix  
  |  -  -  | Bundle org.apache.felix.inventory [36] 
EventDispatcher: Error during dispatch. (java.lang.ClassCastException: 
org.apache.felix.httplite.osgi.HttpServiceImpl cannot be cast to 
org.osgi.service.http.HttpService)

and 

2017-06-13T09:50:23,076 | ERROR | FelixDispatchQueue | inventory
| 36 - org.apache.felix.inventory - 1.0.4 | FrameworkEvent ERROR - 
org.apache.felix.inventory
java.lang.ClassCastException: org.apache.felix.httplite.osgi.HttpServiceImpl 
cannot be cast to org.osgi.service.http.HttpService

etc.

The "javax.servlet two chains" issue has gone. However that comes back if I 
specify "enterprise" instead of "standard" in my "bootFeatures" (investigating 
I had a "org.apache.karaf.features.cfg" file that specified some things that I 
had inherited from another example -- deleted that now).


This clearly indicates to be that there are just some incompatible bundles 
there. org.ops4j.pax.web.pax-web-extender-whiteboard is expecting 
org.apache.felix.httplite.osgi.HttpServiceImpl to be a 
org.osgi.service.http.HttpService when it's not, or at least not the same 
org.osgi.service.http.HttpService class.


Closing Karaf down and then starting it up again though, it still just hangs 
with no output of any kind, no logging.


Re: Exception starting karaf custom distro "minimal example" from docs

2017-06-13 Thread Jean-Baptiste Onofré

Hi Tom,

Here's a pom.xml to do what you want:


http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>


  4.0.0

  example
  my-karaf
  1.0.0-SNAPSHOT
  karaf-assembly

  

  org.apache.karaf.features
  framework
  4.1.1
  kar


  org.apache.karaf.features
  standard
  4.1.1
  features
  xml

  


  

  
org.apache.karaf.tooling
karaf-maven-plugin
4.1.1
true

  
standard
  
  1.8

  

  



It's what I used during ApacheCon to build a custom distribution of Karaf 
embedding Cellar (I removed the Cellar part for you).


Regards
JB

On 06/13/2017 09:52 AM, t...@quarendon.net wrote:

I've attempted to build a simple custom Karaf distribution using the maven 
plugin and the karaf-assembly packaging.
I can build the assembly, but when I start the result I get an exception.

My pom configuration is currently very simple, just:


 
 org.apache.karaf.features
 framework
 ${karafVersion}
 kar
 
 
 org.apache.karaf.features
 standard
 ${karafVersion}
 features
 xml
compile
 

...

 
 org.apache.karaf.tooling
 karaf-maven-plugin
 
 
 
 
 standard
 
 
 
 1.8
 
 


karafVersion is 4.1.1

So I'm just bundling karaf, I'm not including anything else. This is the "minimal 
example" in the karaf docs.

On startup I get the log here : 
https://gist.github.com/tomq42/47403ec44413fdc517c70dc3cccbf0cb

I get the same if I specify "minimal" in "bootFeatures".
Am I doing something wrong here?

Thanks.



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