Arbitrating between multiple bundles that explore a package

2016-02-05 Thread Benson Margulies
My application was happily working using a bundle I built myself to contain
the Snowball package.

org.tartarus.snowball;version=1.0.2,
org.tartarus.snowball.ext;uses:=org.tartarus.snowball;version=1.0.2

Then I added in the ServiceMix lucene-analyzers-common bundle, version
5.2.1.1.

This _also_ exports the snowball packages.

org.tartarus.snowball;uses:=org.apache.lucene.util;version=5.2.1.1,
org.tartarus.snowball.ext;uses:=org.tartarus.snowball;version=5.2.1.1

Now I get NoClassDefFound errors in the code that goes to use snowball.

Is there anything i can configure in Karaf to get around this? At the
moment, my imports don't have a version on them; I'm hoping for a repair
before I can spin a new version of the importing item.


Re: [ANN] New Karaf website online

2016-02-05 Thread Jean-Baptiste Onofré

Thanks, it sounds good.

I would prefer to keep "OSGi" out of the picture on the front page.

Regards
JB

On 02/05/2016 07:55 PM, Raman Gupta wrote:

Thank you for the explanation JB!

I would probably change the wording to something like:

"Karaf is a flexible component container with multiple deployment
options. Focus on your business code and application and Karaf deals
with the rest."

I think getting the word "component" in there is important, or even
"OSGi" (but that might be too technical). The rest is just a
simplification for clarity.

Regards,
Raman


On 02/05/2016 12:58 AM, Jean-Baptiste Onofré wrote:

"Polymorphic container": adapting to your need depending of the
features. For instance, Karaf can be a container for ESB, Big Data,
web application, IoT, etc.
"Dual": because you can run Karaf as standalone, embedded in a
webcontainer, or bootstrapping ("run everywhere") with karaf-boot

;)

Regards
JB

On 02/04/2016 11:15 PM, Raman Gupta wrote:

Congrats!

Now, if someone could only explain to me what a "dual polymorphic
container" is! :-)

Regards,
Raman


On 02/04/2016 10:31 AM, Jean-Baptiste Onofré wrote:

Hi all,

as you may have seen that the new Karaf website is now online.

Don't hesitate to create Jira (with website component) if you see some
broken links and rendering issue.

Thanks !
Regards
JB




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


Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Charles Moulliard
The bundle.info file only contains the id of the bundle (=161) but not all
the these fields

160
mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/1.0.4
32
30
1454661936527
0



On Fri, Feb 5, 2016 at 8:39 AM, Charles Moulliard  wrote:

> I just remove the ServiceReference of the
> org.ops4j.pax.web.service.WebContainer
>
> public void stop(BundleContext bc) throws Exception {
> if (webContainerRef != null) {
> bc.ungetService(webContainerRef);
> webContainerRef = null;
> }
> }
>
> On Fri, Feb 5, 2016 at 8:37 AM, Jean-Baptiste Onofré 
> wrote:
>
>> Hi Charles,
>>
>> What's this bundle ? Do you do something special in the stop() method of
>> the activator ?
>>
>> Regards
>> JB
>>
>>
>> On 02/05/2016 08:02 AM, Charles Moulliard wrote:
>>
>>> When I reboot Karaf, here is the info that I get also
>>>
>>> dabou:~/Fuse/servers/karaf-2.4.4.$ ll data/cache/bundle324/version0.0/
>>> total 51680
>>> drwxr-xr-x   5 chmoulli  staff   170 Feb  4 22:53 .
>>> drwxr-xr-x   4 chmoulli  staff   136 Feb  4 22:53 ..
>>> -rw-r--r--   1 chmoulli  staff  26453746 Feb  4 22:53 bundle.jar
>>> drwxr-xr-x  42 chmoulli  staff  1428 Feb  4 22:53 bundle.jar-embedded
>>> -rw-r--r--   1 chmoulli  staff41 Feb  4 22:53 revision.location
>>>
>>> dabou:~/Fuse/servers/karaf-2.4.4.$ ./bin/karaf
>>>
>>> ERROR: Error reloading cached bundle, removing it:
>>>
>>> /Users/chmoulli/Fuse/Fuse-servers/jboss-fuse-6.2.1.redhat-084/data/cache/bundle324
>>> (java.lang.NumberFormatException: null)
>>> java.lang.NumberFormatException: null
>>> at java.lang.Integer.parseInt(Integer.java:542)
>>> at java.lang.Integer.parseInt(Integer.java:615)
>>> at
>>>
>>> org.apache.felix.framework.cache.BundleArchive.readBundleInfo(BundleArchive.java:959)
>>> at
>>>
>>> org.apache.felix.framework.cache.BundleArchive.(BundleArchive.java:182)
>>> at
>>>
>>> org.apache.felix.framework.cache.BundleCache.getArchives(BundleCache.java:247)
>>> at org.apache.felix.framework.Felix.init(Felix.java:713)
>>> at org.apache.karaf.main.Main.launch(Main.java:344)
>>> at org.apache.karaf.main.Main.main(Main.java:561)
>>>
>>> On Thu, Feb 4, 2016 at 10:49 PM, Charles Moulliard >> > wrote:
>>>
>>> Yes I can do that with jmap. Here is a screenshot -
>>>
>>> https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0
>>>
>>> On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré
>>> > wrote:
>>>
>>> Can you take a thread dump ?
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 02/04/2016 09:00 PM, Charles Moulliard wrote:
>>>
>>> Hi,
>>>
>>> My Karaf 2.4.4 container stays blocked when it shutdowns and
>>> reports
>>> this error
>>>
>>> Exception in thread "Karaf Shell Console Thread"
>>> java.lang.NullPointerException
>>> at java.io.Writer.write(Writer.java:157)
>>> at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
>>> at java.io.PrintStream.newLine(PrintStream.java:544)
>>> at java.io.PrintStream.println(PrintStream.java:824)
>>> at
>>> jline.console.history.FileHistory.flush(FileHistory.java:90)
>>> at
>>>
>>> org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
>>> at
>>>
>>> org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
>>> at
>>>
>>> org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
>>> at
>>>
>>> org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)
>>>
>>> How can I investigate why the thread is blocked and that I
>>> must kill the
>>> process to restart it
>>>
>>> Regards,
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer & PMC / Architect @RedHat
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>>> 
>>>
>>>
>>> --
>>> Jean-Baptiste Onofré
>>> jbono...@apache.org 
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>>
>>>
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer & PMC / Architect @RedHat
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>>> 
>>>
>>>
>>>
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer & PMC / Architect @RedHat
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>>> 
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer & PMC / Architect @RedHat
> Twitter : 

