vCenter

 View Only
Expand all | Collapse all

Exception in thread main / Windows 2000 Server

  • 1.  Exception in thread main / Windows 2000 Server

    Posted Feb 13, 2009 06:37 PM
    When I launch hq-agent.bat setup, I get the following error:

    Exception in thread "main" java.lang.NoClassDefFoundError: \bin\java

    I'm using the HQEE trial windows agent package from the download site. JRE is bundled.

    Anyone have any ideas of what I could try to resolve this?

    I'm running as a service (already ran hq-agent.bat install), and the service is running fine, I just can't configure it.

    Windows 2000 Server


  • 2.  RE: Exception in thread main / Windows 2000 Server

    Posted Feb 13, 2009 07:19 PM
    I'll see where the error is coming from. There is a variable which stores java location withing bundled jre.

    Are you in position to tell what is your HQ installation path? I believe there is something weird in that path and this '\bin\java' is interpreted as command argument. These errors comes so early that there may not be anything usable in agent logs, but you could check it. Maybe it gives some hint.


  • 3.  RE: Exception in thread main / Windows 2000 Server

    Posted Feb 13, 2009 07:32 PM
    Installation path is C:\Program Files\hyperic-hq-agent-4.0.3-EE\

    The log file doesn't seem to show anything useful.

    I'm using that same path in another installation and it's working fine. Let me know if you have any more questions.

    - Chris


  • 4.  RE: Exception in thread main / Windows 2000 Server

    Posted Feb 14, 2009 04:46 AM
    Hi,

    could you please compare the JAVA_HOME environment variable on both systems ?

    Cheers,
    Mirko


  • 5.  RE: Exception in thread main / Windows 2000 Server

    Posted Feb 17, 2009 04:48 PM
    Hi!

    Im getting the same problem. I'm only getting it on my only two Windows 2000 Servers.
    Although i'm using the OpenSource version and downloaded the HQ Agent separately for Windows.

    I thought the problem might be to do with the installation of Java so i've been to the website to update it.
    is there a way to update the agent configuration manually?

    I've copied the exact same folder to my Windows 2003 and that installed without a problem.


  • 6.  RE: Exception in thread main / Windows 2000 Server

    Posted Feb 18, 2009 03:29 AM
    Looks like bundles\agent-4.x.x-xxx\bin\hq-agent.bat has a problem with quotes on Windows 2000. It's attempting to execute

    "C:\Program Files\hyperic-hq-agent-4.0.3\bundles\agent-4.0.3-953\bin\..\..\..\jre"\bin\java

    Which, due to the braindead quote handling on cmd.exe in Win2k, blows up. The following changes fix it for Windows 2000, but I haven't tested these on anything else:

    --- hq-agent.bat.orig 2009-02-17 22:24:31.000000000 -0500
    +++ hq-agent.bat 2009-02-17 22:24:59.000000000 -0500
    @@ -28,7 +28,7 @@
    if not "%HQ_JAVA_HOME%"=="" goto gothqjava

    if EXIST "%AGENT_INSTALL_HOME%\jre" (
    - set HQ_JAVA_HOME="%AGENT_INSTALL_HOME%\jre"
    + set HQ_JAVA_HOME=%AGENT_INSTALL_HOME%\jre
    goto gotjava
    )

    @@ -41,7 +41,7 @@
    echo HQ_JAVA_HOME must be set to a valid directory
    goto :eof
    ) else (
    - set HQ_JAVA_HOME="%HQ_JAVA_HOME%"
    + set HQ_JAVA_HOME=%HQ_JAVA_HOME%
    )

    :gotjava
    @@ -99,7 +99,7 @@

    set CLIENT_CLASS=org.hyperic.hq.bizapp.agent.client.AgentClient

    -set CLIENT_CMD=%HQ_JAVA_HOME%\bin\java -Djava.net.preferIPv4Stack=true -D%AGEN _INSTALL_HOME_PROP%="%AGENT_INSTALL_HOME%" -D%AGENT_BUNDLE_HOME_PROP%="%AGENT_B NDLE_HOME%" -cp "%CLIENT_CLASSPATH%" %CLIENT_CLASS%
    +set CLIENT_CMD="%HQ_JAVA_HOME%\bin\java" -Djava.net.preferIPv4Stack=true -D%AG NT_INSTALL_HOME_PROP%="%AGENT_INSTALL_HOME%" -D%AGENT_BUNDLE_HOME_PROP%="%AGENT BUNDLE_HOME%" -cp "%CLIENT_CLASSPATH%" %CLIENT_CLASS%

    set PING_CMD=%CLIENT_CMD% ping
    set SETUP_CMD=%CLIENT_CMD% setup


    In case the forum eats the patch format, you're just removing the quotes from HQ_JAVA_HOME and putting them around the whole executable path when CLIENT_CMD is defined.


  • 7.  RE: Exception in thread main / Windows 2000 Server

    Posted Apr 17, 2009 01:04 PM
    Just a little note

    I have tried this and it works, however I took the lazy route and just cut and pasted the changes.

    there seem to be a couple of typo's in the last change. the first is the first
    -D%AG NT_INSTALL which should read -D%AGENT_INSTALL
    the second is due to a line cut a _ is missing in the last AGENT_BUNDLE

    it should read
    +set CLIENT_CMD="%HQ_JAVA_HOME%\bin\java" -Djava.net.preferIPv4Stack=true -D%AGENT_INSTALL_HOME_PROP%="%AGENT_INSTALL_HOME%" -D%AGENT_BUNDLE_HOME_PROP%="%AGENT_BUNDLE_HOME%" -cp "%CLIENT_CLASSPATH%" %CLIENT_CLASS%

    regards

    Spencer


  • 8.  RE: Exception in thread main / Windows 2000 Server

    Posted May 04, 2009 07:10 AM
    Hi

    I have the same problem when I want to execute hq-agent.bat start on my win2000.

    Could you please show me where exactly did I have to set those code?

    Regards dodRocket


  • 9.  RE: Exception in thread main / Windows 2000 Server

    Posted May 04, 2009 06:13 PM
    Hi
    It works perfectly, thank you. I'm wondering if it works also for win nt4?

    Regards.


  • 10.  RE: Exception in thread main / Windows 2000 Server

    Posted Jun 04, 2009 12:31 AM
    Hi, I have been having this exact issue, however I copied and pasted as above but cannot seem to get it right. are you able to post the complete script for me?


  • 11.  RE: Exception in thread main / Windows 2000 Server

    Posted Jun 08, 2009 06:56 AM
    Hi,

    Just follow your code and replace them with :

    1 - set HQ_JAVA_HOME=%AGENT_INSTALL_HOME%\jre
    goto gotjava

    2 - set HQ_JAVA_HOME=%HQ_JAVA_HOME%

    3 - set CLIENT_CMD="%HQ_JAVA_HOME%\bin\java" -Djava.net.preferIPv4Stack=true -D%AG NT_INSTALL_HOME_PROP%="%AGENT_INSTALL_HOME%" -D%AGENT_BUNDLE_HOME_PROP%="%AGENT BUNDLE_HOME%" -cp "%CLIENT_CLASSPATH%" %CLIENT_CLASS%

    Regards


  • 12.  RE: Exception in thread main / Windows 2000 Server

    Posted Jun 10, 2009 09:38 PM
    Hi, thanks very much for the reply, will gove it another go .


  • 13.  RE: Exception in thread main / Windows 2000 Server

    Posted Jun 11, 2009 04:01 AM
    With a 2003 server there is another problem in wrapper.conf

    I have never sussed out a proper way to get it to accept the HQ_JAVA_HOME setting, it invariably assumes the default even when it clearly knows better everywhere else. I have taken to setting the default to be where my HQ_JAVA_HOME is, which works.

    Brain dead was the idea of putting spaces in a directory name in the first place.

    BJ