Karaf Cellar status

2022-08-31 Thread DUTERTRY Nicolas
Hi,

The current Cellar version (4.2.1) is quite old (2 years) and it has some 
incompatibilities with recent Karaf versions (4.3 or 4.4). I have opened a jira 
ticket on the issue : https://issues.apache.org/jira/browse/KARAF-7526

Do you know if a new release is planned ?

Regards.
--
Nicolas Dutertry



C2 - Usage restreint


RE: SSH session not properly closed by Karaf

2021-06-29 Thread DUTERTRY Nicolas
https://issues.apache.org/jira/browse/KARAF-7190

Thanks JB !
--
Nicolas Dutertry



C2 - Usage restreint
De : Jean-Baptiste Onofre 
Envoyé : mardi 29 juin 2021 10:17
À : user 
Objet : Re: SSH session not properly closed by Karaf

Oh, really. Then, I think I know the issue: it's probably the SSHD stream 
handler.

Can you please create a Jira about that ? I will fix that for 4.3.3/4.2.12.

Thanks !

Regards
JB

Le 29 juin 2021 à 10:14, DUTERTRY Nicolas 
mailto:nicolas.duter...@soprahr.com>> a écrit :

No, the issue is the same.

--
Nicolas Dutertry


C2 - Usage restreint
De : Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
Envoyé : mardi 29 juin 2021 09:53
À : user mailto:user@karaf.apache.org>>
Objet : Re: SSH session not properly closed by Karaf

Hi,

I guess the connexion is cleanly closed when you do:

$ bin/client
And then CTRL-D

Right ?

Regards
JB

Le 29 juin 2021 à 09:36, DUTERTRY Nicolas 
mailto:nicolas.duter...@soprahr.com>> a écrit :

Hi,

After using « client » script, the tcp socket is not closed by karaf (4.3.2) 
and remains in CLOSE_WAIT state. The session is only closed after ssh timeout 
is reached.

For instance with a SSH timeout set to 30 s :

$ ./client "bundle:list"

$ netstat | grep 8101
tcp6   0  0 localhost:8101  localhost:47844 CLOSE_WAIT

$ tail karaf.log
INFO  | sshd-SshServer[2f716f77](port=8101)-nio2-thread-1 | ServerSessionImpl   
 | 46 - org.apache.sshd.osgi - 2.5.1 | Session 
karaf@/127.0.0.1:47844<mailto:karaf@/127.0.0.1:47844> authenticated
INFO  | sshd-SshServer[2f716f77](port=8101)-timer-thread-1 | ServerSessionImpl  
  | 46 - org.apache.sshd.osgi - 2.5.1 | 
Disconnecting(ServerSessionImpl[karaf@/127.0.0.1:47844]): 
SSH2_DISCONNECT_PROTOCOL_ERROR - Detected IdleTimeout after 30415/3 ms.

Do you have a fix for this issue ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - 
http://www.soprahr.com/<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.soprahr.com%2F=04%7C01%7CNicolas.Dutertry%40soprahr.com%7C9e854f8f41d946def40c08d93ad64673%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C637605514297762233%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=BU%2FJ%2BAilM22esUc007gSQq2leVNf62zfanofYtOTyvc%3D=0>


C2 - Usage restreint



RE: SSH session not properly closed by Karaf

2021-06-29 Thread DUTERTRY Nicolas
No, the issue is the same.

--
Nicolas Dutertry



C2 - Usage restreint
De : Jean-Baptiste Onofre 
Envoyé : mardi 29 juin 2021 09:53
À : user 
Objet : Re: SSH session not properly closed by Karaf

Hi,

I guess the connexion is cleanly closed when you do:

$ bin/client
And then CTRL-D

Right ?

Regards
JB

Le 29 juin 2021 à 09:36, DUTERTRY Nicolas 
mailto:nicolas.duter...@soprahr.com>> a écrit :

Hi,

After using « client » script, the tcp socket is not closed by karaf (4.3.2) 
and remains in CLOSE_WAIT state. The session is only closed after ssh timeout 
is reached.

For instance with a SSH timeout set to 30 s :

$ ./client "bundle:list"

$ netstat | grep 8101
tcp6   0  0 localhost:8101  localhost:47844 CLOSE_WAIT

$ tail karaf.log
INFO  | sshd-SshServer[2f716f77](port=8101)-nio2-thread-1 | ServerSessionImpl   
 | 46 - org.apache.sshd.osgi - 2.5.1 | Session 
karaf@/127.0.0.1:47844<mailto:karaf@/127.0.0.1:47844> authenticated
INFO  | sshd-SshServer[2f716f77](port=8101)-timer-thread-1 | ServerSessionImpl  
  | 46 - org.apache.sshd.osgi - 2.5.1 | 
Disconnecting(ServerSessionImpl[karaf@/127.0.0.1:47844]): 
SSH2_DISCONNECT_PROTOCOL_ERROR - Detected IdleTimeout after 30415/3 ms.

Do you have a fix for this issue ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - 
http://www.soprahr.com/<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.soprahr.com%2F=04%7C01%7CNicolas.Dutertry%40soprahr.com%7C7713128dbc2a4140e2d908d93ad2e8fb%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C637605500396813837%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=TAwbcmU%2BBeC6i562OVXe3kyooDE5T9215gSfmR2g7r0%3D=0>


C2 - Usage restreint



SSH session not properly closed by Karaf

2021-06-29 Thread DUTERTRY Nicolas
Hi,

After using < client > script, the tcp socket is not closed by karaf (4.3.2) 
and remains in CLOSE_WAIT state. The session is only closed after ssh timeout 
is reached.

For instance with a SSH timeout set to 30 s :

$ ./client "bundle:list"

$ netstat | grep 8101
tcp6   0  0 localhost:8101  localhost:47844 CLOSE_WAIT

$ tail karaf.log
INFO  | sshd-SshServer[2f716f77](port=8101)-nio2-thread-1 | ServerSessionImpl   
 | 46 - org.apache.sshd.osgi - 2.5.1 | Session 
karaf@/127.0.0.1:47844 authenticated
INFO  | sshd-SshServer[2f716f77](port=8101)-timer-thread-1 | ServerSessionImpl  
  | 46 - org.apache.sshd.osgi - 2.5.1 | 
Disconnecting(ServerSessionImpl[karaf@/127.0.0.1:47844]): 
SSH2_DISCONNECT_PROTOCOL_ERROR - Detected IdleTimeout after 30415/3 ms.

Do you have a fix for this issue ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



C2 - Usage restreint


Bundle refresh when installing/uninstalling kar

2020-10-29 Thread DUTERTRY Nicolas
Hi,

When I install a new kar, Karaf refreshes bundles and it causes some issues for 
me because too many bundles are restarted.
There is an option in org.apache.karaf.kar.cfg to disable bundle refresh : 
noAutoRefreshBundles=true

It works fine, but unfortunately when I uninstall a kar, Karaf still refreshes 
bundles no matter what the option value is.
Is it possible to disable bundle refresh when uninstalling a kar ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



Interrupting Karaf command

2019-01-30 Thread DUTERTRY Nicolas
Hi,

I would like to write a command allowing the user to press Ctrl+C to interrupt 
the command.

For instance :
@Command(name = "loop", scope = "test", description = "Test loop")
@Service
public class LoopCommand implements Action {
private static final Logger LOGGER = 
LoggerFactory.getLogger(LoopCommand.class);

@Override
public Object execute() throws Exception {
int i = 0;
while(true) {
System.out.println(i);
LOGGER.info("LoopCommand {}", i);
Thread.sleep(1000L);
i++;
}
}
}

When I run this command inside karaf shell and press Ctrl+C, the command thread 
is interrupted and receives an InterruptedException. This is fine.

But when I run the command outside karaf shell with "client test:loop" it is 
not possible to interrupt the command. Ctrl+C has no effect and if I kill the 
client process, the command is still running inside karaf.

What is the right way to write a command that can be interrupted by the user ?

Regards,
--
Nicolas Dutertry



Karaf SSH invalid encoding

2018-11-08 Thread DUTERTRY Nicolas
Hi,

I'm using Karaf 4.2.1 on environments which doesn't have a UTF-8 encoding for 
instance Windows 10 or AIX with ISO-8859-1 encoding.
When I open a SSH session with the "client" script or with another SSH client, 
the non-ascii characters are not displayed correctly.
For instance the result of the "bundle:list" command prints "?" instead of "|" :

karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID ? State  ? Lvl ? Version ? Name
?
23 ? Active ?  80 ? 4.2.1   ? Apache Karaf :: OSGi Services :: Event

After some investigations I have found that the class 
org.apache.karaf.shell.ssh.SshTerminal has a hard coded UTF-8 value in its 
constructor :

public SshTerminal(Environment environment, InputStream input, OutputStream 
output) throws IOException {
 super("Karaf SSH terminal",
environment.getEnv().get(Environment.ENV_TERM),
input,
output,
StandardCharsets.UTF_8);

I have replaced StandardCharsets.UTF_8 with null and when running Karaf with 
this modification, I do not have the character issue anymore.

Do you think it is a valid correction ? I can open a jira ticket if you want.

Regards,
--
Nicolas Dutertry


RE: Error while sending email because of javax.activation

2018-10-25 Thread DUTERTRY Nicolas
I’ve created the jira ticket : https://issues.apache.org/jira/browse/KARAF-5989
--
Nicolas Dutertry

De : Freeman Fang 
Envoyé : jeudi 25 octobre 2018 14:58
À : user@karaf.apache.org
Objet : Re: Error while sending email because of javax.activation

Thanks for reporting this.

Could you please  create a jira ticket and I will take care of it.
-
Freeman(Yue) Fang

Red Hat, Inc.
FuseSource is now part of Red Hat



On Oct 25, 2018, at 8:20 PM, DUTERTRY Nicolas 
mailto:nicolas.duter...@soprahr.com>> wrote:

Hi,

It is not possible to send email in Karaf 4.2 with javax.mail API. When an 
email is sent, this exception is raised :

javax.mail.MessagingException: IOException while sending message;
  nested exception is:
 javax.activation.UnsupportedDataTypeException: no object DCH for MIME type 
multipart/mixed;

I’ve found that it is because the Activation Framework (javax.activation) is 
not OSGI compliant. In the previous Karaf version (4.1) a servicemix 
implementation of the Activation Framework was included but it is not the case 
anymore.

The solution to have a working Activation Framework is to remove 
javax.activation references in jre.properties and to install the bundle 
org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0.

For the future Karaf 4.2.2 can you please :
-  Remove javax.activation from jre.properties
-  Remove activation-1.1.1.jar from directory lib/boot
-  Let the user install 
org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0
 if needed

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



Error while sending email because of javax.activation

2018-10-25 Thread DUTERTRY Nicolas
Hi,

It is not possible to send email in Karaf 4.2 with javax.mail API. When an 
email is sent, this exception is raised :

javax.mail.MessagingException: IOException while sending message;
  nested exception is:
 javax.activation.UnsupportedDataTypeException: no object DCH for MIME type 
multipart/mixed;

I've found that it is because the Activation Framework (javax.activation) is 
not OSGI compliant. In the previous Karaf version (4.1) a servicemix 
implementation of the Activation Framework was included but it is not the case 
anymore.

The solution to have a working Activation Framework is to remove 
javax.activation references in jre.properties and to install the bundle 
org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0.

For the future Karaf 4.2.2 can you please :

-  Remove javax.activation from jre.properties

-  Remove activation-1.1.1.jar from directory lib/boot

-  Let the user install 
org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0
 if needed

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/


RE: Karaf 4.2.1: cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

2018-09-12 Thread DUTERTRY Nicolas
Hi,

I’ve tried to remove jaxb-impl from etc/startup.properties, but the issue is 
still there.

The command “package:exports |grep com.sun.xml.bind” doesn’t return anything.

At the moment the only solution for me is to remove the jaxb-*.jar from 
lib/boot. What are the risks of not having them ?

--
Nicolas Dutertry

De : Freeman Fang [mailto:freeman.f...@gmail.com]
Envoyé : mercredi 12 septembre 2018 09:32
À : user@karaf.apache.org
Objet : Re: Karaf 4.2.1: cannot be cast to 
com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

Hi Stephan,

We need it in lib/boot but I think we can remove jab-impl from 
etc/startup.properties.

Running more tests...
-
Freeman(Yue) Fang

Red Hat, Inc.
FuseSource is now part of Red Hat



On Sep 12, 2018, at 3:13 PM, Siano, Stephan 
mailto:stephan.si...@sap.com>> wrote:

Hi,

I have seen that issue twice (with Java 8). A restart of the VM usually fixed 
this in my case.

I have browsed through the internet about this issue and it seems that this may 
happen if two JAXB implementations are in the classpath (there is also one 
included in the JVM, so removing the third one from CXF might not resolve the 
issue).

I have tried setting the system property 
"com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" to "true" but I don't 
know whether this helps because the issue appears in my setup only very 
sporadically.

IMO it might also be worth a try to remove the JAXB bundles from the lib/boot 
directory before starting karaf. Having JAXB in the JDK and the boot classpath 
might also cause issues.

Best regards
Stephan


From: Freeman Fang mailto:freeman.f...@gmail.com>>
Sent: Mittwoch, 12. September 2018 09:08
To: user@karaf.apache.org
Subject: Re: Karaf 4.2.1: cannot be cast to 
com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

Hello,

This ClassCastException normally means you have two jaxb-impl bundles(with 
different version) installed in the Karaf container.

Could you please double check it?

You can use Karaf command
package:exports |grep com.sun.xml.bind



And paste what the output you get here



Thanks!
-
Freeman(Yue) Fang

Red Hat, Inc.
FuseSource is now part of Red Hat



On Sep 10, 2018, at 10:26 PM, Lukasz Lech 
mailto:l.l...@ringler.ch>> wrote:

Hello,

After finding out that Karaf 4.2.1 includes Eclipselink version with PostgreSQL 
Bug Fix (https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408) I’ve tested it 
with my code.

But another library has backfired, and I feel helpless about finding out what 
is going on.

I’m using JAXB to deserialize XML. I have 2 bundles, which have effectively the 
same code for deserializing XML from the same schema (some configuration data). 
In one of the bundles, everything works fine, in another one I get the 
exception:

JAXBContext.newInstance(targetClass):

Caused by: java.lang.ClassCastException: com.example.MyType$JaxbAccessorF_value 
cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
at 
com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:271)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.(TransducedAccessor.java:220)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:160)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.calcTransducer(RuntimeClassInfoImpl.java:230)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.getTransducer(RuntimeClassInfoImpl.java:204)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.link(RuntimeClassInfoImpl.java:181)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.link(ModelBuilder.java:439)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.link(RuntimeModelBuilder.java:118)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:443)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:277)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:124)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
 ~[?:?]
at 
com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
 ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:?]
  

RE: Karaf 4.2.1: cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

2018-09-11 Thread DUTERTRY Nicolas
Hi,

I have run into the same issue with Karaf 4.2.1. It seems to me that the issue 
comes from cxf feature which contains 2 JAXB  bundles :
- 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.11_1
- 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/2.2.11_1

When I remove those JAXB bundles everything works fine. This is annoying 
because I need both cxf and jaxb.

--
Nicolas Dutertry

-Message d'origine-
De : lechlukasz [mailto:l.l...@ringler.ch] 
Envoyé : lundi 10 septembre 2018 17:06
À : user@karaf.apache.org
Objet : Re: Karaf 4.2.1: cannot be cast to 
com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

I'm using Oracle JDK 8 (Windows).

Those the imports that I make in one bundle which has this issue:

org.apache.commons.csv,version=1.5.0 from org.apache.commons.csv (197)
org.apache.commons.io,version=1.4. from org.apache.commons.io (201)
org.apache.commons.io,version=2.4.0 from org.apache.commons.io (201)
org.apache.commons.lang,version=2.6.0 from org.apache.commons.lang (202)
org.apache.commons.lang.time,version=2.6.0 from org.apache.commons.lang
(202)
org.apache.http,version=4.4.6 from org.apache.httpcomponents.httpcore (38)
org.apache.http.auth,version=4.5.3 from org.apache.httpcomponents.httpclient
(37)
org.apache.http.client,version=4.5.3 from
org.apache.httpcomponents.httpclient (37)
org.apache.http.client.methods,version=4.5.3 from
org.apache.httpcomponents.httpclient (37)
org.apache.http.entity,version=4.4.6 from org.apache.httpcomponents.httpcore
(38)
org.apache.http.impl.client,version=4.5.3 from
org.apache.httpcomponents.httpclient (37)
org.osgi.service.blueprint,version=1.0.0 from
org.apache.aries.blueprint.core (21)
org.slf4j,version=1.7.25 from org.ops4j.pax.logging.pax-logging-api (6)
org.slf4j,version=1.6.6 from org.ops4j.pax.logging.pax-logging-api (6)
org.slf4j,version=1.5.11 from org.ops4j.pax.logging.pax-logging-api (6)
org.slf4j,version=1.4.3 from org.ops4j.pax.logging.pax-logging-api (6)