Re: pax-jdbc-pool-aries

2016-02-05 Thread Charlie Mordant
Hi,

Your pool.maxTotal parameter does not exists in Aries-tx, so you have to
remove it from your config file in order to use it. I think that you'll
have access to these parameters (prefixing them by 'pool.'):
https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/EIP_Transactions_Guide/XaTM-ConfigureTM.html

You'll also have to configure these 3 parameters:


pool.username=
pool.password=
pool.name=
Regards,
Charlie

2016-02-05 8:41 GMT+01:00 Christian Schneider :

> Unfortunately there does not seem to be any documentation about aries
> transaction pool.
> Guillaume Nodet explained to me that aries transaction pool supports the
> transaction recovery feature of geronimo transaction manager.
> So that might be a reason to use it.
>
> I myself till now only ever used the dbcp2 pooling.
>
> Christian
>
> On 04.02.2016 20:24, Cheung, Pauline wrote:
>
> We are currently using dbcp2 and was curious about aries and how it works
> and if there are any advantages to using it.
>
>
>
> Is there any documentation on it?
>
>
>
> Thanks,
>
> Pauline
>
>
> --
> Christian Schneiderhttp://www.liquid-reality.de
>
> Open Source Architecthttp://www.talend.com
>
>


-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent


Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Charles Moulliard
And history content is empty

Exception in thread "Karaf Shell Console Thread"
java.lang.NullPointerException
at java.io.Writer.write(Writer.java:157)
at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
at java.io.PrintStream.newLine(PrintStream.java:544)
at java.io.PrintStream.println(PrintStream.java:824)
at jline.console.history.FileHistory.flush(FileHistory.java:90)
at
org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
at org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
at org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
at java.lang.Thread.run(Thread.java:745)

On Fri, Feb 5, 2016 at 9:55 AM, Charles Moulliard  wrote:

