|
From: Leif M. <le...@ta...> - 2003-10-17 02:37:44
|
Stefan,
If your application is working as a console application, but failing
when run as a service,
your problem is most likely related to a permissions issue or a
difference in the environment
variables that are available.
In any case, the first thing you should do when debugging any
Wrapper problem is to
look in the wrapper.log file. If nothing is obvious, try adding the
following property to your
wrapper.conf and then rerunning your application.
wrapper.debug=true
This will cause the wrapper to dump, amongst other things, the full
java command line
used to actually launch Java. Compare the command line used to launch
the application
as a service versus the one used to launch in console mode.
The most common problem here is setting an environment variable in
the batch file
used to install and then run as a service. Environment variables set in
the batch file
will not be available when run as a service. To do this, you need to
add them to the
command line used to install the Wrapper as a service. As follows:
Wrapper.exe -i ..\conf\wrapper.conf set.MY_ENV=testval
You can also define environment variables within the wrapper.conf
using the same
syntax.
Post back whether or not you get things working. If you are still
having problems,
then attach your wrapper.conf and the wrapper.log output from a SINGLE
run with
debug output enabled.
Cheers,
Leif
|
|
From: Stefan M. <ste...@ea...> - 2003-10-17 08:34:18
Attachments:
wrapper_debug.conf.txt
|
Thanks for your prompt reply
Please find attached my conf file & see below extracts from the log =
file(s)
Any help is greatly appreciated
Have set wrapper.debug=3Dtrue
****************Extract from App.bat************************************
STATUS | wrapper | 2003/10/17 08:49:51 | --> Wrapper Started as Console
DEBUG | wrapperp | 2003/10/17 08:49:51 | server listening on port =
32000.
STATUS | wrapper | 2003/10/17 08:49:52 | Launching a JVM...
DEBUG | wrapper | 2003/10/17 08:49:52 | command: "C:\Program
Files\j2sdk_nb\j2sdk1.4.2\bin\java.exe" -Xms3m -Xmx64m
-Djava.library.path=3D"C:\wrapper_win32_3.0.5/lib" -classpath
"h:/;C:\wrapper_win32_3.0.5/lib/wrapper.jar;C:\jjtds\jtds-0.5.1.jar;C:\my=
SQL
\mysql-connector-java-3.0.8-stable\mysql-connector-java-3.0.8-stable-bin.=
jar
" -Dwrapper.key=3D"vjVwlS9DPWzT8ILN" -Dwrapper.port=3D32000
-Dwrapper.debug=3D"TRUE" -Dwrapper.cpu.timeout=3D"10" =
-Dwrapper.jvmid=3D1
com.eaac.HRWrapper.HRScannerService <myParam#1>...<myParam#n>
....
Loads of other INFO/DEBUG o/p
INFO | jvm 1 | 2003/10/17 08:49:58 | scanHRForChanges
(above INFO line is expected periodic audit trail from within my app)
....
INFO | jvm 1 | 2003/10/17 08:50:06 | scanHRForChanges
STATUS | wrapper | 2003/10/17 08:50:07 | CTRL-C trapped. Shutting =
down.
DEBUG | wrapper | 2003/10/17 08:50:07 | wrapperStopProcess(0) called.
....
INFO | jvm 1 | 2003/10/17 08:50:08 | calling System.exit(0)
DEBUG | wrapper | 2003/10/17 08:50:08 | JVM exited normally.
STATUS | wrapper | 2003/10/17 08:50:08 | <-- Wrapper Stopped
****************Extract from App.bat************************************
****************Extract from log file =
InstallApp-NT.bat*********************
DEBUG | wrapper | 2003/10/17 08:52:04 | Service command:
C:\wrapper_win32_3.0.5\bin\Wrapper.exe -s =
H:\com\eaac\HRWrapper\wrapper.conf
STATUS | wrapper | 2003/10/17 08:52:05 | HR Web SSM Scanner installed.
STATUS | wrapper | 2003/10/17 09:06:00 | HR Web SSM Scanner removed.
****************Extract from log file =
InstallApp-NT.bat*********************
*************Extract from log file =
InstallApp-NT.bat************************
(after hardcoding paths in InstallApp-NT.bat to avoid Env vars)
DEBUG | wrapper | 2003/10/17 09:07:22 | Service command:
C:\wrapper_win32_3.0.5\bin\Wrapper.exe -s =
h:\com\eaac\HRWrapper\wrapper.conf
STATUS | wrapper | 2003/10/17 09:07:23 | HR Web SSM Scanner installed.
*************Extract from log file =
InstallApp-NT.bat************************
PLEASE NOTE
I have also tried your 'out-of-the-box'
TestWrapper.bat & InstallTestWrapper-NT.bat
Same result
If the InstallApp-NT.bat cannot use standard batch file commands for =
setting
up Env variables - Can you correct the example bat files=20
Regards
Stefan Maric
European Aviation Air Charter
01202 581111 x184
-----Original Message-----
From: wra...@li...
[mailto:wra...@li...] On Behalf Of Leif
Mortenson
Sent: 2003-Oct-17 03:37
To: wra...@li...
Subject: Re: [Wrapper-user] Win 2000 Service problem
Stefan,
If your application is working as a console application, but failing =
when run as a service,
your problem is most likely related to a permissions issue or a=20
difference in the environment
variables that are available.
In any case, the first thing you should do when debugging any=20
Wrapper problem is to
look in the wrapper.log file. If nothing is obvious, try adding the=20
following property to your
wrapper.conf and then rerunning your application.
wrapper.debug=3Dtrue
This will cause the wrapper to dump, amongst other things, the full=20
java command line
used to actually launch Java. Compare the command line used to launch=20
the application
as a service versus the one used to launch in console mode.
The most common problem here is setting an environment variable in=20
the batch file
used to install and then run as a service. Environment variables set in =
the batch file
will not be available when run as a service. To do this, you need to=20
add them to the
command line used to install the Wrapper as a service. As follows:
Wrapper.exe -i ..\conf\wrapper.conf set.MY_ENV=3Dtestval
You can also define environment variables within the wrapper.conf=20
using the same
syntax.
Post back whether or not you get things working. If you are still=20
having problems,
then attach your wrapper.conf and the wrapper.log output from a SINGLE=20
run with
debug output enabled.
Cheers,
Leif
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Wrapper-user mailing list
Wra...@li...
https://lists.sourceforge.net/lists/listinfo/wrapper-user
|
|
From: Leif M. <le...@ta...> - 2003-10-17 09:06:45
|
Stefan,
You sent me lots of info, but skipped the one key piece that I need
to respond, the
log output of the run when you attempt to start the application as a
service. Also. When
sending in log files, please do not trim them down. I know the idea is
to reduce the size of
the emails, but you removed a lot of the information that I wanted to
see. :-)
>If the InstallApp-NT.bat cannot use standard batch file commands for setting
>up Env variables - Can you correct the example bat files
>
>
The environment variables declared in the scripts are only really meant
to be used
from within the batch files, not for references in the wrapper.conf
file. So they are
correct in that sense.
Looking at your wrapper.conf file, I have one idea for what the problem
may be.
(It would be answered quickly by seeing the debug log output when you
attempt to
launch the Wrapper as a service.)
You have a few references to the WRAPPERDIR environment variable in your
conf
file. If you have not set this as a system level environment variable
or specified it on
the command line when the wrapper was installed as a service this will
not work:
wrapper.exe -i ../conf/wrapper.conf set.WRAPPERDIR=C:\MyApp
>wrapper.java.classpath.2=%WRAPPERDIR%/lib/wrapper.jar
>
>wrapper.java.library.path.1=%WRAPPERDIR%/lib
>
>
You might want to consider just using a relative path as follows:
wrapper.java.classpath.2=../lib/wrapper.jar
wrapper.java.library.path.1=../lib
Same goes for the following log location. If that file can not be
accessed for any
reason then the wrapper will open a file called wrapper.log in the
windows system
directory. That may be why you have not found the file this far.
>wrapper.logfile=%WKDIR%logs/HRScannerService.log
>
>
This could also be
wrapper.logfile=../logs/HRScannerService.log
Cheers,
Leif
|
|
From: Stefan M. <ste...@ea...> - 2003-10-17 09:49:12
Attachments:
HRScannerService.log
|
OK
Have killed off previous log files
Attached log file shows o/p from running InstallApp-NT.bat
Win2K Services
myService - set Log On As local admin
myService start
No additional entries in log file ?????
*******************Relevant contents of =
InstallApp-NT.bat*******************
rem
rem Run the application.
rem At runtime, the current directory will be that of Wrapper.exe
rem
:startup
"C:\wrapper_win32_3.0.5\bin\Wrapper.exe" -i
h:\com\eaac\HRWrapper\wrapper.conf
if not errorlevel 1 goto end
pause
*******************Relevant contents of =
InstallApp-NT.bat*******************
Regards
Stefan Maric
European Aviation Air Charter
01202 581111 x184
-----Original Message-----
From: wra...@li...
[mailto:wra...@li...] On Behalf Of Leif
Mortenson
Sent: 2003-Oct-17 09:58
To: wra...@li...
Subject: Re: [Wrapper-user] Win 2000 Service problem
Stefan,
You sent me lots of info, but skipped the one key piece that I need=20
to respond, the
log output of the run when you attempt to start the application as a=20
service. Also. When
sending in log files, please do not trim them down. I know the idea is=20
to reduce the size of
the emails, but you removed a lot of the information that I wanted to=20
see. :-)
>If the InstallApp-NT.bat cannot use standard batch file commands for
setting
>up Env variables - Can you correct the example bat files=20
> =20
>
The environment variables declared in the scripts are only really meant=20
to be used
from within the batch files, not for references in the wrapper.conf=20
file. So they are
correct in that sense.
Looking at your wrapper.conf file, I have one idea for what the problem=20
may be.
(It would be answered quickly by seeing the debug log output when you=20
attempt to
launch the Wrapper as a service.)
You have a few references to the WRAPPERDIR environment variable in your =
conf
file. If you have not set this as a system level environment variable=20
or specified it on
the command line when the wrapper was installed as a service this will=20
not work:
wrapper.exe -i ../conf/wrapper.conf set.WRAPPERDIR=3DC:\MyApp
>wrapper.java.classpath.2=3D%WRAPPERDIR%/lib/wrapper.jar
>
>wrapper.java.library.path.1=3D%WRAPPERDIR%/lib
> =20
>
You might want to consider just using a relative path as follows:
wrapper.java.classpath.2=3D../lib/wrapper.jar
wrapper.java.library.path.1=3D../lib
Same goes for the following log location. If that file can not be=20
accessed for any
reason then the wrapper will open a file called wrapper.log in the=20
windows system
directory. That may be why you have not found the file this far.
>wrapper.logfile=3D%WKDIR%logs/HRScannerService.log
> =20
>
This could also be
wrapper.logfile=3D../logs/HRScannerService.log
Cheers,
Leif
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Wrapper-user mailing list
Wra...@li...
https://lists.sourceforge.net/lists/listinfo/wrapper-user
|
|
From: Leif M. <le...@ta...> - 2003-10-18 15:47:05
|
Stefan,
Thank you. That log file shows that the service was installed
correctly. But the
problem is with the startup of the service.
I am looking for the log output from when the service is started,
rather than when
it is installed. My fault because I didn't explain this. But if the
Wrapper is unable
to locate its wrapper.conf. Or it is unable to write to the specified
log file then it
will fall back to writing to a file called wrapper.log that is located
in the same directory
as the Wrapper.exe. That may be where the log output that I am looking
for is
located. Under some failure modes, the file may also exist in the
Windows\system32
directory, also named wrapper.log. Could you please check those two
locations?
The problem may be that you have defined the following log file
location.
wrapper.logfile=%WKDIR%logs/HRScannerService.log
If the WKDIR environment variable can not be resolved for any reason
then this
file will not be valid and the wrapper will fall back to writing to a
wrapper.log file as
described above.
Cheers,
Leif
Stefan Maric wrote:
>OK
>
>Have killed off previous log files
>
>Attached log file shows o/p from running InstallApp-NT.bat
>
>Win2K Services
>myService - set Log On As local admin
>myService start
>
>No additional entries in log file ?????
>
>
>*******************Relevant contents of InstallApp-NT.bat*******************
>rem
>rem Run the application.
>rem At runtime, the current directory will be that of Wrapper.exe
>rem
>:startup
>"C:\wrapper_win32_3.0.5\bin\Wrapper.exe" -i
>h:\com\eaac\HRWrapper\wrapper.conf
>if not errorlevel 1 goto end
>pause
>*******************Relevant contents of InstallApp-NT.bat*******************
>
>
>
>Regards
>Stefan Maric
>European Aviation Air Charter
>01202 581111 x184
>
>
|