Web Development with Karaf: Eclipse integration

2011-03-09 Thread stephanisworking
Hi all,

currently I'm evaluating Karaf to find out, whether it is an option for our 
next web development project (JSP + Hibernate + Spring). Therefore, I'm having 
a few questions I couldn't find a satisfying answer for. It would be great, if 
you could be point to the right direction:

How can I intregate Karaf into Eclipse in a way, that web development can be 
done without the need to run maven after each minor change. For example, when 
I cange something in a JSP template or in CSS files. Any ideas how to do that? 
Whats the best practise in working with Eclipse and Karaf? Whats the suggested 
Eclipse setup?

I'm assuming that Karaf uses the OSGi HTTP Service in order to provide Jetty 
support. I heard, that this way, there is no possiblility to use Servlet 
Filters. Is this information true and/or there are other limitations?

Thanks in advance.

Best regards,
Stephan 
-- 
Schon gehört? GMX hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://www.gmx.net/de/go/toolbar


Race between Features and Spring/Blueprint XML

2011-03-09 Thread Michael Prieß
Hi all,

i like to deploy camel-routes and features inside the deploy directory.

 A deployment look like the following:

- a feature.xml which contain bundles like Apache Camel, Spring with a start
level definition.
- and many xml camel-routes which contain configurations for my components.

Now i have the problem that my camel-routes have the same start level like
the features.

Have anyone a good idea how to resolve the problem?

Regards,

Michael Priess


Re: Race between Features and Spring/Blueprint XML

2011-03-09 Thread Guillaume Nodet
I've seen lots of problems when using spring-dm, some of them do not
have any clean solution *at all*, especially when using custom
namespace handlers such as camel.  That's why I've been advocating for
using blueprint instead, which works way better.

Camel support for blueprint is much better since 2.6 and 2.7 will
bring another set of improvements, so if that's an option, i'd switch
to blueprint.
Else, well, you can always try to put some Thread.sleep at some very
fined tuned location in order to make sure the camel namespace handler
is ready and that all camel components are available.

On Wed, Mar 9, 2011 at 15:51, Michael Prieß
mailingliste...@googlemail.com wrote:
 Hi all,

 i like to deploy camel-routes and features inside the deploy directory.

  A deployment look like the following:

 - a feature.xml which contain bundles like Apache Camel, Spring with a start
 level definition.
 - and many xml camel-routes which contain configurations for my components.

 Now i have the problem that my camel-routes have the same start level like
 the features.

 Have anyone a good idea how to resolve the problem?

 Regards,

 Michael Priess






-- 
Cheers,
Guillaume Nodet

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

Open Source SOA
http://fusesource.com


Re: Race between Features and Spring/Blueprint XML

2011-03-09 Thread Freeman Fang
One solution I can come up with which might not be graceful but  
working is that in your xml camel-routers hold a osgi reference  
exposed by the camel component you want to wait, this can ensure the  
camel components fully started before your customer router bundle.

For example if you need ensure camel-restlet fully started, just put

osgi:reference id=restlet  
interface=org.apache.camel.spi.ComponentResolver

cardinality=1..1 filter=(component=restlet) /
in your customer router bundle camel xml.

Freeman


On 2011-3-9, at 下午11:05, Guillaume Nodet wrote:


I've seen lots of problems when using spring-dm, some of them do not
have any clean solution *at all*, especially when using custom
namespace handlers such as camel.  That's why I've been advocating for
using blueprint instead, which works way better.

Camel support for blueprint is much better since 2.6 and 2.7 will
bring another set of improvements, so if that's an option, i'd switch
to blueprint.
Else, well, you can always try to put some Thread.sleep at some very
fined tuned location in order to make sure the camel namespace handler
is ready and that all camel components are available.

On Wed, Mar 9, 2011 at 15:51, Michael Prieß
mailingliste...@googlemail.com wrote:

Hi all,

i like to deploy camel-routes and features inside the deploy  
directory.


 A deployment look like the following:

- a feature.xml which contain bundles like Apache Camel, Spring  
with a start

level definition.
- and many xml camel-routes which contain configurations for my  
components.


Now i have the problem that my camel-routes have the same start  
level like

the features.

Have anyone a good idea how to resolve the problem?

Regards,

Michael Priess







--
Cheers,
Guillaume Nodet

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

Open Source SOA
http://fusesource.com



--
Freeman Fang



FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org



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