Re: bin/client fails to connect when called via ansible.builtin.shell

2022-01-18 Thread Freeman Fang
Yes, this is the TTY thing and I ran into the same thing before.

On Tue, Jan 18, 2022 at 5:51 PM VIEILLARD Francois <
francois.vieill...@soprasteria.com> wrote:

> Hi Ralf
>
> I had the exact same problem as you and I found that the script fails
> because there is no TTY in the remote session opened using ansible
>
> You could use the script batch mode instead, which doesn’t require TTY
> (flag -b in the script)
>
> So your ansible task would become:
>
> - name: Use Karaf Client
>shell: "./client -v -l 4 -b <<< ls"
>
shell: "echo "no tty input"|./client -v -l 4 -b"

should also work



>args:
>  chdir: "{{ karaf_install_symlink }}/bin"
>
>
>
> Regards,
>
> François
>
>
>
> On 2022/01/04 20:17:37 Ralf Steppacher wrote:
> > Hello all,
> >
> > I am trying to provision Karaf using Ansible (on localhost). All is good
> > until I first try to use the bin/client script to interact with the
> > local Karaf server. For some reason all interactions, no matter what I
> > try, end with the error "Closed". However, I can run the client script
> > successfully on the command line. I ran the client with full trace logs
> > (-v -l 4) with Ansible and on the command line and diffed the output.
> > Apart from session IDs, timestamps, and encrypted content on the wire
> > the logs look identical as far as I can see until we reach this line:
> >
> > [main] DEBUG org.apache.sshd.client.session.ClientSessionImpl -
> > createExecChannel([ClientSessionImpl[karaf@localhost/127.0.0.1:8101],
> > ls, 0, null])[null] created id={} - PTY={}
> >
> > After which the client continues to process the ls command if called on
> > the command line and immediately closes the connection when called via
> > Ansible:
> >
> > 525 [Thread-2] DEBUG org.apache.sshd.client.channel.ChannelExec -
> > close(ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101])
> Closing
> > immediately
> > 525 [Thread-2] DEBUG org.apache.sshd.client.channel.ChannelExec -
> > close(ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101])
> prevent
> > sending EOF
> > 525 [main] DEBUG org.apache.sshd.client.channel.ChannelExec -
> > open(ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101]) Send
> > SSH_MSG_CHANNEL_OPEN - type=session
> > 525 [Thread-2] DEBUG org.apache.sshd.common.channel.Window - Closing
> > Window[client/local](ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101])
> > 525 [main] DEBUG org.apache.sshd.client.channel.ChannelExec -
> > writePacket(ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101])
> > Discarding output packet because channel state=Immediate
> > 525 [Thread-2] DEBUG org.apache.sshd.common.channel.Window - Closing
> > Window[client/remote](ChannelExec[id=0,
> > recipient=-1]-ClientSessionImpl[karaf@localhost/127.0.0.1:8101])
> > [..]
> >
> > All output is on level DEBUG or TRACE. No error is reported.
> >
> > The Ansible task is as simple as they come:
> >
> > - name: Use Karaf Client
> >shell: "./client -v -l 4 ls"
> >args:
> >  chdir: "{{ karaf_install_symlink }}/bin"
> >
> > The karaf server log shows the connection, and a while later logs an
> > authentication timeout, presumably because the client left the
> > conversation dangling.
> >
> > 2022-01-04T20:53:13,178 | INFO  |
> > sshd-SshServer[315a8514](port=8101)-nio2-thread-2 | ServerSessionImpl
> >  | 43 - org.apache.sshd.osgi - 2.5.1 | Session
> > karaf@/127.0.0.1:33910 authenticated
> > 2022-01-04T20:55:12,564 | INFO  |
> > sshd-SshServer[315a8514](port=8101)-timer-thread-1 | ServerSessionImpl
> >   | 43 - org.apache.sshd.osgi - 2.5.1 |
> > Disconnecting(ServerSessionImpl[null@/127.0.0.1:33908]):
> > SSH2_DISCONNECT_PROTOCOL_ERROR - Detected AuthTimeout after
> > 120181/12 ms.
> > 2022-01-04T20:55:12,566 | WARN  |
> > sshd-SshServer[315a8514](port=8101)-nio2-thread-2 | ServerSessionImpl
> >  | 43 - org.apache.sshd.osgi - 2.5.1 |
> > disconnect(ServerSessionImpl[null@/127.0.0.1:33908]) operation failed
> > (IOException) for reason=SSH2_DISCONNECT_PROTOCOL_ERROR [Detected
> > AuthTimeout after 120181/12 ms.]: Broken pipe
> >
> > Where would I have to tweak the setup to make the karaf client work
> > through Ansible?
> >
> >
> > Thanks!
> > Ralf
> >
>


Re: Karaf 4.2.11 - "maven:repository-remove -id central" fails with NPE. Why?

2021-04-12 Thread Freeman Fang
Hi JB,

FYI, I created jira ticket https://issues.apache.org/jira/browse/KARAF-6772
to track it, and leave it for you.

Cheers
Freeman



On Mon, Apr 12, 2021 at 3:05 PM JB Onofré  wrote:

> That’s my point: you should prevent the NPE.
>
> I will fix that.
>
> Regards
> JB
>
> Le 12 avr. 2021 à 21:00, Freeman Fang  a écrit :
>
> 
> Hi Paul,
>
> This is caused by that you don't have ~/.m2/settings.xml, so mavenSettings
> is null. We need to add a NPE guard here.
>
> Freeman
>
> On Mon, Apr 12, 2021 at 2:43 PM Paul Spencer 
> wrote:
>
>> Karaf 4.2.11
>> Java  1.8.0_282
>> OSRedhat 8.2
>>
>> Starting with a virgin Karaf 4.2.11 installation, I added my own
>> repository and I attempted to remove the default remote repositories.
>> Removing the repository id central fails with a NPE.  Why?
>>
>> karaf@root()> maven:repository-add -id myrepo http://myrepo.example.com
>> karaf@root()> maven:repository-remove -id central
>> Are you sure to remove repository with ID "central" for URL
>> https://repo1.maven.org/maven2/? (y/N) y
>> null
>> karaf@root()>
>>
>> ***
>> * From karaf.log
>> ***
>> 14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser
>> of class
>> org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569
>> does not support the CompletingParsedLine interface. Completion with
>> escaped or quoted words won't work correctly.
>> 14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null
>> java.lang.NullPointerException: null
>> at
>> org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
>> ~[!/:?]
>> at
>> org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
>> ~[!/:?]
>> at
>> org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
>> [!/:?]
>> at
>> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>> [!/:4.2.11]
>> at
>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>> [!/:4.2.11]
>> at
>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>> [!/:4.2.11]
>> at
>> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
>> [!/:4.2.11]
>> at
>> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
>> [!/:4.2.11]
>> at
>> org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) [!/:4.2.11]
>> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
>> [!/:4.2.11]
>> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
>> [!/:4.2.11]
>> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
>> [!/:4.2.11]
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> [?:1.8.0_282]
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>> [?:1.8.0_282]
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>> [?:1.8.0_282]
>> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
>>
>>
>> Paul Spencer
>
>


Re: Karaf 4.2.11 - "maven:repository-remove -id central" fails with NPE. Why?

2021-04-12 Thread Freeman Fang
Hi Paul,

This is caused by that you don't have ~/.m2/settings.xml, so mavenSettings
is null. We need to add a NPE guard here.

Freeman

On Mon, Apr 12, 2021 at 2:43 PM Paul Spencer 
wrote:

> Karaf 4.2.11
> Java  1.8.0_282
> OSRedhat 8.2
>
> Starting with a virgin Karaf 4.2.11 installation, I added my own
> repository and I attempted to remove the default remote repositories.
> Removing the repository id central fails with a NPE.  Why?
>
> karaf@root()> maven:repository-add -id myrepo http://myrepo.example.com
> karaf@root()> maven:repository-remove -id central
> Are you sure to remove repository with ID "central" for URL
> https://repo1.maven.org/maven2/? (y/N) y
> null
> karaf@root()>
>
> ***
> * From karaf.log
> ***
> 14:16:28.422 WARN [pipe-maven:repository-remove -id central] The Parser of
> class
> org.apache.karaf.shell.impl.console.ConsoleSessionImpl$$Lambda$411/734988569
> does not support the CompletingParsedLine interface. Completion with
> escaped or quoted words won't work correctly.
> 14:16:30.081 ERROR [pipe-maven:repository-remove -id central] null
> java.lang.NullPointerException: null
> at
> org.apache.karaf.maven.command.RepositoryRemoveCommand.edit(RepositoryRemoveCommand.java:73)
> ~[!/:?]
> at
> org.apache.karaf.maven.command.RepositoryEditCommandSupport.doAction(RepositoryEditCommandSupport.java:65)
> ~[!/:?]
> at
> org.apache.karaf.maven.command.MavenConfigurationSupport.execute(MavenConfigurationSupport.java:161)
> [!/:?]
> at
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
> [!/:4.2.11]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
> [!/:4.2.11]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
> [!/:4.2.11]
> at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
> [!/:4.2.11]
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
> [!/:4.2.11]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
> [!/:4.2.11]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [?:1.8.0_282]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [?:1.8.0_282]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [?:1.8.0_282]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
>
>
> Paul Spencer


Re: Add library to jdk9plus with karaf-maven-plugin

2020-08-13 Thread Freeman Fang
Hi Guillaume,

Could you please fill an enhancement jira ticket for this? We can track it
there.

Thanks!
Freeman

On Wed, Aug 12, 2020 at 4:45 PM Guillaume Girard 
wrote:

> Hi all,
>
> I am trying to use the karaf-maven-plugin to customize a distribution and
> more specifically to add bouncy castle support.
> On JDK 8, there is no issue as additional libraries can be added to the
> distribution with the AssemblyMojo and specifying them like
> 
>
> mvn:org.bouncycastle/bcmail-jdk15on/1.66;type:=extension;delegate:=true
> 
>
> But on JDK11, it looks like bouncy castle jars need to be installed in
> `lib/jdk9plus` and not `lib/ext`.
> This seems to not be possible today with karaf-maven-plugin as the
> AssemblyMojo supports only `endorsed`, `ext` and `boot` locations.
> There is no option to add a library to both `lib/ext` and `lib/jdk9plus`,
> which seems to be required to have a working solution for both JDK8 and
> JDK11.
>
> Is there any clean solution to achieve my aim?
>
> Thanks,
>
> Guillaume.
>


Re: Karaf 4.2.7 + Servlet Multipart java.lang.NoClassDefFoundError: org/eclipse/jetty/util/MultiPartInputStreamParser

2020-06-07 Thread Freeman Fang
Hi,

I believe this is fixed in Karaf 4.2.8
https://issues.apache.org/jira/browse/KARAF-6597
So give it a try with Karaf 4.2.8

Cheers
Freeman

On Sun, Jun 7, 2020 at 11:38 AM Davi Baldin Tavares 
wrote:

> Hi Karafers,
>
> A) In case I use Annotation:
>
> @WebServlet(name = "Sendgrid Inbound Parse receiver", urlPatterns =
> "/inbound")
> @MultipartConfig
> public class SendGridServlet extends HttpServlet implements Servlet { … }
>
> I’m getting:
>
> 2020-06-07T11:59:47,485 | WARN  | qtp423783131-158 | HttpChannel
> | 114 - org.eclipse.jetty.util - 9.4.20.v20190813 |
> /sendgrid/inbound
> java.lang.NoClassDefFoundError:
> org/eclipse/jetty/util/MultiPartInputStreamParser
>
> I’ve found:
>
>
> http://karaf.922171.n3.nabble.com/jsf-NoClassDefFoundError-org-eclipse-jetty-util-MultiPartInputStreamParser-td4057196.html
> https://issues.apache.org/jira/browse/CAMEL-14105
>
> B) In case I use Camel suggestion…
>
> Collection parts = request.getParts();
> parts.forEach((part) -> {
> log.info("Part --> {} : {} ", part.getName(),
> part.getSize() );
> });
>
> I’m getting:
>
> 2020-06-07T12:14:23,180 | WARN  | qtp423783131-160 | HttpChannel
> | 114 - org.eclipse.jetty.util - 9.4.20.v20190813 |
> /sendgrid/inbound
> java.lang.IllegalStateException: No multipart config for servlet
> at org.eclipse.jetty.server.Request.getParts(Request.java:2215)
> ~[?:?]
>
>
> C) In case I try this workaround:
> https://www.eclipse.org/lists/jetty-users/msg03294.html, I get the same
> issue as A (annotation).
>
> What is the correct way to get working with multipart in Karaf?
>
> Thanks,
>
> Davi
>
>
>


Re: "Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0" installing any camel 3.2.0 feature

2020-04-15 Thread Freeman Fang
Hi,
 should be under 
http://karaf.apache.org/xmlns/features-processing/v1.0.0;>





mvn:org.apache.karaf.features/framework/4.3.0-SNAPSHOT/xml/features

mvn:org.apache.karaf.features/standard/4.3.0-SNAPSHOT/xml/features

mvn:org.apache.karaf.features/enterprise/4.3.0-SNAPSHOT/xml/features

mvn:org.apache.karaf.features/enterprise-legacy/4.3.0-SNAPSHOT/xml/features

mvn:org.apache.karaf.features/spring/4.3.0-SNAPSHOT/xml/features

mvn:org.apache.karaf.features/spring-legacy/4.3.0-SNAPSHOT/xml/features


   




Freeman


On Wed, Apr 15, 2020 at 10:05 AM Paul Spencer 
wrote:

> Freeman,
>
> I have installed a fresh copy of Karaf v4.2.8 and get the same error.
>
> I must be doing something wrong because adding the file did not change the
> error. Below is the etc/org.apache.karaf.features.xml
>
> apache-karaf-4.2.8 paul$ more etc/org.apache.karaf.features.xml
> 
> 
>  originalUri="mvn:org.apache.camel/camel-commands-core/3.2.0"
> replacement="mvn:org.apache.camel.karaf/camel-commands-core/3.2.0"/>
> 
>
>
> > On Apr 15, 2020, at 9:38 AM, Freeman Fang 
> wrote:
> >
> > Hi,
> >
> > This is a known issue, please see the discussion and solution here
> >
> > Cheers
> > Freeman
> >
> > On Wed, Apr 15, 2020 at 9:33 AM Paul Spencer 
> wrote:
> > Karaf 4.2.0
> > Java 1.8
> >
> > I am receiving the following error when installing any Camel 3.2.0
> feature
> >
> > > karaf@root()> feature:install camel/3.2.0
> > > org.apache.karaf.features.internal.util.MultiException: Error:
> > >   Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0
> > >   at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.(MavenDownloadManager.java:91)
> > >
> >
> > Looking at the feature.xml on repo1.maven.org, I see
> camel-commands-core listed, but version 3.2.0 of camel-commands-core does
> not exist in repo1.maven.org.
> >
> >   feature.xml -
> https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.2.0/apache-camel-3.2.0-features.xml
> >   camel-commands-core -
> https://repo1.maven.org/maven2/org/apache/camel/camel-commands-core/
> >
> > How do I resolve this error?
> >
> > Paul Spencer
>
>


Re: "Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0" installing any camel 3.2.0 feature

2020-04-15 Thread Freeman Fang
Hi,

This is a known issue, please see the discussion and solution here


Cheers
Freeman

On Wed, Apr 15, 2020 at 9:33 AM Paul Spencer 
wrote:

> Karaf 4.2.0
> Java 1.8
>
> I am receiving the following error when installing any Camel 3.2.0 feature
>
> > karaf@root()> feature:install camel/3.2.0
> > org.apache.karaf.features.internal.util.MultiException: Error:
> >   Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0
> >   at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.(MavenDownloadManager.java:91)
> >
>
> Looking at the feature.xml on repo1.maven.org, I see camel-commands-core
> listed, but version 3.2.0 of camel-commands-core does not exist in
> repo1.maven.org.
>
>   feature.xml -
> https://repo1.maven.org/maven2/org/apache/camel/karaf/apache-camel/3.2.0/apache-camel-3.2.0-features.xml
>   camel-commands-core -
> https://repo1.maven.org/maven2/org/apache/camel/camel-commands-core/
>
> How do I resolve this error?
>
> Paul Spencer


Re: Camel 3.2.0 install on Karaf 4.2.8

2020-04-10 Thread Freeman Fang
Hi,

This is a known issue caused by karaf related stuff in camel being moved to
camel-karaf sub-project and this already get fixed at camel.

Please take a look at the discussion here
to
get the idea how to workaround this.

Freeman

On Fri, Apr 10, 2020 at 4:40 PM Oleg Cohen 
wrote:

> Greetings,
>
> Not sure if anybody ran into this issue.
>
> I am starting with a brand new instance of Karaf 4.2.8
>
> I added camel and camel-extras repos
>
> feature:repo-add camel
> feature:repo-add camel-extras
>
> karaf@root()> feature:repo-list | grep camel
> camel-3.2.0   │
> mvn:org.apache.camel.karaf/apache-camel/RELEASE/xml/features
> camel-extra-2.24.3│
> mvn:org.apache-extras.camel-extra.karaf/camel-extra/RELEASE/xml/features
> camel-2.24.3  │
> mvn:org.apache.camel.karaf/apache-camel/2.24.3/xml/features
>
> When I try to install camel-core I get the following exception:
>
> karaf@root()> feature:install camel
> Error executing command: Error:
>
> * Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0*
> karaf@root()> feature:install camel-core
> Error executing command: Error:
>
> * Error downloading mvn:org.apache.camel/camel-commands-core/3.2.0*
>
> Seems org.apache.camel/camel-commands-core/3.2.0 is missing.
>
> Would appreciate suggestions!
>
> Thank you,
> Oleg
>
>
> --
> *Oleg Cohen  |  Principal  |  **A S S U R E B R I D G E*
> *Office: +1 617 564 0737  |  Mobile: +1 617 455 7927  |  Fax: +1 888 409
> 6995*
> *Email: oleg.co...@assurebridge.com   **|
>  www.assurebridge.com *
>


Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Freeman Fang
And for the Provide-Capability requirements, I think we need to release
jaxrs-api-2.1 from Servicemix which will contain the fix.
So far you can use the snapshot version of it to give it a quick shot.

Freeman

On Sat, Mar 14, 2020 at 12:00 PM Freeman Fang 
wrote:

> Hi,
>
> Please see my comments inline
>
> On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig 
> wrote:
>
>> Hi Tim,
>>
>> thanks for your answer, that was what I was looking at to begin, this was
>> my initial code
>>
>> @Reference ClientBuilder clientBuilder;
>>
>> Client client = clientBuilder.hostnameVerifier((s, session) ->
>> true)
>>  .sslContext(sslContext)
>>  .register(new
>> JacksonJsonProvider(objectMapper))
>>  .connectTimeout(10, TimeUnit.MINUTES)
>>  .build();
>>
>> with but then I faced:
>>
>> Error executing command: Unable to resolve
>> lu.tlk.occupation_postes_electronique.services.login-service [123](R
>> 123.2): missing requirement
>> [lu.tlk.occupation_postes_electronique.services.login-service [123](R
>> 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)
>> Unresolved requirements:
>> [[lu.tlk.occupation_postes_electronique.services.login-service [123](R
>> 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)]
>> I then manually added
>>
>> bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1
>>
>> This is the problem, shouldn't use this one, should use
>
> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
> which has OSGi locator enabled.
>
>>
>>
>> and then I got
>> Error executing command: Error executing command on bundles: Error starting 
>> bundle 123: Unable to resolve 
>> lu.tlk.occupation_postes_electronique.services.login-service [123](R 123.2): 
>> missing requirement 
>> [lu.tlk.occupation_postes_electronique.services.login-service [123](R 
>> 123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0)) 
>> Unresolved requirements: 
>> [[lu.tlk.occupation_postes_electronique.services.login-service [123](R 
>> 123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0))]
>> So at that point I tried to revert to the old code I already and I knew was 
>> running back then ...
>>
>> You had a post back in 2018 about this but it was related to Java 9 ... I'm 
>> still on Java 8.
>>
>> I didn't find anything relevant to this contract issue (except some stuff 
>> about Johnzon JSON-B ...
>>
>>
>>
>>
>> Mat frëndleche Gréiss,
>> Mit freundlichen Grüßen,
>> Meilleures salutations,
>> Kind regards,Alex WeirigResponsable Technique
>> Ville de Luxembourg
>> Service Enseignement
>> Centre Technolink
>> *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* 
>> alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu
>>
>> Centre Technolink
>> 2, rue Charles de Tornaco
>> L-2623 LUXEMBOURG
>>
>> indoors.this.blesses
>> <https://map.what3words.com/indoors.this.blesses>
>> schaufel.besten.kopie
>> <https://map.what3words.com/schaufel.besten.kopie>
>> supposons.levage.venger
>> <https://map.what3words.com/supposons.levage.venger>
>> On 14/03/2020 16:20, Tim Ward wrote:
>>
>> Have you considered creating the clients as described in the JAX-RS
>> Whiteboard specification (
>> https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114)?
>> This avoids the reflective loading pain that you’re hitting in a reliable
>> way.
>>
>> All the best,
>>
>> Tim
>>
>> Sent from my iPhone
>>
>> On 14 Mar 2020, at 15:05, Alex Weirig  wrote:
>>
>> BTW:
>>
>> from my docs it looks like I did that in the past using cxf 3.2.4.
>>
>> Have there been any significant breaking changes since 3.2.4?
>>
>>
>> Mat frëndleche Gréiss,
>> Mit freundlichen Grüßen,
>> Meilleures salutations,
>> Kind regards,Alex WeirigResponsable Technique
>> Ville de Luxembourg
>> Service Enseignement
>> Centre Technolink
>> *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* 
>> alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu
>>
>> Centre Technolink
>> 2, rue Charles de Tornaco
>> L-2623 LUXEMBOURG
>>
>> indoors.this.blesses
>> <https://map.what3words.com/indo

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Freeman Fang
Hi,

Please see my comments inline

On Sat, Mar 14, 2020 at 11:54 AM Alex Weirig 
wrote:

> Hi Tim,
>
> thanks for your answer, that was what I was looking at to begin, this was
> my initial code
>
> @Reference ClientBuilder clientBuilder;
>
> Client client = clientBuilder.hostnameVerifier((s, session) ->
> true)
>  .sslContext(sslContext)
>  .register(new
> JacksonJsonProvider(objectMapper))
>  .connectTimeout(10, TimeUnit.MINUTES)
>  .build();
>
> with but then I faced:
>
> Error executing command: Unable to resolve
> lu.tlk.occupation_postes_electronique.services.login-service [123](R
> 123.2): missing requirement
> [lu.tlk.occupation_postes_electronique.services.login-service [123](R
> 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)
> Unresolved requirements:
> [[lu.tlk.occupation_postes_electronique.services.login-service [123](R
> 123.2)] osgi.wiring.package; (osgi.wiring.package=javax.ws.rs.client)]
> I then manually added
>
> bundle:install mvn:javax.ws.rs/javax.ws.rs-api/2.1
>
> This is the problem, shouldn't use this one, should use
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
which has OSGi locator enabled.

>
>
> and then I got
> Error executing command: Error executing command on bundles:  Error starting 
> bundle 123: Unable to resolve 
> lu.tlk.occupation_postes_electronique.services.login-service [123](R 123.2): 
> missing requirement 
> [lu.tlk.occupation_postes_electronique.services.login-service [123](R 123.2)] 
> osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0)) Unresolved 
> requirements: [[lu.tlk.occupation_postes_electronique.services.login-service 
> [123](R 123.2)] osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0))]
> So at that point I tried to revert to the old code I already and I knew was 
> running back then ...
>
> You had a post back in 2018 about this but it was related to Java 9 ... I'm 
> still on Java 8.
>
> I didn't find anything relevant to this contract issue (except some stuff 
> about Johnzon JSON-B ...
>
>
>
>
> Mat frëndleche Gréiss,
> Mit freundlichen Grüßen,
> Meilleures salutations,
> Kind regards,Alex WeirigResponsable Technique
> Ville de Luxembourg
> Service Enseignement
> Centre Technolink
> *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* 
> alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu
>
> Centre Technolink
> 2, rue Charles de Tornaco
> L-2623 LUXEMBOURG
>
> indoors.this.blesses
> 
> schaufel.besten.kopie
> 
> supposons.levage.venger
> 
> On 14/03/2020 16:20, Tim Ward wrote:
>
> Have you considered creating the clients as described in the JAX-RS
> Whiteboard specification (
> https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e134114)?
> This avoids the reflective loading pain that you’re hitting in a reliable
> way.
>
> All the best,
>
> Tim
>
> Sent from my iPhone
>
> On 14 Mar 2020, at 15:05, Alex Weirig  wrote:
>
> BTW:
>
> from my docs it looks like I did that in the past using cxf 3.2.4.
>
> Have there been any significant breaking changes since 3.2.4?
>
>
> Mat frëndleche Gréiss,
> Mit freundlichen Grüßen,
> Meilleures salutations,
> Kind regards,Alex WeirigResponsable Technique
> Ville de Luxembourg
> Service Enseignement
> Centre Technolink
> *Tel* +352 4796 - 6127 <+35247966127>*Fax* +352 42 88 81*Email* 
> alex.wei...@technolink.luwww.vdl.lu // www.technolink.lu
>
> Centre Technolink
> 2, rue Charles de Tornaco
> L-2623 LUXEMBOURG
>
> indoors.this.blesses
> 
> schaufel.besten.kopie
> 
> supposons.levage.venger
> 
> On 14/03/2020 15:59, Alex Weirig wrote:
>
> Hi,
>
> I'm trying to develop a JAX-RS client on karaf 4.2.8.
>
> I've installed the usual suspects:
>
> feature:install scr webconsole
>
> and I've added the cxf repo
>
> cxf-3.3.5 │
> mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features
>
> and installed following features:
>
> feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client cxf-jackson
>
> and I've installed my bundles. Everything is starting up as expected ...
>
> When I try to create a webclient in my code
>
> Client client = ClientBuilder.newBuilder().hostnameVerifier((s,
> session) -> true)
>.sslContext(sslContext)
>.register(new
> JacksonJsonProvider(objectMapper))
>.connectTimeout(10,
> TimeUnit.MINUTES)
>.build();
>
> I get a CNF 

Re: CNF javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50)

2020-03-14 Thread Freeman Fang
Hi,

This
javax.ws.rs.client.ClientFinder
is suspicious. Could you please use
find-class javax.ws.rs.client.ClientFinder to see which bundle contains
this class?

In CXF, we use Servicemix wrapped jaxrs spec bundle which doesn't use
javax.ws.rs.client.ClientFinder
at all.

My gut is that somehow you use an incorrect version of jaxrs api bundle in
your environment.

Freeman

On Sat, Mar 14, 2020 at 10:59 AM Alex Weirig 
wrote:

> Hi,
>
> I'm trying to develop a JAX-RS client on karaf 4.2.8.
>
> I've installed the usual suspects:
>
> feature:install scr webconsole
>
> and I've added the cxf repo
>
> cxf-3.3.5 │
> mvn:org.apache.cxf.karaf/apache-cxf/RELEASE/xml/features
>
> and installed following features:
>
> feature:install cxf-jaxrs cxf-core cxf-commands cxf-http-client cxf-jackson
>
> and I've installed my bundles. Everything is starting up as expected ...
>
> When I try to create a webclient in my code
>
> Client client = ClientBuilder.newBuilder().hostnameVerifier((s,
> session) -> true)
>.sslContext(sslContext)
>.register(new
> JacksonJsonProvider(objectMapper))
>.connectTimeout(10,
> TimeUnit.MINUTES)
>.build();
>
> I get a CNF exception.
>
> java.lang.RuntimeException: java.lang.ClassNotFoundException
> at
> javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:50) ~[?:?]
> at
> tlk.occupation_postes_electronique.services.login_service.impl.LoginServiceImpl.authenticate(LoginServiceImpl.java:92)
> ~[?:?]
> at
> lu.tlk.occupation_postes_electronique.services.login_service_test.cmd.LoginServiceTestCommands.testLogin(LoginServiceTestCommands.java:22)
> ~[?:?]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[?:1.8.0_212]
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> ~[?:1.8.0_212]
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> ~[?:1.8.0_212]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
> at
> org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:143) ~[?:?]
> at
> org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
> ~[?:?]
> at
> org.apache.karaf.shell.impl.console.osgi.CommandTracker$1.execute(CommandTracker.java:112)
> ~[?:?]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
> ~[?:?]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
> ~[?:?]
> at
> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
> at
> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
> ~[?:?]
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
> ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> ~[?:1.8.0_212]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> ~[?:1.8.0_212]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> ~[?:1.8.0_212]
> at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
> Caused by: java.lang.ClassNotFoundException
> at
> javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:120) ~[?:?]
> at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96)
> ~[?:?]
> at
> javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]
> ... 21 more
> Caused by: java.lang.InstantiationException
> at
> sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
> ~[?:1.8.0_212]
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> ~[?:1.8.0_212]
> at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_212]
> at
> javax.ws.rs.client.ClientFinder.newInstance(ClientFinder.java:116) ~[?:?]
> at javax.ws.rs.client.ClientFinder.find(ClientFinder.java:96)
> ~[?:?]
> at
> javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:44) ~[?:?]
> ... 21 more
>
> I'm pretty sure I had something similar running in an older version of
> karaf but I can't figure out what I'm missing today...
>
> Many thanks in advance
> --
>
>
> Mat frëndleche Gréiss,
> Mit freundlichen Grüßen,
> Meilleures salutations,
> Kind regards,Alex WeirigResponsable Technique
> Ville de Luxembourg
> Service Enseignement
> Centre Technolink
> *Tel* +352 4796 - 