> The bundle.info file only contains the id of the bundle (=161) but not
> all the these fields
>
> 160
> mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/1.0.4
> 32
> 30
> 1454661936527
> 0
>
>
>
> On Fri, Feb 5, 2016 at 8:39 AM, Charles Moulliard 
> wrote:
>
>> I just remove the ServiceReference of the
>> org.ops4j.pax.web.service.WebContainer
>>
>> public void stop(BundleContext bc) throws Exception {
>> if (webContainerRef != null) {
>> bc.ungetService(webContainerRef);
>> webContainerRef = null;
>> }
>> }
>>
>> On Fri, Feb 5, 2016 at 8:37 AM, Jean-Baptiste Onofré 
>> wrote:
>>
>>> Hi Charles,
>>>
>>> What's this bundle ? Do you do something special in the stop() method of
>>> the activator ?
>>>
>>> Regards
>>> JB
>>>
>>>
>>> On 02/05/2016 08:02 AM, Charles Moulliard wrote:
>>>
 When I reboot Karaf, here is the info that I get also

 dabou:~/Fuse/servers/karaf-2.4.4.$ ll data/cache/bundle324/version0.0/
 total 51680
 drwxr-xr-x   5 chmoulli  staff   170 Feb  4 22:53 .
 drwxr-xr-x   4 chmoulli  staff   136 Feb  4 22:53 ..
 -rw-r--r--   1 chmoulli  staff  26453746 Feb  4 22:53 bundle.jar
 drwxr-xr-x  42 chmoulli  staff  1428 Feb  4 22:53
 bundle.jar-embedded
 -rw-r--r--   1 chmoulli  staff41 Feb  4 22:53 revision.location

 dabou:~/Fuse/servers/karaf-2.4.4.$ ./bin/karaf

 ERROR: Error reloading cached bundle, removing it:

 /Users/chmoulli/Fuse/Fuse-servers/jboss-fuse-6.2.1.redhat-084/data/cache/bundle324
 (java.lang.NumberFormatException: null)
 java.lang.NumberFormatException: null
 at java.lang.Integer.parseInt(Integer.java:542)
 at java.lang.Integer.parseInt(Integer.java:615)
 at

 org.apache.felix.framework.cache.BundleArchive.readBundleInfo(BundleArchive.java:959)
 at

 org.apache.felix.framework.cache.BundleArchive.(BundleArchive.java:182)
 at

 org.apache.felix.framework.cache.BundleCache.getArchives(BundleCache.java:247)
 at org.apache.felix.framework.Felix.init(Felix.java:713)
 at org.apache.karaf.main.Main.launch(Main.java:344)
 at org.apache.karaf.main.Main.main(Main.java:561)

 On Thu, Feb 4, 2016 at 10:49 PM, Charles Moulliard > wrote:

 Yes I can do that with jmap. Here is a screenshot -

 https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0

 On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré
 > wrote:

 Can you take a thread dump ?

 Regards
 JB


 On 02/04/2016 09:00 PM, Charles Moulliard wrote:

 Hi,

 My Karaf 2.4.4 container stays blocked when it shutdowns and
 reports
 this error

 Exception in thread "Karaf Shell Console Thread"
 java.lang.NullPointerException
 at java.io.Writer.write(Writer.java:157)
 at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
 at java.io.PrintStream.newLine(PrintStream.java:544)
 at java.io.PrintStream.println(PrintStream.java:824)
 at
 jline.console.history.FileHistory.flush(FileHistory.java:90)
 at

 org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
 at

 org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
 at

 org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
 at

 org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)

 How can I investigate why the thread is blocked and that I
 must kill the
 process to restart it

 Regards,

 --
 Charles Moulliard
 Apache Committer & PMC / Architect @RedHat
 Twitter : @cmoulliard | Blog : 

Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Charles Moulliard
The root cause has been identified. Felix doesn't like very well that we
set System Properties within Activator

public void init() {
Properties props = new Properties();
props.setProperty("apiman.es.protocol", "http");
...
System.setProperties(props);

On Fri, Feb 5, 2016 at 10:23 AM, Jean-Baptiste Onofré 
wrote:

> The screenshot contains a heapdump, not a thread dump.
>
> I think the NPE is a consequence, so we have to find the cause.
>
> A thread dump should help to see locked or parked threads.
>
> Regards
> JB
>
> On 02/04/2016 10:49 PM, Charles Moulliard wrote:
>
>> Yes I can do that with jmap. Here is a screenshot -
>>
>> https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0
>>
>> On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré > > wrote:
>>
>> Can you take a thread dump ?
>>
>> Regards
>> JB
>>
>>
>> On 02/04/2016 09:00 PM, Charles Moulliard wrote:
>>
>> Hi,
>>
>> My Karaf 2.4.4 container stays blocked when it shutdowns and
>> reports
>> this error
>>
>> Exception in thread "Karaf Shell Console Thread"
>> java.lang.NullPointerException
>> at java.io.Writer.write(Writer.java:157)
>> at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
>> at java.io.PrintStream.newLine(PrintStream.java:544)
>> at java.io.PrintStream.println(PrintStream.java:824)
>> at jline.console.history.FileHistory.flush(FileHistory.java:90)
>> at
>>
>> org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
>> at
>>
>> org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
>> at
>> org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
>> at
>>
>> org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)
>>
>> How can I investigate why the thread is blocked and that I must
>> kill the
>> process to restart it
>>
>> Regards,
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org 
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Jean-Baptiste Onofré
Yes, I have something that I did for ActiveMQ WebConsole, leveraging 
etc/jetty.xml.


