2 Replies Latest reply: Dec 10, 2012 1:56 PM by 746690 RSS

    Weblogic admin password reset

    720882
      Hi all

      I am looking for some advice.

      I am attempting to resethe weblogic admin password as per this article http://middlewaremagic.com/weblogic/?p=323.

      My class path has been set and I have ran ./setWLSEnv.sh and ./setDomainEnv.cmd, unfortuntley when running the command to create the new DefaultAuthenticator file I get the following error:

      bash-3.00$ java weblogic.security.utils.AdminAccount username password .
      Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at weblogic.security.utils.AdminAccount.setupAdminAccount(AdminAccount.java:126)
      at weblogic.security.utils.AdminAccount.main(AdminAccount.java:59)

      Any help would be appreciated.

      Thanks in advance.
        • 1. Re: Weblogic admin password reset
          René van Wijk
          Check if: java -version, returns the right version, i.e. java 1.6.*

          Note also that you have to use . ./setWLSEnv.sh instead of ./setWLSEnv.sh (otherwise parameters will not be exported to the shell)
          • 2. Re: Weblogic admin password reset
            746690
            Reason of ".UnsupportedClassVersionError" is -

            When JVM tries to load a class and found that class file version is not supported it throws UnSupportedClassVersionError and it generally occurs if a higher JDK version is used to compile the source file and a lower JDK version is used to run the program. for example if you compile your java source file in JDK 1.5 and you will try to run it on JDK 1.4 you will get error "java.lang.UnsupportedClassVersionError: Bad version number in .class file [at java.lang.ClassLoader.defineClass1(Native Method)]".

            But its important to note is that vice-versa is not true "you can compile your program in J2SE 1.4 and run on J2SE 1.5 and you will not get any UnSupportedClassVersionError". When a higher JDK is used for compilation it creates class file with higher version and when a lower JDK is used to run the program it found that higher version of class file not supported at JVM level and results in java.lang.UnsupportedClassVersionError.

            ----------------------------------------------------------------

            Here "AdminAccount" class is compiled with some higher version of weblogic and you are running " java weblogic.security.utils.AdminAccount username password ." command it taking some old version may be your host default old jdk, specify complete path of your latest java class when running the command and try.

            <LATEST_JAVA_PATH>/bin/ java weblogic.security.utils.AdminAccount username password .


            Regards
            Mukesh Negi