Re: Integrating OpenJSEE into Karaf on JDK8

2020-06-14 Thread Johan Edstrom
Oh, I’ve gotten axis one running in Karaf, you might have to override a 
class loader or two, but you learn alot about the JDK :)


> On Jun 14, 2020, at 11:21 PM, Mark Derricutt  wrote:
> 
> Woo – I _may_ have spoken too soon – after adding a few more !imports – the 
> bundle activator runs and everything _appears_ to be active with no 
> exceptions.
>  
> Of course – the next step is getting something to call/respond to an HTTPS 
> endpoint – but progress.
>  
>  
> From: Johan Edstrom mailto:seij...@gmail.com>>
> Reply to: "user@karaf.apache.org <mailto:user@karaf.apache.org>" 
> mailto:user@karaf.apache.org>>
> Date: Monday, 15 June 2020 at 4:19 PM
> To: "user@karaf.apache.org <mailto:user@karaf.apache.org>" 
> mailto:user@karaf.apache.org>>
> Subject: Re: Integrating OpenJSEE into Karaf on JDK8
>  
> Are some of those possibly something you could make optional?
> Dealing with old jars compile chains can be really enlightening in osgi :)



Re: Integrating OpenJSEE into Karaf on JDK8

2020-06-14 Thread Johan Edstrom
Are some of those possibly something you could make optional?
Dealing with old jars compile chains can be really enlightening in osgi :)


> On Jun 14, 2020, at 9:37 PM, Mark Derricutt  wrote:
> 
> Hey all,
> 
> I was wondering if anyone here had tried integrating/running OpenJSEE ( 
> https://github.com/openjsse/openjsse  ) 
> under Karaf on JDk8 at all? (we're wanting to make use of TLS 1.3 ).
> 
> I've created a simple bundle wrapping the library, and calling 
> java.security.Security#insertProviderAt which we currently use on a non-Kara 
> based project, but when I try and build a distribution I rightly get told off 
> about the bundle wanting to access sun.net.util:
> 
> resolution:=mandatory [caused by: Unable to resolve
>com.smxemail.openjsse/1.0.1.SNAPSHOT: missing
>  requirement [com.smxemail.openjsse/1.0.1.SNAPSHOT] osgi.wiring.package;
>  filter:="(osgi.wiring.package=sun.net.util)"]]
> Ideally I don't want to patch the jre.properties and export the sun.net.util 
> package (and likely others) so wondering if anyone had any ideas, one option 
> I'm thinking of trying is copying the openjsee.jar dependency into the 
> karaf/lib/boot folder, or set add the org.openjsse.net.ssl package to 
> delegate to the boot class loader.
> 
> All of these feel somewhat messy, so if there was some way I could handle it 
> all inside a bundle/karaf-feature that would be preferable.
> 
> Cheers,
> Mark
> 
> "The ease with which a change can be implemented has no relevance at all to 
> whether it is the right change for the (Java) Platform for all time." — Mark 
> Reinhold.
> 
> Mark Derricutt
> http://www.chaliceofblood.net 
> http://www.theoryinpractice.net 
> http://twitter.com/talios 
> http://facebook.com/mderricutt 


Re: Encrypting property values in .cfg files

2018-11-05 Thread Johan Edstrom
Yep, you need something like an ${enc:value} and you need to export a seed 
value that you can unset later in the karaf start script, but yeah. It works

Sent from my pressure cooker.

> On Nov 5, 2018, at 15:50, Leschke, Scott  wrote:
> 
> Thanks for the response.
>  
> So just to be clear, I’m correct in thinking that it should work?
>  
> From: Johan Edstrom [mailto:seij...@gmail.com] 
> Sent: Monday, November 05, 2018 4:47 PM
> To: user@karaf.apache.org
> Subject: Re: Encrypting property values in .cfg files
>  
> I think I have that in a Jira someplace, otherwise 
> I have basic code for it against an older karaf
> 
> Sent from my pressure cooker.
> 
> On Nov 5, 2018, at 15:25, Leschke, Scott  wrote:
> 
> I’m looking to encrypt passwords the are currently in plaintext in a few of 
> my .cfg files.  I’ve looked at how to do that and it seemed reasonably 
> straightforward although I’ve had some difficulty getting it working.  I’m 
> wondering if there’s anything that prevents me from just supplying a service 
> myself that implements the org.jasypt.encryption.StringEncryptor interface 
> rather than using the Karaf jasypt-encryption service.
>  
> I’ve tried it but that doesn’t seem to want to work either so I’m wondering 
> if there’s a reason it doesn’t.
>  
> Scott
>  
>  


Re: Encrypting property values in .cfg files

2018-11-05 Thread Johan Edstrom
I think I have that in a Jira someplace, otherwise 
I have basic code for it against an older karaf

Sent from my pressure cooker.

> On Nov 5, 2018, at 15:25, Leschke, Scott  wrote:
> 
> I’m looking to encrypt passwords the are currently in plaintext in a few of 
> my .cfg files.  I’ve looked at how to do that and it seemed reasonably 
> straightforward although I’ve had some difficulty getting it working.  I’m 
> wondering if there’s anything that prevents me from just supplying a service 
> myself that implements the org.jasypt.encryption.StringEncryptor interface 
> rather than using the Karaf jasypt-encryption service.
>  
> I’ve tried it but that doesn’t seem to want to work either so I’m wondering 
> if there’s a reason it doesn’t.
>  
> Scott
>  
>  


Re: How to 'automate' dynamic import

2018-08-13 Thread Johan Edstrom
http://cxf.547215.n5.nabble.com/DOSGI-CXF-com-sun-xml-bind-v2-ContextFactory-not-found-by-org-apache-cxf-cxf-rt-transports-http-170-td5776976.html
 


> On Aug 13, 2018, at 10:52 AM, Erwin Hogeweg  wrote:
> 
> com.sun.xml.bind.v2.ContextFactory not found by 
> org.apache.cxf.cxf-rt-transports-http



Re: Bundle in a Waiting state

2017-09-21 Thread Johan Edstrom
Try restarting that bundle and you should get some more info in the logs.

> On Sep 21, 2017, at 3:18 PM, Oleg Cohen  wrote:
> 
> Greetings,
> 
> I have a question. One of the 3rd party bundles I am deploying into Karaf 
> (Apache Oak Core) is showing in a Waiting state in the Karaf shell:
> 
> 846 │ Waiting  │  80 │ 1.6.4   │ Oak Core
> 
> In the Web Console it is showing as Active. I am trying to understand the 
> meaning of the Waiting state and how to figure out what the bundle is waiting 
> for.
> 
> Would appreciate any pointers!
> 
> Best,
> Oleg



Re: Error Unresolved requirements osgi.wiring.package=bsh

2016-12-06 Thread Johan Edstrom
This part is wrong:

!bsh,resolution:=optional

! == Don’t import at all.

resolution:=optional is used with a semi-colon, 

bsh;resolution:=optional, *



> On Dec 6, 2016, at 10:40 AM, Singh  wrote:
> 
> !bsh,resolution:=optional



Re: Spring vs Blueprint

2014-09-29 Thread Johan Edstrom
Bigtime spring does a global classloader vs blueprint building a recipe and 
actually starting bundles with their own classloaders, I did a talk on that at 
camel one 2011 Johan Edstrom - via HopOn September 29, 2014 at 21:49 GMT, Tim 
Jones t...@mccarthy.co.nz wrote:Johan, is there any advantage in the way that 
Aries has solved class pathquite differently over Spring DM?


Re: Spring vs Blueprint

2014-09-29 Thread Johan Edstrom
Yep, essentially an EE class loader is applied to a matrix classloading system, 
that is why you can get really strange contextRefresh spins and things like 
class path: works across bundles although they really shouldn't. Johan Edstrom 
- via HopOn September 29, 2014 at 23:56 GMT, Tim Jones t...@mccarthy.co.nz 
wrote:In other words are you saying that Spring DM will use the same class 
loaderfor all bundles as opposed to a different class loader for each bundle?


Re: Ping Can Anyone See My Posts

2014-04-15 Thread Johan Edstrom
I can't see this one either

Sent from my pressure cooker.

 On Apr 15, 2014, at 19:20, Scott Carr kscar...@gmail.com wrote:
 
 ?  Everytime I post it seems like it doesn't make it to the list.
 
 Thanks
 
 Scott Carr


Re: karaf camel activemq

2014-01-30 Thread Johan Edstrom
Right now you are doing both, configuring camel via code as well as in 
Blueprint.
You want to pick one, you could let Blueprint instantiate a bean for you 
via the init-method and there setup Camel or you could declare the components
and the CamelContext in Blueprint and just add a RouteBuilder.

The latter is the most common. 

It looks like you haven't installed camel - you need to add a features url
and do a features:install camel-jms


On Jan 30, 2014, at 6:51 AM, Laci Gaspar laci...@gmail.com wrote:

 Hi JB
 This is my MANIFEST file:
 Import-Package: javax.jms,org.apache.activemq,org.apache.activemq.camel.
 component,org.apache.camel;version=[2.12,3),org.apache.camel.builder;
 version=[2.12,3),org.apache.camel.component.jms;version=[2.12,3),or
 g.apache.camel.impl;version=[2.12,3),org.apache.camel.model;version=
 [2.12,3),org.osgi.service.blueprint;version=[1.0.0,2.0.0)
 
 
 What I am confused about is:
 In the examples I am supposed to configure the connectionFactory in the 
 broker configuration of AMQ.
 But I want to do this in Java.
 
 Any ideas?
 Best,
 Laci
 
 On 30.01.2014 13:29, Jean-Baptiste Onofré wrote:
 Hi Laci,
 
 do you import org.apache.camel package in your bundle ?
 
 Regards
 JB
 
 On 01/30/2014 01:15 PM, Laci Gaspar wrote:
 Hi
 I'm just starting, please excuse silly questions.
 
 I'm having problems writing an example that uses camel, activemq, karaf.
 As a basis I used the Camel Example camel-example-jms-file.
 
 Then I adapted the pom file, so that it builds a bundle. So far so good.
 After installing it in karaf nothing happened, the route didn't start.
 
 Then I looked in other examples  (jms2rest in the karaf tutorials ) and
 so I added a blueprint.xml file to the project.
bean id=jms2FileRoute
 class=org.apache.camel.example.jmstofile.Jms2FileRoute
 /bean
 camelContext id=jms2file
 xmlns=http://camel.apache.org/schema/blueprint;
 routeBuilder ref=jms2FileRoute /
 /camelContext
  bean id=connectionFactory class=javax.jms.ConnectionFactory /
 bean id=jmsConfig
 class=org.apache.camel.component.jms.JmsConfiguration
 property name=connectionFactory ref=connectionFactory/
 /bean
 bean id=jms-test
 class=org.apache.camel.component.jms.JmsComponent
 argument ref=jmsConfig/
 /bean
   bean id=activemqConnectionFactory
 class=org.apache.activemq.ActiveMQConnectionFactory
  property name=brokerURL value=tcp://0.0.0.0:61616 /
  /bean
  bean id=pooledConnectionFactory
 class=org.apache.activemq.pool.PooledConnectionFactory
  property name=maxConnections value=8 /
  property name=connectionFactory
 ref=activemqConnectionFactory /
  /bean
 
 In my main class i do:
 CamelContext context = new DefaultCamelContext();
 JmsConfiguration jmsConfig = new JmsConfiguration(new
 ActiveMQConnectionFactory(tcp://localhost:61616));
 context.addComponent(jms-test, new JmsComponent(jmsConfig ));
 
 
 After installing the bundle in karaf,  i get the log message:
 2014-01-30 13:09:38,145 | INFO  | l Console Thread |
 BlueprintContainerImpl   | container.BlueprintContainerImpl  360
 | 7 - org.apache.aries.blueprint.core - 1.1.0 | Bundle
 org.apache.camel.example.jmstofile.camel-example-jms-file is waiting for
 dependencies
 [((component=test-jms)(objectClass=org.apache.camel.spi.ComponentResolver))]
  
 
 
 It seems that something is wrong with my ActiveMQConnectionFactory, but
 I can't figure out what.
 
 Any advice would be most helpful as well as a working up to date example
 that involves AMQ, camel and karaf.
 
 Thanks a lot,
 Laci
 
 
 



Re: Camel startup error

2014-01-28 Thread Johan Edstrom
You are better off using a feature and putting things in the system repo. Look 
at a smx build or similar, you can change the logging destination. 

Sent from my pressure cooker.

 On Jan 28, 2014, at 23:39, Muhzin rmuh...@gmail.com wrote:
 
 Hi all,
 Looking into the cache corruption little bit I found the discussion on custom 
 distribution where we can pre-load  the bundles.
 
 I am thinking of putting all my bundles required in the deploy folder and my 
 configurations in etc folder of karaf binary distribution and archiving it to 
 make a bundle and make it ready for production deployment. Is this method 
 recommended? or should i make make custom distribution using 
 maven-karaf-plugin? what is the difference between the two?
 
 In either case i need the log files in the data/log not replaced when 
 deploying new distribution. Is there any way that i can change the log file 
 directory to some other directory say, /var/log. 
 
 Thanks in advance.


Re: Third-Party Licensing Policy (was: karaf 3.0 : hibernate 4 feature)

2014-01-09 Thread Johan Edstrom
It applies to anything licensed under ASF Licenses.
Hibernate is probably a good example, the Apache Camel Hibernate components
are housed outside ASF, in a 3rd party repo.
Since that component is compiled against GPL code it isn't ASF compatible 
anymore.


On Jan 9, 2014, at 4:14 PM, John D. Ament john.d.am...@gmail.com wrote:

 Well, since there is no compile time dependency on hibernate, is there
 actually a licensing issue?
 The binary is referenced, but not compiled against in Apache code.
 
 On Thu, Jan 9, 2014 at 5:35 PM, Krzysztof Sobkowiak
 krzys.sobkow...@gmail.com wrote:
 Hi
 
 I have some licensing questions.
 
 I have found following page http://www.apache.org/legal/3party.html which
 defines 3 categories of third party licenses. According to this page LGPL
 v2.1 is category X, but further remark says, the LGPL-v2.1-licensed work can
 be listed as system requirements but can not be included  by Apache
 products. I'm not good in licensing but I try to understand it.  Is the
 category of LGPL really B  (and the page should be corrected) or is the LGP
 category X.  In the second case, can we still list Hibernate in Karaf
 features (e.g. using the remark about listing of system requirements)?
 
 Assume following use cases of third-party work usage:
 1. reference 3rd-party library as (maven) dependency and use the classes in
 ASF code
 2. reference 3rd-party library as (maven) dependency and use the classes
 only in ASF configuration files (e.g. blueprint.xml)
 3. include/copy some unmodified 3rd-party code (e.g. some classes) in ASF
 project
 4. include/copy some 3rd-party code (e.g. some classes) in ASF project and
 modify it
 5. list some 3rd-party libraries in Karaf features, but not include them as
 binaries in one of the Karaf distributions
 6. list some 3rd-party libraries in Karaf features, and  include them as
 binaries in one of the Karaf distributions in system repository
 
 Could anybody please answer which of above points are allowed for following
 3rd-party works
 a. category A as the whole category - I assume, all above use cases are
 allowed in this category, is it ok?
 b. category B as the whole category
 c. category X as the whole category
 d. LGPL
 e. GPL
 f. EPL
 
 I have chosen Karaf as sample ASF project, but it could be any other ASF
 project, e.g. ServiceMix or Aries
 
 Do the rules from the page mentioned above apply only for ASF projects or
 for any project licensed under Apache License?
 
 Best regards
 Krzysztof
 
 
 
 On 03.01.2014 11: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
 
 
 --
 Krzysztof Sobkowiak
 
 JEE  OSS Architect | Technical Architect @ Capgemini
 Capgemini | Software Solutions Center | Wroclaw
 e-mail: krzys.sobkow...@gmail.com | Twitter: @KSobkowiak



Re: ConfigAdmin and OSGi Blueprint

2013-10-30 Thread Johan Edstrom
You'd need to listen for config changes or ensure that you have update hooks or 
perhaps use a ManagedServiceFactory

Sent from my pressure cooker.

On Oct 29, 2013, at 10:37, Christian Schneider ch...@die-schneider.net wrote:

 I would keep the update strategy reload. As far as I know it is the only way 
 to keep up to date with config changes.
 
 Christian
 
 Am 29.10.2013 13:45, schrieb lb:
 reload is something left from copy-and-past :-)
 
 thx for the hint.
 —
 lb
 
 
 On Tue, Oct 29, 2013 at 1:12 PM, Christian Schneider 
 ch...@die-schneider.net wrote:
 On 29.10.2013 11:59, lbu wrote: 
  Hi, 
  I'm trying to figure-out which is the best option to configure a bean 
  
  instantiated via OSGi Blueprint and I have a some question for which I 
  haven't found the answer: 
  
  1) is there any way to reference to the cm:property-placeholder's 
  persistent-id? So I can write something like: 
  
  cm:property-placeholder persistent-id=my.service.pid 
  update-strategy=reload 
  /cm:property-placeholder 
  
  bean id=my.bean.id class=my.bean.Class 
  property name=servicePid value=${persistent-id}/ 
  /bean 
 The persistent id is reflected as property ${service.pid} 
  2) is there any way to have the ConfigAdmin to call Class.update(Map ...) 
  when the bean is instantiated? 
  
  cm:property-placeholder persistent-id=my.service.pid 
  update-strategy=reload 
  /cm:property-placeholder 
  
  bean id=my.bean.id class=my.bean.Class 
  /bean 
  
  class my.bean.Class { 
  public void update(Map configuration) { 
   
  } 
  } 
  
  thx - Luca 
 
 Reload means that the whole context is reloaded when the config changes. 
 So it is not really an update but you can inject the whole map. 
 
 cm:property-placeholder id=myConfig persistent-id=my.service.pid 
 update-strategy=reload 
 /cm:property-placeholder 
 
 bean id=my.bean.id class=my.bean.Class 
 property name=config ref=myConfig/ 
 /bean 
 
 
 Christian 
 
 
 -- 
 Christian Schneider 
 http://www.liquid-reality.de 
 
 Open Source Architect 
 http://www.talend.com
 
 
 -- 
  
 Christian Schneider
 http://www.liquid-reality.de
 
 Open Source Architect
 Talend Application Integration Division http://www.talend.com 