There's nothing explicitely about jaxb there...



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


RE: Unresolved dependency using blueprint transaction

2018-06-07 Thread DUTERTRY Nicolas
Hi,

I have also run into this issue. I think there is a bug in Karaf 4.2.0 related 
to blueprint namespace loading.
It does not happen all the time, but when it is the case, the solution is to 
manually restart bundle org.apache.aries.transaction.blueprint-2.1.0.

Regards,
--
Nicolas Dutertry

-Message d'origine-
De : ceugster [mailto:christian.eugs...@gmx.net] 
Envoyé : mercredi 6 juin 2018 21:32
À : user@karaf.apache.org
Objet : Re: Unresolved dependency using blueprint transaction

Hi JB
because I was not sure if I did feature:install of aries-blueprint and
transaction in the right order, I installed a clean version of karaf-4.2 and
then

feature:install aries-blueprint
feature:install transactions
feature:install eclipselink
feature:install my bundles

then a bundle:diag showed following:

karaf@root()> bundle:diag 75
Herakles Jpa Persistence Bundle (75)

Status: GracePeriod
Blueprint
06.06.18, 21:26
Missing dependencies: 
(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://aries.apache.org/xmlns/transactions/v2.0.0))
(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://aries.apache.org/xmlns/jpa/v2.0.0))
 

it seems even worse than before!? Do you have an idea, what could be the
solution to this?

Thank you!
Christian



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


RE: Blueprint/JPA : Need active coordination error

2018-06-05 Thread DUTERTRY Nicolas
Hi,

The issue ARIES-1793 has been closed in Aries and the correction is available 
in org.apache.aries.blueprint.core-1.10.0.

Is it possible to include the new blueprint core version in the next Karaf 
4.2.1 ?

Regards, 
--
Nicolas Dutertry

-Message d'origine-
De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Envoyé : lundi 14 mai 2018 11:12
À : user@karaf.apache.org
Objet : Re: Blueprint/JPA : Need active coordination error

Ooops, I forgot this one :/

Sorry about that. I'm adding to my daily TODO.

Regards
JB

On 05/14/2018 11:02 AM, DUTERTRY Nicolas wrote:
> Hi JB,
> 
>  
> 
> Do you have any update on that issue ?
> 
>  
> 
> Regards,
> 
> --
> 
> Nicolas Dutertry
> 
>  
> 
> *De :*Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> *Envoyé :* lundi 23 avril 2018 13:29
> *À :* user@karaf.apache.org
> *Cc :* user@karaf.apache.org
> *Objet :* RE: Blueprint/JPA : Need active coordination error
> 
>  
> 
> Thanks.
> 
> I'm still in vacation for a couple of days. I will take a look end of this 
> week
> when back.
> 
> Regards
> 
> JB
> 
> Le 23 avr. 2018, à 15:16, DUTERTRY Nicolas  <mailto:nicolas.duter...@soprahr.com>> a écrit:
> 
> Hi,
> 
> I have opened an issue in aries jira : 
> https://issues.apache.org/jira/browse/ARIES-1793
> 
> Regards,
> --
> Nicolas Dutertry
> 
> -Message d'origine-
> De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
> Envoyé : jeudi 12 avril 2018 14:38
> À : user@karaf.apache.org
> Objet : Re: Blueprint/JPA : Need active coordination error
> 
> Thanks I will take a look asap (I'm in vacation now ;)).
> 
> Regards
> JB
> 
> On 04/12/2018 02:03 PM, DUTERTRY Nicolas wrote:
> 
>  Here is full stack trace :
>  
>  java.lang.IllegalStateException: Need active coordination
>   at org.apache.aries.jpa.support 
> <http://org.apache.aries.jpa.support>.impl.EMSupplierImpl.get(EMSupplierImpl.java:81)
>  ~[?:?]
>   at org.apache.aries.jpa.support 
> <http://org.apache.aries.jpa.support>.osgi.impl.EmProxy.invoke(EmProxy.java:38)
>  ~[?:?]
>   at com.sun.proxy.$Proxy77.createQuery(Unknown Source) ~[?:?]
>   at Proxy4c2993b8_dc6f_46b4_8e62_524dc0ad05f5.createQuery(Unknown Source) 
> ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.service.impl.TestRepository.list(TestRepository.java:26)
>  ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(TestServiceImpl.java:25)
>  ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(ListPersonCommand.java:24)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>  ~[?:?]
>   at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) ~[?:?]
>   at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) 
> ~[?:?]
>   at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  ~[?:?]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  ~[?:?]
>   at java.lang.Thread.run(Thread.java:748) [?:?]
>  
>  --
>  Nicolas Dutertry
>  
>  
>  -Message d'origine-
>  De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
>  Envoyé : jeudi 12 avril 2018 13:51
>  À : user@karaf.apache.org
>  Objet : Re: Blueprint/JPA : Need active coordination error
>  
>  Hi Nicolas,
>  
>  I'm surprised it's not a proxy: it should be a Aries Proxy.
>  
>  Where the ISE is coming from ?
>  
>  Regards
>  JB
>  
>  On 04/12/2018 01:47 PM, DUTERTRY Nicolas wrote:
> 
>  Hi,
> 
>   
> 
>  Yesterday I ran into an error with the new Karaf 4.2.0. This error 
>  seems to be related to blueprint 1.9.0 (the error does not occur in Karaf 
> 4.1.5).
> 
>   
> 
>  I have committed a project on Github to illustrate the issue :
>  https://github.com/nicolas-dutertry/test-jpa
> 
>   
> 
>  This project contains a blueprint bundle with a bean TestRepository 
>  annotated with @PersistenceContext. This bean is then injected into 
>  another bean TestService

RE: Blueprint/JPA : Need active coordination error

2018-05-14 Thread DUTERTRY Nicolas
Hi JB,

Do you have any update on that issue ?

Regards,
--
Nicolas Dutertry

De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Envoyé : lundi 23 avril 2018 13:29
À : user@karaf.apache.org
Cc : user@karaf.apache.org
Objet : RE: Blueprint/JPA : Need active coordination error

Thanks.
I'm still in vacation for a couple of days. I will take a look end of this week 
when back.
Regards
JB
Le 23 avr. 2018, à 15:16, DUTERTRY Nicolas 
<nicolas.duter...@soprahr.com<mailto:nicolas.duter...@soprahr.com>> a écrit:

Hi,

I have opened an issue in aries jira : 
https://issues.apache.org/jira/browse/ARIES-1793

Regards,
--
Nicolas Dutertry

-Message d'origine-
De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
Envoyé : jeudi 12 avril 2018 14:38
À : user@karaf.apache.org
Objet : Re: Blueprint/JPA : Need active coordination error

Thanks I will take a look asap (I'm in vacation now ;)).

Regards
JB

On 04/12/2018 02:03 PM, DUTERTRY Nicolas wrote:

 Here is full stack trace :

 java.lang.IllegalStateException: Need active coordination
  at 
org.apache.aries.jpa.support<http://org.apache.aries.jpa.support>.impl.EMSupplierImpl.get(EMSupplierImpl.java:81)
 ~[?:?]
  at 
org.apache.aries.jpa.support<http://org.apache.aries.jpa.support>.osgi.impl.EmProxy.invoke(EmProxy.java:38)
 ~[?:?]
  at com.sun.proxy.$Proxy77.createQuery(Unknown Source) ~[?:?]
  at Proxy4c2993b8_dc6f_46b4_8e62_524dc0ad05f5.createQuery(Unknown Source) 
~[?:?]
  at 
com.dutertry.test.karaf.jpa.service.impl.TestRepository.list(TestRepository.java:26)
 ~[?:?]
  at 
com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(TestServiceImpl.java:25)
 ~[?:?]
  at 
com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(ListPersonCommand.java:24)
 ~[?:?]
  at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
 ~[?:?]
  at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
 ~[?:?]
  at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
 ~[?:?]
  at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) ~[?:?]
  at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) 
