400 Response with mod_jk

87 views
Skip to first unread message

Will Hartung

unread,
Jul 20, 2017, 7:14:33 PM7/20/17
to Payara Forum
Trying to migrate from 3.12 to latest Payara. Seems that my last stumbling block is our mod_jk integration.

Whenever I try to access anything from the server, I get a 400 Bad Request result.

I've stood up a brand new domain, set up the jk enabled listener, set up the port, deployed a Hello World war, and that worked fine from Apache. So that tells me that Apache side is working. That tells me that jk support in Payara is working.

On my actual domain, with my application, I get the 400s.

I tried deploying a "hello world" war to the server, and it's still getting 400's

I have Grizzly logging turned on to FINE (it was the only thing I could think of, frankly), and I see the request hitting the server.

[2017-07-20T16:10:24.230-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.nio.transport.TCPNIOTransport] [tid: _ThreadID=44 _ThreadName=http-thread-pool::jk-connector(3)] [timeMillis: 1500592224230] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.nio.transport.TCPNIOUtils] [METHODNAME: allocateAndReadBuffer] [[
  TCPNIOConnection (TCPNIOConnection{localSocketAddress={/127.0.0.1:10009}, peerSocketAddress={/127.0.0.1:45826}}) (allocated) read 5 bytes]]

[2017-07-20T16:10:24.230-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.nio.transport.TCPNIOTransport] [tid: _ThreadID=44 _ThreadName=http-thread-pool::jk-connector(3)] [timeMillis: 1500592224230] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.nio.transport.TCPNIOUtils] [METHODNAME: writeSimpleBuffer] [[
  TCPNIOConnection (TCPNIOConnection{localSocketAddress={/127.0.0.1:10009}, peerSocketAddress={/127.0.0.1:45826}}) (plain) write 5 bytes]]

[2017-07-20T16:10:24.231-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.nio.transport.TCPNIOTransport] [tid: _ThreadID=45 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1500592224231] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.nio.transport.TCPNIOUtils] [METHODNAME: allocateAndReadBuffer] [[
  TCPNIOConnection (TCPNIOConnection{localSocketAddress={/127.0.0.1:10009}, peerSocketAddress={/127.0.0.1:45826}}) (allocated) read 374 bytes]]

[2017-07-20T16:10:24.231-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.websockets.BaseWebSocketFilter] [tid: _ThreadID=45 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1500592224231] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.websockets.BaseWebSocketFilter] [METHODNAME: handleRead] [[
  handleRead websocket: null content-size=0 headers=
HttpRequestPacket (
   method=GET
   url=/will/index.html
   query=null
   protocol=HTTP/1.1
   content-length=0
   headers=[
      user-agent=curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
      host=localhost
      accept=*/*
      SSL_CLIENT_S_DN=(null)
      SSL_CLIENT_I_DN=(null)
      SSL_SERVER_S_DN_OU=Domain Control Validated
      SSL_CLIENT_VERIFY=NONE
      content-length=0]
)]]

[2017-07-20T16:10:24.233-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.nio.transport.TCPNIOTransport] [tid: _ThreadID=45 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1500592224233] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.nio.transport.TCPNIOUtils] [METHODNAME: writeSimpleBuffer] [[
  TCPNIOConnection (TCPNIOConnection{localSocketAddress={/127.0.0.1:10009}, peerSocketAddress={/127.0.0.1:45826}}) (plain) write 23 bytes]]

[2017-07-20T16:10:24.233-0700] [Payara 4.1] [FINE] [] [org.glassfish.grizzly.nio.transport.TCPNIOTransport] [tid: _ThreadID=45 _ThreadName=http-thread-pool::jk-connector(4)] [timeMillis: 1500592224233] [levelValue: 500] [CLASSNAME: org.glassfish.grizzly.nio.transport.TCPNIOUtils] [METHODNAME: writeSimpleBuffer] [[
  TCPNIOConnection (TCPNIOConnection{localSocketAddress={/127.0.0.1:10009}, peerSocketAddress={/127.0.0.1:45826}}) (plain) write 6 bytes]]

So, it's something deeper.

The config is pretty basic:

        <network-listeners>
          <network-listener port="10080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="10081" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="10048" protocol="pu-protocol" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
          <network-listener port="10009" protocol="http-listener-1" transport="tcp" name="jk-connector" jk-enabled="true" thread-pool="http-thread-pool"></network-listener>
        </network-listeners>

Not a lot to do there, I don't think.

I've diffed the domain.xmls and nothing stands out that shouldn't be there.

So, I'm at a bit of a loss as to what the next step might be.

Thanks.

Regards,

Will Hartung

Mike Croft

unread,
Jul 21, 2017, 4:16:58 AM7/21/17
to Payara Forum
What's your Apache configuration? Did you copy it directly from your old GlassFish setup?

Will Hartung

unread,
Jul 21, 2017, 1:21:13 PM7/21/17
to Payara Forum


On Friday, July 21, 2017 at 1:16:58 AM UTC-7, Mike Croft wrote:
What's your Apache configuration? Did you copy it directly from your old GlassFish setup?

Yea, apache works fine. I tested that by firing up a new domain, creating the jk-connector, and curl-ing my Hello World war. Worked a champ.

I essentially just copied what I had before. Our current config has several apps in the container, so I need to split our app out. So, I created a new worker in Apache by copying the one we had, and renaming it and changing the port.

But it works fine with a new domain.
 
Message has been deleted

Zoltan Mathe

unread,
Jul 24, 2017, 10:10:19 AM7/24/17
to Payara Forum
Hi Will,

I migrated earlier from GF v3.2.1 with similar mod_jk settings, but I didn't have to create a new domain to work well.
The only difference near the dedicated protocol for the jk-connector listener (but if it worked under v3 with the common http-listener-1 protocol, this will not be the problem).

My migrated settings:

<protocol name="jk-connector">
 
<http default-virtual-server="server">
   
<file-cache></file-cache>
 
</http>
</protocol>

<network-listeners>
 
<network-listener protocol="http-listener-1" port="${HTTP_LISTENER_PORT}" name="http-listener-1" thread-pool="http-thread-pool" transport="tcp"></network-listener>
 
<network-listener protocol="http-listener-2" port="${HTTP_SSL_LISTENER_PORT}" name="http-listener-2" thread-pool="http-thread-pool" transport="tcp"></network-listener>
 
<network-listener protocol="pu-protocol" port="${ASADMIN_LISTENER_PORT}" name="admin-listener" thread-pool="admin-thread-pool" transport="tcp"></network-listener>
 
<network-listener jk-enabled="true" protocol="jk-connector" port="${AJP_PORT}" name="jk-connector" thread-pool="http-thread-pool" jk-configuration-file="${com.sun.aas.installRoot}/config/glassfish-jk.properties" transport="tcp"></network-listener>
</network-listeners>

If I could think of something, I'll write it.

Zoltan
Reply all
Reply to author
Forward
0 new messages