Brad,

  

Thanks I will give it a go.

  

O.

![](https://link.nylas.com/open/ez36v71u7uh7qiundny4ougdd/local-bdc9cbeb-
0fb0?r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmxlLmNvbQ==)

  
On Sep 21 2016, at 12:01 am, Ranx [via Camel] <ml-
node+s465427n5787793...@n5.nabble.com> wrote:  

> One part of this that's been bothering mainly due to my ignorance of not  
having used in my testing is the adviceWith.  And the weaveById.  Route  
definitions throw the generic big E exception.  I wonder if you'd see  
anyting in there if you did something like this.  At least that could  
identify whether there was a problem there or not. By the way I'm  
freehanding my try/catches there so the may not be aligned correctly.  
  
  @Test  
  public void testMessageReceived() throws Exception {  
try{  
  
context.getRouteDefinition("i4ip-order-publish-route").adviceWith(context,  
new AdviceWithRouteBuilder() {  
      @Override   
      public void configure() throws Exception {   
*try{*   
        replaceFromWith("direct:in");   
        weaveById("publishedMessage").after().to("mock:increment");   
*} catch(Exception e) {*   
*System.out.println("We threw an exception in the weaving".*   
*      }*   
*} catch(Excepion e)*   
*System.out.println("We caught an error in the route builder."*   
*}*   
    });   
  
On Tue, Sep 20, 2016 at 12:15 PM, Brad Johnson <[[hidden email]](/user/SendEma
il.jtp?type=node&node=5787793&i=0&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubm
FiYmxlLmNvbQ==)  
> wrote:  

>

>  
> Too bootstrap a route from the Java DSL you only need to do something like  
> this:  
>  
> <camelContext xmlns="[http://camel.apache.org/schema/blueprint](http://camel
.apache.org/schema/blueprint&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmx
lLmNvbQ==)">  
>  
>      <package>my.routes.internal</package>  
>  
> </camelContext>  
>  
> And in the my.routes.internal package (or whatever you want to call it) you
would have route builder. You could put mock:out instead of direct:out.
You'll still use blueprint to export or import OSGi services if you are using
them but that's a trivial matter and I wouldn't worry about it just yet. While
those routes are hard coded in here you'll later replace them with
substitution variable names that you can change from the properties.  Use the
default properties first and then you can override them in you cfg file for
production.  
>  
> public class ARouteBuilder extends RouteBuilder {  
>  
>     public void configure() {  
>  
>         from("direct:in")  
>            .log("${body}")  
>            .to("direct:out");  
>  
>     }  
>  
> }  
>  
> Also, I'm not sure how IDEA works but I'm sure there's something  
> equivalent to what one would do in Eclipse to start a project with a Maven  
> archetype.  Just type in:  
>  
> camel-archetypes-  
>  
> and it should give you a list of sample archetypes to use to start a  
> project.  Also, since you are using Fuse there's a selection of projects  
> under the "quickstarts" directory in there.  
>  
> Brad  
>  
>  
>  
>  
> On Tue, Sep 20, 2016 at 6:27 AM, owain <[[hidden email]](/user/SendEmail.jtp
?type=node&node=5787793&i=1&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmxl
LmNvbQ==)>  
> wrote:  
>  
>> Brad,  
>>  
>> I am using <camel-version>2.15.6</camel-version> since this is the  
>> closest  
>> to Fuse-6.2.1.  I have just tried the test with CBTS 2.17.0.  Is there a  
>> higher version?  
>>  
>> I add mock:increment (now refactored to mock:out) and replace the "from"  
>> with direct:in in.  
>>  
>>  
>> context.getRouteDefinition("i4ip-order-publish-route").advic  
>> eWith(context,  
>> new AdviceWithRouteBuilder() {  
>>       @Override  
>>       public void configure() throws Exception {  
>>         replaceFromWith("direct:in");  
>>         weaveById("publishedMessage").after().to("mock:out");  
>>       }  
>>     });  
>>  
>> Also I am drawing the same conclusion about the XML only approach.  Could  
>> you kind enough to post and example to how to bootstrap the Java DSL from  
>> the Blueprint XML.  
>>  
>> Thanks for your help. I will try putting it in a new project and see if  
>> that  
>> was the problem.  In a single xml file.  
>>  
>> O.  
>>  
>>  
>>  
>> \--  
>> View this message in context: [http://camel.465427.n5.nabble](http://camel.
465427.n5.nabble&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmxlLmNvbQ==).  
>> com/org-osgi-service-blueprint-container-ComponentDefinition  
>> Exception-Unable-to-validate-xml-tp5787642p5787758.html  
>> Sent from the Camel - Users mailing list archive at Nabble.com.  
>>  
>  
>  

>

>  
  

>

> * * *

>

> If you reply to this email, your message will be added to the discussion
below:

>

> [http://camel.465427.n5.nabble.com/org-osgi-service-blueprint-container-
ComponentDefinitionException-Unable-to-validate-xml-
tp5787642p5787793.html](http://camel.465427.n5.nabble.com/org-osgi-service-
blueprint-container-ComponentDefinitionException-Unable-to-validate-xml-tp5787
642p5787793.html&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmxlLmNvbQ==)

>

> To unsubscribe from
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
validate xml, [click here](http://camel.465427.n5.nabble.com/template/NamlServ
let.jtp?macro=unsubscribe_by_code&node=5787642&code=b3dhaW5AaW50ZWdyYXRpb24udG
VjaG5vbG9neXw1Nzg3NjQyfC0xMjIxNzE3NTgw&r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAb
jUubmFiYmxlLmNvbQ==).  
[NAML](http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_
viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces
.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.templ
ate.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-
instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml&
r=bWwtbm9kZStzNDY1NDI3bjU3ODc3OTNoMzdAbjUubmFiYmxlLmNvbQ==)





--
View this message in context: 
http://camel.465427.n5.nabble.com/org-osgi-service-blueprint-container-ComponentDefinitionException-Unable-to-validate-xml-tp5787642p5787865.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to