~[?:?]
  at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) ~[?:?]
  at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) ~[?:?]
  at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
  at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
  at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:?]
  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:?]
  at java.lang.Thread.run(Thread.java:748) [?:?]

 --
 Nicolas Dutertry


 -Message d'origine-
 De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
 Envoyé : jeudi 12 avril 2018 13:51
 À : user@karaf.apache.org
 Objet : Re: Blueprint/JPA : Need active coordination error

 Hi Nicolas,

 I'm surprised it's not a proxy: it should be a Aries Proxy.

 Where the ISE is coming from ?

 Regards
 JB

 On 04/12/2018 01:47 PM, DUTERTRY Nicolas wrote:

 Hi,



 Yesterday I ran into an error with the new Karaf 4.2.0. This error
 seems to be related to blueprint 1.9.0 (the error does not occur in Karaf 
4.1.5).



 I have committed a project on Github to illustrate the issue :
 https://github.com/nicolas-dutertry/test-jpa



 This project contains a blueprint bundle with a bean TestRepository
 annotated with @PersistenceContext. This bean is then injected into
 another bean TestServiceImpl which is then published as an osgi service :



 

 



 

 



 

 

 



 



 With Karaf 4.1.5 the instance of TestRepository injected in
 testService is a proxy managing JPA stuff, but with Karaf 4.2.0 the
 injected instance is not a proxy. Thus when using testService, the following 
error occurs :

 java.lang.IllegalStateException: Need active coordination



 Do you think it is a blueprint bug or is it forbidden to inject a jpa
 bean into another bean in the same blueprint context ?



 Regards,

 --

 Nicolas Dutertry

 Sopra HR Software - http://www.soprahr.com/




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



RE: Blueprint/JPA : Need active coordination error

2018-04-23 Thread DUTERTRY Nicolas
Hi,

I have opened an issue in aries jira : 
https://issues.apache.org/jira/browse/ARIES-1793

Regards,
--
Nicolas Dutertry

-Message d'origine-
De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Envoyé : jeudi 12 avril 2018 14:38
À : user@karaf.apache.org
Objet : Re: Blueprint/JPA : Need active coordination error

Thanks I will take a look asap (I'm in vacation now ;)).

Regards
JB

On 04/12/2018 02:03 PM, DUTERTRY Nicolas wrote:
> Here is full stack trace :
> 
> java.lang.IllegalStateException: Need active coordination
>   at 
> org.apache.aries.jpa.support.impl.EMSupplierImpl.get(EMSupplierImpl.java:81) 
> ~[?:?]
>   at 
> org.apache.aries.jpa.support.osgi.impl.EmProxy.invoke(EmProxy.java:38) ~[?:?]
>   at com.sun.proxy.$Proxy77.createQuery(Unknown Source) ~[?:?]
>   at Proxy4c2993b8_dc6f_46b4_8e62_524dc0ad05f5.createQuery(Unknown 
> Source) ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.service.impl.TestRepository.list(TestRepository.java:26)
>  ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(TestServiceImpl.java:25)
>  ~[?:?]
>   at 
> com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(ListPersonCommand.java:24)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>  ~[?:?]
>   at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>  ~[?:?]
>   at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) 
> ~[?:?]
>   at 
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) 
> ~[?:?]
>   at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) 
> ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
>   at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  ~[?:?]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  ~[?:?]
>   at java.lang.Thread.run(Thread.java:748) [?:?]
> 
> --
> Nicolas Dutertry
> 
> 
> -Message d'origine-
> De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
> Envoyé : jeudi 12 avril 2018 13:51
> À : user@karaf.apache.org
> Objet : Re: Blueprint/JPA : Need active coordination error
> 
> Hi Nicolas,
> 
> I'm surprised it's not a proxy: it should be a Aries Proxy.
> 
> Where the ISE is coming from ?
> 
> Regards
> JB
> 
> On 04/12/2018 01:47 PM, DUTERTRY Nicolas wrote:
>> Hi,
>>
>>  
>>
>> Yesterday I ran into an error with the new Karaf 4.2.0. This error 
>> seems to be related to blueprint 1.9.0 (the error does not occur in Karaf 
>> 4.1.5).
>>
>>  
>>
>> I have committed a project on Github to illustrate the issue :
>> https://github.com/nicolas-dutertry/test-jpa
>>
>>  
>>
>> This project contains a blueprint bundle with a bean TestRepository 
>> annotated with @PersistenceContext. This bean is then injected into 
>> another bean TestServiceImpl which is then published as an osgi service :
>>
>>    
>>
>> 
>>
>>     
>>
>>    
>>
>> 
>>
>>     > class="com.dutertry.test.karaf.jpa.service.impl.TestRepository"/>
>>
>>    
>>
>> > class="com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl">
>>
>>     
>>
>>     
>>
>>    
>>
>> > ref="testService"/>
>>
>>  
>>
>> With Karaf 4.1.5 the instance of TestRepository injected in 
>> testService is a proxy managing JPA stuff, but with Karaf 4.2.0 the 
>> injected instance is not a proxy. Thus when using testService, the following 
>> error occurs :
>>
>> java.lang.IllegalStateException: Need active coordination
>>
>>  
>>
>> Do you think it is a blueprint bug or is it forbidden to inject a jpa 
>> bean into another bean in the same blueprint context ?
>>
>>  
>>
>> Regards,
>>
>> --
>>
>> Nicolas Dutertry
>>
>> Sopra HR Software - http://www.soprahr.com/
>>
>>  
>>
> 
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 

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


RE: Blueprint/JPA : Need active coordination error

2018-04-12 Thread DUTERTRY Nicolas
Here is full stack trace :

java.lang.IllegalStateException: Need active coordination
at 
org.apache.aries.jpa.support.impl.EMSupplierImpl.get(EMSupplierImpl.java:81) 
~[?:?]
at 
org.apache.aries.jpa.support.osgi.impl.EmProxy.invoke(EmProxy.java:38) ~[?:?]
at com.sun.proxy.$Proxy77.createQuery(Unknown Source) ~[?:?]
at Proxy4c2993b8_dc6f_46b4_8e62_524dc0ad05f5.createQuery(Unknown 
Source) ~[?:?]
at 
com.dutertry.test.karaf.jpa.service.impl.TestRepository.list(TestRepository.java:26)
 ~[?:?]
at 
com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl.list(TestServiceImpl.java:25)
 ~[?:?]
at 
com.dutertry.test.karaf.jpa.cmd.ListPersonCommand.execute(ListPersonCommand.java:24)
 ~[?:?]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
 ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) 
~[?:?]
at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) ~[?:?]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) 
~[?:?]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
~[?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

--
Nicolas Dutertry


-Message d'origine-
De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Envoyé : jeudi 12 avril 2018 13:51
À : user@karaf.apache.org
Objet : Re: Blueprint/JPA : Need active coordination error

Hi Nicolas,

I'm surprised it's not a proxy: it should be a Aries Proxy.

Where the ISE is coming from ?

Regards
JB

On 04/12/2018 01:47 PM, DUTERTRY Nicolas wrote:
> Hi,
> 
>  
> 
> Yesterday I ran into an error with the new Karaf 4.2.0. This error 
> seems to be related to blueprint 1.9.0 (the error does not occur in Karaf 
> 4.1.5).
> 
>  
> 
> I have committed a project on Github to illustrate the issue :
> https://github.com/nicolas-dutertry/test-jpa
> 
>  
> 
> This project contains a blueprint bundle with a bean TestRepository 
> annotated with @PersistenceContext. This bean is then injected into 
> another bean TestServiceImpl which is then published as an osgi service :
> 
>    
> 
> 
> 
>     
> 
>    
> 
> 
> 
>      class="com.dutertry.test.karaf.jpa.service.impl.TestRepository"/>
> 
>    
> 
>  class="com.dutertry.test.karaf.jpa.service.impl.TestServiceImpl">
> 
>     
> 
>     
> 
>    
> 
>  ref="testService"/>
> 
>  
> 
> With Karaf 4.1.5 the instance of TestRepository injected in 
> testService is a proxy managing JPA stuff, but with Karaf 4.2.0 the 
> injected instance is not a proxy. Thus when using testService, the following 
> error occurs :
> 
> java.lang.IllegalStateException: Need active coordination
> 
>  
> 
> Do you think it is a blueprint bug or is it forbidden to inject a jpa 
> bean into another bean in the same blueprint context ?
> 
>  
> 
> Regards,
> 
> --
> 
> Nicolas Dutertry
> 
> Sopra HR Software - http://www.soprahr.com/
> 
>  
> 

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


Blueprint/JPA : Need active coordination error

2018-04-12 Thread DUTERTRY Nicolas
Hi,

Yesterday I ran into an error with the new Karaf 4.2.0. This error seems to be 
related to blueprint 1.9.0 (the error does not occur in Karaf 4.1.5).

I have committed a project on Github to illustrate the issue : 
https://github.com/nicolas-dutertry/test-jpa

This project contains a blueprint bundle with a bean TestRepository annotated 
with @PersistenceContext. This bean is then injected into another bean 
TestServiceImpl which is then published as an osgi service :













With Karaf 4.1.5 the instance of TestRepository injected in testService is a 
proxy managing JPA stuff, but with Karaf 4.2.0 the injected instance is not a 
proxy. Thus when using testService, the following error occurs :
java.lang.IllegalStateException: Need active coordination

Do you think it is a blueprint bug or is it forbidden to inject a jpa bean into 
another bean in the same blueprint context ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



Spring security feature

2018-04-11 Thread DUTERTRY Nicolas
Hi,

A spring-security feature was available in Karaf version 3, but it is not the 
case anymore in Karaf 4.1 or 4.2.

Do you know if there is a good reason for that ? Is it possible to add it in 
future Karaf 4.2.1 ?

Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



RE: client.bat does not work in Karaf 4.1.5

2018-03-05 Thread DUTERTRY Nicolas
When running client.bat with option "-l 4", I can see the following error :

5554 
[sshd-ClientInputStreamPump[ChannelShell[id=0,-recipient=0]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]]-thread-1]
 DEBUG org.apache.sshd.client.channel.ChannelShell - 