Re: Karaf 4.2.8 and Java 13 (Was: Error parsing system bundle export statement (Java 13))

2020-02-24 Thread Freeman Fang
Hi Alex,

Thanks for the detailed feedback.
Would you please create a jira ticket so that we can have better track
there.

Thanks!
Freeman



On Mon, Feb 24, 2020 at 12:02 PM Alex Soto  wrote:

> I tested with JDK 11 and it worked, but it does not work with JDK 13.
> I hope I can migrate to 13 directly, since it it the current version.
>
> With JDK 13, here is the error:
>
>
> $ bin/karaf
> ERROR: Error parsing system bundle export
> statement: 
> org.osgi.dto;version="1.0",org.osgi.resource;version="1.0",org.osgi.resource.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework;version="1.8",org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",
> org.osgi.fr
> amework.hooks.bundle;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",org.osgi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",org.osgi.framework.namespace;version="1.1";uses:="org.osgi.resource",org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",org.osgi.framework.startlevel.dto;version="1.0";uses:="org.osgi.dto",org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi.dto,org.osgi.resource.dto",org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",org.osgi.service.packageadmin;version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",org.osgi.service.startlevel;version="1.1";uses:="org.osgi.framework",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",org.apache.karaf.version;version="4.2.8",org.apache.karaf.jaas.boot.principal;uses:=
> javax.security.au
> th;version="4.2.8",org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.2.8",
> org.apache.karaf.info;version="4.2.8",,org.apache.karaf.branding,
> sun.misc, com.sun.jmx.remote.protocol,
> com.sun.jmx.remote.protocol.jmxmp, 
> org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version=4.2.8,
>  
> org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.8, 
> org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.8, 
> org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.8
> org.osgi.framework.BundleException: Exported package names cannot be zero
> length.
>
> at 
> org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:876)
> at
> org.apache.felix.framework.util.manifestparser.ManifestParser.(ManifestParser.java:215)
> at
> org.apache.felix.framework.ExtensionManager.(ExtensionManager.java:261)
> at org.apache.felix.framework.Felix.(Felix.java:429)
> at
> org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
> at org.apache.karaf.main.Main.launch(Main.java:256)
> at org.apache.karaf.main.Main.main(Main.java:178)
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> org.apache.felix.framework.URLHandlers 
> (file:/Users/asoto/Downloads/apache-karaf-4.2.8/system/org/apache/felix/org.apache.felix.framework/5.6.12/org.apache.felix.framework-5.6.12.jar)
> to constructor sun.net.www.protocol.file.Handler()
> WARNING: Please consider reporting this to the maintainers of
> org.apache.felix.framework.URLHandlers
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
>
> Best regards,
> Alex soto
>
>
>
>
> On Feb 21, 2020, at 2:10 PM, Jean-Baptiste Onofré  wrote:
>
> Let me check this out. I?m surprised.
>
> Regards
> JB
>
> Le ven. 21 f?vr. 2020 ? 19:29, Alex Soto  a ?crit :
>
>> It may be more than one problem,  JB, downloading a clean Karaf binary
>> and running it on  Java 13 does not work out of the box.
>> Validating my application *features.xml*  does not work either,
>>  karaf-maven-plugin fails to validate it for Java 13.
>>
>> Best regards,
>> Alex soto
>>
>>
>>
>>
>> On Feb 21, 2020, at 12:55 PM, Jean-Baptiste Onofr? 
>> wrote:
>>
>> On Jenkins we build and test using java 11. Let me fix for java 13.
>>
>> Regards
>> JB
>>
>> Le ven. 21 f?vr. 2020 ? 17:02, Alex Soto  a
>> ?crit :
>>
>> I just confirmed a clean Karaf binary distribution downloaded from Karaf
>> site, will not start with Java 13.
>>
>>
>> Best regards,
>> Alex soto
>>
>>
>>
>>
>> On Feb 21, 2020, at 9:04 AM, Alex Soto  wrote:
>>
>> Inspecting 

Re: javax.xml.bind.annotation issue with Karaf-4.2.5 with Java-8

2019-05-29 Thread Freeman Fang
Hi Erwin,

Actually you can always specify jaxb version like
javax.xml.bind*;version=“[2,3)”,
in your bundle pom.xml maven-bundle-plugin configuration, to make it work both 
with jaxb2.2 and 2.3

Cheers

-
Freeman(Yue) Fang

Red Hat, Inc. 





> On May 29, 2019, at 9:42 PM, Erwin Hogeweg  wrote:
> 
> Hi Stephan, Christian -
> 
> Thanks for your replies.
> 
> My issue was that the same set of bundles compile and run just fine with 
> Karaf 4.2.0, but when I compile with ref. to Karaf-4.2.5 I get this jaxb 
> 2.3.0 dependency error. 
> 
> It appears that the jaxb 2.3.0 dependency is pulled in during compilation 
> from the org.apache.karaf.jaas.modules bundle as jakarta.xml.bind-api. The 
> 4.2.0 version of the jaas module did not have that dependency.
> 
> When I compile the bundles with ref to karaf-4.2.0 and only specify 4.2.5 in 
> feature and distro all is well. So that problem appears to be solved.
> 
> Erwin
> 
> 
>> On May 28, 2019, at 03:18, Siano, Stephan > > wrote:
>> 
>> Hi Erwin,
>>  
>> the problem is that Java 8 does not contain JAXB 2.3.0 (but 2.2.8). So there 
>> are actually two things to consider:
>> Does your application really need JAXB 2.3.0. If it does it might be 
>> challenging to run that on Java 8 (as you will also need a JAXB 
>> implementation that implements the newer JAXB version and you might have all 
>> kinds of interferences between the JAXB version in the JDK and the JAXB 
>> version provided by you.
>> If your application also works with JAXB 2.2.8, you might simply change your 
>> application’s bundle manifest to wire with JAXB 2.2. You write you compile 
>> your application with karaf-4.2.4. What does that mean? If you build with 
>> Maven and added some Karaf artifact as a dependency you might get all kinds 
>> of transitive dependencies into your stack that are not there when you 
>> deploy it (the JAXB 2.3.0 API bundle will be part of Karaf, but only if you 
>> run on Java 11 (that does not contain JAXB)). You’d probably better remove 
>> that karaf artifact dependency and only add the dependencies you really need 
>> (and in version that you will have in the end).
>>  
>> Best regards
>> Stephan
>>  
>> From: Erwin Hogeweg mailto:erwin.hoge...@me.com>> 
>> Sent: Dienstag, 28. Mai 2019 00:49
>> To: user@karaf.apache.org 
>> Subject: javax.xml.bind.annotation issue with Karaf-4.2.5 with Java-8
>>  
>> All -
>>  
>> I am pretty sure I have seen a discussion here re. Karaf, 
>> javax.xml.bind.annotation and Java 8. I can’t find the thread anymore though.
>>  
>> The issue I am running into is this:
>>  
>> missing requirement 
>> [com.my.service/1.2.1.SNAPSHOT_20190527-1640] osgi.wiring.package; 
>> filter:="(&(osgi.wiring.package=javax.xml.bind.annotation)(version>=2.3.0)(!(version>=3.0.0)))”]]
>>  
>> Obviously that is because the jre-1.8 section in jre.properties specifies 
>> 2.2.8.
>>  
>> If I change that section to:
>>  
>> javax.xml.bind;version="2.3.0", \
>> javax.xml.bind.annotation;version="2.3.0", \
>> javax.xml.bind.annotation.adapters;version="2.3.0", \
>> javax.xml.bind.attachment;version="2.3.0", \
>> javax.xml.bind.helpers;version="2.3.0", \
>> javax.xml.bind.util;version="2.3.0", \
>>  
>> Everything is fine again. I assume I can also find a 2.3.0 api bundle and 
>> include that in my distro. Haven’t tried that yet.
>>  
>> Couple of questions remain…
>>  
>> 1. Where does that 2.3.0 dependency come from when I compile against 
>> Karaf-4.2.5? 
>> 2. Is this the right approach, if not, what is the recommended way? 
>>  
>>  
>> Thanks as always,
>>  
>> Erwin
> 



Re: Exception starting HttpContext registration java.lang.NullPointerException: null

2019-05-17 Thread Freeman Fang
Hi,

Please use JDK11 if you could to see if there’s any difference, JDK9 isn’t a 
LTS version.

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On May 15, 2019, at 9:50 AM, Krenn Daniel  wrote:
> 
> Hi Jean-Baptiste,
> 
> Apache Camel Version: 3.0.0-M1
> Apache Karaf Version: 4.2.4
> Java Version Normal:  build 1.8.0_181-b13 (I hope that helps)
> Java Version Docker:  OpenJDK 9
> 
> I tried this with a normal karaf installation and an installation on docker, 
> both display the same behaviour.
> 
> Regards,
> Daniel
> Daniel Krenn
> Consultant MES
> 
> mailto:daniel.kr...@team-con.de  | Tel. +49 (9931) 981 365  
> 
> ​
>  ​T.CON GmbH & Co. KG 
>  ​Hauptsitz
>  Straubinger Straße 2
>  94447 Plattling 
>  T: +49 (0)9931 981 100 
>  F: +49 (0)9931 981 199 
>  www.mescat.de  >
>  www.team-con.de  >
>  
>  Messetermine 
> 
>  >
>  facebook    |  twitter   
> |  xing 
>   |  linkedin   
> |   
> youtube 
>  | 
>  instagram 
> 
>  
>  
> Geschäftsführer: Karl Fuchs, Michael Gulde, Stefan Fiedler
> ​KG, AG Deggendorf HRA 1618 Pers. haftender Ges.
> T.CON Beteiligungs-GmbH AG
> Deggendorf HRB 2053
> Besuchen Sie uns auf folgenden Events:
>  
> 
>   
>  
> 
> Erhalten Sie wichtige Informationen von T.CON. Jetzt anmelden. 
> 
> -Ursprüngliche Nachricht-
> Von: Jean-Baptiste Onofré  
> Gesendet: Mittwoch, 15. Mai 2019 07:16
> An: user@karaf.apache.org
> Betreff: Re: Exception starting HttpContext registration 
> java.lang.NullPointerException: null
> 
> Hi Daniel,
> 
> can you provide some details about the Karaf, Camel version ?
> 
> I guess you are running with JDK 11 no ?
> 
> Regards
> JB
> 
> On 14/05/2019 16:41, Krenn Daniel wrote:
> > Hello,
> > 
> >  
> > 
> > I’m trying to get Swagger UI running on karaf. I packaged the Swagger 
> > UI in a WAR file, which I drop into the deploy folder in the karaf 
> > directory.
> > 
> > The problem is that I apparantly cannot run camel-swagger-java and the 
> > Swagger UI WAR at the same time.
> > 
> > If I don’t install camel-swagger-java, I can successfully deploy the 
> > Swagger UI WAR, but this is obviously useless as no swagger instance 
> > is running.
> > 
> > If I install camel-swagger-java before deploying the Swagger UI WAR, I 
> > get this error:
> > 
> >  
> > 
> > Exception starting HttpContext registration
> > java.lang.NullPointerException: null
> > 
> > Error deploying web applicationjava.lang.NullPointerException: null
> > 
> >  
> > 
> > I don’t know what to do with this error. Also, whenever I try to 
> > deploy the Swagger UI WAR when I already have camel-swagger-java 
> > installed, I get this error:
> > 
> >  
> > 
> > java.lang.ArrayIndexOutOfBoundsException: 19
> > 
> > at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:576)
> > 
> > at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:494)
> > 
> > at 
> > aQute.bnd.osgi.Clazz.parseClassFileWithCollector(Clazz.java:483)
> > 
> > at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:473)
> > 
> > at aQute.bnd.osgi.Analyzer.analyzeJar(Analyzer.java:2177)
> > 
> > at
> > aQute.bnd.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:2114)
> > 
> > at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:138)
> > 
> > at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:616)
> > 
> > at
> > org.ops4j.pax.swissbox.bnd.BndUtils.createBundle(BndUtils.java:161)
> > 
> > at
> > org.ops4j.pax.url.war.internal.AbstractConnection.createBundle(Abstrac
> > tConnection.java:174)
> > 
> > at
> > org.ops4j.pax.url.war.internal.WebBundleConnection.createBundle(WebBun
> > dleConnection.java:108)
> > 
> > at
> > org.ops4j.pax.url.war.internal.AbstractConnection.getInputStream(Abstr
> > actConnection.java:143)
> > 
> > at
> > org.ops4j.pax.url.war.internal.WarConnection.getInputStream(WarConnect
> > ion.java:33)
> > 
> > at java.net.URL.openStream(URL.java:1045)
> > 
> > at
> > org.apache.felix.fileinstall.internal.DirectoryWatcher.install(Directo
> > ryWatcher.java:962)
> > 
> > at
> > org.apache.felix.fileinstall.internal.DirectoryWatcher.install(Directo
> > ryWatcher.java:884)
> > 
> > at
> > org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(Direc
> > toryWatcher.java:489)
> > 

Re: karaf 4.2.2 with OpenJDK 11 on windows

2019-03-05 Thread Freeman Fang
Hi Doug,

Karaf 4.2.3 fixed several jdk11 related issues and we strongly recommend you to 
switch to Karaf 4.2.3 if you want to use JDK11.

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Mar 6, 2019, at 7:46 AM, Jackson, Douglas  
> wrote:
> 
> Hi!
> The OOTB karaf 4.2.2 does not start up when used with OpenJDK 11 – it seems 
> to lock up on startup.  I replaced the karaf.bat file with the karaf 4.2.3 
> karaf.bat file.
> After that the karaf 4.2.2 at least starts up, but I get exceptions.
> 4.2.3 seems to fix these, but switching to that release would set my product 
> release back several months.
> Can anyone tell me if there is a small fix that might enable me to get around 
> these issues on 4.2.2?
> Thanks in advance,
> Doug
>  
> java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator
>at 
> org.apache.karaf.specs.activator.Activator.register(Activator.java:124) ~[?:?]
>at 
> org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:96) 
> ~[?:?]
>  
> If I add in “war” in the boot features, then I see the following:
>  
> karaf@root()> org.apache.karaf.features.internal.util.MultiException: Error 
> restarting bundles:
> Activator start error in bundle org.ops4j.pax.web.pax-web-jetty [136].
> at 
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1005)
>
> at java.base/java.lang.Thread.run(Thread.java:825)
> Suppressed: org.osgi.framework.BundleException: Activator start error 
> in bundle org.ops4j.pax.web.pax-web-jetty [136].
>
> Caused by: java.lang.ClassFormatError: Weaving hook failed.
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.transformClass(BundleWiringImpl.java:24
>   
> Caused by: java.lang.IllegalStateException: Unknown protocol: jrt
>  
> openjdk version "11.0.2" 2019-01-15
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.2+9)
> Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.12.1, JRE 11 Windows 10 
> amd64-64-Bit Compressed References 20190204_123 (JIT enabled, AOT enabled)
> OpenJ9   - 90dd8cb40
> OMR  - d2f4534b
> JCL  - 289c70b684 based on jdk-11.0.2+9)



Re: Any plans for supporting JDK 11 ?

2019-01-24 Thread Freeman Fang
Hi,

Yeah, we should update our website to mention JDK11 is supported for Karaf 
4.2.x.

I’ll do it.

Thanks for pointing out this.
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Jan 25, 2019, at 7:40 AM, Kevin Schmidt  wrote:
> 
> Resurrecting an old thread to get the latest status.
> 
> There have been some recent questions regarding using JDK 11 and it appears 
> some have been successful and some testing has been done, and a number of 
> tickets regarding support resolved in 4.2.1 or 4.2.2, yet the information on 
> the download page (https://karaf.apache.org/download.html 
> <https://karaf.apache.org/download.html>) still says just Java 8/9/10 for 
> 4.2.x.  It this page inaccurate?  Or is there still more work to be done to 
> support JDK 11?  If more work to be done, what is the target release?
> 
> On Fri, Jun 8, 2018 at 4:44 AM Francois Papon  <mailto:francois.pa...@openobject.fr>> wrote:
> Hi Serge,
> 
> This is a great news, thanks for using Apache Karaf :)
> 
> 
> François Papon
> fpa...@apache.org <mailto:fpa...@apache.org>
> Open3m - https://www.open3m.io <https://www.open3m.io/>
> Le 08/06/2018 à 13:07, Serge Huber a écrit :
>> Thanks a lot for all this information. I had some questions about JDK 11 
>> support and you've given lots of details that I will be able to relay 
>> internally.
>> 
>> And of course thanks a lot for all the hard work, I wish I could contribute 
>> more :) 
>> 
>> cheers,
>>   Serge... 
>> 
>> ps : for those of us who don't know we now use Apache Karaf in all our 
>> server products and love it !
>> 
>> Serge Huber
>> CTO & Co-Founder
>> 
>> T +41 22 361 3424
>> 9 route des Jeunes | 1227 Acacias | Switzerland
>> jahia.com <http://www.jahia.com/>
>> SKYPE <> | LINKEDIN <https://www.linkedin.com/in/sergehuber> | TWITTER 
>> <https://twitter.com/sergehuber> | VCARD 
>> <http://www.jahia.com/vcard/HuberSerge.vcf>   
>> 
>> > JOIN OUR COMMUNITY <http://www.jahia.com/> to evaluate, get trained and to 
>> > discover why Jahia is a leading User Experience Platform (UXP) for Digital 
>> > Transformation.
>> 
>> On Fri, Jun 8, 2018 at 12:48 AM, Freeman Fang > <mailto:freeman.f...@gmail.com>> wrote:
>> Please see the patch and my comment on KARAF-5764, I think we need more 
>> change to support java11 in KARAF.
>> 
>> As XBean also embed asm source, so we need a new XBean release which build 
>> against ASM6.2, as well as a new easymock release.
>> 
>> Besides, Since JDK11, those modules get removed from JDK
>> * java.corba — CORBA
>>  * java.transaction — The subset of the Java Transaction API defined by Java 
>> SE to support CORBA Object Transaction Services
>>  * java.activation — JavaBeans Activation Framework
>>  * java.xml.bind — Java Architecture for XML Binding (JAXB)
>>  * java.xml.ws <http://java.xml.ws/> — Java API for XML Web Services 
>> (JAX-WS), Web Services Metadata for the Java Platform, and SOAP with 
>> Attachments for Java (SAAJ)
>>  * java.xml.ws.annotation — The subset of the JSR-250 Common Annotations 
>> defined by Java SE to support web services
>> 
>> So I think we don't need to use --patch-module for those APIs which already 
>> get removed. What we do is just use normal bundle for those APIs, or if we 
>> really need those API in boot stage we can put those in $KARAF_HOME/lib/boot 
>> folder, so far we need jaxb and activation in lib/boot/folder as 
>> features.core need those.
>> 
>> [1]https://issues.apache.org/jira/browse/KARAF-5764 
>> <https://issues.apache.org/jira/browse/KARAF-5764>
>> 
>> Cheers
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> FuseSource is now part of Red Hat
>> 
>> 
>> 
>>> On Jun 8, 2018, at 1:37 AM, Jean-Baptiste Onofré >> <mailto:j...@nanthrax.net>> wrote:
>>> 
>>> Hi Serge,
>>> 
>>> I just submitted Aries Proxy Impl 1.1.2 with ASM 6.2 this morning,
>>> bringing support of Java 9, 10, 11.
>>> 
>>> As soon as the vote passed, I will update in Karaf. The purpose is to
>>> include this for Karaf 4.2.1 (planned next week), in order to give us
>>> time to test.
>>> Before 4.2.1, I have also to work on Pax Web (7.1.1) supporting Jetty
>>> 9.4.10 supporting new Java version as well.
>>> 
>>> So, to summarize, 4.2.1 should support Java 10 & 11, thanks to the ASM
>>> 6.2 update + Aries Proxy + Pax Web/Jetty update (all Jira are created
>>> and in my bucket).
>>> 
>>> Regards
>>> JB
>>> 
>>> On 07/06/2018 17:35, Serge Huber wrote:
>>>> Hello,
>>>> 
>>>> With the upcoming release of JDK 11 (planned for September), I was
>>>> wondering what the plans for supporting it looked like ? Are we
>>>> expecting any kind of blocking problems ? Should be simpler than JDK 9 I
>>>> think. 
>>>> 
>>>> I didn't follow the JDK 10 support, did that involve any problems ?
>>>> 
>>>> cheers,
>>>>   Serge... 
>>> 
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbono...@apache.org <mailto:jbono...@apache.org>
>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>> Talend - http://www.talend.com <http://www.talend.com/>
>> 
>> 
> 



Re: Problems with SAXParserFactory in Karaf 4.2.1

2019-01-09 Thread Freeman Fang
Hi Richard,

Would you please test Karaf 4.2.2,  I believe this issue has already get fixed.

If not, please append a reproducer testcase so that we can reproduce and 
investigate it.

Thanks!
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Jan 9, 2019, at 7:33 PM, Richard Hierlmeier  
> wrote:
> 
> Hi JB,
> 
> Is the problem related to the problem that is described in 
> http://karaf.922171.n3.nabble.com/Karaf-4-2-1-problem-with-xerces-bundle-td4054497.html
>  
> ?
> 
> Richard
> 
> Am Di., 8. Jan. 2019 um 16:51 Uhr schrieb Richard Hierlmeier 
> mailto:rhierlme...@googlemail.com>>:
> Java 8
> 
> Am Di., 8. Jan. 2019 um 15:33 Uhr schrieb Jean-Baptiste Onofré 
> mailto:j...@nanthrax.net>>:
> Hi,
> 
> are you using Java 8 or 10/11 ?
> 
> Regards
> JB
> 
> On 08/01/2019 15:31, Richard Hierlmeier wrote:
> > 
> > I am  currently migrating an application from Karaf 3.0.8 to Karaf 4.2.1.
> > I have problems with a bundle, it can not instantiate a JAXB context object.
> > It throws the following exception:
> > 
> > java.lang.RuntimeException: Provider for class
> > javax.xml.parsers.SAXParserFactory cannot be created
> > at
> > javax.xml.parsers.$FactoryFinder.findServiceProvider($FactoryFinder.java:212)
> > at javax.xml.parsers.$FactoryFinder.find($FactoryFinder.java:180)
> > at javax.xml.parsers.$FactoryFinder.find($FactoryFinder.java:122)
> > at
> > javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:43)
> > at
> > com.sun.xml.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:123)
> > at
> > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:154)
> > at
> > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
> > at
> > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
> > ...
> > at java.lang.Thread.run(Thread.java:745)
> > Caused by: java.util.ServiceConfigurationError:
> > javax.xml.parsers.SAXParserFactory: Provider
> > org.apache.xerces.jaxp.SAXParserFactoryImpl not found
> > at java.util.ServiceLoader.fail(ServiceLoader.java:239)
> > at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
> > at
> > java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
> > at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
> > at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
> > at
> > javax.xml.parsers.$FactoryFinder.lambda$findServiceProvider$3($FactoryFinder.java:206)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at
> > javax.xml.parsers.$FactoryFinder.findServiceProvider($FactoryFinder.java:197)
> > ... 71 more
> > 
> > Caused by:
> > java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory:
> > Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
> > at java.util.ServiceLoader.fail(ServiceLoader.java:239)
> > at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
> > at
> > java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
> > at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
> > at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
> > at
> > javax.xml.parsers.$FactoryFinder.lambda$findServiceProvider$3($FactoryFinder.java:206)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at
> > javax.xml.parsers.$FactoryFinder.findServiceProvider($FactoryFinder.java:197)
> > at javax.xml.parsers.$FactoryFinder.find($FactoryFinder.java:180)
> > at javax.xml.parsers.$FactoryFinder.find($FactoryFinder.java:122)
> > at
> > javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:43)
> > at
> > com.sun.xml.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:123)
> > at
> > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:154)
> > at
> > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
> > at
> > javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
> > 
> > 
> > The class org.apache.xerces.jaxp.SAXParserFactoryImpl comes from bundle
> > 
> > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/2.12.0_1
> > 
> > it is provided by the wss4j from the cxf-3.2.7 feature.
> > 
> > When I add an import to org.apache.xerces.jaxp to the bundle then JAXB
> > is working. But this cannot be the solution because it binds my bundle
> > onto this implementation.
> > 
> > How can I solve this problem?
> > 
> > Richard
> > 
> > 
> > 
> > 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org 
> http://blog.nanthrax.net 
> Talend - http://www.talend.com 



Re: Update

2018-12-26 Thread Freeman Fang
Hi Scott,

Thanks for the update!

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 27, 2018, at 7:06 AM, Leschke, Scott  wrote:
> 
> For what it’s worth, a few weeks ago I reported that I was seeing the Karaf 
> console hang with version 4.2.1 under Windows.  I far as I can tell, this 
> issue appears to be resolved with the 4.2.3_SNAPSHOT release that contains 
> the recent karaf.bat change.
>  
> Regards,
>  
> Scott



Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-26 Thread Freeman Fang
Hi,

