Re: Karaf 4.4.5 - What is the feature or bundle to resolve javax.annotation.security version>=1.3.0 ?

2024-01-22 Thread Łukasz Dywicki

Hello Paul,
I believe you might face issues with jakarta vs javax namespaces. There 
is a ongoing move from javax to jakarta and some of well known 
annotations might be missing at runtime.
Please double check if your runtime consist of javax.annotation.security 
package.


Best,
Łukasz

On 19.01.2024 20:41, Paul Spencer wrote:

Karaf 4.4.5
I am looking to implement security on a REST endpoint

@DeclareRoles("message-view")
@RolesAllowed("message-view")
@Path("/messageLog")
@Component(service = MessageLog.class)
@JaxrsResource
@JaxrsApplicationSelect("(osgi.jaxrs.name=myApi)")
public class MessageLog {
 private static final Logger LOGGER = 
LoggerFactory.getLogger(MessageLog.class);

 @GET
 @Produces(MediaType.APPLICATION_JSON)
 @Path("/")
 public Response getMessageLog() {
...
}

When I added @DeclareRoles("message-view") @RolesAllowed("message-view") 
installing the bundle results in

Error executing command: Unable to resolve com.foo.msg-rest [162](R 162.1): missing requirement 
[foo.bar.msg-rest [162](R 162.1)] osgi.wiring.package; 
(&(osgi.wiring.package=javax.annotation.security)(version>=1.3.0)(!(version>=2.0.0))) 
Unresolved requirements: [[foo.bar.msg-rest [162](R 162.1)] osgi.wiring.package; 
(&(osgi.wiring.package=javax.annotation.security)(version>=1.3.0)(!(version>=2.0.0)))]

I suspect this because I have not installed a required feature or bundle.  What 
is the the required feature or bundle?

Paul Spencer


Re: OAuth2 in Karaf

2023-08-21 Thread Łukasz Dywicki

It really depends what you mean by "how to do".

OAuth2 is authentication/authorization scheme which can be implemented 
as OAuth2 client, OAuth2 resource server or OAuth2 server providing tokens.
For most of these you can probably base of CXF and some of examples 
which it has. Personally I've used com.nimbusds/oauth2-oidc-sdk which 
works fine for client and resource server implementations. With a bit of 
effort I think its possible even to make working server with it.


Best,
Łukasz

On 20.08.2023 22:16, f...@gordijn.org wrote:

Hi all,

Are there any examples on how to do OAuth2 in Karaf?

Best,

-- Jaap



Re: Need help with and (OSGi-fication of TwelweMonkeys)

2023-08-15 Thread Łukasz Dywicki
I haven't dug into spi-fly for a while, can you point me which part of 
its code handle declared capabilities so I can have a look?
My basic understanding of Provide and Require-Capability headers is that 
these are primarily hints for osgi resolver to gather dependencies on 
layer other than import/export packages.


Best,
Łukasz

On 13.08.2023 21:27, Steinar Bang wrote:

Steinar Bang :



Still doesn't work:
  https://gist.github.com/steinarb/8bb77c64562bd853fc95a3fb19cfb5cf



But when I look closer at those error message it may be as simple as
lacking a run time dependency that can provide the package
com.twelvemonkeys.imageio...?



And that seems to be the case with the previous load error message as
well:
  https://gist.github.com/steinarb/55d4814e000e6e4e2f2a6235c3a186ae


Update for those following the thread: after adding compile scope maven
dependencies (which adds them to the karaf feature of the bundle using
them and makes them available at runtime), the load errors went away.

But the application running in karaf still uses the default JPEG reader,
and not the twelvemonkeys JPEG reader, so the SPI stuff hasn't kicked
in.

I have tried with  loading the osgi.serviceloader,
and it fails to load, even when I explictly load Ares SPI Fly (which
already should be loaded, because liquibase requires it).

And when I remove the , as said above, ImageIO uses
the default JPEG reader, which means the twelvemonkey plugin hasn't
registered.

The code definining  looks like this:

modified   imageio/pom.xml
@@ -170,4 +170,22 @@
  
  
  
+
+
+
+
+
+org.apache.felix
+maven-bundle-plugin
+
+
+
+  osgi.extender; 
filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.serviceloader; 
filter:="(osgi.extender=osgi.serviceloader.registrar)"
+
+
+
+
+
+
+
  

Ideas for how to correct this into something that would wor, would be
gratefully accepted.

Thanks!



Re: System.proerties setting to set xtream(1.4.20) permission Globaly in Apache karaf 4.3.7

2023-06-29 Thread Łukasz Dywicki
When you construct XStream mapper instance you can pass a whitelist for 
permitted packages and/or types. This error comes from XStream itself.

An example of security settings for XStream:
https://github.com/opensmarthouse/opensmarthouse-core/blob/7a5fac046a6c110f5c85721b0e279916db6a18cf/bundles/org.opensmarthouse.core.binding.xml/src/main/java/org/openhab/core/binding/xml/internal/BindingInfoReader.java#L89

Best,
Łukasz

On 16.05.2023 16:00, Chandan Singh wrote:


Hi All ,

Any inputs on this ,  We want to set the permission globally on karaf  
  to avoid  setting at  each Class level .


On Tue, May 16, 2023 at 12:23 AM Chandan Singh 
mailto:mailbox.chandansi...@gmail.com>> 
wrote:



Hi All ,

Any idea how to set  permissions for xtream packages  to avoid the
forbidden exception as shown
below


Caused by:
com.thoughtworks.xstream.security.ForbiddenClassException:
com.xx.xx.xx.parser.MyClass

     at

com.thoughtworks.xstream.security.NoTypePermission.allows(NoTypePermission.java:26)
 ~[!/:?]

     at

com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:74)
 ~[!/:?]

     at

com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125) 
~[!/:?]

     at

com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47) 
~[!/:?]

     at

com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
 ~[!/:?]

     at

com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:135) 
~[!/:?]

     at

com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
 ~[!/:?]

     at
com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1464) ~[!/:?]

     at
com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1441) ~[!/:?]

     at
com.thoughtworks.xstream.XStream.fromXML(XStream.java:1321) ~[!/:?]

     at
com.thoughtworks.xstream.XStream.fromXML(XStream.java:1312) ~[!/:?]



I had the below seeting in  pas Karaf  System.properties  and it
used to work in earlier  versions  .


org.apache.camel.xstream.permissions=com.xx.xx.**,java.lang.*,java.util.**
*com.thoughtworks.xstream.permissions=com.xx.xx.*,java.lang.*,java.util.* *
*
*
*
*
*Please advice if the there is any change in Syntax or  any other
config required ? *
*
*
*
*
*Regards*
*Chandan*



Re: Verify SSH client login with Java

2023-01-12 Thread Łukasz Dywicki
Pay attention to directory in whcih your main() is being ran. For start 
try setting absolute path to bin/client.


Best,
Łukasz

On 12.01.2023 16:29, Domke, Alexander wrote:

Hello all,

I'm trying to use a Java program to check if the Karaf SSH client that 
comes with the program is working. For this I wrote a simple Java 
program, but the client does not return the result.  When I run the 
command "bash -c ./bin/client -u karaf -p karaf \"system:version\"" 
manually in the console it works, but not when I run it through the 
program.


import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

public class App {

     public static void main(String[] args) throws Exception {

     System.out.println("SSH Client Check");

     testSSHClient();

     }

     public static void testSSHClient() throws Exception {

     String commandUnix = "bash -c ./bin/client -u karaf -p karaf 
\"system:version\"";


     String clientLoginResult = executeSSHClient(commandUnix);

     System.out.println(clientLoginResult);

     }

     private static String executeSSHClient(String command)

     throws IOException, InterruptedException {

     StringBuffer output = new StringBuffer();

     Process p = Runtime.getRuntime().exec(command);

     p.waitFor();

     BufferedReader reader = new BufferedReader(new 
InputStreamReader(p.getInputStream()));


     String line = "";

     while ((line = reader.readLine()) != null) {

     output.append(line + "\n");

     }

     String result = output.toString();

     return result.trim();

     }

}

Does anyone have any idea what could be the reason for this?

Regards

Alex


CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 
7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com
Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, 
Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken

Vorstandsmitglieder (Members of the Board): Peter Schneck, Axelle Maze
Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz 
(Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), 
Prof. Dr. Isabell Welpe, Ricardo Malta

Bankverbindungen (Bank Accounts):
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 
1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 
0155 00 SWIFT-Code : COBADEFF600,

Registergericht (Registry court): Amtsgericht Stuttgart
Handelsregister (Commercial Register): HRB Nr. 19117
Umsatzsteuer (VAT) ID: DE 147 862 777


Re: Multiple parent feature versions

2022-06-13 Thread Łukasz Dywicki

Hey Konrad,
There are few ways you can avoid issue:
1) Use version ranges for features
2) Use version ranges for bundles
3) Override versions in custom assembly

Case 1 and 2 allow you to import feature sets independently of each 
other. Version range usually aims highest version within range, so you 
can move within specified limit ie. 0.x or 0.0.x. Yet, one thing to 
remember is that version ranges are handled differently at feature 
element (then it's OSGi version range) and at feature/bundle URI (then 
it's Maven version range). Both works mostly fine, but for Maven version 
3.0-SNAPSHOT (alpha, beta as well) is outside of 3.0 range while for 
OSGi it is within the bound as SNAPSHOT is just an qualifier.
For third option you can centrally adjust which version to go with, 
simply overriding versions used in both feature sets. Obviously it is 
not as handy as first two, as it requires you to control a third file, 
yet it gives you a complete control over everything. I use it ie. to 
force specific versions of netty or jetty across third party feature 
sets I sometimes use.
A compact example of how to achieve that based on pax/log4j 2.x issue 
from last year: https://github.com/openhab/openhab-distro/pull/1350/files


Powodzenia! :)
Łukasz

On 8.06.2022 09:17, Konrad Baczynski wrote:

Hello,

I am doing provisioning via features.

Let's assume you have one parent features repository and two child 
repositories that have defined the parent one. Every child repository 
has one feature which depends on the same feature in the parent repository.


You upgraded one bundle version in the feature in the parent repository. 
You upgraded the parent version in the first child repository, but you 
didn't do it for the other one.


Then you added both child repositories, when you install both features 
from child repositories, you have two versions of the bundle from the 
feature from the parent repository. Is there a possibility to cope with 
it? Since the versions were backward compatible, you would like to have 
only one version.



Best regards

Konrad Bączyński



Re: Deleting vulnerable artifacts from system folder

2022-05-11 Thread Łukasz Dywicki

Hey Richard,
The small truth about "system" folder is that its a just a fallback 
repository, which needs to follow a maven repo directory structure. 
Runtime validation is based on manifests, not URIs. Instead of removing 
affected artifact you can simply copy in place of it a updated one. So 
feature definitions stays intact, resolver will simply go over retrieved 
manifest and report issue if its out of range.


I've done this exercise with log4j2/pax-logging updates last December 
without any major trouble. All you have to do is cleaning up cache or 
calling "update 21" (or whatever bundle id is assigned to jackson for 
you). I know its a bad hack, but that's shortest way to stay CVE clear.
If you want a proper way involving boot features (not an 
startup.properties entry), then you can copy a new artifact using proper 
coordinates into 
system/.../jackson-databind/2.13.2.2/jackson-databind-2.13.2.2.jar and 
then use blacklists/overrides and force use of a clear artifact.

Example file:
https://github.com/splatch/openhab-distro/blob/2ecea7e5a2d573cdd6fce394e562ad3bea0a0c48/distributions/openhab/processing.xml 
(make sure you have these contents in 
$KARAF_HOME/etc/org.apache.karaf.features.xml)
Again bringing overrides requires you to clean runtime cache to force 
re-resolving of artifacts.


Let me know if any of these helps.

Best,
Łukasz

On 11.05.2022 13:51, Richard Hierlmeier wrote:


I have a Karaf installation that has in the system folder 
jackson-databind 2.12.1 installed.
A security scanner detects that a vulnerable version of jackon-databind 
is installed (2.12.1 is affected by CVE-2020-36518).
This version of jackson-databind does not become active because another 
feature brings 2.13.2.2 :


karaf@root()> la -u | grep jackson-databind
  21 | Active   |  35 | 2.13.2.2| 
mvn:com.fasterxml.jackson.core/jackson-databind/2.13.2.2

karaf@root()>

The Karaf instance has no access to the internet.
When I delete jackson-databind 2.12.1 from the system folder then the 
following error occurs at startup:


org.apache.karaf.features.internal.util.MultiException: Error:
         Error downloading 
mvn:com.fasterxml.jackson.core/jackson-databind/2.12.1
         at 
org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.(MavenDownloadManager.java:91)
         at 
org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)
         at 
org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:457)
         at 
org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:452)
         at 
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:224)
         at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
         at 
org.apache.karaf.features.internal.service.Deployer.handlePrerequisites(Deployer.java:1121)
         at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:394)
         at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
         at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)

         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)
         Suppressed: java.io.IOException: Error downloading 
mvn:com.fasterxml.jackson.core/jackson-databind/2.12.1



Is it necessary that Karaf resolves this artifact despite it is at the 
end not used?


Regard

    Richard




Re: Activation related stack traces after upgrading to 4.2.15

2022-02-02 Thread Łukasz Dywicki

Hey Greg,
Looking at the stack trace it originates from an system dependency we 
have and not Karaf itself. Are you able to reproduce issue without Karaf 
(ie. running stock CXF), or it happens only when you deploy your service 
within our runtime?


BTW would your organization be interested in providing a story for 
https://karaf.apache.org/stories.html ?


Best,
Łukasz
--
Apache Karaf committer & PMC member
http://code-house.org

On 2.02.2022 17:15, Greg Logan wrote:

Hi all,

We are seeing null pointer exceptions[1] on requests after upgrading 
from 4.2.9 to 4.2.15.  The requests look like this (these are testing 
instances, passwords are public, feel free to copy and paste these 
commands):


curl -vvv 'https://stable.opencast.org/api/series/ 
' \

   -u admin:opencast \
   -F 'metadata=[{"label":"Opencast Series 
Dublincore","flavor":"dublincore\/series","fields":[{"id":"title","value":"Test"}]}]' 
\
   -F 
'acl=[{"allow":true,"action":"write","role":"ROLE_ADMIN"},{"allow":true,"action":"read","role":"ROLE_ADMIN"}]'


A corrected request adds mimetypes to the acl and metadata fields:

curl -vvv 'https://stable.opencast.org/api/series/ 
' \

   -u admin:opencast \
   -F 'metadata=[{"label":"Opencast Series 
Dublincore","flavor":"dublincore\/series","fields":[{"id":"title","value":"Test"}]}]; 
type=application/json' \
   -F 
'acl=[{"allow":true,"action":"write","role":"ROLE_ADMIN"},{"allow":true,"action":"read","role":"ROLE_ADMIN"}]; 
type=application/json'


Looking through the Karaf jira, 
https://issues.apache.org/jira/browse/KARAF-6703 
 caught one of our 
developer's eye, notably the comment with the same stack trace linking 
to https://issues.apache.org/jira/browse/CXF-8380 
.  Looking at the jars 
in our assemblies, it looks like we have CXF 3.4.3, but this behaviour 
is supposed to be resolved by 3.4.2.  Am I confused and this is still a 
known issue, or am I just unfamiliar with the inner workings of Karaf 
and CXF?


Thanks,
G

1: Caused by:java.lang.NullPointerException: mimeType
         at 
java.datatransfer/java.awt.datatransfer.DataFlavor.init(DataFlavor.java:427)
         at 
javax.activation.ActivationDataFlavor.init(ActivationDataFlavor.java:113)

         at javax.activation.DataHandler.init(DataHandler.java:41)
         at 
org.apache.cxf.attachment.AttachmentUtil.createAttachment(AttachmentUtil.java:420)
         at 
org.apache.cxf.jaxrs.ext.MessageContextImpl.createAttachments(MessageContextImpl.java:291)
         at 
org.apache.cxf.jaxrs.ext.MessageContextImpl.get(MessageContextImpl.java:79)
         at 
org.apache.cxf.jaxrs.utils.multipart.AttachmentUtils.getMultipartBody(AttachmentUtils.java:84)
         at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processFormParam(JAXRSUtils.java:1044)
         at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.createHttpParameterValue(JAXRSUtils.java:967)
         at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:927)
         at 
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:842)

...



Re: javax.servlet chain problems

2022-02-01 Thread Łukasz Dywicki
If you build your own distro then you can blacklist CXF bundle and try 
to replace it with wrapped one. The wrapper can be created on the fly 
with wrap: protocol which allows you to inline some parts of bnd 
instructions and overriding existing manifest.

An example patch for openhab-distro which I worked with:
https://github.com/openhab/openhab-distro/pull/1354/files

Just an example to get this:
wrap:mvn:org.apache.cxf/cxf-rt.../3.4.0$override=merge=*;javax.servlet*;version=4.0

Just a note - I haven't tested that, but blacklisting/replacements is 
controlled at the Karaf tooling level. Another URI such as wrap, which 
does delegation under the neath, should still be able to retrieve 
selected artifact.


Best,
Łukasz
--
Code-House
http://code-house.org

On 31.01.2022 21:22, Christian Lutz wrote:

Hello,

you have created the following Issue 
https://issues.apache.org/jira/browse/CXF-8335.
And I am running in exact this problem, too. How could I workaround this issue.

I have my own karaf distro created with karaf-assembly and kar file using the 
OpenAPI.

Any hint how I could fix this either in the distro or the kar file.

kind regards
Christian


Re: user code logging MDC lost

2022-01-04 Thread Łukasz Dywicki

Hey Juergen,
Glad to see here developers who rely on openHAB. :)

The MDC context is not lost, but as this is a diagnostic context it 
might be ephemeral. Can you share code piece how you set MDC?

Look at example how to do it with slf4j [1].

Normally all MDC operations are put into closeable context, so 
diagnostic information is set during operation and cleared once it is done.
We obviously have exceptions, cause some diagnostic context can be 
identified in an permanent way. Construction of pax logging can 
guarantee that bundle related context is always propagated, cause it can 
control loggers which are being requested by them.
This is likely not a case in situations where you request distinct 
loggers elsewhere or logger instance is reused across threads. As far I 
remember MDC scope is usually just a thread.


Best,
Łukasz

[1] 
https://github.com/apache/plc4x/blob/v0.9.1/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/transaction/RequestTransactionManager.java#L207L211



On 4.01.2022 10:42, Jürgen Weber wrote:

This is about openHAB 3.2 which uses Karaf 4.3.4 and Pax logging.

The idea is to put data into an MDC in a bundle and use it for log4j2 routes.

I tried this in a Java main sample and it works:

MDC.put("ohtopic", "openhab/items/XLevel/state");





But not within openHAB / karaf, there only the bundle id etc. appear
in log4j2 (as shown with %X pattern).

Thanks,
Juergen

Am Di., 4. Jan. 2022 um 09:53 Uhr schrieb Jean-Baptiste Onofré
:


Hi,

Are you using the SIFT appender ?

Which Karaf version are you using ?

Does it mean that you set a MDC property that you don't see later on ?

Are you using something similar to:

https://nanthrax.blogspot.com/2014/08/mdc-logging-with-apache-karaf-and-camel_31.html

aka MDC.put("foo", "bar"); ?

?

Regards
JB

On 03/01/2022 22:32, Jürgen Weber wrote:

Seems if a user code in a bundle sets a logging MDC it gets deleted/is
lost? by Karaf. Is this indeed the case? by design?

%X in the appender pattern shows only

{bundle.id=175, bundle.name=org.openhab.core.io.monitor, bundle.version=3.2.0}

Thanks,
Juergen



Re: Updated mitigation for Log4JShell in Karaf 4.2.x and 4.3.x since setting log4j2.formatMsgNoLookups is a insufficient mitigation measure

2022-01-04 Thread Łukasz Dywicki

Just remember to restart system after update. ;-)

Also, you can override files on the disk and start with clean caches.

Best,
Łukasz

On 4.01.2022 13:29, João Assunção wrote:


I think the correct versions of pax logging would be 1.11.13.

And the "patching" can be made with two updates:

bundle:update org.ops4j.pax.logging.pax-logging-api pax-logging-api-1.11.13.jar>
bundle:update org.ops4j.pax.logging.pax-logging-log4j2  pax-logging-log4j2-1.11.13.jar>


Regards,
João

Email: joao.assun...@exploitsys.com 
Mobile: +351 916968984
Phone: +351 211933149
Web: www.exploitsys.com 




On Tue, Jan 4, 2022 at 10:49 AM Paul McCulloch > wrote:


You can uninstall the affected pax logging bundles & install
versions where the issue is resolved:

bundle:uninstall org.ops4j.pax.logging.pax-logging-log4j2
bundle:uninstall org.ops4j.pax.logging.pax-logging-api
bundle:install -l 8 -s mvn:org.ops4j.pax.logging/pax-logging-api/1.11.11
bundle:install -l 8 -s
mvn:org.ops4j.pax.logging/pax-logging-log4j2/1.11.11

However the affected version may get reinstalled (though won't
be wired as far as I can tell) when other features are installed.To
avoid this, and to ensure that a 'clean' doesn't undo the upgrade I
found the following to work (in addition to upgrading the affected
bundles).

* replace the affected JARs in the /system repo with empty JARs (so
that they won't be downloaded from a central maven repo)
* add the new logging JARs to the /system repo
* Modify etc/startup.properties to use the new versions of pax
logging (only affects 'clean')
* Create etc/blacklisted.properties with content

pax-logging-api;type=bundle;url=mvn:org.ops4j.pax.logging/pax-logging-api/1.9.1

pax-logging-log4j2;type=bundle;url=mvn:org.ops4j.pax.logging/pax-logging-log4j2/1.9.1

To prevent any attempt to load the old bundles by features which
explicitly request them

Paul


On Thu, 23 Dec 2021 at 18:40, JB Onofré mailto:j...@nanthrax.net>> wrote:

It makes sense. As it’s for a short period.

Regards
JB

 > Le 23 déc. 2021 à 19:19, Paul Spencer
mailto:paulspen...@mindspring.com>>
a écrit :
 >
 > JB,
 > Karaf upgrades will be done, just not during the holiday
breaks when compliance resources are scarce.  Mitigating the
issue by setting log4j2.formatMsgNoLookups and removing the
JndiLoookup.class will allow the current environment to run
while upgrades are be run through each customer's compliance and
deployment processes.
 >
 > Thank you and the Karaf team for rapidly releasing updated
versions of Karaf to address the CVE.  The updated Karaf will be
will incorporated into our products and pushed through the
release and deployment process as quickly as possible.
 >
 > Paul Spencer
 >
 >> On Dec 23, 2021, at 12:42 PM, Jean-Baptiste Onofre
mailto:j...@nanthrax.net>> wrote:
 >>
 >> It would mitigate only the JNDI part, not the other CVE
(about the lookup).
 >>
 >> Anyway, it’s a good workaround.
 >>
 >> I don’t understand why you don’t want to upgrade to a new
version. It’s exactly the purpose of the new releases to address
CVE.
 >> Else, why we would do new releases if you are stuck with old
versions. Log4j did couple of new releases to address the CVE
issue, so it’s worth to update.
 >>
 >> Regards
 >> JB
 >>
  Le 23 déc. 2021 à 18:37, Paul Spencer
mailto:paulspen...@mindspring.com>>
a écrit :
 >>>
 >>> JB,
 >>> Aymen Furter suggested the following:
 >>>
 >>> $ cd karaf-directory
 >>> $ zip -q -d $(find . | grep pax-logging-log4j2 | grep jar)
org/apache/logging/log4j/core/lookup/JndiLookup.class
 >>> $ zip -q -d $(grep -rlnw . -e "pax-logging-log4j2" | grep
"data/cache/bundle" | grep jar)
org/apache/logging/log4j/core/lookup/JndiLookup.class
 >>>
 >>>
 >>> This looks like a reasonable short term workaround that is
relatively easy to implement. Relative to the Karaf and its
services, do you see any potential problems with the workaround?
 >>>
 >>>
 >>> Paul Spencer
 >>>
  On Dec 23, 2021, at 12:17 PM, JB Onofré mailto:j...@nanthrax.net>> wrote:
 
  Then create your own custom distro upgrading pax logging.
 
 > Le 23 déc. 2021 à 17:23, Paul Spencer
mailto:paulspen...@mindspring.com>>
a écrit :
 >
 > JB,
 > As stated earlier, upgrading Karaf is 

Re: Karaf 4.3.3 feature:refresh results in StackOverflowError

2021-09-29 Thread Łukasz Dywicki

Hey Thomas,
I just got stack overflow myself and began to look for solution of my issue.

From my past experiences I can tell you that stack overflow prior 4.3.x 
was usually result of multiple feature repositories (uris) delivering 
same feature. This might happen if you have several KARs/generated 
feature sets pulled into another feature/final assembly. All works 
separatelly but breaks when paths are crossed and packed together.


You can search for it manually or simply with bash helper:
find . -name "*.xml" -exec grep -C 4 -i "name=\"co7io-chrono" "{}" \; -print

In my case I know issue is related to co7io-chrono feature because I 
attached debugger to see what is at the very top of stack overflow 
listed in .. stack trace. Turns out to be this feature.


With above command I see that same feature is listed in few places.

./features/org.co7io.addons.feature.openhab/target/feature/feature.xml
./features/org.co7io.addons.feature.profile/target/feature/feature.xml
./bundles/org.co7io.chrono/target/test-classes/feature.xml (source)

Situation for me is rather obvious the "chrono" stuff brings own feature 
descriptor which reffered in "openhab" and "profile" feature sets. Quite 
natural, isn't it? Yet due to use of feature aggregation the chrono 
feature is embedded into openhab and profile feature descriptors. 
Effectively I got 3 "co7io-chrono" features defined in three descriptors.


After looking at dependency tree I found that all three feature sets are 
reffered in one build which might confuse resolver.


Can you do similar deduction for your build and see if similar situation 
occurs there too?


Best regards,
Łukasz


On 27.09.2021 15:25, Thomas Driessen wrote:

Hi J.B. :)

