Unrecognized VM option 'MaxPermSize=256m'

Jboss startup error:

Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Translated as:

Unrecognized VM option 'MaxPermSize=256m'

Error: unable to create Java virtual machine.

Error: fatal exception occurred. The program will exit.

It means that the VM option "MaxPermSize=256m" is not available in the current virtual machine. In fact, the reason is:

After jdk8 (inclusive), the permanent generation is removed, so the startup parameter MaxPermSize (maximum permanent generation size) of the virtual machine is unavailable.

The jdk configured for my Jboss is 17. Of course, there is no MaxPermSize option, so it is normal to report this error. So how to solve this error? There are two options:

1. Change JDK version to before 8;

2. Remove the virtual machine startup parameter MaxPermSize.

On the first point, let's start experimenting.

First, Download jdk7, and then upload it to linux through ftp:

Step 2: the unzipped java-se-7u75-ri is jdk7. Open it and have a look:

Step 3: configure jdk environment variables.

# Edit the profile file and change the JDK environment variable to jdk1 seven
vim /etc/profile

Save, exit, and then use the command to make the file effective immediately:

# Make the document effective immediately
source /etc/profile

Step 4: check the jdk version:

The result is useless. In fact, it shouldn't be unless the configuration is wrong, but it has been carefully checked during the configuration. That may be the need to restart the ssh tool. Let's restart and try again.

We see that the jdk has been successfully configured to 1.7, and then start Jboss.

Step 5: start Jboss.

Switch to the Jboss installation directory, then to the bin directory and start the script standalone sh.

We also saw the jdk1.0 we configured 7 environment variables, Jboss environment variables, and some virtual machine startup parameters. However, an error is displayed below:

The above is all the error information. In fact, the most important sentence is:

Caused by: java.io.FileNotFoundException: /opt/jboss/jboss-as-7.1.1.Final/standalone/log/boot.log (no file or directory)

Step 6: solve the error of Jboss startup.

Switch to the corresponding directory and find that there is no log directory, and of course there is no corresponding boot Log file, we manually create the log folder and boot Log file, try to start again.

Step 7: start successfully.

Step 8: test whether the startup is successful.

Open another window and test:

curl http://127.0.0.1:8080

Then we see:

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <title>Welcome to JBoss Application Server 7</title>
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="StyleSheet" href="as7_style.css" type="text/css">
</head>

<body>
  <div class="wrapper">
    <div class="as7">
      <img src="as7_logo.png" alt="JBoss Application Server 7... it's here." width="195" height="228" border="0">
    </div>

    <div class="content">
      <h1>Welcome to AS 7</h1>

      <h3>Your JBoss Application Server 7 is running.</h3>

      <p><a href="documentation.html">Documentation</a> | <a href="https://docs.jboss.org/author/display/AS71/Quickstarts">Quickstarts</a> | <a href="/console">Administration Console</a> <br/>

      <a href="http://www.jboss.org/jbossas"><br>
      JBoss AS Project</a> | <a href="http://community.jboss.org/en/jbossas/as7_users?view=all">User
      Forum</a> | <a href=
      "https://issues.jboss.org/browse/AS7">Report an issue</a></p>

      <p class="logos"><a href="http://jboss.org"><img src="jboss_community.png" alt="JBoss and JBoss Community" width=
      "254" height="31" border="0"></a></p>

      <p class="note">To replace this page set "enable-welcome-root" to false in your server configuration and deploy
      your own war with / as its context path.</p>
    </div>
  </div>
</body>
</html>

We see that this is actually an HTML page.

Continue to test the corresponding ports. We can see the screenshot of the successful startup, which monitors ports 4447, 9999 and 9990.

ss -an | grep 8080
ss -an | grep 9999
ss -an | grep 9990

We can also use the command:

curl -I 127.0.0.1:8080

To verify startup.

There are several red boxes above. The first one is the command we use; The second is the HTTP return code, 200 means ok; The third is the last update time, which shows 2012, that is, the last update time of our current version of Jboss; The fourth and last one is our current operation time: Tuesday, February 2, 2022, 11:10:17, Greenwich mean time. In fact, this time is not accurate, or it is not our current Beijing time in China. Our current time is 19:17. If it corresponds to the time when we input the command, it should correspond to 19:10. In this way, we can see the difference of 8 hours. This is the default time zone setting of Jboss. As we said above, it shows Greenwich mean time, which is 8 hours slower than Beijing time. If we Baidu Greenwich mean time, it is shown as follows:

We'll be clear about the time. Just go back and set the time zone of Jboss.

 

Keywords: Java server

Added by philippo on Wed, 02 Feb 2022 19:35:51 +0200