Please use PAX-EXAM 4.13.1, which will address this issue.

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 27, 2018, at 2:42 AM, Kerry  wrote:
> 
> Thanks Freeman. I've ended up using
> 
> new VMOption("-p"), new VMOption("/usr/lib/jvm/jfx1.11.0/lib"),
> new VMOption("--add-modules"), new 
> VMOption("javafx.base,javafx.controls,javafx.fxml,javafx.graphics")
> 
> Which seems to do the trick but I've got a Karaf start up issue now to solve:
> 
> Cannot access RandomAccessFile java.io.FileNotFoundException: /karaf.log 
> (Permission denied) java.io.FileNotFoundException: /karaf.log (Permission 
> denied)
> 
> Looks like it's looking in the root directory for the log file so something 
> must be different about the configuration and need to work out what has 
> changed (I've previously had the tests working under earlier versions of 
> Karaf and Java)
> 
> 
> Kerry
> On 23/12/2018 23:21, Freeman Fang wrote:
>> 
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> 
>> 
>> 
>> 
>> 
>>> On Dec 24, 2018, at 4:38 AM, Kerry >> <mailto:karaf-u...@avionicengineers.com>> wrote:
>>> 
>>> Hi,
>>> 
>>> I'm trying to to get my project FlexFx to work on Java 11 with OpenJFX 11 
>>> inside Karaf 4.2.2 and have so far managed to get it to work by manually 
>>> deploying the OpenJFX jars to the `jdk9plus` folder of Karaf.
>>> 
>>> I am now trying to update the integration tests which use Pax Exam and 
>>> because JavaFX is no longer part of the JDK-11 I need to include these in 
>>> the Karaf configuration. To begin with I tried this:
>>> 
>>> bootClasspathLibraries(
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_BASE_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_CONTROLS_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
>>> new 
>>> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_FXML_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)))
>>> 
>>> but this only put the artifacts into the lib folder not `lib/jdk9plus`
>> 
>> Then I think you can add 
>> 
>> new VMOption("-classpath"),
>> new VMOption(“lib/whatever_yourlib_is")
>> 
>>> 
>>> Also (and this is where I am still new and confused with the Java9 + module 
>>> system) the above artifacts are not the actual ones I used when I manually 
>>> installed OpenJFX to Karaf. I manually installed the SDK from gluon 
>>> (https://gluonhq.com/products/javafx/ 
>>> <https://gluonhq.com/products/javafx/>) and this zip file includes native 
>>> libraries as well as JARs. These are what I think I should be installing 
>>> automatically but I'm uncertain how I can go about this with PaxExam.
>>> 
>>> Does anyone have any suggestions?
>>> 
>>> Thanks, Kerry.
>>> 
>>> 
>> 



Re: Karaf 4.2.2 with jdk 11

2018-12-26 Thread Freeman Fang
Yup, that’s what exactly I did to address it.

Cheers
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 26, 2018, at 3:13 PM, j...@nanthrax.net wrote:
> 
> Thanks Freeman.
> 
> I didn't check your fix yet, but what I did is o move the Java version check 
> earlier in the script to set the classpath.
> 
> Regards
> JB
> 
> 
> On Wednesday, December 26, 2018 08:08 CET, Freeman Fang 
>  wrote:
>  
>> 
>>  
> tracked and fixed by
>  
> https://issues.apache.org/jira/browse/KARAF-6062 
> <https://issues.apache.org/jira/browse/KARAF-6062>
> -
> Freeman(Yue) Fang
> 
> Red Hat, Inc. 
>  
>  
> 
>  
>  
>> On Dec 24, 2018, at 2:20 PM, Jean-Baptiste Onofré  wrote:
>>  
>> Yes, it's what I thought too. I fixed karaf unix shell and instances.
>> 
>> I did a test using karaf.bat on a VM, probably forgot to cherry-pick the
>> change.
>> 
>> Regards
>> JB
>> 
>> On 24/12/2018 00:15, Freeman Fang wrote:
>>> 
>>> Jaxb module was removed since JDK11 and we need those jaxb jars from
>>> jdk9plus folder.
>>> 
>>> Seems on windows those jars are not on CLASSPATH, should be something
>>> wrong in karaf.bat script. I will take a close look.
>>> -
>>> Freeman(Yue) Fang
>>> 
>>> Red Hat, Inc. 
>>> 
>>> 
>>> 
>>> 
>>>  
>>>> 
>>>> On Dec 23, 2018, at 12:44 PM, Jean-Baptiste Onofré >>> <mailto:j...@nanthrax.net>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I'm suspecting something Windows specific as I tested Karaf 4.2.2 with
>>>> JDK 11 on Linux.
>>>> 
>>>> I remember Freeman did some changes around modules (especially JAXB).
>>>> 
>>>> Regards
>>>> JB
>>>> 
>>>> On 23/12/2018 04:17, Leschke, Scott wrote:
>>>>> 
>>>>> I just tried this again but tried putting the JAXB jars from
>>>>> lib/jdk9plus into lib/ext.  This gets rid of the NoClassDefFoundError so
>>>>> that would seem to indicate that the jar files in lib/jdk9plus are not
>>>>> getting seen as would seem to be their purpose. The entire log file
>>>>> consists of the following 4 entries:
>>>>> 
>>>>>  
>>>>> 
>>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>>>>> 
>>>>> INFO: Trying to lock C:\karaf\apache-karaf-4.2.2\lock
>>>>> 
>>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>>>>> 
>>>>> INFO: Lock acquired
>>>>> 
>>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.Main$KarafLockCallback
>>>>> lockAcquired
>>>>> 
>>>>> INFO: Lock acquired. Setting startlevel to 100
>>>>> 
>>>>> 2018-12-22T20:52:26,571 | INFO  | CM Configuration Updater
>>>>> (ManagedService Update: pid=[org.apache.karaf.features.repos]) |
>>>>> configadmin  | 9 - org.apache.felix.configadmin -
>>>>> 1.9.10 | Service for PID org.apache.karaf.features.repos seems to
>>>>> already have been unregistered, not updating with configuration
>>>>> 
>>>>>  
>>>>> 
>>>>> 4.2.1 mostly worked using JDK 11, apart from the fact that the process
>>>>> would appear to freeze occasionally while using the console. Since I’m
>>>>> running Karaf in the console in this case as well, maybe that’s the
>>>>> underlying cause.
>>>>> 
>>>>>  
>>>>> 
>>>>> The jstack –l of the process is as follows:
>>>>> 
>>>>>  
>>>>> 
>>>>> 2018-12-21 12:00:42
>>>>> 
>>>>> Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS mixed
>>>>> mode):
>>>>> 
>>>>>  
>>>>> 
>>>>> Threads class SMR info:
>>>>> 
>>>>> _java_thread_list=0x027e5c5c7410, length=33, elements={
>>>>> 
>>>>> 0x027e3d9d1000, 0x027e59f2c800, 0x027e59f35800,
>>>>> 0x027e59f86000,
>>>>> 
>>>>> 0x027e59f89000, 0x027e59f8a800, 0x027e59f96800,
>>>>> 0x027e5a8e5000,
>>>>> 
>>>>> 0x02

Re: Karaf 4.2.2 with jdk 11

2018-12-25 Thread Freeman Fang
tracked and fixed by

https://issues.apache.org/jira/browse/KARAF-6062
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 24, 2018, at 2:20 PM, Jean-Baptiste Onofré  wrote:
> 
> Yes, it's what I thought too. I fixed karaf unix shell and instances.
> 
> I did a test using karaf.bat on a VM, probably forgot to cherry-pick the
> change.
> 
> Regards
> JB
> 
> On 24/12/2018 00:15, Freeman Fang wrote:
>> Jaxb module was removed since JDK11 and we need those jaxb jars from
>> jdk9plus folder.
>> 
>> Seems on windows those jars are not on CLASSPATH, should be something
>> wrong in karaf.bat script. I will take a close look.
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> 
>> 
>> 
>> 
>> 
>>> On Dec 23, 2018, at 12:44 PM, Jean-Baptiste Onofré >> <mailto:j...@nanthrax.net>> wrote:
>>> 
>>> Hi,
>>> 
>>> I'm suspecting something Windows specific as I tested Karaf 4.2.2 with
>>> JDK 11 on Linux.
>>> 
>>> I remember Freeman did some changes around modules (especially JAXB).
>>> 
>>> Regards
>>> JB
>>> 
>>> On 23/12/2018 04:17, Leschke, Scott wrote:
>>>> I just tried this again but tried putting the JAXB jars from
>>>> lib/jdk9plus into lib/ext.  This gets rid of the NoClassDefFoundError so
>>>> that would seem to indicate that the jar files in lib/jdk9plus are not
>>>> getting seen as would seem to be their purpose. The entire log file
>>>> consists of the following 4 entries:
>>>> 
>>>>  
>>>> 
>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>>>> 
>>>> INFO: Trying to lock C:\karaf\apache-karaf-4.2.2\lock
>>>> 
>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>>>> 
>>>> INFO: Lock acquired
>>>> 
>>>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.Main$KarafLockCallback
>>>> lockAcquired
>>>> 
>>>> INFO: Lock acquired. Setting startlevel to 100
>>>> 
>>>> 2018-12-22T20:52:26,571 | INFO  | CM Configuration Updater
>>>> (ManagedService Update: pid=[org.apache.karaf.features.repos]) |
>>>> configadmin  | 9 - org.apache.felix.configadmin -
>>>> 1.9.10 | Service for PID org.apache.karaf.features.repos seems to
>>>> already have been unregistered, not updating with configuration
>>>> 
>>>>  
>>>> 
>>>> 4.2.1 mostly worked using JDK 11, apart from the fact that the process
>>>> would appear to freeze occasionally while using the console. Since I’m
>>>> running Karaf in the console in this case as well, maybe that’s the
>>>> underlying cause.
>>>> 
>>>>  
>>>> 
>>>> The jstack –l of the process is as follows:
>>>> 
>>>>  
>>>> 
>>>> 2018-12-21 12:00:42
>>>> 
>>>> Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS mixed
>>>> mode):
>>>> 
>>>>  
>>>> 
>>>> Threads class SMR info:
>>>> 
>>>> _java_thread_list=0x027e5c5c7410, length=33, elements={
>>>> 
>>>> 0x027e3d9d1000, 0x027e59f2c800, 0x027e59f35800,
>>>> 0x027e59f86000,
>>>> 
>>>> 0x027e59f89000, 0x027e59f8a800, 0x027e59f96800,
>>>> 0x027e5a8e5000,
>>>> 
>>>> 0x027e5a92c000, 0x027e5aabf000, 0x027e5ae28800,
>>>> 0x027e5aef4000,
>>>> 
>>>> 0x027e5b094000, 0x027e5b094800, 0x027e5b0bd000,
>>>> 0x027e5b23d800,
>>>> 
>>>> 0x027e5b23e800, 0x027e5b241800, 0x027e5b243800,
>>>> 0x027e5b241000,
>>>> 
>>>> 0x027e5b244000, 0x027e5b242800, 0x027e5b23f000,
>>>> 0x027e5b24,
>>>> 
>>>> 0x027e5b301000, 0x027e5b2fb800, 0x027e5b2fd800,
>>>> 0x027e5b30,
>>>> 
>>>> 0x027e5b302000, 0x027e5b2fe800, 0x027e5b2fd000,
>>>> 0x027e5b2fc000,
>>>> 
>>>> 0x027e5b2ff800
>>>> 
>>>> }
>>>> 
>>>>  
>>>> 
>>>> "main" #1 prio=5 os_prio=0 cpu=1187.50ms elapsed=182.90s
>>>> tid=0x0

Re: Karaf 4.2.2, Java 11, OpenJFX 11 and PaxExam

2018-12-23 Thread Freeman Fang

-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 24, 2018, at 4:38 AM, Kerry  wrote:
> 
> Hi,
> 
> I'm trying to to get my project FlexFx to work on Java 11 with OpenJFX 11 
> inside Karaf 4.2.2 and have so far managed to get it to work by manually 
> deploying the OpenJFX jars to the `jdk9plus` folder of Karaf.
> 
> I am now trying to update the integration tests which use Pax Exam and 
> because JavaFX is no longer part of the JDK-11 I need to include these in the 
> Karaf configuration. To begin with I tried this:
> 
> bootClasspathLibraries(
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_BASE_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_CONTROLS_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)),
> new 
> BootClasspathLibraryOption(mavenBundle().artifactId(OPENJFX_FXML_ARTIFACT_ID).groupId(OPENJFX_GROUP_ID).version(OPENFX_VERSION)))
> 
> but this only put the artifacts into the lib folder not `lib/jdk9plus`

Then I think you can add 

new VMOption("-classpath"),
new VMOption(“lib/whatever_yourlib_is")

> 
> Also (and this is where I am still new and confused with the Java9 + module 
> system) the above artifacts are not the actual ones I used when I manually 
> installed OpenJFX to Karaf. I manually installed the SDK from gluon 
> (https://gluonhq.com/products/javafx/) and this zip file includes native 
> libraries as well as JARs. These are what I think I should be installing 
> automatically but I'm uncertain how I can go about this with PaxExam.
> 
> Does anyone have any suggestions?
> 
> Thanks, Kerry.
> 
> 



Re: Karaf 4.2.2 with jdk 11

2018-12-23 Thread Freeman Fang
Jaxb module was removed since JDK11 and we need those jaxb jars from jdk9plus 
folder.

Seems on windows those jars are not on CLASSPATH, should be something wrong in 
karaf.bat script. I will take a close look.
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 23, 2018, at 12:44 PM, Jean-Baptiste Onofré  wrote:
> 
> Hi,
> 
> I'm suspecting something Windows specific as I tested Karaf 4.2.2 with
> JDK 11 on Linux.
> 
> I remember Freeman did some changes around modules (especially JAXB).
> 
> Regards
> JB
> 
> On 23/12/2018 04:17, Leschke, Scott wrote:
>> I just tried this again but tried putting the JAXB jars from
>> lib/jdk9plus into lib/ext.  This gets rid of the NoClassDefFoundError so
>> that would seem to indicate that the jar files in lib/jdk9plus are not
>> getting seen as would seem to be their purpose. The entire log file
>> consists of the following 4 entries:
>> 
>>  
>> 
>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>> 
>> INFO: Trying to lock C:\karaf\apache-karaf-4.2.2\lock
>> 
>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.lock.SimpleFileLock lock
>> 
>> INFO: Lock acquired
>> 
>> Dec 22, 2018 8:52:24 PM org.apache.karaf.main.Main$KarafLockCallback
>> lockAcquired
>> 
>> INFO: Lock acquired. Setting startlevel to 100
>> 
>> 2018-12-22T20:52:26,571 | INFO  | CM Configuration Updater
>> (ManagedService Update: pid=[org.apache.karaf.features.repos]) |
>> configadmin  | 9 - org.apache.felix.configadmin -
>> 1.9.10 | Service for PID org.apache.karaf.features.repos seems to
>> already have been unregistered, not updating with configuration
>> 
>>  
>> 
>> 4.2.1 mostly worked using JDK 11, apart from the fact that the process
>> would appear to freeze occasionally while using the console. Since I’m
>> running Karaf in the console in this case as well, maybe that’s the
>> underlying cause.
>> 
>>  
>> 
>> The jstack –l of the process is as follows:
>> 
>>  
>> 
>> 2018-12-21 12:00:42
>> 
>> Full thread dump Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS mixed
>> mode):
>> 
>>  
>> 
>> Threads class SMR info:
>> 
>> _java_thread_list=0x027e5c5c7410, length=33, elements={
>> 
>> 0x027e3d9d1000, 0x027e59f2c800, 0x027e59f35800,
>> 0x027e59f86000,
>> 
>> 0x027e59f89000, 0x027e59f8a800, 0x027e59f96800,
>> 0x027e5a8e5000,
>> 
>> 0x027e5a92c000, 0x027e5aabf000, 0x027e5ae28800,
>> 0x027e5aef4000,
>> 
>> 0x027e5b094000, 0x027e5b094800, 0x027e5b0bd000,
>> 0x027e5b23d800,
>> 
>> 0x027e5b23e800, 0x027e5b241800, 0x027e5b243800,
>> 0x027e5b241000,
>> 
>> 0x027e5b244000, 0x027e5b242800, 0x027e5b23f000,
>> 0x027e5b24,
>> 
>> 0x027e5b301000, 0x027e5b2fb800, 0x027e5b2fd800,
>> 0x027e5b30,
>> 
>> 0x027e5b302000, 0x027e5b2fe800, 0x027e5b2fd000,
>> 0x027e5b2fc000,
>> 
>> 0x027e5b2ff800
>> 
>> }
>> 
>>  
>> 
>> "main" #1 prio=5 os_prio=0 cpu=1187.50ms elapsed=182.90s
>> tid=0x027e3d9d1000 nid=0x7ec in Object.wait()  [0x009e999ff000]
>> 
>>java.lang.Thread.State: WAITING (on object monitor)
>> 
>>at java.lang.Object.wait(java.base@11.0.1/Native Method)
>> 
>>- waiting on <0xe032fc00> (a
>> org.apache.felix.framework.util.ThreadGate)
>> 
>>at
>> org.apache.felix.framework.util.ThreadGate.await(ThreadGate.java:79)
>> 
>>- waiting to re-lock in wait() <0xe032fc00> (a
>> org.apache.felix.framework.util.ThreadGate)
>> 
>>at
>> org.apache.felix.framework.Felix.waitForStop(Felix.java:1075)
>> 
>>at org.apache.karaf.main.Main.awaitShutdown(Main.java:641)
>> 
>>at org.apache.karaf.main.Main.main(Main.java:188)
>> 
>>  
>> 
>>Locked ownable synchronizers:
>> 
>>- None
>> 
>>  
>> 
>> "Reference Handler" #2 daemon prio=10 os_prio=2 cpu=0.00ms
>> elapsed=182.82s tid=0x027e59f2c800 nid=0xb58 waiting on condition 
>> [0x009e9a0ff000]
>> 
>>java.lang.Thread.State: RUNNABLE
>> 
>>at
>> java.lang.ref.Reference.waitForReferencePendingList(java.base@11.0.1/Native
>> Method)
>> 
>>at
>> java.lang.ref.Reference.processPendingReferences(java.base@11.0.1/Reference.java:241)
>> 
>>at
>> java.lang.ref.Reference$ReferenceHandler.run(java.base@11.0.1/Reference.java:213)
>> 
>>  
>> 
>>Locked ownable synchronizers:
>> 
>>- None
>> 
>>  
>> 
>> "Finalizer" #3 daemon prio=8 os_prio=1 cpu=0.00ms elapsed=182.82s
>> tid=0x027e59f35800 nid=0x11cc in Object.wait()  [0x009e9a1ff000]
>> 
>>java.lang.Thread.State: WAITING (on object monitor)
>> 
>>at java.lang.Object.wait(java.base@11.0.1/Native Method)
>> 
>>- waiting on <0xe01df4d8> (a
>> java.lang.ref.ReferenceQueue$Lock)
>> 
>>at
>> 

Re: Running Karaf 4.2.1 with OpenJDK 11

2018-11-30 Thread Freeman Fang
Hi,

FYI, we have better JDK11 support for the coming Karaf 4.2.2. Could you please 
try with Karaf 4.2.2-SNAPSHOT for now to see if you still have issue?

Thanks!
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Dec 1, 2018, at 2:51 AM, Javier Delgadillo  wrote:
> 
> Hello everyone,
>  
> We’re in the process of switching our custom Karaf application to OpenJDK 
> from Oracle JRE.  We’ve successfully ported it to OpenJDK 8, but I’m having 
> troubles getting it to run using OpenJDK 11.
>  
> Summary: Building and running with OpenJDK8 works as expected.
>  
> If I build the application with OpenJDK11 and run with OpenJDK11, I see this 
> when running karaf.vat:
> C >.\karaf.bat
> karaf.bat: Enabling Java debug options: 
> -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
> OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in 
> version 9.0 and will likely be removed in a future release.
> Listening for transport dt_socket at address: 5005
> ERROR: Error parsing system bundle export statement: 
> org.osgi.dto;version="1.0",org.osgi.resource;version="1.0",org.osgi.resource.dto;version="1.0";uses:="org.osgi.d
> to",org.osgi.framework;version="1.8",org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framewor
> k",org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",org.os
> gi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",org.osgi.framework.name
> space;version="1.1";uses:="org.osgi.resource",org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",org.osgi.framework.startlevel.dto;version="1.0";
> uses:="org.osgi.dto",org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi
> .dto,org.osgi.resource.dto",org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",org.osgi.service.packageadmin;
> version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",org.osgi.se
>  
> rvice.startlevel;version="1.1";uses:="org.osgi.framework",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",org.apa
> che.karaf.version;version="4.2.1",org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.2.1",org.apache.karaf.jaas.boot;uses:="javax.security.aut
> h,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.2.1",,org.apache.karaf.branding,
>  sun.misc, org.apache
> .karaf.diagnostic.core;uses:=org.osgi.framework;version=4.2.1, 
> org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.2.1,
>  org.apac
> he.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version=4.2.1,
>  org.a
> pache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.2.1
> org.osgi.framework.BundleException: Exported package names cannot be zero 
> length.
> at 
> org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeExportClauses(ManifestParser.java:876)
> at 
> org.apache.felix.framework.util.manifestparser.ManifestParser.(ManifestParser.java:215)
> at 
> org.apache.felix.framework.ExtensionManager.(ExtensionManager.java:261)
> at org.apache.felix.framework.Felix.(Felix.java:429)
> at 
> org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:28)
> at org.apache.karaf.main.Main.launch(Main.java:256)
> at org.apache.karaf.main.Main.main(Main.java:178)
> Error installing bundle listed in startup.properties with url: 
> mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.1 and 
> startlevel: 1
>  
> In data/log/karaf.log, I see this:
> Nov 30, 2018 9:16:56 AM org.apache.karaf.main.Main launch
> INFO: Installing and starting initial bundles
> Nov 30, 2018 9:16:56 AM org.apache.karaf.main.Main main
> SEVERE: Could not launch framework
> java.lang.RuntimeException: Error installing bundle listed in 
> startup.properties with url: 
> mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.1 and 
> startlevel: 1
> at org.apache.karaf.main.Main.installAndStartBundles(Main.java:550)
> at org.apache.karaf.main.Main.launch(Main.java:273)
> at org.apache.karaf.main.Main.main(Main.java:178)
> Caused by: org.osgi.framework.BundleException: Could not create bundle object.
> at org.apache.felix.framework.Felix.installBundle(Felix.java:3095)
> at 
> 

Re: karaf-maven-plugin version 4.2.2?

2018-11-21 Thread Freeman Fang
Hi Alex,

FYI, Karaf 4.2.2 isn't released yet, should be available in coming weeks.

Cheers
Freeman
-
Freeman(Yue) Fang

Red Hat, Inc. 





> On Nov 22, 2018, at 4:41 AM, Alex Soto  wrote:
> 
> I am starting to upgrade Karaf to version 4.2.2,  plugin  karaf-maven-plugin 
> is missing:
> I get error:
> 
> 
>   Could not find artifact 
> org.apache.karaf.tooling:karaf-maven-plugin:jar:4.2.2 in central 
> (https://repo.maven.apache.org/maven2 ) 
> @ 
> 
> Was this renamed or moved somewhere else?
> 
> Best regards,
> Alex soto
> 
> 
> 
> 



Re: Error while sending email because of javax.activation

2018-10-25 Thread Freeman Fang
Thanks for reporting this.

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

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



> On Oct 25, 2018, at 8:20 PM, DUTERTRY Nicolas  
> wrote:
> 
> Hi,
>  
> It is not possible to send email in Karaf 4.2 with javax.mail API. When an 
> email is sent, this exception is raised :
>  
> javax.mail.MessagingException: IOException while sending message;
>   nested exception is:
>  javax.activation.UnsupportedDataTypeException: no object DCH for MIME 
> type multipart/mixed;
>  
> I’ve found that it is because the Activation Framework (javax.activation) is 
> not OSGI compliant. In the previous Karaf version (4.1) a servicemix 
> implementation of the Activation Framework was included but it is not the 
> case anymore.
>  
> The solution to have a working Activation Framework is to remove 
> javax.activation references in jre.properties and to install the bundle 
> org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0.
>  
> For the future Karaf 4.2.2 can you please :
> -  Remove javax.activation from jre.properties
> -  Remove activation-1.1.1.jar from directory lib/boot
> -  Let the user install 
> org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0
>  if needed
>  
> Regards,
> --
> Nicolas Dutertry
> Sopra HR Software - http://www.soprahr.com/ 


Re: Karaf 4.2.1 JDK 10 - provide jax-ws

2018-09-17 Thread Freeman Fang
Yes, as JB said, you should use spec bundles from Apache Servicemix which 
support OSGi locator which means can find spec impls in OSGi container.

As to which spec bundles you should have for your case, if it’s web service 
endpoint, you actually can draw on cxf-specs features shipped with Apache 
CXF[1].

[1]http://repo2.maven.org/maven2/org/apache/cxf/karaf/apache-cxf/3.2.6/apache-cxf-3.2.6-features.xml
-
Freeman(Yue) Fang

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



> On Sep 17, 2018, at 4:28 PM, Jean-Baptiste Onofré  wrote:
> 
> No, Java 11 has exactly the same approach.
> 
> As said, we provide the spec bundle at ServiceMix, so you can install it.
> 
> Regards
> JB
> 
> On 17/09/2018 09:30, lechlukasz wrote:
>> This is exactly my problem, finding out the required bundles to install.
>> 
>> As for now, I've found that 'canonical' SO answer:
>> https://stackoverflow.com/questions/48204141/replacements-for-deprecated-jpms-modules-with-java-ee-apis/48204154#48204154
>> 
>> unfortunately, many of the listed artifacts are not OSGi-zed. 
>> 
>> On the other way, I'm missing details, how are Java's 'services' working in
>> OSGi environment. For example, for JAXB, who will load the
>> javax.xml.bin.JAXBContext implementation, the bundle from which the package
>> javax.xml.bind is imported? 
>> 
>> I suppose I'm not the only person with that problem and there's some
>> 'proper' list of bundles to install to use JAXB, JAX-WS etc. 
>> 
>> I suppose the solution for Java 10 will work in Java 11 too, so waiting for
>> Java 11 will not fix anything authomatically? 
>> 
>> 
>> 
>> 
>> 
>> jbonofre wrote
>>> With Java 9/10/11, as Freeman said, EE packages are not in separated
>>> modules. So you have to either install the packages in the JDK (and
>>> update jre.properties) or install the required bundles.
>> 
>> 
>> 
>> 
>> 
>> --
>> 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



Re: Karaf 4.2.1 JDK 10 - provide jax-ws

2018-09-14 Thread Freeman Fang
Sure, we definitely need better documentation.

Thanks JB!
-
Freeman(Yue) Fang

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



> On Sep 14, 2018, at 10:08 PM, Jean-Baptiste Onofré  wrote:
> 
> You are right, I was in the jre-8 section of etc/jre.properties (misread).
> 
> If you don't mind, I will add a note in the documentation, as some users
> might be "lost".
> 
> Regards
> JB
> 
> On 14/09/2018 16:06, Freeman Fang wrote:
>> Hi JB,
>> 
>> Those packages are already removed from Karaf 4.2.1(etc/jre.properties)
>> when using JDK9,10,11.
>> 
>> Not sure if we should install those spec bundles in Karaf by default,
>> IMO, Karaf should be a small core, the smaller, the better. Customer can
>> build customised kit with our powerful karaf-maven-plugin anyway.
>> 
>> Cheers
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> FuseSource is now part of Red Hat
>> 
>> 
>> 
>>> On Sep 14, 2018, at 9:58 PM, Jean-Baptiste Onofré >> <mailto:j...@nanthrax.net>> wrote:
>>> 
>>> Good point Freeman.
>>> 
>>> In that case, what do you think about removing these package from
>>> jre.properties and let the user install the spec bundle ?
>>> Maybe, we can also do it by default in the Karaf standard distribution.
>>> 
>>> Thoughts ?
>>> 
>>> Regards
>>> JB
>>> 
>>> On 14/09/2018 15:51, Freeman Fang wrote:
>>>> Hi,
>>>> 
>>>> For Java 9,10,11, we handle those versions in same way. Since several EE
>>>> related jigsaw modules including javax.xml.ws will be removed from
>>>> Java11 eventually, override it and let system bundle 0 expose those
>>>> packages makes less sense IMO,  you need install jax-ws api bundle by
>>>> yourself.
>>>> 
>>>> You can use servicemix wrapped one, just like we do for a long time
>>>> in CXF
>>>> 
>>>> install
>>>> -s 
>>>> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0
>>>> 
>>>> 
>>>> 
>>>> -
>>>> Freeman(Yue) Fang
>>>> 
>>>> Red Hat, Inc. 
>>>> FuseSource is now part of Red Hat
>>>> 
>>>> 
>>>> 
>>>>> On Sep 14, 2018, at 9:17 PM, Lukasz Lech >>>> <mailto:l.l...@ringler.ch>
>>>>> <mailto:l.l...@ringler.ch>> wrote:
>>>>> 
>>>>> Hello,
>>>>>  
>>>>> After starting my app in Karaf 4.2.1  with Java 10 I’m getting errors:
>>>>>  
>>>>> 
>>>>> java.lang.ClassNotFoundException: javax.xml.ws.Service
>>>>> 
>>>>>  at java.net.URLClassLoader.findClass(URLClassLoader.java:466)
>>>>> ~[?:?]
>>>>> 
>>>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:566) ~[?:?]
>>>>> 
>>>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>>>> 
>>>>>  at
>>>>> org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:940)
>>>>> ~[?:?]
>>>>> 
>>>>>  at
>>>>> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
>>>>> ~[?:?]
>>>>> 
>>>>>  at
>>>>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
>>>>> ~[?:?]
>>>>> 
>>>>>  at
>>>>> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>>>>> ~[?:?]
>>>>> 
>>>>>  at
>>>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>>>>> ~[?:?]
>>>>> 
>>>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>>>> 
>>>>> I’ve checked what imports the bundle that have triggered this error,
>>>>> and it imports javax.xml.ws from System bundle (0):
>>>>>  
>>>>> javax.xml,version=0.0.0 from org.apache.felix.framework (0)
>>>>> <http://lx-entw3:8192/system/console/bundles/0> -- Overwritten by Boot
>>>>> Delegation
>>>>

Re: Karaf 4.2.1 JDK 10 - provide jax-ws

2018-09-14 Thread Freeman Fang
Hi JB,

Those packages are already removed from Karaf 4.2.1(etc/jre.properties) when 
using JDK9,10,11.

Not sure if we should install those spec bundles in Karaf by default, IMO, 
Karaf should be a small core, the smaller, the better. Customer can build 
customised kit with our powerful karaf-maven-plugin anyway.

Cheers
-
Freeman(Yue) Fang

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



> On Sep 14, 2018, at 9:58 PM, Jean-Baptiste Onofré  wrote:
> 
> Good point Freeman.
> 
> In that case, what do you think about removing these package from
> jre.properties and let the user install the spec bundle ?
> Maybe, we can also do it by default in the Karaf standard distribution.
> 
> Thoughts ?
> 
> Regards
> JB
> 
> On 14/09/2018 15:51, Freeman Fang wrote:
>> Hi,
>> 
>> For Java 9,10,11, we handle those versions in same way. Since several EE
>> related jigsaw modules including javax.xml.ws will be removed from
>> Java11 eventually, override it and let system bundle 0 expose those
>> packages makes less sense IMO,  you need install jax-ws api bundle by
>> yourself.
>> 
>> You can use servicemix wrapped one, just like we do for a long time in CXF
>> 
>> install
>> -s 
>> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0
>> 
>> 
>> 
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> FuseSource is now part of Red Hat
>> 
>> 
>> 
>>> On Sep 14, 2018, at 9:17 PM, Lukasz Lech >> <mailto:l.l...@ringler.ch>> wrote:
>>> 
>>> Hello,
>>>  
>>> After starting my app in Karaf 4.2.1  with Java 10 I’m getting errors:
>>>  
>>> 
>>> java.lang.ClassNotFoundException: javax.xml.ws.Service
>>> 
>>>  at java.net.URLClassLoader.findClass(URLClassLoader.java:466)
>>> ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:566) ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>> 
>>>  at
>>> org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:940)
>>> ~[?:?]
>>> 
>>>  at
>>> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
>>> ~[?:?]
>>> 
>>>  at
>>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
>>> ~[?:?]
>>> 
>>>  at
>>> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>>> ~[?:?]
>>> 
>>>  at
>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>>> ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>> 
>>> I’ve checked what imports the bundle that have triggered this error,
>>> and it imports javax.xml.ws from System bundle (0):
>>>  
>>> javax.xml,version=0.0.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0> -- Overwritten by Boot
>>> Delegation
>>> javax.xml.bind,version=2.2.1 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.namespace,version=0.0.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.parsers,version=0.0.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.stream,version=1.2.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.stream.events,version=1.2.0 from org.apache.felix.framework
>>> (0) <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.transform,version=0.0.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.transform.stream,version=0.0.0
>>> from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.validation,version=0.0.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.ws,version=2.2.0 from org.apache.felix.framework (0)
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>>  
>>> What do I need to do to use JAX-WS in Karaf 4.2.1 with JDK 10? Is the
>>> import of javax.xml.ws. packages from system bundle OK?
>>> I suppose it might be tricky to get the same set of features working
>>> with JDK 8 and 10, but in case of JAX-WS I haven’t even found the
>>> boundles with JAX-WS that I can install. Jaxws-rt bundles from Maven
>>> Repository that I’ve found are not OSGi bundles…
>>>  
>>> Best regards,
>>> Lukasz Lech
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