just wanted to ask if you did find some spare time to have a look at 
that issue?


Kind regards,
Thomas

Am Mo., 20. Sept. 2021 um 07:50 Uhr schrieb Thomas Driessen 
mailto:thomas.driessen...@gmail.com>>:


Hi J.B.,

I've sent you the contents directly to your email :)

Am Mo., 20. Sept. 2021 um 07:43 Uhr schrieb Jean-Baptiste Onofre
mailto:j...@nanthrax.net>>:

Hi Thomas,

Would it be possible to have your features definition ? I will
be able to take a look.

Thanks
Regards
JB

 > Le 20 sept. 2021 à 07:27, Thomas Driessen
mailto:thomas.driessen...@gmail.com>> a écrit :
 >
 > Hi J.B. , hi Francois,
 >
 > thanks for your quick answer and sorry for the delay.
 >
 > Is there any way to detect such a cycle, i.e. is there a
command such as feature:tree like for the dependency tree in
maven that could help me identifying such cycles?
 >
 > Strange thing is: the exact same setup worked fine with Karaf
4.3.2. So probably one of our referenced features in other
feature repositories causes this behavior.
 >
 >
 > Kind regards,
 > Thomas
 >
 > Am Sa., 18. Sept. 2021 um 06:22 Uhr schrieb Jean-Baptiste
Onofre mailto:j...@nanthrax.net>>:
 > Hi Thomas,
 >
 > I think you have a loop in your features (a feature A require
feature B that require feature A).
 >
 > I know that Pax CDI has a cycle like this (I have a fix but
not yet released).
 >
 > Regards
 > JB
 >
 > > Le 17 sept. 2021 à 17:00, Thomas Driessen
mailto:thomas.driessen...@gmail.com>> a écrit :
 > >
 > > Hi,
 > >
 > > we just updated to the new Karaf 4.3.3 and suddenly we
always get a StackOverflowError as soon as we try to do a
feature:refresh:
 > >
 > > 2021-09-17T14:56:44,239 | ERROR | Karaf local console user
karaf | ShellUtil                        | 44 -
org.apache.karaf.shell.core - 4.3.3 | Exception caught while
executing command
 > > java.util.concurrent.ExecutionException:
java.lang.StackOverflowError
 > >         at
java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
 > >         at
java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
 > >         at

org.apache.felix.gogo.runtime.CommandSessionImpl$JobImpl.run(CommandSessionImpl.java:855)
~[?:?]
 > >         at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
~[?:?]
 > >         at
java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
 > >         at

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
~[?:?]
 > >         at

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
~[?:?]
 > >         at java.lang.Thread.run(Thread.java:829) [?:?]
 > > Caused by: java.lang.StackOverflowError
 > >         at
   

Re: Shutdown issue ActiveMq

2021-09-23 Thread Łukasz Dywicki

Hey Jorg,
I am not too familiar with pax-jms, I do recall some of spring-jms 
troubles in the past (especially camel).
The big question is if your components actually do have an option for 
graceful shutdown. What you observe might be a very basic.


Looking at the sequence of actions you can see two paths of execution:
1. Container shutdown announced
2. Pool shutdown
3. Connection shutdown

1. Container shutdown announced
2. Component shutdown
3. Last will message
4. Connection close

If your only link between pool and component is connection itself you 
will observe a lot of such troubles. In order to do such you need to 
bind state of pool and client so they work together.
While shutdown of client should not cause shutdown of pool the reversed 
scenario is true. Also blueprint references might not be "up" at the 
time camel context is still awake.


A very basic workaround for that is building up a set of listeners ie. 
listening if connection factory is up in your client and vice versa.
Reverse listening (pool for clients) will help you to make graceful 
shutdown.


Hope that above puts some light on topic.

Best,
Łukasz
--
Code-House
http://code-house.org


On 22.09.2021 20:29, Jörg Jansen wrote:

Hi JB,

any update?

Thanks,
Joerg

-Original Message-
From: JB Onofré 
Sent: Montag, 16. August 2021 08:27
To: user@karaf.apache.org
Subject: Re: Shutdown issue ActiveMq

Hi

I will take a look with the resources you sent on your last email.
No need a jira for now, we will create one if the issue is confirmed.

Regards
JB


Le 16 août 2021 à 08:25, Jörg Jansen  a écrit 
:

Good morning,

I would like to bring up this point once again and kindly ask if anybody has an 
idea, of a possible cause of this issue?
Should I raise a JIRA ticket?

Kind regards,
Joerg

-Original Message-
From: Jörg Jansen
Sent: Montag, 5. Juli 2021 10:47
To: 'user@karaf.apache.org' 
Subject: RE: Shutdown issue ActiveMq

Hi JB,

I just pushed an example to github, which shows the configuration and
a reproduction guide: https://github.com/jojansen/jms-shutdown.git
Maybe you have time to look into it?

Regards,
Joerg

-Original Message-
From: Jörg Jansen
Sent: Freitag, 2. Juli 2021 15:02
To: user@karaf.apache.org
Subject: RE: Shutdown issue ActiveMq

Sure,

the feature looks like:

jms
spring
activemq-broker-noweb
activemq-client
pax-jms-pool-pooledjms
pax-jms-activemq
camel-jms


  name = lisa-amq
  osgi.jndi.service.name = jms/lisa-amq
  password = ${activemq.jms.password}
  connectionFactoryType = ConnectionFactory
  type = activemq
  url = ${activemq.url}
  user = ${activemq.jms.user}

  # hints for pax-jms-config to use selected 
org.ops4j.pax.jms.service.PooledConnectionFactoryFactory
  pool = pooledjms
  xa = false

  # pooled-jms specific configuration of 
org.messaginghub.pooled.jms.JmsPoolConnectionFactory
  pool.idleTimeout = 10
  pool.maxConnections = 10
  pool.blockIfSessionPoolIsFull = true
  pax.jms.managed = true

  

Thanks and regards
Joerg

-Original Message-
From: Jean-Baptiste Onofre 
Sent: Freitag, 2. Juli 2021 14:53
To: user@karaf.apache.org
Subject: Re: Shutdown issue ActiveMq

It should be fine if your feature installed pax-jms config has prerequisite.

Can you share snippet of your feature referencing activemq-broker ?

Regards
JB


Le 2 juil. 2021 à 14:21, Jörg Jansen  a écrit 
:

It's installed as a prerequisite feature (which is referenced by my customized 
boot feature).

Regards,
Joerg

-Original Message-
From: Jean-Baptiste Onofre 
Sent: Freitag, 2. Juli 2021 14:07
To: user@karaf.apache.org
Subject: Re: Shutdown issue ActiveMq

Ah the broker is installed as a feature in Karaf ? I thought your broker was 
outside of Karaf (standalone).

Does activemq-broker feature installed as boot feature ? Or do you install 
after startup using feature:install ?

Regards
JB


Le 2 juil. 2021 à 11:14, Jörg Jansen  a écrit 
:


Hi JB,

I'm using the AUTO ack, but switching to CLIENT doesn't make any difference.
How can I change the AMQ pool?
 From my understanding it should be the preferred way to use pooledjms.

This behavior sounds to me, that it may be be a ordering problem in my assembly.
The broker should be shutdown after all cliens.

Regards,
Joerg

-Original Message-
From: Jean-Baptiste Onofre 
Sent: Freitag, 2. Juli 2021 09:52
To: user 
Subject: Re: Shutdown issue ActiveMq

Hi,

Did you try with another kind of pooler ? Like "native" ActiveMQ pool instead 
of wrapped pooledjms ?

What kind of ack do you use in your Camel route ? AUTO (default) or CLIENT ?

Regards
JB


Le 2 juil. 2021 à 08:05, Jörg Jansen  a écrit 
:

Hi everybody,

I'm facing a problem with our JMS connection, when shutting down the karaf 
container.
The JMS connectionFactory is provided/configured via ops4j-jms.
When shutting down karaf, I receive the message: "Caught exception trying rollback() 
when 

Re: Possible to get config on first component startup?

2020-09-21 Thread Łukasz Dywicki
Yeah, my bad - I meant ManagedServiceFactory:
https://docs.osgi.org/javadoc/r5/cmpn/org/osgi/service/cm/ManagedServiceFactory.html

It works with "pid", however this pid becomes a factory one, meaning
that your etc/ configuration files must have -something in the name.
>From your example:
etc/no.priv.bang.oldalbum.roleadder.auth-testenvironment.cfg
etc/no.priv.bang.oldalbum.roleadder.auth-prod.cfg

The -prod is not directly visible to managed service #update method call
(however can be retrieved from dictionary if you use fileinstall), cause
"pid" will contain your pid and some random value. Your service factory
can then decide what kind of service should be published and decide to
resign from it if config is invalid.

I used this pattern to build configurable authentication mechanism in
one of customer projects and it served purpose quite well. With proper
tracking and decorating of services you can build whole chain of
elements which will for example result in launching of dedicated
endpoint where user will enter password, or like in your case amend
authorization logic.

Best,
Łukasz

On 21.09.2020 19:58, Steinar Bang wrote:
>>>>>> Łukasz Dywicki :
> 
>> Last resort is turning your configuration into
>> ManagedConfigurationFactory and publishing services only when config
>> admin receives an updated version of config.
> 
> Hm... google can't find much on ManagedConfigurationFactory.
> 
> Do you have a URL to some docs?
> 
> Thanks!
> 


Re: Possible to get config on first component startup?

2020-09-21 Thread Łukasz Dywicki
Last resort is turning your configuration into
ManagedConfigurationFactory and publishing services only when config
admin receives an updated version of config.

Best,
Łukasz

On 21.09.2020 09:22, Francois Papon wrote:
> Hi,
> 
> May be you can try with:
> 
> @Component(immediate = true, configurationPolicy =
> ConfigurationPolicy.REQUIRE)
> 
> regards,
> 
> François
> fpa...@apache.org
> 
> Le 20/09/2020 à 19:00, Steinar Bang a écrit :
>> I've added config for an Declarative Services component in the
>> src/main/feature/feature.xml file:
>>
>>  
>>  http://karaf.apache.org/xmlns/features/v1.4.0; 
>> name="oldalbum.roleadder.test">
>>  
>>  > name="no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment">
>>  username=${env:USERNAME:-admin}
>>  password=${env:PASSWORD:-admin}
>>  allowModify=${env:ALLOW_MODIFY:-true}
>>  
>>  scr
>>  
>>  
>>
>> The 
>> etc/no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment.cfg
>> file is created on startup, with the expected content:
>>  username=${env:USERNAME:-admin}
>>  password=${env:PASSWORD:-admin}
>>  allowModify=${env:ALLOW_MODIFY:-true}
>>  org.apache.karaf.features.configKey = 
>> no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment
>>
>>
>> But on the first call to the @Activate
>> method the config object is almost empty:
>>  
>> {component.name=no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment,
>>  component.id=7}
>>
>> If I stop karaf, delete the data directory, restart karaf, and reinstall
>> the feature (now with the config file in place), the @Activate method
>> gets the config results:
>>  
>> {service.pid=no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment,
>>  allowModify=true, password=admin, 
>> org.apache.karaf.features.configKey=no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment,
>>  
>> component.name=no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment,
>>  
>> felix.fileinstall.filename=file:/home/sb/skrot/apache-karaf-4.2.9/etc/no.priv.bang.oldalbum.roleadder.test.ShiroRoleAdderForOldalbumTestEnvironment.cfg,
>>  component.id=4, username=admin}
>>
>> Is there a way so that I can get the contents of the newly generated
>> .cfg file on the first component install?
>>
>> Thanks!
>>
>>
>> - Steinar
>>


Re: swagger-ui in Karaf

2020-09-02 Thread Łukasz Dywicki
Webjars ship js/css/probably html resources, but still need an servlet
to return them to browser. Hence you need to amend your application.

Long time ago I come with "standalone" swagger-ui deployment based
repackaged webjar:
https://github.com/Code-House/karaf-swagger/blob/master/ui/pom.xml
Take a look and try amending it to your needs.

Kind regards,
Łukasz
--
Code-House
http://code-house.org/

On 25.08.2020 08:51, Gerald Kallas wrote:
> Dear all,
> 
> I've installed swagger-ui as described here
> 
> https://cwiki.apache.org/confluence/display/CXF20DOC/OpenApiFeature#OpenApiFeature-EnablingSwaggerUIinOSGicontainer(Karaf)
> 
> with the command
> 
> install mvn:org.webjars/swagger-ui/3.32.3
> 
> Further I've an API endpoint that provides a swagger definition, reachable 
> under
> 
> https://localhost:8443/apiisp001/base/api-doc.
> 
> Could someone point me out how I can call swagger-ui from the bundle 
> installed?
> 
> Best
> Gerald
> 


Re: Is EventAdmin only suitable for OSGi platform internals?

2020-05-18 Thread Łukasz Dywicki
I don't think it is mainly for internal stuff. For example openHAB
project makes rather intense use of event admin masked under
org.openhab.core.events.EventPublisher and
org.openhab.core.events.EventSubscriber interfaces.
Main point for above abstraction is separation of application specific
logic from OSGi specification. Making it in such a way allows to mock
necessary eventing logic in unit tests without real event admin (even if
contract is small).

Best regards,
Łukasz


On 18.05.2020 02:53, Davi Baldin Tavares wrote:
> Hi all,
> 
> I would like to add an event driven communication to my app. For example if 
> some sort of data (pattern) is going to be saved into database by the DAO 
> service, an event should be raised and broadcasted to other 
> bundle/services/listeners. Instead of writing my own “AMQP” framework,  can I 
> reuse current Karaf EventAdmin implementation? Event propagation is only 
> required inside the same instance and the outside Comunication is not 
> necessary right now. It is ok to extend the EventAdmin usage beyond bundle 
> lifecycle and framework stuff?
> 
> Thanks,
> 
> Davi
> 


Re: [UPDATE] Karaf Virtual Meetup preparation

2020-04-28 Thread Łukasz Dywicki
Any updates on this?

On 25.04.2020 07:37, Jean-Baptiste Onofre wrote:
> Hi everyone,
> 
> Just a quick update to let you know that we will have a call with Achim
> on Monday to prepare the Karaf Virtual Meetup scheduled on Thursday.
> 
> I will share the schedule and details on Monday evening both on the
> mailing list and meetup.com .
> 
> For the presenters, I will send an email directly to you with the
> organisation.
> 
> Regards
> JB


Re: Other version of javax.xml.bind when running with Java 8 and 11

2020-04-28 Thread Łukasz Dywicki
Cześć Łukasz,
Technically speaking JAXB as a standard is moving its versions so
version shipped with Java 8 and Java 11 will be different. As far I
remember the overall plan for future releases is to remove JAXB from
official distribution and let programmers manage it as external dependency.
You can install RI within framework at the cost of additional megabyte
of your distribution.

Best regards,
Łukasz
--
Code-House
http://code-house.org


On 28.04.2020 09:50, lechlukasz wrote:
> Hello,
> 
> Is there a technical reason for org.apache.felix.framework providing other
> version of javax.xml.bind package when running with Java 8 (2.2.8) and Java
> 11 (2.3.0)?
> 
> Best regards,
> Lukasz Lech
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 


Re: OAuth2 recommended bundles/features

2020-04-17 Thread Łukasz Dywicki
I've used nimbus-jose-jwt which is quite handy:
https://mvnrepository.com/artifact/com.nimbusds/nimbus-jose-jwt

It doesn't ship any specific integration for jaxrs nor any other popular
backend framework, but on other hand doesn't hold you from implementing it.

I know CXF has its own integration with OAuth/JWT, from your information
I can not read if you rely on it or not.

Cheers,
Łukasz


On 16.04.2020 02:53, Davi Baldin Tavares wrote:
> Hi team,
> 
> My Karaf app is going to deploy a WebBundle for REST services been served by 
> jersey and Jackson only. 
> 
> Features installed along my bundle:
> 
> feature:install jetty
> feature:install war 
> 
> I would like to add Oauth2 and CORS support to connect with front-end app, so 
> what do you recommend me with library should I start using (based on your 
> Experience on Karaf).
> 
> Many thanks,
> 
> Davi.
> 


Re: JAXRS whiteboard service with client certificate authentication

2020-03-19 Thread Łukasz Dywicki
Hey Alex,
In order to get client certificates you need to configure server for
that. Sample jetty configuration (from Java API) is available here:
https://gist.github.com/jankronquist/6412839

Major trouble here is fact that SSL context will be shared across whole
server/connector (port) which you declare. Secured service which
requires client cert might redirect automatically to https to force
validation on the server side.

Anyhow if you will find a working configuration then it will be very
nice material for publication! :-)

Cheers,
Łukasz

On 04.03.2020 08:02, Alex Weirig wrote:
> Hello,
> 
> I have multiple REST webservices running in karaf using Apache Aries
> JAX-RS Whiteboard.
> 
> Now I'd need to create a webservice that should require a client
> certificate authentication.
> 
> Is there an example somewhere on how to implement this authentication
> (filter, ...?) is an KISS OSGi approach?
> 
> I found some code samples using google but they all seem relatively
> complicated or relying on other frameworks (Spring ...).
> 
> Many thanks in advance for your help
> 
> -- 
> 
> Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations,
> Kind regards,
> Alex Weirig
> Responsable Technique Ville de Luxembourg Service Enseignement Centre
> Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81
> *Email* alex.wei...@technolink.lu 
> www.vdl.lu  // www.technolink.lu
>  Centre Technolink 2, rue Charles de Tornaco
> L-2623 LUXEMBOURG
> 
> //indoors.this.blesses
> 
> //schaufel.besten.kopie
> 
> //supposons.levage.venger
> 


Re: Review of jackson features

2020-01-31 Thread Łukasz Dywicki
My points is following - if we need to change scope of maven dependency
just to force feature generator to create  entry (or similar)
then it is better to explicitly declare these in the descriptor manually
and do not rely on generator for these.

Cheers,
Łukasz
--
Code-House
http://code-house.org

On 28.01.2020 17:02, Steinar Bang wrote:
>>>>>> Łukasz Dywicki :
> 
>> Scope change is only necessary for feature generator thus we should
>> avoid that to not promote new dependencies to jackson users. This
>> might cause a push back later on as somebody will need to manage
>> dependency brought by new jackson release which he hasn't had before.
> 
> Yes, this was my worry.
> 
> (on the other hand, some of these dependencies were already
> provided, so FWIW it's more consistent in my change
> branch...)
> 
>> I believe we can still explicitly define these in feature fragment using
>>  part and leave maven part.
> 
> I don't understand what you mean here.
> 


Re: Review of jackson features

2020-01-27 Thread Łukasz Dywicki
Scope change is only necessary for feature generator thus we should avoid
that to not promote new dependencies to jackson users. This might cause a
push back later on as somebody will need to manage dependency brought by
new jackson release which he hasn't had before.
I believe we can still explicitly define these in feature fragment using
 part and leave maven part.

Cheers,
Łukasz

pon., 27 sty 2020 o 17:17 Steinar Bang  napisał(a):

> >>>>> Łukasz Dywicki :
>
> > Hey, as changes were made last year I would not hold it too long. As
> > long as integration doesn't break Jackson build we should be fine. In
> > worst case we will have to raise an issue in jackson issue
> > tracker. ;-)
>
> The changes that I'm most unsure about, are the dependency scope changes
> (I've changed all of the dependencies that are pulled in by features to
> have provided and that in turn meant that I've had to add
> dependencies that were previously pulled in as transitive dependencies,
> just to make maven build).
>
>


Re: Review of jackson features

2020-01-26 Thread Łukasz Dywicki
Hey, as changes were made last year I would not hold it too long. As long as 
integration doesn't break Jackson build we should be fine. In worst case we 
will have to raise an issue in jackson issue tracker. ;-)
They are pretty responsive and didn’t make any troubles with fixes in the past 
so I am not worried about waiting a bit for a patch release from them.

Cheers,
Łukasz Dywicki
--
Code-House
http://code-house.org

> On 21 Jan 2020, at 05:47, Jean-Baptiste Onofré  wrote:
> 
> Hi,
> 
> Now that I've submitted 4.2.8 to vote, I will switch back to this one.
> 
> Again, sorry for the delay :/
> 
> Regards
> JB
> 
>> On 20/01/2020 22:27, Steinar Bang wrote:
>> (a small ping on this one...)
>> 
>>>>>>> Steinar Bang :
>> 
>>>>>>> Steinar Bang :
>>>>>>> Jean-Baptiste Onofré :
>>>>> Hi Steinar,
>>>>> I started to review the different branches
>>>>> (https://github.com/steinarb/jackson-parent/tree/add-apache-karaf-features-to-jackson,
>>>>> ...).
>> 
>>>>> I have some comments and improvements.
>> 
>>>>> Do you want me to create PR on your branches or do you want to chat on
>>>>> Slack about that ?
>> 
>>>>> Please let me know the most convenient for you.
>> 
>>>> Thanks, JB!  PRs on the branches will be simplest.
>> 
>>> Hi JB, any progress on the PRs?
>> 
>>> (If you don't have time to make the PRs yourself, and have notes from the
>>> review, you could pass me your notes in an email or here on the list,
>>> and I will make the PRs and run them past you to see if I've understood
>>> the notes)
>> 
>>> Thanks!
>> 
>> 
>>> - Steinar
>> 
>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com


Re: Karaf-based App-Store

2019-10-02 Thread Łukasz Dywicki
The Eclipse stuff is based on Drupal thus it is bunch of forms, custom
content types to represent extension types and their "xml"
representations for integration needs.
I don't know much about it and how it is built internally, but I guess
it is kind of system made through available toolset. Far from perfect,
but working for Kura and other ecosystems.

A long time ago (around 2010) I was thinking of making an online
repository for feature repositories but idea have died somewhere between
other tasks.