pumpInputStream([ChannelShell[id=0, 
recipient=0]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101], 
ArrayIndexOutOfBoundsException, 4]) Caught null : {}
5554 
[sshd-ClientInputStreamPump[ChannelShell[id=0,-recipient=0]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]]-thread-1]
 TRACE org.apache.sshd.client.channel.ChannelShell - 
pumpInputStream(ChannelShell[id=0, 
recipient=0]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]) caught 
exception details
java.lang.ArrayIndexOutOfBoundsException: 4
at 
org.jline.utils.NonBlocking$NonBlockingReaderInputStream.read(NonBlocking.java:116)
at 
org.jline.utils.NonBlockingInputStream.read(NonBlockingInputStream.java:28)
at 
org.jline.utils.NonBlockingInputStream.read(NonBlockingInputStream.java:63)
at java.io.FilterInputStream.read(FilterInputStream.java:133)
at 
org.apache.sshd.client.channel.ChannelSession.securedRead(ChannelSession.java:206)
at 
org.apache.sshd.client.channel.ChannelSession.pumpInputStream(ChannelSession.java:166)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

--
Nicolas Dutertry


-Message d'origine-
De : t...@quarendon.net [mailto:t...@quarendon.net] 
Envoyé : lundi 5 mars 2018 15:26
À : user@karaf.apache.org
Objet : Re: client.bat does not work in Karaf 4.1.5

There was an incompatibility I believe in 4.1.3, where a dependency introduced 
a breaking change in a point release that was picked up by karaf. 4.1.5 has 
similar problems, though I don't know what the exact cause is there yet. We 
jumped to 4.1.5 and then back down to 4.1.4 as that one worked. In 4.1.3/4.1.5, 
external SSH clients work, just not client.bat.
Vanilla 4.1.5 download, start karaf.bat, start client.bat, can't login. 

> On 05 March 2018 at 13:54 t...@quarendon.net wrote:
> 
> 
> We've seen the same thing. 4.1.3 had a problem, 4.1.5 has a different 
> problem, 4.1.4 is the sweetspot at the moment. I can't recall the details, 
> I'll dig them out.
> 
> > On 05 March 2018 at 13:02 Jean-Baptiste Onofré <j...@nanthrax.net> wrote:
> > 
> > 
> > Hi Nicolas,
> > 
> > the big issue is just Windows ;)
> > 
> > Without kidding, it seems that the ParsedLine line is null in the Console 
> > reader.
> > 
> > It could be related to your terminal. What's your Windows version ?
> > 
> > Can you try to cleanup etc/shell.init.script (especially around the 
> > color
> > settings) ?
> > Does it work with Karaf 4.1.4 ?
> > 
> > Thanks !
> > Regards
> > JB
> > 
> > On 03/05/2018 01:56 PM, DUTERTRY Nicolas wrote:
> > > Hi,
> > > 
> > >  
> > > 
> > > I have just downloaded Karaf 4.1.5 and it seems that, under 
> > > Windows, it is not possible to obtain an interactive SSH session anymore 
> > > with the script “client.bat”.
> > > 
> > > The login is successful but when I press any key the SSH session ends.
> > > 
> > > I have this error in logs :
> > > 
> > >  
> > > 
> > > 2018-03-05T13:35:39,496 | ERROR | Karaf ssh console user karaf |
> > > ShellUtil| 43 - org.apache.karaf.shell.core - 
> > > 4.1.5 |
> > > Exception caught while executing command
> > > 
> > > java.lang.NullPointerException: null
> > > 
> > >   at
> > > org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(Console
> > > SessionImpl.java:348) [43:org.apache.karaf.shell.core:4.1.5]
> > > 
> > >   at java.lang.Thread.run(Thread.java:748) [?:?]
> > > 
> > > 2018-03-05T13:35:40,011 | WARN  | sshd-SshServer[50ae478a]-nio2-thread-3 |
> > > ServerSessionImpl| 48 - org.apache.sshd.core - 1.6.0 |
> > > exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:65321])[state=O
> > > pened]
> > > IOException: The specified network name is no longer available.
> > > 
> > >  
> > > 
> > > Do you have any idea what the issue is ?
> > > 
> > > Regards,
> > > 
> > > --
> > > 
> > > Nicolas Dutertry
> > > 
> > > Sopra HR Software - http://www.soprahr.com/
> > > 
> > >  
> > > 
> > 
> > --
> > Jean-Baptiste Onofré
> > jbono...@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com


RE: client.bat does not work in Karaf 4.1.5

2018-03-05 Thread DUTERTRY Nicolas
I use Windows 7 (sorry ;-)).

I've tried to cleanup shell.init.script, but it does not work.

It works fine with Karaf 4.1.4. 
It also works fine when starting Karaf 4.1.5 and using Putty to get a SSH 
session. The issue is really in client.bat.

Regards,
--
Nicolas Dutertry

-Message d'origine-
De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Envoyé : lundi 5 mars 2018 14:02
À : user@karaf.apache.org
Objet : Re: client.bat does not work in Karaf 4.1.5

Hi Nicolas,

the big issue is just Windows ;)

Without kidding, it seems that the ParsedLine line is null in the Console 
reader.

It could be related to your terminal. What's your Windows version ?

Can you try to cleanup etc/shell.init.script (especially around the color
settings) ?
Does it work with Karaf 4.1.4 ?

Thanks !
Regards
JB

On 03/05/2018 01:56 PM, DUTERTRY Nicolas wrote:
> Hi,
> 
>  
> 
> I have just downloaded Karaf 4.1.5 and it seems that, under Windows, 
> it is not possible to obtain an interactive SSH session anymore with the 
> script "client.bat".
> 
> The login is successful but when I press any key the SSH session ends.
> 
> I have this error in logs :
> 
>  
> 
> 2018-03-05T13:35:39,496 | ERROR | Karaf ssh console user karaf | 
> ShellUtil    | 43 - org.apache.karaf.shell.core - 
> 4.1.5 | Exception caught while executing command
> 
> java.lang.NullPointerException: null
> 
>   at
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSess
> ionImpl.java:348) [43:org.apache.karaf.shell.core:4.1.5]
> 
>   at java.lang.Thread.run(Thread.java:748) [?:?]
> 
> 2018-03-05T13:35:40,011 | WARN  | 
> sshd-SshServer[50ae478a]-nio2-thread-3 | ServerSessionImpl    
> | 48 - org.apache.sshd.core - 1.6.0 | 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:65321])[state=Opene
> d]
> IOException: The specified network name is no longer available.
> 
>  
> 
> Do you have any idea what the issue is ?
> 
> Regards,
> 
> --
> 
> Nicolas Dutertry
> 
> Sopra HR Software - http://www.soprahr.com/
> 
>  
> 

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


