Home > Blockchain >  Java Exception "java.lang.IllegalArgumentException: Expecting ----prefix" when starting Je
Java Exception "java.lang.IllegalArgumentException: Expecting ----prefix" when starting Je

Time:07-12

I'm upgrading a Jenkins server to 2.357 and I've upgraded Java to 11 from 1.8 to support it.

However, when I start the Jenkins, it fails and journalctl -xe gives the below error

   Server.
    -- Subject: Unit jenkins.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has failed.
    -- 
    -- The result is failed.
    Jul 11 14:28:57 jenkins01 systemd[1]: Unit jenkins.service entered failed state.
    Jul 11 14:28:57 jenkins01 systemd[1]: jenkins.service failed.
    Jul 11 14:28:57 jenkins01 systemd[1]: jenkins.service holdoff time over, scheduling restart.
    Jul 11 14:28:57 jenkins01 systemd[1]: Stopped Jenkins Continuous Integration Server.
    -- Subject: Unit jenkins.service has finished shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has finished shutting down.
    Jul 11 14:28:57 jenkins01 systemd[1]: Starting Jenkins Continuous Integration Server...
    -- Subject: Unit jenkins.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has begun starting up.
    Jul 11 14:28:57 jenkins01 jenkins[19752]: Running from: /usr/share/java/jenkins.war
    Jul 11 14:28:57 jenkins01 jenkins[19752]: Exception in thread "main" java.lang.IllegalArgumentException: Expecting ----prefix=VALUE but found no value
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at winstone.cmdline.CmdLineParser.parse(CmdLineParser.java:60)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at winstone.Launcher.getArgsFromCommandLine(Launcher.java:415)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at winstone.Launcher.main(Launcher.java:385)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at Main._main(Main.java:332)
    Jul 11 14:28:57 jenkins01 jenkins[19752]: at Main.main(Main.java:114)
    Jul 11 14:28:57 jenkins01 systemd[1]: jenkins.service: main process exited, code=exited, status=1/FAILURE
    Jul 11 14:28:57 jenkins01 systemd[1]: Failed to start Jenkins Continuous Integration Server.
    -- Subject: Unit jenkins.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has failed.
    -- 
    -- The result is failed.
    Jul 11 14:28:57 jenkins01 systemd[1]: Unit jenkins.service entered failed state.
    Jul 11 14:28:57 jenkins01 systemd[1]: jenkins.service failed.
    Jul 11 14:28:58 jenkins01 systemd[1]: jenkins.service holdoff time over, scheduling restart.
    Jul 11 14:28:58 jenkins01 systemd[1]: Stopped Jenkins Continuous Integration Server.
    -- Subject: Unit jenkins.service has finished shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has finished shutting down.
    Jul 11 14:28:58 jenkins01 systemd[1]: start request repeated too quickly for jenkins.service
    Jul 11 14:28:58 jenkins01 systemd[1]: Failed to start Jenkins Continuous Integration Server.
    -- Subject: Unit jenkins.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- 
    -- Unit jenkins.service has failed.
    -- 
    -- The result is failed.
    Jul 11 14:28:58 jenkins01 systemd[1]: Unit jenkins.service entered failed state.
    Jul 11 14:28:58 jenkins01 systemd[1]: jenkins.service failed.

Looks like it points to the exception Exception in thread "main" java.lang.IllegalArgumentException: Expecting ----prefix=VALUE but found no value but I can't seem to figure it out. A help would be appreciated!

Java Version:

openjdk version "11.0.15" 2022-04-19 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.15 9-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.15 9-LTS, mixed mode, sharing)

CodePudding user response:

The error indicates that you are somehow passing the --prefix startup parameter with an invalid value. --prefix is only needed if you have a custom context path for Jenkins.

If you are starting your Jenkins server as a service, check the service definition and make sure only the required parameters are passed. The service definition is located at /etc/systemd/system/jenkins.service

  • Related