drno-reg
@drno-reg
см не кратко

Как правильно сконфигурировать java wrapper?

Здравствуйте.

Пытаюсь в windows запустить jar как службу.
Для этих целей решил воспользоваться функционалом java wrapper community edition 3.5.29
При старте службы возникает ошибка wrapper при том, что необходимый jar стартует нормально.

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


настроки conf

#encoding=UTF-8
# Configuration files must begin with a line specifying the encoding
# of the 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
....


Прошу помочь разобраться в чем проблема.
  • Вопрос задан
  • 1530 просмотров
Решения вопроса 1
drno-reg
@drno-reg Автор вопроса
см не кратко
необходим простейший работающий пример класса с implements WrapperListener

временно решил вопрос таким образом

#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"


работающий выглядит так

# 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=
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
sergey-gornostaev
@sergey-gornostaev Куратор тега Java
Седой и строгий
Попробуй wrapper.startup.timeout=0
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
Bell Integrator Ульяновск
До 400 000 ₽
Bell Integrator Хабаровск
До 400 000 ₽
Bell Integrator Ижевск
До 400 000 ₽
22 мая 2024, в 02:15
10000 руб./за проект
21 мая 2024, в 23:47
30000 руб./за проект