Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jetty java.lang.NullPointerException处于高负载状态_Java_Null_Jetty - Fatal编程技术网

Jetty java.lang.NullPointerException处于高负载状态

Jetty java.lang.NullPointerException处于高负载状态,java,null,jetty,Java,Null,Jetty,我在jetty服务器v9.3上的5个qps负载上收到java.lang.NullPointerException 我定义了以下配置: jetty.threadPool.maxThreads=500 jetty.http.acceptors=-1 jetty.http.selectors=-1 有人遇到过类似的问题吗 日志 [WARN] [05/11/2015 09:49:29.074] [qtp821513849-64] [org.eclipse.jetty.server.HttpChanne

我在jetty服务器v9.3上的5个qps负载上收到java.lang.NullPointerException

我定义了以下配置:

jetty.threadPool.maxThreads=500 jetty.http.acceptors=-1 jetty.http.selectors=-1
有人遇到过类似的问题吗

日志

[WARN] [05/11/2015 09:49:29.074] [qtp821513849-64] [org.eclipse.jetty.server.HttpChannel] //host.com/service1
java.lang.NullPointerException: null
        at org.eclipse.jetty.security.SecurityHandler.checkSecurity(SecurityHandler.java:387) ~[jetty-security-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:443) ~[jetty-security-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) ~[jetty-servlet-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.webapp.logging.ContextLogHandler.handle(ContextLogHandler.java:62) ~[jetty-webapp-logging-9.0.0.jar:na]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.Server.handle(Server.java:517) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306) ~[jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) [jetty-server-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) [jetty-io-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) [jetty-io-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) [jetty-util-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) [jetty-util-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) [jetty-util-9.3.5.v20151012.jar:9.3.5.v20151012]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) [jetty-util-9.3.5.v20151012.jar:9.3.5.v20151012]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
配置

我在以下docker容器上使用default配置:

FROM centos:7

USER root

ENV TERM xterm

ENV JAVA_HOME /etc/alternatives/jre
ENV PATH $PATH:$JAVA_HOME

# Install Java
RUN yum install -y \
       java-1.8.0-openjdk \
       java-1.8.0-openjdk-devel


ENV JETTY_HOME /opt/jetty
ENV JETTY_VERSION 9.3.5.v20151012

# Install Jetty
RUN curl http://download.eclipse.org/jetty/${JETTY_VERSION}/dist/jetty-distribution-${JETTY_VERSION}.tar.gz -o /tmp/jetty.tar.gz \
 && cd /opt \
 && tar zxvf /tmp/jetty.tar.gz \
 && ln -s /opt/jetty-distribution-${JETTY_VERSION} /opt/jetty \
 && rm /tmp/jetty.tar.gz \
 && rm -rf /opt/jetty/webapps.demo

 # New Relic install
ADD ./newrelic/ $JETTY_HOME/newrelic/
RUN cd $JETTY_HOME/newrelic
RUN java -jar $JETTY_HOME/newrelic/newrelic.jar install

ENV JETTY_BASE /var/lib/jetty

RUN mkdir -p $JETTY_BASE/modules 

WORKDIR $JETTY_BASE

# Get the list of modules in the default start.ini and build new base with those modules, then add setuid
RUN modules="$(grep -- ^--module= "$JETTY_HOME/start.ini" | cut -d= -f2 | paste -d, -s)" \
    && set -xe \
    && java -jar "$JETTY_HOME/start.jar" --add-to-startd="$modules,setuid"

RUN cd modules \
    && curl -O https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/logging.mod \
    && curl -O https://raw.githubusercontent.com/jetty-project/logging-modules/master/centralized/webapp-logging.mod

RUN java -jar "$JETTY_HOME/start.jar" --add-to-startd="logging,webapp-logging"

# Delete default logback configuration
RUN rm resources/logback.xml

RUN useradd jetty -U -s /bin/false
RUN chown -R jetty:jetty $JETTY_HOME
RUN chown -R jetty:jetty $JETTY_BASE

EXPOSE 8080


# Set Application Configuration
ENV JETTY_ARGS "jetty.threadPool.maxThreads=500 jetty.http.acceptors=-1 jetty.http.selectors=-1"
ENV JAVA_OPTIONS "-Xms7g -Xmx7g -XX:NewSize=6g -XX:MaxNewSize=6g -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC"

# Copy Jetty config file
COPY ./src/main/webapp/WEB-INF/jetty.xml $JETTY_BASE/etc/jetty.xml
COPY ./src/main/resources/logback.xml $JETTY_BASE/resources/logback.xml
COPY ./target/*.war $JETTY_BASE/webapps/ROOT.war

# Run Jetty
RUN chmod +x $JETTY_HOME/bin/jetty.sh
CMD ["/opt/jetty/bin/jetty.sh", "run"]

非常奇怪的NPE,因为这意味着请求对象本身是空的。实际上,您以某种方式让服务器处理一个不存在的请求。你能吗?我正在使用./wrk“server_address”-s scripts/post.lua-c 200-t 20-d 30m-R 15000我刚刚试过你的
wrk
选项,所有这些对我来说都很好。你能把你的服务器配置和你的
post.lua
粘贴到什么地方吗?谢谢添加了配置结果表明这是一个bug——它已在jetty-9.3.x分支中解决,并将在下一个9.3版本(下周)中出现