0

我正在尝试使用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>
4

2 回答 2

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

你能验证你Applications.name()的正确吗?这很愚蠢,但我认为它来自这里:-)

您还可以查看简单的快速入门 Stormpath tuto

于 2015-07-09T08:17:21.663 回答
0

实际上这是我的错,我输入了错误的应用程序名称 "My Main"。这就是我得到大小 0 的原因。

于 2015-07-09T10:17:56.770 回答