8 Replies Latest reply on Apr 5, 2010 1:00 PM by jesper.pedersen

    Problem with JBoss Profiler 2 Beta install.

    aprobe

      I have installed one of the profiler 2 beta files, the larger of the two, though it's not clear if I need both or not. I believe I have followed the instructions in the README.txt, but starting JBoss fails:

      =========================================================================

      JBoss Bootstrap Environment

      JBOSS_HOME: /jboss/jboss-4.2.3.GA-src/build/output/jboss-4.2.3.GA

      JAVA: /usr/java/jdk1.5.0_16//bin/java

      JAVA_OPTS: -javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

      CLASSPATH: /jboss/jboss-4.2.3.GA-src/build/output/jboss-4.2.3.GA/bin/run.jar:/usr/java/jdk1.5.0_16//lib/tools.jar

      =========================================================================

      Error opening zip file: jboss-profiler.jar
      Error occurred during initialization of VM
      agent library failed to init: instrument

      The bin directory contains:

      asm.jar jboss_init_suse.sh shutdown.jar wsprovide.sh
      classpath.sh probe.bat shutdown.sh wsrunclient.bat
      javassist.jar probe.sh twiddle.bat wsrunclient.sh
      jboss-profiler-plugins.jar run.bat twiddle.jar wstools.bat
      jboss-profiler.jar run.conf twiddle.sh wstools.sh
      jboss-profiler.properties run.jar wsconsume.bat
      jboss_init_hpux.sh run.sh wsconsume.sh
      jboss_init_redhat.sh shutdown.bat wsprovide.bat

      I saw a similar post, so I have already checked the jar files with "jar tf ..." and they all appear to be fine. I also tried adding hte profiler jars to the classpath, but that id not help.

      I tried the example but the class can't be found. I guess you have to do the local build for that to work.

      Is there anything more I can check or do to generate any more information?

        • 1. Re: Problem with JBoss Profiler 2 Beta install.
          jesper.pedersen

          Strange - as you can 'jar tf' the file.

          Could you try and build the agent yourself from the source ?

          The SVN is located at http://anonsvn.jboss.org/repos/jbossprofiler/branches/JBossProfiler2

          • 2. Re: Problem with JBoss Profiler 2 Beta install.
            aprobe

            OK, I downloaded and built the profiler locally, moved the jar and sar
            files to the proper positions, but I still get the same failure. I rechecked
            the jboss-profiler.jar file with "jar tf ..." and it looks fine to me.

            What next?

            Do I need to do somehting with the classpath? I tried adding the jboss-profiler.jar (and others) to the classpath bu that doesn't help. I removed
            the jboss-profiler.jar file form the bin directory and I get the same error,
            so there must be something wrong with the classpath or some other definition that locates the jar file. Ideas?

            • 3. Re: Problem with JBoss Profiler 2 Beta install.
              aprobe

              OK, I found the problem. I was not starting JBoss from the bin directory and I did not have a full path to the jboss-profiler.jar file in the JAVA_OPTS. Fixing that gets things going.

              Do I need to add a path to the jboss-profiler.properties -D options as well? Also, I notice there is such a file in the jboss-profiler.jar file as well as the one I put in the put directory. Which one gets used?

              Now I have problem with the profiler communications. I get a NoClassDefFoundError for org/jboss/remoting/ServerInvocationHandler during startup, and I can't connect with the client. I assume I am missing some jar file, but which one?

              • 4. Re: Problem with JBoss Profiler 2 Beta install.
                aprobe

                Well, this all seems to be a problem with which jar files form the distribution (in particular the 3rd party libraries) go into the jbossas/bin and jbossas/lib directories. When I put them all in jbossas/bin there are some problems, and when I put all the ones not listed as going in jbossas/bin in the README.txt into jbossas/lib I still get a problem.

                Can you tell me which jars go where? (I am a bit of a JBoss newbie so I don't have a good feel as to where they should go).


                • 5. Re: Problem with JBoss Profiler 2 Beta install.
                  jesper.pedersen

                  You need the full path to jboss-profiler.properties in your -D option.

                  The jboss-profiler.properties inside the jar will be default values so you need to override them in your local copy.

                  The client depends on other jar files like the jboss-remoting.jar. You need the files in the same directory as the client.jar. Otherwise see the MANIFEST.MF file inside client.jar for the needed jar files.

                  You only need the jboss-profiler.jar and jboss-profiler-plugins.jar in AS/bin -- and asm.jar if you use the asm option inside the property file.

                  Hope this helps !

                  • 6. Re: Problem with JBoss Profiler 2 Beta install.
                    aprobe

                    Thanks, cleaning up the extra jboss-profiler-*.jar files I put in AS/bin
                    did the trick. The profiler is up and running. Also, running the client
                    from the build/dist directory (where all the jar files are) did the trick
                    with the client. Now I just have to get an app running to profile...

                    Thanks again.

                    • 7. Re: Problem with JBoss Profiler 2 Beta install.

                      how to set Run.conf file for JBoss Profiler

                       

                      which one is correct

                       

                      if [ "x$JAVA_OPTS" = "x" ]; then
                         JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties"
                      fi

                       

                      or

                       

                      JAVA_OPTS="$JAVA_OPTS -javaagent:bin/jboss-profiler.jar -Djboss-profiler.properties=bin/jboss-profiler.properties"

                       

                      this giving problem , of jar file corrupt could not initialize the VM ,...

                      also i have cheked my Jboss-profiler.jar file with jat -tf command its fine , not showing error

                      • 8. Re: Problem with JBoss Profiler 2 Beta install.
                        jesper.pedersen

                        The first option - if you are starting JBoss using

                         

                        cd bin
                        ./run.sh
                        

                         

                        Use run.conf for Unix and run.bat for Windows.