小编Wen*_*yan的帖子

ERROR in无法读取未定义的属性'getSymbolByModule'

当我升级到Angular 4并运行ng服务时,我收到以下错误:

ERROR in Cannot read property 'getSymbolByModule' of undefined
Run Code Online (Sandbox Code Playgroud)

依赖关系按以下方式使用

  "dependencies": {
    "@angular/animations": "^4.0.2",
    "@angular/cli": "^1.0.0",
    "@angular/common": "^4.0.2",
    "@angular/compiler": "^4.0.2",
    "@angular/compiler-cli": "^2.4.10",
    "@angular/core": "^4.0.2",
    "@angular/forms": "^4.0.2",
    "@angular/http": "^4.0.2",
    "@angular/platform-browser": "^4.0.2",
    "@angular/platform-browser-dynamic": "^4.0.2",
    "@angular/platform-server": "^4.0.2",
    "@angular/router": "^4.0.2",
    "@types/jasmine": "^2.5.47",
    "angular2-flash-messages": "^1.0.8",
    "angular2-jwt": "^0.1.28",
    "codelyzer": "^2.1.1",
    "core-js": "^2.4.1",
    "jasmine-spec-reporter": "^2.7.0",
    "karma": "^1.6.0",
    "rxjs": "^5.3.0",
    "ts-helpers": "^1.1.2",
    "ts-node": "^1.7.3",
    "typescript": "^2.0.10",
    "zone.js": "^0.8.5"
  },
Run Code Online (Sandbox Code Playgroud)

这里有什么问题吗?

angular

10
推荐指数
2
解决办法
4441
查看次数

Spring 5 RouterFunction状态415,原因为“不支持内容类型'application / json'”

我正在尝试按照以下代码使用Spring 5 Rounter Function

public class PersonHandler {

    private final PersonRepository repository;

    public PersonHandler(PersonRepository repository) {
        this.repository = repository;
    }

    public Mono<ServerResponse> listPeople(ServerRequest request) { 
        System.out.println("List people");
        Flux<Person> people = repository.findAll();
        return ServerResponse.ok().contentType(APPLICATION_JSON).body(people, Person.class);
    }

    public Mono<ServerResponse> createPerson(ServerRequest request) { 
        System.out.println("Insert people");
        Mono<Person> person = request.bodyToMono(Person.class); 
        repository.insert(person).subscribe();
        return ServerResponse.ok().build();
    }

    public Mono<ServerResponse> getPerson(ServerRequest request) { 
        System.out.println("Get people");
        String personName = request.pathVariable("name");
        Mono<ServerResponse> notFound = ServerResponse.notFound().build();
        Mono<Person> personMono = this.repository.findByName(personName);
        return personMono
                .flatMap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject(person)))
                .switchIfEmpty(notFound);
    }
}
Run Code Online (Sandbox Code Playgroud)

这是路由器功能

@Configuration
public …
Run Code Online (Sandbox Code Playgroud)

spring-webflux

5
推荐指数
1
解决办法
923
查看次数

google-oauth-client-jetty 无法在 Tomcat 7 上运行

当我使用Google OAuth2时,我需要使用该库

    <dependency>
        <groupId>com.google.oauth-client</groupId>
        <artifactId>google-oauth-client-jetty</artifactId>
        <version>1.23.0</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试在 Tomcat 7 上运行我的 web 应用程序时,服务器无法启动并抱怨以下错误:

2017 年 10 月 14 日 9:26:57 PM org.apache.catalina.core.ContainerBase startInternal 严重:启动时子容器失败 java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException:无法启动组件 [StandardEngine [Tomcat].StandardHost[localhost].StandardContext[]]

这是什么原因呢?谢谢。

tomcat jetty google-api-java-client

4
推荐指数
1
解决办法
816
查看次数