ApplicationList大小为0

时间:2015-07-08 12:29:34

标签: java spring spring-boot stormpath

我正在尝试使用stormpath和spring boot获取facebook数据。但我得到的ApplicationList大小为0。

        ApiKey apiKey = ApiKeys.builder().setFileLocation(path).build();
        Client client = Clients.builder().setApiKey(apiKey).build();
        Tenant tenant = client.getCurrentTenant();
        ApplicationList applications = tenant.getApplications(
                Applications.where(Applications.name().eqIgnoreCase("My Main"))
        ); // applications size is 0 I am getting

      Application application =  applications.iterator().next();

知道为什么会这样吗?以及如何获得应用程序?

编辑:这是我的pom.xml

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.3.RELEASE</version>
    </parent>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>

    <!-- Spring Boot -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
        <dependency>
            <groupId>com.stormpath.sdk</groupId>
            <artifactId>stormpath-sdk-api</artifactId>
            <version>1.0.RC4.4</version>
        </dependency>
        <dependency>
            <groupId>com.stormpath.sdk</groupId>
            <artifactId>stormpath-sdk-httpclient</artifactId>
            <version>1.0.RC4.4</version>
            <scope>runtime</scope>
        </dependency>
</dependencies>

2 个答案:

答案 0 :(得分:0)

ApplicationList applications = tenant.getApplications(
                Applications.where(Applications.name().eqIgnoreCase("My Main"))
        ); // applications size is 0 I am getting

您可以验证Applications.name()是否正确吗?这是愚蠢的,但我认为它来自这里: - )

您还可以查看简单的quickstart Stormpath tuto

答案 1 :(得分:0)

实际上我错了我的错误应用程序名"My Main"。这就是为什么我的大小为0的原因。

相关问题