Because Karaf can host diverse set of apps with various granularity
levels making an App-Store can be done in two ways - universal approach
which sticks to features/KARs or, something more customizable which will
be able to represent structuring of underlying modules - ie. transports,
integrations, UIs and so on.

Cheers,
Łukasz

On 02.10.2019 13:43, Julian Feinauer wrote:
> Hi Lukasz,
> 
> thanks fort he response.
> In fact, I know both of those but Atlassians backend is not open source and 
> Eclipses Backend is based on p2, as far as I understand which is some 
> different kind of OBR or?
> But generally, the Eclipse store covers pretty much our use case (it could / 
> should even be simpler, of course).
> 
> But to bring that to karaf I could use Cave to host the bundles and then 
> "only" send a Command to the karaf ssh shell, or, I mean, theoretically 
> speaking?
> 
> Julian
> 
> Am 02.10.19, 13:40 schrieb "Łukasz Dywicki" :
> 
> I am aware of one marketplace which is completely based on open source
> stack - and it is used in .. no surprise .. openHAB. :-)
> 
> There is Eclipse Marketplace which offers some kid of listing of
> resources which can be downloaded and installed in end-user environment.
> The marketplace is a webservice, openhab have special client which
> downloads bundles or KARs and tells karaf to install them.
> 
> Having said there is still a lot of things which are left unresolved -
> such as payments and/or licensing.
> 
> Another marketplace which you might not be fully aware of is Atlassian -
> their plugins are running with OSGi under the hood.
> 
> Cheers,
> Łukasz
> 
> 
> On 29.09.2019 16:14, Jean-Baptiste Onofré wrote:
> > Hi,
> > 
> > For OpenSource/Karaf perspective, that's a bit the idea of features in
> > combination with Cave (as server provider). I think it's already good to
> > go when used the correct way.
> > 
> > Regarding more "commercial/pro" AppStore like, it's not in Karaf scope
> > directly IMHO. I know some providers about kind of "Karaf Apps"
> > (basically a features plus some metadata).
> > 
> > Regards
> > JB
> > 
> > On 27/09/2019 15:35, Julian Feinauer wrote:
> >> Hi all,
> >>
> >>  
> >>
> >> after several discussions in the #karaf Channel in Slack I wanted to
> >> bring this issue also to the list.
> >>
> >>  
> >>
> >> We are currently building a Framework which is like an “App-Store” 
> where
> >> we provide a “Runtime” and a set of SPIs to code “Apps” against. This 
> Is
> >> all web-based so the Apps are in fact a set of Websites (boring,
> >> oldshool, give us apps!).
> >>
> >> But we also like to introduce later on an “App Store” and the ability 
> to
> >> (dynamically) load / start new Apps or stop / uninstall them.
> >>
> >> So, theoretically speaking, Karaf is a good fit as it already brings a
> >> lot of necessary functionality.
> >>
> >>  
> >>
> >> My question is a bit similar to Jaaps in [1]: Are there any (known) and
> >> ideally Open Source solutions of what we are trying to solve?
> >>
> >>  
> >>
> >> We would also need things like Signed bundles (see [2]), a separate
> >> process for Managing (or remote controlling) Karaf and so on.
> >>
> >> And it would be nice to look at another project and see what one can 
> use
> >> from there and what not.
> >>
> >>  
> >>
> >> Or do you have any general questions, ideas, hints for us on if this
> >> would work or if we should better forget about that?
> >>
> >>  
> >>
> >> Thanks already!
> >>
> >> Julian
> >>
> >>  
> >>
> >> [1]
> >> 
> https://lists.apache.org/thread.html/72b266c2a49bce7288c2972a03ee36562b058088898eb40d8f992590@%3Cuser.karaf.apache.org%3E
> >>
> >> [2] https://issues.apache.org/jira/browse/KARAF-6436
> >>
> > 
> 
> 


Re: Karaf-based App-Store

2019-10-02 Thread Łukasz Dywicki
I am aware of one marketplace which is completely based on open source
stack - and it is used in .. no surprise .. openHAB. :-)

There is Eclipse Marketplace which offers some kid of listing of
resources which can be downloaded and installed in end-user environment.
The marketplace is a webservice, openhab have special client which
downloads bundles or KARs and tells karaf to install them.

Having said there is still a lot of things which are left unresolved -
such as payments and/or licensing.

Another marketplace which you might not be fully aware of is Atlassian -
their plugins are running with OSGi under the hood.

Cheers,
Łukasz


On 29.09.2019 16:14, Jean-Baptiste Onofré wrote:
> Hi,
> 
> For OpenSource/Karaf perspective, that's a bit the idea of features in
> combination with Cave (as server provider). I think it's already good to
> go when used the correct way.
> 
> Regarding more "commercial/pro" AppStore like, it's not in Karaf scope
> directly IMHO. I know some providers about kind of "Karaf Apps"
> (basically a features plus some metadata).
> 
> Regards
> JB
> 
> On 27/09/2019 15:35, Julian Feinauer wrote:
>> Hi all,
>>
>>  
>>
>> after several discussions in the #karaf Channel in Slack I wanted to
>> bring this issue also to the list.
>>
>>  
>>
>> We are currently building a Framework which is like an “App-Store” where
>> we provide a “Runtime” and a set of SPIs to code “Apps” against. This Is
>> all web-based so the Apps are in fact a set of Websites (boring,
>> oldshool, give us apps!).
>>
>> But we also like to introduce later on an “App Store” and the ability to
>> (dynamically) load / start new Apps or stop / uninstall them.
>>
>> So, theoretically speaking, Karaf is a good fit as it already brings a
>> lot of necessary functionality.
>>
>>  
>>
>> My question is a bit similar to Jaaps in [1]: Are there any (known) and
>> ideally Open Source solutions of what we are trying to solve?
>>
>>  
>>
>> We would also need things like Signed bundles (see [2]), a separate
>> process for Managing (or remote controlling) Karaf and so on.
>>
>> And it would be nice to look at another project and see what one can use
>> from there and what not.
>>
>>  
>>
>> Or do you have any general questions, ideas, hints for us on if this
>> would work or if we should better forget about that?
>>
>>  
>>
>> Thanks already!
>>
>> Julian
>>
>>  
>>
>> [1]
>> https://lists.apache.org/thread.html/72b266c2a49bce7288c2972a03ee36562b058088898eb40d8f992590@%3Cuser.karaf.apache.org%3E
>>
>> [2] https://issues.apache.org/jira/browse/KARAF-6436
>>
> 


Re: Debugging Itests

2019-06-11 Thread Łukasz Dywicki
Hey Paul,
Within pax exam there are several processes which gets started. One
which you need to debug is Karaf one. All steps you mentioned seems to
be correct.

Debugging of option creation is not subject of debugConfiguration. This
code is executed by maven (surefire) or IDE you run. In order to debug
calculation of runtime configurations you need to debug process which
does that, namely junit executor.
General guide - @Configuration method is called before managed process
is launched thus can't be subject of standard Karaf debugging.
Keep in mind that surefire debugging might be tricky, but IntelliJ
should be rather smooth. Just remember to swap debugger ports.

In terms of exam debug configuration - pax allows you to specify port
but also "hold" flag to wait for debugger to be attached:
See:
org.ops4j.pax.exam.karaf.options.KarafDistributionOption#debugConfiguration(java.lang.String,
boolean)
If you will set second argument to true runtime won't be started until
you attach your debugger. Sometimes it is necessary to catch events
associated with bundles which are starting early.
>From what I observed IntelliJ can also skip breakpoints which have
signature mismatches. Make sure you have all versions in sync.

Kind regards,
Łukasz
--
Code-House http://code-house.org

On 11.06.2019 12:07, Paul Fraser wrote:
> Hi Again,
> 
> Is it possible in an itest to debug into the inner karaf runtime?
> 
> To try and debug into the "listBundleCommand" test in the Karaf Itest
> example I tried
> 
>  1. Set breakpoint on "String httpPort = ..." in the "public Option[]
> config()" method in the itest code.
>  2. Set breakpoint at first line  in "listBundleCommand" test.
>  3. Set a remote configuration in Intellij with port 5005.
>  4. start karaf with bin/karaf debug.
>  5. console displays "Listening for transport dt at address: 5005
>  6. Karaf starts up with branding and prompt.
>  7. Shift-F9 in intellij starts a debug session.
>  8. Debug console displays "Connected to the target VM, address:
> 'localhost:5005", transport: 'socket'
>  9. Run test (debug)
> 10. Debugger stops at breakpoint '1' above.
> 11. Does not stop at breakpoint '2' above.
> 12. "listBundleCommand" test runs to completion and output as expected.
> 
> If it can be done, what am I missing?
> 
> Paul Fraser
> 
> 
> 
> 
> 
> 
> 
> 
> 


Re: feature for jetty proxy

2019-06-11 Thread Łukasz Dywicki
I've used JettyProxyServlet too, and it works with openHAB out of the box:
https://github.com/ConnectorIO/connectorio-io-http :-)

At least for openHAB it wasn't a problem cause jetty-proxy is present at
runtime.

Anyhow - there is bunch of advanced features Jetty's proxy servlet
enables. I been using it to transform on the fly response from proxied
services. It's quite powerful. If you need a sample of this - I will be
able to cut it from somewhere.

Cheers,
Łukasz
--
Code-House http://code-house.org


On 10.06.2019 18:35, Jean-Baptiste Onofré wrote:
> Hi Markus,
> 
> I'm already added jetty-proxy in the Pax Web and Karaf features.
> 
> I just mentioned a workaround waiting for new Pax Web/Karaf releases.
> 
> Regards
> JB
> 
> On 10/06/2019 17:55, Markus Rathgeb wrote:
>> Hi JB,
>>
>>> First, you can use the ProxyService directly to programmatically create
>>> the proxies you need.
>>
>> I read the proxy service of the Karaf project but this does not fit to
>> my use-case.
>> I use a subclass of Jetty's proxy servlet because the "proxyTo" is not fixed.
>> It depends on the caller of the URL which backend is used to generate
>> the response for the request.
>>
>> Think about a system where an user needs to be logged in first.
>> The login credentials are used to choose the real backend system.
>>
>> If user 1 calls httsp://some.thing/foo/bar the "reverse proxy"
>> redirects the request to https://10.10.10.101/foo/bar
>> If user 2 calls httsp://some.thing/foo/bar the "reverse proxy"
>> redirects the request to https://10.10.10.102/foo/bar
>> ...
>>
>> So my servlet is a subclass of the proxy servlet that generated the
>> URL for the rewrite target in a very dynamic way.
>>
>> And it is already working it is just some additional work to align the
>> Jetty version on every Karaf bump.
>>
>>> About the version, it's actually the opposite: the Jetty proxy is a pure
>>> servlet, and a version of Jetty proxy can work with other Jetty version.
>>
>> Sure, the proxy is just a servlet but the implementation is using a
>> e.g. Jetty HttpClient:
>>
>> * 
>> https://github.com/eclipse/jetty.project/blob/jetty-9.4.18.v20190429/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java#L43
>> * 
>> https://github.com/eclipse/jetty.project/blob/jetty-9.4.18.v20190429/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java#L129
>> * 
>> https://github.com/eclipse/jetty.project/blob/jetty-9.4.18.v20190429/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java#L273
>>
>> If the Jetty proxy servlet implementation is newer then the Jetty HTTP
>> Client the proxy servlet implementation could potentially use
>> functions that are not yet present in the provided HttpClient
>> implementation.
>> If strong semver is used a newer HTTP Client should still support all
>> stuff used by the proxy servlet but how knows...
>>
>>
>> The Jetty proxy artifact is already an OSGi bundle, so what's the "big
>> win" to add its classes to every bundle as private package instead of
>> adding the jetty-proxy bundle to the OSGi runtime?
>>
>> Thank you for your patient,
>> Markus
>>
> 


Re: Karaf, Pax Web, Jetty: "some" client authentication

2019-05-16 Thread Łukasz Dywicki
Can you use two sockets/connectors?
Jetty stuff is configured at connector level, before even servlet is
reached. I know its not a perfect solution, rather a workaround..

Best regards,
Łukasz
--
Code-House
http://code-house.org


On 16.05.2019 08:12, Markus Rathgeb wrote:
> Hi,
> 
> I assume there are different parties involved, so if this question
> should be raised on another mailing list, please can you point me to?
> 
> I am using Karaf + Pax Web + Jetty.
> 
> Currently I build a custom distribution that Pax Web configuration
> (org.ops4j.pax.web.cfg) contains also this lines:
> 
> ===
> org.ops4j.pax.web.ssl.clientauthwanted = true
> org.ops4j.pax.web.ssl.clientauthneeded = true
> 
> org.ops4j.pax.web.ssl.truststore=${karaf.etc}/truststore.jks
> org.ops4j.pax.web.ssl.truststore.password=that-is-not-the-real-one
> ===
> 
> This distribution contains a bundle that registers a servlet "MyServlet".
> 
> Now, just FYI, I assume not all is relevant:
> 
> ===
> "MyServlet" extends the "WebSocketServlet"
> (org.eclipse.jetty.websocket.servlet.WebSocketServlet).
> Type hierarchy: MyServlet -> WebSocketServlet -> HttpServlet ->
> GenericServlet [Servlet, ServletConfig, Serializable].
> 
> The WebSocketServlet requires the implementation of the abstract
> method "public abstract void configure(WebSocketServletFactory
> factory);"
> 
> In the "configure" implementation is set a "creator".
> 
> factory.setCreator(new MyCreator(...));
> 
> MyCreator implements the following method (required by the
> WebSocketCreator interface):
> 
> public @Nullable Object createWebSocket(final ServletUpgradeRequest
> req, final ServletUpgradeResponse resp);
> 
> In that method I do a simple certificate check.
> 
> I call "final X509Certificate[] certs = req.getCertificates();" and
> use the returned chain for the check.
> 
> Now back to the relevant part.
> ===
> 
> The current implementation of the client certificate chain check
> relies that Jetty already required the client authentication
> (clientauthneeded) and that the certificate is already checked against
> the configured truststore (that contains only a special CA).
> 
> As we could rely on a "valid" certifcate I just need to extract the
> information I need from the client certifcate and "all is fine".
> 
> 
> Now, I need to add another servlet to that custom distribution that
> should work without a client certifcate.
> 
> I assume I will need to remove the truststore and clientauth settings
> from the configuration (keep wanted and drop needed?) and check the
> certifcate in the code for "MyServlet" itself.
> I further assume it should work by a filter or in the servlet itself.
> 
> Are there better ways to handle two servlet
> * Servlet1 needs client authentication
> * Servlet2 do not use client authentication
> 
> How can I trigger the check of the client certificate correctly in the
> servlet / filter to check against a specific truststore?
> 
> I am interested in your inputs.
> 
> Best regards,
> Markus
> 


Re: Modular graphic interface

2019-02-26 Thread Łukasz Dywicki
Long long time ago we made an attempt to push concept of modular console
forward: https://github.com/apache/karaf-webconsole. This project is
archived for quite long time as it didn't get beyond Karaf. As you might
expect other communities favored their own tools.

Above is based on wicket, still maintained btw. A glue is pax-wicket
which manages classloaders and extensions to create a fully dynamic
application. There is a bit of magic, however everything happens at Java
level thanks to osgi services and existing Wicket SPIs.

These days most of management tools is based on modern technologies
which communicate via http to retrieve necessary information from
backend. While many of these client oriented technics claim to have
modularization concepts, most of them do not support any dynamism when
it comes to deployment of app. At least I don't know one which does that
out of the box. GWT for example is statically compiled which forces you
to repeat what we did with Wicket, but on client side.
If you aim "modern market" you might need to assemble/generate some kind
of JS resource on the fly which will pull necessary js modules (static
or semi static resources) from deployed bundles.

One of longest surviving projects is felix webconsole which is fairly
basic, however it does support extensibility. Maybe you will be able to
repackage it in a way that it will host your needs.

Kind regards,
Łukasz Dywicki
--
Code-House
http://code-house.org

On 19.02.2019 18:39, Weirig, Alex wrote:
> Hello,
> 
> if you want to stick with Java, you can have a look at the Vaadin Framework.
> 
> Vaadin 8 was/is pure Java. With the newer versions you can also use
> webcomponents.
> 
> You can create modular UIs where even individual parts of the UI can be
> OSGi modules.
> 
> ---
> 
> Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations,
> Kind regards,
> Alex Weirig
> Responsable Technique Ville de Luxembourg Service Enseignement Centre
> Technolink *Tel* +352 4796 - 6127  *Fax* +352 42 88 81
> *Email* alex.wei...@technolink.lu <mailto:alex.wei...@technolink.lu>
> www.vdl.lu <http://www.vdl.lu> // www.technolink.lu
> <http://www.technolink.lu> Centre Technolink 2, rue Charles de Tornaco
> L-2623 LUXEMBOURG
> 
> 
> 
> -Original Message-
> *From: *"Jean-Baptiste Onofré" 
> *To: *user@karaf.apache.org
> *Sent: *Tuesday, February 19, 2019 10:26:49 AM
> *Subject: *Re: Modular graphic interface
> 
> Hi,
> 
> I know Yupiik is using Angular (deployed in Karaf) with Karaf backend.
> It's quite module as each part of the whole application is an Angular
> bundle.
> 
> Maybe it's possible to do that same with other frameworks.
> 
> Regards
> JB
> 
> On 19/02/2019 10:23, LuisLo wrote:
>> Hi all.
>>
>> Currently my company has a production system based on karaf. The system is
>> quite dynamic and the client requests new functionalities
> periodically, some
>> of which should not be deployed in all sites.
>> Thanks to Karaf we have elegantly solved, through "features", the part of
>> business logic, so that some deployments contain some services and other
>> deployments contain others.
>> However, the graphical interface is always the same (enabling or disabling
>> unused areas). We use JSF + primeFaces.
>> Is there any way of modulating the war that contains the graphical
>> interface? We have tried to use fragments, but we have not been able (or
>> known) to make a modular application.
>> Note: we prefer a JSF solution, but we accept any other web framework.
>>
>> Thanks for the help.
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>>
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 
> -- 
> This email was Anti Virus checked by SOPHOS UTM


Re: Android

2018-12-18 Thread Łukasz Dywicki
Dear Joern,
I think there was no test for this so far. We need to take into
consideration few things. First of all Karaf is usually ran against
regular JRE/JDK distributions. Second big point is that some extensions
might pull things which will not be present on Android.

My proposal for you is to start from minimal distribution and see if it
starts properly. In case if you encounter any troubles you can try to
build a custom distribution which will strip problematic modules.

Some of modules such Karaf Features mechanism rely on presence of JAXB.
This is part which might require special care if you would like to get
it running.

Kind regards,
Łukasz


On 15.12.2018 01:22, Jørn-Anders Kløvning wrote:
> Hi,
> 
> We are currently using the osgi felix on Android.
> Is it possible to use Karaf in an Android context?
> 
> Best regards
> Joern Anders Kloevning
> 


Re: OSGi and karaf in the cloud. Looking for some experiences and stories

2018-09-12 Thread Łukasz Dywicki
We do run Karaf inside docker (using static assemblies).

The best thing I see in it is possibility to SSH into karaf and see
what's going on. This is especially useful when logs are not dumped to
stdout nor file but sent via network somewhere else. Log tail then shows
all events before they are serialized.

A nice side effect of SSH console is possibility to execute commands via
exec. ;-)) By this way you can browse basic file system contents and
verify files delivered via container/cloud orchestration tools.

Having said that we run static assemblies, I would like to note that we
do not rely on "dynamic" updates of configurations just yet. We
experiment with kube as new way to run things but we didn't reach yet
place where we deliver configurations from etcd. This is place which
will get really interesting. Most likely it will require us to go back
to traditional, non static, assembly in order to pick up updates pushed
via kube api.

We do have separate pipeline (with simple makefiles) for building docker
images which is detached from main build where we produce custom distro.
Its used to add cloud specific configurations.
In two projects where we didn't use a common configurations we had extra
profile in maven build for that.
Developer can run static assembly locally with minor inconvenience
caused by static configs. For local builds we also used docker-compose
which allowed to setup all required dependencies (such database).

Cheers,
Lukasz



On 8/18/18 11:00 PM, Christian Schneider wrote:
> I am currently looking into optimized ways to run OSGi applications in
> the cloud. 
> I would like to describe how cloud native OSGi could look like.
> 
> Apart from my own experiments I would like to hear from other karaf
> users. Do you run OSGi and especially karaf applications in the cloud?
> 
> How do you build your application? How do you do releases and
> deployments? What do you do different compared to a non cloud setup.
> 
> Regards
> Christian
> 
> -- 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Computer Scientist
> http://www.adobe.com
> 


Re: How to (easily) find the bundle that implements a given interface/service?

2018-09-03 Thread Łukasz Dywicki
You can use few commands - I usually start with `la -l|grep async` which
allows to list bundle locations - quite often you can find interesting
part in maven coordinates.
Second option is `package:exports|grep async` which will show bundles
exporting packages with async fragment. Then, based on output you can
check who imports that to see if there are any consumers and possibly
service providers relying on it.
Last option is service list (`ls`) - but in such case you rather need to
know what kind of service you looking for.

Cheers,
Lukasz

On 9/3/18 3:57 PM, Thiago Moreira (timba) wrote:
> 
>   Hi all, rookie question :D
> 
>   I'm starting to play with Async
>  
> interface/service
> but I'm having hard time to find the bundle that implements the service.
> I found that these
> jars https://search.maven.org/search?q=fc:org.osgi.service.async.Async
> contains the interface and this implements it org.apache.aries.async
> 
>  but
> how to do it from the Karaf's console? I mean, there is a bunch of
> features there to be installed but which one will provided the
> implementation for my interface/service?
> 
>   Thanks
> 
> Thiago Moreira
> +55 48 99911-6331


Re: Web whiteboard: use whiteboard context instead of alias for servlet

2018-06-17 Thread Łukasz Dywicki
Hey,
I see in your code examples servlets but I can not see HttpContext instance. 
You specify org.osgi.service.http.HttpContext to be different than default but 
do not register service which have such id.

Cheers,
Łukasz
--
Code-House
http://code-house.org

