Jetty例外没有选择器或NPE

时间:2018-04-17 08:21:17

标签: java jetty dropwizard

我正在运行服务应用程序并获得下一个问题

java.lang.IllegalArgumentException: No selectors

    at org.eclipse.jetty.io.SelectorManager.<init>(SelectorManager.java:64)
    at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.<init>(ServerConnector.java:524)
    at org.eclipse.jetty.server.ServerConnector.newSelectorManager(ServerConnector.java:232)


    at org.eclipse.jetty.server.ServerConnector.<init>(ServerConnector.java:225)
    at io.dropwizard.jetty.HttpConnectorFactory.buildConnector(HttpConnectorFactory.java:540)
    at io.dropwizard.jetty.HttpConnectorFactory.build(HttpConnectorFactory.java:517)
    at io.dropwizard.server.DefaultServerFactory.buildAppConnectors(DefaultServerFactory.java:233)
    at io.dropwizard.server.DefaultServerFactory.buildRoutingHandler(DefaultServerFactory.java:193)
    at io.dropwizard.server.DefaultServerFactory.build(DefaultServerFactory.java:171)
    at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:49)
    at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
    at io.dropwizard.testing.DropwizardTestSupport.startIfRequired(DropwizardTestSupport.java:227)
    at io.dropwizard.testing.DropwizardTestSupport.before(DropwizardTestSupport.java:141)
    at io.dropwizard.testing.junit.DropwizardAppRule.before(DropwizardAppRule.java:154)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at net.serenitybdd.junit.runners.SerenityRunner.performRunChild(SerenityRunner.java:471)
    at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:446)
    at net.serenitybdd.junit.runners.SerenityRunner.runChild(SerenityRunner.java:55)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.contrib.java.lang.system.EnvironmentVariables$EnvironmentVariablesStatement.evaluate(EnvironmentVariables.java:71)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at net.serenitybdd.junit.runners.SerenityRunner.run(SerenityRunner.java:252)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:65)

当我添加

<dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-io</artifactId>
            <version>9.4.7.v20170914</version>
        </dependency>

java.lang.NullPointerException
    at io.restassured.internal.print.ResponsePrinter.print(ResponsePrinter.java:46)
    at io.restassured.internal.ValidatableResponseOptionsImpl.logResponse(ValidatableResponseOptionsImpl.java:423)
    at io.restassured.internal.ValidatableResponseOptionsImpl.logResponse(ValidatableResponseOptionsImpl.java:419)
    at io.restassured.internal.ValidatableResponseOptionsImpl.logResponse(ValidatableResponseOptionsImpl.java:415)
    at io.restassured.internal.ValidatableResponseOptionsImpl.all(ValidatableResponseOptionsImpl.java:371)
    at bdd.utils.Request.get(Request.java:45)

然后当我发送请求时异常切换到NPE。 我认为它是因为maven依赖关系在某处重叠,但我有一个复杂的框架与pom父母。有什么建议吗?

这是控制台日志

 INFO  [2018-04-17 08:32:34,120] org.eclipse.jetty.server.AbstractConnector: Stopped application@62d6ac{HTTP/1.1,[http/1.1]}{0.0.0.0:60088}
    INFO  [2018-04-17 08:32:34,121] org.eclipse.jetty.server.AbstractConnector: Stopped admin@103e9972{HTTP/1.1,[http/1.1]}{0.0.0.0:60089}
    INFO  [2018-04-17 08:32:34,124] org.eclipse.jetty.server.handler.ContextHandler: Stopped i.d.j.MutableServletContextHandler@5b5a89d1{/,null,UNAVAILABLE}
    INFO  [2018-04-17 08:32:34,128] org.eclipse.jetty.server.handler.ContextHandler: Stopped i.d.j.MutableServletContextHandler@736f2fb8{/,null,UNAVAILABLE}
    INFO  [2018-04-17 08:32:34,133] org.ehcache.core.EhcacheManager: Cache 'CridAndImi-CachedEvent' removed from Eh107InternalCacheManager.
    INFO  [2018-04-17 08:32:34,134] org.ehcache.core.EhcacheManager: Cache 'CustomerId-CachedRecordings' removed from Eh107InternalCacheManager.

0 个答案:

没有答案