Apache camel ApacheCamel 2.14谷歌驱动器组件

Apache camel ApacheCamel 2.14谷歌驱动器组件,apache-camel,google-drive-api,Apache Camel,Google Drive Api,我正在ApacheCamel2.14应用程序中使用新的Google驱动器组件。 目前它不工作,这是应用程序: private String accessToken = ... private String applicationName = "camel-mytest"; private String clientId = ... private String clientSecret = ... private String refreshToken = ... private List&l

我正在ApacheCamel2.14应用程序中使用新的Google驱动器组件。 目前它不工作,这是应用程序:

private String accessToken = ...
private String applicationName = "camel-mytest";
private String clientId = ...
private String clientSecret = ...
private String refreshToken = ...

private List<String> scopes = Arrays.asList("https://www.googleapis.com/auth/drive");
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
camelContext = (CamelContext) applicationContext.getBean("idGoogleDriveCamelContext");
GoogleDriveConfiguration configuration = new GoogleDriveConfiguration();
configuration.setAccessToken(accessToken);
configuration.setApplicationName(applicationName);
configuration.setClientId(clientId);
configuration.setClientSecret(clientSecret);
configuration.setRefreshToken(refreshToken);
configuration.setScopes(scopes);

GoogleDriveComponent googleDriveComponent = new GoogleDriveComponent();
googleDriveComponent.setConfiguration(configuration);
camelContext.addComponent("google-drive", googleDriveComponent);
camelContext.start();
如前所述,我已经创建了客户机ID和客户机机密,我在OAuth设置范围中获得了访问令牌和刷新令牌。 我已经在pom.xml文件中添加了Google Drive maven依赖项

这是stacktrace:

[2014-09-29 10:35:55,124] Artifact camel-googledrive:war: Error during artifact deployment. See server log for details.
[2014-09-29 10:35:55,125] Artifact camel-googledrive:war: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"camel-googledrive-1.0-SNAPSHOT.war\".component.Bootstrap.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"camel-googledrive-1.0-SNAPSHOT.war\".component.Bootstrap.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
    Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
    Caused by: javax.ejb.EJBException: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: java.lang.NullPointerException"}}

这是组件初始化还是sintax问题?谢谢

您是如何设置骆驼路线的?如果在安装googleDriveComponent之前加载了路由,您可能会遇到NPE问题。您太棒了!:)实际上,我是在加载路由后声明GoogleDrive组件的,路由是在applicationContext.xml文件中加载的Java类中定义的。在加载路由之前,在applicationContext.xml中设置组件及其配置已足够。非常感谢。它会与谷歌服务帐户一起工作吗?
[2014-09-29 10:35:55,124] Artifact camel-googledrive:war: Error during artifact deployment. See server log for details.
[2014-09-29 10:35:55,125] Artifact camel-googledrive:war: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"camel-googledrive-1.0-SNAPSHOT.war\".component.Bootstrap.START" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"camel-googledrive-1.0-SNAPSHOT.war\".component.Bootstrap.START: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
    Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
    Caused by: javax.ejb.EJBException: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[google-drive://drive-about/get]] -> [Log... because of Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: google-drive://drive-about/get due to: null
    Caused by: java.lang.NullPointerException"}}