You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by linbo liao <ll...@gmail.com> on 2017/03/20 03:15:22 UTC

Tomcat 8.5.3 with Apr Connector throws NullPointerException

Hi,

My tomcat  throws NullPointerException sometimes. Here is environment:

Linux VM: RedHat Enterprise Linux Server release 6.7 x86_64
Tomcat: 8.5.3
JVM: HotSpot 64-Bit Server VM 1.8.0_65
APR: 1.5.2-1
Tomcat Native: 1.2.7

The exception show in catalina.log :

18-Mar-2017 03:36:01.135 WARNING [http-apr-2181-Poller]
> org.apache.tomcat.util.net.AprEndpoint$Poller.run Unexpected poller error
> java.lang.NullPointerException at
> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper.access$400(AprEndpoint.java:2243)
> at org.apache.tomcat.util.net.AprEndpoint$Poller.run(AprEndpoint.java:1654)
> at java.lang.Thread.run(Thread.java:745)
>

I searched find similar with issue 54513
<https://bz.apache.org/bugzilla/show_bug.cgi?id=54513>, but looks an
old one and fixed.

Anyone hit this issue, any information can I look up?

Thanks,

Linbo

Re: Tomcat 8.5.3 with Apr Connector throws NullPointerException

Posted by linbo liao <ll...@gmail.com>.
Thanks Mark.

Now tomcat is in production. If upgrade to 8.5.12, we will test our
application is compatible with 8.5.12 first.

Sorry for the limit information. Here is tomcat configuration file (remove
comment line):

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <Listener
className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="2181"
protocol="org.apache.coyote.http11.Http11AprProtocol"
       maxHttpHeaderSize="8192"
                 maxThreads="400"
                 connectionTimeout="3000"
                 acceptorThreadCount="4"
                 maxKeepAliveRequests="-1"
                 enableLookups="false" disableUploadTimeout="true"
                 acceptCount="800"
    />

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/data/logs/tomcat"
               prefix="localhost_access_log" rotatable="false" suffix=".log"
               pattern="%t %U %D" renameOnRotate="true" />
      </Host>
    </Engine>
  </Service>
</Server>

And none of these feature used in our application, only 2181 port (Apr)
used ( SSL/AJP isn't used). Application is a simple Restful API, received
POST json data and send to Kafka.

- HTTP/2
- Servlet async
- send file
- web socket

Thanks,
Linbo


2017-03-20 17:10 GMT+08:00 Mark Thomas <ma...@apache.org>:

> On 20/03/17 03:15, linbo liao wrote:
> > Hi,
> >
> > My tomcat  throws NullPointerException sometimes. Here is environment:
> >
> > Linux VM: RedHat Enterprise Linux Server release 6.7 x86_64
> > Tomcat: 8.5.3
> > JVM: HotSpot 64-Bit Server VM 1.8.0_65
> > APR: 1.5.2-1
> > Tomcat Native: 1.2.7
>
> I'd recommend testing with to 8.5.12 and 1.2.12.
>
> If you still see the issue, any information you can provide on
> reproducing it would be helpful. Failing that, you could try narrowing
> down whether the problem depends on the use of any of:
> - HTTP/2
> - Servlet async
> - send file
> - web socket
>
> etc.
>
> In short, the more information you can provide the better the chances of
> us being able to help you.
>
> You should probably look at using
> -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
>
>
> Mark
>
>
> >
> > The exception show in catalina.log :
> >
> > 18-Mar-2017 03:36:01.135 WARNING [http-apr-2181-Poller]
> >> org.apache.tomcat.util.net.AprEndpoint$Poller.run Unexpected poller
> error
> >> java.lang.NullPointerException at
> >> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper.
> access$400(AprEndpoint.java:2243)
> >> at org.apache.tomcat.util.net.AprEndpoint$Poller.run(
> AprEndpoint.java:1654)
> >> at java.lang.Thread.run(Thread.java:745)
> >>
> >
> > I searched find similar with issue 54513
> > <https://bz.apache.org/bugzilla/show_bug.cgi?id=54513>, but looks an
> > old one and fixed.
> >
> > Anyone hit this issue, any information can I look up?
> >
> > Thanks,
> >
> > Linbo
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Tomcat 8.5.3 with Apr Connector throws NullPointerException

Posted by Mark Thomas <ma...@apache.org>.
On 20/03/17 03:15, linbo liao wrote:
> Hi,
> 
> My tomcat  throws NullPointerException sometimes. Here is environment:
> 
> Linux VM: RedHat Enterprise Linux Server release 6.7 x86_64
> Tomcat: 8.5.3
> JVM: HotSpot 64-Bit Server VM 1.8.0_65
> APR: 1.5.2-1
> Tomcat Native: 1.2.7

I'd recommend testing with to 8.5.12 and 1.2.12.

If you still see the issue, any information you can provide on
reproducing it would be helpful. Failing that, you could try narrowing
down whether the problem depends on the use of any of:
- HTTP/2
- Servlet async
- send file
- web socket

etc.

In short, the more information you can provide the better the chances of
us being able to help you.

You should probably look at using
-Dorg.apache.catalina.connector.RECYCLE_FACADES=true


Mark


> 
> The exception show in catalina.log :
> 
> 18-Mar-2017 03:36:01.135 WARNING [http-apr-2181-Poller]
>> org.apache.tomcat.util.net.AprEndpoint$Poller.run Unexpected poller error
>> java.lang.NullPointerException at
>> org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper.access$400(AprEndpoint.java:2243)
>> at org.apache.tomcat.util.net.AprEndpoint$Poller.run(AprEndpoint.java:1654)
>> at java.lang.Thread.run(Thread.java:745)
>>
> 
> I searched find similar with issue 54513
> <https://bz.apache.org/bugzilla/show_bug.cgi?id=54513>, but looks an
> old one and fixed.
> 
> Anyone hit this issue, any information can I look up?
> 
> Thanks,
> 
> Linbo
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org