|
From: Hoffman, J. <Jon...@ac...> - 2006-11-21 14:44:20
|
Hello, I recently started working on a project that was started by a former employee of the company I work for. They were using the Java Service Wrapper to create a windows service, but I have never used it before and I am having a lot of problems with the classpath. When I try to run the application through the console I get the following error: jvm 1 | WrapperSimpleApp: Unable to locate the class com.acs.wrapper.outbound.OutboundProcessor: java.lang.ClassNotFoundException:com.acs.wrapper.outbound.OutboundProcessor I have both the system classpath and the wrapper classpath set up to point to the jar file that contains the OutboundProcessor class (c:\Wrapper\dist\lib\WrapperProcessor.jar). When I turn on debug mode and it prints out the java command, the classpath is being set properly (c:\Wrapper\dist\lib\WrapperProcessor.jar is in the classpath): C:\bea\jdk142_05\bin\java.exe -Djava.library.path="wrapper.dll;wrapper.exe;c:\program files\sqllib\bin" -classpath "c:\Wrapper\lib\wrappertest.jar;c:\Wrapper\lib\wrapper.jar;c:\Wrapper\dist\l ib\WrapperProcessor.jar;c:\Wrapper\lib\commons-logging.jar;c:\Wrapper\lib\lo g4j-1.2.8.jar;." -Dwrapper.key="h_MrwxLwWo3O6XhN" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=3440 -Dwrapper.version="3.2.0" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp com.acs.wrapper.outbound.OutboundProcessor C:\editest\Test C:\editest\Prod C:\edidirect\home\meddata\Test\outbound C:\edidirect\home\meddata\Prod\outbound C:\edidirect\home\responses\Prod C:\edidirect\home\responses\Test I tried putting the jar file in my jdk/jre/lib/ext directory and everything worked perfectly (the wrapper process found my jar and ran the application). Below is my configuration file: #******************************************************************** # TestWrapper Properties # # NOTE - Please use src/conf/wrapper.conf.in as a template for your # own application rather than the values used for the # TestWrapper sample. #******************************************************************** # Java Application wrapper.java.command=java # set Wrapper native lib wrapper.native_library=wrapper # 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 com.acs.wrapper.outbound.OutboundProcessor C:\editest\Test C:\editest\Prod C:\edidirect\home\meddata\Test\outbound C:\edidirect\home\meddata\Prod\outbound C:\edidirect\home\responses\Prod C:\edidirect\home\responses\Test # Java Classpath (include wrapper.jar) Add class path elements as # needed starting from 1 wrapper.java.classpath.1=c:\Wrapper\lib\wrappertest.jar wrapper.java.classpath.2=c:\Wrapper\lib\wrapper.jar wrapper.java.classpath.3=c:\Wrapper\dist\lib\WrapperProcessor.jar wrapper.java.classpath.4=c:\Wrapper\lib\commons-logging.jar wrapper.java.classpath.5=c:\Wrapper\.lib\log4j-1.2.8.jar wrapper.java.classpath.6=c:\Wrapper\lib\commons.jar #wrapper.java.classpath.7=C:\Program Files\SQLLIB\java\db2java.zip #wrapper.java.classpath.8=C:\Program Files\SQLLIB\java\runtime.zip #wrapper.java.classpath.1=C:\Wrapper\dist\lib\WrapperProcessor.jar #wrapper.java.classpath.2=C:\Wrapper\lib # Java Library Path (location of Wrapper.DLL or libwrapper.so) wrapper.java.library.path.1=wrapper.dll wrapper.java.library.path.2=wrapper.exe wrapper.java.library.path.3=c:\program files\sqllib\bin # 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= #******************************************************************** # Wrapper Logging Properties #******************************************************************** # 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/OutboundWrapper.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 ############## My property ######################## #wrapper.daemonize=TRUE #wrapper.monitor_thread_count=true #wrapper.startup.delay=30 #wrapper.startup.delay.console=0 #wrapper.startup.delay.service=30 # work #wrapper.max_failed_invocations=100 # Seconds to restart jvm, by default # 30 seconds wrapper.ping.timeout=2400 #******************************************************************** # Wrapper Windows Properties #******************************************************************** # Title to use when running as a console wrapper.console.title=Outbound Processor #******************************************************************** # Wrapper Windows NT/2000/XP Service Properties #******************************************************************** # WARNING - Do not modify any of these properties when an application # using this configuration file has been installed as a service. # Please uninstall the service before modifying this section. The # service can then be reinstalled. # Name of the service #wrapper.ntservice.name=testwrapper wrapper.ntservice.name=outboundwrapper # Display name of the service wrapper.ntservice.displayname=Wrapper Outbound Processor # Description of the service wrapper.ntservice.description=ACS Wrapper Outbound Processor 1.0 # Service dependencies. Add dependencies as needed starting from 1 wrapper.ntservice.dependency.1= # Mode in which the service is installed. AUTO_START or DEMAND_START wrapper.ntservice.starttype=AUTO_START # Allow the service to interact with the desktop. wrapper.ntservice.interactive=false #wrapper.single_invocation=TRUE wrapper.debug=true I have tried using ../dist/lib/WrapperProcessor.jar in the classpath (actually that is how the last developer had it set) but that did not work either. I also had to move the other jars listed in the classpath section to the jdk/jre/lib/ext directory to get Java to find them. What is wrong with the classpath and why is it not finding my jar file? Any help would be greatly appreciated. Thanks Jon Hoffman |