1

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

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

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

настройки conf

    #********************************************************************
# 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=main.jar
#wrapper.java.classpath.2=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/wrapper.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=UM_Scheduler

#********************************************************************
# 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.

Прошу помочь разобраться в проблеме. Чего ждет от моего класса JVM?

1
  • необходим простейший работающий пример класса с implements WrapperListener 19 июл 2016 в 11:22

1 ответ 1

2

удалось решить вопрос через правку conf

решение через изменение настроек conf #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"

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.