Re: blueprint / spring question

2013-09-05 Thread Johan Edstrom
Aries blueprint isn't spring.
It isn't a 1-1 relationship between beans and namespace handlers.
Not used Gemini enough to comment on that.

If you are not looking to actually converting things you are better off using 
spring-dm.



Sent from my pressure cooker.

On Sep 5, 2013, at 19:34, Marcos Mendez mar...@jitisoft.com wrote:

 Thanks. That moved it along, now I'm getting
 
 2013-09-05 21:33:04,054 | INFO  | rint Extender: 2 | BlueprintContainerImpl   
 | container.BlueprintContainerImpl  303 | 7 - 
 org.apache.aries.blueprint.core - 1.1.0 | Bundle springosgi.hellowebint2 is 
 waiting for namespace handlers [http://www.springframework.org/schema/beans, 
 http://www.eclipse.org/gemini/blueprint/schema/blueprint, 
 http://www.springframework.org/schema/integration/mail, 
 http://www.springframework.org/schema/integration, 
 http://www.springframework.org/schema/util]
 2013-09-05 21:33:04,143 | INFO  | l Console Thread | HttpServiceFactoryImpl   
 | .internal.HttpServiceFactoryImpl   35 | 90 - 
 org.ops4j.pax.web.pax-web-runtime - 3.0.2 | Binding bundle: 
 [springosgi.hellowebint2 [247]] to http service
 
 
 I commented out the spring stuff in the web.xml (ContextLoaderListener and 
 OsgiBundleXmlWebApplicationContext) as well.
 
 Any ideas?
 
 
 You have to move your spring files into OSGI-INF/blueprint for gemini to
 pick them up.
 
 
 On 2013-09-05 1:37 PM, Marcos Mendez mar...@jitisoft.com wrote:
 
 Hi,
 
 I have a working wab + spring-dm + spring integration and wab + spring
 mvc apps. Now, I should be looking to move it to use blueprint correct?
 Due to spring-dm being deprecated.
 
 So, I tried, but the things beans defined in either blueprint and
 applicationContext.xml (spring) don't see each other, except of course
 thru osgi - e.g. by adding spring-dm and exporting/importing services..
 which sort of defeats the purpose.
 
 Am I missing something? Is there a better way to tackle a
 blueprint/spring combination? I haven't been able to find any examples
 tacking this.
 
 Regards,
 Marcos
 
 
 
 
 Matthew Bishop, Senior Architect
 Mobile: +1-604-218-8102
 Email: matthew.bis...@elasticpath.com
 
 Elastic Path Software Inc.
 Web: www.elasticpath.com
 Blog: www.getelastic.com
 Community: grep.elasticpath.com
 Careers: www.elasticpath.com/jobs
 
 Confidentiality Notice: This message is intended only for the use of the 
 designated addressee(s), and may contain information that is privileged, 
 confidential and exempt from disclosure. Any unauthorized viewing, 
 disclosure, copying, distribution or use of information contained in this 
 e-mail is prohibited and may be unlawful. If you received this e-mail in 
 error, please reply to the sender immediately to inform us you are not the 
 intended recipient and delete the email from your computer system. Thank you.
 


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

2013-01-29 Thread Johan Edstrom
There are several blogs out there on how to get Hibernate running.
That said, it isn't really an OSGi problem that Hibernate and Spring are
written in a way that prevents sane class-loading, that is pretty much all it 
is.

You don't need a FAB nor an uberbundle to get it working, all you need are
a few fragments.


On Jan 29, 2013, at 4:36 AM, James Carman jcar...@carmanconsulting.com wrote:

 Yes, OpenJPA will save you a lot of headaches, since it is designed to work 
 in an OSGi environment.  
 
 On Jan 29, 2013, at 6:19 AM, Bram Pouwelse b...@pouwelse.com wrote:
 
 Hi Gonzalo,
 
 I've used Hibernate in Karaf in the past got it al working based on on
 Hibernate bundles created as described in this blog post:
 http://iocanel.blogspot.nl/2010/07/wicket-spring-3-jpa2-hibernate-osgi.html
 
 I was able to update these bundles to Hibernate 3.6.2 but switched to
 OpenJPA after all.
 
 Regards,
 Bram
 
 
 
 2013/1/29 Jean-Baptiste Onofré j...@nanthrax.net:
 Hi Gonzalo,
 
 my comments inline:
 
 
 First.
Why do we have to repackage every library is not in the form of
 bundle?
It would be easier, more manageable, to wrap missing libraries (not
 in the form of a bundle) around a container that describes its contents.
 This way something like, say, apache.commons does not need to be
 unpacked and packed with a new manifiest. This method will break signing
 if any, but proposed one does not.
 
 A lot of library (like commons) are already bundles.
 The problem using wrap is that most of the time the OSGi statements are not
 correct. That's why creating a bundle is required.
 
 
 
 
 Second.
This project (in this case OSGi- Felix) is supposed to be created
 to resolve library mess. But I can only find references to peculiarities
 to the implementation of the class loaders that makes every old project
 incompatible without modifications. Say Hibernate. Do I have to use
 packages that only springsource Enterprise provides? This is a little
 pain because if the bundle is not there, is not anywhere.
 
 Karaf is an OSGi container. Classloaders are handled in a different way in
 OSGi.
 
 
 
 
 Third.
After fighting with dependencies for a long time. I repackaged
 hibernate, spring and friend into a new package. And found that nothing
 works together. I was smart enough to get spring 3.0.7-RELEASE that
 comes with karaf. But found following problem that I'm not able to
 solve:
 
 Creating a big bundle mean that you create a single classloader. It works
 but it's ugly IMHO.
 Fragment can do the trick too.
 
 I'm not sure to follow your issues with Hibernate and Spring.
 
 Regards
 JB
 
 
 
 
 
 But the class org/hibernate/cfg/Configuration is packaged with the rest.
 And it must find it. Where is the problem?
 
 I tried package different versions of hibernate that is the thing that I
 can touch. Because Spring is too much to repackage it. So I have to
 stick with the two versions included in the container, 3.0.7-RELEASE and
 3.1 whatever.
 
 Any help on how to make it work?
 
 
 I read everywhere: Switch to openJPA it does bundles and works better
 with OSGi. But I just have much built on hibernate and don't want to
 switch. I want to learn how to make every project work. Don't want to
 have to do a switch to another project everytime I have some missing
 package (bundle) that makes the project not to work on osgi.
 
 Thank you in advance.
 It will be a great project once this kind of problems are solved.  In
 effect cxf works great!
 
 
 ---
 
 Exception in thread SpringOsgiExtenderThread-4
 org.springframework.beans.factory.BeanCreationException: Error creating
 bean with name 'crmSessionFactoryBean' defined in URL
 [bundle://196.0:0/META-INF/spring/hibernate-spring-beans.xml]:
 Instantiation of bean failed; nested exception is
 org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class
 [org.springframework.orm.hibernate3.LocalSessionFactoryBean]:
 Constructor threw exception; nested exception is
 java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
at
 
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:964)
at
 
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:910)
at
 
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:484)
at
 
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory
 $1.getObject(AbstractBeanFactory.java:293)
