Error while building Weblogic Custom Authenticator
Buildfile: D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\build.xml
[echo] Starting Jar :D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\lib
clean:
[delete] Deleting directory D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test
[echo] Clean finish
build.mdf:
[java] Working directory ignored when same JVM is used.
[java] Parsing the MBean definition file: DBAuthenticator.xml
[echo] Created Supporting Classes
build.mjf:
[echo] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\lib
[java] Working directory ignored when same JVM is used.
[java] Creating an MJF from the contents of directory test...
[java] Compiling the files...
[java] Creating the list.
[java] Doing the compile.
[java] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test\com\nokia\hdm\security\dbauthentication\DBAuthenticatorMBean.java:5: package weblogic.management.commo does not exist
[java] import weblogic.management.commo.RequiredModelMBeanWrapper;
[java] ^
[java] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test\com\nokia\hdm\security\dbauthentication\DBAuthenticatorMBean.java:16: package weblogic.management.commo does not exist
[java] public interface DBAuthenticatorMBean extends weblogic.management.commo.StandardInterface,weblogic.descriptor.DescriptorBean, weblogic.management.security.authentication.AuthenticatorMBean {
[java] ^
[java] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test\com\nokia\hdm\security\dbauthentication\DBAuthenticatorMBean.java:16: package weblogic.descriptor does not exist
[java] public interface DBAuthenticatorMBean extends weblogic.management.commo.StandardInterface,weblogic.descriptor.DescriptorBean, weblogic.management.security.authentication.AuthenticatorMBean {
[java] ^
[java] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test\com\nokia\hdm\security\dbauthentication\DBAuthenticatorMBean.java:16: package weblogic.management.security.authentication does not exist
[java] public interface DBAuthenticatorMBean extends weblogic.management.commo.StandardInterface,weblogic.descriptor.DescriptorBean, weblogic.management.security.authentication.AuthenticatorMBean {
[java] ^
[java] D:\GoogleDrive\Nokia\Workspace\DBAuthenticator\test\com\nokia\hdm\security\dbauthentication\DBAuthenticatorMBean.java:16: cannot access java.lang.Object
[java] bad class file: java\lang\Object.class(java\lang:Object.class)
[java] class file has wrong version 52.0, should be 50.0
[java] Please remove or make sure it appears in the correct subdirectory of the classpath.
[java] public interface DBAuthenticatorMBean extends weblogic.management.commo.StandardInterface,weblogic.descriptor.DescriptorBean, weblogic.management.security.authentication.AuthenticatorMBean {
[java] ^
[java] Exec failed .. exiting
[java] org.apache.tools.ant.ExitException: Permission ("java.lang.RuntimePermission" "exitVM") was not granted.
[java] at org.apache.tools.ant.types.Permissions$MySM.checkExit(Permissions.java:194)
[java] at java.lang.Runtime.exit(Runtime.java:107)
[java] at java.lang.System.exit(System.java:971)
[java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:497)
[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:332)
[java] at weblogic.management.commo.WebLogicMBeanMaker.compile(WebLogicMBeanMaker.java:1050)
[java] at weblogic.management.commo.WebLogicMBeanMaker.compile(WebLogicMBeanMaker.java:1011)
[java] at weblogic.management.commo.WebLogicMBeanMaker.main(WebLogicMBeanMaker.java:728)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:221)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:154)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:834)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:228)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:137)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:110)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:352)
[java] at org.apache.tools.ant.Target.execute(Target.java:437)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:458)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:857)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:236)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:286)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
[java] WLMaker-SubProcess: : Error: Could not find or load main class weblogic.management.commo.BeanGenDriver
[java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
[java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
[java] BeanGen code generation failed
[java] Security breach!. Request Terminated.
[echo] Created Mbean Jar
build:
BUILD SUCCESSFUL
Total time: 0 seconds
Solution:
The error "class file has wrong version 52.0, should be 50.0"
It means your Java runtime version is 1.8, but your compiler version (javac) is 1.6. To simply solve it, just retreat the Java version from 1.8 to 1.6.
Enjoy coding...