contactreji edited a comment on issue #892: Defining datasource in groovy and 
using in XML routes
URL: https://github.com/apache/camel-k/issues/892#issuecomment-528889641
 
 
   > org.apache.activemq.camel.component
   
   @WillemJiang  - I get following error while starting the app. 
   
   ```
   011 seconds
   [1] Exception in thread "main" 
org.apache.camel.FailedToCreateRouteException: Failed to create route route1: 
Route(route1)[[From[activemq:queue:TESTINGCONNECTION]] -> [L... because of 
Failed to resolve endpoint: activemq://queue:TESTINGCONNECTION due to: Username 
must also be provided when using username/password as credentials.
   [1]     at 
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:217)
   [1]     at 
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1140)
   [1]     at 
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3735)
   [1]     at 
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3440)
   [1]     at 
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
   
   ```
   
   
   Route file
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <routes xmlns="http://camel.apache.org/schema/spring"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation=" 
http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
      <route streamCache="true">
         <from uri="activemq:queue:TESTINGCONNECTION"/>
         <log message="Received request to process" />
      </route>
   </routes>
   ```
   
   
   Groovy file
   ```
   import org.apache.activemq.camel.component.ActiveMQComponent;
   
   context {
       components {
           activemq(ActiveMQComponent) {
               brokerURL = 'tcp://localhost:61616'
               userName = 'admin'
               password = 'admin'
           }
       }
   }
   ```
   
   
   Camel command used
   ```
   kamel run --dev --name jmsintegration --trait service.port=1212 --dependency 
mvn:org.apache.camel/camel-jsonpath:2.24.1 --dependency 
mvn:org.apache.camel/camel-http4:2.24.1 --dependency 
mvn:org.apache.camel/camel-jetty:2.24.1 --dependency 
mvn:org.apache.camel/camel-jackson:2.24.1 --dependency 
mvn:org.apache.camel/camel-jaxb:2.24.1 --dependency  
mvn:org.apache.camel/camel-restlet:2.24.1 --dependency 
mvn:org.apache.camel/camel-sql:2.24.1 --dependency  
mvn:mysql/mysql-connector-java:5.1.34 --dependency 
mvn:commons-dbcp/commons-dbcp:1.4 --dependency 
mvn:org.apache.activemq/activemq-camel:5.15.10 --logging-level 
org.apache.camel.k=DEBUG routes.xml beans.groovy
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to