at
 
 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
 
 

Re: JPA Usage: Strategy for using Hibernate + Postgresql

2012-10-26 Thread Johan Edstrom
I'll third that.
Very easy to setup, quite a bit faster thanks to much less reflection.


On Oct 26, 2012, at 5:17 AM, Achim Nierbeck bcanh...@googlemail.com wrote:

 I just can second that, I have no hassle in using JPA with Aries
 blueprint, jpa and OpenJPA in my projects ...
 
 regards, Achim
 
 2012/10/26 James Carman ja...@carmanconsulting.com:
 OpenJPA is much more OSGi-friendly.  You might give that a go.  We've
 switched and never looked back.
 
 On Fri, Oct 26, 2012 at 6:48 AM, dealbitte anand.boc...@gmail.com wrote:
 Hi
 
 I am trying to set up Hibernate and Postgresql in conjunction with Karaf. I
 have a maven project (archetype: osgi)  that depends on Hibernate and
 Postgresql and I want to install this project in karaf. I would like to know
 if there are design patterns to set up a JPA provider (like Hibernate) along
 with a database (like Postgres).
 
 I installed hibernate dependencies, via feature file shown below
 
  feature name=hibernate
bundlewrap:mvn:org.hibernate/hibernate-core/4.1.7.Final/bundle
 
 bundlewrap:mvn:org.hibernate/hibernate-entitymanager/4.1.7.Final/bundle
 
 bundlewrap:mvn:org.hibernate.javax.persistence/hibernate-jpa-2.0-api/1.0.1.Final/bundle
 
 bundlewrap:mvn:org.hibernate.common/hibernate-commons-annotations/4.0.1.Final/bundle
bundlewrap:mvn:org.jboss.logging/jboss-logging/3.1.0.GA/bundle
  /feature
 
 When I tried to install my bundle, it complains about missing
 'hibernate.cfg.xml' even though this is available inside the bundle.
 
 I am looking for some examples, tutorials that can help to understand the
 usage of JPA provider with database. I am not restricted to Hibernate and
 Postgres.
 
 regards,
 Rakesh
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/JPA-Usage-Strategy-for-using-Hibernate-Postgresql-tp4026586.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 
 
 
 -- 
 
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/
 Committer  Project Lead
 OPS4J Pax for Vaadin
 http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter  Project
 Lead
 blog http://notizblog.nierbeck.de/



Re: switch to github

2012-08-17 Thread Johan Edstrom
git-svn works really well

On Aug 17, 2012, at 4:51 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote:

 Yes, OPS4J Pax projects are NOT Apache projects, it's the main difference ;)
 More over, OPS4J directly use github, not Apache projects.
 
 Really, even using git, just do a git diff and attach (with ASF grant) into a 
 Karaf Jira, your patch will be included really quickly (quicker than via 
 github for sure).
 
 Regards
 JB
 
 On 08/18/2012 12:48 AM, Andrei Pozolotin wrote:
Jean-Baptiste:
 
1) last time you accepted my pull request
https://github.com/apache/karaf/pull/5
you had to re-process it by hand, and it is still not in svn; this
is just needless pain!
 
2) in comparison, after Achim gave me a blessing on my pax-url pull
https://github.com/ops4j/org.ops4j.pax.url/pull/4
 
I got my commit back as a snapshot the next day :-)
 
3) so, the essence of my proposal is this
you are still following  apache guidelines, but you use github as
primary commit source
 
Thank you,
 
Andrei
 
  Original Message 
 Subject: Re: switch to github
 From: Jean-Baptiste Onofré j...@nanthrax.net
 To: user@karaf.apache.org
 Date: Fri 17 Aug 2012 05:07:22 PM CDT
 Hi Andrei,
 
 We are several (it's my case), to already use git (with git-svn).
 
 For github, we already use it as source, as soon as they contain the
 correct grant, compliant with the Apache standard.
 
 There are already lot of developer that use Karaf github mirror. If
 you take a look on:
 https://github.com/apache/karaf
 
 you can see that we have 28 forks, pull requests, etc.
 
 As you said, we are an Apache project, and so some guidelines. There
 are still discussions in the ASF to provide a git service.
 
 So, be sure that we are following all discussions related to git, and
 we already know (and use since long time now ;)) that git is much
 appreciated ;)
 
 Regards
 JB
 
 On 08/17/2012 11:49 PM, Andrei Pozolotin wrote:
*Jean-Baptiste, and ALL:
*
I am sure you had chance to convince yourself that
git + fork/pull is better then svn + patch.txt
 
I understand that you have apache guidelines,
but the switch should be easy:
 
1) treat github as the primary commit source,
require every git pull to contain an apache one liner
 Grant license to ASF for inclusion in ASF works (as per the Apache
License http://www.apache.org/licenses/LICENSE-2.0§5)
 
2) replicate git to svn on schedule via hudson/jenkins job,
if github goes bust - just fall back to svn;
 
3) continue to produce snapshots and releases from svn
 
above all else, get an easy access to 500K github java developers
who are just eager to start committing to the karaf! :-)
 
what do you think?
 
Thank you,
 
Andrei
 
 
 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org
 http://blog.nanthrax.net
 Talend - http://www.talend.com



Re: switch to github

2012-08-17 Thread Johan Edstrom
It is really clear.
http://www.apache.org/dev/git.html


On Aug 17, 2012, at 5:42 PM, Brian Topping topp...@codehaus.org wrote:

 
 On Aug 18, 2012, at 2:11 AM, Jean-Baptiste Onofré j...@nanthrax.net wrote:
 
 When you are not committer on a project, and you contribute a patch, you 
 have to explicitly grant your license to ASF. To do that, you just mention 
 it by checking Grant ASF when attaching the file to the Jira.
 
 Yes, i appreciate that, but I thought we were trying to clarify whether 
 Github pulls were acceptable means of providing patches.  It seems that they 
 are not acceptable for non-committers, so the fact that there are pull 
 requests obscures the fact that those pull requests are unusable and 
 therefore not statistically relevant.  
 
 Having said that, it would be good to concretely clarify that Github pulls 
 are not acceptable for non-committers, avoiding any interpretation that 
 Github is a means by which non-committers can provide value to the project.  
 It's important because it is actually very difficult in my experience to get 
 patches applied, which dissuades people from contributing and makes it appear 
 that nobody is interested when there may in fact be many folks interested in 
 contributing but find it too unproductive to do so.  These misinterpretations 
 are very damaging to a project since valuable contributions (however small or 
 unimportant to one group) are never made, and folks of a mindset similar to 
 the person who never contributed do not in turn ever start using the project 
 because these features never made it in.
 
 This is very much an anti-pattern in ASF projects, but I've found it pretty 
 common as well, so please don't interpret this as me calling out Karaf in 
 particular.  
 
 Brian