Re: Karaf 4.2.1 JDK 10 - provide jax-ws

2018-09-14 Thread Freeman Fang
FWIW, in karaf 4.2.1, the system bundle won’t export javax.xml.ws package 
anymore when using jdk 9,10,11.

And since jdk11, there is no such JPMS module  for javax.xml.ws anymore from 
JDK.

Several modules are removed since JDK11, they are
 * java.corba — CORBA
 * java.transaction — The subset of the Java Transaction API defined by Java SE 
to support CORBA Object Transaction Services
 * java.activation — JavaBeans Activation Framework
 * java.xml.bind — Java Architecture for XML Binding (JAXB)
 * java.xml.ws — Java API for XML Web Services (JAX-WS), Web Services Metadata 
for the Java Platform, and SOAP with Attachments for Java (SAAJ)
 * java.xml.ws.annotation — The subset of the JSR-250 Common Annotations 
defined by Java SE to support web services

-
Freeman(Yue) Fang

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



> On Sep 14, 2018, at 9:55 PM, Tim Ward  wrote:
> 
> Yes, you’re tripping over one of the packages that was removed from Java 
> because it was technically a Java EE package and could not be upgraded 
> without upgrading Java. You either need to launch with the relevant modules 
> enabled, or, as in the email below, add the API into your framework. The 
> latter solution is better.
> 
> Also, Karaf needs to fix its platform definition as it incorrectly states 
> that the system bundle provides the package. This package should only be 
> advertised if the relevant JPMS module is also deployed.
> 
> Tim
> 
>> On 14 Sep 2018, at 14:51, Freeman Fang > <mailto:freeman.f...@gmail.com>> wrote:
>> 
>> Hi,
>> 
>> For Java 9,10,11, we handle those versions in same way. Since several EE 
>> related jigsaw modules including javax.xml.ws will be removed from Java11 
>> eventually, override it and let system bundle 0 expose those packages makes 
>> less sense IMO,  you need install jax-ws api bundle by yourself.
>> 
>> You can use servicemix wrapped one, just like we do for a long time in CXF
>> 
>> install -s 
>> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0
>> 
>> 
>> 
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> FuseSource is now part of Red Hat
>> 
>> 
>> 
>>> On Sep 14, 2018, at 9:17 PM, Lukasz Lech >> <mailto:l.l...@ringler.ch>> wrote:
>>> 
>>> Hello,
>>>  
>>> After starting my app in Karaf 4.2.1  with Java 10 I’m getting errors:
>>>  
>>> java.lang.ClassNotFoundException: javax.xml.ws.Service
>>> 
>>>  at java.net.URLClassLoader.findClass(URLClassLoader.java:466) 
>>> ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:566) ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>> 
>>>  at 
>>> org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:940)
>>>  ~[?:?]
>>> 
>>>  at 
>>> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
>>>  ~[?:?]
>>> 
>>>  at 
>>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
>>>  ~[?:?]
>>> 
>>>  at 
>>> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>>>  ~[?:?]
>>> 
>>>  at 
>>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>>>  ~[?:?]
>>> 
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
>>> 
>>> I’ve checked what imports the bundle that have triggered this error, and it 
>>> imports javax.xml.ws from System bundle (0):
>>>  
>>> javax.xml,version=0.0.0 from org.apache.felix.framework (0) 
>>> <http://lx-entw3:8192/system/console/bundles/0> -- Overwritten by Boot 
>>> Delegation
>>> javax.xml.bind,version=2.2.1 from org.apache.felix.framework (0) 
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.namespace,version=0.0.0 from org.apache.felix.framework (0) 
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.parsers,version=0.0.0 from org.apache.felix.framework (0) 
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.stream,version=1.2.0 from org.apache.felix.framework (0) 
>>> <http://lx-entw3:8192/system/console/bundles/0>
>>> javax.xml.stream.events,version=1.2.0 from org.apache.

Re: Karaf 4.2.1 JDK 10 - provide jax-ws

2018-09-14 Thread Freeman Fang
Hi,

For Java 9,10,11, we handle those versions in same way. Since several EE 
related jigsaw modules including javax.xml.ws will be removed from Java11 
eventually, override it and let system bundle 0 expose those packages makes 
less sense IMO,  you need install jax-ws api bundle by yourself.

You can use servicemix wrapped one, just like we do for a long time in CXF

install -s 
mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0



-
Freeman(Yue) Fang

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



> On Sep 14, 2018, at 9:17 PM, Lukasz Lech  wrote:
> 
> Hello,
>  
> After starting my app in Karaf 4.2.1  with Java 10 I’m getting errors:
>  
> java.lang.ClassNotFoundException: javax.xml.ws.Service
> 
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:466) ~[?:?]
> 
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:566) ~[?:?]
> 
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
> 
>  at 
> org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:940)
>  ~[?:?]
> 
>  at 
> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
>  ~[?:?]
> 
>  at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
>  ~[?:?]
> 
>  at 
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>  ~[?:?]
> 
>  at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>  ~[?:?]
> 
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
> 
> I’ve checked what imports the bundle that have triggered this error, and it 
> imports javax.xml.ws from System bundle (0):
>  
> javax.xml,version=0.0.0 from org.apache.felix.framework (0) 
>  -- Overwritten by Boot 
> Delegation
> javax.xml.bind,version=2.2.1 from org.apache.felix.framework (0) 
> 
> javax.xml.namespace,version=0.0.0 from org.apache.felix.framework (0) 
> 
> javax.xml.parsers,version=0.0.0 from org.apache.felix.framework (0) 
> 
> javax.xml.stream,version=1.2.0 from org.apache.felix.framework (0) 
> 
> javax.xml.stream.events,version=1.2.0 from org.apache.felix.framework (0) 
> 
> javax.xml.transform,version=0.0.0 from org.apache.felix.framework (0) 
> 
> javax.xml.transform.stream,version=0.0.0 from org.apache.felix.framework (0) 
> 
> javax.xml.validation,version=0.0.0 from org.apache.felix.framework (0) 
> 
> javax.xml.ws,version=2.2.0 from org.apache.felix.framework (0) 
> 
>  
> What do I need to do to use JAX-WS in Karaf 4.2.1 with JDK 10? Is the import 
> of javax.xml.ws. packages from system bundle OK?
> I suppose it might be tricky to get the same set of features working with JDK 
> 8 and 10, but in case of JAX-WS I haven’t even found the boundles with JAX-WS 
> that I can install. Jaxws-rt bundles from Maven Repository that I’ve found 
> are not OSGi bundles…
>  
> Best regards,
> Lukasz Lech



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

2018-09-14 Thread Freeman Fang
Hi,

This should be fixed by KARAF-5912[1]

[1]https://issues.apache.org/jira/browse/KARAF-5912 


Cheers
Freeman
-
Freeman(Yue) Fang

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



> On Sep 14, 2018, at 8:58 PM, lechlukasz  wrote:
> 
> karaf@root()> package:exports |grep com.sun.xml.bind
> com.sun.xml.bind.annotation  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.api.impl
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.api 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.marshaller  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.unmarshaller
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.util
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.bytecode 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.doc-files
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.annotation 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.core   
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.impl   
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.nav
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.runtime
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.model.util   
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime.output   
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime.property 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime.reflect.opt  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime.reflect  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime.unmarshaller 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.runtime  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.schemagen.episode
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.schemagen.xmlschema  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.schemagen
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2.util 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind.v2  
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> com.sun.xml.bind 
> | 2.2.11   | 12  | org.apache.servicemix.bundles.jaxb-impl
> 
> I always get that error under windows (OracleJDK 8), never in dockerized
> container (OpenJDK8). 
> 
> 
> 
> Freeman-2 wrote
>> Hello,
>> 
>> This ClassCastException normally means you have two jaxb-impl bundles(with
>> different version) installed in the Karaf container.
>> 
>> Could you please double check it?
>> 
>> You can use Karaf command 
>> package:exports |grep com.sun.xml.bind
>> 
>> And paste what the output you get here
> 
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html



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

2018-09-12 Thread Freeman Fang
JDK11 need those jaxb jars since they are removed from JDK11.

Seems I need another folder to put those jars for JDK11 only. Will fix it ...
-
Freeman(Yue) Fang

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



> On Sep 12, 2018, at 4:01 PM, DUTERTRY Nicolas  
> wrote:
> 
> Hi,
>  
> I’ve tried to remove jaxb-impl from etc/startup.properties, but the issue is 
> still there.
>  
> The command “package:exports |grep com.sun.xml.bind” doesn’t return anything.
>  
> At the moment the only solution for me is to remove the jaxb-*.jar from 
> lib/boot. What are the risks of not having them ?
>  
> --
> Nicolas Dutertry
>  
> De : Freeman Fang [mailto:freeman.f...@gmail.com 
> <mailto:freeman.f...@gmail.com>] 
> Envoyé : mercredi 12 septembre 2018 09:32
> À : user@karaf.apache.org <mailto:user@karaf.apache.org>
> Objet : Re: Karaf 4.2.1: cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
>  
> Hi Stephan,
>  
> We need it in lib/boot but I think we can remove jab-impl from 
> etc/startup.properties.
>  
> Running more tests...
> -
> Freeman(Yue) Fang
> 
> Red Hat, Inc. 
> FuseSource is now part of Red Hat
>  
>  
>  
> On Sep 12, 2018, at 3:13 PM, Siano, Stephan  <mailto:stephan.si...@sap.com>> wrote:
>  
> Hi,
>  
> I have seen that issue twice (with Java 8). A restart of the VM usually fixed 
> this in my case.
>  
> I have browsed through the internet about this issue and it seems that this 
> may happen if two JAXB implementations are in the classpath (there is also 
> one included in the JVM, so removing the third one from CXF might not resolve 
> the issue).
>  
> I have tried setting the system property 
> "com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" to "true" but I don't 
> know whether this helps because the issue appears in my setup only very 
> sporadically.
>  
> IMO it might also be worth a try to remove the JAXB bundles from the lib/boot 
> directory before starting karaf. Having JAXB in the JDK and the boot 
> classpath might also cause issues.
>  
> Best regards
> Stephan
>  
>  
> From: Freeman Fang mailto:freeman.f...@gmail.com>> 
> Sent: Mittwoch, 12. September 2018 09:08
> To: user@karaf.apache.org <mailto:user@karaf.apache.org>
> Subject: Re: Karaf 4.2.1: cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
>  
> Hello,
>  
> This ClassCastException normally means you have two jaxb-impl bundles(with 
> different version) installed in the Karaf container.
>  
> Could you please double check it?
>  
> You can use Karaf command 
> package:exports |grep com.sun.xml.bind
> 
> 
> 
> And paste what the output you get here
> 
> 
> 
> Thanks!
> -
> Freeman(Yue) Fang
> 
> Red Hat, Inc. 
> FuseSource is now part of Red Hat
>  
>  
>  
> On Sep 10, 2018, at 10:26 PM, Lukasz Lech  <mailto:l.l...@ringler.ch>> wrote:
>  
> Hello,
>  
> After finding out that Karaf 4.2.1 includes Eclipselink version with 
> PostgreSQL Bug Fix (https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408 
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408>) I’ve tested it with 
> my code.
>  
> But another library has backfired, and I feel helpless about finding out what 
> is going on.
>  
> I’m using JAXB to deserialize XML. I have 2 bundles, which have effectively 
> the same code for deserializing XML from the same schema (some configuration 
> data). In one of the bundles, everything works fine, in another one I get the 
> exception:
>  
> JAXBContext.newInstance(targetClass): 
>  
> Caused by: java.lang.ClassCastException: 
> com.example.MyType$JaxbAccessorF_value cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:271)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.(TransducedAccessor.java:220)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:160)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.calcTransducer(RuntimeClassInf

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

2018-09-12 Thread Freeman Fang
Hi Stephan,

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

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

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



> On Sep 12, 2018, at 3:13 PM, Siano, Stephan  wrote:
> 
> Hi,
>  
> I have seen that issue twice (with Java 8). A restart of the VM usually fixed 
> this in my case.
>  
> I have browsed through the internet about this issue and it seems that this 
> may happen if two JAXB implementations are in the classpath (there is also 
> one included in the JVM, so removing the third one from CXF might not resolve 
> the issue).
>  
> I have tried setting the system property 
> "com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" to "true" but I don't 
> know whether this helps because the issue appears in my setup only very 
> sporadically.
>  
> IMO it might also be worth a try to remove the JAXB bundles from the lib/boot 
> directory before starting karaf. Having JAXB in the JDK and the boot 
> classpath might also cause issues.
>  
> Best regards
> Stephan
>  
>  
> From: Freeman Fang mailto:freeman.f...@gmail.com>> 
> Sent: Mittwoch, 12. September 2018 09:08
> To: user@karaf.apache.org <mailto:user@karaf.apache.org>
> Subject: Re: Karaf 4.2.1: cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
>  
> Hello,
>  
> This ClassCastException normally means you have two jaxb-impl bundles(with 
> different version) installed in the Karaf container.
>  
> Could you please double check it?
>  
> You can use Karaf command 
> package:exports |grep com.sun.xml.bind
> 
> 
> And paste what the output you get here
> 
> 
> Thanks!
> -
> Freeman(Yue) Fang
> 
> Red Hat, Inc. 
> FuseSource is now part of Red Hat
>  
>  
>  
> On Sep 10, 2018, at 10:26 PM, Lukasz Lech  <mailto:l.l...@ringler.ch>> wrote:
>  
> Hello,
>  
> After finding out that Karaf 4.2.1 includes Eclipselink version with 
> PostgreSQL Bug Fix (https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408 
> <https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408>) I’ve tested it with 
> my code.
>  
> But another library has backfired, and I feel helpless about finding out what 
> is going on.
>  
> I’m using JAXB to deserialize XML. I have 2 bundles, which have effectively 
> the same code for deserializing XML from the same schema (some configuration 
> data). In one of the bundles, everything works fine, in another one I get the 
> exception:
>  
> JAXBContext.newInstance(targetClass): 
>  
> Caused by: java.lang.ClassCastException: 
> com.example.MyType$JaxbAccessorF_value cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:271)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.(TransducedAccessor.java:220)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:160)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.calcTransducer(RuntimeClassInfoImpl.java:230)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.getTransducer(RuntimeClassInfoImpl.java:204)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.link(RuntimeClassInfoImpl.java:181)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.link(ModelBuilder.java:439)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.link(RuntimeModelBuilder.java:118)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:443)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:277)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:124)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
>  ~[?:?]
> at 
&g

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

2018-09-12 Thread Freeman Fang
Hello,

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

Could you please double check it?

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

And paste what the output you get here

Thanks!
-
Freeman(Yue) Fang

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



> On Sep 10, 2018, at 10:26 PM, Lukasz Lech  wrote:
> 
> Hello,
>  
> After finding out that Karaf 4.2.1 includes Eclipselink version with 
> PostgreSQL Bug Fix (https://bugs.eclipse.org/bugs/show_bug.cgi?id=522408 
> ) I’ve tested it with 
> my code.
>  
> But another library has backfired, and I feel helpless about finding out what 
> is going on.
>  
> I’m using JAXB to deserialize XML. I have 2 bundles, which have effectively 
> the same code for deserializing XML from the same schema (some configuration 
> data). In one of the bundles, everything works fine, in another one I get the 
> exception:
>  
> JAXBContext.newInstance(targetClass): 
>  
> Caused by: java.lang.ClassCastException: 
> com.example.MyType$JaxbAccessorF_value cannot be cast to 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:190)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:271)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.(TransducedAccessor.java:220)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor.get(TransducedAccessor.java:160)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.calcTransducer(RuntimeClassInfoImpl.java:230)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.getTransducer(RuntimeClassInfoImpl.java:204)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeClassInfoImpl.link(RuntimeClassInfoImpl.java:181)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.ModelBuilder.link(ModelBuilder.java:439)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder.link(RuntimeModelBuilder.java:118)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:443)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:277)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:124)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
>  ~[?:?]
> at 
> com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
>  ~[?:?]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method) ~[?:?]
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
> ~[?:?]
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:?]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
> at 
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:247) ~[?:?]
> at 
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234) ~[?:?]
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:462) 
> ~[?:?]
> at 
> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641) ~[?:?]
> at 
> javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584) ~[?:?]
>  
> I don’t see any substantial difference between those 2 bundles. They have 
> other config files, but the same code parsing them. They use similar package 
> imports etc.
>  
> However, one of them always starts, the other one not.
>  
> How to start debugging that issue? Have you experienced similar behavior or 
> have hints, what can cause them?
>  
> The previous version, in that everything was working stable, was Karaf 4.1.3
>  
> Best regards,
> Lukasz Lech 



Re: Startup error using JRE 10 with 4.2.0

2018-07-11 Thread Freeman Fang
Hi,

FYI, the upcoming Karaf 4.2.1 will start to support Java 10. The error you see 
comes from that the the asm6.0(used in Karaf 4.2) can’t work with JAVA10.

Cheers
-
Freeman(Yue) Fang

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



> On Jul 10, 2018, at 10:51 PM, Leschke, Scott  wrote:
> 
> I see the following during startup of Karaf 4.2.0 with JDK 10 on Windows 
> Server 2016.  Has anybody else seen this?  Shall I submit a JIRA?
>  
> Regards,
>  
> Scott Leschke
>  
>  
> 2018-07-09T16:00:56,439 | ERROR | paxweb-config-2-thread-1 | Activator
> | 108 - org.ops4j.pax.web.pax-web-runtime - 7.0.0 | Unable to 
> start pax web server: Weaving hook failed.
> java.lang.ClassFormatError: Weaving hook failed.
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.transformClass(BundleWiringImpl.java:2479)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2152)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1607)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>  ~[?:?]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:499) 
> ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
>  ~[?:?]
> at 
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
>  ~[?:?]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:499) 
> ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.(JettyServerImpl.java:97)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.JettyFactoryImpl.createServer(JettyFactoryImpl.java:90)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:443)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:81)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.ServerControllerFactoryImpl$1.start(ServerControllerFactoryImpl.java:164)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Unconfigured.configure(ServerControllerImpl.java:788)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:97)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:347)
>  ~[?:?]
> at 
> org.ops4j.pax.web.service.internal.Activator.lambda$scheduleUpdateFactory$2(Activator.java:291)
>  ~[?:?]
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514) [?:?]
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
> [?:?]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
>  [?:?]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>  [?:?]
> at java.lang.Thread.run(Thread.java:844) [?:?]
> Caused by: java.lang.IllegalArgumentException
> at org.objectweb.asm.ClassReader.(ClassReader.java:160) 
> ~[?:?]
> at org.objectweb.asm.ClassReader.(ClassReader.java:143) 
> ~[?:?]
> at org.objectweb.asm.ClassReader.(ClassReader.java:418) 
> ~[?:?]
> at 
> org.apache.aries.spifly.dynamic.OSGiFriendlyClassWriter.getCommonSuperClass(OSGiFriendlyClassWriter.java:81)
>  ~[?:?]
> at 
> org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1729) ~[?:?]
> at org.objectweb.asm.Frame.merge(Frame.java:1530) ~[?:?]
> at org.objectweb.asm.Frame.merge(Frame.java:1441) ~[?:?]
> at 
> org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1497) ~[?:?]
> at 
> org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(LocalVariablesSorter.java:165)
>  ~[?:?]
> at 
> org.objectweb.asm.ClassReader.readCode(ClassReader.java:1738) ~[?:?]
> at 
> org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126) ~[?:?]

Re: Any plans for supporting JDK 11 ?

2018-06-07 Thread Freeman Fang
Please see the patch and my comment on KARAF-5764, I think we need more change 
to support java11 in KARAF.

As XBean also embed asm source, so we need a new XBean release which build 
against ASM6.2, as well as a new easymock release.

Besides, Since JDK11, those modules get removed from JDK
* java.corba — CORBA
 * java.transaction — The subset of the Java Transaction API defined by Java SE 
to support CORBA Object Transaction Services
 * java.activation — JavaBeans Activation Framework
 * java.xml.bind — Java Architecture for XML Binding (JAXB)
 * java.xml.ws — Java API for XML Web Services (JAX-WS), Web Services Metadata 
for the Java Platform, and SOAP with Attachments for Java (SAAJ)
 * java.xml.ws.annotation — The subset of the JSR-250 Common Annotations 
defined by Java SE to support web services

So I think we don't need to use --patch-module for those APIs which already get 
removed. What we do is just use normal bundle for those APIs, or if we really 
need those API in boot stage we can put those in $KARAF_HOME/lib/boot folder, 
so far we need jaxb and activation in lib/boot/folder as features.core need 
those.

[1]https://issues.apache.org/jira/browse/KARAF-5764 


Cheers
-
Freeman(Yue) Fang

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



> On Jun 8, 2018, at 1:37 AM, Jean-Baptiste Onofré  wrote:
> 
> Hi Serge,
> 
> I just submitted Aries Proxy Impl 1.1.2 with ASM 6.2 this morning,
> bringing support of Java 9, 10, 11.
> 
> As soon as the vote passed, I will update in Karaf. The purpose is to
> include this for Karaf 4.2.1 (planned next week), in order to give us
> time to test.
> Before 4.2.1, I have also to work on Pax Web (7.1.1) supporting Jetty
> 9.4.10 supporting new Java version as well.
> 
> So, to summarize, 4.2.1 should support Java 10 & 11, thanks to the ASM
> 6.2 update + Aries Proxy + Pax Web/Jetty update (all Jira are created
> and in my bucket).
> 
> Regards
> JB
> 
> On 07/06/2018 17:35, Serge Huber wrote:
>> Hello,
>> 
>> With the upcoming release of JDK 11 (planned for September), I was
>> wondering what the plans for supporting it looked like ? Are we
>> expecting any kind of blocking problems ? Should be simpler than JDK 9 I
>> think. 
>> 
>> I didn't follow the JDK 10 support, did that involve any problems ?
>> 
>> cheers,
>>   Serge... 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



Re: Karaf and SSH timeouts

2018-01-05 Thread Freeman Fang
Seems we already have a jira ticket for it KARAF-5473[1]
[1]https://issues.apache.org/jira/browse/KARAF-5473
-
Freeman(Yue) Fang

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



> On Jan 5, 2018, at 5:36 AM, Ryan Moquin  wrote:
> 
> One more thing that might be helpful, my bitvise client reconnects... so 
> there is a set of logs where it's been connecting and getting disconnected, 
> looks like it's happening every 10 minutes, I wasn't doing anything with 
> Karaf during that time:
> 
> 18:25:48.014 WARN [sshd-SshServer[6e85ec8]-nio2-thread-1] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:49332])[state=Opened] 
> InterruptedByTimeoutException: null
> 18:25:50.120 INFO [sshd-SshServer[6e85ec8]-nio2-thread-1] Session 
> karaf@/127.0.0.1:49402  authenticated
> 18:36:05.122 WARN [sshd-SshServer[6e85ec8]-nio2-thread-2] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:49402])[state=Opened] 
> InterruptedByTimeoutException: null
> 18:36:07.226 INFO [sshd-SshServer[6e85ec8]-nio2-thread-2] Session 
> karaf@/127.0.0.1:49506  authenticated
> 18:46:22.227 WARN [sshd-SshServer[6e85ec8]-nio2-thread-1] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:49506])[state=Opened] 
> InterruptedByTimeoutException: null
> 18:46:24.335 INFO [sshd-SshServer[6e85ec8]-nio2-thread-1] Session 
> karaf@/127.0.0.1:49602  authenticated
> 20:48:01.659 WARN [sshd-SshServer[6e85ec8]-nio2-thread-2] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:49602])[state=Opened] 
> InterruptedByTimeoutException: null
> 20:48:03.767 INFO [sshd-SshServer[6e85ec8]-nio2-thread-2] Session 
> karaf@/127.0.0.1:50035  authenticated
> 20:58:18.768 WARN [sshd-SshServer[6e85ec8]-nio2-thread-1] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:50035])[state=Opened] 
> InterruptedByTimeoutException: null
> 20:58:20.937 INFO [sshd-SshServer[6e85ec8]-nio2-thread-1] Session 
> karaf@/127.0.0.1:50225  authenticated
> 21:08:35.940 WARN [sshd-SshServer[6e85ec8]-nio2-thread-2] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:50225])[state=Opened] 
> InterruptedByTimeoutException: null
> 21:08:38.046 INFO [sshd-SshServer[6e85ec8]-nio2-thread-2] Session 
> karaf@/127.0.0.1:50344  authenticated
> 21:18:53.048 WARN [sshd-SshServer[6e85ec8]-nio2-thread-1] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:50344])[state=Opened] 
> InterruptedByTimeoutException: null
> 21:18:55.160 INFO [sshd-SshServer[6e85ec8]-nio2-thread-1] Session 
> karaf@/127.0.0.1:50601  authenticated
> 21:29:10.162 WARN [sshd-SshServer[6e85ec8]-nio2-thread-2] 
> exceptionCaught(ServerSessionImpl[karaf@/127.0.0.1:50601])[state=Opened] 
> InterruptedByTimeoutException: null
> 21:29:12.301 INFO [sshd-SshServer[6e85ec8]-nio2-thread-2] Session 
> karaf@/127.0.0.1:50687  authenticated
> 
> 
> On Thu, Jan 4, 2018 at 11:58 AM Jean-Baptiste Onofré  > wrote:
> Thanks for the update.
> 
> Let me try to reproduce this behavior.
> 
> Regards
> JB
> 
> On 01/04/2018 04:56 PM, Ryan Moquin wrote:
> > Yes, sorry, 4.0.12.  Yes, with both the Karaf client and an OpenSSH client 
> > I see
> > this happen.  Let me just re-verify that if I start up karaf with absolutely
> > nothing in it and ssh to it locally that it times out.  Want to make sure no
> > bundles are clobbering anything.  The logging gets messed up periodically
> > because camel pulls in pax-logger-log4j2 which breaks the logging and then I
> > have to reconnect my ssh client, if it's still connected.  I think this is
> > something different though.
> >
> > Actually, I think a bug was logged for this by OpenHAB (that was the 
> > project),
> > here is the thread where they discuss what sounds like the exact same thing 
> > I'm
> > seeing.  They mention it happening after 30 minutes, which is what the Karaf
> > timeout is configured for, but then someone else mentions it happens after 
> > a few
> > minutes consistently...
> >
> > https://community.openhab.org/t/timeout-in-karaf-console/35443 
> > 
> >
> > I've tried different SSH clients with Karaf to see if there was any 
> > difference
> > just in case.  If I turn on keepalive in my bitvise ssh client, it seems to 
> > stay
> > connected a lot longer, but it sends a keep alive ever 20 seconds and the
> > interval isn't configurable, which makes the logs fun to look through :)
> >
> >
> >
> > On Thu, Jan 4, 2018 at 10:39 AM Jean-Baptiste Onofré  > 
> > >> wrote:
> >
> > Hi Ryan,
> >
> > Are you using the Karaf client or OpenSSH client ?
> >
> > You just type log:tail ?
> >
> > I didn't notice such timeout.
> >
> > 

Re: Encrypted keystore password

2017-05-21 Thread Freeman Fang
Hi,

Yes, provided you are using Karaf 4.1.x, which in turn uses the pax.web 6.0.x.

Basically we use jasypt to encrypt the sensitive string, hence introduce 
several more properties for pax web pid, such as enc.masterpassword, 
enc.algorithm, enc.enabled, enc.prefix, enc.suffix. Moreover, you can configure 
the masterpassword for the jasypt encryptor with env variable or system 
property, other configuration for decryptor all have default values.

Please take a look at PAXWEB-1021[1] to get more details.

[1]https://ops4j1.jira.com/browse/PAXWEB-1021 


Cheers
-
Freeman(Yue) Fang

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



> On May 19, 2017, at 9:02 PM, ashonline  wrote:
> 
> Hi,
> 
> I'm in the process of configuring karaf to use SSL communication and have
> therefore provided the password to the keystore in the org.ops4j.pax.web.cfg
> file:
> 
> org.ops4j.pax.web.ssl.keypassword=mypwd
> 
> I can't however find anything in the documentation that tells me how to
> encrypt the password, for example by surrounding the password digest with
> {CRYPT} markers.
> 
> Please advise whether or not this encryption capability exists or, if not,
> what we can do as a workaround? It won't be acceptable for our clients to
> have to type in their password in plain text for their keystore that they
> will provide to our karaf based framework.
> 
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Encrypted-keystore-password-tp4050396.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Invalid Bundle Context errors with 4.0.6, unpredictably

2016-09-19 Thread Freeman Fang
FWIW, for the upcoming pax-exam 4.10, we offer a chance to rerun the test if 
the testcase implements a retry TestRule, so that when the test failed first 
time with such bundle refresh problem,  there’s another chance to rerun it with 
a refreshed Karaf container. PAXEXAM-795[1] tracked this.

