can't get the wrapper to start a small application / Error: unkown option

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

can't get the wrapper to start a small application / Error: unkown option

Colin Kincaid Williams
I'm trying to use the wrapper to start http://quantifind.com/KafkaOffsetMonitor/ . On the project site they give an example to start the application, which works for me.

java -cp KafkaOffsetMonitor-assembly-0.2.1.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk myzk1:2181,myzk2:2181,myzk3:2181/kafka1 --port 8080 --refresh 10.seconds --retain 2.days


Then I thought the following guide was appropriate to use: http://wrapper.tanukisoftware.com/doc/english/integrate-simple-nix.html


Here are the relevant lines from my configuration file:

#********************************************************************

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


# Java Classpath (include wrapper.jar)  Add class path elements as

#  needed starting from 1

wrapper.java.classpath.1=../lib/wrapper.jar

wrapper.java.classpath.2=../KafkaOffsetMonitor-assembly-0.2.1.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=com.quantifind.kafka.offsetapp.OffsetGetterWeb

wrapper.app.parameter.2=--zk myzk1:2181,myzk2:2181,myzk3:2181/kafka1

wrapper.app.parameter.3=--port 8080

wrapper.app.parameter.4=--refresh 10.seconds

wrapper.app.parameter.5=--retain 7.days


Here is the logfile:


STATUS | wrapper  | 2015/05/05 21:05:36 | --> Wrapper Started as Daemon
STATUS | wrapper  | 2015/05/05 21:05:36 | Java Service Wrapper Community Edition 64-bit 3.5.26
STATUS | wrapper  | 2015/05/05 21:05:36 |   Copyright (C) 1999-2014 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper  | 2015/05/05 21:05:36 |     http://wrapper.tanukisoftware.com
STATUS | wrapper  | 2015/05/05 21:05:36 |
STATUS | wrapper  | 2015/05/05 21:05:37 | Launching a JVM...
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperManager: Initializing...
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp:
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: Encountered an error running main:
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: com.quantifind.sumac.ArgException: unknown option zk "myzk1:2181,myzk2:2181,myzk3:2181/kafka1"
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: usage:
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --retain  class scala.concurrent.duration.FiniteDuration  null
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --refresh class scala.concurrent.duration.FiniteDuration  null
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --dbName  class java.lang.String  offsetapp
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --port  int 37352
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --zk  class java.lang.String  null
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --zkSessionTimeout  class scala.concurrent.duration.Duration  30 seconds
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: --zkConnectionTimeout class scala.concurrent.duration.Duration  30 seconds
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgumentParser$$anonfun$nameToHolder$2.apply(ArgumentParser.scala:10)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgumentParser$$anonfun$nameToHolder$2.apply(ArgumentParser.scala:9)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.Map$WithDefault.default(Map.scala:52)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.MapLike$class.apply(MapLike.scala:141)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.AbstractMap.apply(Map.scala:58)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgumentParser$$anonfun$parse$1.applyOrElse(ArgumentParser.scala:23)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgumentParser$$anonfun$parse$1.applyOrElse(ArgumentParser.scala:21)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.TraversableLike$$anonfun$collect$1.apply(TraversableLike.scala:278)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:226)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.mutable.HashMap.foreach(HashMap.scala:98)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.TraversableLike$class.collect(TraversableLike.scala:278)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at scala.collection.AbstractTraversable.collect(Traversable.scala:105)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgumentParser.parse(ArgumentParser.scala:21)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.Args$class.parse(Args.scala:39)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.kafka.offsetapp.OffsetGetterArgs.parse(OffsetGetterApp.scala:29)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.Args$class.parse(Args.scala:34)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.kafka.offsetapp.OffsetGetterArgs.parse(OffsetGetterApp.scala:29)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgMain$class.mainHelper(ArgApp.scala:39)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.sumac.ArgMain$class.main(ArgApp.scala:34)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.kafka.offsetapp.OffsetGetterWeb$.main(OffsetGetterWeb.scala:43)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at com.quantifind.kafka.offsetapp.OffsetGetterWeb.main(OffsetGetterWeb.scala)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at java.lang.reflect.Method.invoke(Method.java:606)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error:   at java.lang.Thread.run(Thread.java:745)
STATUS | wrapper  | 2015/05/05 21:05:39 | <-- Wrapper Stopped
STATUS | wrapper  | 2015/05/05 21:08:08 | --> Wrapper Started as Daemon

Can anybody suggest how I can get it to work for me?


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: can't get the wrapper to start a small application / Error: unkown option

Dannes Wessels-2


On Wed, May 6, 2015 at 5:20 AM, Colin Kincaid Williams <[hidden email]> wrote:

INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: Encountered an error running main:
INFO   | jvm 1    | 2015/05/05 21:05:37 | WrapperSimpleApp Error: com.quantifind.sumac.ArgException: unknown option zk "myzk1:2181,myzk2:2181,myzk3:2181/kafka1"


clearly wrong parameters are passed to the application  .....  probably you have to check your WrapperSimpleApp ...

regards

Dannes


--
eXist-db Native XML Database - http://exist-db.org
Join us on linked-in: http://www.linkedin.com/groups?gid=35624

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: can't get the wrapper to start a small application / Error: unkown option

Colin Kincaid Williams
>java -cp KafkaOffsetMonitor-assembly-0.2.1.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk myzk1:2181,myzk2:2181,myzk3:2181/kafka1 --port 8080 --refresh 10.seconds --retain 2.days

serving resources from: jar:file:/opt/kafka-offset-monitor/KafkaOffsetMonitor-assembly-0.2.1.jar!/offsetapp
...

starting the application via the command line as I showed above works. Then I'm trying to adapt it to the wrapper. I will look at the wrapper again. 

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: can't get the wrapper to start a small application / Error: unkown option

Leif Mortenson-3
Colin,

The arguments passed to the Wrapper need to be broken up.  You have registered them as pairs of arguments (name and value) with a space.  Those are passed as a single argument to the JVM on UNIX.
Please try it as follows and let me know if this fixes your problem.

wrapper.app.parameter.1=com.quantifind.kafka.offsetapp.OffsetGetterWeb

wrapper.app.parameter.2=--zk

wrapper.app.parameter.3=myzk1:2181,myzk2:2181,myzk3:2181/kafka1

wrapper.app.parameter.4=--port

wrapper.app.parameter.5=8080

wrapper.app.parameter.6=--refresh

wrapper.app.parameter.7=10.seconds

wrapper.app.parameter.8=--retain

wrapper.app.parameter.9=7.days


Problems like this can be easily debugged by setting the following property to show the generated command line in the log file (You have it commented out):


wrapper.java.command.loglevel=INFO


Cheers,

Leif


On Thu, May 7, 2015 at 8:32 AM, Colin Kincaid Williams <[hidden email]> wrote:
>java -cp KafkaOffsetMonitor-assembly-0.2.1.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk myzk1:2181,myzk2:2181,myzk3:2181/kafka1 --port 8080 --refresh 10.seconds --retain 2.days

serving resources from: jar:file:/opt/kafka-offset-monitor/KafkaOffsetMonitor-assembly-0.2.1.jar!/offsetapp
...

starting the application via the command line as I showed above works. Then I'm trying to adapt it to the wrapper. I will look at the wrapper again. 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: can't get the wrapper to start a small application / Error: unkown option

Colin Kincaid Williams
Thanks Leif, this resolved my issue. I will try changing the log level next time.

Best,

Colin Williams

On Wed, May 6, 2015 at 7:15 PM, Leif Mortenson <[hidden email]> wrote:
Colin,

The arguments passed to the Wrapper need to be broken up.  You have registered them as pairs of arguments (name and value) with a space.  Those are passed as a single argument to the JVM on UNIX.
Please try it as follows and let me know if this fixes your problem.

wrapper.app.parameter.1=com.quantifind.kafka.offsetapp.OffsetGetterWeb

wrapper.app.parameter.2=--zk

wrapper.app.parameter.3=myzk1:2181,myzk2:2181,myzk3:2181/kafka1

wrapper.app.parameter.4=--port

wrapper.app.parameter.5=8080

wrapper.app.parameter.6=--refresh

wrapper.app.parameter.7=10.seconds

wrapper.app.parameter.8=--retain

wrapper.app.parameter.9=7.days


Problems like this can be easily debugged by setting the following property to show the generated command line in the log file (You have it commented out):


wrapper.java.command.loglevel=INFO


Cheers,

Leif


On Thu, May 7, 2015 at 8:32 AM, Colin Kincaid Williams <[hidden email]> wrote:
>java -cp KafkaOffsetMonitor-assembly-0.2.1.jar com.quantifind.kafka.offsetapp.OffsetGetterWeb --zk myzk1:2181,myzk2:2181,myzk3:2181/kafka1 --port 8080 --refresh 10.seconds --retain 2.days

serving resources from: jar:file:/opt/kafka-offset-monitor/KafkaOffsetMonitor-assembly-0.2.1.jar!/offsetapp
...

starting the application via the command line as I showed above works. Then I'm trying to adapt it to the wrapper. I will look at the wrapper again. 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user