Re: explicitly make one bundle aware of other ?

2012-06-22 Thread Johan Edstrom
If you actually want to shade cassandra the following works.
You just need to add the maven bundle plugin to this, you'll have a complete 
cassandra bundle that contains all the necessary bits and pieces.

?xml version=1.0 encoding=UTF-8?
project xmlns=http://maven.apache.org/POM/4.0.0;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
 parent
   artifactIdbundles/artifactId
   groupIdcom.savoirtech/groupId
   version1.0-SNAPSHOT/version
 /parent
 modelVersion4.0.0/modelVersion
 artifactIdcassandra-all/artifactId
 packagingbundle/packaging
 dependencies
   dependency
 groupIdorg.apache.cassandra/groupId
 artifactIdcassandra-all/artifactId
   /dependency
 /dependencies
 build
   plugins
 plugin
   artifactIdmaven-shade-plugin/artifactId
   executions
 execution
   phasepackage/phase
   goals
 goalshade/goal
   /goals
   configuration
 artifactSet
   includes
 include${pkgGroupId}:${pkgArtifactId}/include
   /includes
 /artifactSet
 filters
   filter
 artifact${pkgGroupId}:${pkgArtifactId}/artifact
 excludes
   exclude**/exclude
 /excludes
   /filter
 /filters
 promoteTransitiveDependenciestrue/promoteTransitiveDependencies
 createDependencyReducedPomfalse/createDependencyReducedPom
 
keepDependenciesWithProvidedScopetrue/keepDependenciesWithProvidedScope
   /configuration
 /execution
   /executions
 /plugin
   /plugins
 /build
 properties
   pkgVersion${cassandra.version}/pkgVersion
   pkgArtifactIdcommons-codec/pkgArtifactId
   
savoirtech.osgi.export.pkgorg.apache.cassandra.*;version=${cassandra.version},
 org.apache.thrift.*;version=${cassandra.version}
   /savoirtech.osgi.export.pkg
   pkgGroupIdcassandra-all/pkgGroupId
 /properties
/project

On Jun 22, 2012, at 9:17 PM, Chris Geer wrote:

 
 On Fri, Jun 22, 2012 at 7:46 PM, ramesh chandra tablet...@gmail.com wrote:
 On 06/22/2012 09:08 PM, Chris Geer wrote:
 On Fri, Jun 22, 2012 at 5:12 PM, ramesh chandra tablet...@gmail.com wrote:
 I have wrapped an external library ( Cassandra - Hector Client ) as a bundle 
 , but I am constantly getting a ClassNotFoundException. So , I tried passing 
 the missing (Thrift Library) after wrapping as a bundle, but it does not 
 help either.
 
 How did you go about making it a bundle?
 
 Is there any other way I can explicitly make one bundle aware of other ?
 
 You need to make sure two things happen. Your Cassandra bundle exports the 
 correct packages and your other bundle imports the correct packages.
 
 Just in case if anyone has see it , this is the error
 
 Caused by: java.lang. ClassNotFoundException: org.apache.thrift.transport. 
 TTransportException not found by me.prettyprint.hector [169]
 
   at org.apache.felix.framework. ModuleImpl. findClassOrResourceByDelegatio 
 n(ModuleImpl.java:787)
   at org.apache.felix.framework. ModuleImpl.access$400( ModuleImpl.java:71)
   at org.apache.felix.framework. ModuleImpl$ModuleClassLoader. 
 loadClass(ModuleImpl.java: 1768)
   at java.lang.ClassLoader. loadClass(ClassLoader.java: 247)[:1.6.0_26]
 
   ... 41 more
 
 appreciate any help
 
 kind regards,
 Ramesh
 
 Hi Chris,
 
 Thanks for the input. Karaf has a beautiful wrapper for external library 
 osgi:install wrap:mvn:Group/Artifact/version does a quick and easy install. 
 
 Have you checked the imports/exports of your bundles? From the Karaf console 
 headers bundle-id. 
 
 regards,
 Ramesh
 



Re: Install refresh issue

2012-06-11 Thread Johan Edstrom
It actually isn't how osgi package resolvers work, it is how the Spring-Osgi 
extender works.
Move this to Aries Blueprint.

On Jun 11, 2012, at 7:10 PM, Freeman Fang wrote:

 Hi,
 
 Yeah, it's nto a bug, it's just how OSGi package resolve works.
 Anyway, if you put spring feature also in your customer feature along with 
 the freemarker bunle, the spring bundle which have new optional import 
 package available can get refreshed automatically when you install your 
 customer feature, this is the default behavior from karaf feature service. 
 Your customer feature should be like
 
 feature name='your_customer_feature' version='...'
 feature version=[3,4)spring/feature
 
 bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker/2.3.18_1/bundle
 bundle...any bundle you need in your feature/bundle
 /feature
 
 The key point is you need put spring feature in your feature, so that all 
 bundles from spring feature are also in your feature, hence get chance to 
 refresh automatically if necessary when you install your_customer_feature.
 
 Freeman
 On 2012-6-12, at 上午2:44, Achim Nierbeck wrote:
 
 Hi,
 
 this is no bug this is actually a resolving issue.
 Since in your first startup the Spring Bundle was successfully
 resolved without the optional dependencies there was no need
 to refresh the bundle after the FreeMarker Bundle was installed.
 
 You might try to use the OBR-Resolver to work around this. This way
 the features-service might realize
 that a new opitonal dependency was installed and might refresh the
 Spring Bundle.
 
 If this still doesn't work I suggest writing a Fragment-Bundle that
 attaches to the Spring-bundle
 and alters the Import-Package of the Host-Bundle to work without the
 optional flag.
 If you keep this Fragment-Bundle with your Features it might work
 around this issue. Though a restart of the Host-Bundle
 might be needed also, but this way it'll survive a Server restart :)
 
 Regards, Achim
 
 2012/6/11 bobshort jer...@check-it.ca:
 Hi,
 
 Here is the scenario:
 
 1. I install the Karaf Spring feature.
 
 2. I install my feature which includes FreeMarker and uses Spring's
 SpringTemplateLoader class.
 
 When my bundle attempts to use the SpringTemplateLoader I get:
 
 /Caused by: java.lang.ClassNotFoundException:
 freemarker.cache.TemplateLoader
at
 org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)[osgi-3.6.2.R36x_v20110210.jar:]
at
 org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)[osgi-3.6.2.R36x_v20110210.jar:]
at
 org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)[osgi-3.6.2.R36x_v20110210.jar:]
at
 org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)[osgi-3.6.2.R36x_v20110210.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_29]
... 58 more/
 
 Once I refresh the Spring Context Support bundle and try again everything
 works fine. It seems that the Spring bundle cannot resolve the optional
 FreeMarker dependency until it is refreshed.
 
 Is this a bug, or is there a better way of installing my feature so I don't
 get the classloading exception?
 
 Thanks!
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Install-refresh-issue-tp4024804.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 
 
 
 -- 
 
 Apache Karaf http://karaf.apache.org/ Committer  PMC
 OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/
 Committer  Project Lead
 OPS4J Pax for Vaadin
 http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter  Project
 Lead
 blog http://notizblog.nierbeck.de/
 
 -
 Freeman Fang
 
 FuseSource
 Email:ff...@fusesource.com
 Web: fusesource.com
 Twitter: freemanfang
 Blog: http://freemanfang.blogspot.com
 http://blog.sina.com.cn/u/1473905042
 weibo: http://weibo.com/u/1473905042
 
 
 
 
 
 
 
 
 
 



Re: Costum distribution

2011-11-22 Thread Johan Edstrom
To add the dependency for 
org/apache/felix/org.apache.felix.framework/3.0.9/org.apache.felix.framework-3.0.9.jar

On Nov 22, 2011, at 10:46 AM, Filippo Balicchia wrote:

 Hello I am trying to build my costum distribution but at the moment to
 launch karaf get the following error
 
 Could not create framework: java.io.FileNotFoundException:
 /home/fbalicchia/projects/mykaraf/target/mycustom-karaf-1.0/org/apache/felix/org.apache.felix.framework/3.0.9/org.apache.felix.framework-3.0.9.jar
 
 Can you tell me what I forgot ?
 
 Cheers
 
 
 --Filippo
 
 
 My bin.xml looks like this.
 --from here--
 assembly
idbin/id
formats
formattar.gz/format
/formats
 
fileSets
 
!-- Expanded Karaf Standard Distribution --
fileSet
directorytarget/dependencies/apache-karaf-2.2.4/directory
outputDirectory//outputDirectory
excludes
exclude**/demos/**/exclude
excludebin/**/exclude
excludeetc/system.properties/exclude
excludeetc/users.properties/exclude
excludeetc/org.apache.karaf.features.cfg/exclude
excludeetc/org.ops4j.pax.logging.cfg/exclude
excludeLICENSE/exclude
excludeNOTICE/exclude
excludeREADME/exclude
excludeRELEASE-NOTES/exclude
excludekaraf-manual*.html/exclude
excludekaraf-manual*.pdf/exclude
/excludes
/fileSet
 