[1]https://ops4j1.jira.com/browse/PAXEXAM-795
-
Freeman(Yue) Fang

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



> On Sep 15, 2016, at 3:35 AM, Guillaume Nodet  wrote:
> 
> Such an error is caused by the bundle being stopped / refreshed / updated, so 
> the reason should appear in the log.
> 
> 2016-09-14 21:10 GMT+02:00 Benson Margulies  >:
> I don't know of any reason for a refresh. The structure is always that
> I have a Karaf assembly; the test launches it and then tests web
> services that it publishes. No test involves any updating or deploying
> features or bundles.
> 
> 
> On Wed, Sep 14, 2016 at 2:59 PM, Guillaume Nodet  > wrote:
> > If your test deploys certain bundles such as eventadmin, it can cause
> > pax-logging-api to be refreshed, which in turn cause almost all bundles to
> > be refreshed, which can cause such problems.
> > If that's the case, you should consider deploying eventamin at the startup
> > stage somehow to avoid the refreshes..
> >
> > 2016-09-14 20:54 GMT+02:00 Benson Margulies  > >:
> >>
> >> Folks,
> >>
> >> One of my pax-exam tests _sometimes_ fails with the backtrace below;
> >> to be more precise, it hangs after showing this backtrace on the
> >> console.
> >>
> >> It seems as if this only happens when all of my ITs run; if I tell
> >> failsafe to just run one, it seems never to happen.
> >>
> >> Any ideas?
> >>
> >> TIA
> >>
> >>
> >> 2016-09-14 14:46:52,074 | WARN  | pool-6-thread-1  | Activator
> >>| 6 - org.apache.karaf.features.core - 4.0.6 | Error
> >> starting activator
> >> java.lang.IllegalStateException: Invalid BundleContext.
> >> at
> >> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)[org.apache.felix.framework-5.4.0.jar:]
> >> at
> >> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[org.apache.felix.framework-5.4.0.jar:]
> >> at
> >> org.apache.karaf.util.tracker.BaseActivator.registerMBean(BaseActivator.java:293)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:265)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:236)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_60]
> >> at
> >> java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_60]
> >> at
> >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_60]
> >> at
> >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_60]
> >> at java.lang.Thread.run(Thread.java:745)[:1.8.0_60]
> >
> >
> >
> >
> > --
> > 
> > Guillaume Nodet
> > 
> > Red Hat, Open Source Integration
> >
> > Email: gno...@redhat.com 
> > Web: http://fusesource.com 
> > Blog: http://gnodet.blogspot.com/ 
> >
> 
> 
> 
> -- 
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
> 
> Email: gno...@redhat.com 
> Web: http://fusesource.com 
> Blog: http://gnodet.blogspot.com/ 
> 



Re: Breaking change in 4.0.6 bin/client login

2016-09-08 Thread Freeman Fang
Hi,

IMO the username/password stored in etc/users.properties should be only used on 
the jaas server side with PropertiesLoginModule, that’s the backend storage for 
server side thing, so the bin/client which basically is a ssh client should 
never rely on it by default. Although we ship both client and server scripts 
together in the kit, it doesn’t mean they should share the 
etc/users.properties. I think the most common use case is that you start Karaf 
in one machine with modified etc/users.properties and use bin/client on another 
machine which the etc/users.properties could be totally different. This change 
may break your current logic however it prompt the chance to specify the 
password if you specify a user,  that’s said, you should know the password for 
the user you’re using, which make more sense and is more safe IMO. 

In any case, I’m +1 to re-introduce the -p flag so that we can use -u -p 
together in the script which avoid the password prompt.
-
Freeman(Yue) Fang

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



> On Sep 9, 2016, at 5:17 AM, Ed Welch  wrote:
> 
> I just updated from 4.0.5 to 4.0.6 and some automated scripts I had which use 
> the bin/client shell script are now no longer working.
> 
> I traced the issue down to https://issues.apache.org/jira/browse/KARAF-3859
> 
> The previous functionality let me specify the user with the -u flag, and then 
> it would go lookup the password from the users.properties file.
> 
> Now, if you specify the -u flag, it force prompts you for a password, and 
> there is no option for me to tell it to go find the user.  And it's not 
> really very easy or practical for me to pass in the password to the prompt 
> being presented.
> 
> If I do not specify the user, it will log in without prompt, however, the 
> user is pulled as the first from an iterator, which is not reliable, and 
> often for me not a user which has the permissions I need.
> 
> 
> I'm not sure why this issue was created in the first place, and I don't think 
> I agree with this change (well, obviously since it broke my stuff :)  )
> 
> I don't understand the requirement that drove creating 3859 and why 
> "interactive mode" was introduced into the ClientConfig class.
> 
> I remember back in the day there used to be a -p flag where you could specify 
> a password along with a user, maybe re-introducing this would be a better 
> solution than breaking current functionality?
> 
> Thoughts?
> 
> Thanks,
> Ed



Re: CXF feature question

2015-09-29 Thread Freeman Fang
Hi,

Those resource import are not needed for a while.
-
Freeman(Yue) Fang

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



> On Sep 26, 2015, at 1:06 AM, Daniel McGreal  wrote:
> 
> Hi Karaf types,
> 
> I’m using Karaf 3.0.1 and the cxf-jaxrs feature for this project where I need 
> a very simple endpoint.
> 
> Trying to configure with
> 
>   
>   
> 
> according to 
> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Spring
>  
> ,
>  results in:
> 
> Caused by: java.io.FileNotFoundException: OSGi 
> resource[classpath:META-INF/cxf/cxf.xml|bnd.id=294|bnd.sym=endpoint.cxf] 
> cannot be resolved to URL because it does not exist
> 
> which is fair enough, because it doesn’t.
> 
> Any suggestions welcome!
> Thanks, Dan.



Re: CXF feature question

2015-09-29 Thread Freeman Fang
Hi Dan,

You can download Apache Servicemix kit, where you can find a cxf-jaxrs example 
shipped with kit, it should be very similar as your scenario.

-
Freeman(Yue) Fang

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



> On Sep 29, 2015, at 3:23 PM, Daniel McGreal <d.j.mcgr...@gmail.com> wrote:
> 
> Hi Freeman,
> I wondered that, removed them but got an error about missing an http 
> transport bean of some kind. Investigating that error led by o a post about 
> the missing imports. Are they replaced by some other construct? Could you 
> elaborate on what is required?
> I'll be looking into the other suggestion today. 
> Dan.
> 
> On 29 Sep 2015, at 08:11, Freeman Fang <freeman.f...@gmail.com 
> <mailto:freeman.f...@gmail.com>> wrote:
> 
>> Hi,
>> 
>> Those resource import are not needed for a while.
>> -
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc. 
>> FuseSource is now part of Red Hat
>> 
>> 
>> 
>>> On Sep 26, 2015, at 1:06 AM, Daniel McGreal <d.j.mcgr...@gmail.com 
>>> <mailto:d.j.mcgr...@gmail.com>> wrote:
>>> 
>>> Hi Karaf types,
>>> 
>>> I’m using Karaf 3.0.1 and the cxf-jaxrs feature for this project where I 
>>> need a very simple endpoint.
>>> 
>>> Trying to configure with
>>> 
>>> 
>>> 
>>> 
>>> according to 
>>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Spring
>>>  
>>> <http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Spring>,
>>>  results in:
>>> 
>>> Caused by: java.io.FileNotFoundException: OSGi 
>>> resource[classpath:META-INF/cxf/cxf.xml|bnd.id=294|bnd.sym=endpoint.cxf] 
>>> cannot be resolved to URL because it does not exist
>>> 
>>> which is fair enough, because it doesn’t.
>>> 
>>> Any suggestions welcome!
>>> Thanks, Dan.
>> 



Re: karaf 3.0.4 problem with console client

2015-09-09 Thread Freeman Fang
Yeah, this is the bug we need fix.

Create KARAF-3984[1] to track it.
[1]https://issues.apache.org/jira/browse/KARAF-3984
-
Freeman(Yue) Fang

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



> On Sep 3, 2015, at 3:36 PM, ykruchko  wrote:
> 
> when I execute client with command like that ./bin/client kar:list 
> I see 
> KAR Name   
> -- 
> 
> and console not exit I must sent ^C to brake karaf client 
> 
> 
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/karaf-3-0-4-problem-with-console-client-tp4042293.html
> Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Cannot Deploy Spring Web Application

2015-04-29 Thread Freeman Fang
Hi,

How you deploy the war bundle?

Also, could you check the headers of the war?

You can use the
headers war_bundle_id 
to see the Import-Package part, as the exception suggest you should at least 
Import-Package org.springframework.web.context

-
Freeman(Yue) Fang

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



On 2015-4-29, at 下午5:56, noushadali wrote:

 Hi there,
 
 I am deploying  my Spring based web application on Karaf 3.0.3. I resolved
 all the dependencies( including transitive) for the WAR (the war is OSGified
 skinny war). But when I try to Run the WAR I get the Following Errors. 
 
 Here I share the following things that I use 
 1. My POM
 2 .My web.xml
 3.The esception that Iam getting
 
 *POM*
 
 project xmlns=http://maven.apache.org/POM/4.0.0;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/xsd/maven-4.0.0.xsd;
   modelVersion4.0.0/modelVersion
   parent
   artifactIdmyproduct-proxy/artifactId
   groupIdcom.company.myproduct.proxy/groupId
   version1.0/version
   /parent
   artifactIdwap-push-tracker/artifactId
   nameWAP Push Tracker/name
   descriptionwap push tracker/description
 
   build
   finalNamec/finalName
   plugins
   plugin
   artifactIdmaven-war-plugin/artifactId
   configuration
   archive
   
 manifestFile${project.build.outputDirectory}/META-INF/MANIFEST.MF/manifestFile
   /archive
   /configuration
   /plugin
   plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-war-plugin/artifactId
   version2.6/version
   configuration
   
   
 packagingExcludesWEB-INF/lib/*.jar/packagingExcludes
   /configuration
   executions
   execution
   idbundle-manifest/id
   phaseprocess-classes/phase
   goals
   goalmanifest/goal
   /goals
   /execution
   /executions
   /plugin
   plugin
   groupIdorg.apache.felix/groupId
   artifactIdmaven-bundle-plugin/artifactId
   version2.5.3/version
   extensionstrue/extensions
   executions
   execution
   idbundle-manifest/id
   phaseprocess-classes/phase
   goals
   goalmanifest/goal
   /goals
   /execution
   /executions
   configuration
   supportedProjectTypes
   
 supportedProjectTypewar/supportedProjectType
   /supportedProjectTypes
   instructions
 
   
 Import-Package*/Import-Package
   
 Bundle-SymbolicName${pom.groupId}.${pom.artifactId}/Bundle-SymbolicName
   
 Bundle-Name${pom.artifactId}/Bundle-Name
   
 Bundle-Version1.0.0/Bundle-Version
   
 Web-ContextPath/wap-push-servlet/Web-ContextPath
   
 Webapp-Context/wap-push-servlet/Webapp-Context
   _wabsrc/main/webapp/_wab
   /instructions
   /configuration
   /plugin
   /plugins
   /build
 
   dependencies
   dependency
   groupIdorg.osgi/groupId
   artifactIdorg.osgi.core/artifactId
   version5.0.0/version
   scopeprovided/scope
   /dependency
   .
.
   /dependencies
   

Re: javax.activation.DataHandler in OSGi

2015-04-22 Thread Freeman Fang
Hi David,

Could you put that activation bundle into the endorsed dir so that all 
activation class and java.awt.datatransfer.DataFlavor could be loaded from 
system class loader to avoid this problem? That's what Karaf do currently, you 
can see org.apache.servicemix.specs.activation-api-1.1-2.4.0.jar in 
$KARAF_HOME/lib/endorsed.

-
Freeman(Yue) Fang

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



On 2015-4-21, at 下午9:23, David Bosschaert wrote:

 Hi all,
 
 Apologies for posting to the Karaf list as this is not really a Karaf
 issue, but I this list may contain people that might have come across
 this issue as well.
 
 I have some code that runs in OSGi that uses
 javax.activation.DataHandler. As this is javax... you should be able
 to provide your own bundle providing these classes. So I have a bundle
 that provides an alternative javax.activation.DataHandler. Now it
 turns out that this class has a dependency on
 java.awt.datatransfer.DataFlavor, a java.awt class! The DataFlavor
 code is kicked in from DataHandler, but then DataFlavor tries to load
 some classes too, in my case it tries to load DataHandler again. The
 code in DataFlavor tries to load classes from the System Classloader
 first, so it finds the javax.activation.DataHandler in the JRE and
 loads that - boom LinkageError.
 
 I was wondering whether there are any 'fixed' versions of
 javax.activation that don't expose this behaviour and work properly in
 a modular environment like OSGi.
 
 Many thanks,
 
 David



Re: CXF - No DestinationFactory for Http Transport

2015-01-08 Thread Freeman Fang
Hi,

Yeah, this error means your bundle get started before the 
cxf-rt-transports-http bundle.

You can make your bundle import an OSGi 
service(org.apache.cxf.transport.http.DestinationRegistry) which is exposed by 
the cxf-rt-transports-http bundle to ensure cxf bundle get started reliably 
before your bundle
-
Freeman(Yue) Fang

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



On 2015-1-8, at 下午5:24, Mohammad Shamsi wrote:

 
 Hi, 
 
 I've a relatively simple REST bundle, in karaf 2.3, with following blueprint 
 config: 
  jaxrs:server id=foo-id address=/foo
jaxrs:serviceBeans
   bean id=bean-id class=sample.Foo /
/jaxrs:serviceBeans
  /jaxrs:server
 
 Sometimes, during karaf startup, following exception is thrown:
 Caused by: org.apache.cxf.BusException: No DestinationFactory was found for 
 the namespace http://cxf.apache.org/transports/http.
 at 
 org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:130)
  
  ...
 And therefore bundle installation (my rest bundle) fails. 
 As I said, the problem is happening randomly, i believe, depending on bundles 
 start order. Sometime the http-transport bundle is installed and started 
 after my bundle, which causes the above issue. If I refresh or update my 
 bundle, it starts successfully. 
 
 Given that http-transport is used by cxf and my bundle doesn't have direct 
 dependency to it (not using any package from it), How can i make sure that 
 http-transport starts before my bundle? 
 
 Cheers,
 Mohammad Shamsi
 



Re: Error message

2014-12-18 Thread Freeman Fang
Hi,

That message is from Apache Felix but not Karaf.

You may need post request there.
-
Freeman(Yue) Fang

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



On 2014-12-18, at 下午7:38, Milan Tomic wrote:

 Hi,
 
 If you could please change error message from:
 
 Unable to resolve 140.0: missing requirement [140.0] osgi.wiring.package; 
 ((osgi.wiring.package=my.package.api)(version=1.0.0)(!(version=2.0.0)))
 
 to:
 
 Unable to resolve 140.0: missing requirement [140.0] osgi.wiring.package; 
 ((osgi.wiring.package=my.package.api)(found: version=1.0.0)(!(expected: 
 version=2.0.0)))
 
 (I added found and expected)
 
 because it is not intuitive and each time I got this error message I have to 
 search for its meaning.
 
 Thank you,
 Milan



Re: 60,000+ org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects in the HeapDump. Why?

2014-12-16 Thread Freeman Fang
karaf 2.x branch also affected, but the master is OK.

Thanks JB btw.
-
Freeman(Yue) Fang

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



On 2014-12-16, at 下午4:13, Jean-Baptiste Onofré wrote:

 Hi
 
 I've just seen that Freeman committed a fix for the leak issue. I will double 
 check but it looks good to me. I would like to check if the other branches 
 are not affected as well.
 
 Regards
 JB
 
 
  Original message 
 From: Jean-Baptiste Onofré j...@nanthrax.net 
 Date:16/12/2014 09:00 (GMT+01:00) 
 To: user@karaf.apache.org 
 Cc: 
 Subject: Re: 60,000+ 
 org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects in 
 the HeapDump. Why? 
 
 Hi 
 
 I have reproduced it yesterday as well.
 Thanks for the Jira Freeman, I will try to work on it tonight or tomorrow.
 
 Regards
 JB
 
 
  Original message 
 From: Freeman Fang freeman.f...@gmail.com 
 Date:16/12/2014 08:46 (GMT+01:00) 
 To: user@karaf.apache.org 
 Cc: 
 Subject: Re: 60,000+ 
 org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects in 
 the HeapDump. Why? 
 
 FYI, I can reproduce it and create KARAF-3415[1] to track it, and I'm on it
 
 [1]https://issues.apache.org/jira/browse/KARAF-3415
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 
 
 
 On 2014-12-11, at 下午10:54, Paul Spencer wrote:
 
 JB,
 Have you been able to reproduce the issue?
 
 Paul Spencer
 
 
 On Dec 9, 2014, at 2:30 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote:
 
 Thanks Paul,
 
 I gonna investigate this issue.
 
 Regards
 JB
 
 On 12/09/2014 08:23 PM, Paul Spencer wrote:
 JB,
 One way to reproduce this issue:
 - Start Karaf with bin/karaf
 - Dump the Heap Memory with a tool like jmap
 - Open a second command shell and execute the following command several 
 times:
$KARAF_HOME/bin/client -u karat instance:list
 - Dump the Heap Memory with a tool like jmap into a second output file
 - Compare the two files with the Eclipse Memory Analyzer
 
 Paul Spencer
 
 
 On Dec 9, 2014, at 12:52 PM, Jean-Baptiste Onofré j...@nanthrax.net 
 wrote:
 
 Can you try to session.close(false) just in case after the waitFor on the 
 channel ?
 
 Regards
 JB
 
 On 12/09/2014 06:46 PM, Paul Spencer wrote:
 I have a test case that connects to a Karaf 3.0.2 server via SSH to
 reset the environment prior to making WebService calls to the server.
 After upgrading from Karaf 2.3.4 I started noticing
 java.lang.OutOfMemoryError: Java heap space” errors.  In looking around
 I noticed 60,000+
 org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects
 in the HeapDump when the Karaf server had only run a few rounds of 
 testing.
 
 1) Although I have searched without finding a definitive answer, Is this
 a known issue?
 
 2) I am using the default Karaf 3.0.2 installation with cxf-jaxbws and
 some custom bundles.  In addition to the attached screen image from the
 Eclipse Memory Analyzer, what additional information should I provided?
 
 ***
 * Code to programmatically connect to Karaf via ssh and issue reset
 commands.
 ***
 String host = “localhost”;
 int port = 8101;
 String user = karaf;
 String password = karaf;
 
 SshClient client = null;
 String line = null;
 try {
 client = SshClient.setUpDefaultClient();
 client.start();
 ConnectFuture future = client.connect(user, host, port);
 future.await();
 ClientSession session = future.getSession();
 session.addPasswordIdentity(password);
 session.auth().verify();
 ClientChannel channel = session.createExecChannel(command);
 InputStream is = new FileInputStream(/dev/null);
 PipedInputStream pi = new PipedInputStream();
 PipedOutputStream po = new PipedOutputStream(pi);
 InputStreamReader isr = new InputStreamReader(pi);
 LineNumberReader lr = new LineNumberReader(isr);
 channel.setIn(is);
 channel.setOut(po);
 channel.setErr(System.err);
 channel.open();
 channel.waitFor(ClientChannel.CLOSED, 0);
 line = lr.readLine();
 
 lr.close();
 is.close();
 } catch (InterruptedException e) {
 e.printStackTrace();
 throw e;
 } catch (IOException e) {
 e.printStackTrace();
 throw e;
 } catch (Exception e) {
 e.printStackTrace();
 throw e;
 } finally {
 client.stop();
 }
 
 
 Paul Spencer
 
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com
 
 



Re: 60,000+ org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects in the HeapDump. Why?

2014-12-15 Thread Freeman Fang
FYI, I can reproduce it and create KARAF-3415[1] to track it, and I'm on it

[1]https://issues.apache.org/jira/browse/KARAF-3415
-
Freeman(Yue) Fang

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



On 2014-12-11, at 下午10:54, Paul Spencer wrote:

 JB,
 Have you been able to reproduce the issue?
 
 Paul Spencer
 
 
 On Dec 9, 2014, at 2:30 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote:
 
 Thanks Paul,
 
 I gonna investigate this issue.
 
 Regards
 JB
 
 On 12/09/2014 08:23 PM, Paul Spencer wrote:
 JB,
 One way to reproduce this issue:
 - Start Karaf with bin/karaf
 - Dump the Heap Memory with a tool like jmap
 - Open a second command shell and execute the following command several 
 times:
$KARAF_HOME/bin/client -u karat instance:list
 - Dump the Heap Memory with a tool like jmap into a second output file
 - Compare the two files with the Eclipse Memory Analyzer
 
 Paul Spencer
 
 
 On Dec 9, 2014, at 12:52 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote:
 
 Can you try to session.close(false) just in case after the waitFor on the 
 channel ?
 
 Regards
 JB
 
 On 12/09/2014 06:46 PM, Paul Spencer wrote:
 I have a test case that connects to a Karaf 3.0.2 server via SSH to
 reset the environment prior to making WebService calls to the server.
 After upgrading from Karaf 2.3.4 I started noticing
 java.lang.OutOfMemoryError: Java heap space” errors.  In looking around
 I noticed 60,000+
 org.apache.karaf.shell.security.impl.SecuredCommandProcessorImpl objects
 in the HeapDump when the Karaf server had only run a few rounds of 
 testing.
 
 1) Although I have searched without finding a definitive answer, Is this
 a known issue?
 
 2) I am using the default Karaf 3.0.2 installation with cxf-jaxbws and
 some custom bundles.  In addition to the attached screen image from the
 Eclipse Memory Analyzer, what additional information should I provided?
 
 ***
 * Code to programmatically connect to Karaf via ssh and issue reset
 commands.
 ***
 String host = “localhost”;
 int port = 8101;
 String user = karaf;
 String password = karaf;
 
 SshClient client = null;
 String line = null;
 try {
 client = SshClient.setUpDefaultClient();
 client.start();
 ConnectFuture future = client.connect(user, host, port);
 future.await();
 ClientSession session = future.getSession();
 session.addPasswordIdentity(password);
 session.auth().verify();
 ClientChannel channel = session.createExecChannel(command);
 InputStream is = new FileInputStream(/dev/null);
 PipedInputStream pi = new PipedInputStream();
 PipedOutputStream po = new PipedOutputStream(pi);
 InputStreamReader isr = new InputStreamReader(pi);
 LineNumberReader lr = new LineNumberReader(isr);
 channel.setIn(is);
 channel.setOut(po);
 channel.setErr(System.err);
 channel.open();
 channel.waitFor(ClientChannel.CLOSED, 0);
 line = lr.readLine();
 
 lr.close();
 is.close();
 } catch (InterruptedException e) {
 e.printStackTrace();
 throw e;
 } catch (IOException e) {
 e.printStackTrace();
 throw e;
 } catch (Exception e) {
 e.printStackTrace();
 throw e;
 } finally {
 client.stop();
 }
 
 
 Paul Spencer
 
 
 --
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com
 



Re: Karaf 3.0.x and Bouncy Castle

2014-11-23 Thread Freeman Fang
Hi,

Please take a look at [1] to get more details about how to add security 
providers for Karaf

[1]http://karaf.apache.org/manual/latest/users-guide/security.html
-
Freeman(Yue) Fang

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



On 2014-11-22, at 上午8:27, Richard Snowden wrote:

 I do some encryption stuff and use Bouncy Castle as the provider. In one of 
 my classes I do:
 
 static {
 Security.addProvider(new BouncyCastleProvider());
 }
 
 This works fine when running standalone - but when I deploy it to Karaf I get 
 (of course) an unresolved constraint exception.
 
 I can install Bouncy Castle via install mvn:org.bouncycastle/bcprov... - 
 but not sure if that's the correct way to do?
 



Re: ScopedProxyMode ClassCastException when starting the bundle

2014-10-30 Thread Freeman Fang
Hi,

This CCE error generally is caused by 
org.springframework.context.annotation.ScopedProxyMode was loaded by different 
classloaders, so you need check 
1. if you have multiple spring-context bundles in container
or
2. your customer bundle embed spring-context lib which isn't good practice in 
OSGi container
-
Freeman(Yue) Fang

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



