Guice创建错误:Cloudify

时间:2013-03-16 20:41:41

标签: glassfish guice netbeans-7 jclouds cloudify

我是Guice的新手并且确实是云化的,我希望得到一个指针或区域来查看可能导致这种情况的原因:

  1. 首先:

    No implementation for com.google.common.cache.LoadingCache<org.jclouds.ec2.domain.RunningInstance, org.jclouds.domain.LoginCredentials> was bound.
      while locating com.google.common.cache.LoadingCache<org.jclouds.ec2.domain.RunningInstance, org.jclouds.domain.LoginCredentials>
        for parameter 9 at org.jclouds.aws.ec2.compute.strategy.AWSEC2CreateNodesInGroupThenAddToSet.<init>(AWSEC2CreateNodesInGroupThenAddToSet.java:94)
      at org.jclouds.aws.ec2.compute.config.AWSEC2ComputeServiceContextModule.configure(AWSEC2ComputeServiceContextModule.java:96)
    
  2. 并且:

    No implementation for com.google.common.cache.CacheLoader<org.jclouds.ec2.domain.RunningInstance, org.jclouds.domain.Credentials> was bound.
      at org.jclouds.ec2.compute.config.EC2ComputeServiceDependenciesModule.credentialsMap(EC2ComputeServiceDependenciesModule.java:169)
    2 errors
    
  3. 1的代码是: -

    public class AWSEC2ComputeServiceContextModule extends BaseComputeServiceContextModule {
    @Override
    protected void configure() {
    super.configure();
        installDependencies();
        install(new EC2BindComputeStrategiesByClass());
        install(new AWSEC2BindComputeSuppliersByClass());
        bind(ReviseParsedImage.class).to(AWSEC2ReviseParsedImage.class);
        bind(CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.class).to(
               CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.class);
        bind(EC2HardwareSupplier.class).to(AWSEC2HardwareSupplier.class);
        bind(EC2TemplateBuilderImpl.class).to(AWSEC2TemplateBuilderImpl.class);
        bind(EC2GetNodeMetadataStrategy.class).to(AWSEC2GetNodeMetadataStrategy.class);
        bind(EC2ListNodesStrategy.class).to(AWSEC2ListNodesStrategy.class);
        bind(EC2DestroyNodeStrategy.class).to(AWSEC2DestroyNodeStrategy.class);
        bind(InstancePresent.class).to(AWSEC2InstancePresent.class);
        bind(EC2CreateNodesInGroupThenAddToSet.class).to(AWSEC2CreateNodesInGroupThenAddToSet.class);
        bind(RunningInstanceToNodeMetadata.class).to(AWSRunningInstanceToNodeMetadata.class);
    }
    

    2的代码是: -

    @Provides
    @Singleton
    @Named("SECURITY")
    protected LoadingCache<RegionAndName, String> securityGroupMap(
            @Named("SECURITY") CacheLoader<RegionAndName, String> in) {
        return CacheBuilder.newBuilder().build(in);
    }
    

    我最初的想法是它可能是路径中丢失或缺少项目的jar文件?任何指针和指导表示赞赏。这是在Bootcamped IMAC上的Netbeans 7.3 betaJava 1.7GlassFishCloudify 2.5.0-SNAPSHOT,Windows 7 Professional 64位上。

2 个答案:

答案 0 :(得分:0)

您缺少类路径中的一些jar文件。至少你应该在类路径的以下目录中拥有jar文件:

  • CLOUDIFY_HOME / LIB /需要/ *
  • CLOUDIFY_HOME / LIB /平台/ ESM / *
  • CLOUDIFY_HOME / LIB /平台/ cloudify / *

答案 1 :(得分:0)

同时检查您正在使用的Java版本。如果它是1.7u51或更高,它与cloudify使用的jclouds版本不一致,特别是与Guice(问题描述为here)。

恢复到早期的JDK(1.7u45或更低)应解决它。