client.bat does not work in Karaf 4.1.5

2018-03-05 Thread DUTERTRY Nicolas
Hi,

I have just downloaded Karaf 4.1.5 and it seems that, under Windows, it is not 
possible to obtain an interactive SSH session anymore with the script 
"client.bat".
The login is successful but when I press any key the SSH session ends.
I have this error in logs :

2018-03-05T13:35:39,496 | ERROR | Karaf ssh console user karaf | ShellUtil  
  | 43 - org.apache.karaf.shell.core - 4.1.5 | Exception caught 
while executing command
java.lang.NullPointerException: null
  at 
org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:348)
 [43:org.apache.karaf.shell.core:4.1.5]
  at java.lang.Thread.run(Thread.java:748) [?:?]
2018-03-05T13:35:40,011 | WARN  | sshd-SshServer[50ae478a]-nio2-thread-3 | 
ServerSessionImpl| 48 - org.apache.sshd.core - 1.6.0 | 
exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:65321])[state=Opened] 
IOException: The specified network name is no longer available.

Do you have any idea what the issue is ?
Regards,
--
Nicolas Dutertry
Sopra HR Software - http://www.soprahr.com/



RE: JPA and transaction issue in Karaf 4.0.4

2016-02-08 Thread Dutertry Nicolas
Hi Christian,

Thanks for you answer. I have fixed the 2 issues (correct jpa namespace and 
pax-jdbc for datasource) but unfortunately, the error is still there.
The new code is committed on github.
Regards,
--
Nicolas

De : cschneider...@gmail.com [mailto:cschneider...@gmail.com] De la part de 
Christian Schneider
Envoyé : samedi 6 février 2016 19:09
À : user@karaf.apache.org
Objet : Re: JPA and transaction issue in Karaf 4.0.4

Hi Nicolas,

I found some issues with your example but nothing that could fully explain the 
error.

1. In blueprint.xml you use the namespace 
xmlns:jpa="http://aries.apache.org/xmlns/jpan/v1.0.0;. This is deprecated. The 
correct one is xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0;
2. Your DataSource is not fully JTA enabled. (You are using 
org.apache.commons.dbcp2.managed.BasicManagedDataSource)

You can see how to setup dbcp2 in
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-pool-dbcp2/src/main/java/org/ops4j/pax/jdbc/pool/dbcp2/impl/ds/DbcpXAPooledDataSourceFactory.java

I suggest to simply use pax-jdbc-pool-dbcp2 und pax-jdbc-config to create your 
DataSource. See
https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+for+DataSourceFactory

Can you try if fixing these two issues helps?
If not then it might be a bug and I will investigate it deeper.

Christian

2016-02-05 15:07 GMT+01:00 Dutertry Nicolas 
<nicolas.duter...@soprahr.com<mailto:nicolas.duter...@soprahr.com>>:
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-

RE: JPA and transaction issue in Karaf 4.0.4

2016-02-08 Thread Dutertry Nicolas
Thank you Christian !

--
Nicolas Dutertry

De : Christian Schneider [mailto:cschneider...@gmail.com] De la part de 
Christian Schneider
Envoyé : lundi 8 février 2016 12:01
À : user@karaf.apache.org
Objet : Re: JPA and transaction issue in Karaf 4.0.4

Hi Nicolas,

I was able to reproduce the issue and created a jira issue for it
https://issues.apache.org/jira/browse/ARIES-1494

I also found the workaround to make the method TestServiceImpl.delete also 
@Transactional. Still this is a severe issue and I will try to fix it as soon 
as possible.

Christian

On 08.02.2016 11:17, Dutertry Nicolas wrote:
Hi Christian,

Thanks for you answer. I have fixed the 2 issues (correct jpa namespace and 
pax-jdbc for datasource) but unfortunately, the error is still there.
The new code is committed on github.
Regards,
--
Nicolas

De : cschneider...@gmail.com<mailto:cschneider...@gmail.com> 
[mailto:cschneider...@gmail.com] De la part de Christian Schneider
Envoyé : samedi 6 février 2016 19:09
À : user@karaf.apache.org<mailto:user@karaf.apache.org>
Objet : Re: JPA and transaction issue in Karaf 4.0.4

Hi Nicolas,

I found some issues with your example but nothing that could fully explain the 
error.

1. In blueprint.xml you use the namespace 
xmlns:jpa="http://aries.apache.org/xmlns/jpan/v1.0.0;. This is deprecated. The 
correct one is xmlns:jpa="http://aries.apache.org/xmlns/jpa/v2.0.0;
2. Your DataSource is not fully JTA enabled. (You are using 
org.apache.commons.dbcp2.managed.BasicManagedDataSource)

You can see how to setup dbcp2 in
https://github.com/ops4j/org.ops4j.pax.jdbc/blob/master/pax-jdbc-pool-dbcp2/src/main/java/org/ops4j/pax/jdbc/pool/dbcp2/impl/ds/DbcpXAPooledDataSourceFactory.java

I suggest to simply use pax-jdbc-pool-dbcp2 und pax-jdbc-config to create your 
DataSource. See
https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+for+DataSourceFactory

Can you try if fixing these two issues helps?
If not then it might be a bug and I will investigate it deeper.

Christian

2016-02-05 15:07 GMT+01:00 Dutertry Nicolas 
<nicolas.duter...@soprahr.com<mailto:nicolas.duter...@soprahr.com>>:
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.DelegatingMethod

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: Karaf freezes after ssh connection

2014-06-16 Thread Dutertry Nicolas
Hi,

I have upgraded sshd-core bundle from 0.9.0 to 0.11.0 and there is no freeze 
anymore.

Can you please update sshd-core version for future Karaf releases ?

Regards.
--
Nicolas Dutertry
-Original Message-
From: Dutertry Nicolas [mailto:nicolas.duter...@hraccess.com] 
Sent: jeudi 12 juin 2014 15:24
To: 'user@karaf.apache.org'
Subject: RE: Karaf freezes after ssh connection

Actually the issue seems to be related to using Putty. I made the same test 
using Linux ssh command and there is no freeze.

Do you know if I should set some specific Putty parameters ?

Regards,
--
Nicolas Dutertry

-Original Message-
From: Dutertry Nicolas [mailto:nicolas.duter...@hraccess.com] 
Sent: jeudi 12 juin 2014 15:15
To: 'user@karaf.apache.org'
Subject: RE: Karaf freezes after ssh connection

Same result with CTRL-D

--
Nicolas Dutertry

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: jeudi 12 juin 2014 15:12
To: user@karaf.apache.org
Subject: Re: Karaf freezes after ssh connection

Hi Nicolas,

instead of using logout, can you try CTRL-D ?

Regards
JB

On 06/12/2014 03:06 PM, Dutertry Nicolas wrote:
 Hi,

 I am testing Karaf SSH connection but I am not able to properly close it.
 I am using Karaf 3.0.1 on Windows and Putty for the SSH connection.

 Here is exactly what I am doing:
 - Start Karaf using bin\karaf.bat
 - Open a SSH connection with putty on locahost:8101
 - Type  feature:list in putty console
 - Type logout in putty console

 Then Karaf does not log me out, the putty console stays frozen.
 If I go back to the local Karaf console and try to shutdown Karaf, the local 
 console also stay frozen.

 Do you have any workaround or patch to solve the problem ?
 Thanks.


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


Karaf freezes after ssh connection

2014-06-12 Thread Dutertry Nicolas
Hi,

I am testing Karaf SSH connection but I am not able to properly close it.
I am using Karaf 3.0.1 on Windows and Putty for the SSH connection.

Here is exactly what I am doing:
- Start Karaf using bin\karaf.bat
- Open a SSH connection with putty on locahost:8101
- Type  feature:list in putty console
- Type logout in putty console

Then Karaf does not log me out, the putty console stays frozen.
If I go back to the local Karaf console and try to shutdown Karaf, the local 
console also stay frozen.

Do you have any workaround or patch to solve the problem ?
Thanks.
-- 
Nicolas Dutertry 
HR Access - http://www.hraccess.com 



RE: Karaf freezes after ssh connection

2014-06-12 Thread Dutertry Nicolas
Same result with CTRL-D

--
Nicolas Dutertry

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: jeudi 12 juin 2014 15:12
To: user@karaf.apache.org
Subject: Re: Karaf freezes after ssh connection

Hi Nicolas,