> On 16 Jun 2018, at 18:31, Steinar Bang  wrote:
> 
> I'm trying to replace alias with web context for a whiteboard servlet
> started with DS.  I tried to copy-paste an example that works and edit
> it as needed.
> 
> However the end result didn't work (I just got 404 on the path), and I
> wonder where I went wrong...?
> 
> I have this servlet that works, ie. I get the expected results on
> "/ukelonn/*":
> @Component(
>property= {
>HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/*",
>HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + 
> HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +"=ukelonn)",
>HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME+"=ukelonn"},
>service=VaadinServlet.class,
>immediate=true
> )
> public class UkelonnServlet extends TouchKitServlet {
>  ...
> }
> 
> (it sort of works if the service is Servlet.class as well, just not as
> well)
> 
> So I have this:
> @Component(service={Servlet.class}, property={"alias=/frontend-karaf-demo"} )
> public class ReactServlet extends HttpServlet {
>   ...
> }
> 
> and tried replacing this with:
> @Component(
>property= {
>HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/*",
>HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + 
> HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +"=frontend-karaf-demo)",
>
> HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME+"=frontend-karaf-demo"},
>service=Servlet.class,
>immediate=true
> )
> public class ReactServlet extends HttpServlet {
>   ...
> }
> 
> But that just gave me 404 on /frontend-karaf-demo and
> /frontend-karaf-demo/
> 
> So where did I go wrong?
> 
> Thanks!
> 


Re: Karaf IoT

2017-01-04 Thread Łukasz Dywicki
Brad,
If you have service dependant on presence of some board you can make it 
conditional. Just use OSGi service lifecycle to deregister service when device 
is disconnected. Service consumers should be aware of it or at least should not 
call injected service any longer. That’s perfect use case for service tracker. 
While GPIO will physicaly never get disconnected from raspberry the connected 
device, i2c may go out at any time. Tricky part is how to detect when device 
goes offline. This can’t be done in general way and I think it needs to be 
linked with device interactions (tracking link status and when it hangs) or 
system events, but this brings us back to Kura and native libraries.

Cheers,
Lukasz
--
Apache Karaf Committer & PMC
Twitter: @ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

> Wiadomość napisana przez Brad Red Hat <bradj...@redhat.com> w dniu 4 sty 
> 2017, o godz. 22:56:
> 
> I'm still doing a bit of head scratching to figure out where I and OSGi 
> libraries fit in the Kura scheme.  Part of the problem is code samples may 
> not be the best indicator of intended use but they are what's out there. 
> Here's an example which doesn't fit how I think about OSGi services. If I 
> switch the board I'm deploy to then my code is broken. If these were injected 
> as services instead, then this device driver level bundle would be unaware of 
> the change.  Configuring it at the board bundle level also means that all 
> configuration for pins, numbers and modes is in a single place.
> 
> Well, I guess I've gone off the beaten path here and shouldn't be posting any 
> of this to the Karaf forum as it is a tangential concern here. More to the 
> point here is getting a Karaf deployment mechanism in place.
> 
> public void activate(ComponentContext componentContext) {
>   logger.info("Bundle {} is starting...", APP_ID);
> //A factory call across class loaders. Even if this is changed to inject 
> GpioController it doesn't quite work.
>   GpioController gpioController = GpioFactory.getInstance();
> //Pins and board devices should be configured and exported as named services 
> at the board level not in the application bundle.  
>   GpioPinDigitalMultipurpose motionSensor = 
> gpioController.provisionDigitalMultipurposePin(RaspiPin.GPIO_01, 
> PinMode.DIGITAL_INPUT);
> //Ditto
>   GpioPinDigitalMultipurpose motionStatusLed = 
> gpioController.provisionDigitalMultipurposePin(RaspiPin.GPIO_05, 
> PinMode.DIGITAL_OUTPUT);
> 
> 
> }
> 
> 
> -Original Message-
> From: Łukasz Dywicki [mailto:l...@code-house.org] 
> Sent: Wednesday, January 4, 2017 2:54 PM
> To: user@karaf.apache.org
> Cc: Markus Rathgeb <maggu2...@gmail.com>
> Subject: Re: Karaf IoT
> 
> I am OpenHab (OH) 2 user and I I must say that whole PDE thing is redundant 
> from my Karaf (as a platform) point of view. But this all comes from past of 
> project which was launched with Tycho and PDE since early days. There are 
> multiple entities involved in project and it is not an easy task to redefine 
> how things should be built.
> 
> Initial apis of OH were quite simple and didn’t require anything strictly 
> related to physical thing. Starting form OH2 and extraction of Eclipse 
> SmartHome there is a seperation of concerns. OH2 bindings define Bridge and 
> Things connected over it and may have Channels associated with every of 
> these. At this stage it is lowest common denominator. There is no higher 
> level APIs for representing pumps, boilers or sensors or alarms but from 
> other hand OH is not a SCADA platform. Maybe at some point there will be 
> further generalization of code which will allow bindings to gain some 
> benefits? Many of bindings is pure software integration with vendor bridges 
> having very little or no hardware involved at all which makes it easier to 
> develop.
> 
> I haven’t played with Kura so far because I didn’t need such low level 
> library, but even if I would need something such that I would rather go for 
> dedicated library handling specific use case instead of Kura which brings too 
> much. 
> 
> Kind regards,
> Lukasz
> --
> Apache Karaf Committer & PMC
> Twitter: @ldywicki
> Blog: http://dywicki.pl
> Code-House - http://code-house.org
> 
> 
>> Wiadomość napisana przez chris.g...@kiffer.ltd.uk w dniu 2 sty 2017, o godz. 
>> 19:56:
>> 
>> I share most of Brad's concerns; at first I was very interested in 
>> OpenHAB but after playing with it for a bit I began to think about 
>> designing a new service layer and then seeing if I could fit the 
>> OpenHAB native libraries to it.
>> 
>> OpenHAB corroborates my "PDE considered harmful" theory; it must be 
>> possible to use OSGi idioms effectively while developing in Eclipse 
>> PDE, but it doesn't seem to happen in practice.
>> 
>> So Brad, I am right with you and I would like to help - but I am 
>> seriously short of time at the moment :-(
>> 
>> 
>> 
>> 
> 
> 



Re: Karaf IoT

2017-01-04 Thread Łukasz Dywicki
I am OpenHab (OH) 2 user and I I must say that whole PDE thing is redundant 
from my Karaf (as a platform) point of view. But this all comes from past of 
project which was launched with Tycho and PDE since early days. There are 
multiple entities involved in project and it is not an easy task to redefine 
how things should be built.

Initial apis of OH were quite simple and didn’t require anything strictly 
related to physical thing. Starting form OH2 and extraction of Eclipse 
SmartHome there is a seperation of concerns. OH2 bindings define Bridge and 
Things connected over it and may have Channels associated with every of these. 
At this stage it is lowest common denominator. There is no higher level APIs 
for representing pumps, boilers or sensors or alarms but from other hand OH is 
not a SCADA platform. Maybe at some point there will be further generalization 
of code which will allow bindings to gain some benefits? Many of bindings is 
pure software integration with vendor bridges having very little or no hardware 
involved at all which makes it easier to develop.

I haven’t played with Kura so far because I didn’t need such low level library, 
but even if I would need something such that I would rather go for dedicated 
library handling specific use case instead of Kura which brings too much. 

Kind regards,
Lukasz
--
Apache Karaf Committer & PMC
Twitter: @ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org


> Wiadomość napisana przez chris.g...@kiffer.ltd.uk w dniu 2 sty 2017, o godz. 
> 19:56:
> 
> I share most of Brad's concerns; at first I was very interested in OpenHAB
> but after playing with it for a bit I began to think about designing a new
> service layer and then seeing if I could fit the OpenHAB native libraries
> to it.
> 
> OpenHAB corroborates my "PDE considered harmful" theory; it must be
> possible to use OSGi idioms effectively while developing in Eclipse PDE,
> but it doesn't seem to happen in practice.
> 
> So Brad, I am right with you and I would like to help - but I am seriously
> short of time at the moment :-(
> 
> 
> 
> 



Re: PaxOsgi Appender

2016-12-04 Thread Łukasz Dywicki
Hey Nicolas,
This appender is used to keep latest events in memory so log:tail and other log 
related commands can be applied on top of collected data. Since Karaf might be 
configured to just send log events over the wire we can’t rely on log file, 
even if we might know log format from configuration. You can safely remove this 
appender, but this will affect log commands.

Best regards,
Lukasz
—
Apache Karaf Committer & PMC
Twitter: @ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org


> Wiadomość napisana przez Nicolai Stäger  w dniu 17 lis 2016, 
> o godz. 18:10:
> 
> Hi everyone,
> we are using Karaf with Log4j2. But we are wondering, what the  
> appender does. I cannot find any documentation on this. You can find it here 
> in the example:https://karaf.apache.org/manual/latest/#_log4j_v2_support 
>  Can anyone help 
> me out, what this thing does?
> Thanks in advance,
> Nicolai
>  
>  



Re: Consider adding GELF Log4J 2 appender in Karaf 4.1.x by default

2016-03-19 Thread Łukasz Dywicki
Hey Vladimir,
While I see reasoning to have this feature, I must say it is not a core 
requirement to all users. If we would decide to have such appender we easily 
can run into situation that everyone will want to have it’s own appender and 
it’s dependencies installed/available by default in Karaf. Sadly (in my 
perception) we can’t agree for that. If you would like to push this forward 
please answer to this mail and send reply to d...@karaf.apache.org 
 so we could continue there. We need to keep in 
mind, that logging is part of foundation functionalities offered in Karaf 
available in same shape under minimal distribution. 

What I can recommend you is custom (re)packaging of Karaf. This will avoid 
troubles with manual modifications in configuration files and can be fully 
automated with maven tooling we offer. All you need to do is proper feature 
definition which will cause generation of startup.properties. You can also 
override default configuration files (ie. org.ops4j.pax.logging.cfg). In this 
way you will be able to produce Karaf assembly right for you, your clients and 
colleagues. 

Kind regards,
Lukasz
—
Apache Karaf Committer & PMC
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org


> Wiadomość napisana przez Владимир Коньков  w dniu 16 mar 
> 2016, o godz. 11:32:
> 
> Hi
> 
> As of version 4.1 Karaf will use Log4J 2 as logging backend (thanx, 
> Guillaume). It’s very good news, because it greatly simplify configuration of 
> robust production logging - compression, flexible rotation rules, async, 
> fallback logging. All this features comes out of the box with Log4J 2. No 
> more custom appenders needs to be installed at first start time to achieve 
> basic production quality configuration.
> 
> But for advanced production logging one option is missing out of the box - 
> logging analysis tools integration, line ELK, Fluentd, Graylog, Splunk. To 
> achieve this capability in robust way we should again install custom appender 
> ( like https://github.com/Graylog2/log4j2-gelf 
>  ) at first start time.
> 
> I know, it can be installed as regular bundle fragment after first startup. 
> But installing appender this way has some drawbacks that make it unacceptable 
> for production usage:
> 1. First startup logs not coming in appender installed after start. (stopper 
> for automated deployments)
> 2. If appender configured before bundle cache initialization - there is 
> errors in file logs about missing appender class. Cache clean up is not so 
> rare on production deployment, usually it is simpler to clean cache before 
> some major software update that dealing with deps conflicts on upgrade.
> 3. After installation of custom appender bundle host bundle should be 
> refreshed (some log entries may be lost).
> 
> If custom appender is MAIN logging channel restriction above not acceptable 
> for us. Workaround is simple but very inconvenient to support for different 
> versions of Karaf:
>  - add appender jar to system lib
>  - modify startup.properties to incude appender bundle
> 
> My proposal: include GELF Log4J 2 appender in standart distribution. In such 
> way we provide log streaming capability to all major logging analysis tools. 
> Because of growing adoption of log analysis tools it may be good addition to 
> Karaf feature portfolio in addition to own solution Decanter.
> 
> I can provide PR on Github with carefully repackaged appender lib that not 
> export anything to other bundles.
> 
> What do you think?
> 
> Thanx,
> Vladimir Konkov
> 



Re: Dynamic Config Loading in Camel Application Bundle in Karaf 3.0.5

2016-03-03 Thread Łukasz Dywicki

Hey Debraj,
If you would like to reload just your bean add  element 
inside „configBean” definition. Each update will result in calling given 
method. I don’t remember if it will set properties first. Other strategy which 
you could try is container-managed. For sure both will behave as managed 
service proxy.

Best regards,
Łukasz
—
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org



> Wiadomość napisana przez Debraj Manna  w dniu 2 mar 
> 2016, o godz. 12:50:
> 
> 
> I have a simple Camel Application bundle which is to be deployed in Karaf 
> 3.0.5 under Apache Service Mix 6.1. The configuration file is placed in etc/ 
> directory (let's say it is named as wf.cfg). I want to have the dynamic 
> config change functionality in my application bundle. So that whenever 
> something is changed in wf.cfg it is immediately available to bundle. For 
> this I have added the following in my blueprint.xml
> 
>  update-strategy="reload">
> 
> 
> 
> 
> 
> 
>  class="com.jabong.orchestratorservice.basecomponent.config.ConfigBean">
> 
> 
> 
> 
> The problem I am facing now is if the update-strategy is set to reload. Then 
> it seems to be reloading the entire bean.
> 
> Can someone let me know is there a way I can reload only the configBean not 
> the entire bundle? If I can achieve this then may be I can have some static 
> reference to the config variables inside the configBean which my application 
> bundle can then make use of?
> 
> The full blueprint.xml is placed here 
> .
> 
> 
> 
> 
> 
> 
> 



Re: Features : Install using wrap

2016-02-27 Thread Łukasz Dywicki
Done. Next time please add issue so you can refer it in commit message. :-) 

Best regards,
Łukasz
—
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

> Wiadomość napisana przez Matthieu Vincent <mvincent...@gmail.com> w dniu 25 
> lut 2016, o godz. 16:13:
> 
> ping ;)
> 
> 2016-02-25 15:49 GMT+01:00 Łukasz Dywicki <l...@code-house.org 
> <mailto:l...@code-house.org>>:
> Matthieu,
> If you have time for making doc update please do, I can review your PR and 
> push it for you. Just ping me when you submit it.
> 
> Cheers,
> Lukasz
> 
> 
>> Wiadomość napisana przez Matthieu Vincent <mvincent...@gmail.com 
>> <mailto:mvincent...@gmail.com>> w dniu 25 lut 2016, o godz. 15:45:
>> 
>> Confirm : it worked.
>> 
>> I planned to pull request for doc but if Lukasz already has rights, it would 
>> be quicker :)
>> 
>> 2016-02-25 15:12 GMT+01:00 Achim Nierbeck <bcanh...@googlemail.com 
>> <mailto:bcanh...@googlemail.com>>:
>> hey Lukasz, 
>> 
>> you have the rights to change it, so go ahead and document it ;)
>> 
>> regards, Achim 
>> 
>> 
>> 2016-02-25 15:10 GMT+01:00 Łukasz Dywicki <l...@code-house.org 
>> <mailto:l...@code-house.org>>:
>> Hey Achim,
>> Would be great to get a section in docs about that. I’ve found just blog 
>> post [1] which is describing that, but I belive best place for that is 
>> official guide.
>> 
>> [1] http://blog.tonyganchev.com/beginning-karaf/ 
>> <http://blog.tonyganchev.com/beginning-karaf/>
>> 
>> Cheers,
>> Łukasz
>> --
>> l...@code-house.org <mailto:l...@code-house.org>
>> Twitter: ldywicki
>> Blog: http://dywicki.pl <http://dywicki.pl/>
>> Code-House - http://code-house.org <http://code-house.org/>
>>> Wiadomość napisana przez Achim Nierbeck <bcanh...@googlemail.com 
>>> <mailto:bcanh...@googlemail.com>> w dniu 25 lut 2016, o godz. 11:02:
>>> 
>>> yes, you need to add a dependency to your feature with the wrap feature: 
>>> 
>>> wrap 
>>> 
>>> in your feature definition. 
>>> If you have a custom build, make sure that the karaf std. features are 
>>> "grouped" via brackets "(feature1, feature2, ...),(custom-feature)" 
>>> in your karaf-maven-plugin section. 
>>> 
>>> regards, Achim 
>>> 
>>> 
>>> 2016-02-25 10:56 GMT+01:00 Matthieu Vincent <mvincent...@gmail.com 
>>> <mailto:mvincent...@gmail.com>>:
>>> Hi,
>>> 
>>> I'm trying to upgrade to Karaf v4.0.4 but i'm facing a problem wityh the 
>>> wrap mode for bundle installation.
>>> 
>>> I've tried to upgrade the definition to (according to documentation 
>>> https://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html
>>>  
>>> <https://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html>)
>>>  : 
>>> 
>>> >> start-level="80">wrap:mvn:net.sf.ehcache/ehcache-core/2.6.11$Bundle-SymbolicName=ehcache-coreBundle-Version=2.6.11;
>>> 
>>> But I get the following error when launching Karaf : 
>>> 
>>> Caused by: java.net.MalformedURLException: Unknown protocol: wrap
>>> at java.net.URL.(URL.java:620)[:1.8.0_65]
>>> at java.net.URL.(URL.java:483)[:1.8.0_65]
>>> at java.net.URL.(URL.java:432)[:1.8.0_65]
>>> at 
>>> org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[9:org.apache.karaf.features.core:4.0.4]
>>> ... 8 more
>>> Caused by: java.lang.IllegalStateException: Unknown protocol: wrap
>>> at 
>>> org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)[org.apache.felix.framework-5.4.0.jar:]
>>> at java.net.URL.(URL.java:615)[:1.8.0_65]
>>> ... 11 more
>>> 
>>> Any idea ?
>>> Thanks
>>> 
>>> 
>>> 
>>> -- 
>>> 
>>> Apache Member
>>> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> 
>>> Committer & PMC
>>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
>>> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
>>> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
>>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
>>> <http://bit.ly/1ps9rkS>>
>>> 
>>> Software Architect / Project Manager / Scrum Master 
>>> 
>> 
>> 
>> 
>> 
>> -- 
>> 
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> Committer 
>> & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
>> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
>> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
>> <http://bit.ly/1ps9rkS>>
>> 
>> Software Architect / Project Manager / Scrum Master 
>> 
>> 
> 
> 



Re: Features : Install using wrap

2016-02-25 Thread Łukasz Dywicki
Matthieu,
If you have time for making doc update please do, I can review your PR and push 
it for you. Just ping me when you submit it.

Cheers,
Lukasz


> Wiadomość napisana przez Matthieu Vincent <mvincent...@gmail.com> w dniu 25 
> lut 2016, o godz. 15:45:
> 
> Confirm : it worked.
> 
> I planned to pull request for doc but if Lukasz already has rights, it would 
> be quicker :)
> 
> 2016-02-25 15:12 GMT+01:00 Achim Nierbeck <bcanh...@googlemail.com 
> <mailto:bcanh...@googlemail.com>>:
> hey Lukasz, 
> 
> you have the rights to change it, so go ahead and document it ;)
> 
> regards, Achim 
> 
> 
> 2016-02-25 15:10 GMT+01:00 Łukasz Dywicki <l...@code-house.org 
> <mailto:l...@code-house.org>>:
> Hey Achim,
> Would be great to get a section in docs about that. I’ve found just blog post 
> [1] which is describing that, but I belive best place for that is official 
> guide.
> 
> [1] http://blog.tonyganchev.com/beginning-karaf/ 
> <http://blog.tonyganchev.com/beginning-karaf/>
> 
> Cheers,
> Łukasz
> --
> l...@code-house.org <mailto:l...@code-house.org>
> Twitter: ldywicki
> Blog: http://dywicki.pl <http://dywicki.pl/>
> Code-House - http://code-house.org <http://code-house.org/>
>> Wiadomość napisana przez Achim Nierbeck <bcanh...@googlemail.com 
>> <mailto:bcanh...@googlemail.com>> w dniu 25 lut 2016, o godz. 11:02:
>> 
>> yes, you need to add a dependency to your feature with the wrap feature: 
>> 
>> wrap 
>> 
>> in your feature definition. 
>> If you have a custom build, make sure that the karaf std. features are 
>> "grouped" via brackets "(feature1, feature2, ...),(custom-feature)" 
>> in your karaf-maven-plugin section. 
>> 
>> regards, Achim 
>> 
>> 
>> 2016-02-25 10:56 GMT+01:00 Matthieu Vincent <mvincent...@gmail.com 
>> <mailto:mvincent...@gmail.com>>:
>> Hi,
>> 
>> I'm trying to upgrade to Karaf v4.0.4 but i'm facing a problem wityh the 
>> wrap mode for bundle installation.
>> 
>> I've tried to upgrade the definition to (according to documentation 
>> https://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html
>>  
>> <https://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html>)
>>  : 
>> 
>> > start-level="80">wrap:mvn:net.sf.ehcache/ehcache-core/2.6.11$Bundle-SymbolicName=ehcache-coreBundle-Version=2.6.11;
>> 
>> But I get the following error when launching Karaf : 
>> 
>> Caused by: java.net.MalformedURLException: Unknown protocol: wrap
>>  at java.net.URL.(URL.java:620)[:1.8.0_65]
>>  at java.net.URL.(URL.java:483)[:1.8.0_65]
>>  at java.net.URL.(URL.java:432)[:1.8.0_65]
>>  at 
>> org.apache.karaf.features.internal.download.impl.SimpleDownloadTask.download(SimpleDownloadTask.java:62)[9:org.apache.karaf.features.core:4.0.4]
>>  ... 8 more
>> Caused by: java.lang.IllegalStateException: Unknown protocol: wrap
>>  at 
>> org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)[org.apache.felix.framework-5.4.0.jar:]
>>  at java.net.URL.(URL.java:615)[:1.8.0_65]
>>  ... 11 more
>> 
>> Any idea ?
>> Thanks
>> 
>> 
>> 
>> -- 
>> 
>> Apache Member
>> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> Committer 
>> & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
>> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
>> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
>> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
>> <http://bit.ly/1ps9rkS>>
>> 
>> Software Architect / Project Manager / Scrum Master 
>> 
> 
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf <http://karaf.apache.org/ <http://karaf.apache.org/>> Committer 
> & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/ 
> <http://wiki.ops4j.org/display/paxweb/Pax+Web/>> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/ <http://notizblog.nierbeck.de/>>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS 
> <http://bit.ly/1ps9rkS>>
> 
> Software Architect / Project Manager / Scrum Master 
> 
> 



Re: iPOJO + Jersey + Quartz + Swagger on Karaf 4.0

2016-01-14 Thread Łukasz Dywicki
FYI I’ve created swagger wrapper which integrates it with Karaf/CXF in the way 
it is possible to generate composite JSON descriptor for all JAX-RS services 
running currently in Karaf. Descriptor is refreshed every time when service 
goes down.

Source code for that is available here:
https://github.com/Code-House/karaf-swagger 
<https://github.com/Code-House/karaf-swagger>

Kind regards,
Łukasz Dywicki
—
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org


> Wiadomość napisana przez Jean-Baptiste Onofré <j...@nanthrax.net> w dniu 14 
> sty 2016, o godz. 10:38:
> 
> Hi Andy,
> 
> great job !
> 
> What's exactly the target and use cases of the library ?
> Do you plan to donate it to Karaf (or karaf-boot) ?
> 
> Thanks !
> Regards
> JB
> 
> On 01/13/2016 10:13 PM, AndyPhillips404 wrote:
>> I wanted to send a note out to Karaf users, in case anyone is interested,
>> that i have started posting some of the foundation library i have built for
>> some startups I've been a part of.   I genually hope this is useful to
>> someone who wants a quick start to build some applications using Jersey as
>> opposed to CXF.
>> 
>> The library includes a Jersey implementation rest client, a fuller featured
>> quartz scheduler that allows for multiple schedulers and iPOJO instantiation
>> of jobs, and native Karaf 4.0 commands.   The implementation also supports
>> Swagger / OpenAPI generation as well.
>> 
>> POJO is used internally but is not necessarily required to use the library
>> if the other features are of benefit and exposed as standard service
>> interfaces.
>> 
>> https://github.com/andyphillips404/awplab-core
>> 
>> I hope it is found to be useful.   Love Karaf.  I have a rest interface to
>> the scheduler coming as well.  Good work!
>> 
>> Thanks!
>> Andy P
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://karaf.922171.n3.nabble.com/iPOJO-Jersey-Quartz-Swagger-on-Karaf-4-0-tp4044820.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: How to avoid getting two servicemix-specs versions when installing camel or cxf 's feature

2015-08-19 Thread Łukasz Dywicki
Hey,
It does work for things installed by via features, it doesn’t work with bundles 
enlisted in startup.properties.

Best regards,
Lukasz

 Wiadomość napisana przez Aki Yoshida elak...@gmail.com w dniu 19 sie 2015, 
 o godz. 15:54:
 
 Hi Lukasz,
 thanks for this info about the override option.
 Is this supported by karaf-3.0.4? It doesn't seem to be working there.
 
 regards, aki
 
 2015-08-11 9:39 GMT+02:00 Łukasz Dywicki l...@code-house.org:
 For now you can use overrides mechanism. In etc create file named 
 overrides.properties and place:
 mvn:org.apache.servicemix.specs/…./2.4.0;version=[2.2.0,3)
 
 This will force features service to install version 2.4.0 for anything from 
 range 2.2.0-3.0.
 
 Kind regards,
 Lukasz
 
 Wiadomość napisana przez Aki Yoshida elak...@gmail.com w dniu 5 sie 2015, 
 o godz. 19:12:
 
 Hi JB,
 
 Thanks for the explanation.
 
 For the current snapshot version of camel (2.16-SNAPSHOT and
 2.15.3-SNAPSHOT), we used approach 1 to solve this problem for now.
 If the spec features are made available in one of the Karaf's repos as
 in approach 2, that will be great. This can avoid this problem for
 other combination in the future or with a combination with other
 components that also can use this shared features to avoid getting
 into this problem.
 Will you be providing the spec features as in approach 2?
 
 Regards, aki
 
 
 
 2015-08-05 17:28 GMT+02:00 Jean-Baptiste Onofré j...@nanthrax.net:
 Hi Aki,
 
 We have different ways:
 1/ we align CXF and Camel to the same spec bundle version. As spec 
 bundles
 are pretty stable in term of release, I think it's probably the easiest
 move, but we don't actually fix the problem if we use old version of one of
 the two.
 2/ remove spec from CXF and Camel and put a spec feature directly in Karaf,
 as we do for jetty, etc.
 3/ provision spec bundle in the lib folder as we do for activator spec
 bundle
 
 Probably 2 would make sense. Anyway, we will have to update CXF and Camel 
 to
 refer to provided spec feature. With Karaf 4 and the new feature resolver,
 it would be better to use feature requirements and let the resolver deals
 with spec bundle.
 
 Regards
 JB
 
 
 On 08/05/2015 11:38 AM, Aki Yoshida wrote:
 
 Originally, I posted the following mail to dev@camel regarding this issue.
 
 http://camel.465427.n5.nabble.com/Installing-camel-cxf-2-15-2-feature-leads-to-two-versions-of-ServiceMix-Stax-API-bundles-installed-td5769830.html
 
 Currently, both camel and cxf have their features that directly
 installing some servicemix-specs bundles. This leads to the problem
 mentioned in the above mail thread that installing camel-cxf leads to
 installing two versions of servicemix-spec because camel-2.15.2 is
 using smx-specs 2.2.0 while cxf-3.0.4 referred in camel-2.15.2 is
 using smx-specs 2.4.0.
 
 I am wondering if we need to define this feature (e.g., feature
 stax-api-1.0) outside of camel and cxf and both refer to this external
 feature using the appropriate version range e.g. [2.2,3) or we can
 locally solve this problem within camel and cxf's feature definitions?
 
 I would appreciate for your comments.
 
 regards, aki
 
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com
 



Re: How to avoid getting two servicemix-specs versions when installing camel or cxf 's feature

2015-08-11 Thread Łukasz Dywicki
For now you can use overrides mechanism. In etc create file named 
overrides.properties and place:
mvn:org.apache.servicemix.specs/…./2.4.0;version=[2.2.0,3)

This will force features service to install version 2.4.0 for anything from 
range 2.2.0-3.0.

Kind regards,
Lukasz

 Wiadomość napisana przez Aki Yoshida elak...@gmail.com w dniu 5 sie 2015, o 
 godz. 19:12:
 
 Hi JB,
 
 Thanks for the explanation.
 
 For the current snapshot version of camel (2.16-SNAPSHOT and
 2.15.3-SNAPSHOT), we used approach 1 to solve this problem for now.
 If the spec features are made available in one of the Karaf's repos as
 in approach 2, that will be great. This can avoid this problem for
 other combination in the future or with a combination with other
 components that also can use this shared features to avoid getting
 into this problem.
 Will you be providing the spec features as in approach 2?
 
 Regards, aki
 
 
 
 2015-08-05 17:28 GMT+02:00 Jean-Baptiste Onofré j...@nanthrax.net:
 Hi Aki,
 
 We have different ways:
 1/ we align CXF and Camel to the same spec bundle version. As spec bundles
 are pretty stable in term of release, I think it's probably the easiest
 move, but we don't actually fix the problem if we use old version of one of
 the two.
 2/ remove spec from CXF and Camel and put a spec feature directly in Karaf,
 as we do for jetty, etc.
 3/ provision spec bundle in the lib folder as we do for activator spec
 bundle
 
 Probably 2 would make sense. Anyway, we will have to update CXF and Camel to
 refer to provided spec feature. With Karaf 4 and the new feature resolver,
 it would be better to use feature requirements and let the resolver deals
 with spec bundle.
 
 Regards
 JB
 
 
 On 08/05/2015 11:38 AM, Aki Yoshida wrote:
 
 Originally, I posted the following mail to dev@camel regarding this issue.
 
 http://camel.465427.n5.nabble.com/Installing-camel-cxf-2-15-2-feature-leads-to-two-versions-of-ServiceMix-Stax-API-bundles-installed-td5769830.html
 
 Currently, both camel and cxf have their features that directly
 installing some servicemix-specs bundles. This leads to the problem
 mentioned in the above mail thread that installing camel-cxf leads to
 installing two versions of servicemix-spec because camel-2.15.2 is
 using smx-specs 2.2.0 while cxf-3.0.4 referred in camel-2.15.2 is
 using smx-specs 2.4.0.
 
 I am wondering if we need to define this feature (e.g., feature
 stax-api-1.0) outside of camel and cxf and both refer to this external
 feature using the appropriate version range e.g. [2.2,3) or we can
 locally solve this problem within camel and cxf's feature definitions?
 
 I would appreciate for your comments.
 
 regards, aki
 
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: get bundle version in pax exam test

2015-08-11 Thread Łukasz Dywicki
If you work with features then declare its descriptor as dependency to itests:

dependency
groupIdorg.code-house.webconsole/groupId
artifactIdfeatures/artifactId
classifierfeatures/classifier
typexml/type
/dependency
Then use servicemix-depends plugin to drop all the versions from maven into 
property file used by pax-exam:

build
plugins
plugin
groupIdorg.apache.servicemix.tooling/groupId
artifactIddepends-maven-plugin/artifactId
executions
execution
idgenerate-depends-file/id
goals
goalgenerate-depends-file/goal
/goals
/execution
/executions
/plugin
/plugins
/build
At the end you can reference artifact in your tests without any problem:

@Configuration
public Option[] config() {
String featuresUrl = maven(org.code-house.webconsole, 
features).classifier(features).type(xml).versionAsInProject().getURL();
String karafVersion = MavenUtils.getArtifactVersion(org.apache.karaf, 
apache-karaf);
MavenArtifactUrlReference frameworkURL = maven(org.apache.karaf, 
apache-karaf).type(zip).version(karafVersion);

return new Option[]{

karafDistributionConfiguration().karafVersion(karafVersion).frameworkUrl(frameworkURL),
editConfigurationFileExtend(etc/org.apache.karaf.features.cfg, 
featuresRepositories, , + featuresUrl),
editConfigurationFileExtend(etc/org.ops4j.pax.url.mvn.cfg, 
org.ops4j.pax.url.mvn.repositories, , +
additional project repositories),
};
}

Kind regards,
Lukasz
—
Apache Karaf commiter  PMC
Code-House http://code-house.org http://code-house.org/
Blog http://dywicki.pl http://dywicki.pl/
Twitter @ldywicki


 Wiadomość napisana przez Marco Westermann m...@intersales.de w dniu 31 lip 
 2015, o godz. 13:59:
 
 Hi,
 
 I try to test if my feature works as expected via pax exam.
 
 Imagine my project structure as follows:
 
 |
 |-my.bundle
 |-features
 |-itests
 |-pom.xml
 
 
 so I have a parent pom which defines the version for all child poms. the 
 feature contains the installation of the my.bundle with version 
 ${project.version}. In the itest I would like to test if the correct version 
 of my.bundle is installed without errors.
 
 therefor I install the feature in the configure method and now I would like 
 to test if the bundle is installed. I got it working to test if the bundle is 
 installed but I struggle around with the correct version as I don't know the 
 correct version in the test. What I would like to do is: get the 
 ${project.version} value in the test method. First I tried to provide it via 
 system-property via surefire configuration, but I guess the system property 
 is not available in karaf container when executing the test.
 
 The next approach was to get the test bundle version via:
 
 bundleContext.getBundle().getVersion().toString() but the provisioning bundle 
 created by pax exam always has the version 0.0.0
 
 
 Is there another way to determine the correct version?
 
 best regards, Marco
 
 -- 
 ++ Business-Software aus einer Hand ++
 ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
 http://www.intersales.de http://www.intersales.de/
 http://www.eisxen.org http://www.eisxen.org/
 http://www.tarantella-partner.de http://www.tarantella-partner.de/
 http://www.medisales.de http://www.medisales.de/
 http://www.eisfair.net http://www.eisfair.net/
 
 interSales AG Internet Commerce
 Weinsbergstr. 190 
 50825 Köln
 
 Tel  02 21 - 27 90 50
 Fax  02 21 - 27 90 517
 Mail isi...@intersales.de mailto:isi...@intersales.de
 Mail m...@intersales.de mailto:m...@intersales.de
 Web  www.intersales.de http://www.intersales.de/
 
 Handelsregister Köln HR B 30904
 Ust.-Id.: DE199672015
 Finanzamt Köln-Nord. UstID: nicht vergeben
 Aufsichtsratsvorsitzender: Michael Hippler
 Vorstand: Andrej Radonic, Peter Zander 



Re: Integration Test by PAX-EXAM

2015-06-04 Thread Łukasz Dywicki
If you use proxy repository and you have non-standard maven installation (no 
repo at ~/.m2/repository) it’s possible that pax-exam rely on defaults thus it 
doesn’t recognize your local repository/maven settings.

Make sure your maven settings are located in ~/.m2/settings.xml not in 
M2_HOME/conf/settings.xml.

Cheers,
Lukasz

 Wiadomość napisana przez hsinchen hcts...@gmail.com w dniu 4 cze 2015, o 
 godz. 03:59:
 
 Hi,
 
 I would like to do testing with PAX-EAXM for Karaf. But, meeting Maven
 connection problem. 
 
 Caused by: java.io.IOException: Error resolving artifact
 org.apache.karaf:apache-karaf:zip:3.0.1: Could not transfer artifact
 org.apache.karaf:apache-karaf:zip:3.0.1 from/to central
 (http://repo1.maven.org/maven2/): Error transferring file: Connection timed
 out: connect
 
 We have internal Nexus to mirror outside repositories. During the compiling,
 all of dependency libraries including the Karaf 3.0.1 are downloaded from
 the internal Nexus. I could see it at local maven repository. But, it seems
 that the testing code would connect the outside repository directly, but not
 local maven repository or the internal Nexus repository. May I know how to
 change it to access our internal repository?
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Integration-Test-by-PAX-EXAM-tp4040735.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Capturing bundle load errors...

2015-04-02 Thread Łukasz Dywicki
Hey Tmhull,
There are two stages of installation which are covered by fileinstall - first 
one is bringing bundle to system, second starting it up. You can manage to do 
such thing via BundleContext instance. Code is not hard since all necessary 
functionalities are delivered by OSGi framework out of the box.

String url = file:/opt/repository/bundle-1.0.jar;
try {
Bundle bundle = bundleContext.install(url);

try {
bundle.start();
} catch (BundleException e) {
// bundle could not be started due to:
// {@link BundleException#NATIVECODE_ERROR},
// {@link BundleException#RESOLVE_ERROR},
// {@link BundleException#STATECHANGE_ERROR}, and
// {@link BundleException#ACTIVATOR_ERROR}.
} catch (IllegalStateException e) {
// bundle is uninstalled OR bundle tries to update itself
} catch (SecurityException e)
// no privileges to run
}
} catch (BundleException e) {
// unable to install bundle due one of these reasons:
// {@link BundleException#READ_ERROR}
// {@link BundleException#DUPLICATE_BUNDLE_ERROR},
// {@link BundleException#MANIFEST_ERROR}, and
// {@link BundleException#REJECTED_BY_HOOK}
} catch (IllegalStateException e) {
// called bundle context is invalid
} catch (SecurityException e) {
// no privileges to install 
}

I don’t know details of your system, however most of cases are
a) bundle installation location is invalid
b) resolving bundle dependencies fails

Kind regards,
Lukasz,
—
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

 Wiadomość napisana przez thully tmh...@eng.ucsd.edu w dniu 2 kwi 2015, o 
 godz. 04:43:
 
 Hi,
 
 Our project (Cytoscape) utilizes Karaf 3 as its framework for OSGi bundle
 management. In our application, end users are able to install bundles -
 either from our App Store or from disk. These bundles are stored in a
 subdirectory of the user's home that is managed by Felix FileInstall.
 
 Anyway, I was wondering if there is any way to capture bundle load errors
 programmatically so that our application can respond to them (i.e. by
 displaying an error message, offering the user the choice to uninstall the
 bundle, etc etc). It seems that since FileInstall starts the bundles, there
 is no way to capture these aside from scraping the log. 
 
 Would it be a better approach to simply not use FileInstall at all and
 manage our own local bundles? If that might be a good approach, how can we
 change its settings such that it won't scan for JAR files?
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Capturing-bundle-load-errors-tp4039419.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Error in WebService Call

2014-09-17 Thread Łukasz Dywicki
Hey Laci,
I'm not an expert on linux environment, however you might have system proxy
specified and JVM reuses it.

Cheers,
Lukasz

2014-09-15 9:35 GMT+02:00 Laci Gaspar laci...@gmail.com:

 Hi
 I have another strange error in one of my karaf installations.

 I'm calling a WebService (https) using cxf. In one karaf installation it
 works, it the other I get:
 Caused by: java.io.IOException: Unable to tunnel through proxy. Proxy
 returns HTTP/1.1 403 Forbidden
 at sun.net.www.protocol.http.HttpURLConnection.doTunneling(
 HttpURLConnection.java:1873)
 at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnec
 tion.connect(AbstractDelegateHttpsURLConnection.java:183)
 at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(
 HttpURLConnection.java:1091)
 at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(
 HttpsURLConnectionImpl.java:250)
 at org.apache.cxf.transport.http.URLConnectionHTTPConduit$
 URLConnectionWrappedOutputStream.setupWrappedStream(
 URLConnectionHTTPConduit.java:168)
 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
 handleHeadersTrustCaching(HTTPConduit.java:1282)
 at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
 onFirstWrite(HTTPConduit.java:1238)
 at org.apache.cxf.transport.http.URLConnectionHTTPConduit$
 URLConnectionWrappedOutputStream.onFirstWrite(
 URLConnectionHTTPConduit.java:195)
 at org.apache.cxf.io.AbstractWrappedOutputStream.write(
 AbstractWrappedOutputStream.java:47)
 at org.apache.cxf.io.AbstractThresholdOutputStream.write(
 AbstractThresholdOutputStream.java:69)
 at org.apache.cxf.transport.http.HTTPConduit$
 WrappedOutputStream.close(HTTPConduit.java:1295)
 ... 30 more

 What is strange about this, is that I don't actually use a proxy. There is
 no system property http(s)_proxy defined.

 Any idea what could cause this?

 Thanks!
 Laci




Re: karaf with gwt

2014-06-24 Thread Łukasz Dywicki
Once again I'll replay this: you don't need gwt-user and any of it's
dependencies under OSGi because you don't run hosted mode in the Karaf
and after build you should have just html/css/javascript resources
packaged as a WAR ready to launch. No need to deploy JAR containing
your client project binaries which are not used in runtime at all..

Best regards,
Lukasz
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

2014-06-24 8:13 GMT+02:00 Jean-Baptiste Onofré j...@nanthrax.net:
 Hi,

 ouoh ouoh:

 1/ the tutorial is no more up to date in terms of bundle version (2011 !!)
 2/ The json bundle has been release. You can use:
 install -s
 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/20090211_1
 2/ The json-lib bundle doesn't start probably due to a missing dependency
 (take a look in the log)
 3/ I released GWT bundles: you have gwt-dev 2.4.0_1 and 2.6.0_1, but also
 gwt-servlet 2.6.0_1, gwt-user 2.4.0_1 and 2.6.0_1. Use these releases
 instead of the SNAPSHOTs.
 4/ feature:repo-add
 https://repository.apache.org/content/repositories/snapshots/ is not
 correct. The SNAPSHOT repository is already part of
 etc/org.ops4j.pax.url.mvn.cfg. The feature:repo-add command expect a feature
 XML.

 Regards
 JB

 On 06/24/2014 07:10 AM, parker wrote:

 Hi,

 I would like to use Karaf with GWT , can you recommend to me a tutorial
 with
 GWT who is working well ?


 I try to do this tutorial :

 http://cmoulliard.blogspot.fr/2011/12/run-google-web-toolkit-2-project-on.html

 but I have these errors :

 karaf@root() install -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/1.3.9_1
 Bundle ID: 206
 karaf@root() install -s

 mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr303-api-1.0.0/1.9.0
 Bundle ID: 207
 karaf@root() install -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/20090211_1-SNAPSHOT
 Bundle IDs:
 Error executing command: Error installing bundles:
  Unable to install bundle

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/20090211_1-SNAPSHOT
 karaf@root()  install -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 Bundle ID: 209
 Error executing command: Error installing bundles:
  Unable to start bundle

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 karaf@root()  install -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 Bundle ID: 209
 Error executing command: Error installing bundles:
  Unable to start bundle

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 karaf@root()
 karaf@root()
 karaf@root() install -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-dev/2.4.0_1-SNAPSHOT
 Bundle IDs:
 Error executing command: Error installing bundles:
  Unable to install bundle

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-dev/2.4.0_1-SNAPSHOT
 karaf@root() uninstall -s

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 Error executing command bundle:uninstall: undefined option -s
 Try command --help' for more information.
 karaf@root() uninstall

 mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
 No bundles specified.
 karaf@root()
 karaf@root() feature:repo-add
 https://repository.apache.org/content/repositories/snapshots/
 Adding feature url
 https://repository.apache.org/content/repositories/snapshots/
 [Fatal Error] :11:5: The element type link must be terminated by the
 matching end-tag /link.
 Error executing command: The element type link must be terminated by the
 matching end-tag /link.
 karaf@root() feature:repo-add
 https://repository.apache.org/content/repositories/snapshots
 Adding feature url
 https://repository.apache.org/content/repositories/snapshots
 [Fatal Error] :-1:-1: Premature end of file.
 Error executing command: Premature end of file.



 Thank you for your advice and help,



 --
 View this message in context:
 http://karaf.922171.n3.nabble.com/karaf-with-gwt-tp4033721.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: How to start specified feature spring version in PAX-EXAM

2014-06-20 Thread Łukasz Dywicki
Ken,
From semantic point of view it looks fine. Do you have any log entries
produced by Karaf?

Please try adding DEBUG option for org.apache.karaf.features category.

Best regards,
Lukasz


2014-06-20 17:49 GMT+02:00 Ken Longnan ken.long...@gmail.com:

 Hi,

 I want to start feature spring version 3.2.4.RELEASE in PAX-EXAM.

 I try to do following way, but it doesn't working:
  features(

 maven().groupId(org.apache.karaf.assemblies.features).artifactId(enterprise).type(xml)
 .classifier(features).version(2.3.5),
 transaction, jndi, jpa,
 spring/3.2.4.RELEASE),

 How to archive it?

 Thanks  BR,

 Ken



Re: Updating Karaf Features

2014-02-17 Thread Łukasz Dywicki
Proper procedure is:
features:uninstall feature name
features:refreshurl
features:install feature name

In case if you are using KARs it’s a little bit different because instead of 
refreshurl you need to copy  override KAR file.

Cheers,
Lukasz

Wiadomość napisana przez Ryan Moquin fragility...@gmail.com w dniu 10 lut 
2014, o godz. 23:37:

 Of course making sure the features file is refreshed if need be
 
 Ryan
 
 On Feb 10, 2014 3:57 PM, Achim Nierbeck bcanh...@googlemail.com wrote:
 It's still just installing the new one and uninstalling the old one after the 
 new one is successfully installed. 
 
 regards, Achim 
 
 
 2014-02-10 mbelling mbe...@gmail.com:
 Is there a way to update a feature in Karaf?
 
 For example, I install version 1.0 of my feature.  Later down the road we
 put out 2.0.  Is there a command that will allow me to update version 1.0 of
 my feature to 2.0?  I saw there was a post about this about 3.5 years ago
 (http://karaf.922171.n3.nabble.com/Updating-features-td977482.html), but I
 was wondering if things have changed since then.
 
 Thanks,
 ~Matt
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Updating-Karaf-Features-tp4031609.html
 Sent from the Karaf - User mailing list archive at Nabble.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/



Re: Maven bundle plugin with native libraries as resources

2013-11-14 Thread Łukasz Dywicki
In maven use:

dependency
groupIdcom.mycompany.native/groupId
artifactIdlibname/artifactId
versionx.y/version
/dependency

In maven bundle plugin then you may use:
Embed-Dependency*;artifactId=libname;inline=true/Embed-Dependency
The libname.jar deployed to your maven repository must contain dll/so files.

Or
dependency
groupIdcom.mycompany.native/groupId
artifactIdlibname/artifactId
versionx.y/version
typedll/type
/dependency

Embed-Dependency*;type=dll|so/Embed-Dependency

However from maven point of view packaging should be used instead of type.

In embed dependency you may use different filters - groupId, artifactId or even 
scope, so depends on the number of dependencies you may choose what's works for 
you.

Kind regards,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez CLEMENT Jean-Philippe 
jean-philippe.clem...@fr.thalesgroup.com w dniu 14 lis 2013, o godz. 09:36:

 Right ;)
  
 Well, the plugin assembled the bundle without issue *but* with native 
 libraries stored in the resource directory. I would like the native libraries 
 to be taken from the maven repository instead.
  
 I didn’t find a simple way to do so. The bundle plugin has two issues. First 
 all dependencies are added to the classpath no matter the dependency type (it 
 adds .so and .dll as well!). Second the embedded file name keeps the maven 
 format. Unfortunately the native file name is also its identifier so it must 
 be changed. Note that using the Embed-StripVersion option fails as it also 
 strips the classifier part (so two resources which only differs with the 
 classifier attribute overloads each other).
  
 Any idea?
  
 JP
  
 [@@ THALES GROUP INTERNAL @@]
  
 De : Łukasz Dywicki [mailto:l...@code-house.org] 
 Envoyé : mercredi 13 novembre 2013 23:35
 À : user@karaf.apache.org
 Objet : Re: Maven bundle plugin with native libraries as resources
  
 For native dependencies you need also Bundle-NativeCode manifest entry. Check 
 OSGi Core specification for detailed description as well.
  
 Cheers,
 Łukasz Dywicki
 --
 l...@code-house.org
 Twitter: ldywicki
 Blog: http://dywicki.pl
 Code-House - http://code-house.org
  
 Wiadomość napisana przez CLEMENT Jean-Philippe 
 jean-philippe.clem...@fr.thalesgroup.com w dniu 12 lis 2013, o godz. 13:27:
 
 
 Dear Karaf exeperts,
 
 I would like the maven bundle plugin to use native libraries stored in the 
 repository. I tried Embed-Dependency with native libraries (.so  .dll). It 
 succeeds but the Bundle-ClassPath is generated with them.
 
 Is there a way to remove non-jar dependencies from the Bundle-ClassPath entry?
 
 JP



Re: Maven bundle plugin with native libraries as resources

2013-11-13 Thread Łukasz Dywicki
For native dependencies you need also Bundle-NativeCode manifest entry. Check 
OSGi Core specification for detailed description as well.

Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez CLEMENT Jean-Philippe 
jean-philippe.clem...@fr.thalesgroup.com w dniu 12 lis 2013, o godz. 13:27:

 Dear Karaf exeperts,
 
 I would like the maven bundle plugin to use native libraries stored in the 
 repository. I tried Embed-Dependency with native libraries (.so  .dll). It 
 succeeds but the Bundle-ClassPath is generated with them.
 
 Is there a way to remove non-jar dependencies from the Bundle-ClassPath entry?
 
 JP



Re: Wrap com.datastax.cassandra/cassandra-driver-core

2013-09-09 Thread Łukasz Dywicki
Hey,
Sadly the stack trace was removed by filtering on apache mailing lists, could 
you please paste it in plaintext? We are using home made cassandra bundle which 
I want donate to servicemix-bundles, however we are not using jdbc layer 
(astyanax). It might be option for my collegues so I am happy to help you with 
embedding it.

Cheers,
Lukasz Dywicki
--
Code-House
http://code-house.org

Krasiczynska 3/80
03-379 Warsaw
Mobile +48 721151666

Wiadomość napisana przez sigmundl sigmund.lundg...@gmail.com w dniu 9 wrz 
2013, o godz. 16:47:

 Anybody got that working? Actually bundling it seemed to work but when trying
 to use it in another bundle:
 
 
 
 
 Ideas?
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Wrap-com-datastax-cassandra-cassandra-driver-core-tp4029634.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: MBeanRegistrer refresh

2013-08-23 Thread Łukasz Dywicki
Andrey,
Ensure that ehcache do not register this cache statistics mbean on their own. 
MBeanRegistrer during shutdown removes all mbeans if registered any. The same 
happens if MBeanServer service dissapears.

Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Kolchanov, Andrey andrey.kolcha...@billing.ru w 
dniu 22 sie 2013, o godz. 14:45:

 Sorry,
 I have send uncompleted letter.
 
 But when I'm trying stop/start this bundle I'm getting exception
 
 
 javax.management.InstanceAlreadyExistsException:
 net.sf.ehcache:type=CacheStatistics,CacheManager=net.sf.ehcache.CacheManage
 r@20f664cb,name=L1Cache
 
 How can I avoid this EhChache JMX error?
 
 -- 
 С уважением,
 Андрей Колчанов.
 Ведущий системный архитектор
 ЗАО «ПЕТЕР-СЕРВИС»
 
 
 
 
 
 
 22.08.13, 16:41 пользователь Kolchanov, Andrey
 andrey.kolcha...@billing.ru написал:
 
 Hello,
 
 I have a jmx enabled blueprint bundle like this
 
   reference id=mbeanServer interface=javax.management.MBeanServer
   reference-listener ref=mbeanRegistrer
 bind-method=registerMBeanServer
   unbind-method=unregisterMBeanServer/
   /reference
 
   bean id=mbeanRegistrer
 class=org.apache.karaf.management.MBeanRegistrer init-method=init
 destroy-method=destroy
   property name=mbeans
   map
   entry value=someKey
  key-ref=someBean/
   /map
   /property
   /bean
 
 All is Ok when I deploy my budge first time.
 But when I'm trying stop/start this bundle I'm getting exception
 



Re: Requiring bundles to be signed

2013-07-12 Thread Łukasz Dywicki
This works similar to standard java policy files. In traditional J2SE you may 
use signed by statement in Java policy. In OSGi you can achieve this with 
conditional permission admin which requires Java Security to be enabled.

I've created an example a while ago which works with Karaf 2.x:
https://github.com/splatch/osgi-cpm

The policy configuration in my case was written in XML (easiest to parse  
validate)
https://github.com/splatch/osgi-cpm/blob/master/admin/src/main/resources/policy.xml
 

Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez j...@nanthrax.net w dniu 11 lip 2013, o godz. 10:26:

 Hi
 
 I already tested it with Karaf 1 and 2.2 (and directly with Felix). I didn't 
 try latest versions or with Karaf 2.3.
 
 I will take a look tomorrow (I travel today).
 
 I will keep you posted tomorrow.
 
 Regards
 JB
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://wwx.talend.com
 
 - Reply message -
 From: Christian Schneider ch...@die-schneider.net
 To: user@karaf.apache.org
 Subject: Requiring bundles to be signed
 Date: Thu, Jul 11, 2013 9:50 am
 
 
 Hi all,
 
 we have a customer requirement to only allow signed bundles in the framework.
 
 I have read that this should be possible:
 - 
 http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fbundle_security.html
 - http://felix.apache.org/site/apache-felix-framework-security.html
 
 I am struggling though how to set it up so it actually checks signatures and 
 denies non trusted or missing signatures.
 
 Has anyone here already tried this?
 
 If the framework does not allow it via configuration. Is there a hook in OSGi 
 where I can be called when a bundle is loaded?
 
 Christian
 



Re: How to call a code only once

2013-06-27 Thread Łukasz Dywicki
Dear all,
As OSGi core spec says - native libraries are loaded once and they are linked 
with classloader. Due the fact that bundle classloader only find the native 
library for system classloader which performs load the DLL/SO file is always 
loaded only once and remains in memory untill JVM shutdown.

For details see OSGi 5 Core Spec section 3.10, especially paragraph 3.10.2.

Czheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez CLEMENT Jean-Philippe 
jean-philippe.clem...@fr.thalesgroup.com w dniu 27 cze 2013, o godz. 17:04:

 From what I understand BundleActivator warns when un bundle is 
 started/stopped, which is not exactly the usecase I would like.
 
 The .so lib must be loaded once. The best thing would be to obtain an event 
 stating the bundle is installed so I may load the lib.
 
 For the moment I added a class with a static part. I load the lib when that 
 class is loaded by the classloader, which is not very good but does the job. 
 I also put the bundle as singleton for extra protection.
 
 JP
 
 [@@ OPEN @@]
 
 -Message d'origine-
 De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
 Envoyé : jeudi 27 juin 2013 16:15
 À : user@karaf.apache.org
 Objet : Re: How to call a code only once
 
 Hi JP,
 
 you can control the loading in the BundleActivator.
 
 Regards
 JB
 
 On 06/27/2013 10:45 AM, CLEMENT Jean-Philippe wrote:
 Dear Karaf,
 
 I have a bundle which loads .so libraries. I would like this code to run 
 once. What is the easiest way to do so?
 
 Best regards,
 JP
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: How to call a code only once

2013-06-27 Thread Łukasz Dywicki
Jean,
Native libraries are linked with system classloader thus they are not re-loaded 
even if bundle is updated.

Cheers,
Lukasz

Wiadomość napisana przez Jean-Baptiste Onofré j...@nanthrax.net w dniu 27 cze 
2013, o godz. 20:56:

 Not sure I follow you:
 
 
 When a class loaded by a bundle's class loader attempts to load a native
 library, by calling System.loadLibrary, the findLibrary method of the 
 bundle’s class loader must be called to return the file path in which the 
 Framework has made the requested native library available. The parameter to 
 the findLibrary method is the name of the library in operating system 
 independent form, like http. The bundle class loader can use the 
 mapLibraryName method from the VM to map this name to an operating system 
 dependent name, like libhttp.so.
 
 As we have a classloader per bundle, it's loaded at each bundle startup.
 
 Regards
 JB
 
 On 06/27/2013 08:05 PM, Łukasz Dywicki wrote:
 Dear all,
 As OSGi core spec says - native libraries are loaded once and they are
 linked with classloader. Due the fact that bundle classloader only find
 the native library for system classloader which performs load the DLL/SO
 file is always loaded only once and remains in memory untill JVM shutdown.
 
 For details see OSGi 5 Core Spec section 3.10, especially paragraph 3.10.2.
 
 Czheers,
 Łukasz Dywicki
 --
 l...@code-house.org mailto:l...@code-house.org
 Twitter: ldywicki
 Blog: http://dywicki.pl
 Code-House - http://code-house.org
 
 Wiadomość napisana przez CLEMENT Jean-Philippe
 jean-philippe.clem...@fr.thalesgroup.com
 mailto:jean-philippe.clem...@fr.thalesgroup.com w dniu 27 cze 2013, o
 godz. 17:04:
 
 From what I understand BundleActivator warns when un bundle is
 started/stopped, which is not exactly the usecase I would like.
 
 The .so lib must be loaded once. The best thing would be to obtain an
 event stating the bundle is installed so I may load the lib.
 
 For the moment I added a class with a static part. I load the lib when
 that class is loaded by the classloader, which is not very good but
 does the job. I also put the bundle as singleton for extra protection.
 
 JP
 
 [@@ OPEN @@]
 
 -Message d'origine-
 De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net http://nanthrax.net]
 Envoyé : jeudi 27 juin 2013 16:15
 À : user@karaf.apache.org mailto:user@karaf.apache.org
 Objet : Re: How to call a code only once
 
 Hi JP,
 
 you can control the loading in the BundleActivator.
 
 Regards
 JB
 
 On 06/27/2013 10:45 AM, CLEMENT Jean-Philippe wrote:
 Dear Karaf,
 
 I have a bundle which loads .so libraries. I would like this code to
 run once. What is the easiest way to do so?
 
 Best regards,
 JP
 
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org mailto: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: How to call a code only once

2013-06-27 Thread Łukasz Dywicki
Yes, you are right. I've back to the spec and the case I described is true for 
libraries which are loaded by system classloader, ie from $KARAF_HOME/lib or 
other places which are not found by bundle classloaders. 
However, you can't be sure when native library will be unloaded by JVM since 
it's strictly related to garbarage collection. In other words, all references 
to classes loaded by bundle should be removed because they hold old bundle 
classloader which loaded native lib. Dependant bundles must be refreshed after 
uninstallation of bundle containing native libraries otherwise new version of 
dll will never be loaded.

As answer for initial question - if you want to be sure that your native code 
is loaded once and only once don't embed dll/so in bundle but place it in 
filesystem directory and let system classloader load and keep it. 

Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Achim Nierbeck bcanh...@googlemail.com w dniu 27 cze 
2013, o godz. 22:09:

 Lukasz, 
 this is wrong. Nativ Libraries are reloaded in case a bundle is updated. 
 Though you need to take care of certain restrictions. Native Libraries inside 
 a bundle must not be linked to other native libraries that are inside this or 
 another bundle and may only depent to system libraries. 
 This is due to the way nativ library re-loading is handled. Actually the 
 original nativ bundle is kept, and the second one is re-named (if I 
 remember correctly) and that's the main reason why the dependency to another 
 native library doesn't work. 
 Neer the less technically speaking the library is re-loaded well actually 
 it's more of a moved into a not accessible space and beeing replaced by 
 another library. 
 
 regards, Achim 
 
  
 
 
 2013/6/27 Łukasz Dywicki l...@code-house.org
 Jean,
 Native libraries are linked with system classloader thus they are not 
 re-loaded even if bundle is updated.
 
 Cheers,
 Lukasz
 
 Wiadomość napisana przez Jean-Baptiste Onofré j...@nanthrax.net w dniu 27 
 cze 2013, o godz. 20:56:
 
  Not sure I follow you:
 
  
  When a class loaded by a bundle's class loader attempts to load a native
  library, by calling System.loadLibrary, the findLibrary method of the 
  bundle’s class loader must be called to return the file path in which the 
  Framework has made the requested native library available. The parameter to 
  the findLibrary method is the name of the library in operating system 
  independent form, like http. The bundle class loader can use the 
  mapLibraryName method from the VM to map this name to an operating system 
  dependent name, like libhttp.so.
  
  As we have a classloader per bundle, it's loaded at each bundle startup.
 
  Regards
  JB
 
  On 06/27/2013 08:05 PM, Łukasz Dywicki wrote:
  Dear all,
  As OSGi core spec says - native libraries are loaded once and they are
  linked with classloader. Due the fact that bundle classloader only find
  the native library for system classloader which performs load the DLL/SO
  file is always loaded only once and remains in memory untill JVM shutdown.
 
  For details see OSGi 5 Core Spec section 3.10, especially paragraph 3.10.2.
 
  Czheers,
  Łukasz Dywicki
  --
  l...@code-house.org mailto:l...@code-house.org
  Twitter: ldywicki
  Blog: http://dywicki.pl
  Code-House - http://code-house.org
 
  Wiadomość napisana przez CLEMENT Jean-Philippe
  jean-philippe.clem...@fr.thalesgroup.com
  mailto:jean-philippe.clem...@fr.thalesgroup.com w dniu 27 cze 2013, o
  godz. 17:04:
 
  From what I understand BundleActivator warns when un bundle is
  started/stopped, which is not exactly the usecase I would like.
 
  The .so lib must be loaded once. The best thing would be to obtain an
  event stating the bundle is installed so I may load the lib.
 
  For the moment I added a class with a static part. I load the lib when
  that class is loaded by the classloader, which is not very good but
  does the job. I also put the bundle as singleton for extra protection.
 
  JP
 
  [@@ OPEN @@]
 
  -Message d'origine-
  De : Jean-Baptiste Onofré [mailto:j...@nanthrax.net http://nanthrax.net]
  Envoyé : jeudi 27 juin 2013 16:15
  À : user@karaf.apache.org mailto:user@karaf.apache.org
  Objet : Re: How to call a code only once
 
  Hi JP,
 
  you can control the loading in the BundleActivator.
 
  Regards
  JB
 
  On 06/27/2013 10:45 AM, CLEMENT Jean-Philippe wrote:
  Dear Karaf,
 
  I have a bundle which loads .so libraries. I would like this code to
  run once. What is the easiest way to do so?
 
  Best regards,
  JP
 
 
  --
  Jean-Baptiste Onofré
  jbono...@apache.org mailto: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
 
 
 
 
 -- 
 
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http

Re: Deploy Karaf In WebLogic

2013-03-12 Thread Łukasz Dywicki
Karaf may be deployed under *any* web container. That's for sure.

Basically you have following options:
a) embed OSGi framework
b) run on top of WebLogic OSGi environment
c) embed Karaf Main

I really have no idea how b) may look like, especially under WebLogic. However 
for a) you may take a look on my blog entry [1] describing how to run Apache 
Aries with Tomcat. Running Karaf may be done in similar way. Last possibility 
is to simply run Karaf main from own implementation of ServletContextListener. 
That's simplest solution.

[1] http://dywicki.pl/2012/01/apache-aries-under-apache-tomcat/

Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Jean-Baptiste Onofré j...@nanthrax.net w dniu 12 mar 
2013, o godz. 13:39:

 Hi Filippo,
 
 It would be tricky.
 
 What's the purpose ? To use some EJBs deployed in WebLogic (in that case 
 Karaf could be close to WebLogic and use EJB via RMI-IIOP) ?
 
 Regards
 JB
 
 On 03/12/2013 12:54 PM, Filippo Balicchia wrote:
 Hi All,
 
 
 I need to deploy karaf in WebLogic,
 
 Is it possible ? someone has done it ?
 
 
 Regards
 
 --Filippo
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: Https 2-way authentication and JAAS

2013-02-21 Thread Łukasz Dywicki
I haven't done that with CXF STS, however I did it with regular WSS4J username 
token  JAAS:

bean id=svc class=org.code_house.cxf.secure.CustomerServiceImpl /

jaxws:endpoint id=customerService implementor=#svc address=/customer
jaxws:inInterceptors
bean class=org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
 argument
map
   entry key=action value=UsernameToken/
/map
 /argument
  /bean
  bean 
class=org.apache.cxf.interceptor.security.JAASLoginInterceptor
property name=contextName value=test /
  /bean
  bean 
class=org.apache.cxf.interceptor.security.SecureAnnotationsInterceptor
property name=securedObject ref=svc/
  /bean
/jaxws:inInterceptors
jaxws:properties
 entry key=ws-security.validate.token value=false /
 !-- Only verification of auth headers
 entry key=ws-security.ut.validator
bean 
class=org.apache.ws.security.validate.JAASUsernameTokenValidator
property name=contextName value=test /
 /bean
 /entry
 --
/jaxws:properties
/jaxws:endpoint


With this configuration CXF checks @RolesAllowed. Roles are defined in JAAS 
login module.

Best regards,
Lukasz

Wiadomość napisana przez Christian Schneider ch...@die-schneider.net w dniu 
21 lut 2013, o godz. 01:13:

 I am currently trying to do a similar thing. I try to authenticate against a 
 CXF Secure Token Service using a client cert. Currently CXF STS has some 
 modules for authorization.
 To get this out of STS I try to switch the authorization to JAAS. The problem 
 is that in JAAS you can not simply get the roles of a user. You only get the 
 roles after you do a login.
 
 So what I am trying to do is use or create a CertificateLoginModule for JAAS 
 that can work with either SSL client certs or ws-security cert + signature.
 
 Perhaps this can even be done in a simpler way. I wonder if I could simply 
 create a LDAP Login Module that does no authentication and instead simply 
 uses a fixed user to fetch the role infos from LDAP.
 In any case I will report my progress and it would be great if you could also 
 write if you find something. 
 
 Christian
 
 
 Am 20.02.2013 19:17, schrieb Lars-Erik Helander:
 Thanks Achim,
 
 do you have any suggestions on where I can find documentation/examples that 
 could be of help to me, e.g. how to configure my web app to force login 
 via client certs?
 
 Thanks
 
 Lars
 
 Skickat från min iPhone
 
 20 feb 2013 kl. 17:41 skrev Achim Nierbeck bcanh...@googlemail.com:
 
 Hi Lars, 
 
 I think it should be possible. At least right now I don't see anything 
 objecting to this. As Pax Web already does work with certs, you have the  
 credentials for it. Now you just need to make sure you're configuration for 
 the authorization is delegated to the underlying JAAS. This should be 
 possible. 
 It probably needs a bit of tweaking and researching since it's a 
 not-out-of-the-box situation. 
 
 Let us know if it worked out :)
 
 regards, Achim 
 
 
 2013/2/20 Lars-Erik Helander leh...@gmail.com
 Lukasz  Achim,
 
 Thanks for the feedback.
 
 No, I do not have a working stand alone jetty solution to port.
 
 The solution works as follows today:
 
 The client which is another system and not a human user, autthenticates to 
 the Karaf server using a client cert. No login takes place so its just a 
 matter of transport level security. The receiving servlet makes an explicit 
 call to an LDAP server to get the role(s) associated with the client. The 
 LDAP search is based on the user principal established during the ssl 
 session setup (principal info comes from the client certificate). I would 
 like to move away from doing the LDAP call in my application (servlet) and 
 instead make the LDAP interaction via JAAS. I guess I woul need to do at 
 least two things:
 1) configure JAAS with an LDAP login module
 2) force login to take place, probably by somehow configure the specific 
 URL as being protected an somehow configure/code that login usin client 
 certificate shall take place
 
 Is this possible?
 
 Thanks
 
 /Lars
 
 Skickat från min iPhone
 
 20 feb 2013 kl. 15:17 skrev Łukasz Dywicki l...@code-house.org:
 
 I was thinking about something more complex [1] where principals may be 
 populated from peer certificate.
 
 [1] 
 https://github.com/jboss-switchyard/core/blob/master/security/base/src/main/java/org/switchyard/security/login/CertificateLoginModule.java
 
 Cheers,
 Lukasz
 
 Wiadomość napisana przez Achim Nierbeck bcanh...@googlemail.com w dniu 
 20 lut 2013, o godz. 15:11:
 
 Lukasz,
 
 Pax-Web should work with Certificates already, it just needs a proper 
 combination of the authentication which should be done by Pax-Web and the 
 authorization which should be done by the JAAS part of Karaf. 
 
 regards, Achim

Re: Use same JAAS module for web app and cxf rest application

2013-02-21 Thread Łukasz Dywicki
FYI it should be fixed in Karaf 2.3.0. Do you use this version?


Łukasz Dywicki
l...@code-house.org
--
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez siv vasan svasanta@gmail.com w dniu 21 lut 2013, 
o godz. 16:35:

 I have facing an security configuration issue with karaf. 
 
 1. I have a JAAS Login module blueprint bundle deployed in karaf.
 2. Jetty is configured with JAASLoginSerivce, and the configuration file is
 deployed as fragment bundle. 
 
 Now have 2 applications
 1. Web application which use container(jetty) based authentication
 
 2. I have another application, which is cfx rest application. For this i am
 using authentication filter as described here
 http://cxf.apache.org/docs/secure-jax-rs-services.html 
 
 My plan is to use same jaas module configurations for both applications.(web
 application used JAASLoginService and  rest uses authentication  filter) 
 
 But the problem is,  for rest application login request is going to Jetty
 JAASLoginSerivce instead of coming filter. and it is throwing below
 exception. 
 h3Caused by:
 prejava.lang.ClassNotFoundException:
 org.apache.karaf.jaas.boot.principal.RolePrincipal not found by
 org.apache.cxf.cxf-rt-transports-http [122]   
   
 
at
 org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)

at
 org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
   
at
 org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)


 at
 org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginService.java:315)
  
at
 org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.java:244) 
 
at
 org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:88)
   
at
 org.eclipse.jetty.security.authentication.DeferredAuthentication.authenticate(DeferredAuthentication.java:108)
 
at
 org.eclipse.jetty.server.Request.getUserPrincipal(Request.java:1251)  
 
 
 
 If remove JAASLoginSerivce then authentication is happening thorough filter.
 I assume that JAASLoginSerivce i configured is applied for all the web
 applications deployed in jetty. 
 
 Is there a way to  restrict the JAASLoginSerivce  to specific web app ? or
 How can i bypass  JAASLoginSerivce   for rest application. 
 
 
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Use-same-JAAS-module-for-web-app-and-cxf-rest-application-tp4027838.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Use same JAAS module for web app and cxf rest application

2013-02-21 Thread Łukasz Dywicki
It might be an workaround for your problem. Change transport from http to 
http-osgi if you may. Publish adress must be then set to '/something'. Your 
services will be listed at http://localhost:8181/cxf. I tested my configuration 
with Karaf 2.2.9, but I don't use JAAS from Jetty level. Instead I have it 
inside CXF with org.apache.cxf.interceptor.security.JAASLoginInterceptor. This 
gives additional benefit with role based access restrictions. All you need to 
enable this is configured SecureAnnotationsInterceptor.

Singular JAAS context can be used from anywhere. There is no way to restrict 
its visibility in Karaf. Issue fixed in 2.3.0 that I was reffering to is 
KARAF-1305.


Łukasz Dywicki
l...@code-house.org
--
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez siv vasan svasanta@gmail.com w dniu 21 lut 2013, 
o godz. 17:48:

 Is there a way to restrict JAASLoginService to one specific web application
 only. I tried having configuration in jetty-web.xml but this configuration
 is not taken. 
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Use-same-JAAS-module-for-web-app-and-cxf-rest-application-tp4027838p4027844.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Https 2-way authentication and JAAS

2013-02-20 Thread Łukasz Dywicki
I think you may get this with chaining JAAS login modules in login context 
configuration, however we don't ship certificate login module yet.

Which certificate login module do you use now?

Lukasz

Wiadomość napisana przez Achim Nierbeck bcanh...@googlemail.com w dniu 20 lut 
2013, o godz. 11:20:

 Hi Lars, 
 
 I'm sure it's possible. Do you have a working simple Application that 
 already works on a std. jetty?
 If so, try to port those things needed to karaf. 
 Karaf supports JAAS so if you are able to get your JAAS configuration working 
 I'm sure it's a easy move over. 
 
 To my understanding the user attached to the certificate needs to be know in 
 the jaas part. 
 Since the authentication is done via certificate the JAAS part is only needed 
 for the authorization. 
 
 Regards, Achim 
 
 
 2013/2/19 helander leh...@gmail.com
 Hi,
 I am connecting to a web application in Karaf using https and a client
 certificate and it works fine.
 Now I want to associate the authenticated client with a set of roles defined
 in a JAAS login module, e.g. in user.properties or via LDAP. Is this
 possible? How to set it up? What user name could be used, e.g. what part
 of the client certificate would the user identity be selected from?
 
 Any help is highly appreciated.
 
 Thanks
 
 Lars
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Https-2-way-authentication-and-JAAS-tp4027804.html
 Sent from the Karaf - User mailing list archive at Nabble.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/



Re: Https 2-way authentication and JAAS

2013-02-20 Thread Łukasz Dywicki
I was thinking about something more complex [1] where principals may be 
populated from peer certificate.

[1] 
https://github.com/jboss-switchyard/core/blob/master/security/base/src/main/java/org/switchyard/security/login/CertificateLoginModule.java

Cheers,
Lukasz

Wiadomość napisana przez Achim Nierbeck bcanh...@googlemail.com w dniu 20 lut 
2013, o godz. 15:11:

 Lukasz,
 
 Pax-Web should work with Certificates already, it just needs a proper 
 combination of the authentication which should be done by Pax-Web and the 
 authorization which should be done by the JAAS part of Karaf. 
 
 regards, Achim 
 
 
 2013/2/20 Łukasz Dywicki l...@code-house.org
 I think you may get this with chaining JAAS login modules in login context 
 configuration, however we don't ship certificate login module yet.
 
 Which certificate login module do you use now?
 
 Lukasz
 
 Wiadomość napisana przez Achim Nierbeck bcanh...@googlemail.com w dniu 20 
 lut 2013, o godz. 11:20:
 
 Hi Lars, 
 
 I'm sure it's possible. Do you have a working simple Application that 
 already works on a std. jetty?
 If so, try to port those things needed to karaf. 
 Karaf supports JAAS so if you are able to get your JAAS configuration 
 working I'm sure it's a easy move over. 
 
 To my understanding the user attached to the certificate needs to be know in 
 the jaas part. 
 Since the authentication is done via certificate the JAAS part is only 
 needed for the authorization. 
 
 Regards, Achim 
 
 
 2013/2/19 helander leh...@gmail.com
 Hi,
 I am connecting to a web application in Karaf using https and a client
 certificate and it works fine.
 Now I want to associate the authenticated client with a set of roles defined
 in a JAAS login module, e.g. in user.properties or via LDAP. Is this
 possible? How to set it up? What user name could be used, e.g. what part
 of the client certificate would the user identity be selected from?
 
 Any help is highly appreciated.
 
 Thanks
 
 Lars
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Https-2-way-authentication-and-JAAS-tp4027804.html
 Sent from the Karaf - User mailing list archive at Nabble.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/



Re: Why this library hell? Hibernate + Spring = Mess

2013-01-29 Thread Łukasz Dywicki
FYI there is some work done by Hibernate team too:
https://hibernate.onjira.com/browse/HHH-7527


Wiadomość napisana przez Krzysztof Sobkowiak krzys.sobkow...@gmail.com w dniu 
29 sty 2013, o godz. 20:37:

 Hi
 
 I have created a gist with a feature file for the 3rd party dependencies fo 
 my 
 application iI have implemented for my firm 
 (https://gist.github.com/4666947). 
 Perhaps it helps you with your problem. I have managed to install hibernate 
 4.1.0.FINAL on Karaf 2.3.0 and implement a DAO using the hibernate API and 
 JPA.
 
 Perhaps can somebody review this feature?
 
 Best regards
 Krzysztof
 
 
 On Tuesday 29 of January 2013 12:19:18 Bram Pouwelse wrote:
 Hi Gonzalo,
 
 I've used Hibernate in Karaf in the past got it al working based on on
 Hibernate bundles created as described in this blog post:
 http://iocanel.blogspot.nl/2010/07/wicket-spring-3-jpa2-hibernate-osgi.html
 
 I was able to update these bundles to Hibernate 3.6.2 but switched to
 OpenJPA after all.
 
 Regards,
 Bram
 
 



Re: Can not login into karaf-webconsole on Karaf 2.3.0 and 2.2.10

2013-01-16 Thread Łukasz Dywicki
Hey Krzysztof,
Yeah, 2.3.0 and 2.2.10 contains change which is not backward compatible: 
KARAF-1305. I belive it should not happen in 2.2.x branch.

Anyway, I'll review your patches and start necessary branches for webconsole to 
support current Karaf releases.

Best regards,
Lukasz


Wiadomość napisana przez Krzysztof Sobkowiak w dniu 16 sty 2013, o godz. 01:46:

 Hi
  
 To solve the problem with itest with karaf.version 2.3.0 I have attached a 
 patch  upgrading the itests to PAX Exam 2.6.0 and PAX Exam Karaf 
  
 Best regards 
 Krzysztof
 
 -- 
 
 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/ 



Re: Can not login into karaf-webconsole on Karaf 2.3.0 and 2.2.10

2013-01-16 Thread Łukasz Dywicki
Many thanks for quick response. This rollback will make versioning of dependant 
projects easier!

Cheers,
Lukasz
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Achim Nierbeck w dniu 16 sty 2013, o godz. 22:01:

 Yeah my bad, sorry for this.
 I'm going to open a new issue for this and will fix it for 2.2.x
 
 sent from tablet
 
 Am 16.01.2013 21:20 schrieb Jean-Baptiste Onofré j...@nanthrax.net:
 Hi,
 
 We discussed about this with Achim (he's the author of the changes).
 
 He proposed to rollback his change in Karaf 2.2.x.
 
 Regards
 JB
 
 On 01/16/2013 09:18 PM, Łukasz Dywicki wrote:
 Hey Krzysztof,
 Yeah, 2.3.0 and 2.2.10 contains change which is not backward
 compatible: KARAF-1305. I belive it should not happen in 2.2.x branch.
 
 Anyway, I'll review your patches and start necessary branches for
 webconsole to support current Karaf releases.
 
 Best regards,
 Lukasz
 
 
 Wiadomość napisana przez Krzysztof Sobkowiak w dniu 16 sty 2013, o godz.
 01:46:
 
 Hi
 
 To solve the problem with itest with karaf.version 2.3.0 I have
 attached a patch upgrading the itests to PAX Exam 2.6.0 and PAX Exam
 Karaf
 
 Best regards
 Krzysztof
 
 --
 
 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/
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: how to set up jaas both outside and inside osgi container?

2012-11-30 Thread Łukasz Dywicki
Hey Mike (sorry, I am late as JB answered partially your question),
This scenario is a bit tricky because Karaf JAAS module from JVM point of view 
is proxy. However typical JAAS constructions still works well under OSGi ie. if 
you create new LoginContext you can expect that it will reach deployed realm.

If you would like to use InitialContext you should override initial factory 
property I believe to call provider you expect, not default one - in Karaf case 
it will be Aries.
My personal recomendation is to port your realm and run it normally under OSGi, 
as it will let you control everything.

Cheers,
Łukasz Dywicki
--
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Mike Wilson w dniu 30 lis 2012, o godz. 14:04:

 I've tried both bootdelegation and packages.extra settings, for
 referring to my LoginModule residing in non-OSGI code, and both
 ways seem to work.
 
 Though in both cases, when the LoginModule tries to create an
 InitialContext, I am getting an exception from Aries JNDI:
 
 javax.naming.NoInitialContextException: The calling code's BundleContext
 could not be determined.
   at
 org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSG
 iInitialContextFactoryBuilder.java:46)
   at
 javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
   at
 javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
   at javax.naming.InitialContext.init(InitialContext.java:242)
   at javax.naming.InitialContext.init(InitialContext.java:192)
   at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:51)
   at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
 89)
   at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
   at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
   at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
   at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
   at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
   at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
   at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
   at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
   at
 org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:503)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
   at
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
   at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
   at
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
   at
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
   at
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
   at
 org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerColl
 ection.java:230)
   at
 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:11
 4)
   at
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
   at org.mortbay.jetty.Server.handle(Server.java:326)
   at
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
   at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnectio
 n.java:928)
   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
   at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
   at
 org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582
 )
 
 I've asked on the Aries ML how to solve this, but if someone here 
 has a clue that'd be great too :-)
 
 Thanks
 Mike Wilson
 
 Mike Wilson wrote:
 Thanks Jean-Baptiste,
 
 So then I should do all JAAS configuration from Karaf, right?
 The application has its own JAAS LoginModule in the non-OSGI codebase 
 so would it be something like this? :
 
 blueprint ...
  ... 
  jaas:config name=karaf rank=1
jaas:module className=org.apache...PropertiesLoginModule/ 
  /jaas:config
  jaas:config name=myjaas rank=1
jaas:module className

Re: jni/native karaf

2012-10-01 Thread Łukasz Dywicki
Just put DLL/SO file to lib/ directory. JVM should be able to load it using 
System.loadLibrary.

Best regards,
Lukasz

Wiadomość napisana przez Dan Tran w dniu 29 wrz 2012, o godz. 07:18:

 Hello,
 
 I know there is a right to package jni bundle together with associated
 bits ( I can see jansi as a good example )
 
 For prototyping purpose, can just create a java jni only bundle and
 place the native files in the path ? ie ( on windows use PATH env ,
 for Linux us LD_LIBRARY_PATH )
 
 Big thanks for any suggestion.
 
 -Dan



Re: Unable to install webconsole under karaf-2.2.9

2012-08-26 Thread Łukasz Dywicki
Then it's clear. Karaf minimal do not contain InstanceAdmin and support for 
child containers.

Łukasz Dywicki
--
Code-House
http://code-house.org

Dnia 26 sie 2012 o godz. 17:27 Dan Tran dant...@gmail.com napisał(a):

 It only happens if I use 'minimal' package, apache-Karaf-2.2.9-minimal.tar.gz
 
 -D
 
 On Sunday, August 26, 2012, Łukasz Dywicki wrote:
 Hey Dan,
 The webconsole feature is old fashion stuff (Felix one), the 
 webconsole-wicket is a new one. Both works well on my computer with 2.2.9 
 release. Maybe you typed too fast and some of features was not yet started? 
 The admin package is resolved correctly (122 is webconsole admin module):
 
 packages:imports 122|grep admin
 Apache Karaf :: Admin :: Core (35): org.apache.karaf.admin; version=2.2.9
 
 Best regards,
 Lukasz
 
 
 
 Wiadomość napisana przez Dan Tran w dniu 25 sie 2012, o godz. 08:26:
 
 If you have a work around to get webconsole-wicket to work on 2.2.9,
 please let me know.
 
 Thanks
 
 -D
 
 On Fri, Aug 24, 2012 at 9:56 PM, Łukasz Dywicki l...@code-house.org wrote:
 Dan,
 Thanks for testing. I checked 2.2.9 with webconsole-wicket indtallation and 
 it worked well. Will take a lok on yor issue.
 
 Łukasz Dywicki
 --
 Code-House
 http://code-house.org
 
 Dnia 25 sie 2012 o godz. 06:26 Dan Tran dant...@gmail.com napisał(a):
 
 feature:install webconsole and webconsole-wicket work for full pack.
 So I guess this is a bug. I also try 2.2.7, 2.2.8 as well
 
 Will create a JIRA for this
 
 -Dan
 
 On Fri, Aug 24, 2012 at 8:56 PM, Dan Tran dant...@gmail.com wrote:
 Hi this is the first time I try the webconsole feature under karaf
 minimal package
 
 and run into this issue, is it a bug?  I can see same error on both
 linux and windows
 
 I also try to build webconsole-wicket and install according source
 tree's readme, and ran into the same issue.  Looks like a regression
 for 2.2.9??
 
 Could someone confirm?
 
 Thanks
 
 
 -Dan
 
 karaf@root feature:install -v webconsole
 Installing feature webconsole 2.2.9
 Installing feature webconsole-base 2.2.9
 Installing feature http 2.2.9
 Installing feature jetty 7.5.4.v20111024
 


Re: Unable to install webconsole under karaf-2.2.9

2012-08-24 Thread Łukasz Dywicki
Dan,
Thanks for testing. I checked 2.2.9 with webconsole-wicket indtallation and it 
worked well. Will take a lok on yor issue.

Łukasz Dywicki
--
Code-House
http://code-house.org

Dnia 25 sie 2012 o godz. 06:26 Dan Tran dant...@gmail.com napisał(a):

 feature:install webconsole and webconsole-wicket work for full pack.
 So I guess this is a bug. I also try 2.2.7, 2.2.8 as well
 
 Will create a JIRA for this
 
 -Dan
 
 On Fri, Aug 24, 2012 at 8:56 PM, Dan Tran dant...@gmail.com wrote:
 Hi this is the first time I try the webconsole feature under karaf
 minimal package
 
 and run into this issue, is it a bug?  I can see same error on both
 linux and windows
 
 I also try to build webconsole-wicket and install according source
 tree's readme, and ran into the same issue.  Looks like a regression
 for 2.2.9??
 
 Could someone confirm?
 
 Thanks
 
 
 -Dan
 
 karaf@root feature:install -v webconsole
 Installing feature webconsole 2.2.9
 Installing feature webconsole-base 2.2.9
 Installing feature http 2.2.9
 Installing feature jetty 7.5.4.v20111024
 Installing bundle
 mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.0.0
 Installing bundle 
 mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.1.2
 Installing bundle mvn:javax.mail/mail/1.4.5
 Installing bundle mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1
 Installing bundle mvn:org.eclipse.jetty/jetty-util/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-io/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-http/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-client/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-continuation/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-jmx/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-server/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-security/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-servlet/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-servlets/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-xml/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-webapp/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-jndi/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-plus/7.5.4.v20111024
 Installing bundle mvn:org.eclipse.jetty/jetty-websocket/7.5.4.v20111024
 Checking configuration file
 mvn:org.apache.karaf/apache-karaf/2.2.9/xml/jettyconfig
 Installing bundle mvn:org.ops4j.pax.web/pax-web-api/1.0.11
 Installing bundle mvn:org.ops4j.pax.web/pax-web-spi/1.0.11
 Installing bundle mvn:org.ops4j.pax.web/pax-web-runtime/1.0.11
 Installing bundle mvn:org.ops4j.pax.web/pax-web-jetty/1.0.11
 Installing bundle mvn:org.apache.felix/org.apache.felix.metatype/1.0.4
 Installing bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.branding/2.2.9
 Installing bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.console/2.2.9
 Installing bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.admin/2.2.9
 Installing bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.features/2.2.9
 Installing bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.gogo/2.2.9
 Installing bundle
 mvn:org.apache.felix/org.apache.felix.webconsole.plugins.event/1.0.2
 Error executing command: Could not start bundle
 mvn:org.apache.karaf.webconsole/org.apache.karaf.webconsole.admin/2.2.9
 in feature(s) webconsole-2.2.9: Unresolved constraint in bundle
 org.apache.karaf
 .webconsole.admin [60]: Unable to resolve 60.0: missing requirement
 [60.0] package;
 ((package=org.apache.karaf.admin)(version=2.2.0)(!(version=3.0.0)))
 karaf@root


Re: Retrieves bundle registration state

2012-03-24 Thread Łukasz Dywicki
You can use:
bundleContext.getBundles()[0].getState()

Below you can find an enumeration which shows usage of getState result.
https://github.com/splatch/karaf-webconsole/blob/develop/osgi/core/src/main/java/org/apache/karaf/webconsole/osgi/core/shared/State.java

Best regards,
Lukasz


Wiadomość napisana przez homeration w dniu 23 mar 2012, o godz. 12:12:

 Hi,
 
 I develop a bundle that scans a list of bundles and controls their
 registration states.
 How can I determine that a bundle is unregistered ?
 
 Currently, I seek all service reference's from a bundle contextand try to
 determine their
 registration state. Unfortunately, I did not find any property that allows
 me to determine that.
 
 Have you any idea to do this?
 
 Thanks,
 
 Christophe.
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Retrieves-bundle-registration-state-tp3851245p3851245.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Connect to remote JMX?

2012-03-24 Thread Łukasz Dywicki
FYI there is also a jmx plugin for felix web console. It is attached to some 
jira issue. 

Łukasz Dywicki
--
Code-House
http://code-house.org

Dnia 24 mar 2012 o godz. 03:51 mikevan mvangeert...@comcast.net napisał(a):

 Thiago,
 
 So, here's some background on what's probably causing your issue.  JVisualVM
 actually uses two ports when you connect to a JMX Server remotely. We
 already know about the one that configured in Karaf 1099. However, JVisualVM
 also randomly selects a port to connect to the JMX Server. If your version
 of Karaf is behind a firewall, on a highly protected VM (like in a VMWare
 cloud), or has other security concerns associated with it, you may never be
 able to reliabley connect.
 
 Thats' why Karaf has a sub-project for a JMX webconsole page. A couple of
 pretty smart developers work extra hard to make that page, and I would
 suggest you use that if you're having trouble connecting to teh JMX server
 holding your Karaf mbean information.
 
 Please let me know if that helps.
 
 -
 Mike Van  (All links open in new tabs)
 Committer - Kalumet 
 
 Atraxia Technologies 
 
 Mike Van's Open Source Technologies Blog 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Connect-to-remote-JMX-tp3846988p3853241.html
 Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Karaf 2.2.5 integration tests

2012-02-24 Thread Łukasz Dywicki
Hey Lennart,
You can take a look for cellar integration tests. They execute commands on test 
container.
https://github.com/apache/karaf-cellar/tree/trunk/itests

Current cellar trunk is tested with Karaf 2.2.5.

Best regards,
Lukasz Dywicki
--
Code-House
http://code-house.org

Wiadomość napisana przez lennart.jore...@teliasonera.com 
lennart.jore...@teliasonera.com w dniu 24 lut 2012, o godz. 12:51:

 Hello all,
 
 I have been trying for some time to get integration tests running properly in 
 Karaf 2.2.5.
 The test rig is copied from what little integration tests could be found on 
 the net.
 
 My problem is that I always receive an exception claiming that the executed 
 command does not exist.
 Is this a known problem? 
 Can anyone point me to a full Karaf integration test for Karaf 2.2.5 that 
 actually works without relying on Karaf 3.0.0 snapshot dependencies?
 
 2012-02-24 12:46:16,133 | WARN  | rint Extender: 2 | KarArtifactInstaller 
 | eployer.kar.KarArtifactInstaller   71 | 15 - 
 org.apache.karaf.deployer.kar - 2.2.5 | Unable to create directory for Karaf 
 Archive timestamps. Results may vary...
 __ __    
/ //_/ __ _/ __/  
   / ,  / __ `/ ___/ __ `/ /_
  / /| |/ /_/ / /  / /_/ / __/
 /_/ |_|\__,_/_/   \__,_/_/ 
 
   Apache Karaf (2.2.5)
 
 Hit 'tab' for a list of available commands
 and '[cmd] --help' for help on a specific command.
 Hit 'ctrl-d' or 'osgi:shutdown' to shutdown Karaf.
 
 karaf@root 2012-02-24 12:46:16,461 | WARN  | rint Extender: 2 | 
 FeaturesServiceImpl  | res.internal.FeaturesServiceImpl  214 | 16 
 - org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a 
 name. The name will be mandatory in the next Karaf version.
 2012-02-24 12:46:16,486 | WARN  | rint Extender: 2 | FeaturesServiceImpl  
 | res.internal.FeaturesServiceImpl  214 | 16 - 
 org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a 
 name. The name will be mandatory in the next Karaf version.
 2012-02-24 12:46:16,559 | WARN  | rint Extender: 2 | FeaturesServiceImpl  
 | res.internal.FeaturesServiceImpl  214 | 16 - 
 org.apache.karaf.features.core - 2.2.5 | Feature repository doesn't have a 
 name. The name will be mandatory in the next Karaf version.
 
 Running command: bundle:list --help
 
 org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: 
 bundle:list
   at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:471)
   at 
 org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)
   at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
   at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
   at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
   at 
 org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
 
 
 --
 // Bästa hälsningar, 
 // [sw. Best regards,]
 //
 // Lennart Jörelid, Systems Architect
 // email: lennart.jore...@teliasonera.com
 // cell: +46 708 507 603
 // skype: jgurueurope
 



Re: dev:watch and refresh

2012-01-12 Thread Łukasz Dywicki
The dev:watch command updates bundle if source location has been changed. You 
don't need to execute a refresh. It should back to Active state right after 
update without need to do refresh.

Łukasz Dywicki
--
Code-House
http://code-house.org


Wiadomość napisana przez Raman Gupta w dniu 2012-01-12, o godz. 21:48:

 I see that Karaf has a dev:watch command, but I also note that this
 does not refresh the bundles.
 
 Is there a way to tell Karaf to automatically refresh the changed
 bundle as well?
 
 Thanks,
 Raman



Re: multiple ssh commands programatically

2012-01-09 Thread Łukasz Dywicki
You can use an alias and quote sign a \  will do an space. Alsi you can 
create an alias.

Łukasz Dywicki
--
Code-House
http://code-house.org



Wiadomość napisana przez kmoens w dniu 2012-01-09, o godz. 14:28:

 Hi,
 
 I would like to send multiple SSH commands programatically, specifically to
 do a config:edit, config:propset MyProperty Foo Bar followed by a
 config:update.
 
 I have seen the example with multiple commands seperated by a space, but in
 my case the config:propset command itself contains spaces...
 
 And the config:edit - confi:update need to be done in 1 session.
 
 Any help on this would be very appreciated.
 
 Tx,
 
 Kris
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/multiple-ssh-commands-programatically-tp3644509p3644509.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Encryption of passwords

2012-01-04 Thread Łukasz Dywicki
Hey Matt,
Sorry for initial missunderstanding of your idea. So far there is no support 
for crypted values in config admin. EncryptionService is general purpose tool. 
You can use it to de-crypt values from configuration admin or somewhere in your 
application.
If you're looking for something to crypt passwords used by Camel take look for 
camel-jaspyt integration: http://camel.apache.org/jasypt.html

Best regards,
Łukasz Dywicki
--
Code-House
http://code-house.org

Wiadomość napisana przez Bengt Rodehav w dniu 2012-01-04, o godz. 23:42:

 Thanks for you suggestion Lukasz but I already read that part.
 
 Looking at it again, it seems like encryption is only supported in JAAS 
 configurations. I was hoping that it could be used in any configuration file 
 managed by config admin (or rather fileinstall). E g we configure a lot of 
 camel routes using e g ftp. In that case we need to configure the route with 
 the correct user and password. We currently do that using config admin. I was 
 hoping that Karaf's encryption support could make the passwords in those 
 configuration files encrypted. They would of course have to be decrypted 
 before the config admin feeds a service with the configuration.
 
 Did I completely misunderstand the encryption service?
 
 /Bengt
 
 2012/1/4 Łukasz Dywicki l...@code-house.org
 Please reffer the documentation:
 
 http://karaf.apache.org/manual/latest-2.2.x/developers-guide/security-framework.html#Encryptionservice
 
 For stronger security use a Jaspyt.
 
 Łukasz Dywicki
 --
 Code-House
 http://code-house.org
 
 Wiadomość napisana przez Bengt Rodehav w dniu 2012-01-04, o godz. 21:22:
 
 I've seen that Karaf provides an encryption service but I haven't figured 
 out how to use it.
 
 In our case we sometimes have to store passwords in configuration files. Can 
 the encryption service be used to encrypt them and then decrypt them when 
 configuration admin passes a configuration to a service? If so, how do I 
 accomplish this?
 
 /Bengt
 
 
 
 
 



Re: How to set up the remote debug with karaf in eclipse indigo

2011-12-15 Thread Łukasz Dywicki
Xilai,
Make sure you debug configuration in Eclipse points to port 5005. By default it 
is 8000. Also once you are connected to this port the second try will fail. To 
ensure that you are not already connected to Karaf switch a perspective to 
debug and check the process/threads list.

Regards,
Lukasz



 Tried with set KARAF_DEBUG=true before start karaf, and got:
  
 karaf.bat: Enabling Java debug options: -Xdebug -Xnoagent 
 -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,sus
 pend=n,address=5005
 Listening for transport dt_socket at address: 5005
  
 But still got the same error L when try to debug a bundle project.
  
 Thanks.
 Xilai
 From: Łukasz Dywicki [mailto:l...@code-house.org] 
 Sent: Thursday, December 15, 2011 5:05 PM
 To: user@karaf.apache.org
 Subject: Re: How to set up the remote debug with karaf in eclipse indigo
  
 For windows users it won't be a export, it will be
 set KARAF_DEBUG=1
  
 You can also add KARAF_DEBUG as user environment variable, but then every 
 time when'll start karaf you'll get a debug turned on, which might slow a bit 
 JVM.
  
 Regards,
 Lukasz
 
 
 Hi,
  
 Try to use
 export KARAF_DEBUG=true
 in the shell where you launch karaf to see if there's any difference, seems 
 the bin/karaf debug is incorrect, you should be able to see output like
 karaf: Enabling Java debug options: -Xdebug -Xnoagent -Djava.compiler=NONE 
 -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
 Listening for transport dt_socket at address: 5005
 if all set.
  
 Freeman
  
 On 2011-12-15, at 下午4:44, XiLai Dai wrote:
 
 
 Hi, Freeman,
  
 Run with bin\karaf.bat debug,  and got:
 TCP0.0.0.0:5005   0.0.0.0:0  LISTENING   3288
 When execute netstat –ano
  
 Thanks.
 Xilai
 From: Freeman Fang [mailto:freeman.f...@gmail.com] 
 Sent: Thursday, December 15, 2011 4:34 PM
 To: user@karaf.apache.org
 Subject: Re: How to set up the remote debug with karaf in eclipse indigo
  
 Hi,
  
 How you enable karaf debug?
 Did you
 export KARAF_DEBUG=true
 in the shell before you launch Karaf?
  
 Freeman
 On 2011-12-15, at 下午4:20, XiLai Dai wrote:
 
 
 
 Hello, 
 
 Does anybody has the experience which setting up the debug environment with 
 eclipse indigo? 
 
 I did the following steps:
 1. install EIK plugin from update site: 
 http://svn.codespot.com/a/eclipselabs.org/eik/trunk/features/info.evanchik.eclipse.karaf.update/
  
 2. follow the steps of 
 http://code.google.com/a/eclipselabs.org/p/eik/wiki/UsingEIK 
 
 Then , start karaf 2.2.4 with debug option:   Listening for transport 
 dt_socket at address: 5005 
 Debug a bundle project from eclipse IDE, but always got:
 
 Failed to connect to remote VM. Connection refused.
 Connection refused: connect
 
 Thanks.
 Xilai
  
 -
 Freeman Fang
  
 FuseSource
 Email:ff...@fusesource.com
 Web: fusesource.com
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
  
  
  
  
  
  
  
  
  
  
 -
 Freeman Fang
  
 FuseSource
 Email:ff...@fusesource.com
 Web: fusesource.com
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
  
  
  
  
  
  
  
  
  
  



Re: Loading Camel processors in separate classloaders

2011-12-14 Thread Łukasz Dywicki
Can't you simply use a Processor which uses list of Processor instances looked 
up from OSGi service registry and call them using an interface? Then you'll 
have separate class loaders for every service instance.

Best regards,
Lukasz

 I am building a system that relies on Apache Camel for data routing.  Within
 these routes will be custom processors and 3rd party processors (plug-ins).
 I would like the processors to run inside their own classloaders for
 protection and to protect the core system.  Is this something that Karaf can
 support since I don't think its possible for Camel to support this
 functionality.
 
 Thanks,
 Mark



Re: Karaf and aspectj load-time-weaving

2011-11-30 Thread Łukasz Dywicki
Hey Raman,
I wrote complete instruction how to enable equinox waving hook working under 
Karaf. You may find it on my blog:
http://dywicki.pl/2011/11/running-aspects-under-osgi-4-2-with-karaf/

Also I work on generic weaving hook compatible with OSGi 4.3 (I guess AspectJ 
team works on it too) to enable load time weaving on Felix too. It won't work 
in Karaf 2.2.x but it will work under 3.0 (current trunk).

Best regards,
Lukasz


 Hi Raman, 
 
 can't really answer your questions but give some hints :)
 
 1) it's not mandatory to use felix you easily can switch over to equinox
 2) should be as simples / stressfull with running on Virgo since 
 Karaf dosn't do anything special to prevent this :)
 
 So for using equinox just add the following line to your
 custsom.properties
 
 karaf.framework=equinox
 
 now Karaf runs with equinox. For the aspects stuff you still need to provide 
 the needed bundles 
 to Karaf but after that it should run. 
 
 Regards, Achim 
 
 2011/11/30 Raman Gupta rocketra...@gmail.com
 I'd like to have container-level LTW enabled for my bundles. Virgo has
 this out of the box using Equinox Aspects and the Equinox aspectj hook.
 
 Karaf uses Felix by default so I was trying to get this working on
 Felix, but have not found any solution. So, two questions:
 
 1) Is there a working AspectJ LTW solution for Felix?
 
 2) Does anyone have any experience with Equinox Aspects on top of
 Karaf with Equinox?
 
 Regards,
 Raman Gupta
 Principal
 VIVO Systems
 
 
 
 -- 
 
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer  
 Project Lead
 blog http://notizblog.nierbeck.de/



Re: Fetching feature from a nexus repository

2011-11-16 Thread Łukasz Dywicki
Hey Michael,
Slash was not source of problems. The source of all issues was space before it. 
Sorry for late response, but take a look for this example:

org.ops4j.pax.url.mvn.repositories= \ - this is wrong
org.ops4j.pax.url.mvn.repositories=\ - this is correct

You can use slash without any problems, just remember to dont use spaces at 
begining of property.

Best regards,
Lukasz

 Hi,
 
 a slash before my repository definition was the mistake.
 
 Thanks for your help.
 
 Cheers,
 
 Michael



Re: Unable to access library in lib directory NoClassDefFound

2011-11-08 Thread Łukasz Dywicki
Hey Otavio,
You can verify what is exposed by two commands:
packages:imports bundle-id
packages:exports bundle-id

Also if you library try to use Thread ContextClassLoader you may get these 
errors.

Regards,
Lukasz

 Hello,
 
 I am having problems making Karaf load the contents of a non-bundled
 java library (Webpshere MQ client 6.0.2.4).
 
 To have Karaf use them, I have added the following files to the lib directory:
 - com.ibm.mq.jar
 - ibm.mqjms.jar
 - dhbcore.jar
 
 After that, I modified the startup script so that it loaded those
 files. Additionally, I configured the custom.properties file so that
 they are accessible from outside:
 
 org.osgi.framework.system.packages.extra=com.google.common.base,\
 com.google.common.collect,sun.misc, com.ibm.mq, com.ibm.mq.jms,\
 com.ibm.msg.client.jms,com.ibm.disthub2.*,com.google.common.collect.*
 
 Even after doing that, when I deploy my bundle it stays in resolved
 state and does nothing. When I bounce Karaf,  I get the following
 exception:
 
 ERROR: Bundle com.spcs.wsd [78] Error starting
 file:/home/orpiske/environments/wsd-transaction-core-0.0.1-SNAPSHOT/deploy/service_manager-0.0.1-SNAPSHOT-bundle.jar
 (org.osgi.framework.BundleException: Activator start error in bundle
 com.spcs.wsd [78].
 java.lang.NoClassDefFoundError: com/ibm/mq/jms/MQQueueConnectionFactory
   at 
 com.spcs.wsd.camel.wmq.WmqJmsComponentBuilder.getMQQueueConnectionFactory(WmqJmsComponentBuilder.java:58)
   at 
 com.spcs.wsd.camel.wmq.WmqJmsComponentBuilder.build(WmqJmsComponentBuilder.java:84)
   at 
 com.spcs.wsd.service.manager.ServiceManager.registerNewComponent(ServiceManager.java:28)
   at 
 com.spcs.wsd.service.manager.ServiceManager.init(ServiceManager.java:22)
   at 
 com.spcs.wsd.service.manager.ServiceActivationManager.start(ServiceActivationManager.java:19)
   at 
 org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
   at org.apache.felix.framework.Felix.activateBundle(Felix.java:1842)
   at org.apache.felix.framework.Felix.startBundle(Felix.java:1759)
   at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1163)
   at 
 org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
   at java.lang.Thread.run(Thread.java:662)
 
 
 It looks like Karaf is not exposing or being able to expose the
 contents of that package to other classes. I did a quick test,
 following those steps, but exposing a simple hello-world jar and it
 works flawlessly.
 
 In addition to those steps, I also tried to run osgi:install -w
 wrap:file:lib/filename.jar but it did not work either.
 
 Would anyone know would prevent Karaf from accessing that library or
 would have any idea of how to overcome this?
 
 Regards
 -- 
 Otavio R. Piske
 http://orpiske.net



Re: Discover Karaf version

2011-06-29 Thread Łukasz Dywicki
Hey Daniel,
You can get karaf version using system properties.

System.getProperty(karaf.version)

Regards,
Lukasz


 Hi is there a api/service to retrieve current karaf version?
 
 Thanks
 
 -Dan



Re: how to integrate springMVC with karaf

2011-03-31 Thread Łukasz Dywicki
Hello,
First of all you need to change your context class to OsgiWebAppContext instead 
standard class. After that most of the errors dissapear.
I did some small test about 3 months before and it is pretty standard setup - 
Spring 3 + Spring WebMVC.

If you have some additional errors please share it. We may include Spring 
WebMVC demo in futher Karaf releases.

Best regards,
Lukasz

 Hi,
 
 which kind of errors did you get ?
 
 Regards
 JB
 
 On 03/31/2011 04:22 AM, stream wrote:
 Hi.
 As subject, i've tried a long time for this integration.
 but, always get various error, someone could give me guideline or a example
 thinks



Re: how to integrate springMVC with karaf

2011-03-31 Thread Łukasz Dywicki
Hi all,
I found my old project. From details provided by steam it looks like there is 
no all required imports:

In my example I had following packages imported:

Core spring dependency
 org.springframework.context,
 org.springframework.context.support,

Spring DM web stuff
 org.springframework.osgi.web.context.support,

Servlet and mvc
 org.springframework.web.context,
 org.springframework.web.servlet,
 org.springframework.web.servlet.handler,
 org.springframework.web.servlet.i18n,
 org.springframework.web.servlet.view,
 org.springframework.web.servlet.view.document,
 org.springframework.web.servlet.view.json,
 org.springframework.web.servlet.view.feed,
 org.springframework.web.servlet.view.tiles2,
 org.springframework.web.servlet.theme,
 org.springframework.web.servlet.tags,
 org.springframework.web.servlet.tags.form,
 org.springframework.web.servlet.mvc,
 org.springframework.web.servlet.mvc.annotation,

If you use json features in Spring WebMVC
 org.codehaus.jackson,
 org.codehaus.jackson.map,


If you wish to use tiles
 org.apache.tiles,
 org.apache.tiles.preparer,
 org.apache.tiles.renderer.impl,
 org.apache.tiles.evaluator,
 org.apache.tiles.context,
 org.apache.tiles.renderer,
 org.apache.tiles.definition,
 org.apache.tiles.startup,
 org.apache.tiles.jsp.context,
 org.apache.tiles.jsp.taglib,
 org.apache.tiles.servlet.context,

The jstl stuff
 javax.servlet.jsp.jstl.core,
 javax.servlet.jsp.jstl.fmt,

Jstl implementation
 org.apache.taglibs.standard,
 org.apache.taglibs.standard.tlv,
 org.apache.taglibs.standard.tei,
 org.apache.taglibs.standard.tag.rt.core,
 org.apache.taglibs.standard.tag.rt.fmt,
 org.apache.taglibs.standard.tag.common.core,
 org.apache.taglibs.standard.tag.common.fmt,
 org.apache.taglibs.standard.functions,

In past version of pax-web I needed to embed taglibs and put them to web.xml. 
Maybe it is not required now:
Embed-Dependency*;scope=runtime|provided;inline=META-INF/*.tld|META-INF/tld/*

Some of these imports are not necessary, but you have them by default in spring 
bundles so it will work anyway. 

Best regards,
Lukasz

 Hi Lukasz,
 
 that would be great :)
 
 regards, Achim
 
 2011/3/31 Łukasz Dywicki l...@code-house.org:
 Hello,
 First of all you need to change your context class to OsgiWebAppContext 
 instead standard class. After that most of the errors dissapear.
 I did some small test about 3 months before and it is pretty standard setup 
 - Spring 3 + Spring WebMVC.
 
 If you have some additional errors please share it. We may include Spring 
 WebMVC demo in futher Karaf releases.
 
 Best regards,
 Lukasz
 
 Hi,
 
 which kind of errors did you get ?
 
 Regards
 JB
 
 On 03/31/2011 04:22 AM, stream wrote:
 Hi.
 As subject, i've tried a long time for this integration.
 but, always get various error, someone could give me guideline or a example
 thinks
 
 



RE: Replace eclipse console with karaf

2010-12-28 Thread Łukasz Dywicki
Hi,
You may be interested in EIK (Eclipse Integration for Karaf) made by Stephen
Evanchik:
http://stephen.evanchik.com/blog/2010/12/05-release-eclipse-integration-kara
f.html

The EIK provides target platform definition for Karaf and let you start it
directly from your IDE.

Best regards,
Lukasz

-Original Message-
From: WPH [mailto:w...@maconomy.com] 
Sent: Tuesday, December 28, 2010 10:40 AM
To: user@karaf.apache.org
Subject: Replace eclipse console with karaf


I'm trying to use the Karaf console in an OSGi project rather than using the
eclipse console. The problem is when I run it, it starts up but terminate
immediately after.

It is an almost empty eclipse plugin project, with a target platform with
the following five bundles:
org.apache.aries.blueprint (0.2.0.invubating)
org.apache.felix.configadmin (1.2.4)
org.apache.karaf.shell.console (2.1.2)
org.eclipse.osgi (3.6.1.R36x_v20100806)
org.ops4j.pax.logging.pax-logging-api (1.5.3)

The output from the run is here:  http://pastebin.com/uncPWdxw pastebin.com 

This is with the following VM arguments: -Declipse.ignoreApp=true
-Dosgi.noShutdown=true -Dkaraf.startLocalConsole=true
-Dkaraf.startRemoteShell=false

If I remove -console from the program arguements is does not even start up.

Any ideas as to why I can't get the Karaf console to work?
-- 
View this message in context:
http://karaf.922171.n3.nabble.com/Replace-eclipse-console-with-karaf-tp21560
20p2156020.html
Sent from the Karaf - User mailing list archive at Nabble.com.



RE: Managed Properties question

2010-12-20 Thread Łukasz Dywicki
If you try to do managed component your configuration property name must
match field name, otherwise container will not update your bean. Both
spring-dm and aries blueprint works same. In your example the property named
integer have to use placeholder ${integer}. If you would like to use
different names you need to manage changes in bean (set strategy to bean
managed and callback method).

Best regards,
Lukasz

-Original Message-
From: Achim Nierbeck [mailto:bcanh...@googlemail.com] 
Sent: Monday, December 20, 2010 6:00 PM
To: user@karaf.apache.org
Subject: Re: Managed Properties question

OK, another try

bean id=containerManaged class=ContainerManagedBean
   osgix:managed-properties persistent-id=labX
update-strategy=container-managed/
   property name=integer value=23/
/bean

this is the official example :)

I think the property (named integer here) is optional. Usually all
properties which can be read through getter and setter can be set by
the configuration.

So your problem is that you try to inject properties within another property

property name=hibernateProperties
   props
prop key=hibernate.show_sql${myAppDbShowSql}/prop
prop key=hibernate.format_sql${myAppDbFormatSql}/prop
   /props
  /property

All your properties you want to update need to be accessible via
getter and setter.
If you want to do this you need to make an extra bean which is
configurable (with the same pid)
and inject that one after it is initialized. you may want to make your
standard bean dependend on the new bean.

2010/12/20 karafman mvangeert...@comcast.net

 It still isn't working.

 Here's an excerpt of my .cfg file (none of the names in the file have any
 characters other than [a-z, A-Z]:
 myAppDbShowSql = false
 myAppDbFormatSql = false

 In the file where I get my service I have:
 osgix:cm-properties id=myAppDatabaseProperties
 persistent-id=myApp.data.access/
 ctx:property-placeholder properties-ref=myAppDatabaseProperties/

 In the file where I am using the managed service I have (unnecessary bits
 removed):
 bean id=myAppSessionFactory
 class=org.springframework.orm.hibernate3.LocalSessionFactoryBean
 p:dataSource-ref=myAppPoolDataSource
  osgix:managedProperties persistent-id=myApp.data.access
 update-strategy=container-managed/
  property name=mappingResources
   listhibernate valies/list
  /property
  property name=hibernateProperties
    props
     prop key=hibernate.show_sql${myAppDbShowSql}/prop
     prop key=hibernate.format_sql${myAppDbFormatSql}/prop
    /props
   /property
 /bean

 When I change the values in my .cfg file, I can see those changes being
 populated by doing a config:list.

 However, I get the following error in my log:
 Configuration for myApp.data.access has already been used for service
 [org.osgi.service.cm.ManagedService, id=127, bundle=89] and will be also
 given to [org.osgi.service.cm.ManagedService, id=128, bundle=89]

 When I restart bundle 89, the properties are properly consumed.

 Anyone know what's going wrong?


 -
 Karafman
 Slayer of the JEE
 Pounder of the Perl Programmer

 --
 View this message in context:
http://karaf.922171.n3.nabble.com/Managed-Properties-question-tp2107407p2121
172.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



RE: Placing properties files in the classpath

2010-12-09 Thread Łukasz Dywicki
It depends on the configuration admin. Karaf uses etc directory for these
configurations - eg. If you persistence id is set to com.mycompany any
changes in $KARAF_BASE/etc/com.mycompany.cfg will be visible for your
components. It doesn't look classpath, it looks into etc directory. That's
better than classpath because operations can do changes without JAR
modification. Even more fantastic is fact that your component can be
notified about configuration change..


Best regards,
Lukasz


-Original Message-
From: Mike Van [mailto:mvangeert...@comcast.net] 
Sent: Thursday, December 09, 2010 9:42 PM
To: user@karaf.apache.org
Subject: RE: Placing properties files in the classpath


In those cases, where does OSGi look to find the properties? And, what are
the property file names?

Mike Van
-- 
View this message in context:
http://karaf.922171.n3.nabble.com/Placing-properties-files-in-the-classpath-
tp2054553p2060007.html
Sent from the Karaf - User mailing list archive at Nabble.com.



RE: Placing properties files in the classpath

2010-12-09 Thread Łukasz Dywicki
No,
These bundles may reffer same persistent id (configuration file) without 
problems.

In fact - you may introduce new bundle which produces connection factory and 
export it as service to reduce number of configuration dependencies.

Best regards,
Lukasz

-Original Message-
From: Mike Van [mailto:mvangeert...@comcast.net] 
Sent: Thursday, December 09, 2010 10:03 PM
To: user@karaf.apache.org
Subject: Re: Placing properties files in the classpath




Ok. 



If I have 4 bundles that all use JMS, and they are named: 

myApp.bundle1 

myApp.bundle2 

myApp.bundle3 

myApp.bundle4 



Would I need 4 configuration files in etc: 

myApp.bundle1.cfg 

myApp.bundle2.cfg 

myApp.bundle3.cfg 

myApp.bundle4.cfg 



? 


- Original Message - 
From: Łukasz Dywicki [via Karaf] 
ml-node+2060078-1778899901-228...@n3.nabble.com 
To: Mike Van mvangeert...@comcast.net 
Sent: Thursday, December 9, 2010 3:58:32 PM 
Subject: RE: Placing properties files in the classpath 

It depends on the configuration admin. Karaf uses etc directory for these 
configurations - eg. If you persistence id is set to com.mycompany any 
changes in $KARAF_BASE/etc/com.mycompany.cfg will be visible for your 
components. It doesn't look classpath, it looks into etc directory. That's 
better than classpath because operations can do changes without JAR 
modification. Even more fantastic is fact that your component can be 
notified about configuration change.. 


Best regards, 
Lukasz 


-Original Message- 
From: Mike Van [mailto: [hidden email] ] 
Sent: Thursday, December 09, 2010 9:42 PM 
To: [hidden email] 
Subject: RE: Placing properties files in the classpath 


In those cases, where does OSGi look to find the properties? And, what are 
the property file names? 

Mike Van 
-- 
View this message in context: 
http://karaf.922171.n3.nabble.com/Placing-properties-files-in-the-classpath- 
tp2054553p2060007.html 
Sent from the Karaf - User mailing list archive at Nabble.com. 







View message @ 
http://karaf.922171.n3.nabble.com/Placing-properties-files-in-the-classpath-tp2054553p2060078.html
 
To start a new topic under Karaf - User, email 
ml-node+930749-917263437-228...@n3.nabble.com 
To unsubscribe from Karaf - User, click here .
-- 
View this message in context: 
http://karaf.922171.n3.nabble.com/Placing-properties-files-in-the-classpath-tp2054553p2060101.html
Sent from the Karaf - User mailing list archive at Nabble.com.



RE: Ather URL Handler not available.

2010-11-30 Thread Łukasz Dywicki
What do you think to increase log level for this category by default?

(Or report decrease proposal in aries)

Best regards,
Lukasz


From: bengt.rode...@gmail.com [mailto:bengt.rode...@gmail.com] On Behalf Of
Bengt Rodehav
Sent: Tuesday, November 30, 2010 1:38 PM
To: user@karaf.apache.org
Subject: Re: Ather URL Handler not available.

OK - thanks,

/Bengt
2010/11/30 Guillaume Nodet gno...@gmail.com
Yes, those are harmless and can be safely ignored.

On Tue, Nov 30, 2010 at 11:58, Bengt Rodehav be...@rodehav.com wrote:
 Starting from Karaf 2.1.2 I get the following in my log file:

 2010-11-30 09:21:45,911 | INFO  | rint Extender: 2 |
 AetherBridgeConnection           | .internal.AetherBridgeConnection   61
|
 Ather URL Handler not available.

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 | core
             | ?                                   ? | ServiceEvent
 REGISTERED

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 |
 BlueprintEventDispatcher         | ntainer.BlueprintEventDispatcher  123
|
 Sending blueprint container event BlueprintEvent[type=CREATED] for bundle
 org.apache.karaf.admin.core

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 |
 BlueprintContainerImpl           | container.BlueprintContainerImpl  231
|
 Running blueprint container for bundle org.apache.karaf.admin.core in
state
 Created

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 |
 BlueprintContainerImpl           | container.BlueprintContainerImpl  231
|
 Running blueprint container for bundle
org.apache.karaf.deployer.blueprint
 in state Unknown

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 |
 BlueprintContainerImpl           | container.BlueprintContainerImpl  190
|
 Grace-period directive: false

 2010-11-30 09:21:45,911 | DEBUG | rint Extender: 3 |
 BlueprintEventDispatcher         | ntainer.BlueprintEventDispatcher  123
|
 Sending blueprint container event BlueprintEvent[type=CREATING] for
bundle
 org.apache.karaf.deployer.blueprint

 2010-11-30 09:21:45,911 | INFO  | rint Extender: 2 |
 AetherBridgeConnection           | .internal.AetherBridgeConnection   66
|
 Using mvn fallback to resolve
 mvn:se.digia.connect/karaf/1.1.0-SNAPSHOT/xml/features

 I get lots of these, probably for all the bundles I have installed. Is
this
 normal? What does it mean?
 /Bengt


--
Cheers,
Guillaume Nodet

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

Open Source SOA
http://fusesource.com




Announcement: ServiceMix IDE

2010-10-19 Thread Łukasz Dywicki
Hi folks!

 

I would announce small project, which can interest you - ServiceMix IDE [1].
It is partially fork of EIK from Fuse Forge which I moved to github a week
ago.

 

We (at this moment me) would achieve better support for developers working
with XML configurations for Camel/ServiceMix/ActiveMQ/Karaf/CXF and so on.
This project can ease introduction to these projects for new users and let
you work faster. Do you remember how many times you Maven artifact didn't
start because you have done typo in XML? :-)

 

What project have:

-  Support XML namespaces for ActiveMQ (from 4.0 to 5.4) and Camel
(from 1.0 to 2.4). You can safely work without internet connection or behind
broxy.

-  Additional archetype catalogs for M2Eclipse from Sonatype.

In future I would add content assistant for camel XML (it will be Spring IDE
extension) and other configurations.

 

If something hurts you in your IDE let us know [2].

 

Kind regards,

Lukasz Dywicki

 

[1] I know, it is not IDE yet.

 [2] http://github.com/splatch/servicemix-ide/issues