N
N
Nikolay Baranenko2016-07-19 10:32:10
Java
Nikolay Baranenko, 2016-07-19 10:32:10

How to properly configure java wrapper?

Hello.

I'm trying to run jar as a service in windows.
For these purposes, I decided to use the functionality of java wrapper community edition 3.5.29
At the start of the service, a wrapper error occurs despite the fact that the necessary jar starts normally.

STATUS | wrappers | 2016/07/19 10:22:06 | --> Wrapper Started as Service
STATUS | wrappers | 2016/07/19 10:22:06 | Java Service Wrapper Community Edition 32-bit 3.5.29
STATUS | wrappers | 2016/07/19 10:22:06 | Copyright (C) 1999-2016 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrappers | 2016/07/19 10:22:06 | wrapper.tanukisoftware.com
STATUS | wrappers | 2016/07/19 10:22:06 |
STATUS | wrappers | 2016/07/19 10:22:06 | Launching a JVM...
INFO | jvm1 | 2016/07/19 10:22:07 | [10:22:06 07/19/2016]: Starting the main process. Working with Oracle database.
ERROR | wrappers | 2016/07/19 10:22:36 | Startup failed: Timed out waiting for a signal from the JVM.
ADVICE | wrappers | 2016/07/19 10:22:36 |
ADVICE | wrappers | 2016/07/19 10:22:36 | -------------------------------------------------- ----------------------
ADVICE | wrappers | 2016/07/19 10:22:36 | Advice:
ADVICE | wrappers | 2016/07/19 10:22:36 | The Wrapper consists of a native component as well as a set of classes
ADVICE | wrappers | 2016/07/19 10:22:36 | which run within the JVM that it launches. The Java component of the
ADVICE | wrappers | 2016/07/19 10:22:36 | Wrapper must be initialized promptly after the JVM is launched or the
ADVICE | wrappers | 2016/07/19 10:22:36 | Wrapper will timeout, as just happened. Most likely the main class
ADVICE | wrappers | 2016/07/19 10:22:36 | specified in the Wrapper configuration file is not correctly initializing
ADVICE | wrappers | 2016/07/19 10:22:36 | the Wrapper classes:
ADVICE | wrappers | 2016/07/19 10:22:36 | COM.MainRunner
ADVICE | wrappers | 2016/07/19 10:22:36 | While it is possible to do so manually, the Wrapper ships with helper
ADVICE | wrappers | 2016/07/19 10:22:36 | classes to make this initialization processes automatic.
ADVICE | wrappers | 2016/07/19 10:22:36 | Please review the integration section of the Wrapper's documentation
ADVICE | wrappers | 2016/07/19 10:22:36 | for the various methods which can be employed to launch an application
ADVICE | wrappers | 2016/07/19 10:22:36 | within the Wrapper:
ADVICE | wrappers | 2016/07/19 10:22:36 | wrapper.tanukisoftware.com/doc/english/integrate.html
ADVICE | wrappers | 2016/07/19 10:22:36 | -------------------------------------------------- ----------------------
ADVICE | wrappers | 2016/07/19 10:22:36 |
ERROR | wrappers | 2016/07/19 10:22:36 | JVM did not exit on request, termination requested.
STATUS | wrappers | 2016/07/19 10:22:36 | JVM exited after being requested to terminate.
STATUS | wrappers | 2016/07/19 10:22:41 | Launching a JVM...
INFO | jvm2 | 2016/07/19 10:22:41 | [10:22:41 07/19/2016]: Starting the main process. Working with Oracle database.


conf settings

#encoding=UTF-8
# Configuration files must begin with a line specifying the encoding
# of the file.

....
#********************************************* *************************
# Wrapper Localization
#************************* *********************************************
# Specify the locale which the Wrapper should use. By default the system
#locale is used.
#wrapper.lang=en_US # en_US or ja_JP

# Specify the location of the Wrapper's language resources. If these are
# missing, the Wrapper will default to the en_US locale.
wrapper.lang.folder=../lang

#******************************************* ******************************
# Wrapper Java Properties
#******************************************************* *******************
# Java Application
# Locate the java binary on the system PATH:
wrapper.java.command=java
# Specify a specific java binary:
#set.JAVA_HOME =/java/path
#wrapper.java.command=%JAVA_HOME%/bin/java