Regards
JB

On 02/05/2016 12:45 PM, Charles Moulliard wrote:

Hi,

Do we have an example where we map Security Constraint (web.xml)


   
 
   apiman-gateway-api
   /*
 
 
   apipublisher
 
   
   
 BASIC
 apiman
   
   
 apipublisher
   

to the Pax Web

WebContainer.registerConstraintMapping()

Regards,

--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io




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


Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Charles Moulliard
Hi,

Do we have an example where we map Security Constraint (web.xml)


  

  apiman-gateway-api
  /*


  apipublisher

  
  
BASIC
apiman
  
  
apipublisher
  

to the Pax Web

WebContainer.registerConstraintMapping()

Regards,

-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Karaf 4.0.2: Problem Eclipselink 2.6.0 with JPA 2.2.0?

2016-02-05 Thread jochenw
An update for Karaf 4.0.4:

Using JPA 1.0.4 with org.apache.aries.jpa.container leads to a problem with
finding the datasources:

org.apache.aries.jpa.container - 1.0.3 | No JNDI services for
jdbc/myXADataSource are available from persistence bundle
mypersistencebundle/0.1.2.SNAPSHOT. The persistence units [] will now be
unregistered.

Switching back to 1.0.2 in the enterprise feature XML solves that.


Using eclipselink 2.6.1 with org.apache.aries.jpa.eclipselink.adapter 2.3.0
leads to the the same problem as with the previous version:

java.lang.NoClassDefFoundError:
org/eclipse/persistence/internal/jpa/rs/metadata/model/Link

Switching back to 2.1.0 in the enterprise feature XML solves that.


Does it make sense to file a Jira for this, or is the JPA 1.x branch sort of
deprecated, and we should switch to 2.x anyways, switching to the annotation
way for defining persistence units?

Best Regards,

Jochen




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-0-2-Problem-Eclipselink-2-6-0-with-JPA-2-2-0-tp4043068p4045198.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4.0.2: Problem Eclipselink 2.6.0 with JPA 2.2.0?

2016-02-05 Thread Jean-Baptiste Onofré

Hi Jochen

thanks for the update. I think it makes sense to provide multiple 
feature version (stable) and document which one to use depending of the 
use case (annotation, blueprint, etc).


WDYT ?

Regards
JB

On 02/05/2016 12:19 PM, jochenw wrote:

An update for Karaf 4.0.4:

Using JPA 1.0.4 with org.apache.aries.jpa.container leads to a problem with
finding the datasources:

org.apache.aries.jpa.container - 1.0.3 | No JNDI services for
jdbc/myXADataSource are available from persistence bundle
mypersistencebundle/0.1.2.SNAPSHOT. The persistence units [] will now be
unregistered.

Switching back to 1.0.2 in the enterprise feature XML solves that.


Using eclipselink 2.6.1 with org.apache.aries.jpa.eclipselink.adapter 2.3.0
leads to the the same problem as with the previous version:

java.lang.NoClassDefFoundError:
org/eclipse/persistence/internal/jpa/rs/metadata/model/Link

Switching back to 2.1.0 in the enterprise feature XML solves that.


Does it make sense to file a Jira for this, or is the JPA 1.x branch sort of
deprecated, and we should switch to 2.x anyways, switching to the annotation
way for defining persistence units?

Best Regards,

Jochen




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-0-2-Problem-Eclipselink-2-6-0-with-JPA-2-2-0-tp4043068p4045198.html
Sent from the Karaf - User mailing list archive at Nabble.com.



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


Re: Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Achim Nierbeck
Yes of course the samples do contain such a sample and
of course there is an Integration test available for it :-)


2016-02-05 12:47 GMT+01:00 Jean-Baptiste Onofré :

> Yes, I have something that I did for ActiveMQ WebConsole, leveraging
> etc/jetty.xml.
>
> Regards
> JB
>
>
> On 02/05/2016 12:45 PM, Charles Moulliard wrote:
>
>> Hi,
>>
>> Do we have an example where we map Security Constraint (web.xml)
>>
>>
>>
>>  
>>apiman-gateway-api
>>/*
>>  
>>  
>>apipublisher
>>  
>>
>>
>>  BASIC
>>  apiman
>>
>>
>>  apipublisher
>>
>>
>> to the Pax Web
>>
>> WebContainer.registerConstraintMapping()
>>
>> Regards,
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

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


JPA and transaction issue in Karaf 4.0.4

2016-02-05 Thread Dutertry Nicolas
Hi,

I'm trying to migrate an application working with Karaf 3.0.5 to Karaf 4.0.4.
I ran into a problem with JPA and transaction management so I have created a 
small maven project showing it.
This sample is available on GitHub : 
https://github.com/nicolas-dutertry/test-jpa

The class TestServiceImpl in test-jpa-service has an EntityManager annoted with 
@PersistenceContext(unitname = "test")
The class DeleteManager also has an EntityManager annoted with 
@PersistenceContext(unitname = "test")

The method TestServiceImpl.delete is not transactional and it calls the 
transactional method DeleteManager.delete several times :

public class TestServiceImpl implements TestService {
@PersistenceContext(unitName = "test")
private EntityManager entityManager;

private DeleteManager deleteManager;

...

@Override
public void delete(String... names) {
for (String name : names) {
System.out.println("Deleting " + name);
deleteManager.delete(name);
}
}
}

public class DeleteManager {
@PersistenceContext(unitName = "test")
private EntityManager entityManager;

...

@Transactional
public void delete(String lastName) {
Query query = entityManager.createQuery(
"delete from Person where lastName = :lastName");

query.setParameter("lastName", lastName);
query.executeUpdate();
}
}

At runtime it raised a javax.persistence.TransactionRequiredException during 
the second call to DeleteManager.delete in the for loop.

To reproduce the problem, compile the sample project with maven:
> mvn clean install

Then, launch Karaf 4.0.4 and install the kar:
> kar:install mvn:com.dutertry.test.karaf.jpa/test-jpa-kar/1.0.0-SNAPSHOT/kar

Then, create new entries in database:
> person:create Smith 25
> person:create Green 23

Finally delete them:
> person:delete Smith Green

This will output :
Deleting Smith
Deleting Green
Error executing command: Executing an update/delete query

With the following log :
2016-02-05 14:52:32,753 | ERROR | nsole user karaf | ShellUtil  
  | 44 - org.apache.karaf.shell.core - 4.0.4 | Exception caught while 
executing command
javax.persistence.TransactionRequiredException: Executing an update/delete query
at 
org.hibernate.jpa.spi.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:71)
at 
com.dutertry.test.karaf.jpa.service.impl.DeleteManager.delete(DeleteManager.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)[:1.7.0_67]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_67]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_67]
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_67]
at 
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[21:org.apache.aries.proxy.impl:1.0.4]
at 
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[21:org.apache.aries.proxy.impl:1.0.4]
at 
com.dutertry.test.karaf.jpa.service.impl.$DeleteManager1431996488.delete(Unknown
 Source)[131:test-jpa-service:1.0.0.SNAPSHOT]
at 
com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.delete(TestServiceImpl.java:53)[131:test-jpa-service:1.0.0.SNAPSHOT]
at Proxy77c92452_69bd_43a7_b242_ba213735af8a.delete(Unknown 
Source)[:]
at 
com.dutertry.test.karaf.jpa.cmd.DeletePersonCommand.execute(DeletePersonCommand.java:30)[128:test-jpa-cmd:1.0.0.SNAPSHOT]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[44:org.apache.karaf.shell.core:4.0.4]
at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[44:org.apache.karaf.shell.core:4.0.4]
at 

Re: JPA and transaction issue in Karaf 4.0.4

2016-02-05 Thread Jean-Baptiste Onofré

Hi Nicolas,

thanks for the update and the detailed use case.

Let's take a look.

Regards
JB

On 02/05/2016 03:07 PM, Dutertry Nicolas wrote:

Hi,

I’m trying to migrate an application working with Karaf 3.0.5 to Karaf
4.0.4.

I ran into a problem with JPA and transaction management so I have
created a small maven project showing it.

This sample is available on GitHub :
https://github.com/nicolas-dutertry/test-jpa

The class TestServiceImpl in test-jpa-service has an EntityManager
annoted with @PersistenceContext(unitname = "test")

The class DeleteManager also has an EntityManager annoted with
@PersistenceContext(unitname = "test")

The method TestServiceImpl.delete is not transactional and it calls the
transactional method DeleteManager.delete several times :

public class TestServiceImpl implements TestService {

 @PersistenceContext(unitName = "test")

 private EntityManager entityManager;

 private DeleteManager deleteManager;

 …

 @Override

 public void delete(String... names) {

 for (String name : names) {

 System.out.println("Deleting " + name);

 deleteManager.delete(name);

 }

 }

}

public class DeleteManager {

 @PersistenceContext(unitName = "test")

 private EntityManager entityManager;

 …

 @Transactional

 public void delete(String lastName) {

 Query query = entityManager.createQuery(

 "delete from Person where lastName = :lastName");

 query.setParameter("lastName", lastName);

 query.executeUpdate();

 }

}

At runtime it raised a javax.persistence.TransactionRequiredException
during the second call to DeleteManager.delete in the for loop.

To reproduce the problem, compile the sample project with maven:


mvn clean install


Then, launch Karaf 4.0.4 and install the kar:


kar:install mvn:com.dutertry.test.karaf.jpa/test-jpa-kar/1.0.0-SNAPSHOT/kar


Then, create new entries in database:


person:create Smith 25



person:create Green 23


Finally delete them:


person:delete Smith Green


This will output :

Deleting Smith

Deleting Green

Error executing command: Executing an update/delete query

With the following log :

2016-02-05 14:52:32,753 | ERROR | nsole user karaf |
ShellUtil| 44 - org.apache.karaf.shell.core -
4.0.4 | Exception caught while executing command

javax.persistence.TransactionRequiredException: Executing an
update/delete query

 at
org.hibernate.jpa.spi.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:71)

 at
com.dutertry.test.karaf.jpa.service.impl.DeleteManager.delete(DeleteManager.java:33)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)[:1.7.0_67]

 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_67]

 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_67]

 at
java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_67]

 at
org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[21:org.apache.aries.proxy.impl:1.0.4]

 at
org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[21:org.apache.aries.proxy.impl:1.0.4]

 at
com.dutertry.test.karaf.jpa.service.impl.$DeleteManager1431996488.delete(Unknown
Source)[131:test-jpa-service:1.0.0.SNAPSHOT]

 at
com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.delete(TestServiceImpl.java:53)[131:test-jpa-service:1.0.0.SNAPSHOT]

 at
Proxy77c92452_69bd_43a7_b242_ba213735af8a.delete(Unknown Source)[:]

 at
com.dutertry.test.karaf.jpa.cmd.DeletePersonCommand.execute(DeletePersonCommand.java:30)[128:test-jpa-cmd:1.0.0.SNAPSHOT]

 at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[44:org.apache.karaf.shell.core:4.0.4]

 at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[44:org.apache.karaf.shell.core:4.0.4]

 at

Karaf 4.0.4: org.apache.aries.spifly.dynamic.bundle - where is it loaded

2016-02-05 Thread jochenw
Hello,

since Karaf 4.0.4, all bundles are checked for SPI-provider entries by
org.apache.aries.spifly.dynamic.bundle. Since I currently don't need this
(at least in my own bundles), I'd like to switch this off. However, I have
not found the place where the spifly bundle is loaded - in none of the
feature files.

Where can this be switched off? I should I better not do that since some
Karaf bundles depend on it?

Best Regards,

Jochen



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-0-4-org-apache-aries-spifly-dynamic-bundle-where-is-it-loaded-tp4045203.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Achim Nierbeck
ahh you're talking of non war security.
In that case you need to make sure you have your own httpContext which
handles the security for you.
It's in the OSGi spec how this is supposed to work.
We also have some samples for this.

regards, Achim


2016-02-05 14:08 GMT+01:00 Jean-Baptiste Onofré :

> Can't you use:
>
> Web-Connectors
> Web-VirtualHosts
>
> headers ?
>
> Regards
> JB
>
> On 02/05/2016 02:07 PM, Charles Moulliard wrote:
>
>> If I use WebContainer, is it possible to define within the start method
>> of the class implementing the BundleActivator,  the Web context Path of
>> the module/bundle that we will register within the HTTP Jetty Server ?
>>
>> On Fri, Feb 5, 2016 at 1:40 PM, Achim Nierbeck > > wrote:
>>
>> Yes of course the samples do contain such a sample and
>> of course there is an Integration test available for it :-)
>>
>>
>> 2016-02-05 12:47 GMT+01:00 Jean-Baptiste Onofré > >:
>>
>>
>> Yes, I have something that I did for ActiveMQ WebConsole,
>> leveraging etc/jetty.xml.
>>
>> Regards
>> JB
>>
>>
>> On 02/05/2016 12:45 PM, Charles Moulliard wrote:
>>
>> Hi,
>>
>> Do we have an example where we map Security Constraint
>> (web.xml)
>>
>>
>> 
>>   
>>
>>   apiman-gateway-api
>> /*
>>   
>>   
>> apipublisher
>>   
>> 
>> 
>>   BASIC
>>   apiman
>> 
>> 
>>   apipublisher
>> 
>>
>> to the Pax Web
>>
>> WebContainer.registerConstraintMapping()
>>
>> Regards,
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org 
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
>>
>> --
>>
>> 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
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

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: Karaf 4.0.4: org.apache.aries.spifly.dynamic.bundle - where is it loaded

2016-02-05 Thread Jean-Baptiste Onofré

Hi Jochen,

spifly is referenced by pax web feature (pax-jetty exactly), so I guess 
you installed one of the http features (jetty, http, war, webconsole, 
whatever). Correct ?


Regards
JB

On 02/05/2016 01:59 PM, jochenw wrote:

Hello,

since Karaf 4.0.4, all bundles are checked for SPI-provider entries by
org.apache.aries.spifly.dynamic.bundle. Since I currently don't need this
(at least in my own bundles), I'd like to switch this off. However, I have
not found the place where the spifly bundle is loaded - in none of the
feature files.

Where can this be switched off? I should I better not do that since some
Karaf bundles depend on it?

Best Regards,

Jochen



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-0-4-org-apache-aries-spifly-dynamic-bundle-where-is-it-loaded-tp4045203.html
Sent from the Karaf - User mailing list archive at Nabble.com.



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


Re: Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Charles Moulliard
If I use WebContainer, is it possible to define within the start method of
the class implementing the BundleActivator,  the Web context Path of the
module/bundle that we will register within the HTTP Jetty Server ?

On Fri, Feb 5, 2016 at 1:40 PM, Achim Nierbeck 
wrote:

> Yes of course the samples do contain such a sample and
> of course there is an Integration test available for it :-)
>
>
> 2016-02-05 12:47 GMT+01:00 Jean-Baptiste Onofré :
>
>> Yes, I have something that I did for ActiveMQ WebConsole, leveraging
>> etc/jetty.xml.
>>
>> Regards
>> JB
>>
>>
>> On 02/05/2016 12:45 PM, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> Do we have an example where we map Security Constraint (web.xml)
>>>
>>>
>>>
>>>  
>>>apiman-gateway-api
>>>/*
>>>  
>>>  
>>>apipublisher
>>>  
>>>
>>>
>>>  BASIC
>>>  apiman
>>>
>>>
>>>  apipublisher
>>>
>>>
>>> to the Pax Web
>>>
>>> WebContainer.registerConstraintMapping()
>>>
>>> Regards,
>>>
>>> --
>>> Charles Moulliard
>>> Apache Committer & PMC / Architect @RedHat
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>>> 
>>>
>>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>
>
>
> --
>
> 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
>
>


-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: Pax Web - Example of security conbstraint mapping

2016-02-05 Thread Jean-Baptiste Onofré

Can't you use:

Web-Connectors
Web-VirtualHosts

headers ?

Regards
JB

On 02/05/2016 02:07 PM, Charles Moulliard wrote:

If I use WebContainer, is it possible to define within the start method
of the class implementing the BundleActivator,  the Web context Path of
the module/bundle that we will register within the HTTP Jetty Server ?

On Fri, Feb 5, 2016 at 1:40 PM, Achim Nierbeck > wrote:

Yes of course the samples do contain such a sample and
of course there is an Integration test available for it :-)


2016-02-05 12:47 GMT+01:00 Jean-Baptiste Onofré >:

Yes, I have something that I did for ActiveMQ WebConsole,
leveraging etc/jetty.xml.

Regards
JB


On 02/05/2016 12:45 PM, Charles Moulliard wrote:

Hi,

Do we have an example where we map Security Constraint (web.xml)



  

  apiman-gateway-api
/*
  
  
apipublisher
  


  BASIC
  apiman


  apipublisher


to the Pax Web

WebContainer.registerConstraintMapping()

Regards,

--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io



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




--

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




--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io




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


Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Jean-Baptiste Onofré

The screenshot contains a heapdump, not a thread dump.

I think the NPE is a consequence, so we have to find the cause.

A thread dump should help to see locked or parked threads.

Regards
JB

On 02/04/2016 10:49 PM, Charles Moulliard wrote:

Yes I can do that with jmap. Here is a screenshot -
https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0

On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré > wrote:

Can you take a thread dump ?

Regards
JB


On 02/04/2016 09:00 PM, Charles Moulliard wrote:

Hi,

My Karaf 2.4.4 container stays blocked when it shutdowns and reports
this error

Exception in thread "Karaf Shell Console Thread"
java.lang.NullPointerException
at java.io.Writer.write(Writer.java:157)
at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
at java.io.PrintStream.newLine(PrintStream.java:544)
at java.io.PrintStream.println(PrintStream.java:824)
at jline.console.history.FileHistory.flush(FileHistory.java:90)
at

org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
at
org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
at
org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
at

org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)

How can I investigate why the thread is blocked and that I must
kill the
process to restart it

Regards,

--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io



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




--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io




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


Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Jean-Baptiste Onofré

Weird as it's what we do in Karaf ;)

On 02/05/2016 11:41 AM, Charles Moulliard wrote:

The root cause has been identified. Felix doesn't like very well that we
set System Properties within Activator

 public void init() {
 Properties props = new Properties();
 props.setProperty("apiman.es.protocol", "http");
 ...
 System.setProperties(props);

On Fri, Feb 5, 2016 at 10:23 AM, Jean-Baptiste Onofré > wrote:

The screenshot contains a heapdump, not a thread dump.

I think the NPE is a consequence, so we have to find the cause.

A thread dump should help to see locked or parked threads.

Regards
JB

On 02/04/2016 10:49 PM, Charles Moulliard wrote:

Yes I can do that with jmap. Here is a screenshot -

https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0

On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré

>> wrote:

 Can you take a thread dump ?

 Regards
 JB


 On 02/04/2016 09:00 PM, Charles Moulliard wrote:

 Hi,

 My Karaf 2.4.4 container stays blocked when it
shutdowns and reports
 this error

 Exception in thread "Karaf Shell Console Thread"
 java.lang.NullPointerException
 at java.io.Writer.write(Writer.java:157)
 at java.io.BufferedWriter.newLine(BufferedWriter.java:243)
 at java.io.PrintStream.newLine(PrintStream.java:544)
 at java.io.PrintStream.println(PrintStream.java:824)
 at
jline.console.history.FileHistory.flush(FileHistory.java:90)
 at


org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
 at

org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
 at

org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
 at


org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)

 How can I investigate why the thread is blocked and
that I must
 kill the
 process to restart it

 Regards,

 --
 Charles Moulliard
 Apache Committer & PMC / Architect @RedHat
 Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
 


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




--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io



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




--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io




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


Re: Karaf stays blocked when it shutdowns

2016-02-05 Thread Charles Moulliard
Code has been changed to use OSGI Config Admin and the problem is gone.

I'm very curious to know why such code (System.setProperties) can result in
a so huge issue



On Fri, Feb 5, 2016 at 11:46 AM, Jean-Baptiste Onofré 
wrote:

> Weird as it's what we do in Karaf ;)
>
> On 02/05/2016 11:41 AM, Charles Moulliard wrote:
>
>> The root cause has been identified. Felix doesn't like very well that we
>> set System Properties within Activator
>>
>>  public void init() {
>>  Properties props = new Properties();
>>  props.setProperty("apiman.es.protocol", "http");
>>  ...
>>  System.setProperties(props);
>>
>> On Fri, Feb 5, 2016 at 10:23 AM, Jean-Baptiste Onofré > > wrote:
>>
>> The screenshot contains a heapdump, not a thread dump.
>>
>> I think the NPE is a consequence, so we have to find the cause.
>>
>> A thread dump should help to see locked or parked threads.
>>
>> Regards
>> JB
>>
>> On 02/04/2016 10:49 PM, Charles Moulliard wrote:
>>
>> Yes I can do that with jmap. Here is a screenshot -
>>
>> https://www.dropbox.com/s/9nns0coyue9j6zt/Screenshot%202016-02-04%2022.48.56.png?dl=0
>>
>> On Thu, Feb 4, 2016 at 9:31 PM, Jean-Baptiste Onofré
>> 
>> >> wrote:
>>
>>  Can you take a thread dump ?
>>
>>  Regards
>>  JB
>>
>>
>>  On 02/04/2016 09:00 PM, Charles Moulliard wrote:
>>
>>  Hi,
>>
>>  My Karaf 2.4.4 container stays blocked when it
>> shutdowns and reports
>>  this error
>>
>>  Exception in thread "Karaf Shell Console Thread"
>>  java.lang.NullPointerException
>>  at java.io.Writer.write(Writer.java:157)
>>  at
>> java.io.BufferedWriter.newLine(BufferedWriter.java:243)
>>  at java.io.PrintStream.newLine(PrintStream.java:544)
>>  at java.io.PrintStream.println(PrintStream.java:824)
>>  at
>> jline.console.history.FileHistory.flush(FileHistory.java:90)
>>  at
>>
>>
>> org.apache.karaf.shell.console.jline.KarafFileHistory.flush(KarafFileHistory.java:65)
>>  at
>>
>>
>> org.apache.karaf.shell.console.jline.Console.close(Console.java:163)
>>  at
>>
>> org.apache.karaf.shell.console.jline.Console.run(Console.java:216)
>>  at
>>
>>
>> org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)
>>
>>  How can I investigate why the thread is blocked and
>> that I must
>>  kill the
>>  process to restart it
>>
>>  Regards,
>>
>>  --
>>  Charles Moulliard
>>  Apache Committer & PMC / Architect @RedHat
>>  Twitter : @cmoulliard | Blog :
>> http://cmoulliard.github.io
>>  
>>
>>
>>  --
>>  Jean-Baptiste Onofré
>> jbono...@apache.org 
>> >
>> http://blog.nanthrax.net
>>  Talend - http://www.talend.com
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
>> --
>> Jean-Baptiste Onofré
>> jbono...@apache.org 
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer & PMC / Architect @RedHat
>> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
>> 
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io