On 2014-10-30, at 下午5:05, Srikanth Hugar wrote:

 I have a strange problem, bundle is not starting.
 This problem does not occur every time. It occurs some time and if i delete 
 the data folder and start again, it works sometime. And sometime it does not 
 work even if i delete data folder and start the karaf.
 
 Unexpected exception parsing XML document from URL 
 [bundle://187.0:0/META-INF/spring/connector-server.xml]; nested exception is 
 java.lang.ClassCastException: 
 org.springframework.context.annotation.ScopedProxyMode cannot be cast to 
 org.springframework.context.annotation.ScopedProxyMode
 
 What could be the issue?
 
 
 
 08:28:55.548 [SpringOsgiExtenderThread-12] ERROR 
 o.s.o.e.i.a.ContextLoaderListener - Application context refresh failed 
 (OsgiBundleXmlApplicationContext(bundle=connector-server, 
 config=osgibundle:/META-INF/spring/*.xml))
 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected 
 exception parsing XML document from URL 
 [bundle://187.0:0/META-INF/spring/connector-server.xml]; nested exception is 
 java.lang.ClassCastException: 
 org.springframework.context.annotation.ScopedProxyMode cannot be cast to 
 org.springframework.context.annotation.ScopedProxyMode
   at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
  ~[3.2.8.RELEASE-1.0.0-SNAPSHOT:na]
   at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
  ~[3.2.8.RELEASE-1.0.0-SNAPSHOT:na]
   at 
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
  ~[3.2.8.RELEASE-1.0.0-SNAPSHOT:na]
   at 
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
  ~[na:na]
   at 
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
  ~[na:na]
   at 
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
  ~[na:na]
   at 
 org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
  ~[1.2.1:1.2.1]
   at 
 org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
  ~[1.2.1:1.2.1]
   at 
 org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
  ~[na:na]
   at 
 org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
  ~[na:na]
   at 
 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
  [1.2.1:1.2.1]
   at 
 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
  ~[1.2.1:1.2.1]
   at 
 org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
  ~[na:na]
   at 
 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
  [1.2.1:1.2.1]
   at 
 org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
  [1.2.1:1.2.1]
   at 
 org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
  [1.2.1:1.2.1]
   at 
 org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
  [1.2.1:1.2.1]
   at 
 org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
  [1.2.1:1.2.1]
   at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
 Caused by: java.lang.ClassCastException: 
 org.springframework.context.annotation.ScopedProxyMode cannot be cast to 
 org.springframework.context.annotation.ScopedProxyMode
   at 
 org.springframework.context.annotation.AnnotationScopeMetadataResolver.resolveScopeMetadata(AnnotationScopeMetadataResolver.java:84)
  ~[na:na]
   

Re: Blueprint bean error on startup

2014-10-30 Thread Freeman Fang
Hi,

Are you sure BarImpl has a constructor with a single argument taking the Foo 
interface, your blueprint file doesn't match this.
-
Freeman(Yue) Fang

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



On 2014-10-30, at 下午4:32, Marcus Bond wrote:

 Hi,
 
 I have the following beans declared in a blueprint config and I am having 
 receiving error 
 org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to 
 find a matching constructor on class uk.co.marcusbond.FooImpl for arguments 
 [org.apache.aries.blueprint.container.BeanRecipe$UnwrapperedBeanHolder@169e5808]
 
 
 bean class=uk.co.marcusbond.BarImpl id=bar /
 
 bean class=uk.co.marcusbond.FooImpl id=foo
 argument ref=bar /
 /bean
 
 FooImpl implements interface Foo and BarImpl has a constructor with a single 
 argument taking the Foo interface (dependency on interface not 
 implementation) yet I get the above error and when listed the feature / 
 bundle is shown in state Failure.
 Another oddity is that this only happens on karaf startup, if I add a 
 bundle:watch and then rebuild the relevant bundle exactly the same the change 
 is picked up and the bundle installed correctly (Active). Is this a bug or a 
 problem with the configuration?
 
 Regards,
 Marcus.
 



Re: Missing requirement for org.apache.cxf.jaxrs.ext.multipart

2014-10-13 Thread Freeman Fang
Hi,

You should install cxf feature where have all CXF related bundles for you.
-
Freeman(Yue) Fang

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



On 2014-10-4, at 上午3:42, petertirrell wrote:

 I'm trying to implement a bundle to handle uploading files; I have a REST web
 service that I've created.  It was working successfully serving up files to
 download.  Now I'm trying to implement file uploading and it makes use of
 the org.apache.cxf.jaxrs.ext.multipart package.  Of course when I deployed
 my bundle I started getting a spew of this:
 
 /org.osgi.framework.BundleException: Unresolved constraint in bundle
 com.meritain.pbmfilestreamer [207]: Unable to resolve 207.11: missing
 requirement [207.11] osgi.wiring.package;
 ((osgi.wiring.package=org.apache.cxf.jaxrs.ext.multipart)(version=2.7.0)(!(version=3.0.0)))/
 
 Ok, so how can I make that package available to my bundle?  I tried manually
 installing the whole cxf-bundle-jaxrs maven dependency into Karaf since that
 includes the package I need, but that started down a rabbit hole of other
 needed dependencies.  Should the .ext pieces have been included as part of
 the cxf feature I installed into Karaf originally?
 
 At this point I'm unsure on how to resolve this dependency, any thoughts or
 help?  Thanks!
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Missing-requirement-for-org-apache-cxf-jaxrs-ext-multipart-tp4035630.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Adding a Web Interface for a Legacy OSGi application

2014-09-17 Thread Freeman Fang
Hi,

Actually no such standard approach, :-)

However your approach sounds good to me, that said, has a webservice facade and 
your legacy application as a backend
-
Freeman(Yue) Fang

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



On 2014-9-17, at 下午3:12, Richard Snowden wrote:

 Hi all,
 
  
 I have a question that is more of a general OSGi nature.
 
  
 For a legacy application, that’s already running in an OSGi container, I’d 
 like to provide a Web Service interface. 
 
 - At the moment this application uses some non-standard, socket-based 
 protocol. 
 
 - It’s all pretty monolithic – all in one big bundle.
 
  
 My first idea was to simply expose the functionality of this application as 
 an OSGi service and create a second bundle that consumes this OSGi service 
 and exposes it as a Web Service.
 
  
 Does that sound reasonable? Not sure what the standard-approach is for such 
 use cases.
 
  
 cheers,
 
 Richard
 



Re: How to config jmx ACL for javax.management.MBeanServer

2014-06-27 Thread Freeman Fang
Hi,

My comment inline
-
Freeman(Yue) Fang

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



On 2014-6-27, at 下午2:46, XiLai Dai wrote:

 Thanks Freeman.
  
 If I understand right the jmx credencial is mandatory when you try to invoke 
 an operation on karaf 3.x ?(but it’s optional on karaf 2.3.x?).
Yes for karaf 3.x. For Karaf 2.3.x, we don't introduce RBAC yet
  
 Now the jmx credencial exception disappeared on karaf 3.0.1 after I made 
 these changes:
  
 HashMapString, String[] env = new HashMapString, String[]();
 String[] credentials = new String[] { karaf, karaf };
 env.put(jmx.remote.credentials, credentials);
 JMXServiceURL url = new 
 JMXServiceURL(service:jmx:rmi://0.0.0.0:4/jndi/rmi://0.0.0.0:1099/karaf-root);
 JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
 MBeanServerConnection mbs = jmxc.getMBeanServerConnection();
 ObjectName name = ObjectName.getInstance(java.lang:type=OperatingSystem);
 AttributeList list = mbs.getAttributes(name, new String[] { SystemCpuLoad 
 });
  
 And don’t need to provide etc/ jmx.acl.java.lang.OperatingSystem.cfg anymore.
That's because there's a
* = admin
in etc/jmx.acl.cfg which will match all those JMX invocations which can't find 
more specific definition in ObjectName pattern acl configuration files
As you login in as karaf which is admin role, so you can do any invocation here.
  
 Regards.
 Xilai Dai
 From: Freeman Fang [mailto:freeman.f...@gmail.com] 
 Sent: Thursday, June 26, 2014 5:33 PM
 To: user@karaf.apache.org
 Subject: Re: How to config jmx ACL for javax.management.MBeanServer
  
 Hi,
  
 How you run this code?
  
 This error generally means you don't have correct credential in the 
 SecurityContext. Did you login in as Admin role?
 That's said, don't use the local process way to access the MBeanServer,  or 
 for the upcoming Karaf 3.0.2 you can  edit
 etc/jmx.acl.whitelist.cfg
 to 
 add
 java.lang.OperatingSystem=bypass
 which will totally bypass the RBAC check for the given ObjectName.
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
  
  
  
 On 2014-6-26, at 下午1:57, XiLai Dai wrote:
 
 
 Hi,
  
 With these codes running in the karaf 3.0.1:
  
 import java.lang.management.ManagementFactory;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 ……
 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = ObjectName.getInstance(java.lang:type=OperatingSystem);
 AttributeList list = mbs.getAttributes(name, new String[] { SystemCpuLoad 
 });
  
 And also created a ACL configuration file etc/ 
 jmx.acl.java.lang.OperatingSystem.cfg  (one line for enable access to all 
 attributes)
  
 * = admin
  
  
 But still got the SecurityException:
 karaf@root() Exception in thread Thread-49 java.lang.SecurityException: 
 Insufficient roles/credentials for operation
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleInvoke(KarafMBeanServerGuard.java:228)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleGetAttribute(KarafMBeanServerGuard.java:192)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleGetAttributes(KarafMBeanServerGuard.java:197)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.invoke(KarafMBeanServerGuard.java:65)
 at 
 org.apache.karaf.management.boot.KarafMBeanServerBuilder$MBeanInvocationHandler.invoke(KarafMBeanServerBuilde
 r.java:63)
  
 Any ideas?
  
 Regards.
 Xilai Dai
  



Re: How to config jmx ACL for javax.management.MBeanServer

2014-06-26 Thread Freeman Fang
Hi,

How you run this code?

This error generally means you don't have correct credential in the 
SecurityContext. Did you login in as Admin role?
That's said, don't use the local process way to access the MBeanServer,  or for 
the upcoming Karaf 3.0.2 you can  edit
etc/jmx.acl.whitelist.cfg
to 
add
java.lang.OperatingSystem=bypass
which will totally bypass the RBAC check for the given ObjectName.
-
Freeman(Yue) Fang

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



On 2014-6-26, at 下午1:57, XiLai Dai wrote:

 Hi,
  
 With these codes running in the karaf 3.0.1:
  
 import java.lang.management.ManagementFactory;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 ……
 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 ObjectName name = ObjectName.getInstance(java.lang:type=OperatingSystem);
 AttributeList list = mbs.getAttributes(name, new String[] { SystemCpuLoad 
 });
  
 And also created a ACL configuration file etc/ 
 jmx.acl.java.lang.OperatingSystem.cfg  (one line for enable access to all 
 attributes)
  
 * = admin
  
  
 But still got the SecurityException:
 karaf@root() Exception in thread Thread-49 java.lang.SecurityException: 
 Insufficient roles/credentials for operation
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleInvoke(KarafMBeanServerGuard.java:228)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleGetAttribute(KarafMBeanServerGuard.java:192)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.handleGetAttributes(KarafMBeanServerGuard.java:197)
 at 
 org.apache.karaf.management.KarafMBeanServerGuard.invoke(KarafMBeanServerGuard.java:65)
 at 
 org.apache.karaf.management.boot.KarafMBeanServerBuilder$MBeanInvocationHandler.invoke(KarafMBeanServerBuilde
 r.java:63)
  
 Any ideas?
  
 Regards.
 Xilai Dai



Re: Creating instances on dedicated IP addresses rather than varying the ports

2014-05-19 Thread Freeman Fang
yep, something wrong on the Karaf 3.x, but it works with Karaf 2.x, I'm on it
-
Freeman(Yue) Fang

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



On 2014-5-16, at 下午5:39, Jim Talbut wrote:

 Continuing this: 
 http://mail-archives.apache.org/mod_mbox/karaf-user/201402.mbox/browser
 
 Setting up an instance (olt) using karaf 3.0.1 and configuring a 
 default.interface as follows:
 etc/org.apache.karaf.shell.cfg:sshHost = ${default.interface}
 instances/olt/etc/custom.properties:default.interface=172.28.129.166
 instances/olt/etc/org.apache.karaf.management.cfg:serviceUrl
  
 =service:jmx:rmi://${default.interface}:${rmiServerPort}/jndi/rmi://${default.interface}:${rmiRegistryPort}/karaf-${karaf.name}
 instances/olt/etc/org.apache.karaf.shell.cfg:sshHost = ${default.interface}
 
 Results in:
 [root@srv-lon-ss1 apache-karaf]# netstat -anpt | grep 23728
 tcp0  0 :::1100 :::*LISTEN  23728/java
 tcp0  0 :::57334 :::*  LISTEN  23728/java
 tcp0  0 :::127.0.0.1:45751 :::* LISTEN  23728/java
 tcp0  0 :::5 :::*  LISTEN  23728/java
 tcp0  0 :::172.28.129.166:8102:::* LISTEN  23728/java
 
 So the ssh port is working correctly, but the JMX ports are not.
 
 This is in the bundle config for JMX:
 instances/olt/data/cache/bundle10/data/config/org/apache/karaf/management.config:serviceUrl=service:jmx:rmi://172.28.129.166:5/jndi/rmi://172.28.129.166:1100/karaf-olt
 
 The 45751 is listed in instances/olt/data/port, but I can't find any 
 reference to the 57334.
 If these are managed internally and I don't need to connect to them then I 
 guess I don't care what they are.
 
 So, how can I get the JMX ports to work on a single address?
 
 Thanks.
 
 Jim
 
 
 Jim



Re: Creating instances on dedicated IP addresses rather than varying the ports

2014-05-19 Thread Freeman Fang
Hi,

Fixed by KARAF-2989.
-
Freeman(Yue) Fang

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



On 2014-5-20, at 上午11:00, Freeman Fang wrote:

 yep, something wrong on the Karaf 3.x, but it works with Karaf 2.x, I'm on it
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 
 
 
 On 2014-5-16, at 下午5:39, Jim Talbut wrote:
 
 Continuing this: 
 http://mail-archives.apache.org/mod_mbox/karaf-user/201402.mbox/browser
 
 Setting up an instance (olt) using karaf 3.0.1 and configuring a 
 default.interface as follows:
 etc/org.apache.karaf.shell.cfg:sshHost = ${default.interface}
 instances/olt/etc/custom.properties:default.interface=172.28.129.166
 instances/olt/etc/org.apache.karaf.management.cfg:serviceUrl
  
 =service:jmx:rmi://${default.interface}:${rmiServerPort}/jndi/rmi://${default.interface}:${rmiRegistryPort}/karaf-${karaf.name}
 instances/olt/etc/org.apache.karaf.shell.cfg:sshHost = ${default.interface}
 
 Results in:
 [root@srv-lon-ss1 apache-karaf]# netstat -anpt | grep 23728
 tcp0  0 :::1100 :::*LISTEN  23728/java
 tcp0  0 :::57334 :::*  LISTEN  23728/java
 tcp0  0 :::127.0.0.1:45751 :::* LISTEN  23728/java
 tcp0  0 :::5 :::*  LISTEN  23728/java
 tcp0  0 :::172.28.129.166:8102:::* LISTEN  23728/java
 
 So the ssh port is working correctly, but the JMX ports are not.
 
 This is in the bundle config for JMX:
 instances/olt/data/cache/bundle10/data/config/org/apache/karaf/management.config:serviceUrl=service:jmx:rmi://172.28.129.166:5/jndi/rmi://172.28.129.166:1100/karaf-olt
 
 The 45751 is listed in instances/olt/data/port, but I can't find any 
 reference to the 57334.
 If these are managed internally and I don't need to connect to them then I 
 guess I don't care what they are.
 
 So, how can I get the JMX ports to work on a single address?
 
 Thanks.
 
 Jim
 
 
 Jim
 



Re: Not seeing services being exported via blueprint

2014-05-18 Thread Freeman Fang
Hi,

What's the output of la command?
What's your bundle status?
-
Freeman(Yue) Fang

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



On 2014-5-16, at 上午12:55, constv wrote:

 I have a bundle that should export references to shared services (in Karaf
 3.0.1) This used to work fine in my other applications. Everything seems
 fine: I have my blueprint XML file under /resources/OSGI-INF/blueprint.
 Here's the sample contents:
 
 blueprint default-activation=eager
 xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
 
 xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0;
 
cm:property-placeholder persistent-id=myConfigId
 update-strategy=reload
 
cm:default-properties
cm:property name=ds.oracle.connection.url
 value=jdbc:oracle:thin:@myhost:1521:SMTH/
cm:property name=ds.oracle.connection.username value=user/
cm:property name=ds.oracle.connection.driver
 value=oracle.jdbc.driver.OracleDriver/
cm:property name=ds.oracle.connection.password
 value=password/
/cm:default-properties
/cm:property-placeholder
 
 
 
 
bean id=oracleDataSource class=oracle.jdbc.pool.OracleDataSource
property name=URL value=${ds.oracle.connection.url}/
property name=user value=${ds.oracle.connection.username}/
property name=password value=${ds.oracle.connection.password}/
/bean
 
bean id=jdbcTemplate
 class=org.springframework.jdbc.core.JdbcTemplate
property name=dataSource ref=oracleDataSource/
/bean
bean id=someSharedDao
 class=com.mycompany.myapp.common.dataaccess.SomeDao
property name=jdbcTemplate ref=jdbcTemplate/
/bean
*service interface=com.mycompany.myapp.common.dataaccess.SomeDao
 ref=someSharedDao/*
 
... other similar bean definitions and exports...
 
 /blueprint
 
 
 
 In my Maven POM I am ensuring that the packages with the classes whose
 instances are to be shared are exported:
 
 plugin
groupIdorg.apache.felix/groupId
artifactIdmaven-bundle-plugin/artifactId
version${maven-bundle-plugin.version}/version
extensionstrue/extensions
 
configuration
instructions
 
 Bundle-SymbolicName${project.groupId}.${project.artifactId}/Bundle-SymbolicName
Import-Package
Import-Package
*
/Import-Package
/Import-Package
   DynamicImport-Package*/DynamicImport-Package
Export-Package
com.mycompany.myapp.common*,
 ... etc
 
/Export-Package
/instructions
/configuration
/plugin 
 
 All dependencies seem to be defined properly and installed in Karaf. The
 bundle deployes without errors, but I don't think that the blueprint context
 is being created for this bundle, I am not seeing any indication of that in
 the logs. i have never seen this before, it used to be fairly
 straightforward. 
 
 When I do the OSGi  ls command on the bundle, it renders nothing, so no
 beans are exported.
 
 What could cause the Blueprint XML files to be ignored?  I am positive that
 the config files are packaged within the bundle JARs - inside the JAR under
 \OSGI-INF\blueprint\ .  Any ideas?
 
 Thanks!
 
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Not-seeing-services-being-exported-via-blueprint-tp4033133.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: start levels for datasource files in deploy dir

2014-05-18 Thread Freeman Fang
Hi,

You just need use OSGi service pattern(normally osgi:service schema) for the 
JNDI name lookup in your spring context xml, please take a look at [1] to get 
more details.

[1]http://karaf.apache.org/manual/latest/users-guide/jndi.html
-
Freeman(Yue) Fang

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



On 2014-5-17, at 上午6:54, asookazian2 wrote:

 Also, at least in some of our cases, we are doing the JNDI lookup from Spring
 context xml.  thx.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/start-levels-for-datasource-files-in-deploy-dir-tp4033155p4033163.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: karaf using 100% cpu

2014-05-15 Thread Freeman Fang
Hi,

I remember that some old jetty version have bugs can cause 100% CPU usage when 
use SSL, are you use jetty with SSL(through Camel/CXF/Pax-WEB,whatnot)?

What's the jetty version in your container?
-
Freeman(Yue) Fang

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



On 2014-5-7, at 上午2:06, Laci Gaspar wrote:

 I'm off work now so I can tell you tomorrow if I have several objects per 
 queue name. 
 But yes, AMQ is installed in karaf, because in the beginning we used a broker 
 inside karaf. We don't do that anymore, but AMQ is still installed in karaf. 
 Regards, 
 Laci
 
 Am 06.05.2014 19:58 schrieb Jean-Baptiste Onofré j...@nanthrax.net:
 OK ;)
 
 I'm surprised that you have a lot of Object for queues. Especially do you 
 have a bunch of objects for the same queue name ?
 
 Do you install ActiveMQ in Karaf (using the ActiveMQ features) ?
 
 Regards
 JB
 
 On 05/06/2014 06:09 PM, Laci Gaspar wrote:
 Hi JB
 We're using AMQ 5.9
 
 Am 06.05.2014 18:02 schrieb Jean-Baptiste Onofré j...@nanthrax.net
 mailto:j...@nanthrax.net:
 
 Hi Laci,
 
 What's the version of ActiveMQ that you use ? If you use ActiveMQ
 5.7, there's a bug in the ConnectionFactory (it doesn't release
 correctly the session). Maybe it's your issue (but not fully sure).
 
 Regards
 JB
 
 On 05/06/2014 04:37 PM, Laci Gaspar wrote:
 
 Ok, after a little struggle, I installed jmxterm because I have
 only a
 terminal access to the host.
 Unfortunately I have no idea what to do now... no jmx experience.
 When I list the mbeans, I get TONS of entries representing my
 ActiveMQ
 queues.  Is that correct?
 
 Then, how can I find out which process uses most cpu?
 
 Thanks for your help.
 Laci
 
 
 On 06.05.2014 14:44, Achim Nierbeck wrote:
 
 Also, do you have some trace levels activated with your
 camel routes?
 This might also produce a high load :)
 But as Jamie already said, it's good to enable JMX
 Monitoring ... this
 way you also find out about the camel routes ;)
 
 regards, Achim
 
 
 2014-05-06 14:07 GMT+02:00 Jamie G.
 jamie.goody...@gmail.com mailto:jamie.goody...@gmail.com
 mailto:jamie.goodyear@gmail.__com
 mailto:jamie.goody...@gmail.com:
 
  Connect to the JMX management console and see what's
 running up
  the CPU.
 
  --Jamie
 
  On Tue, May 6, 2014 at 9:31 AM, Laci Gaspar
 laci...@gmail.com mailto:laci...@gmail.com
  mailto:laci...@gmail.com mailto:laci...@gmail.com
 wrote:
   Hi
   I noticed that our karaf runtime is using 100% CPU.
   We are running karaf version 2.2.6 with some camel
 routes. There
  is hardly
   any load.
  
   Looking at the log file with level DEBUG didn't
 reveal anything.
  
  
   What can I do to find out what's causing the high cpu
 load?
  
   Regards
   Laci
 
 
 
 
 --
 
 Apache Karaf 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/__
 
 Software Architect / Project Manager / Scrum Master
 
 
 
 --
 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: Waiting for dependent bundle

2014-03-27 Thread Freeman Fang
Hi,

Could you please elaborate how you define the dependency between REST Service 
and ServiceImpl bundles?
Using OSGi service? Using blueprint to refer the OSGi service?
-
Freeman(Yue) Fang

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



On 2014-3-26, at 下午8:07, Arun Manivannan wrote:

 This is a little embarrassing considering I have been meddling around with 
 Karaf for a while now.
 
 I have a service implementation bundle and a CXF-REST bundle. If I throw in 
 the REST bundle before the ServiceImpl bundle into my deploy folder, it waits 
 for the service bundle for a few seconds and then goes into a Failed state. 
 Obviously, all goes well if I do it in sequence - ServiceImpl first and REST 
 next. I wanted my REST service to wait forever until the ServiceImpl is 
 deployed (just like the rest of the OSGi bundles)
 
 My guess is that there is some place where I should be increasing the timeout 
 to wait forever. This guess is based on the fact that for a PaxExam test, I 
 should do so.
 
 @Inject
 @Filter(timeout = 30)
 BootFinished bootFinished;
 (source : KarafTestSupport.java)
 
 Am I looking at the wrong place or should I be looking at other places for 
 hints like Activator or Import/Export packages?
 
 My REST maven-bundle-plugin looks like this : 
 
 
 
 
 
 build
 
 plugins
 
 plugin
 
 groupIdorg.apache.felix/groupId
 
 artifactIdmaven-bundle-plugin/artifactId
 
 extensionstrue/extensions
 
 configuration
 
 instructions
 
 
 Bundle-SymbolicName${project.artifactId}/Bundle-SymbolicName
 
 Bundle-Version${project.version}/Bundle-Version
 
 Bundle-Activator.xxx
 .rest.Activator/Bundle-Activator
 
 Import-Package*/Import-Package
 
 /instructions
 
 /configuration
 
 /plugin
 
 /plugins
 
 /build
 
 
 
 I understand that deploying as a .kar file along with the the rest of the 
 libraries (I deploy the dependencies as a .kar) would solve it but I do not 
 want to do that for the REST and Impl bundles because of faster deployments 
 (and bandwidth sizes - I am on EC2).
 
 
 Cheers,
 Arun Manivannan
 



Re: bundle:refresh

2014-03-27 Thread Freeman Fang
Hi,

If a bundle(Let's say bundleA) isn't self-contained, which means other bundles 
depend on this bundle, then install bundleA won't take effect immediately, 
you do need refresh bundleA, this will cause all bundles depending on bundleA 
refresh(re-resolved) also, so that your changes in bundleA can take effect.

-
Freeman(Yue) Fang

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



On 2014-3-28, at 上午2:11, asookazian2 wrote:

 what is the purpose of the refresh command in Karaf 3.0.x?  What effect does
 it have on the bundle lifecycle?
 
 I have a WAB (mega bundle WAR) that I just re-built using mvn.  I run
 'update xxx'.  Do I need to run 'refresh xxx' as well?  Typically I update
 WAB bundle and halt Karaf and restart Karaf to effect changes.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/bundle-refresh-tp4032433.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: refresh causes ClassCastException in 3.0.0

2014-03-27 Thread Freeman Fang
Hi,

The solution here could be

1. simply eliminate multiple versions for 
com.nextgate.ms.component.adapter.listener.mm.impl.MMNotifyConfigurationImpl 
from your container

or 

2. correctly use use directive in OSGi headers so that the dependency chain 
could be resolved without any ambiguity so that only one version 
com.nextgate.ms.component.adapter.listener.mm.impl.MMNotifyConfigurationImpl 
would be used in your bundle 
-
Freeman(Yue) Fang

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



On 2014-3-28, at 上午2:48, asookazian2 wrote:

 Bundle is currently active.  we exec 'refresh xxx' for that bundle and start
 that bundle.  how to handle this as I've read the same class has been loaded
 by 2 different classloaders and thus the exception...
 
 Caused by: java.lang.ClassCastException:
 com.nextgate.ms.component.adapter.listener.mm.impl.MMNotifyConfigurationImpl
 cannot be cast to
 com.nextgate.ms.component.adapter.listener.mm.impl.MMNotifyConfigurationImpl
at
 com.nextgate.ms.component.adapter.listener.mm.routes.MMNotifyRouteBuilder.refreshRoutes(MMNotifyRouteBuilder.java:110)
at
 com.nextgate.ms.component.adapter.listener.mm.routes.MMNotifyRouteBuilder.configure(MMNotifyRouteBuilder.java:103)
at
 org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)
at
 org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)
at
 org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)
at
 org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:669)
at
 com.nextgate.ms.bundlelib.interfaces.NGMSBundleActivator.startup(NGMSBundleActivator.java:80)
at
 com.nextgate.ms.component.adapter.listener.mm.routes.Activator.start(Activator.java:44)
at
 org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
... 40 more
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/refresh-causes-ClassCastException-in-3-0-0-tp4032437.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Not able to reinstall custom feature in karaf 3.0.0

2014-03-20 Thread Freeman Fang
Hi,

This is caused by you have multiple version of
com.fasterxml.jackson.core.jackson-databind
in your container, but some bundle's OSGi metadata header isn't so accurate, 
generally not use correct use directive which can cause this  two dependency 
chains when refresh bundles(features:install can cause it), the most simple 
solution now is remove one com.fasterxml.jackson.core.jackson-databind bundle
-
Freeman(Yue) Fang

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



On 2014-3-20, at 下午4:51, Sebastian Heib wrote:

 Hello,
 
 we have grouped some of our bundles with their dependencies into a
 custom feature.
 
 Now if we install this feature in an empty karaf (3.0.0), everything
 works as expected.
 
 But in case we want to update that feature (feature:uninstall/
 feature:install), this fails with the following error:
 
 
 Refreshing bundles org.springframework.web.servlet (124), 
 org.springframework.web (123)
 Error executing command: Could not start bundle 
 mvn:org.springframework.hateoas/spring-hateoas/0.8.0.RELEASE in feature(s) 
 customFeature-1.0.0-SNAPSHOT: Uses constraint violation. Unable to resolve 
 bundle revision org.springframework.hateoas [221.0] because it is exposed to 
 package 'com.fasterxml.jackson.databind' from bundle revisions 
 com.fasterxml.jackson.core.jackson-databind [218.0] and 
 com.fasterxml.jackson.core.jackson-databind [201.0] via two dependency chains.
 
 Chain 1:
  org.springframework.hateoas [221.0]
import: 
 ((osgi.wiring.package=com.fasterxml.jackson.databind)(version=2.2.0)(!(version=3.0.0)))
 |
export: osgi.wiring.package=com.fasterxml.jackson.databind
  com.fasterxml.jackson.core.jackson-databind [218.0]
 
 Chain 2:
  org.springframework.hateoas [221.0]
import: 
 ((osgi.wiring.package=org.springframework.http.converter.json)(version=3.2.3)(!(version=4.0.0)))
 |
export: osgi.wiring.package=org.springframework.http.converter.json; 
 uses:=com.fasterxml.jackson.databind
  org.springframework.web [123.0]
import: 
 ((osgi.wiring.package=com.fasterxml.jackson.databind)(version=2.0.0)(!(version=3.0.0)))
 |
export: osgi.wiring.package=com.fasterxml.jackson.databind
  com.fasterxml.jackson.core.jackson-databind [201.0]
 
 
 I also tried to install/ reinstall the feature with the -v switch, to
 see what bundles are installed. The list is just the same, only that the
 messages are different (which are Found installed bundle in case the
 install command is run in the empty karaf, and Installing bundle in
 case the feature is reinstalled - for me those LOG messages sound like
 they are interchanged).
 
 As I can't see any differences: why is karaf behaving this way? Why does
 our feature install in an empty karaf, but we are not able to update it
 (even if it is exactly the same feature)?
 
 
 Here is our feature.xml:
 
 features name=customFeature-${project.version}
 xmlns=http://karaf.apache.org/xmlns/features/v1.0.0;
 
feature name=customFeature version=${project.version}
 resolver=(obr) description=...
details.../details
 
!-- thirdparty features --
featurewar/feature
featurespring-dm/feature
featurespring-dm-web/feature
feature version=3.2.4.RELEASEspring/feature
 
featurecxf/feature
 
!-- thirdparty bundles --
bundlemvn:com.fasterxml.jackson.core/jackson-core/2.2.2/bundle
 
 bundlemvn:com.fasterxml.jackson.core/jackson-databind/2.2.2/bundle
 
 bundlemvn:com.fasterxml.jackson.core/jackson-annotations/2.2.2/bundle
 
bundlemvn:org.objenesis/objenesis/1.3/bundle
 
 bundlemvn:org.springframework.hateoas/spring-hateoas/0.8.0.RELEASE/bundle
 
bundlemvn:net.minidev/json-smart/1.2/bundle
bundlemvn:com.jayway.jsonpath/json-path/0.9.1/bundle
 
bundlemvn:com.sun.jersey/jersey-core/1.12/bundle
bundlemvn:com.sun.jersey/jersey-server/1.12/bundle
bundlemvn:javax.ws.rs/jsr311-api/1.1.1/bundle
bundlemvn:com.sun.jersey/jersey-json/1.12/bundle
bundlemvn:org.codehaus.jackson/jackson-core-asl/1.9.5/bundle
bundlemvn:org.codehaus.jackson/jackson-jaxrs/1.9.5/bundle
bundlemvn:org.codehaus.jackson/jackson-mapper-asl/1.9.5/bundle
 
!-- app --
bundlemvn:anApiBundle/1.0.0-SNAPSHOT/bundle
 
 bundlemvn:aBundleProvidingAnImplementationForTheApi/1.0.0-SNAPSHOT/bundle