# Tell the Wrapper to log the full generated Java command line.
#wrapper.java.command.loglevel=INFO

# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
#wrapper.java.mainclass=org.tanukisoftware.wrapper.demo.DemoApp
wrapper.java.mainclass=COM.MainRunner

# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
#wrapper.java.classpath .1=../lib/wrapperdemo.jar
wrapper.java.classpath.1=../lib/main.jar
#wrapper.java.classpath.2=../lib/wrapper.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib

# Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE

# Java Additional Parameters
wrapper.java.additional.1=

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1="Oracle"

#*********************************** *************************************
# Wrapper Logging Properties
#********** ******************************************************* **********
# Enables Debug output from the Wrapper.
# wrapper.debug=TRUE

# Format of output for the console. (See docs for formats)
wrapper.console.format=PM

# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=../logs/main.log

# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0

# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************* **************************
# Wrapper General Properties
#************************* ***************************************************
# Allow for the use of non-contiguous numbered properties
wrapper.ignore_sequence_gaps=TRUE

# Do not start if the pid file already exists.
wrapper.pidfile.strict=TRUE

# Title to use when running as a console
wrapper.console.title=Test Wrapper Sample Application

#*********************** *********************************************
# Wrapper JVM Checks
# ******************************************************* ******************
# Detect DeadLocked Threads in the JVM. (Requires Standard Edition)
wrapper.check.deadlock=TRUE
wrapper.check.deadlock.interval=10
wrapper.max_failed_invocations=99
wrapper.console.fatal_to_stderr=FALSE
wrapper.console.error_to_stderr=FALSE
wrapper.check.deadlock.action=RESTART
wrapper .check.deadlock.output=FULL

# Out Of Memory detection.
# Ignore -verbose:class output to avoid false positives.
wrapper.filter.trigger.1000=[Loaded java.lang.OutOfMemoryError
wrapper.filter.action.1000=NONE
# (Simple match)
wrapper.filter.trigger.1001=java.lang.OutOfMemoryError
# (Only match text in stack traces if -XX:+PrintClassHistogram is being used.)
#wrapper.filter.trigger.1001=Exception in thread "*" java.lang.OutOfMemoryError
#wrapper.filter.allow_wildcards.1001=TRUE
wrapper.filter.action.1001=RESTART
wrapper.filter.message.1001=The JVM has run out of memory.

....
# Specify custom mail content
wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n
....


Please help me figure out what the problem is.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolay Baranenko, 2016-07-19
@drno-reg

the simplest working example of a class with implements WrapperListener is needed
temporarily solved the issue in this way

#wrapper.java.mainclass=org.tanukisoftware.wrapper.demo.DemoApp
#wrapper.java.mainclass=COM.MainTaskRunner
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
#wrapper.java.classpath.1=../lib/wrapperdemo.jar
wrapper.java.classpath.1=C:/New/MainRunner.jar
wrapper.java.classpath.2=../lib/wrapper.jar
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib
wrapper.java.library.path.2=C:/New/MainRunner/lib

# Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE

# Java Additional Parameters
wrapper.java.additional.1=

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters.  Add parameters as needed starting from 1
#wrapper.app.parameter.1="Oracle"


# The first application parameter is the name of the class whose main
# method is to be called when the application is launched.  The class
# name is followed by the number of parameters to be passed to its main
# method.  Then comes the actual parameters.
wrapper.app.parameter.1=COM.MainRunner
wrapper.app.parameter.2="Oracle"

working looks like this
# Java Main class.  This class must implement the WrapperListener interface
#  or guarantee that the WrapperManager class is initialized.  Helper
#  classes are provided to do this for you.  See the Integration section
#  of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1

wrapper.java.classpath.1=../lib/example.jar
wrapper.java.classpath.2=../lib/wrapper.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=../lib
wrapper.java.library.path.2=../lib/lib

# Java Bits.  On applicable platforms, tells the JVM to run in 32 or 64-bit mode.
wrapper.java.additional.auto_bits=TRUE

# Java Additional Parameters
wrapper.java.additional.1="Oracle"

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters.  Add parameters as needed starting from 1
wrapper.app.parameter.1=

S
Sergey Gornostaev, 2016-07-19
@sergey-gornostaev

Try wrapper.startup.timeout=0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question