5 Replies Latest reply on Aug 10, 2012 8:38 AM by Charles Akalugwu

    Jboss 7 main class

    Charles Akalugwu Newbie

      Hi guys,

       

      I am trying to make jboss 7 run as a service using java service wrapper. I previously did this with 5.1 and 6.0 with no problems. Does anyone know the main class for jboss 7? And in what jars?

       

      In jboss 5 and 6, there was a org.jboss.Main class which was the entry point into the server startup. I am missing this class in Jboss 7. I need this class (or whatever the new class is), the module where this class is located and the corresponding jar file. I need this information to bootstrap with the Tanuki java service wrapper. Any help? Perhaps this is a very easy question for the developers. Help.

       

      Thanks.

        • 1. Re: Jboss 7 main class
          Gerry Matte Apprentice

          Sorry - I can't answer your question about the main class name.

           

          However, check out the Jul 24 posts in https://community.jboss.org/message/617264#617264  and also see https://community.jboss.org/message/618229#618229

           

          If you get it working with Tanuki, please share your knowledge.

          Thanks

          • 2. Re: Jboss 7 main class
            Charles Akalugwu Newbie

            I got it partially working.

             

            First of all, I am working with JBoss 7.0 Final and Java Service Wrapper 3.5.6 community edition. I am working on a Windows 7 machine ( 64 bit) and using a 32-bit JRE (due to constraints by the community version of the wrapper ).  My JBoss 7 server starts up fine when I run it without the wrapper. But with the wrapper, it seems the main method of the Jboss server is never run. I turned on debugging in jsw and the output is below.

             

             

            wrapper  | --> Wrapper Started as Console

            wrapper  | Java Service Wrapper Community Edition 32-bit 3.5.6

            wrapper  |   Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved.

            wrapper  |     http://wrapper.tanukisoftware.com

            wrapper  |

            wrapper  | Release time: 2010/10/15 00:00:00

            wrapper  | Build time:   2010/10/16 16:28:00

            wrapper  | Timezone:     W. Europe Standard Time (W. Europe Daylight Time) Offset: -3600, hasDaylight: 1

            wrapper  | Using tick timer.

            wrapper  | Current User: CharlesR2D2  Domain: JUPITER

            wrapper  | Use tick timer mutex=FALSE

            wrapper  | active log file changed: ..\logs\wrapper.log

            wrapperp | server listening on port 32000.

            wrapper  | Ping settings: wrapper.ping.interval=5, wrapper.ping.interval.logged=1, wrapper.ping.timeout=30

            wrapper  | Launching a JVM...

            wrapper  | Command: "..\..\jre7\bin\java" -XX:MaxPermSize=512m -Dprogram.name=standalone.bat -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.util.logging.manager=org.jboss.logmanage

            r.LogManager -Dorg.tanukisoftware.wrapper.WrapperManager.mbean=true -Djava.library.path="..\standalone\lib" -classpath "..\lib\wrapper.jar;..\modules\org\jboss\as\server/main\jboss-as-server-7.0.0.Final.jar;..\modules\org\jboss\logmanager/main\jboss-logmanager-1.2.0.GA.jar;..\modules\org\jboss\logma

            nager\log4j\main\jboss-logmanager-log4j-1.0.0.GA.jar;..\modules\org\jboss\stdio\main\jboss-stdio-1.0.0.GA.jar;..\modules\org\apache\log4j\main\log4j-1.2.16.jar" -Dwrapper.key="98-JaT3LhudhQ0it" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwr

            apper.pid=6236 -Dwrapper.version="3.5.6" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.jboss.as.server.Main

            wrapper  | JVM started (PID=5888)

            jvm 1    | WrapperManager Debug: WrapperManager class initialized by thread: main   Using classloader: sun.misc.Launcher$AppClassLoader@e80a59

            jvm 1    | WrapperManager: Initializing...

            jvm 1    | WrapperManager Debug: JVM #1

            jvm 1    | WrapperManager Debug: Running a 32-bit JVM.

            jvm 1    | WrapperManager Debug: org.tanukisoftware.wrapper.WrapperManager package information:

            jvm 1    | WrapperManager Debug:   Implementation Title: org.tanukisoftware.wrapper

            jvm 1    | WrapperManager Debug:   Implementation Vendor: Tanuki Software, Ltd.

            jvm 1    | WrapperManager Debug:   Implementation Version: 3.5.6

            jvm 1    | WrapperManager Debug:   Is Sealed?: False

            jvm 1    | WrapperManager Debug: org.tanukisoftware.wrapper.WrapperManager protection domain:

            jvm 1    | WrapperManager Debug:   Location: file:/C:/canotechresearch/software/jboss7jvm32/jboss-7.0.0.Final/lib/wrapper.jar

            jvm 1    | WrapperManager Debug:     Size: 114,841

            jvm 1    | WrapperManager Debug:     MD5: bd15f2edcb385c5a1ec554b2c10d862c

            jvm 1    | WrapperManager Debug: Registering shutdown hook

            jvm 1    | WrapperManager Debug: Using wrapper

            jvm 1    | WrapperManager Debug: Registered MBean with Platform MBean Server: org.tanukisoftware.wrapper:type=WrapperManager

            jvm 1    | WrapperManager Debug: Load native library. One or more attempts may fail if platform specific libraries do not exist.  This is NORMAL and is only a problem if they all fail.

            jvm 1    | WrapperManager Debug:   Unable to load native library: wrapper-windows-x86-32.dll  Cause: no wrapper-windows-x86-32 in java.library.path

            jvm 1    | WrapperManager Debug:   Loaded native library:

            jvm 1    | WrapperManager Debug: Loaded native localization method.

            jvm 1    | WrapperManager Debug: Calling native initialization method.

            jvm 1    | WrapperJNI Debug: Initializing WrapperManager native library.

            jvm 1    | WrapperJNI Debug: Java Executable: C:\canotechresearch\software\jboss7jvm32\jre7\bin\java.exe

            jvm 1    | WrapperJNI Debug: Native Library: C:\canotechresearch\software\jboss7jvm32\jboss-7.0.0.Final\standalone\lib\wrapper.dll

            jvm 1    | WrapperJNI Debug: Windows version: 6.1.7600

            jvm 1    | WrapperManager Debug: Java Version   : 1.7.0-b147 Java HotSpot(TM) Client VM

            jvm 1    | WrapperManager Debug: Java VM Vendor : Oracle Corporation

            jvm 1    | WrapperManager Debug: OS Name        : Windows 7

            jvm 1    | WrapperManager Debug: OS Arch        : x86

            jvm 1    | WrapperManager Debug:

            jvm 1    | WrapperManager Debug: Control event monitor thread started.

            jvm 1    | WrapperManager Debug: Startup runner thread started.

            jvm 1    | WrapperManager Debug: WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@e1469c, args[]) called by thread: main

            jvm 1    | WrapperManager Debug: Communications runner thread started.

            jvm 1    | WrapperManager Debug: Open socket to wrapper...Wrapper-Connection

            jvm 1    | WrapperManager Debug: Opened Socket from 31,000 to 32,000

            jvm 1    | WrapperManager Debug: Send a packet KEY : 98-JaT3LhudhQ0it

            jvm 1    | WrapperManager Debug: handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])

            wrapperp | accepted a socket from 127.0.0.1 on port 31000

            wrapperp | closing backend server.

            wrapperp | read a packet KEY : 98-JaT3LhudhQ0it

            wrapper  | Got key from JVM: 98-JaT3LhudhQ0it

            wrapperp | send a packet LOW_LOG_LEVEL : 1

            wrapperp | send a packet PING_TIMEOUT : 30

            wrapperp | send a packet LOGFILE : ..\logs\wrapper.log

            wrapperp | send a packet PROPERTIES : (Property Values)

            wrapper  | Start Application.

            wrapperp | send a packet START : start

            jvm 1    | WrapperManager Debug: Received a packet LOW_LOG_LEVEL : 1

            jvm 1    | WrapperManager Debug: LowLogLevel from Wrapper is 1

            jvm 1    | WrapperManager Debug: Received a packet PING_TIMEOUT : 30

            jvm 1    | WrapperManager Debug: PingTimeout from Wrapper is 30,000

            jvm 1    | WrapperManager Debug: Received a packet LOGFILE : ..\logs\wrapper.log

            jvm 1    | WrapperManager Debug: Received a packet PROPERTIES : (Property Values)

            jvm 1    | WrapperManager Debug: Received a packet START : start

            jvm 1    | WrapperManager Debug: Java temporary directory: C:\Users\CHARLE~1\AppData\Local\Temp

            jvm 1    | WrapperManager Debug: calling WrapperListener.start()

            jvm 1    | WrapperManager Debug: WrapperListener.start runner thread started.

            jvm 1    | WrapperSimpleApp Debug: start(args) Will wait up to 2 seconds for the main method to complete.

            jvm 1    | WrapperSimpleApp Debug: invoking main method

            jvm 1    | WrapperManager Debug: ShutdownHook started

            jvm 1    | WrapperManager Debug: WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook

            jvm 1    | WrapperManager Debug: Send a packet STOP : 0

            jvm 1    | WrapperManager Debug: Startup runner thread stopped.

            jvm 1    | WrapperManager Debug: Stopped checking for control events.

            wrapperp | read a packet STOP : 0

            wrapper  | JVM requested a shutdown. (0)

            wrapper  | wrapperStopProcess(0) called.

            wrapper  | Sending stop signal to JVM

            wrapperp | send a packet STOP : NULL

            jvm 1    | WrapperManager Debug: Received a packet STOP :

            jvm 1    | WrapperManager Debug: Send a packet START_PENDING : 5000

            wrapperp | read a packet START_PENDING : 5000

            wrapper  | JVM signaled a start pending with waitHint of 5000 millis.

            jvm 1    | WrapperManager Debug: Thread, Wrapper-Shutdown-Hook, handling the shutdown process.

            jvm 1    | WrapperManager Debug: shutdownJVM(0) Thread: Wrapper-Shutdown-Hook

            jvm 1    | WrapperManager Debug: wait for 0 shutdown locks to be released.

            jvm 1    | WrapperManager Debug: Send a packet STOPPED : 0

            wrapperp | read a packet STOPPED : 0

            wrapper  | JVM signaled that it was stopped.

            jvm 1    | WrapperManager Debug: Closing backend socket.

            jvm 1    | WrapperManager Debug: Closed socket (Normal): java.net.SocketException: Socket Closed

            jvm 1    | WrapperManager Debug: Returned from socket handler.

            wrapperp | socket read no code (closed?).

            wrapperp | closing backend socket.

            jvm 1    | WrapperManager Debug: ShutdownHook complete

            jvm 1    | WrapperManager Debug: Server daemon shut down

            wrapper  | JVM process exited with a code of 1, setting the wrapper exit code to 1.

            wrapper  | JVM exited normally.

            wrapper  | <-- Wrapper Stopped

             

             

            I think at this point, I should talk about my folder structures. I am trying to make a "portable" wrapper-lized jboss 7 distribution. I have a folder called jboss7jvm32. This folder contains two folders. The first is the Jboss7 folder and the second is a jre7 folder. I organized it in this way, so I can just copy jboss7jvm32 folder to as many machines as possible and simply install the service. The jboss would always have a jvm available (the jvm bundled in the jboss7jvm32 folder).  My wrapper.conf is below:

             

             

            encoding=UTF-8

            # Configuration files must begin with a line specifying the encoding

            #  of the the file.

             

             

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

            # Wrapper License Properties (Ignored by Community Edition)

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

            # Professional and Standard Editions of the Wrapper require a valid

            #  License Key to start.  Licenses can be purchased or a trial license

            #  requested on the following pages:

            # http://wrapper.tanukisoftware.com/purchase

            # http://wrapper.tanukisoftware.com/trial

             

             

            # Include file problems can be debugged by removing the first '#'

            #  from the following line:

            ##include.debug

             

             

            # The Wrapper will look for either of the following optional files for a

            #  valid License Key.  License Key properties can optionally be included

            #  directly in this configuration file.

            #include ../conf/wrapper-license.conf

            #include ../conf/wrapper-license-%WRAPPER_HOST_NAME%.conf

             

             

            # The following property will output information about which License Key(s)

            #  are being found, and can aid in resolving any licensing problems.

            #wrapper.license.debug=TRUE

             

             

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

            # Wrapper Localization

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

            # Specify the locale which the Wrapper should use.  By default the system

            #  locale is used.

            #wrapper.lang=en_US # en_US or ja_JP

             

             

            # Specify the location of the Wrapper's language resources.  If these are

            #  missing, the Wrapper will default to the en_US locale.

            wrapper.lang.folder=../lang

             

             

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

            # Wrapper Java Properties

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

            # Java Application

            #  Locate the java binary on the system PATH:

            # wrapper.java.command=java

            #  Specify a specific java binary:

            set.JBOSS_HOME=..

            set.JAVA_HOME=..\..\jre7

            wrapper.java.command=%JAVA_HOME%\bin\java

             

             

            # Tell the Wrapper to log the full generated Java command line.

            wrapper.java.command.loglevel=DEBUG

             

             

            # 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=%JBOSS_HOME%\lib\wrapper.jar

            wrapper.java.classpath.2=%JBOSS_HOME%\modules\org\jboss\as\server\main\jboss-as-server-7.0.0.Final.jar

            wrapper.java.classpath.3=%JBOSS_HOME%\modules\org\jboss\logmanager\main\jboss-logmanager-1.2.0.GA.jar

            wrapper.java.classpath.4=%JBOSS_HOME%\modules\org\jboss\logmanager\log4j\main\jboss-logmanager-log4j-1.0.0.GA.jar

            wrapper.java.classpath.5=%JBOSS_HOME%\modules\org\jboss\stdio\main\jboss-stdio-1.0.0.GA.jar

            wrapper.java.classpath.6=%JBOSS_HOME%\modules\org\apache\log4j\main\log4j-1.2.16.jar

            #wrapper.java.classpath.7=%JBOSS_HOME%\jboss-modules.jar

             

             

             

             

            # Java Library Path (location of Wrapper.DLL or libwrapper.so)

            wrapper.java.library.path.1=%JBOSS_HOME%\standalone\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=-XX:MaxPermSize=512m

            wrapper.java.additional.2=-Dprogram.name=standalone.bat

            wrapper.java.additional.3=-Dorg.jboss.resolver.warning=true

            wrapper.java.additional.4=-Dsun.rmi.dgc.client.gcInterval=3600000

            wrapper.java.additional.5=-Dsun.rmi.dgc.server.gcInterval=3600000

            wrapper.java.additional.6=-Djboss.modules.system.pkgs=org.jboss.byteman

            wrapper.java.additional.7=-Djava.util.logging.manager=org.jboss.logmanager.LogManager

            wrapper.java.additional.8=-Dorg.tanukisoftware.wrapper.WrapperManager.mbean=true

            #wrapper.java.additional.9=-Dorg.tanukisoftware.wrapper.WrapperSimpleApp.waitForStartMain=true

            #wrapper.java.additional.9=-Dorg.tanukisoftware.wrapper.WrapperSimpleApp.maxStartMainWait=300

             

             

             

             

            # Initial Java Heap Size (in MB)

            #wrapper.java.initmemory=512

             

             

            # Maximum Java Heap Size (in MB)

            #wrapper.java.maxmemory=1024

             

             

            # Application parameters.  Add parameters as needed starting from 1

            wrapper.app.parameter.1=org.jboss.as.server.Main

             

             

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

            # 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=DEBUG

             

             

            # 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=DEBUG

             

             

            # 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

             

             

            # Title to use when running as a console

            wrapper.console.title=JBoss Application Server 7.0 Final

             

             

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

            # Wrapper JVM Checks

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

            # Detect DeadLocked Threads in the JVM. (Requires Standard Edition)

            wrapper.check.deadlock=TRUE

            wrapper.check.deadlock.interval=60

            wrapper.check.deadlock.action=RESTART

            wrapper.check.deadlock.output=FULL

             

             

            # Out Of Memory detection.

            # (Simple match)

            wrapper.filter.trigger.1000=java.lang.OutOfMemoryError

            # (Only match text in stack traces if -XX:+PrintClassHistogram is being used.)

            #wrapper.filter.trigger.1000=Exception in thread "*" java.lang.OutOfMemoryError

            #wrapper.filter.allow_wildcards.1000=TRUE

            wrapper.filter.action.1000=RESTART

            wrapper.filter.message.1000=The JVM has run out of memory.

             

             

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

            # Wrapper Email Notifications. (Requires Professional Edition)

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

            # Common Event Email settings.

            #wrapper.event.default.email.debug=TRUE

            #wrapper.event.default.email.smtp.host=<SMTP_Host>

            #wrapper.event.default.email.smtp.port=25

            #wrapper.event.default.email.subject=[%WRAPPER_HOSTNAME%:%WRAPPER_NAME%:%WRAPPER_EVENT_NAME%] Event Notification

            #wrapper.event.default.email.sender=<Sender email>

            #wrapper.event.default.email.recipient=<Recipient email>

             

             

            # Configure the log attached to event emails.

            #wrapper.event.default.email.attach_log=TRUE

            #wrapper.event.default.email.maillog.lines=50

            #wrapper.event.default.email.maillog.format=LPTM

            #wrapper.event.default.email.maillog.loglevel=INFO

             

             

            # Enable specific event emails.

            #wrapper.event.wrapper_start.email=TRUE

            #wrapper.event.jvm_prelaunch.email=TRUE

            #wrapper.event.jvm_start.email=TRUE

            #wrapper.event.jvm_started.email=TRUE

            #wrapper.event.jvm_deadlock.email=TRUE

            #wrapper.event.jvm_stop.email=TRUE

            #wrapper.event.jvm_stopped.email=TRUE

            #wrapper.event.jvm_restart.email=TRUE

            #wrapper.event.jvm_failed_invocation.email=TRUE

            #wrapper.event.jvm_max_failed_invocations.email=TRUE

            #wrapper.event.jvm_kill.email=TRUE

            #wrapper.event.jvm_killed.email=TRUE

            #wrapper.event.jvm_unexpected_exit.email=TRUE

            #wrapper.event.wrapper_stop.email=TRUE

             

             

            # Specify custom mail content

            wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n

             

             

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

            # 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.name=JBAS70SVC

             

             

            # Display name of the service

            wrapper.displayname=JBoss Application Server 7.0 Final

             

             

            # Description of the service

            wrapper.description=JBoss Application Server 7.0 Final

             

             

            # Service dependencies.  Add dependencies as needed starting from 1

            wrapper.ntservice.dependency.1=

             

             

            # Mode in which the service is installed.  AUTO_START, DELAY_START or DEMAND_START

            wrapper.ntservice.starttype=AUTO_START

             

             

            # Allow the service to interact with the desktop.

            wrapper.ntservice.interactive=false

             

            Does someone have an idea what is happening? Any help would be greatly appreciated. So far, I solved all classpath issues. Thanks for your help.  Charles.

            • 3. Re: Jboss 7 main class
              Nicklas Karlsson Master

              could the "..\" stuff be a problem? Tried writing out full paths with forward slahes "/"?

               

              Anyway, if you get it to work, a blog or some documentation on this would be nice.

              • 4. Re: Jboss 7 main class
                Prasad Deshpande Expert

                I think main class is org.jboss.modules.Main & it is located in jboss-modules.jar. it's in JBOSS_HOME directory of AS7.