bundlemvn:aRESTBundle/1.0.0-SNAPSHOT/war/bundle
/feature
 
 /features
 
 -- 
 /**
 * Sebastian Heib
 * Senior Developer
 *
 * synyx GmbH  Co. KG
 * Open Source Solutions
 * Karlstr. 68
 * 76137 Karlsruhe
 *
 * Telefon  +49 721 203823-44
 * Fax  +49 721 203823-12
 * E-Mail   h...@synyx.de
 * Web  http://www.synyx.de
 * Blog http://blog.synyx.de
 *
 * Sitz der Gesellschaft: Karlsruhe
 * Registergericht: Mannheim
 * Handelsregisternummer: HRA 104793
 * USt-IdNr.: DE249264296
 *
 * Komplementärin: synyx Verwaltung GmbH
 * Sitz der Gesellschaft: Karlsruhe
 * Geschäftsführer:
 * Thomas Kraft, Markus 

Re: Feature validation did not use jre properties?

2014-03-20 Thread Freeman Fang
Hi,

Is there any bundle in your feature Import-Package javax.xml.bind* not 
compatible with the one exported by config.properties? What's it like? You may 
need change your bundle OSGi header accordingly.
As the features-maven-plugin:validation is to validate the feature can deploy 
into Karaf correctly so we need keep it same as the karaf configuration
-
Freeman(Yue) Fang

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



On 2014-3-20, at 下午9:42, SvS wrote:

 Hi JB,
 
 I remove in the config.properties (used by the
 maven-feature-plugin:validation) the version. Is that correct?
 
 From:
 javax.xml.bind;version=2.2.1, \
 javax.xml.bind.annotation;version=2.2.1, \
 
 To:
 javax.xml.bind, \
 javax.xml.bind.annotation, \
 
 Regards,
 Sam.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Feature-validation-did-not-use-jre-properties-tp4032170p4032357.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: using version=0 in Import-Package

2014-03-19 Thread Freeman Fang
Hi,

Per the OSGi spec, the version=0 here means version=[0, infinite), actually 
it's default version range so you needn't explicitly have it.

About the JDBC driver classname issue, I believe you run into a problem 
explained here[1], please take a look

[1]http://freemanfang.blogspot.com/2012/03/how-to-use-jdbc-driver-in-osgi.html
-
Freeman(Yue) Fang

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



On 2014-3-20, at 上午1:01, asookazian2 wrote:

 what does version=0 mean/do?
 
 Import-Packagecom.mysql.jdbc;resolution:=optional;version=0/Import-Package
 
 Also, I have optional JARs b/c we're not sure which RDBMS vendor the client
 will be using.  But I want maven-bundle-plugin to resolve all the other
 dependencies in Import-Package for me.  How do I write this?  thx.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/using-version-0-in-Import-Package-tp4032333.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Feature validation did not use jre properties?

2014-03-12 Thread Freeman Fang
Hi, 

Yeah, please create a jira, the config.properties in features-maven-plugin is 
out-of-data
-
Freeman(Yue) Fang

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



On 2014-3-12, at 下午5:59, SvS wrote:

 Hi,
 
 Thank all for the reactions!
 
 Indeed, but my assumption was that the default would be good for me. But the
 default config contains only jre-1.5.
 
 Also, the following go wrong:
 Bundle contains:
  Import-Package: javax.xml.bind ...
 jre.properties contains:
  javax.xml.bind, version = 2.2.1, \
  javax.xml.bind.annotation, version = 2.2.1, \
 
 This results in a validation error, but runtime (in Karaf) there is no
 problem.
 
 Shall I create a JIRA issue for both?
 
 Regards,
 Sam.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Feature-validation-did-not-use-jre-properties-tp4032170p4032209.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Feature validation did not use jre properties?

2014-03-11 Thread Freeman Fang
Hi,

For the validation mojo, you can specify a karafConfig configuration for the 
plugin, where you can include the jre.properties

see the related code

/**
 * Karaf config.properties
 *
 * @parameter default-value=config.properties
 */
private String karafConfig;
-
Freeman(Yue) Fang

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



On 2014-3-12, at 上午12:23, SvS wrote:

 Hi JB,
 
 Yes, validation with the feature-maven-plugin.
 
 Regards,
 Sam.
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Feature-validation-did-not-use-jre-properties-tp4032170p4032183.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: How do I configure the features-maven-plugin version 2.3.2 to include dependent features?

2014-03-06 Thread Freeman Fang
: org.codehaus.woodstox:stax2-api:jar:3.1.1
[INFO] Copying bundle: org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0
[INFO] Copying bundle: 
org.apache.servicemix.specs:org.apache.servicemix.specs.jsr339-api-m10:jar:2.2.0
[INFO] Copying bundle: org.apache.cxf:cxf-rt-bindings-xml:jar:2.7.6
[INFO] Copying bundle: org.eclipse.jetty:jetty-servlet:jar:7.6.9.v20130131
[INFO] Copying bundle: org.apache.cxf.karaf:cxf-karaf-commands:jar:2.7.6
[INFO] Copying bundle: org.eclipse.jetty:jetty-continuation:jar:7.6.9.v20130131
[INFO] Copying bundle: org.ops4j.pax.web:pax-web-api:jar:1.1.16
[INFO] Copying bundle: 
org.apache.servicemix.bundles:org.apache.servicemix.bundles.jaxb-xjc:jar:2.2.1.1_2
-
Freeman(Yue) Fang

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



On 2014-3-5, at 下午9:07, Paul Spencer wrote:

 Below is from the pom that fails to include the dependent feature 
 http-whiteboard. The feature is a dependency of cxf-jaxws.
 
  plugin
 groupIdorg.apache.karaf.tooling/groupId
artifactIdfeatures-maven-plugin/artifactId
version2.3.2/version
 
executions
   execution
  idadd-features-to-repo/id
  phasegenerate-resources/phase
  goals
 goaladd-features-to-repo/goal
  /goals
  configuration
  descriptors
 !--  Feature Descriptor Files --
 descriptor
mvn:org.apache.cxf.karaf/apache-cxf/2.7.6/xml/features
 /descriptor 
  /descriptors
  features
 !--  Features to add to offline respository --
 featurehttp/feature
 featurecxf-jaxws/feature
  /features
  repositorytarget/offline-repository/repository
  karafVersion2.3.4/karafVersion
  /configuration
  /execution
/executions
  /plugin
 
 Paul Spencer
 
 On Mar 4, 2014, at 10:33 PM, Freeman Fang freeman.f...@gmail.com wrote:
 
 Hi,
 
 By default it will have all dependent features included, what's the exact 
 problem you encounter?
 If your features.xml have multiple cxf version, you may encounter a issue[1] 
 get fixed very recently
 [1]https://issues.apache.org/jira/browse/KARAF-2791
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 
 
 
 On 2014-3-5, at 上午4:07, Paul Spencer wrote:
 
 How do I configure the features-maven-plugin version 2.3.2 to include 
 dependent features?
 
 As an example, I have include the jax-ws feature which depends on 
 http-whiteboard.  I would like to have all dependent features includes, or 
 be notified of dependent features that are not included.
 
 karaf@root features:info cxf-jaxws
 Description of cxf-jaxws 2.7.10 feature
 
 Feature has no configuration
 Feature has no configuration files
 Feature depends on:
 cxf-core 2.7.10
 cxf-databinding-jaxb 2.7.10
 cxf-bindings-soap 2.7.10
 cxf-http 2.7.10
 Feature contains followed bundles:
 mvn:org.apache.cxf/cxf-rt-frontend-simple/2.7.10 start-level=40
 mvn:org.apache.cxf/cxf-rt-frontend-jaxws/2.7.10 start-level=40
 
 karaf@root features:info cxf-http
 Description of cxf-http 2.7.10 feature
 
 Feature has no configuration
 Feature has no configuration files
 Feature depends on:
 cxf-core 2.7.10
 http-whiteboard [2,4)
 Feature contains followed bundles:
 mvn:org.apache.cxf/cxf-rt-transports-http/2.7.10 start-level=40
 
 
 Paul Spencer
 
 
 



Re: How do I configure the features-maven-plugin version 2.3.2 to include dependent features?

2014-03-04 Thread Freeman Fang
Hi,

By default it will have all dependent features included, what's the exact 
problem you encounter?
If your features.xml have multiple cxf version, you may encounter a issue[1] 
get fixed very recently
[1]https://issues.apache.org/jira/browse/KARAF-2791
-
Freeman(Yue) Fang

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



On 2014-3-5, at 上午4:07, Paul Spencer wrote:

 How do I configure the features-maven-plugin version 2.3.2 to include 
 dependent features?
 
 As an example, I have include the jax-ws feature which depends on 
 http-whiteboard.  I would like to have all dependent features includes, or be 
 notified of dependent features that are not included.
 
 karaf@root features:info cxf-jaxws
 Description of cxf-jaxws 2.7.10 feature
 
 Feature has no configuration
 Feature has no configuration files
 Feature depends on:
  cxf-core 2.7.10
  cxf-databinding-jaxb 2.7.10
  cxf-bindings-soap 2.7.10
  cxf-http 2.7.10
 Feature contains followed bundles:
 mvn:org.apache.cxf/cxf-rt-frontend-simple/2.7.10 start-level=40
 mvn:org.apache.cxf/cxf-rt-frontend-jaxws/2.7.10 start-level=40
 
 karaf@root features:info cxf-http
 Description of cxf-http 2.7.10 feature
 
 Feature has no configuration
 Feature has no configuration files
 Feature depends on:
  cxf-core 2.7.10
  http-whiteboard [2,4)
 Feature contains followed bundles:
 mvn:org.apache.cxf/cxf-rt-transports-http/2.7.10 start-level=40
 
 
 Paul Spencer
 



Re: Problem installing cxf WebService

2014-02-12 Thread Freeman Fang
Hi,

Could you please edit 
$KARAF_HOME/etc/jre.properties
change
javax.jws, \
 javax.jws.soap, \
to
javax.jws;version=2.0, \
 javax.jws.soap;version=2.0, \

and cleanly restart karaf?


-
Freeman(Yue) Fang

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



On 2014-2-12, at 下午5:41, Laci Gaspar wrote:

 Hi
 I'm having a problem installing a CXF WebService. I'm getting an unresolved 
 constraint error:
 
 starting bundle: 
 file:/C:/Users/kit/apache-karaf-2.3.3/deploy/cxf-code-first-bundle-1.0-SNAPSHOT.jar
 org.osgi.framework.BundleException: Unresolved constraint in bundle 
 cxf-code-first-bundle [186]: Unable to resolve 186.0: missing requirement 
 [186.0] osgi.wiring.package; ((osgi.wiri
 ng.package=javax.jws)(version=2.0.0)(!(version=3.0.0)))
at 
 org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.framework.Felix.startBundle(Felix.java:1868)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[6:org.apache.felix.fileinstall:3.2.6]
 
 
 I tried several examples on the web, no luck.
 
 Thanks for your help
 Laci



Re: Problem installing cxf WebService

2014-02-12 Thread Freeman Fang
Sorry, actually you should install
mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3
bundle which can export javax.jws 2.0

Btw, I think you should install features.xml from cxf and features:install 
cxf which will offer you all necessary bundles when you work on cxf related 
projects
-
Freeman(Yue) Fang

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



On 2014-2-12, at 下午6:58, Freeman Fang wrote:

 Hi,
 
 Could you please edit 
 $KARAF_HOME/etc/jre.properties
 change
 javax.jws, \
  javax.jws.soap, \
 to
 javax.jws;version=2.0, \
  javax.jws.soap;version=2.0, \
 
 and cleanly restart karaf?
 
 
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 
 
 
 On 2014-2-12, at 下午5:41, Laci Gaspar wrote:
 
 Hi
 I'm having a problem installing a CXF WebService. I'm getting an unresolved 
 constraint error:
 
 starting bundle: 
 file:/C:/Users/kit/apache-karaf-2.3.3/deploy/cxf-code-first-bundle-1.0-SNAPSHOT.jar
 org.osgi.framework.BundleException: Unresolved constraint in bundle 
 cxf-code-first-bundle [186]: Unable to resolve 186.0: missing requirement 
 [186.0] osgi.wiring.package; ((osgi.wiri
 ng.package=javax.jws)(version=2.0.0)(!(version=3.0.0)))
at 
 org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.framework.Felix.startBundle(Felix.java:1868)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)[org.apache.felix.framework-4.0.3.jar:]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[6:org.apache.felix.fileinstall:3.2.6]
at 
 org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[6:org.apache.felix.fileinstall:3.2.6]
 
 
 I tried several examples on the web, no luck.
 
 Thanks for your help
 Laci
 



Re: How to connect Jetty JMX MBeans when running in Karaf?

2014-01-20 Thread Freeman Fang
Hi,

The jetty.xml configuration to enable jetty MBean should be like

!-- === --
New id=MBeanContainer class=org.eclipse.jetty.jmx.MBeanContainer
Arg
Ref id=MBeanServer /
/Arg
/New

!-- Add to the Server to listen for object events --
Get id=Container name=container
Call name=addEventListener
Arg
Ref id=MBeanContainer /
/Arg
/Call
/Get

!-- Add to the Server as a lifecycle --
!-- Only do this if you know you will only have a single jetty server --
Call name=addBean
Arg
Ref id=MBeanContainer /
/Arg
/Call

!-- Add the static log --
Get id=Logger class=org.eclipse.jetty.util.log.Log name=log /
Ref id=MBeanContainer
Call name=addBean
Arg
Ref id=Logger /
/Arg
/Call
/Ref

With this, you can see the jetty mbeans, however, some MBeans miss 
attribute/operation. This is caused by jetty have *mbean.properties in 
different modules which make it very hard to be used in OSGi container, here is 
a jetty issue[1] tracked it and fixed for Jetty 9. As a workaround for know, 
need collect all *mbean.properties from different jetty modules and jar it, 
then put this jar in Karaf bootloader. 

[1]http://jira.codehaus.org/browse/JETTY-1514



-
Freeman(Yue) Fang

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



On 2014-1-18, at 上午7:48, toomanyedwards wrote:

 Hi all,
  We are attempting to configure JMX monitoring for the Jetty instance (used
 by cxf) embedded in Karaf.  I have edited the jetty.xml as shown below and
 can connect to Karaf via jconsole BUT I don't see the Jetty MBeans.  Any
 guidance is appreciated.  Is there a better way to monitor the embedded
 Jetty?  Thanks!
 
 -e
 
 
 Jetty.xml:
 
 Call id=MBeanServer class=java.lang.management.ManagementFactory
 name=getPlatformBeanServer/
 
New id=MBeanContainer
 class=org.eclipse.jetty.jmx.MBeanContainer
Arg
Ref id=MBeanServer/
/Arg
/New
 
Get id=Container name=container
Call name=addEventListener
Ref id=MBeanContainer/
/Call
/Get
 ...
 
 -e
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/How-to-connect-Jetty-JMX-MBeans-when-running-in-Karaf-tp4031171.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: karaf 2.3.3 java.io.IOException: Pipe closed

2014-01-08 Thread Freeman Fang
Hi,

Servicemix wrap quartz as OSGi bundle, how about you use the one from 
servicemix[1].

something like
install -s 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.quartz/1.8.6_1
-
Freeman(Yue) Fang

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



On 2014-1-8, at 下午5:33, simafengyun1984 wrote:

 Hi JB,
 
 when I try to deploy the quartz-1.8.5.jar to karaf 2.3.3
 It always shows the below exception.
 
 
 2014-01-08 17:04:49,276 | INFO  | raf-2.3.3/deploy | fileinstall  

 | ?   ? | 6 - org.apache.felix.fileinstall -
 3.2.6 | Started bundle:
 wrap:file:/C:/work/softtools/Karaf%20cluster/apache-karaf-2.3.3/deploy/quartz-2.0.0.jar$Bundle-SymbolicName=quartzBundle-Version=2.0.0

 2014-01-08 17:04:50,199 | WARN  | Thread-15| BndUtils 

 | ps4j.pax.swissbox.bnd.BndUtils$1  178 | 2 - org.ops4j.pax.url.wrap - 1.3.6
 | Bundle cannot be generated  
 
 java.io.IOException: Pipe closed  
 
at
 java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:244)[:1.6.0_37]

at
 java.io.PipedInputStream.receive(PipedInputStream.java:210)[:1.6.0_37]
 
at
 java.io.PipedOutputStream.write(PipedOutputStream.java:132)[:1.6.0_37]
 
at
 java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:155)[:1.6.0_37]
   
at
 java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:196)[:1.6.0_37] 
 
at
 aQute.lib.osgi.Jar.writeResource(Jar.java:305)[2:org.ops4j.pax.url.wrap:1.3.6]
 
at
 aQute.lib.osgi.Jar.write(Jar.java:211)[2:org.ops4j.pax.url.wrap:1.3.6]
 
at
 org.ops4j.pax.swissbox.bnd.BndUtils$1.run(BndUtils.java:174)[2:org.ops4j.pax.url.wrap:1.3.6]
   
 
 
 
 I check the MANIFEST.MF in the jar file. the content as below
 *Manifest-Version: 1.0
 Archiver-Version: Plexus Archiver
 Created-By: Apache Maven
 Built-By: cruise
 Build-Jdk: 1.6.0_24*
 
 apparently it is not a standard bundle MANIFEST.MF file. 
 *Is the issue caused by the MANIFEST.MF file? Is any solution to fix this?
 *   
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/karaf-2-3-3-java-io-IOException-Pipe-closed-tp4030932.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: karaf 3.0 : hibernate 4 feature

2014-01-03 Thread Freeman Fang
Though it's a very useful feature, I'm not sure if we can add it in Karaf, as 
Hibernate is under LGPL license, can we?
-
Freeman(Yue) Fang

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



On 2014-1-3, at 下午6:19, Jean-Baptiste Onofré wrote:

 +1
 
 I'm adding it (I create the Jira).
 
 Thanks for the contribution.
 
 Regards
 JB
 
 On 01/03/2014 11:04 AM, lbu wrote:
 Hi,
 here you can find a feature for Hibernate 4:
 
 feature name=hibernate4 version=4.2.7.Final description=Hibernate4 JPA
 persistence engine support
 detailsEnable Hibernate4 as persistence engine./details
 featuretransaction/feature
 featurejpa/feature
 featurehttp/feature
 bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5/bundle
 bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.8.2_2/bundle
 bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5/bundle
 bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle
 bundle dependency=truemvn:com.fasterxml/classmate/0.9.0/bundle
 bundle dependency=truemvn:org.javassist/javassist/3.18.1-GA/bundle
 bundle
 dependency=truemvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final/bundle
 bundle dependency=truewrap:mvn:org.jboss/jandex/1.1.0.Final/bundle
 bundle
 dependency=truemvn:org.jboss.logging/jboss-logging/3.1.4.GA/bundle
 bundle
 dependency=truemvn:org.hibernate.common/hibernate-commons-annotations/4.0.4.Final/bundle
 bundlemvn:org.hibernate/hibernate-core/4.2.7.Final/bundle
 bundlemvn:org.hibernate/hibernate-entitymanager/4.2.7.Final/bundle
 bundlemvn:org.hibernate/hibernate-envers/4.2.7.Final/bundle
 bundlemvn:org.hibernate/hibernate-osgi/4.2.7.Final/bundle
 /feature
 
 Do you think it can be added to karaf's enterprise features?
 
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/karaf-3-0-hibernate-4-feature-tp4030887.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: karaf 3.0 : hibernate 4 feature

2014-01-03 Thread Freeman Fang
Thanks JB!
-
Freeman(Yue) Fang

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



On 2014-1-3, at 下午6:51, Jean-Baptiste Onofré wrote:

 LGPL is category B (not X), so we can reference it but not include it: it's 
 what we do.
 
 FYI, in Karaf 3.0.0, I've already added a hibernate feature.
 
 Regards
 JB
 
 On 01/03/2014 11:46 AM, Freeman Fang wrote:
 Though it's a very useful feature, I'm not sure if we can add it in
 Karaf, as Hibernate is under LGPL license, can we?
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 
 
 
 On 2014-1-3, at 下午6:19, Jean-Baptiste Onofré wrote:
 
 +1
 
 I'm adding it (I create the Jira).
 
 Thanks for the contribution.
 
 Regards
 JB
 
 On 01/03/2014 11:04 AM, lbu wrote:
 Hi,
 here you can find a feature for Hibernate 4:
 
 feature name=hibernate4 version=4.2.7.Final
 description=Hibernate4 JPA
 persistence engine support
detailsEnable Hibernate4 as persistence engine./details
featuretransaction/feature
featurejpa/feature
featurehttp/feature
bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5/bundle
bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.8.2_2/bundle
bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5/bundle
bundle
 dependency=truemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle
bundle dependency=truemvn:com.fasterxml/classmate/0.9.0/bundle
bundle
 dependency=truemvn:org.javassist/javassist/3.18.1-GA/bundle
bundle
 dependency=truemvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final/bundle
bundle
 dependency=truewrap:mvn:org.jboss/jandex/1.1.0.Final/bundle
bundle
 dependency=truemvn:org.jboss.logging/jboss-logging/3.1.4.GA/bundle
bundle
 dependency=truemvn:org.hibernate.common/hibernate-commons-annotations/4.0.4.Final/bundle
bundlemvn:org.hibernate/hibernate-core/4.2.7.Final/bundle
bundlemvn:org.hibernate/hibernate-entitymanager/4.2.7.Final/bundle
bundlemvn:org.hibernate/hibernate-envers/4.2.7.Final/bundle
bundlemvn:org.hibernate/hibernate-osgi/4.2.7.Final/bundle
 /feature
 
 Do you think it can be added to karaf's enterprise features?
 
 
 
 
 
 --
 View this message in context:
 http://karaf.922171.n3.nabble.com/karaf-3-0-hibernate-4-feature-tp4030887.html
 Sent from the Karaf - User mailing list archive at Nabble.com
 http://Nabble.com.
 
 
 --
 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: fail to install openejb-core on Karaf v3.0

2014-01-01 Thread Freeman Fang
Hi,

Karaf export javax.xml.namespace package from system bundle with no version. 
And I'd say org.apache.geronimo.specs.geronimo-jaxb_2.2_spec bundle import  
javax.xml.namespace with version 1.0 is kind of bug, should be addressed from 
geronimo side, there's already a similar jira ticket on geronimo side[1] to fix 
stax-api, probably need another one to fix the 
org.apache.geronimo.specs.geronimo-jaxb_2.2_spec.

Btw, servicemix also provide a jaxb-api-2.2 spec bundle, you may wanna use this 
one.

[1]https://issues.apache.org/jira/browse/GERONIMO-5848
-
Freeman(Yue) Fang

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



On 2014-1-2, at 上午11:30, Tom Leung wrote:

 Dear all,
  
 I started a new Karaf v3.0 instance on Ubuntu v13.04, use the default setting 
 and install the following bundles/features:
  
 feature:install war
 feature:install webconsole
 feature:repo-add openejb 4.5.2
  
 karaf@root() feature:list | grep openejb
 org.apache.commons| 0.0.0|   | 
 openejb-features|  
 xbean | 3.12 |   | 
 openejb-features|  
 org.apache.openwebbeans   | 1.1.8|   | 
 openejb-features|   
 geronimo-osgi | 1.1  |   | 
 openejb-features|  
 org.apache.activemq   | 5.7.0|   | 
 openejb-features|   
 openjpa   | 2.2.0|   | 
 openejb-features|  
 openejb-core  | 4.5.2|   | 
 openejb-features|  
 openejb-server| 4.5.2|   | 
 openejb-features|  
 openejb-cxf   | 4.5.2|   | 
 openejb-features|  
 openejb-rest  | 4.5.2|   | 
 openejb-features|  
 openejb-soap  | 4.5.2|   | 
 openejb-features|  
 karaf@root()
  
 feature:install openejb-core
  
 but, I get the following error:
  
 karaf@root() feature:install openejb-core
 Refreshing bundles 
 org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec (130), 
 org.apache.geronimo.specs.geronimo-jaspic_1.0_spec (84), 
 org.apache.geronimo.specs.geronimo-validation_1.0_spec (242)
 Error executing command: Could not start bundle 
 mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.1 in feature(s) 
 javaee-api-6.0-5: Unresolved constraint in bundle 
 org.apache.geronimo.specs.geronimo-jaxb_2.2_spec [260]: Unable to resolve 
 260.0: missing requirement [260.0] osgi.wiring.package; 
 ((osgi.wiring.package=javax.xml.namespace)(version=1.0.0))
 karaf@root()
  
 javax.xml.namespace is missing.
  
 Which bundle I should install to resolve the missing dependencies?
  
 Best Rgds,
  
 Tom
  



Re: fail to install openejb-core on Karaf v3.0

2014-01-01 Thread Freeman Fang
yep, that's a workaround.
-
Freeman(Yue) Fang

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



On 2014-1-2, at 下午2:42, Krzysztof Sobkowiak wrote:

 Hi
 
 I have added ;version=1.0.0 for javax.xml.namespace in jre.properties. It 
 worked for me too.
 
 Best regards
 Krzysztof
 
 On 02.01.2014 06:41, Freeman Fang wrote:
 Hi,
 
 Karaf export javax.xml.namespace package from system bundle with no version. 
 And I'd say org.apache.geronimo.specs.geronimo-jaxb_2.2_spec bundle import  
 javax.xml.namespace with version 1.0 is kind of bug, should be addressed 
 from geronimo side, there's already a similar jira ticket on geronimo 
 side[1] to fix stax-api, probably need another one to fix the 
 org.apache.geronimo.specs.geronimo-jaxb_2.2_spec.
 
 Btw, servicemix also provide a jaxb-api-2.2 spec bundle, you may wanna use 
 this one.
 
 [1]https://issues.apache.org/jira/browse/GERONIMO-5848
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 
 
 
 On 2014-1-2, at 上午11:30, Tom Leung wrote:
 
 Dear all,
  
 I started a new Karaf v3.0 instance on Ubuntu v13.04, use the default 
 setting and install the following bundles/features:
  
 feature:install war
 feature:install webconsole
 feature:repo-add openejb 4.5.2
  
 karaf@root() feature:list | grep openejb
 org.apache.commons| 0.0.0|   | 
 openejb-features|  
 xbean | 3.12 |   | 
 openejb-features|  
 org.apache.openwebbeans   | 1.1.8|   | 
 openejb-features|   
 geronimo-osgi | 1.1  |   | 
 openejb-features|  
 org.apache.activemq   | 5.7.0|   | 
 openejb-features|   
 openjpa   | 2.2.0|   | 
 openejb-features|  
 openejb-core  | 4.5.2|   | 
 openejb-features|  
 openejb-server| 4.5.2|   | 
 openejb-features|  
 openejb-cxf   | 4.5.2|   | 
 openejb-features|  
 openejb-rest  | 4.5.2|   | 
 openejb-features|  
 openejb-soap  | 4.5.2|   | 
 openejb-features|  
 karaf@root()
  
 feature:install openejb-core
  
 but, I get the following error:
  
 karaf@root() feature:install openejb-core
 Refreshing bundles 
 org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec (130), 
 org.apache.geronimo.specs.geronimo-jaspic_1.0_spec (84), 
 org.apache.geronimo.specs.geronimo-validation_1.0_spec (242)
 Error executing command: Could not start bundle 
 mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.1 in feature(s) 
 javaee-api-6.0-5: Unresolved constraint in bundle 
 org.apache.geronimo.specs.geronimo-jaxb_2.2_spec [260]: Unable to resolve 
 260.0: missing requirement [260.0] osgi.wiring.package; 
 ((osgi.wiring.package=javax.xml.namespace)(version=1.0.0))
 karaf@root()
  
 javax.xml.namespace is missing.
  
 Which bundle I should install to resolve the missing dependencies?
  
 Best Rgds,
  
 Tom
  
 
 
 
 -- 
 Krzysztof Sobkowiak
 
 JEE  OSS Architect | Technical Architect @ Capgemini
 e-mail: krzys.sobkow...@gmail.com | Twitter: @KSobkowiak



Re: Is there a way to automatically fire a Karaf shell script before shutting down Karaf?

2013-10-31 Thread Freeman Fang
Hi,

You can install a bundle where add a shutdown hook and do whatever you want, 
code like

Thread hook = new Thread() {
@Override
public void run() {
//do what you want
}
};
Runtime.getRuntime().addShutdownHook(hook); 
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-11-1, at 上午10:22, Tom Leung wrote:

 When type in the following Karaf command:
  
  shutdown
  
 or stop the Karaf windows service on Windows Platform.
  
 Is there a way to automatically fire a Karaf shell script before shutting 
 down Karaf?
  
  
 Best Rgds,
  
 Tom
  
  
  
  



Re: Installing and Starting up bundle at startup

2013-10-16 Thread Freeman Fang
Hi,

You can define a customer feature which refer your LDAP blueprint configuration 
file and then add this feature in etc/org.apache.karaf.features.cfg  
featuresBoot property,
your customer feature would be like

  feature name=my-ldap-feature version=1.0.0 resolver=(obr) 
start-level='50'
  bundleblueprint:file:etc/my-ldap.xml/bundle
/feature

-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-10-16, at 下午5:49, omkar.chog...@nomura.com omkar.chog...@nomura.com 
wrote:

 Hi,
  
 I want to add my own bundle into karaf and make it up the moment karaf 
 starts. It just contains xml to specify LDAP as realm to be used. Actually I 
 want to configure karaf to use LDAP realm without putting blueprint xml into 
 deploy folder. Is there any other way to do this?
  
 Could someone please let me know how can I achieve this?
  
 Thanks and Regards,
 Omkar Chogale
 This e-mail (including any attachments) is confidential, may contain
 proprietary or privileged information and is intended for the named
 recipient(s) only. Unintended recipients are prohibited from taking
 action on the basis of information in this e-mail and must delete all
 copies. Nomura will not accept responsibility or liability for the
 accuracy or completeness of, or the presence of any virus or disabling
 code in, this e-mail. If verification is sought please request a hard
 copy. Any reference to the terms of executed transactions should be
 treated as preliminary only and subject to formal written confirmation
 by Nomura. Nomura reserves the right to monitor e-mail communications
 through its networks (in accordance with applicable laws). No
 confidentiality or privilege is waived or lost by Nomura by any
 mistransmission of this e-mail. Any reference to Nomura is a
 reference to any entity in the Nomura Holdings, Inc. group.
 Please read our Electronic Communications Legal Notice which forms
 part of this e-mail: http://www.Nomura.com/email_disclaimer.htm



Re: Blueprint XML Never Starts

2013-10-10 Thread Freeman Fang
Hi,

