----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
I forgot to add: Using the same script, I can start JServ and use it
just fine. The problem shows up ONLY with the -r or -s switches.
Shash
Shash Chatterjee wrote:
>
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files. Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> Hi All!
>
> I am having a problem manually restarting/stopping a JServ engine. What I
> get in the logfile is this:
>
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.jserv.JServ.fail(JServ.java, Compiled Code)
> at org.apache.jserv.JServ.fail(JServ.java, Compiled Code)
> at org.apache.jserv.JServ.signal(JServ.java, Compiled Code)
> at org.apache.jserv.JServ.main(JServ.java, Compiled Code)
>
> The relevant files are included below.
>
> Thanks,
> Shash
>
> The configuration I have:
> Redhat-6.1 on Intel
> Blackdown JDK 1.2.2-RC3
> JServ-1.1b3 (on Apache 1.3.9, although irrelevant in this case)
>
> ---------------------------JServ script -----------------------------------
> I use the "-r" or "-s" argument to the following script:
>
> #!/bin/bash
>
> cfg=/home/chatsa/servlets/jserv.properties
> log=/home/chatsa/logs/jserv_share.log
> java="java -green"
>
> # Setup classpath for all tools and common libraries
> cp=/home/chatsa/servlets/classes:/usr/local/lib/jdk/lib/tools.jar
> cp=$cp:/home/chatsa/servlets/classes/mail.jar
> cp=$cp:/home/chatsa/servlets/classes/activation.jar
> cp=$cp:/home/httpd/classes/mysql_comp.jar
> cp=$cp:/usr/lib/apache/ApacheJServ.jar
> cp=$cp:/home/httpd/classes/servlet-2.0.jar
>
> exec $java -classpath $cp org.apache.jserv.JServ $cfg $1 2>>$log
>
> ----------------------------- jserv.properties ---------------------------------
> ##
> ##
> ##
> ###############################################################################
> # Apache JServ Configuration File #
> ###############################################################################
>
> ################################ W A R N I N G ################################
> # Unlike normal Java properties, JServ configurations have some important
> # extentions:
> #
> # 1) commas are used as token separators
> # 2) multiple definitions of the same key are concatenated in a
> # comma-separated list.
> ###############################################################################
>
> #
> # General parameters
> ######################
>
> # Set the default IP address or hostname Apache JServ binds (or listens) to.
> #
> # If you have a machine with multiple IP addresses, this address
> # will be the one used. If you set the value to localhost, it
> # will be resolved to the IP address configured for the locahost
> # on your system (generally this is 127.0.0.1). This feature is so
> # that one can have multiple instances of Apache JServ listening on
> # the same port number, but different IP addresses on the same machine.
> #
> # Syntax: bindaddress=[ipaddress] or [localhost]
> # Default: localhost
> bindaddress=www.chatsa
>
> # Set the port Apache JServ listens to.
> # Syntax: port=[1024,65535] (int)
> # Default: 8007
> port=9001
>
> #
> # Servlet Zones parameters
> ###########################
>
> # List of servlet zones Apache JServ manages
> # Syntax: zones=[servlet zone],[servlet zone]... (Comma separated list of String)
> # Default: NONE
> zones=chatsa,gnujsp
>
> # Configuration file for each servlet zone (one per servlet zone)
> # Syntax: [servlet zone name as on the zones list].properties=[full path to
>configFile] (String)
> # Default: NONE
> # Note: if the file could not be opened, try using absolute paths.
> chatsa.properties=/home/chatsa/servlets/zone.properties
> gnujsp.properties=/home/chatsa/servlets/gnujsp.properties
>
> #
> # Thread Pool parameters
> #########################
>
> # Enables or disables the use of the thread pool.
> # Syntax: pool=[true|false] (boolean)
> # Default: false
> # WARNING: the pool has not been extensively tested and may generate deadlocks.
> # For this reason, we advise against using this code in production environments.
> pool=false
>
> # Indicates the number of idle threads that the pool may contain.
> # Syntax: pool.capacity=(int)>0
> # Default: 10
> # NOTE: depending on your system load, this number should be low for contantly
> # loaded servers and should be increased depending on load bursts.
> pool.capacity=10
>
> # Indicates the pool controller that should be used to control the
> # level of the recycled threads.
> # Syntax: pool.controller=[full class of controller] (String)
> # Default: org.apache.java.recycle.DefaultController
> # NOTE: it is safe to leave this unchanged unless special recycle behavior
> # is needed. Look at the "org.apache.java.recycle" package javadocs for more
> # info on other pool controllers and their behavior.
> pool.controller=org.apache.java.recycle.DefaultController
>
> #
> # Security parameters
> #####################
>
> # Enable/disable the execution of org.apache.jserv.JServ as a servlet.
> # This is disabled by default because it may give informations that should
> # be restricted.
> # Note that the execution of Apache JServ as a servlet is filtered by the web
> # server modules by default so that both sides should be enabled to let this
> # service work.
> # This service is useful for installation and configuration since it gives
> # feedback about the exact configurations Apache JServ is using, but it should
> # be disabled when both installation and configuration processes are done.
> # Syntax: security.selfservlet=[true|false] (boolean)
> # Default: false
> # WARNING: disable this in a production environment since may give reserved
> # information to untrusted users.
> security.selfservlet=true
>
> # Set the maximum number of socket connections Apache JServ may handle
> # simultaneously. Make sure your operating environment has enough file
> # descriptors to allow this number.
> # Syntax: security.maxConnections=(int)>1
> # Default: 50
> security.maxConnections=50
>
> # Backlog setting for very fine performance tunning of JServ.
> # Unless you are familiar to sockets leave this value commented out.
> # security.backlog=5
>
> # List of IP addresses allowed to connect to Apache JServ. This is a first
> # security filtering to reject possibly unsecure connections and avoid the
> # overhead of connection authentication.
> # Syntax: security.allowedAddresses=[IP address],[IP Address]... (Comma separated
>list of IP addresses)
> # Default: 127.0.0.1
>
>security.allowedAddresses=127.0.0.1,192.168.0.1,192.168.0.100,192.168.0.101,192.168.0.102
>
> # Enable/disable connection authentication.
> # NOTE: unauthenticated connections are a little faster since authentication
> # handshake is not performed at connection creation.
> # WARNING: authentication is disabled by default because we believe that
> # connection restriction from all IP addresses but localhost reduces your
> # time to get Apache JServ to run. If you allow other addresses to connect and
> # you don't trust it, you should enable authentication to prevent untrusted
> # execution of your servlets. Beware: if authentication is disabled and the
> # IP address is allowed, everyone on that machine can execute your servlets!
> # Syntax: security.authentication=[true,false] (boolean)
> # Default: true
> security.authentication=true
>
> # Authentication secret key.
> # The secret key is passed as a file that must be kept secure and must
> # be exactly the same of those used by clients to authenticate themselves.
> # Syntax: security.secretKey=[secret key path and filename] (String)
> # Default: NONE
> # Note: if the file could not be opened, try using absolute paths.
> security.secretKey=/etc/httpd/conf/jserv/jserv.secret.key
>
> # Length of the randomly generated challenge string (in bytes) used to
> # authenticate connections. 5 is the lowest possible choice to force a safe
> # level of security and reduce connection creation overhead.
> # Syntax: security.challengeSize=(int)>5
> # Default: 5
> security.challengeSize=5
>
> #
> # Logging parameters
> ####################
>
> # Enable/disable Apache JServ logging.
> # WARNING: logging is a very expensive operation in terms of performance. You
> # should reduced the generated log to a minumum or even disable it if fast
> # execution is an issue. Note that if all log channels (see below) are
> # enabled, the log may become really big since each servlet request may
> # generate many Kb of log. Some log channels are mainly for debugging
> # purposes and should be disabled in a production environment.
> # Syntax: log=[true,false] (boolean)
> # Default: true
> log=true
>
> # Set the name of the trace/log file. To avoid possible confusion about
> # the location of this file, an absolute pathname is recommended.
> #
> # This log file is different than the log file that is in the
> # jserv.conf file. This is the log file for the Java portion of Apache
> # JServ.
> #
> # On Unix, this file must have write permissions by the owner of the JVM
> # process. In other words, if you are running Apache JServ in manual mode
> # and Apache is running as user nobody, then the file must have its
> # permissions set so that that user can write to it.
> # Syntax: log.file=[log path and filename] (String)
> # Default: NONE
> # Note: if the file could not be opened, try using absolute paths.
> log.file=/home/chatsa/logs/jserv.log
>
> # Enable the timestamp before the log message
> # Syntax: log.timestamp=[true,false] (boolean)
> # Default: true
> log.timestamp=true
>
> # Use the given string as a data format
> # (see java.text.SimpleDateFormat for the list of options)
> # Syntax: log.dateFormat=(String)
> # Default: [dd/MM/yyyy HH:mm:ss:SSS zz]
> log.dateFormat=[dd/MM/yyyy HH:mm:ss:SSS zz]
>
> # Since all the messages logged are processed by a thread running with
> # minimum priority, it's of vital importance that this thread gets a chance
> # to run once in a while. If it doesn't, the log queue overflow occurs,
> # usually resulting in the OutOfMemoryError.
> #
> # To prevent this from happening, two parameters are used: log.queue.maxage
> # and log.queue.maxsize. The former defines the maximum time for the logged
> # message to stay in the queue, the latter defines maximum number of
> # messages in the queue.
> #
> # If one of those conditions becomes true (age > maxage || size > maxsize),
> # the log message stating that fact is generated and the log queue is
> # flushed in the separate thread.
> #
> # If you ever see such a message, either your system doesn't live up to its
> # expectations or you have a runaway loop (probably, but not necessarily,
> # generating a lot of log messages).
> #
> # WARNING: Default values are lousy, you probably want to tweak them and
> # report the results back to the development team.
>
> # Syntax: log.queue.maxage = [milliseconds]
> # Default: 5000
> log.queue.maxage = 5000
>
> # Syntax: log.queue.maxsize = [integer]
> # Default: 1000
> log.queue.maxsize = 1000
>
> # Enable/disable logging the channel name
> # Default: false
> log.channel=true
>
> # Enable/disable channels, each logging different actions.
> # Syntax: log.channel.[channel name]=[true,false] (boolean)
> # Default: false
>
> # Info channel - quite a lot of informational messages
> # hopefully you don't need them under normal circumstances
> log.channel.info=true
>
> # Servlets exception, i.e. exception caught during
> # servlet.service() processing are monitored here
> # you probably want to have this one switched on
> log.channel.servletException=true
>
> # JServ exception, caught internally in jserv
> # we suggest to leave it on
> log.channel.jservException=true
>
> # Warning channel, it catches all the important
> # messages that don't cause JServ to stop, leave it on
> log.channel.warning=true
>
> # Servlet log
> # All messages logged by servlets. Probably you want
> # this one to be switched on.
> log.channel.servletLog=true
>
> # Critical errors
> # Messages produced by critical events causing jserv to stop
> log.channel.critical=true
>
> # Debug channel
> # Only for internal debugging purposes
> log.channel.debug=true
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives and Other: <http://java.apache.org/main/mail.html>
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]