camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpcat <rpcata...@gmail.com>
Subject how to get loginConfig into standalone camel salesforce component
Date Mon, 21 Sep 2015 05:27:18 GMT
My standalone camel instance needs a salesforce component. It has:

public class Driver 
{
	private Main main;
	static final Logger log = LoggerFactory.getLogger(Driver.class);

	public void startDriver() throws Exception
	{
		main = new Main();
		main.enableHangupSupport();	//so you can press ctrl-c to terminate the jvm
...
                SalesforceLoginConfig loginConfig = new
SalesforceLoginConfig(
                    loginUrl, clientId, clientSecret, userName, password,
lazyLogin);

                SalesforceComponent component = new SalesforceComponent();
                component.setLoginConfig(loginConfig);
        
                component.setPackages(new
String[]{Program_Schedule__c.class.getPackage().getName()    });

                main.getOrCreateCamelContext().addComponent(componentName,
component);		
		main.addRouteBuilder(new RoutePollSalesforce());
		
but when i start up the route there's no loginConfig:

Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create
component: salesforce
        at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:400)
        at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:376)
        at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:548)
        ... 25 more
Caused by: java.lang.IllegalArgumentException: loginConfig must be specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:293)
        at
org.apache.camel.component.salesforce.SalesforceComponent.doStart(SalesforceComponent.java:175)
        at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
        at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2885)
        at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:395)
        ... 27 more
[                      Thread-0] MainSupport$HangupInterceptor  INFO 
Received hang up - stopping the main instance.

suggestions would be greatly appreciated.




--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-loginConfig-into-standalone-camel-salesforce-component-tp5771694.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message