Did you already install postgresql and commons-dbcp bundles which is needed by 
this blueprint file?
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-10-11, at 下午12:02, Kevin Carr wrote:

 Here is the file that is being used.  Usernames and passwords changed to 
 protect the innocent. 
 
 
 On Thu, Oct 10, 2013 at 10:53 PM, Freeman Fang freeman.f...@gmail.com wrote:
 Hi,
 
 Could you please post your blueprint file here?
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 Web: http://fusesource.com | http://www.redhat.com/
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
 http://blog.sina.com.cn/u/1473905042
 weibo: @Freeman小屋
 
 
 
 On 2013-10-11, at 上午11:39, Scott Carr wrote:
 
 I have a blueprint xml file in the deploy folder in apache karaf 2.3.3.  The 
 blueprint has worked before fine.  For some reason, now I see:
 
 Started bundle: blueprint:file:xml  over and over in the log. It is like 
 it keeps trying to create the bundle but there is no other information about 
 an error or anything.
 
 Does anyone else see this?  Putting blueprint files directly in the deploy 
 folder has worked in the past.
 
 Thanks
 
 Scott Carr
 
 
 
 
 -- 
 Scott Carr
 db_file.xml



Re: custom properties file in karaf

2013-10-09 Thread Freeman Fang
Hi,

Yes, use OSGi standard ConfigAdmin service you can do it.  That said, you can 
configure your application bundle with property-placeholder and define 
necessary properties there, then you can have a persistent-id.cfg file in 
$KARAF_HOME/etc to specify the properties.
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-10-9, at 下午2:54, Ali, Mohammad wrote:

 Hi,
  
 I am migrating my application from felix to apache karaf. Currently I am 
 providing my application related properties such as database details etc in 
 system.properties. I want to use a saterate properties file say 
 myApp.properties for this.
 Is there a way to make karaf read the myApp.properties and make these 
 properties available to bundles from karaf startup.
  
 Any help will be highly appreciated.
  
 Thanks  Regards,
 Shadab Ali
  
 This e-mail (and any attachments), is confidential and may be privileged. It 
 may be read, copied and used only
 by intended recipients. Unauthorized access to this e-mail (or attachments) 
 and disclosure or copying of its 
 contents or any action taken in reliance on it is unlawful. Unintended 
 recipients must notify the sender immediately 
 by e-mail/phone  delete it from their system without making any copies or 
 disclosing it to a third person.
 
 



Re: How can I enable reference URL handler?

2013-09-22 Thread Freeman Fang
Hi,

Not sure how to handle it using pax-exam, you can build a customer kit with 
those changes you need anyway.
$B!]!]!]!]!]!]!]!]!]!]!]!]!](B
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman$B.20(B



On 2013-9-19, at $B28a(B5:50, Debeerst Benjamin wrote:

 Hello,
  
 Sorry to open up such an old thread, but I.FNm facing a very similar 
 problem. It actually the exact same problem, only I am running an integration 
 test in Karaf here (Pax Exam 3.2.0, Karaf 2.3.2). Since INm using 
 useDeployFolder(false), the test bundles get deployed as a feature, so INm 
 running into the same issue that $B!H(Breference$B!I(B is not working 
 within a feature descriptor. (Using useDeployFolder(true) had other problems 
 for me).
  
 Freeman, you suggested to put the pax-url-reference bundle in the system repo 
 and add it to startup.properties.
  
 I can edit the startup.properties via KarafDistributionOptions.editC 
 onfigurationFilePut($B!D(B), but how can I populate the system repository 
 with additional artifacts in my Pax Exam test?
  
 Regards,
 Benjamin
  
 On Tue, May 22, 2012 at 11:47 AM, Freeman-2 wrote:
 
  Hi, 
  
  As you put ODP-Server in featuresBoot, so the reference 
  URLStreamHandlerService should be available at very early stage, so you 
  need 
  put pax-url-reference bundle into $KARAF_HOME/etc/startup.properties,  just 
  like what we do for 
  org/ops4j/pax/url/pax-url-mvn/1.2.8/pax-url-mvn-1.2.8.jar=5 
  org/ops4j/pax/url/pax-url-wrap/1.2.8/pax-url-wrap-1.2.8.jar=5 
  
  Basically you need add pax-url-reference bundle in startup.properties, also 
  you need ensure add this bundle in $KARAF_ HOME/system folder, as when load 
  bundles from startup.properties, won't use mvn to download it remotely, so 
  need ensure it's on your local disk. 
  
  Take a look at how we do for pax-url-mvn and pax-url-wrap, do same for the 
  pax-reference. 
  
  Freeman 
  On 2012-5-22, at $B28a(B2:36, Alexey Romanov wrote: 
  
  Actually, it turns out that reference: URL works for installing files: 
  
  karaf@root install 
  reference:file:/home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-275/generated/ru.focusmedia.jsr-275.jar
   
  Bundle ID: 105 
  
  but not for features! 
  
  karaf@root feature:install ODP-Server 
  Error executing command: Unknown protocol: reference 
  
  Why could that be? 
  
  -- 
  View this message in context: 
  http://karaf.922171.n3.nabble.com/How-can-I-enable-reference-URL-handler-tp3988050p4006097.html
  Sent from the Karaf - User mailing list archive at Nabble.com. 
  
  
  - 
  Freeman Fang 
  
  FuseSource 
  Email:[hidden email][hidden email] 
  Web: fusesource.com 
  Twitter: freemanfang 
  Blog: http://freemanfang.blogspot.com
  http://blog.sina.com.cn/u/1473905042
  weibo: http://weibo.com/u/1473905042
 
 



Re: Karaf 2.3.2: ClassNotFoundException for javax.* packages

2013-08-18 Thread Freeman Fang
FYI, we already have a jira[1] to track this issue

[1]https://issues.apache.org/jira/browse/KARAF-2446
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-8-16, at 下午8:01, Ioan Eugen Stan wrote:

 Hello JB,
 
 I think Freeman is right. I will explain my setup here:
 
 I have a bundle that uses Jasper to create PDF's. The Jasper bundle
 I'm using (5.1.0 from Maven Central) depends on Xerces libraries but
 declares Dynamic-Imports, not explicit imports.
 Because Karaf does not export the xerces packages from lib/endorsed I
 have to add the xerces bundle. I'm also using XML parsers from
 javax.xml.* packages, implemented by xerces from lib/endorsed.
 
 The issue arises from the fact that during PDF generation, classes
 from my own xerces bundle get mixed with classes from javax.xml system
 bundle implemented by the lib/endorsed xerces. Since they are loaded
 by different ClassLoaders it results in a ClassCast exception. I think
 the solution is, as Freeman suggested to export the xerces packages
 from the lib/endorsed version. That way the calsses will be loaded
 from the same bundle, by the same ClassLoader.
 
 I'm willing to test this if you tell me what to do. I'm not that deep
 in Karaf yet, and no time to get deep right now.
 
 Regards,



Re: Karaf 2.3.2: ClassNotFoundException for javax.* packages

2013-08-14 Thread Freeman Fang
Hi,

I think the problem comes from that we endorse xercesImpl jar but not configure 
the org.osgi.framework.bootdelegation and 
org.osgi.framework.system.packages.extra correctly.

We should endorse xercesImpl and add xerces related packages in 
org.osgi.framework.bootdelegation and org.osgi.framework.system.packages.extra 
of  etc/custom.properties, like what Servicemix do.

I will take care of it later on.
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-8-15, at 上午5:36, Jean-Baptiste Onofré wrote:

 Hi Ioan,
 
 could you explain what you did ? (just to reproduce it and work on that).
 
 As reminder, we included xercesImpl jar file in the lib/endorsed to fix an 
 critical issue with IBM JDK. Actually, Karaf didn't start at all without 
 xercesImpl in the lib/endorsed (we had parsing issue on Blueprint especially).
 
 Depending about your test case, I wonder if it would not be better to remove 
 xercesImpl from lib/endorsed (as we had before) and add a note for IBM JDK 
 users.
 
 Regards
 JB
 
 On 08/14/2013 11:27 PM, Ioan Eugen Stan wrote:
 Hello,
 
 I removed it and it worked. It's a bummer though - xerces impl from
 endorsed does not export org.apache.xerces.* packages so I need to
 import them from another bundle which gets me to ClassCast exception.
 Any way around this?
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: Migrate from felix to apache karaf

2013-08-02 Thread Freeman Fang
Hi,

Please elaborate your dynamic here.

Anyway, business logic depend on bundle start sequence isn't good practice in 
OSGi container, you may need consider a refactor to avoid it.
Also, specify start level isn't that reliable if you really need bundle start 
sequence, export|import OSGi service between bundles is the way to guarantee 
sequence thing work
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-8-2, at 下午6:25, Mohammad Shadab Ali wrote:

 Hi,
  
 I am planning to migrate to apache karaf from felix for dynamic loading of 
 osgi bundle. I tried to place the project related osgi bundles and jars in 
 the deploy directory. I have a set bundles termed as core bundles, which 
 needs to be loaded first then the other bundles.
 I tried with features.xml for ordering the bundles but features is for static 
 loading and not for dynamic loading
 Is there a way in karaf to define the start-level for a bundle.
  
 I am using apache-karaf-2.3.0 version.
  
  
 Regards,
 Shadab
  
 
 *** This e-mail (and any attachments), is confidential and may be privileged. 
 It may be read, copied and used only
 by intended recipients. Unauthorized access to this e-mail (or attachments) 
 and disclosure or copying of its
 contents or any action taken in reliance on it is unlawful. Unintended 
 recipients must notify the sender immediately
 by e-mail/phone  delete it from their system without making any copies or 
 disclosing it to a third person.***
 This e-mail (and any attachments), is confidential and may be privileged. It 
 may be read, copied and used only
 by intended recipients. Unauthorized access to this e-mail (or attachments) 
 and disclosure or copying of its 
 contents or any action taken in reliance on it is unlawful. Unintended 
 recipients must notify the sender immediately 
 by e-mail/phone  delete it from their system without making any copies or 
 disclosing it to a third person.
 
 



Re: creating features for own bundles and making the accessible

2013-07-22 Thread Freeman Fang
Hi,

Edit $KARAF_HOME/etc/org.ops4j.pax.url.mvn.cfg,

add your local nexus url to

org.ops4j.pax.url.mvn.repositories

property
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-7-22, at 下午8:37, Marco Westermann wrote:

 Hi,
 
 I try to get my written osgi-bundles available as features.
 
 I read that there is an archtype to create the features.xml from dependencies 
 in the pom.xml.
 
 When I try this, I get an error, that my referenced bundle could not be found 
 in central repo. How can I archiv that it uses my local nexus repo to look up 
 the bundles instead of the central one.
 
 thanks and
 best regards,
 
 Marco Westermann
 
 -- 
 ++ Business-Software aus einer Hand ++
 ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
 http://www.intersales.de
 http://www.eisxen.org
 http://www.tarantella-partner.de
 http://www.medisales.de
 http://www.eisfair.net
 
 interSales AG Internet Commerce
 Subbelrather Str. 247
 50825 Köln
 
 Tel  02 21 - 27 90 50
 Fax  02 21 - 27 90 517
 Mail isi...@intersales.de
 Mail m...@intersales.de
 Web  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: SMX 4.4-Karaf -2.2.4 - JMX List Features

2013-07-01 Thread Freeman Fang
Hi,

This should be in Karaf users list.

Because there's no listFeatures operation in FeaturesServiceMBean at all.

You can use getFeatures instead.
TabularData getFeatures() throws Exception;
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-7-1, at 下午8:24, pchakinala wrote:

 Hello,
 
 We are using Karaf  2.2.4 JMX Services to build user console and were able
 to retrieve all the information using JMX MBeans.
 
 Using below MBean, extracted features related data from Karaf /felix
 container.
 org.apache.karaf.features.management.internal.FeaturesServiceMBeanImpl
 
 Below services are working fine.
 1. public abstract void addRepository(String paramString)throws
 Exception;
 2.  public abstract void removeRepository(String paramString) throws
 Exception;
 3.  public abstract void installFeature(String paramString) throws
 Exception;
 4.  public abstract void installFeature(String paramString1, String
 paramString2) throws Exception;
 5.  public abstract void uninstallFeature(String paramString) throws
 Exception;
 6. public abstract void uninstallFeature(String paramString1, String
 paramString2)throws Exception;
 
 When i am trying to use listFeature service, system is throwing No Such
 Method exception
 
 
 javax.management.ReflectionException: No such operation: listFeatures
   at 
 com.sun.jmx.mbeanserver.PerInterface.noSuchMethod(PerInterface.java:152)
   at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:94)
   at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
   at javax.management.StandardMBean.invoke(StandardMBean.java:391)
   at
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
   at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
 
 Code:
 
 MBeanServerConnection.invoke(new
 ObjectName(org.apache.karaf:type=features,name=root),
 listFeatures,null,null);
 
 Method in MBean:
 
 public abstract Feature[] listFeatures()   throws Exception;
 
 Please suggest is there any issue in above code.
 
 Regards,
 Pchakina
 
 
 
 
 
 
 
 --
 View this message in context: 
 http://servicemix.396122.n5.nabble.com/SMX-4-4-Karaf-2-2-4-JMX-List-Features-tp5717215.html
 Sent from the ServiceMix - User mailing list archive at Nabble.com.



Re: Having custom features.xml in own bundles - how to?

2013-07-01 Thread Freeman Fang
Hi Claus,

Seems you're looking for kar archive, a zip file which contains features 
descriptor and a bunch of bundles, please take a look at [1] to get more 
details.

[1]http://karaf.apache.org/manual/latest-2.3.x/users-guide/kar.html
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-7-2, at 下午12:33, Claus Ibsen wrote:

 Hi
 
 I can't remember how to do this.
 
 Looking at:
 http://karaf.apache.org/manual/latest-2.3.x/users-guide/provisioning.html
 
 I have a custom bundle - eg in this case its a new Camel example -
 camel-example-mybatis. But it could also be a custom application.
 
 And as my bundle requires X other bundles and whatnot to be installed
 I want to have a feature to install it easily in karaf.
 
 I can't remember if I can include a features.xml in my own bundle in
 some special directory. And then use the
 
 addurl to add my features.xml file, eg like
 
 features:addurl
 mvn:org.apache.camel/camel-example-mybatis/2.12-SNAPSHOT/xml/features
 
 But I get this error
 
 Error executing command: Unable to add repositories:
 URL [mvn:org.apache.camel/camel-example-mybatis/2.12-SNAPSHOT/xml/features]
 could not be resolved.
 
 
 Currently my features.xml file is in src/main/resources directory of
 the camel-example-mybatis. Though wonder if I must place it in another
 directory.
 
 It would be sad if I have to create a features.xml file outside my
 bundle. As I would like a single deployment unit with included
 features.xml, for people to easy install and use it.
 
 
 
 
 
 --
 Claus Ibsen
 -
 www.camelone.org: The open source integration conference.
 
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: cib...@redhat.com
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen



Re: features-maven-plugin fails to download smooks dependencies

2013-06-12 Thread Freeman Fang
Hi,

Because that artifact isn't in maven central repo
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-6-11, at 下午6:19, Ioan Eugen Stan wrote:

 Hello Freeman,
 
 I've added the Alfresco repo and it works as expected. Thanks for the
 help. However I'm not sure why the strange behavior with Central.
 Running 'mvn install' fails with missing artifact, but manually
 getting the artifact with the bellow command succeeds. Too bad I don't
 have time to investigate.
 
 Cheers,
 
 mvn install:install-file -DgroupId=org.objectweb.asm
 -DartifactId=com.springsource.org.objectweb.asm.util -Dversion=2.2.3
 -Dpackaging=jar -Dfile=/path/to/file
 
 ---
repositories
repository
idalfresco-releases/id
releases
enabledtrue/enabled
updatePolicyalways/updatePolicy
checksumPolicywarn/checksumPolicy
/releases
snapshots
enabledfalse/enabled
/snapshots
nameAlfresco Public Artifacts/name

 urlhttps://artifacts.alfresco.com/nexus/content/groups/public//url
/repository
/repositories
 
 On Fri, Jun 7, 2013 at 4:11 AM, Freeman Fang freeman.f...@gmail.com wrote:
 Hi,
 
 I can find one repo here[1], could you add it into your pom.xml?
 
 [1]https://maven.alfresco.com/nexus/content/repositories/com.springsource.repository.bundles.external/org/objectweb/asm/com.springsource.org.objectweb.asm.util/2.2.3/
 
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Web: http://fusesource.com | http://www.redhat.com/
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
 http://blog.sina.com.cn/u/1473905042
 weibo: @Freeman小屋
 
 www.camelone.org : The open source integration conference:
 
 On 2013-6-7, at 上午12:42, Ioan Eugen Stan wrote:
 
 Hello Freeman,
 
 I have the repo (checked in effective-pom). I removed the directory
 but it's still doesn't work. It's also strange that search.maven.org
 does not seem to find it either [1].
 
 Cheers,
 
 [1]
 http://search.maven.org/#search%7Cga%7C1%7Ccom.springsource.org.objectweb.asm.util
 
 
 
 
 
 -- 
 Ioan Eugen Stan
 0720 898 747



Re: Need of complete network address isolation.

2013-06-08 Thread Freeman Fang
Hi,

Yes, this is a known issue and already get resolved, KARAF-2291[1] tracked it, 
next Karaf 2.3.2 would pick up this fix.

And you can find the commit change from [1] also, where you can build a jar 
with the fix yourself

[1]https://issues.apache.org/jira/browse/KARAF-2291
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-6-8, at 下午7:03, BHa77 wrote:

 Hi,
 
 From karaf 2.3.1 - that bundles with smx 5.0.0 - there is a very useful
 property named rmiRegistryHost that binds socket to
 ${rmiRegistryHost}:${rmiRegistryPort}, but it's only half the way to fit one
 of my production requirements : no tcp port wildcarding.
 
 This listener is OK :
 *tcp0  0 :::192.168.200.1:1099   :::* 
   
 LISTEN*
 
 However I found no way to do the same with rmiServer,
 so this one is not correct for my use :
 *tcp0  0 :::4:::*   
 LISTEN* 
 
 My goal is to have :
 *tcp0  0 :::192.168.200.1:4:::*   
 
 LISTEN* 
 
 It has to be done in some SocketFactory but I don't know karaf sources for
 now...
 If someone has solved this,... Ideas welcome!!
 Thanks
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Need-of-complete-network-address-isolation-tp4028980.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: features-maven-plugin fails to download smooks dependencies

2013-06-06 Thread Freeman Fang
Hi,

I can find one repo here[1], could you add it into your pom.xml?

[1]https://maven.alfresco.com/nexus/content/repositories/com.springsource.repository.bundles.external/org/objectweb/asm/com.springsource.org.objectweb.asm.util/2.2.3/
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-6-7, at 上午12:42, Ioan Eugen Stan wrote:

 Hello Freeman,
 
 I have the repo (checked in effective-pom). I removed the directory
 but it's still doesn't work. It's also strange that search.maven.org
 does not seem to find it either [1].
 
 Cheers,
 
 [1] 
 http://search.maven.org/#search%7Cga%7C1%7Ccom.springsource.org.objectweb.asm.util



Re: Jetty and multiple jaxrs servers

2013-06-04 Thread Freeman Fang
Hi,

Yes, pax-web can provide this flexibility IMO.

You can configure pax-web to support SSL, even in another port.[1]

And the http basic auth configuration actually is endpoint|bundle specific, not 
much about the transport level. For example, for cxf endpoint you can configure 
a authenticationInterceptor(it could be 
org.apache.cxf.interceptor.security.JAASLoginInterceptor) which can delegate 
the authentication to Karaf JAAS if this cxf endpoint need http basic auth, we 
have an example in SMX code base, you may wanna take a look.[2]

[1]https://ops4j1.jira.com/wiki/display/paxweb/SSL+Configuration
[2]https://svn.apache.org/repos/asf/servicemix/smx4/features/trunk/examples/cxf/cxf-ws-security-osgi/
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-6-5, at 上午11:49, m.mcinness1 wrote:

 Thanks for the replies.
 
 Freeman, my use case is to interface with a number of third-party vendors,
 each having unique requirements and accessing very different applications.
 For example, one may require that the endpoint be restricted to ssl, another
 may require basic auth, and third might support neither. The services have
 no relationship to each other. In essence they are all private and custom to
 the third parties.
 
 I've read a couple posts regarding proxying via camel and modifying
 jetty.xml with pax web, but it's not clear whether either of these would be
 a better choice for my situation than stand alone jetty and multiple ports.
 We'll end up running 20 or so application bundles on one karaf instance.
 Does pax web offer the flexibility we need?
 
 Thanks again!
 
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Jetty-and-multiple-jaxrs-servers-tp4028957p4028962.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Keep track of features installed in karaf 2.2.9

2013-06-03 Thread Freeman Fang
Hi,

Does 

features:list
work for you?
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-6-4, at 上午8:16, anair wrote:

 Hello,
 
 Is it possible to know which features were installed in karaf 2.2.9 once the
 container is up and running. The feature can be installed using obr:deploy
 or features:install. I am already listening to the bundles being installed
 by implementing SynchronousBundleListener. However, now I need to know which
 features they belong to. I just need the feature name, basically when user
 does 'obr:deploy -s feature-name', I need the feature-name. My current
 implementation gives me only the list of bundles that get installed when the
 feature itself is installed.
 
 Any pointers are greatly appreciated.
 
 regards,
 
 Asha
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Keep-track-of-features-installed-in-karaf-2-2-9-tp4028938.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Encoding issue for Redis key using xml blueprint

2013-05-29 Thread Freeman Fang
Hi,

Please check and ensure there's no multiple spring-data-redis bundle get 
installed in your container.
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-29, at 下午3:05, Djeeaie . wrote:

 Hi,
 
 Thanks for the help. Here is the result :
 
 karaf@root osgi:headers camel-test
 
 Bundle 170
 --
 Manifest-Version = 2
 
 Bundle-SymbolicName = camel-test.xml
 Bundle-Version = 0.0.0
 Bundle-ManifestVersion = 2
 
 DynamicImport-Package =
 *
 Import-Package =
 org.springframework.data.redis.connection.jedis,
 org.springframework.data.redis.core,
 org.springframework.data.redis.serializer
 
 Best regards,
 Djee
 
 
 On 29 May 2013 03:14, Freeman Fang freeman.f...@gmail.com wrote:
 Hi,
 
 This could be caused by your customer bundle miss some package or your 
 customer bundle embed spring jars.
 
 Please post the result of 
 osgi:headers your_bundle_id
 -
 Freeman(Yue) Fang
 
 Red Hat, Inc. 
 FuseSource is now part of Red Hat
 Web: http://fusesource.com | http://www.redhat.com/
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
 http://blog.sina.com.cn/u/1473905042
 weibo: @Freeman小屋
 
 www.camelone.org : The open source integration conference: 
 
 On 2013-5-28, at 下午8:19, Djeeaie . wrote:
 
 Hi,
 
 here comes some new stuff. I digged into it and found out I needed a 
 StringRedisSerializer in a  RedisTemplate. So i changed the xml file :
 
 ?xml version=1.0 encoding=UTF8?
 blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
 
  bean id=redisConnectionFactory 
 class=org.springframework.data.redis.connection.jedis.JedisConnectionFactory
  property name=hostName value=ip.of.server /
  property name=port value=6379/
  /bean
  
  bean id=stringRedisSerializer 
 class=org.springframework.data.redis.serializer.StringRedisSerializer/
  bean id=RedisTemplate 
 class=org.springframework.data.redis.core.StringRedisTemplate
  property name=connectionFactory 
 ref=redisConnectionFactory/
  property name=keySerializer ref = stringRedisSerializer/
  property name=hashKeySerializer ref = 
 stringRedisSerializer/
  property name=valueSerializer ref = stringRedisSerializer/
  property name=hashValueSerializer ref = 
 stringRedisSerializer/
  /bean
  camelContext xmlns=http://camel.apache.org/schema/blueprint; 
 id=monAutreContXML
  route
  from 
 uri=stream:file?fileName=./inboxRedis/testamp;scanStream=true/
  setHeader headerName=CamelRedis.Key
  constantmyKey/constant
  /setHeader
  to uri=stream:out/
  to 
 uri=spring-redis://redhishost?command=SETamp;redisTemplate=#RedisTemplate//route
  /camelContext 
 /blueprint
 
 But when I try to deploy it, I get the following error message in the karaf 
 log :
 
 2013-05-28 14:24:58,779 | ERROR | rint Extender: 3 | BlueprintContainerImpl  
  | container.BlueprintContainerImpl  393 | 7 - 
 org.apache.aries.blueprint.c
 ore - 1.1.0 | Unable to start blueprint container for bundle camel-test.xml
 org.osgi.service.blueprint.container.ComponentDefinitionException: Error 
 setting property: PropertyDescriptor name: keySerializer, getter: class 
 org.springfram
 ework.data.redis.core.RedisTemplate.getKeySerializer(), setter: [class 
 org.springframework.data.redis.core.RedisTemplate.setKeySerializer(interface 
 org.springfr
 amework.data.redis.serializer.RedisSerializer)]
 at 
 org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:941)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:907)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:888)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:820)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[7:org.apache.aries.blueprint.core:1.1.0]
 at 
 java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
 at 
 java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
 at 
 org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[7

Re: how to control auto refresh when deploy a kar

2013-05-21 Thread Freeman Fang
Hi,

No, currently the car service/deployer won't support this configurable option.

However I see this requirement is a good improvement,  create KARAF-2320[1] to 
track it.
[1]https://issues.apache.org/jira/browse/KARAF-2320
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-21, at 下午1:50, XiLai Dai wrote:

 Hi,
  
 May I have a quick question about auto refresh in case deploy a kar file into 
 deploy folder? There is an option (–r  --no-auto-refresh) on features:install 
 command used to control whether auto refresh bundles. Is there also a way to 
 control this behavior with kar file deployment?
  
 Thanks!
 Xilai



Re: use spring-data-mongodb in servicemix4.5.1

2013-05-17 Thread Freeman Fang
Hi,

First of all, as I told you before, servicemix issue should go into servicemix 
mailing list, though this question looks more like a maven question

Also you need elaborate your problem a little bit, likely how you see the error 

 Missing artifact 
 org.springframework.data:spring-data-mongodb:jar:1.0.0.RELEASE pom.xml

as it's actually in maven central repo, does your machine has direct internet 
access? 

-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-17, at 下午1:57, wangyan wrote:

 Hi~
 I would like to ask,servicemix4.5.1 is not integrated into the 
 spring-data-mongodb?
  
 If I want to use spring-data-mongodb in servicemix4.5.1 , and what is the 
 right way?
  
 I tried to download spring-data-mongodb:
  
 dependency
 groupIdorg.springframework.data/groupId
 artifactIdspring-data-mongodb/artifactId
 version1.0.0.RELEASE/version
 /dependency
  
 But the error :
 Missing artifact 
 org.springframework.data:spring-data-mongodb:jar:1.0.0.RELEASE pom.xml
  
 I'm Sorry!
  
 I know that this problem should not be in the mail group asked , but think 
 there should be a solution . Or is the cause of the problem.
  
 Thanks!



Re: use apache-servicemix-5.0.0-SNAPSHOT in activemq

2013-05-15 Thread Freeman Fang
Indeed, this is a Servicemix related question to send to Servicemix Users 
mailing list.

By default Servicemix 5.0 will start a secure Activemq broker which delegate to 
use Karaf JAAS realm, so you need provide username/password to connect to the 
broker.

The default username/password is smx/smx, it's configured in 
$SMX_HOME/etc/users.properties
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

www.camelone.org : The open source integration conference: 

On 2013-5-15, at 下午2:12, Claus Ibsen wrote:

 Hi
 
 Use the ServiceMix mailing list please for your ServiceMix questions.
 
 Also the error in the logs indicate its a security issue, so you need
 to setup username/password to allow to connect to the ActiveMQ broker.
 
 On Wed, May 15, 2013 at 5:32 AM, wangyan wang...@supermap.com wrote:
 Hi~
 I use apache-servicemix-5.0.0-SNAPSHOT in activemq,
 The following information log:display:
 
 2013-05-15 11:19:45,921 | WARN  | 0.0.1:2517@61616 | TransportConnection
| 60 - org.apache.activemq.activemq-osgi - 5.8.0 |
 Failed to add Connection
 
  ID:fds-8465-84945615-3:60, reason: java.lang.SecurityException: User name
  [null] or password is invalid.
 
 
 2013-05-15 11:19:45,921 | WARN  | 0.0.1:2517@61616 | Transport
| 60 - org.apache.activemq.activemq-osgi - 5.8.0 |
 
  Transport Connection to : tcp://127.0.0.1:2517 failed:
 java.io.EOFException
  2013-05-15 11:19:45,921 | WARN  | r[FEATURES.JSON] |
 faultJmsMessageListenerContaine
 | 86 - org.springframework.jms - 3.1.4.RELEASE | Could not refresh JMS
 Connection
  for destination 'FEATURES.JSON' - retrying in 5000 ms. Cause: User name
 [null]
  or password is invalid.
 
 
 2013-05-15 11:19:47,921 | INFO  | q-broker] Task-2 | TransportConnection
| 60 - org.apache.activemq.activemq-osgi - 5.8.0 |
 Stopping tcp://127.0.0.1:2517
  because Failed with SecurityException: User name
 [null] or password is invalid.
 
 
 I try to manually install activemq-broker,activemq-client,activemq-pool.
 But the error still exists,and there is no can be downloaded to the
 activemq-core(5.8.0)
 and activemq-all(5.8.0)
 
 What is the reason?
 
  Thanks!
 
 
 
 -- 
 Claus Ibsen
 -
 www.camelone.org: The open source integration conference.
 
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: cib...@redhat.com
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen



  1   2   >