!-- Copy over bin/* separately to get the correct file mode --
fileSet
directorytarget/dependencies/apache-karaf-2.2.4/directory
outputDirectory//outputDirectory
includes
includebin/admin/include
includebin/karaf/include
includebin/start/include
includebin/stop/include
/includes
fileMode0755/fileMode
/fileSet
 
!-- Copy over jar files --
fileSet
directorytarget/dependencies/directory
includes
includemy-custom.jar/include
/includes
outputDirectory/lib//outputDirectory
/fileSet
 
fileSet
directorysrc/main/distribution/directory
outputDirectory//outputDirectory
fileMode0644/fileMode
/fileSet
fileSet
directorytarget/classes/etc/directory
outputDirectory/etc//outputDirectory
lineEndingunix/lineEnding
fileMode0644/fileMode
/fileSet
 
fileSet
directorytarget/features-repo/directory
outputDirectory/system/outputDirectory
/fileSet
 
/fileSets
 
files
file

 source/home/fbalicchia/projects/mykaraf/target/dependencies/apache-karaf-2.2.4/bin/karaf/source
outputDirectory/bin//outputDirectory
destNamemy-custom/destName
fileMode0755/fileMode
lineEndingunix/lineEnding
/file
/files
 /assembly
 --to here--
 
 my pom.xml
 
 --from here --
 ?xml version=1.0 encoding=UTF-8?
 project xmlns=http://maven.apache.org/POM/4.0.0;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://maven.apache.org/POM
 http://maven.apache.org/xsd/maven-4.0.0.xsd;
 modelVersion4.0.0/modelVersion
  groupIdmy.company/groupId
  artifactIdmycustom-karaf/artifactId
  version1.0/version
  packagingpom/packaging
  nameMy Unix Custom Karaf Distribution/name
 
  properties
karaf.version2.2.4/karaf.version
  /properties
 
  dependencies
dependency
  groupIdorg.apache.karaf/groupId
  artifactIdapache-karaf/artifactId
  version2.2.4/version
  typetar.gz/type
/dependency
dependency
  groupIdorg.apache.karaf.assemblies.features/groupId
  artifactIdstandard/artifactId
  version2.2.4/version
  typexml/type
  classifierfeatures/classifier
/dependency
dependency
  groupIdorg.apache.karaf.assemblies.features/groupId
  artifactIdenterprise/artifactId
  version2.2.4/version
  typexml/type
  classifierfeatures/classifier
/dependency
 
  /dependencies
 
   repositories
!-- Required to allow building with a snapshot of the NMR
 (parent POM) --
repository
idapache.snapshots/id
nameApache Snapshot Repository/name
urlhttp://repository.apache.org/snapshots/url
releases
enabledfalse/enabled
/releases
/repository
!-- Java.net Maven Repository, required by javax.mail --
repository
idjava.net/id
nameJava.net Maven2 Repository/name
urlhttp://download.java.net/maven/2/url
releases
enabledtrue/enabled
/releases
snapshots
enabledfalse/enabled
/snapshots
/repository
!-- JBoss Maven 

Re: Aries and Spring Co-Existance in Karaf

2011-11-01 Thread Johan Edstrom
I think you are reading this wrong.

Table 5.1. XML Configuration Differences


On Nov 1, 2011, at 8:15 AM, Raman Gupta wrote:

 In this example, how would the three contexts work together?  In my work, 
 I've seen coding like this where Spring is desired, and where Aries 
 blueprint doesn't provide the functionality Spring provides.  In that 
 environment, there is a movement towards Eclipse Gemini because it is 
 written to play nicely with Spring.  What I'd like to do is once and for 
 all, identify if Aries and Spring can work in the same bundle or not.  
 Normally what I hear is no, but from my prototyping, that response doesn't 
 hold water.  
 
 I believe Eclipse Gemini (AKA Spring DM 2.x) *can* mix and match
 Spring and Blueprint namespaces. There is an example shown here:
 
 http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html-single/#blueprint:differences:xml
 
 However, Karaf doesn't support DM 2 / Gemini at this time AFAIK.
 
 -- 
 Raman Gupta
 VIVO Systems
 http://vivosys.com



Re: Aries and Spring Co-Existance in Karaf

2011-11-01 Thread Johan Edstrom
If you use osgi services you can accomplish this.

On Nov 1, 2011, at 8:06 AM, mikevan wrote:

 
 
 Guillaume, 
 
 
 
 Consider the following use-case: 
 
 1) A bundle is activated by Aries Blueprint, and Blueprint consumes a osgi 
 service that provides a jms connection. (configured in an OSGI-INF/blueprint 
 directory) 
 
 2) The bundle uses spring-web to create a restful endpoint (configured in a 
 META-INF/spring directory). 
 
 3) The bundle uses camel to route between the restful endpoint and the jms 
 osgi service (the route is defined using java dsl). 
 
 
 
 This example, while not depicting the most optimal usage of these 
 technologies, is conceivable of something someone could try to do. As such, 
 it is an example of a scenario where three different contexts (blueprint, 
 camel, and spring) could be created. 
 
 
 
 In this example, how would the three contexts work together?  In my work, 
 I've seen coding like this where Spring is desired, and where Aries blueprint 
 doesn't provide the functionality Spring provides.  In that environment, 
 there is a movement towards Eclipse Gemini because it is written to play 
 nicely with Spring.  What I'd like to do is once and for all, identify if 
 Aries and Spring can work in the same bundle or not.  Normally what I hear is 
 no, but from my prototyping, that response doesn't hold water.  
 
 
 
 
 - Original Message -
 
 
 From: Guillaume Nodet [via Karaf] 
 ml-node+s922171n3470594...@n3.nabble.com 
 To: mikevan mvangeert...@comcast.net 
 Sent: Tuesday, November 1, 2011 9:01:47 AM 
 Subject: Re: Aries and Spring Co-Existance in Karaf 
 
 You can use OSGi services for that.  OSGi services can be exported and 
 imported irrespective of the underlying technology used. 
 
 
 On Tue, Nov 1, 2011 at 13:35, Raman Gupta  [hidden email]  wrote: 
 
 
 
 On 11/01/2011 06:05 AM, Ioannis Canellos wrote: 
 Let's not confuse blueprint with spring. Blueprint is 
 a declarative way to work with OSGi services and Spring is a framework 
 for creating applications. 
 I don't think that Aries has the same focus with Spring but with SpringDM. 
 
 You can always use both, if you have to go with Spring. 
 
 If I had to use Spring, I would use it only where its necessary and 
 for managing services etc I would use Aries. 
 Example: 
 In Cellar 90% of the modules use Aries, but there is a single module 
 that uses Spring/SpringDM. We don't have any problem with that. 
 
 What would have been nice is if Blueprint provided a way, out of the 
 box, to expose beans created by Spring or Guice to the Blueprint 
 context. That way, one could use the DI framework of choice / 
 annotations inside a bundle, while consistently using Blueprint as a 
 microservice layer. I'm surprised the Blueprint spec developers didn't 
 consider interop with existing DI frameworks as a first class spec 
 item. I suppose such functionality could still be implemented as a 
 Blueprint extension for each DI framework. 
 
 Regards, 
 Raman Gupta 
 VIVO Systems 
 http://vivosys.com 
 
 
 
 
 
 
 -- 
  
 Guillaume Nodet 
  
 Blog: http://gnodet.blogspot.com/ 
  
 Open Source SOA 
 http://fusesource.com 
 
 
 
 
 
 
 If you reply to this email, your message will be added to the discussion 
 below: 
 http://karaf.922171.n3.nabble.com/Aries-and-Spring-Co-Existance-in-Karaf-tp3438050p3470594.html
  
 To start a new topic under Karaf - User, email 
 ml-node+s922171n930749...@n3.nabble.com 
 To unsubscribe from Karaf - User, click here .
 
 -
 Mike Van  (All links open in new tabs)
 Committer - Kalumet 
 
 Atraxia Technologies 
 
 NCI Inc 
 
 Mike Van's Open Source Technologies Blog 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Aries-and-Spring-Co-Existance-in-Karaf-tp3438050p3470758.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Aries and Spring Co-Existance in Karaf

2011-11-01 Thread Johan Edstrom
Gotcha, that still would be an effect of the authors of Spring DM2 having the 
legacy schemas, 
I don;t really personally see why aries should support spring syntax if the 
standards agreed on 
one schema.

Just my 0.2 though.

/je

On Nov 1, 2011, at 8:33 AM, Raman Gupta wrote:

 On 11/01/2011 10:27 AM, Johan Edstrom wrote:
 I think you are reading this wrong.
 
 Table 5.1. XML Configuration Differences
 
 No. Scroll down to the end of that section.
 
 As mentioned before, in Spring DM one can mix and match the namespaces:
 
 [...snip...]
 
 The example above, uses the Spring beans, util, p, Spring Expression
 Language (SpEL) and the task namespace introduced in Spring 3.x, and
 Spring DM [ed: this should say Blueprint] namespace.
 
 -- 
 Raman Gupta
 VIVO Systems
 http://vivosys.com



Re: Upgrade to 2.2.4

2011-10-31 Thread Johan Edstrom
As in etc?

You'd want to svn checkin those configs or use diff?

/je

On Oct 31, 2011, at 10:58 PM, MehrCurry wrote:

 Hi,
 
 i think this topic must be a FAQ. But i did not found an answer anyway.
 
 I have a running karaf instance (Version 2.2.1) and would like to upgrade to
 Version 2.2.4 - without loosing configuration changes i made. Any hints for
 me?
 
 Regards,
 
 Guido
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Upgrade-to-2-2-4-tp3469881p3469881.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Error Karaf 2.0 - No feature named 'spring' with version '[3,4)' available

2011-10-26 Thread Johan Edstrom
You'll want a newer karat for that.

On Oct 26, 2011, at 18:13, Matt Madhavan mattmadha...@gmail.com wrote:

 Hello,
 I'm trying to install Camel in Karaf 2.0. I'm getting the error when I do
 *features:install camel*
 
 /Error executing command: No feature named 'spring' with version '[3,4)'
 available
 /
 
 I have spring feature 3.0.5 installed!
 [installed  ] [3.0.5.RELEASE ] spring 
 karaf-2.0.0
 
 Any ideas please?
 
 Thanks in advance!
 
 Matt
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Error-Karaf-2-0-No-feature-named-spring-with-version-3-4-available-tp3456296p3456296.html
 Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Aries and Spring Co-Existance in Karaf

2011-10-20 Thread Johan Edstrom
It creates a bp context.
no.
Depends. - SpringProxy issues comes to mind as well as glib usage.

On Oct 20, 2011, at 9:31 AM, mikevan wrote:

 I have some questions about how Spring and Aries co-exist in Karaf.
 
 1) If you have an application that uses aries blueprint, does aries
 blueprint create its own application context for bundles?
 2) Can applications that rely heavily on spring annotations work inside of a
 blueprint environment?
 3) Can a bundle using aries successfully wire to a bundle that uses
 springdm?
 
 -
 Mike Van  (All links open in new tabs)
 Committer - Kalumet 
 
 Atraxia Technologies 
 
 NCI Inc 
 
 Mike Van's Open Source Technologies Blog 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Aries-and-Spring-Co-Existance-in-Karaf-tp3438050p3438050.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Aries and Spring Co-Existance in Karaf

2011-10-20 Thread Johan Edstrom
A bundle that is activated by blueprint would not activate springs 
AnnotationProcessors, 
nor do I think they would work as you'd have no application context.

Sure they publish/consume services. 
Spring relies heavily on proxies / cglib / aopalliance and whatnot-else, 
the actual implementation of say a Dao may be quite far from what you actually 
expect.

Niether extender does more than try to publish / subscribe events from the osgi 
service-registry.

You'd run into the same thing expecting Spring annotations to work magically in 
guice.

/je
On Oct 20, 2011, at 9:48 AM, mikevan wrote:

 Regarding question 2: I'm wondering why this would be the case.  If you have
 a bundle that is activated by aries blueprint, and if that bundle then uses
 Spring annotations internally, wouldn't a spring context be created within
 the blueprint context?  If this is true, then wouldn't the annotations be
 usable?  If not, this seems like a strong use-case against migration to
 blueprint for bundles that use spring annotations.
 
 Regarding question 3: Doesn't the underlying OSGi framework manage wiring? 
 I understand that both Aries and SpringDM have thier own extender bundles
 that appear to manage wiring, but don't they both leverage the wiring
 capability of the underlying framework?  If so, wouldn't the extenders
 share wiring information based on the underlying framework's wiring
 mechanism?
 
 
 Johan Edstrom-2 wrote:
 
 It creates a bp context.
 no.
 Depends. - SpringProxy issues comes to mind as well as glib usage.
 
 On Oct 20, 2011, at 9:31 AM, mikevan wrote:
 
 I have some questions about how Spring and Aries co-exist in Karaf.
 
 1) If you have an application that uses aries blueprint, does aries
 blueprint create its own application context for bundles?
 2) Can applications that rely heavily on spring annotations work inside
 of a
 blueprint environment?
 3) Can a bundle using aries successfully wire to a bundle that uses
 springdm?
 
 -
 Mike Van  (All links open in new tabs)
 Committer - Kalumet 
 
 Atraxia Technologies 
 
 NCI Inc 
 
 Mike Van's Open Source Technologies Blog 
 --
 View this message in context:
 http://karaf.922171.n3.nabble.com/Aries-and-Spring-Co-Existance-in-Karaf-tp3438050p3438050.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 
 
 
 -
 Mike Van  (All links open in new tabs)
 Committer - Kalumet 
 
 Atraxia Technologies 
 
 NCI Inc 
 
 Mike Van's Open Source Technologies Blog 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Aries-and-Spring-Co-Existance-in-Karaf-tp3438050p3438104.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Running Karaf without PAX Logging

2011-10-15 Thread Johan Edstrom
The osgi standards are properties based, just like all old log4j config files.
Having it as config admin allows JMX bundles, etc etc to participate in the 
logging setup.

An XML config file would in the current environment require something like
an MBean, a parser, possibly a config injector etc etc.


On Oct 14, 2011, at 9:21 AM, ceki wrote:

 
 On Oct 14, 2011 3:47:54 am Guillaume Nodet wrote:
  The main problem I see with logback is that there's no properties
  based configuration for logback.
 
  That's a real problem imho because we would not be able to leverage
  the OSGi ConfigAdmin which is a key point in order to have a clean
  interaction point with all configurations.  If you are aware of
  anything that would look like a properties based configurator for
  logback, things may changed.
 
 Hello Guillaume,
 
 I am puzzled by the your remark. Logback can be configured via
 configuration files in XML or groovy format. It can also be configured
 programmatically via an API. (XML/groovy configuration invoke this API
 underneath). Logback can also be interrogated programmatically. For
 example, you can get obtain the list of existing logger and get (or
 set) the level of any logger.
 
 Why on earth would you care that logback does not support
 configuration files in properties format? What am I missing?
 
 Best regards,
 --
 Ceki



Re: Hi Johan - Regarding signing the Apache contributor paperwork

2011-09-30 Thread Johan Edstrom
Excellent!

The first step is to file the icla, that gives you wiki karma, then I'd
look at documentation, examples as well as low-hanging fruit in the Jiras.

-- This would go for all open source projects I think.

Cheers!

On Fri, Sep 30, 2011 at 12:08 PM, Matt Madhavan mattmadha...@gmail.comwrote:

 Hi Johan,
 In response your reply as below:

 /Matt,

 Since you are a person that we've noticed.
 You are active, post really good questions and provide really good feedback
 - would you mind helping
 us in signing the Apache contributor paperwork and possibly helping us fix
 up the Jira?

 Thank you! /

 Its my honour being invited to the Apache Family. Please note that even
 though I have been using open source for a long time I have never
 contributed back. I do not have any experience.

 I would love to get involved. But I need some help in the beginning. Some
 pointers, some guidelines to get me started. I have been in conversation
 with Andreas regarding this. Andreas is going to send me some
 pointers/guidlines as well. I would like get involved in some thing small
 to
 start with and get going much further as I gain more insights.

 Please let me know I can I get involved slowly with out biting too much in
 the beginning. I would like to be useful.

 Thanks for the invite!

 Matt G. Madhavan



 --
 View this message in context:
 http://karaf.922171.n3.nabble.com/Hi-Johan-Regarding-signing-the-Apache-contributor-paperwork-tp3383212p3383212.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: EBA and Karaf - Can I install an EBA to KARAF

2011-09-28 Thread Johan Edstrom
Matt, 

Since you are a person that we've noticed.
You are active, post really good questions and provide really good feedback - 
would you mind helping 
us in signing the Apache contributor paperwork and possibly helping us fix up 
the Jira?

Thank you!

On Sep 28, 2011, at 6:07 PM, Matt Madhavan wrote:

 Oh BTW,
 I copied the the eba to the deploy folder as well! Noting happens and no log
 neither
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/EBA-and-Karaf-Can-I-install-an-EBA-to-KARAF-tp3377768p339.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: ActiveMq Listening on tcp6

2011-09-14 Thread Johan Edstrom
You probably have your hosts file kinda fuubared.

You can try supplying : -Djava.net.preferIPv4Stack=true

Or completely disabling ipv6, 

or listening to 0.0.0.0 


On Sep 14, 2011, at 2:40 PM, Geoffry Roberts wrote:

 Gareth,
 
 Tried telnet and got the following:
 
 telnet: could not resolve 192.168.40.140:61616/telnet: Name or service not 
 known
 
 
 On 14 September 2011 13:38, Geoffry Roberts geoffry.robe...@gmail.com wrote:
 Gareth,
 
 This is what I get from netstat -anp --tcp:
 
 tcp6   0  0 127.0.0.1:61616 :::*LISTEN
   - 
 
 It's that tcp6 business that concerns me.  
 
 See below:
 
 On 14 September 2011 13:12, Gareth gareth.o.coll...@gmail.com wrote:
 Hello Geoffry,
 
 On the machine with your broker, do you see the following in netstat?:
 
 tcp0  0 :::server_ip:61616 :::*
 LISTEN
 tcp0  0 :::127.0.0.1:61616  :::*
 LISTEN
 
 If yes, from the consumer machine, can you now run:
 
 telnet server_ip 61616
 
 I'll have to install telnet first. 
 
 and connect (to confirm the port is really accessible)? If yes, this is now
 an issue on your consumer.
 
 I am not understanding one thing though. How were you configuring your
 broker originally? I was expecting you to update an existing broker
 configuration file (whether it be outside OSGi, or defined inside OSGi as a
 spring-dm/blueprint file)...rather than creating a new one.
 
 I had a file called localhost-broker.xml that I created from the karaf client 
 command line. (I don't recall the exact command I ran.)  It contained a 
 transport connector element similar to what you have prescribed.  As I 
 thrashed around, trying to get this thing to work, I removed it because none 
 of the sketchy documentation I was referencing seemed to include it.
 
 regards,
 Gareth
 
 
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/ActiveMq-Listening-on-tcp6-tp3334296p3337007.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 
 
 
 -- 
 Geoffry Roberts
 
 
 
 
 -- 
 Geoffry Roberts
 



Re: Karaf Forum Query

2011-08-11 Thread Johan Edstrom
Oh, that is a common request.

Did you make sure you deleted your old email address?
Then more importantly, did you make sure you deleted all the address book 
entries you have so 
none of these can send to you?

After that I'd make sure I just bin any emails coming from the mailing list 
maintainer.

/je
On Aug 11, 2011, at 9:48 PM, Gnanaguru S wrote:

 Hi 
 
 I want to use the discussion forums, but i dont want all the conversaions to
 be sent as a mail. To stop receiving mails what should i do. Since i deleted
 the welcome mail which has controls.
 
 Help out
 
 Regards
 Guru
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/Karaf-Forum-Query-tp3248199p3248199.html
 Sent from the Karaf - User mailing list archive at Nabble.com.



Re: Hibernate in Karaf

2011-05-11 Thread Johan Edstrom

Loaded/Resolved/Installed/Started etc, are more of osgi lifecycle than karaf 
pertaining.
In the end of the day, they are loaded into felix/equinox.

This whole discussion is also dependent on how you actually load classes, if 
you use spring and so on.
Something like slf4j's logback will pick up fragments after the host was loaded 
if you want, they actively 
check the classpath for changes.

http://gnodet.blogspot.com/2010/03/spring-dm-aries-blueprint-and-custom.html




On May 11, 2011, at 10:44 AM, Bengt Rodehav wrote:

 OK guys - so what is the collective wisdom here?
 
 Seems like the fragment must be loaded before the host otherwise the host 
 must be refreshed after the fragment is loaded. Is that correct? That theory 
 supports my findings.
 
 Then there is a question about what loaded really means. I have a feeling  
 that the important thing is that the host is not resolved before the fragment 
 is available. Don't know what available means here but I gues installed 
 should do it - right?
 
 The resolving process in Karaf is a bit of a mystery to me. It seems I can 
 install/start bundles in at least three ways in Karaf: startup.properties, 
 drop in deploy folder and using Karaf features. Then what bundles are 
 available when bundles in startup.properties are resolved? What bundles are 
 available when bundles in the deploy folder are resolved? What bundles are 
 available when bundles in Karaf features are resolved?
 
 I would really appreciate if someone could explain this because I think it's 
 critical to know how this works when using Karaf.
 
 Like I wrote in a previous post (same conversation I think), ideally Karaf 
 would install all bundles (from startup.properties, deploy folder, features) 
 before any of them were resolved. Then we wouldn't have this problem at all 
 (or am I fooling myself here?).
 
 /Bengt
 
 
 
 2011/5/11 mikevan mvangeert...@comcast.net
 
 
 Confirmed.  I use an antlr-hibernate fragment to allow Hibernate to play well 
 with mysql, and I always load the fragment first.  No real reason why, that's 
 just how I roll, yo. :-)
 
 
 
 Mike Van
 
 
 - Original Message -
 From: Johan Edstrom-2 [via Karaf] 
 ml-node+2927872-15445059-228...@n3.nabble.com
 To: mikevan mvangeert...@comcast.net
 Sent: Wednesday, May 11, 2011 11:54:03 AM
 Subject: Re: Hibernate in Karaf
 
 You can load fragements after the host.
 
 On May 11, 2011, at 9:34 AM, Achim Nierbeck wrote:
 
 
  Ah, you're right forgot about the startlevel has no impact on
  fragments since those are not start-able.
  Never the less you need to make sure it is loaded before the host
  bundle is started because to my
  understanding the host-bundle takes care about attaching the fragment
  to it, uncertain about this
  but this is what I have seen so far.
 
  2011/5/11 Bengt Rodehav  [hidden email] :
  That was my understanding too. Can you elaborate? Is there an easy way to
  accomplish what I want?
 
  /Bengt
 
  Den 11 maj 2011 17.22 skrev Charles Moulliard  [hidden email] :
  start level is not relevant
 
 
  On Wed, May 11, 2011 at 5:13 PM, Bengt Rodehav  [hidden email]  wrote:
  Achim,
  I tried giving the fragment start level 40 which I think is lower than
  the
  default for features but it doesn't help. Are you sure that the start
  level
  is relevant?
  /Bengt
 
  2011/5/11 Bengt Rodehav  [hidden email] 
 
  Thanks a lot Achim - I'll give it a try.
  I though start levels didn't matter. I had a feeling that it was the
  resolving phase that was important...
  /Bengt
 
  2011/5/11 Achim Nierbeck  [hidden email] 
 
  Ok,
 
  another race here :-)
  for a fragment to be found by the hostbundle it needs to be available
  before the host is started. That's the only downside that just came to
  my mind.
  So to fix this in your fragment you need to make sure it has a
  slightly lower startlevel then your spring-orm bundle. For example set
  the startlevel of your
  fragment to 50 and the one of the spring-orm bundle to 51, that should
  pretty much solve it :-)
 
  Regards, Achim
 
  2011/5/11 Bengt Rodehav  [hidden email] :
  Achim,
  It turns out I need your trick anyway. I depend on spring-aop finding
  aspectj stuff. I therefore created a fragment using your trick. It
  works.
  However, presently I hot deploy it in the deploy directory (seems to
  be
  resolved before the features if I do it that way...). But I would
  like
  to
  deploy it using Karaf features like this:
 
feature name=trs-persistence version=${project.version}
 
 
 
  bundlemvn:se.digia.trs.persistence/spring-aop-fragment/${project.version}/bundle
  feature version=${project.version}trs-hibernate/feature
  feature version=${project.version}trs-util/feature
 
 
 
  bundlewrap:mvn:sqlserver-2005/jdbc-driver/${sqlserver-2005-jdbc-version}/bundle
 
 
  bundlemvn:commons-pool/commons-pool/${commons-pool-version}/bundle
 
 
  bundlemvn:commons-dbcp/commons-dbcp/${commons-dbcp-version}/bundle

Re: Hibernate in Karaf

2011-05-11 Thread Johan Edstrom
Oh, I don't disagree :)

I've managed to get around some of those types of install issues in spring with

features:install -r myfeature


And - 

disabling springs context publishing.


On May 11, 2011, at 11:30 AM, Bengt Rodehav wrote:

 Johan,
 
 Yes, OSGi aware/friendly applications are more dynamic in nature but 
 unfortunately I'm presently stuck with Spring+Hibernate.
 
 I think that my idea that all bundles should be installed before any bundle 
 is resolved would make it a lot easier to use non-OSGi friendly 
 applications. Face it, it will take a long time before all bundles you 
 install will handle the dynamic nature of OSGi. Meanwhile we need a good way 
 of coping with them.
 
 Of course, if you actually install bundles (manually) in an already running 
 container then there is not much Karaf can do. But, in my case, Karaf knows 
 from startup exactly what bundles I want to install and should be able to 
 take all of them into account in the same pass. Karaf just needs to parse 
 startup.properties, check the deploy folder, and walk the features that I 
 have specified to be started. It doesn't sound like rocket science to me :-)
 
 BTW I only get this problems when installing bundles (with an empty data 
 folder). If I restart Karaf after all the bundles are installed then there is 
 no problem. I guess that it's because all bundles are installed in the bundle 
 cache and are therefore available at resolve time.
 
 /Bengt
 
 2011/5/11 Johan Edstrom seij...@gmail.com
 
 Loaded/Resolved/Installed/Started etc, are more of osgi lifecycle than 
 karaf pertaining.
 In the end of the day, they are loaded into felix/equinox.
 
 This whole discussion is also dependent on how you actually load classes, if 
 you use spring and so on.
 Something like slf4j's logback will pick up fragments after the host was 
 loaded if you want, they actively
 check the classpath for changes.
 
 http://gnodet.blogspot.com/2010/03/spring-dm-aries-blueprint-and-custom.html
 
 
 
 
 On May 11, 2011, at 10:44 AM, Bengt Rodehav wrote:
 
  OK guys - so what is the collective wisdom here?
 
  Seems like the fragment must be loaded before the host otherwise the host 
  must be refreshed after the fragment is loaded. Is that correct? That 
  theory supports my findings.
 
  Then there is a question about what loaded really means. I have a feeling 
   that the important thing is that the host is not resolved before the 
  fragment is available. Don't know what available means here but I gues 
  installed should do it - right?
 
  The resolving process in Karaf is a bit of a mystery to me. It seems I can 
  install/start bundles in at least three ways in Karaf: startup.properties, 
  drop in deploy folder and using Karaf features. Then what bundles are 
  available when bundles in startup.properties are resolved? What bundles 
  are available when bundles in the deploy folder are resolved? What 
  bundles are available when bundles in Karaf features are resolved?
 
  I would really appreciate if someone could explain this because I think 
  it's critical to know how this works when using Karaf.
 
  Like I wrote in a previous post (same conversation I think), ideally Karaf 
  would install all bundles (from startup.properties, deploy folder, 
  features) before any of them were resolved. Then we wouldn't have this 
  problem at all (or am I fooling myself here?).
 
  /Bengt
 
 
 
  2011/5/11 mikevan mvangeert...@comcast.net
 
 
  Confirmed.  I use an antlr-hibernate fragment to allow Hibernate to play 
  well with mysql, and I always load the fragment first.  No real reason why, 
  that's just how I roll, yo. :-)
 
 
 
  Mike Van
 
 
  - Original Message -
  From: Johan Edstrom-2 [via Karaf] 
  ml-node+2927872-15445059-228...@n3.nabble.com
  To: mikevan mvangeert...@comcast.net
  Sent: Wednesday, May 11, 2011 11:54:03 AM
  Subject: Re: Hibernate in Karaf
 
  You can load fragements after the host.
 
  On May 11, 2011, at 9:34 AM, Achim Nierbeck wrote:
 
 
   Ah, you're right forgot about the startlevel has no impact on
   fragments since those are not start-able.
   Never the less you need to make sure it is loaded before the host
   bundle is started because to my
   understanding the host-bundle takes care about attaching the fragment
   to it, uncertain about this
   but this is what I have seen so far.
  
   2011/5/11 Bengt Rodehav  [hidden email] :
   That was my understanding too. Can you elaborate? Is there an easy way to
   accomplish what I want?
  
   /Bengt
  
   Den 11 maj 2011 17.22 skrev Charles Moulliard  [hidden email] :
   start level is not relevant
  
  
   On Wed, May 11, 2011 at 5:13 PM, Bengt Rodehav  [hidden email]  wrote:
   Achim,
   I tried giving the fragment start level 40 which I think is lower than
   the
   default for features but it doesn't help. Are you sure that the start
   level
   is relevant?
   /Bengt
  
   2011/5/11 Bengt Rodehav  [hidden email] 
  
   Thanks a lot Achim - I'll give

Re: Hibernate in Karaf

2011-05-10 Thread Johan Edstrom
The webinars are not out, but I can assure you
that using openjpa and aries TX/JPA in  the long run
will have you much happier with its behavior in an osgi environment.


/je

On May 10, 2011, at 7:38 AM, Charles Moulliard wrote:

 For those interested, I have created a tutorial 2 years ago --
 http://camel.apache.org/tutorial-osgi-camel-part2.html
 
 Remarks :
 
 - It is based on ServiceMix but could be adapted easily adapted for
 its little brother Karaf,
 - Next month, I will present two FuseSource webinars about persistence
 and camel (part 1 will cover camel and components while the second
 part will focus on JPA, JTA using OpenJPA on ServiceMix)
 
 2011/5/10 Michael Täschner m.taesch...@googlemail.com:
 Hi Bengt,
 
 I have been following this discussion very closely and would be very
 interested if you can integrate Achims suggestions. If this works, can you
 provide a short guide for using Hibernate in Karaf ?
 
 Thanks and Regards,
 Michael
 
 2011/5/10 Bengt Rodehav be...@rodehav.com
 
 Thanks Achim - I'll give it a try,
 /Bengt
 
 2011/5/10 Achim Nierbeck bcanh...@googlemail.com
 
 Bengt,
 
 sorry I don't have one around but it's quite simple.
 
 do a headers command on the spring-orm  bundle
 copy the imports for hibernate.
 
 Now create a simple project where you create a manifest, in that
 manifest you declare
 imports-package: with the imports you just have copied from the
 headers command. Remove the optional part
 add a
 fragment-host: com.springsource.orm (the bundle id of the spring-orm jar)
 
 and that's it :-)
 
 regards, Achim
 
 
 2011/5/10 Bengt Rodehav be...@rodehav.com:
 Achim and Charles,
 I also normally use OpenJPA but I'm trying to migrate an existing
 application (running on ServiceMix 3.X using JBI + Spring/Hibernate) to
 Apache Karaf + Camel. Long term I'd like to get rid of Hibernate but
 it's
 not possible to do it in the short timeframe that I have.
 Achim, can you send me examples of how you create a fragment bundle to
 change optional imports to mandatory? I've never done that before.
 /Bengt
 
 2011/5/10 Achim Nierbeck bcanh...@googlemail.com
 
 Bengt,
 
 yes those Spring bundles do all kinds of optional imports, that's why
 you sometimes end up in this
 inconvenient position where you think you have all that needs to be
 provided available but still since
 one of those bundles is already resolved nothing works.
 That's why I made those extra fragments to switch optional imports
 into required ones.
 
 For investigation I recommend using package:imports/exports and
 headers on the Karaf shell for getting detailed informations.
 
 regards, Achim
 
 2011/5/10 Bengt Rodehav be...@rodehav.com:
 Thanks for your reply Charles,
 Yes, the direct cause is the exception you specify. However,
 everything
 works fine if I include spring-orm as a private package. Thus, there
 is
 nothing wrong with my spring context definition file per se. I'm
 sure
 the
 problem has to do with classloading/bundle resolving stuff.
 Perhaps it's because spring-aop is already installed? Maybe it's not
 enough
 delaying the resolving of spring-orm, perhaps spring-aop must also
 resolve
 after my classes are installed?
 I'm using spring-aop to define transaction attributes for my spring
 beans.
 /Bengt
 
 2011/5/10 Charles Moulliard cmoulli...@gmail.com
 
 Hi Bengt,
 
 Your problem is linked to this error (from your stacktrace)
 
 Caused by: java.lang.IllegalStateException: Expecting raw type,
 not:
 org.springframework.beans.factory.FactoryBean
at
 
 
 org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:37)[47:com.springsource.org.aspectj.weaver:1.6.6.RELEASE]
 
 Regards,
 
 Charles Moulliard
 
 Sr. Principal Solution Architect - FuseSource
 Apache Committer
 
 Blog : http://cmoulliard.blogspot.com
 Twitter : http://twitter.com/cmoulliard
 Linkedin : http://www.linkedin.com/in/charlesmoulliard
 Skype: cmoulliard
 
 
 
 On Tue, May 10, 2011 at 12:16 PM, Bengt Rodehav be...@rodehav.com
 wrote:
 Achim,
 You're right that the problem concerns spring-orm. If I specify
 org.springframework.orm* as a private package (so that it is
 included
 in
 my
 bundle) and I also specify the following dynamic imports:
 
 
 
 
 
 org.springframework.aop,org.springframework.aop.*,org.aopalliance.aop,org.hibernate.*,net.sf.cglib.*
 
 ...then it works. But I can't seem to find a way to use an
 already
 installed
 spring-orm bundle. So, it sounds like the problem you describe
 but in
 my
 case spring-orm is not installed until I install it as part of my
 feature,
 as follows:
 
 ...
   feature name=trs-persistence version=${project.version}
 feature version=${project.version}trs-util/feature
 
 
 
 bundlemvn:org.springframework/spring-aop/${spring-version}/bundle
 
 
 
 bundlemvn:org.springframework/spring-jdbc/${spring-version}/bundle
 
 
 
 bundlemvn:org.springframework/spring-orm/${spring-version}/bundle
 
 
 
 
 bundlemvn:org.springframework/spring-transaction/${spring-version}/bundle
 
 

Re: JSR-330 Dependency Injection with KARAF ?

2011-04-22 Thread Johan Edstrom
There are extensions to guice (peaberry) that deal with services registration 
and such.
It is quite simple to use.

If you do not need services exchanges, guice works great in an osgi environment.
And combining Blueprint with guice also works quite well.


On Apr 22, 2011, at 1:42 PM, Cristiano Gavião wrote:

 Hi people,
 
 Today I was studying a little more about the options that we have on DI area 
 with OSGi environment.
 
 I could see that Blueprint is the actual standard DI for OSGi, and that we 
 could also use spring DM.
 
 I have been using @inject from JSR-330 (Dependency Injection for Java 
 specification) with our web and desktop applications (that we are intend to 
 migrate to OSGi).
 
 And I could find that there is Google Guice for OSGi...but I couldn't find 
 any information about its use with Karaf, yet. 
 
 My question: is the use of JSR-330 a valid approach with OSGi and 
 particularly with Karaf ?
 
 thanks for any comment
 
 Cristiano



Re: how to integrate Spring-dm with Hibernate

2011-03-18 Thread Johan Edstrom
I'd strongly suggest you use Aries and Openjpa

On Mar 18, 2011, at 9:25, Ioannis Canellos ioca...@gmail.com wrote:

 Hi stream,
 
 I have spent some time on this problem and here are my tips:
 
 If you are going to use jpa 2 which translates to hibernate version over 3.5, 
 then you will have hard time finding a bundle (I would suggest you try this 
 https://issues.apache.org/jira/browse/SMX4-715 its more recent that the one I 
 made for my blog).
 if you are going to use apache aries (which I recommend), then your hibernate 
 bundle will need to register a javax.persistence.spi.PersistenceProvider 
 service.
 I haven't tried springsource hibernate bundles (which are for older version 
 of hibernate) but they may worth trying.
 
 
 On Fri, Mar 18, 2011 at 10:24 AM, stream stream1...@gmail.com wrote:
 Thanks all guys.
 
 i will try all of your post  in turn.
 if i got some result, i will put it here
 
 thanks again.
 
 --
 View this message in context: 
 http://karaf.922171.n3.nabble.com/how-to-integrate-Spring-dm-with-Hibernate-tp2692712p2697176.html
 Sent from the Karaf - User mailing list archive at Nabble.com.
 
 
 
 -- 
 Ioannis Canellos
  http://iocanel.blogspot.com
 
 Apache Karaf Committer  PMC
 Apache ServiceMix  Committer
 
 
 
 
 


Re: Race between Features and Spring/Blueprint XML

2011-03-09 Thread Johan Edstrom
'm just now moving a project to blueprint, here is an example camel setup that 
works really well (Thanks jgenender)

This is using aries JNDI/transaction and persistence.


?xml version=1.0 encoding=UTF-8?
blueprint default-activation=lazy
  xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0;
  xmlns:camel-bp=http://camel.apache.org/schema/blueprint;
  xmlns:tx=http://aries.apache.org/xmlns/transactions/v1.0.0;
  xsi:schemaLocation=
   http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
   http://camel.apache.org/schema/blueprint 
http://camel.apache.org/schema/blueprint.xsd
   

 cm:property-placeholder persistent-id=wcsri

   cm:default-properties

 !-- Security --
 cm:property name=wcs.securityEnabled value=false/
 cm:property name=wcs.securityRealm value=nnew/

 !-- AMQ specific --
 cm:property name=amq.http.connector.url value=tcp://localhost:61616/
 cm:property name=submgt.abandoned.days value=30/
 cm:property name=submgt.deleted.hold.days value=15/
 cm:property name=submgt.transformer.list
  value=DESCRIPTION 
COVERAGE|jms:queue:pubsub.xformer.DescribeCoverage,GET 
COVERAGE|jms:queue:pubsub.xformer.GetCoverage/

   /cm:default-properties

 /cm:property-placeholder

 camel-bp:camelContext xmlns=http://camel.apache.org/schema/blueprint; 
id=sub-management
   !-- Handles the ack messages --
   route
 from uri=jms:topic:ActiveMQ.Advisory.MessageConsumed.TempQueue./
 to uri=ackProcessor/
   /route
   !-- Handles the queue access/disconnect messages --
   route
 from uri=jms:topic:ActiveMQ.Advisory.TempQueue/
 to uri=connectionProcessor/
   /route
   !-- Handles the handshake --
   route
 from uri=jms:queue:pubsub.handshake/
 to uri=handshakeProcessor/
   /route
   !-- Handles the cleanup of the subscription meta data --
   route
 !-- Fire quartz every 5 minutes --
 from uri=timer://foo?fixedRate=trueamp;period=60/
 !--
 from uri=quartz://cleanup?cron=0+0/5+*+*+*+?/
 --
 to uri=cleanupProcessor/
   /route
 /camel-bp:camelContext

 bean id=transformerHandler 
class=edu.ucar.ral.wcsri.pubsub.sm.hidden.TransformerHandler
   argument value=${submgt.transformer.list}/
 /bean

 !-- TransformerInformation --
 bean id=transformerInformationService 
class=edu.ucar.ral.wcsri.pubsub.sm.TransformerInformationServiceImpl
   property name=transformerHandler ref=transformerHandler/
 /bean

 !-- Authentication Service --
 bean id=jaasAuthenticationService 
class=edu.ucar.ral.security.jaas.authentication.JAASAuthenticationService/

 !-- Ack Processor --
 bean id=ackProcessor 
class=edu.ucar.ral.wcsri.pubsub.sm.hidden.AckProcessor
   property name=messageDAO ref=messageDAO/
   property name=eventProducerId value=AckProcessor/
   property name=eventProducerDAO ref=eventProducerDAO/
   property name=idempotentRepository ref=idempotentRepository/
   tx:transaction method=process* value=Required/
 /bean

 !-- Connection Processor --
 bean id=connectionProcessor 
class=edu.ucar.ral.wcsri.pubsub.sm.hidden.ConnectionProcessor
   property name=subscriptionDAO ref=subscriptionDAO/
   property name=eventProducerId value=ConnectionProcessor/
   property name=eventProducerDAO ref=eventProducerDAO/
   property name=idempotentRepository ref=idempotentRepository/
   tx:transaction method=process* value=Required/
 /bean

 !-- Handshake Processor --
 bean id=handshakeProcessor 
class=edu.ucar.ral.wcsri.pubsub.sm.hidden.HandshakeProcessor
   property name=subscriptionDAO ref=subscriptionDAO/
   property name=messageDAO ref=messageDAO/
   property name=jmsTemplate ref=jmsTemplate/
   property name=securityEnabled value=${wcs.securityEnabled}/
   property name=securityRealm value=${wcs.securityRealm}/
   property name=authenticationService ref=jaasAuthenticationService/
   property name=streamingFactory ref=streamingFactory/
   tx:transaction method=process* value=Required/
 /bean

 !-- Cleanup Processor --
 bean id=cleanupProcessor 
class=edu.ucar.ral.wcsri.pubsub.sm.hidden.CleanupProcessor
   property name=abandonedDays value=${submgt.abandoned.days}/
   property name=deletedHoldDays value=${submgt.deleted.hold.days}/
   property name=subscriptionDAO ref=subscriptionDAO/
   property name=messageDAO ref=messageDAO/
   property name=eventProducerId value=CleanupProcessor/
   property name=eventProducerDAO ref=eventProducerDAO/
   property name=idempotentRepository ref=idempotentRepository/
   tx:transaction method=process* value=Required/
 /bean

 !-- Spring JMS Template --
 bean id=jmsTemplate class=org.springframework.jms.core.JmsTemplate
   property name=connectionFactory ref=jmsConnectionPool/
 /bean

 bean id=jms class=org.apache.camel.component.jms.JmsComponent
   property name=connectionFactory