Installer does not run install -dis correctly on Windows

Description

At Step 9/10 I get an exception.

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>SET OPENNMS_HOME=C:/OpenNMS

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>SET DBNAME=opennms

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>SET DBURL=jdbc:postgresql://localhost:5432/

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>SET ETCDIR=C:/OpenNMS/etc

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>SET SERVLETDIR=C:/OpenNMS/webapps/opennms

C:\Users\marskuh\Downloads\standalone-opennms-installer-14.0.0-0.20141019.rc.stable.1.14.0.78\opennms-installer>"C:\Program Files\Java\jdk1.7.0_10\bin\java" -Xmx512m "-Dopennms.home=C:/OpenNMS" "-Dinstall.dir=C:/OpenNMS" "-Dinstall.database.name=opennms" "-Dinstall.database.url=jdbc:postgresql://localhost:5432/" "-Dinstall.etc.dir=C:/OpenNMS/etc" "-Dinstall.servlet.dir=C:/OpenNMS/webapps/opennms" -classpath "C:/OpenNMS/lib/opennms_bootstrap.jar;C:/OpenNMS/lib/opennms_install.jar" org.opennms.install.Installer -dis -l C:/OpenNMS/lib
java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.CommandLineParser
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
Exception in thread "main"

Environment

Windows 8.1

Acceptance / Success Criteria

None

blocks

Lucidchart Diagrams

Activity

Markus von Rüden October 22, 2014 at 11:12 AM

I fixed the Stacktrace issue in OpenNMS with pull request https://github.com/OpenNMS/opennms/pull/141

I had to not print the stacktrace when warning about the "CSDVersion" not found issue.

Markus von Rüden October 20, 2014 at 8:42 AM

I fixed the "NoClassDefFound"-Exception by correcting the classpath and main class with commit https://github.com/OpenNMS/installer/commit/7e8b72f2e354f53b0d2fa6a249a4897d0e6b5eee

Markus von Rüden October 20, 2014 at 7:41 AM
Edited

I managed to figure out the correct command line argument

However there seems to be a problem while determining the windows version:

==============================================================================
OpenNMS Installer
==============================================================================

Configures PostgreSQL tables, users, and other miscellaneous settings.

DEBUG: Looks like we're on Windows... Validating.
WARNING: Unable to retrieve the value for SOFTWARE\Microsoft\Windows NT\CurrentVersion\CSDVersion
com.sun.jna.platform.win32.Win32Exception: The system cannot find the file specified.
at com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(Advapi32Util.java:495)
at org.opennms.install.IPv6Validator.getStringFromRegistry(IPv6Validator.java:162)
at org.opennms.install.IPv6Validator.isPlatformIPv6Ready(IPv6Validator.java:65)
at org.opennms.install.Installer.checkIPv6(Installer.java:308)
at org.opennms.install.Installer.install(Installer.java:199)
at org.opennms.install.Installer.main(Installer.java:967)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:366)
at java.lang.Thread.run(Thread.java:722)
DEBUG: Windows NT Version 6,3, Build 9600 (Service Pack 0)

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created October 20, 2014 at 5:22 AM
Updated October 23, 2014 at 9:54 AM
Resolved October 23, 2014 at 9:54 AM