Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7500131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:04:34+00:00 2026-05-29T20:04:34+00:00

I installed GlassFish 3.1.1 and set it up to work with Apache Webserver 2.2.x

  • 0

I installed GlassFish 3.1.1 and set it up to work with Apache Webserver 2.2.x using mod_jk. Everything works great when using port 8080. For example, an example hello.war application deployed on GlassFish runs fine from:

http://www.mydomain.com:8080/hello/

My question is, what do I need to change (or add) such that I can access the hello.war application using an address like this (and using port 80; so I can eventually close port 8080):

http://www.mydomain.com/hello/

The goal is to have all external traffic pass through Apache webserver port 80 to access GlassFish. Using this site’s instructions as inspiration, I modified httpd.conf to include the following lines (inside the pre-existing VirtualHost tags for http://www.mydomain.com)

JkMount /hello/* worker1
JkMount /hello worker1

Then I restart Apache webserver and go to:

http://www.mydomain.com/hello

and the website hangs (spinning wheel for 30s). What could be the problem? There’s no firewall between Apache and Glassfish, no loadbalance, and no clustering. It’s a new CentOS 6.2 server with all fresh installs.

For reference, my httpd.conf file includes the following (among other things):

LoadModule jk_module /etc/httpd/modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /etc/httpd/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
...
Listen 0.0.0.0:80

and the glassfish-jk.properties file is:

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

UPDATE: 2/11/2012 8:30pm I fixed the original problem posted above. The problem occurred because (1) there was a GlassFish bug (see Kevin’s answer below for this discovery), and (2) I had somehow managed inadvertently to setup multiple http listeners that were listening to the same port 8009. When I deleted all of the listeners and then created the one listener I wanted, I was able to solve the original intent of this posting. However upon viewing the server.log, I see another problem…

When I bring up the GlassFish server, I issue the following commands (note: port 4850 is simply an administration web-console provided by GlassFish; it needs to be there for some commands (not sure exactly which ones) but it doesn’t seems to hurt anything by being there for all of them):

# ./asadmin
asadmin> asadmin start-domain --port 4850
asadmin> deploy /path/to/file/hello.war --port 4850
asadmin> create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server gf_listener --port 4850 
asadmin> create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector --port 4850
asadmin> set server-config.network-config.network-listeners.network-listener.jk-connector.jk-configuration-file=/home/glassfish/glassfish3/glassfish/domains/domain1/config/glassfish-jk.properties --port 4850
asadmin> restart-domain --port 4850

The above commands are taken directly from the GlassFish Administration Guide (click on PDF link, turn to page 150. This starts the section “To enable mod_jk”, specifically see steps 5 and 6 on page 151).

I’ve included a snippet from the GlassFish server log below showing one type of SEVERE error and a WARNING for max threads too low.

[#|2012-02-11T20:23:23.666-0800|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=14;_ThreadName=Thread-2;|Grizzly Framework 1.9.36 started in: 43ms - bound to [0.0.0.0:8080]|#]
[#|2012-02-11T20:23:23.666-0800|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=11;_ThreadName=Thread-2;|Grizzly Framework 1.9.36 started in: 6ms - bound to [0.0.0.0:3700]|#]
[#|2012-02-11T20:23:23.666-0800|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=12;_ThreadName=Thread-2;|Grizzly Framework 1.9.36 started in: 24ms - bound to [0.0.0.0:4850]|#]
[#|2012-02-11T20:23:23.668-0800|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=15;_ThreadName=Thread-2;|Grizzly Framework 1.9.36 started in: 2ms - bound to [0.0.0.0:7676]|#]
[#|2012-02-11T20:23:23.691-0800|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.admin.adapter|_ThreadID=10;_ThreadName=Thread-2;|The Admin Console is already installed, but not yet loaded.|#]
[#|2012-02-11T20:23:23.781-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]|#]
[#|2012-02-11T20:23:23.788-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]|#]
[#|2012-02-11T20:23:23.793-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4850]|#]
[#|2012-02-11T20:23:23.803-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0170: Apache mod_jk/jk2 attached to virtual-server [server]  listening on port [8,009]|#]
[#|2012-02-11T20:23:23.806-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0170: Apache mod_jk/jk2 attached to virtual-server [server]  listening on port [8,009]|#]
[#|2012-02-11T20:23:23.826-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0171: Created virtual server [server]|#]
[#|2012-02-11T20:23:23.828-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0171: Created virtual server [__asadmin]|#]
[#|2012-02-11T20:23:24.316-0800|INFO|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0172: Virtual server [server] loaded default web module []|#]
[#|2012-02-11T20:23:24.416-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.416-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.416-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker worker|#]
[#|2012-02-11T20:23:24.416-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.417-0800|INFO|glassfish3.1.1|org.apache.jk.common.ChannelSocket|_ThreadID=10;_ThreadName=Thread-2;|JK: ajp13 listening on /0.0.0.0:8009|#]
[#|2012-02-11T20:23:24.426-0800|WARNING|glassfish3.1.1|org.apache.tomcat.util.threads.ThreadPool|_ThreadID=10;_ThreadName=Thread-2;|threadpool.max_threads_too_low|#]
[#|2012-02-11T20:23:24.428-0800|INFO|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|Jk running ID=0 time=0/25  config=null|#]
[#|2012-02-11T20:23:24.434-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.434-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.435-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker worker|#]
[#|2012-02-11T20:23:24.435-0800|SEVERE|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|No class name for worker.worker1 worker|#]
[#|2012-02-11T20:23:24.435-0800|INFO|glassfish3.1.1|org.apache.jk.common.ChannelSocket|_ThreadID=10;_ThreadName=Thread-2;|JK: ajp13 listening on /0.0.0.0:8009|#]
[#|2012-02-11T20:23:24.436-0800|WARNING|glassfish3.1.1|org.apache.tomcat.util.threads.ThreadPool|_ThreadID=10;_ThreadName=Thread-2;|threadpool.max_threads_too_low|#]
[#|2012-02-11T20:23:24.436-0800|INFO|glassfish3.1.1|org.apache.jk.server.JkMain|_ThreadID=10;_ThreadName=Thread-2;|Jk running ID=0 time=0/3  config=null|#]
and so on...

Anyone know how to eliminate the SEVERE errors for No class name for worker.worker1 worker, and how to eliminate threadpool.max_threads_too_low WARNING?

Which thread pool are they referring to? For example, when I type: asadmin> list-threadpools server, I get the following:

admin-thread-pool
http-thread-pool
thread-pool-1

I changed the http-thread-pool size from the default of 5 to a value of 200, then restarted GlassFish and looked at the server.log file and… nothing changes (still get same error message above). The max threads for admin-thread-pool is 50 and for thread-pool-1 is 200. Any ideas how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:04:36+00:00Added an answer on May 29, 2026 at 8:04 pm

    Finally figured out what was the problem with help from the GlassFish open-source forum (summarized below for others to reference). In the original posting above, I used:

    Problem #1 (broken AJP connection between mod_jk and GlassFish, original posted problem)

    # ./asadmin
    asadmin> asadmin start-domain --port 4850
    asadmin> deploy /path/to/file/hello.war --port 4850
    asadmin> create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs  server gf_listener --port 4850 
    asadmin> create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector --port 4850
    asadmin> set server-config.network-config.network-listeners.network-listener.jk-connector.jk-configuration-file=/home/glassfish/glassfish3/glassfish/domains/domain1/config/glassfish-jk.properties --port 4850
    asadmin> restart-domain --port 4850
    

    This came from the Administrator’s Guide. While the HTML file is correct here (http://docs.oracle.com/cd/E18930_01/html/821-2416/gfaad.html), if you select PDF and go to page 151, step 5 uses a variable called listener-name. However, this listener-name must agree with the use of jk-connector in step 6. Thus either listener-name must be jk-connector in step 5, or jk-connector in step 6 must be listener-name in step 5. In my case (see original posting code above), I set listener-name to gf_listener in step 5 and used jk-connector in step 6. This created the situation where two listeners were listening on the same port, which isn’t allowed. A better solution is to simply avoid issuing the create-http-server command, which is deprecated and shown only for backward compatibility (although not documented as such).

    Problem #2 (SEVERE errors noted above)

    The other problem is that the worker properties must go into the file ~/apache/conf/worker.properties, and all connector attributes (e.g. and NO worker properties) go into the domain-dir/conf/glassfish-jk.properties file. This is confusing because the PDF document above page 153 example 6-7 explicitly states This example shows a workers.properties or glassfish-jk.properties file that is set for load balancing... where they show setting worker properties in the glassfish-jk.properties file. This is wrong (given the directory structure and commands used above in the same document).

    Problem #3 (WARNING noted above for thread pool)

    I eliminated the WARNING for threadpool.max_threads_too_low because I had mistakenly increased the Default configuration rather than the Server configuration’s settings in the web console (after I increased the server configuration’s settings the warning went away). Increasing this value can be done at the command line or even easier using the web admin console (Configuration > server-config > thread pools). The command line way is:

    configs.config.server-config.thread-pools.thread-pool.http-thread-pool.max-thread-pool-size=200
    

    for 200 threads (example).

    Solution:

    Here’s my final and complete bring-up for GlassFish:

    asadmin> start-domain
    asadmin> deploy /home/glassfish/apps/hello.war
    asadmin> create-network-listener --protocol http-listener-1 --listenerport 8009 --jkenabled true jk-connector
    asadmin> set server-config.network-config.network-listeners.network-listener.jk-connector.jk-configuration-file=/home/glassfish/glassfish3/glassfish/domains/domain1/config/glassfish-jk.properties
    asadmin> restart-domain
    

    Note: there’s no create-jvm-options setting (as found in admin guide PDF above, step 7) since this relates to http-listener which is not used here anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just installed Glassfish on my Ubuntu server (No GUI) using THIS tutorial. Everything
I start glassfish with ~/.glassfish/bin/asadmin start-domain domain1 Everything works perfect. I enter to http://localhost:8080
I have glassfish installed on a server with a JMS ConnectionFactory set up jms/MyConnectionFactory
I was using 1.6.0_19 jdk and installed 1.6.0_20 jdk.. Glassfish doesn't like that... Here
I have glassfish v3 on windows 7 installed, but it won't start on 8080.
I'm trying to create REST services using Jersey (builtin) on Glassfish. I installed GlassFish
I've got Apache 2.2.15 proxying requests to GlassFish 3.1.1 via mod_proxy_ajp using the defaults
I installed Ubuntu, GlassFish web server, installed JRuby on Rails using GlassFish's admin tools,
I just installed Glassfish V2 on my local machine just to play around with
Glassfish had already been installed into Netbeans. But I forgot the password and username.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.