instead of using logout, can you try CTRL-D ?

Regards
JB

On 06/12/2014 03:06 PM, Dutertry Nicolas wrote:
 Hi,

 I am testing Karaf SSH connection but I am not able to properly close it.
 I am using Karaf 3.0.1 on Windows and Putty for the SSH connection.

 Here is exactly what I am doing:
 - Start Karaf using bin\karaf.bat
 - Open a SSH connection with putty on locahost:8101
 - Type  feature:list in putty console
 - Type logout in putty console

 Then Karaf does not log me out, the putty console stays frozen.
 If I go back to the local Karaf console and try to shutdown Karaf, the local 
 console also stay frozen.

 Do you have any workaround or patch to solve the problem ?
 Thanks.


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


RE: Karaf freezes after ssh connection

2014-06-12 Thread Dutertry Nicolas
Actually the issue seems to be related to using Putty. I made the same test 
using Linux ssh command and there is no freeze.

Do you know if I should set some specific Putty parameters ?

Regards,
--
Nicolas Dutertry

-Original Message-
From: Dutertry Nicolas [mailto:nicolas.duter...@hraccess.com] 
Sent: jeudi 12 juin 2014 15:15
To: 'user@karaf.apache.org'
Subject: RE: Karaf freezes after ssh connection

Same result with CTRL-D

--
Nicolas Dutertry

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: jeudi 12 juin 2014 15:12
To: user@karaf.apache.org
Subject: Re: Karaf freezes after ssh connection

Hi Nicolas,

instead of using logout, can you try CTRL-D ?

Regards
JB

On 06/12/2014 03:06 PM, Dutertry Nicolas wrote:
 Hi,

 I am testing Karaf SSH connection but I am not able to properly close it.
 I am using Karaf 3.0.1 on Windows and Putty for the SSH connection.

 Here is exactly what I am doing:
 - Start Karaf using bin\karaf.bat
 - Open a SSH connection with putty on locahost:8101
 - Type  feature:list in putty console
 - Type logout in putty console

 Then Karaf does not log me out, the putty console stays frozen.
 If I go back to the local Karaf console and try to shutdown Karaf, the local 
 console also stay frozen.

 Do you have any workaround or patch to solve the problem ?
 Thanks.


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


karaf-assembly and config files

2014-03-04 Thread Dutertry Nicolas
Hi,

I am using karaf-assembly packaging to build a custom karaf distribution with 
karaf-maven-plugin.

What is the right way to override the content of a standard karaf file ? For 
instance I want to provide a custom org.ops4j.pax.logging.cfg.

I tried to put the file in src/main/resources/etc/org.ops4j.pax.logging.cfg, 
but then the final zip contains the file twice in etc folder (mine plus the 
original one).

Regards,
-- 
Nicolas Dutertry 
HR Access - http://www.hraccess.com 




RE: karaf-assembly and config files

2014-03-04 Thread Dutertry Nicolas
I did not use any specific goal as I used karaf-assembly packaging which 
automatically calls install-kars and instance-create-archive goals.

I have a custom org.ops4j.pax.logging.cfg in the file in 
src/main/resources/etc/.
I have attached the built zip file in this mail. You will find 2 files named 
org.ops4j.pax.logging.cfg in etc folder.

Here is my pom.xml :

?xml version=1.0 encoding=UTF-8?
project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
modelVersion4.0.0/modelVersion

groupIdtest/groupId
artifactIdtest-custom/artifactId
version1.0.0-SNAPSHOT/version
packagingkaraf-assembly/packaging
name${project.artifactId}/name

properties
karaf.version3.0.0/karaf.version
/properties

dependencies
dependency
!-- scope is compile so all features (there is only one) are installed 
into startup.properties and the feature repo itself is not installed --
groupIdorg.apache.karaf.features/groupId
artifactIdframework/artifactId
version${karaf.version}/version
typekar/type
/dependency

dependency
!-- scope is runtime so the feature repo is listed in the features 
service config file, and features may be installed using the karaf-maven-plugin 
configuration --
groupIdorg.apache.karaf.features/groupId
artifactIdstandard/artifactId
classifierfeatures/classifier
version${karaf.version}/version
typexml/type
scoperuntime/scope
/dependency
/dependencies

build
plugins
plugin
groupIdorg.apache.karaf.tooling/groupId
artifactIdkaraf-maven-plugin/artifactId
version3.0.0/version
extensionstrue/extensions
configuration
!-- no startupFeatures --
bootFeatures
featurestandard/feature
featuremanagement/feature
/bootFeatures
!-- no installedFeatures --
/configuration
/plugin
/plugins
/build
/project

--
Nicolas Dutertry

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: mardi 4 mars 2014 09:57
To: user@karaf.apache.org
Subject: Re: karaf-assembly and config files

Hi Nicolas,

Did you create a kar file with the create-kar goal and use the install-kar goal 
to populate the assembly ?

Could you explain what you do ?

Thanks,
Regards
JB

On 03/04/2014 09:27 AM, Dutertry Nicolas wrote:
 Hi,

 I am using karaf-assembly packaging to build a custom karaf distribution with 
 karaf-maven-plugin.

 What is the right way to override the content of a standard karaf file ? For 
 instance I want to provide a custom org.ops4j.pax.logging.cfg.

 I tried to put the file in src/main/resources/etc/org.ops4j.pax.logging.cfg, 
 but then the final zip contains the file twice in etc folder (mine plus the 
 original one).

 Regards,


--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
ScanMail detected and removed a file named test-custom-1.0.0-SNAPSHOT.zip 
that violated attachment blocking policy from the original mail entity. You can 
safely save or delete this replacement attachment.

Transaction management with JPA

2014-02-14 Thread Dutertry Nicolas
Hi,

I am trying to use transactions (JTA) and JPA with blueprint in Karaf 3.0.0 but 
I did not manage to make it work.

I don't want to use XA datasource because I only access a single database. So 
In my JPA persistence.xml file I have something like :
persistence-unit name=test

jta-data-sourceosgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/testdb)/jta-data-source
...

I have written a test to check transaction's rollback, using a transactional 
method like the following :
   
 public void createPerson(Person person) {
entityManager.persist(person);
entityManager.flush();

throw new RuntimeException(exception);
 }

I was expecting that the created person would not be written to the database 
after calling createPerson because of the Exception, but it is not the case ! 
The person object is persisted in the database.
It appears that the underlying JDBC Connection has an autocommit property set 
to true, so rollback is impossible. I thought transaction manager would take 
care of JDBC connection autocommit, but it is not the case.

The result is the same with OpenJPA and Hibernate.

Am I missing something related to JTA ?

Thanks for your help.
-- 
Nicolas Dutertry 
HR Access - http://www.hraccess.com 




RE: JPA with Karaf

2014-01-15 Thread Dutertry Nicolas
The hibernate feature seems to be broken as well. I tried it and got a 
GracePeriod state with the same log message :
Bundle test.jpa is waiting for dependencies 
[(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))]

Regards
--
Nicolas
-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: mercredi 15 janvier 2014 06:46
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

By the way, reviewing the OpenJPA feature, we found that the problem is in the 
feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next Karaf 
release.

Sorry about that.

Regards
JB

On 01/14/2014 10:33 AM, Dutertry Nicolas wrote:
 Hi,

 I am trying to use JPA with Karaf 3.0.0 but it does not work.

 First of all I have installed the following features :

 karaf@root() feature:install jndi jpa transaction openjpa

 Then I have created a simple JPA bundle containing:

 -A HSQLDB datasource configured with blueprint

 -A JPA entity (class Person) and the file META-INF/persistence.xml

 -A service for getting and creating people (class PersonService)

 The JPA EntityManager is injected in PersonService using blueprint.

 Finally I have deployed hsqldb and my bundle in Karaf, but my bundle's 
 state is set to GracePeriod :

 karaf@root() list

 START LEVEL 100 , List Threshold: 50

 ID | State   | Lvl | Version| Name

 --
 ---

 86 | Active  |  80 | 3.0.0  | Apache Karaf :: JNDI :: Command

 114 | Active  |  80 | 2.3.0  | Apache ServiceMix :: Specs ::
 Java Persistence API 1.4

 115 | Active  |  80 | 3.2.1  | Commons Collections

 116 | Active  |  80 | 1.6.0  | Commons Pool

 117 | Active  |  80 | 1.4| Commons DBCP

 118 | Active  |  80 | 2.6| Commons Lang

 119 | Active  |  80 | 2.3.0  | OpenJPA Aggregate Jar

 120 | Active  |  80 | 2.3.1  | HSQLDB

 121 | GracePeriod |  80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle

 In the log file we found :

 2014-01-14 10:04:28,388 | INFO  | raf-3.0.0/deploy |
 BlueprintContainerImpl   | 4 - org.apache.aries.blueprint.core -
 1.3.0 | Bundle test.jpa is waiting for dependencies 
 [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
 bjectClass=javax.persistence.EntityManagerFactory))]

 I have attached the sources of my bundle and the full karaf log file 
 in this mail.

 Is there a bug in Karaf or am I missing something ?

 Thanks for your help.

 --
 Nicolas Dutertry
 HR Access - http://www.hraccess.com


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


