|
From: Leif M. <lei...@ta...> - 2014-09-01 07:56:25
|
Lin, I am sorry for the very slow reply. We somehow missed that this mail was stuck in moderation. I think this is a problem with your working directory. Remember that when the Wrapper runs, it ALWAYS forces the current working directory to be the location of the wrapper binary. This is done so that the Wrapper runs consistently regardless of how the Wrapper is launched. In your case, when running with the Wrapper, the working directory is: /Users/lin/git/exabeam/martini/java-wrapper/bin I am not 100% sure what it is when you are running directly with your command line. In both cases, your classpath looks like this: ../lib/martini.jar:../lib/wrapper.jar In the case of running with the Wrapper, this would mean that these files are both located in the following directory: /Users/lin/git/exabeam/martini/java-wrapper/lib A couple things that are confusing to me: 1) If the jar files had not been found, you would be seeing a message like the following in the logs just before the JVM is launched: DEBUG | wrapper | 2014/09/01 16:02:40.255 | | Classpath element, wrapper.java.classpath.3, does not exist: ../lib/foo.jar DEBUG | wrapper | 2014/09/01 16:02:40.255 | | Classpath element, wrapper.java.classpath.4, does not exist: ../xxx/bar.jar The lack of these messages in the log makes it look like both files exist 2) How are you launching the Wrapper? Is this on system startup? The working directory of the parent that launched the Wrapper was the root directory: DEBUG | wrapper | 2014/08/18 22:06:42 | P--W- | WRAPPER_INIT_DIR=/ This should not matter as the working directory was correctly changed to the location of the Wrapper binary: DEBUG | wrapper | 2014/08/18 22:06:42 | ---W- | WRAPPER_WORKING_DIR=/Users/lin/git/exabeam/martini/java-wrapper/bin In both cases, the WrapperSimpleApp class is being located and loaded correctly. That class simply locates the "com.exabeam.martini.Martini" class by name in the same ClassLoader without doing anything special. If none of these hints help, would it be possible to get a tar of your application sent to su...@ta...? We should only need the martini.jar to be able to see if it locates your main class. But I am also interested in seeing the relative location of files. Cheers, Leif On Tue, Aug 19, 2014 at 2:13 PM, Lin Zhao <li...@ex...> wrote: > My previous post didn't get through so I'm reposting. > > I've been trying to use WrapperSimpleApp and have a ClassNotFoundException > that I can't explain. > > The .conf has the jar that includes the main class, and you can see from > the wrapper debug log that it's included to -classpath. But the wrapper > fails to find it. > > Attaching the wrapper debug log. > > In the log, you can see: > > *DEBUG | wrapper | 2014/08/18 15:19:08 | Command[7] : > ../lib/martini.jar:../lib/wrapper.jar* > > martini.jar has com.exabeam.martini.Martini, yet the wrapper can't find > it. > > *INFO | jvm 1 | 2014/08/18 15:19:08 | WrapperSimpleApp Error: Unable > to locate the class com.exabeam.martini.Martini : > java.lang.ClassNotFoundException: com.exabeam.martini.Martini* > When the wrapper repeatedly retries, I captured the task command (via ps) > as: > > *501 44180 44168 0 9:57PM ttys008 0:00.47 /usr/bin/java -d64 > -Dlog4j.configuration=file:///Users/lin/git/exabeam/martini/src/main/resources/log4j.properties > -Dspark.cleaner.ttl=300 -Xmx14000m -Djava.library.path=../lib -classpath > ../lib/martini.jar:../lib/wrapper.jar -Dwrapper.key=JXisZluSb14SpUBv > -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 > -Dwrapper.jvm.port.max=31999 -Dwrapper.debug=TRUE -Dwrapper.pid=44168 > -Dwrapper.version=3.5.25 -Dwrapper.native_library=wrapper > -Dwrapper.arch=universal -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=3 > org.tanukisoftware.wrapper.WrapperSimpleApp com.exabeam.martini.Martini > /Users/lin/git/exabeam/martini/config/custom/exabeam_config_imperva.conf* > > If I run below command directly, WrapperSimpleApp is able to find and > launch my main method, after which it failed for application specific > reason. > > *java -classpath ../lib/martini.jar:../lib/wrapper.jar > org.tanukisoftware.wrapper.WrapperSimpleApp com.exabeam.martini.Martini > /Users/lin/git/exabeam/martini/config/custom/exabeam_config_imperva.conf* > > Output: > > *WrapperManager: Initializing...* > > *WrapperManager: WARNING - The version of the Wrapper which launched this > JVM is* > > *WrapperManager: "unknown" while the version of the native > library* > > *WrapperManager: is "3.5.25".* > > *WrapperManager: The Wrapper may appear to work correctly but > some features may* > > *WrapperManager: not function correctly. This configuration has > not been tested* > > *WrapperManager: and is not supported.* > > *WrapperManager: * > > *2014-08-18 22:00:11.924 INFO ************************ > > *2014-08-18 22:00:11.925 INFO Martini started.* > Attaching the log and the conf. Thanks for the help. > > |