RE: JPA with Karaf

2014-01-15 Thread Dutertry Nicolas
I used version 3.3.2.GA available in Karaf 3.0.0.

I have also tested version 4.2.7 found here :
https://github.com/lburgazzoli/lb-karaf-features/blob/master/repo/hibernate4.xml

I have finally managed to make this version work. Indeed I found in a hibernate 
tutorial (see last comment in 
https://github.com/hibernate/hibernate-orm/blob/4.2/documentation/src/main/docbook/quickstart/tutorials/osgi/managed-jpa/features.xml)
 that hibernate-osgi must be started after the bundle containing JPA entities.
So to make everything work,  I have to stop the hibernate-osgi bundle before 
installing my bundle, and then restart hibernate-osgi.
For instance :
 feature:install hibernate42
 stop 127 // NB: 127 is hibernate-osgi bundle
 install url_to_my_bundle
 start 127

This is somewhat dirty, I hope we can find a better solution.

Regards,
--
Nicolas

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: mercredi 15 janvier 2014 15:02
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

Hi Nicolas,

thanks for the update.

What's version of the hibernate feature do you use ?

Regards
JB

On 01/15/2014 02:53 PM, Dutertry Nicolas wrote:
 The hibernate feature seems to be broken as well. I tried it and got a 
 GracePeriod state with the same log message :
 Bundle test.jpa is waiting for dependencies 
 [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(o
 bjectClass=javax.persistence.EntityManagerFactory))]

 Regards
 --
 Nicolas
 -Original Message-
 From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
 Sent: mercredi 15 janvier 2014 06:46
 To: user@karaf.apache.org
 Subject: Re: JPA with Karaf

 By the way, reviewing the OpenJPA feature, we found that the problem is in 
 the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next 
 Karaf release.

 Sorry about that.

 Regards
 JB

 On 01/14/2014 10:33 AM, Dutertry Nicolas wrote:
 Hi,

 I am trying to use JPA with Karaf 3.0.0 but it does not work.

 First of all I have installed the following features :

 karaf@root() feature:install jndi jpa transaction openjpa

 Then I have created a simple JPA bundle containing:

 -A HSQLDB datasource configured with blueprint

 -A JPA entity (class Person) and the file META-INF/persistence.xml

 -A service for getting and creating people (class PersonService)

 The JPA EntityManager is injected in PersonService using blueprint.

 Finally I have deployed hsqldb and my bundle in Karaf, but my 
 bundle's state is set to GracePeriod :

 karaf@root() list

 START LEVEL 100 , List Threshold: 50

 ID | State   | Lvl | Version| Name

 -
 -
 ---

 86 | Active  |  80 | 3.0.0  | Apache Karaf :: JNDI :: Command

 114 | Active  |  80 | 2.3.0  | Apache ServiceMix :: Specs ::
 Java Persistence API 1.4

 115 | Active  |  80 | 3.2.1  | Commons Collections

 116 | Active  |  80 | 1.6.0  | Commons Pool

 117 | Active  |  80 | 1.4| Commons DBCP

 118 | Active  |  80 | 2.6| Commons Lang

 119 | Active  |  80 | 2.3.0  | OpenJPA Aggregate Jar

 120 | Active  |  80 | 2.3.1  | HSQLDB

 121 | GracePeriod |  80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle

 In the log file we found :

 2014-01-14 10:04:28,388 | INFO  | raf-3.0.0/deploy |
 BlueprintContainerImpl   | 4 - org.apache.aries.blueprint.core -
 1.3.0 | Bundle test.jpa is waiting for dependencies 
 [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(
 o bjectClass=javax.persistence.EntityManagerFactory))]

 I have attached the sources of my bundle and the full karaf log file 
 in this mail.

 Is there a bug in Karaf or am I missing something ?

 Thanks for your help.

 --
 Nicolas Dutertry
 HR Access - http://www.hraccess.com


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


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


RE: JPA with Karaf

2014-01-14 Thread Dutertry Nicolas
Thank you Achim, the feature with openjpa 2.2.2 you gave me works !

I'm wondering why Karaf 3.0.0 provide an openjpa feature if it does not work ?

Regards
--
Nicolas Dutertry

From: Achim Nierbeck [mailto:bcanh...@googlemail.com]
Sent: mardi 14 janvier 2014 12:20
To: user@karaf.apache.org
Subject: Re: JPA with Karaf

btw.

this is a working feature, I used in a sample with Karaf 3.0

feature name='Karaf-JPA-OpenJPA' version='${project.version}'
!-- Container dependencies --
featuretransaction/feature
featurejpa/feature
featurejndi/feature

!-- Dependencies for OpenJPA --
bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/bundle
bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle
bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle
bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle
bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle
bundlemvn:commons-lang/commons-lang/2.6/bundle
bundlemvn:commons-collections/commons-collections/3.2.1/bundle
bundlemvn:commons-pool/commons-pool/1.6/bundle
bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/bundle
bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6/bundle
bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle
bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle
bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/bundle
bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle
/feature

2014/1/14 Achim Nierbeck 
bcanh...@googlemail.commailto:bcanh...@googlemail.com
Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue.
If you take a look at how the openjpa requirements for 2.2.0 are defined in 
camel
you'll find a working sample :)

regards, Achim

2014/1/14 Jean-Baptiste Onofré j...@nanthrax.netmailto:j...@nanthrax.net
Hi Nicolas,

could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue.

Regards
JB


On 01/14/2014 10:33 AM, Dutertry Nicolas wrote:
Hi,

I am trying to use JPA with Karaf 3.0.0 but it does not work.

First of all I have installed the following features :

karaf@root() feature:install jndi jpa transaction openjpa

Then I have created a simple JPA bundle containing:
-A HSQLDB datasource configured with blueprint

-A JPA entity (class Person) and the file META-INF/persistence.xml

-A service for getting and creating people (class PersonService)


The JPA EntityManager is injected in PersonService using blueprint.

Finally I have deployed hsqldb and my bundle in Karaf, but my bundle's
state is set to GracePeriod :

karaf@root() list

START LEVEL 100 , List Threshold: 50

ID | State   | Lvl | Version| Name

-

86 | Active  |  80 | 3.0.0  | Apache Karaf :: JNDI :: Command

114 | Active  |  80 | 2.3.0  | Apache ServiceMix :: Specs ::
Java Persistence API 1.4

115 | Active  |  80 | 3.2.1  | Commons Collections

116 | Active  |  80 | 1.6.0  | Commons Pool

117 | Active  |  80 | 1.4| Commons DBCP

118 | Active  |  80 | 2.6| Commons Lang

119 | Active  |  80 | 2.3.0  | OpenJPA Aggregate Jar

120 | Active  |  80 | 2.3.1  | HSQLDB

121 | GracePeriod |  80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle

In the log file we found :

2014-01-14 10:04:28,388 | INFO  | raf-3.0.0/deploy |
BlueprintContainerImpl   | 4 - org.apache.aries.blueprint.core -
1.3.0 | Bundle test.jpa is waiting for dependencies
[(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.namehttp://osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))]

I have attached the sources of my bundle and the full karaf log file in
this mail.

Is there a bug in Karaf or am I missing something ?

Thanks for your help.

--
Nicolas Dutertry
HR Access - http://www.hraccess.com

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



--

Apache Karaf http://karaf.apache.org/ Committer  PMC
OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer  
Project Lead
OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home 
Commiter  Project Lead
blog http://notizblog.nierbeck.de/



--

Apache Karaf http://karaf.apache.org/ Committer  PMC
OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer  
Project Lead
OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home 
Commiter  Project Lead
blog http://notizblog.nierbeck.de/