Sunday, October 13, 2019

java.lang.NoSuchMethodError: com.mongodb.client.MongoCollection.replaceOne

I am facing teh following error while updating the Object in MongoDB.
I am using org.springframework.data.mongodb.repository.MongoRepository class for Object Repository Any Sugegstions.
java.lang.NoSuchMethodError: com.mongodb.client.MongoCollection.replaceOne(Lorg/bson/conversions/Bson;Ljava/lang/Object;Lcom/mongodb/client/model/ReplaceOptions;)Lcom/mongodb/client/result/UpdateResult;
 at org.springframework.data.mongodb.core.MongoTemplate$2.doInCollection(MongoTemplate.java:1558) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:585) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.mongodb.core.MongoTemplate.saveDocument(MongoTemplate.java:1543) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.mongodb.core.MongoTemplate.doSave(MongoTemplate.java:1479) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.mongodb.core.MongoTemplate.save(MongoTemplate.java:1421) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.save(SimpleMongoRepository.java:87) ~[spring-data-mongodb-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
 at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
 at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:371) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:204) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:657) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:621) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80) ~[spring-data-commons-2.2.0.RELEASE.jar:2.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at com.sun.proxy.$Proxy56.save(Unknown Source) ~[na:na]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
 at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
 at com.sun.proxy.$Proxy56.save(Unknown Source) ~[na:na]
 at io.vertx.user.dao.UserDaoImpl.saveUser(UserDaoImpl.java:32) ~[classes/:na]
 at io.vertx.user.verticle.UserVerticle.lambda$register$2(UserVerticle.java:162) ~[classes/:na]
 at io.vertx.core.http.HttpServerRequest.lambda$bodyHandler$0(HttpServerRequest.java:214) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.HttpServerRequestImpl.doEnd(HttpServerRequestImpl.java:537) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:526) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.Http1xServerConnection.handleEnd(Http1xServerConnection.java:167) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.Http1xServerConnection.handleContent(Http1xServerConnection.java:157) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:138) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.net.impl.ConnectionBase.handleRead(ConnectionBase.java:390) ~[vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:320) [vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43) [vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:188) [vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:174) [vertx-core-3.7.0.jar:3.7.0]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.handler.codec.http.websocketx.extensions.WebSocketServerExtensionHandler.channelRead(WebSocketServerExtensionHandler.java:102) [netty-codec-http-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) [netty-codec-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) [netty-codec-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.vertx.core.http.impl.Http1xOrH2CHandler.end(Http1xOrH2CHandler.java:61) [vertx-core-3.7.0.jar:3.7.0]
 at io.vertx.core.http.impl.Http1xOrH2CHandler.channelRead(Http1xOrH2CHandler.java:38) [vertx-core-3.7.0.jar:3.7.0]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) [netty-common-4.1.30.Final.jar:4.1.30.Final]
 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.30.Final.jar:4.1.30.Final]
 at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]

Friday, August 23, 2019

sh: vue-cli-service: not found or sh: tslint: not found in docker-compose

While running docker-compose with vue.js application, It keeps throwing error as following

  1.  web_1     | sh: vue-cli-service: not found
  2.  server_1  | > tslint -c tslint.json -p tsconfig.json --fix
It is found that While running the docker-compose the path to the vue-cli-service/tslint is not found.

Solution:

  • Install the vue cli as global in Dockerfile as follows.
  • Include the path to the bat/exe to the docker environment path as follows.
Sample Dockerfile:

FROM node:12.2.0-alpine
WORKDIR /app
COPY . /app
ENV PATH /app/node_modules/.bin:$PATH
RUN npm install -g typescript
RUN npm install -g tslint
RUN npm install
CMD ["npm", "run","start"]

Tuesday, April 30, 2019

isPalindrome Implementation in Scala

The palindrome function will check the Given Number/ String is Palindrome or In case of List of Items It will test individual items in list can contribute to a Palindrome or Not.

def isPalindrome[A](item:A):Boolean = item match {
  case head :: Nil => isPalindrome(head)
  case ls:List[A] => ls.head == ls.last &&  isPalindrome(ls.drop(1).dropRight(1))// Checks the Head and Tail, and recursively check for the remaining
  case ls:String => ls.reverse == ls
  case e => e.toString.reverse == e.toString
}

println("IS Palindrome :"+isPalindrome(1234454321))  // Result false
println("IS Palindrome :"+isPalindrome(List(1,2,3,4,3,2,1)))  // Result true
println("IS Palindrome :"+isPalindrome("ABCDCBA"))  // Result true

Monday, April 22, 2019

Shortcut in Visual Code for ReactJs

1. Type rfc and press TAB key, It will create a Rect Functional Component skeleton

Example:
import React from 'react'

export default function Launch() {
return (
<div>
</div>
)
}

If you type rcf: the Auto suggestion will point to rfc ;)
2. Type rcc and press TAB key, It will create a Rect Class Component skeleton

import React, { Component } from 'react'

export default class Launch extends Component {
render() {
return (
<div>
</div>
)
}
}


Tuesday, April 9, 2019

How to run docker-compose in windows 10 Home - kitematic

As Windows-10 Home doesnt support Hyper-V, While running docker-compose in windows 10 Home, You cannot map the current directory in windows to the docker volume,

I did the following solution:

  1. Connect Kitematic VM using WinSCP
    1. IP Address : 192.168.99.100
    2. UserName: docker
    3. Password : tcuser
  2. Upload all files for the docker container to the VM
    1. Example /home/docker/nginx
  3. Map the Volume to the folder in docker-compose.yml [Where the docker-compose.yml is still in the Windows machine, while all the container file is uploaded to the Kitematic VM -192.168.99.100 ]

version: '3'

services:
proxy:
image: nginx:1.13 # this will use the latest version of 1.13.x
ports:
- '80:80' # expose 80 on host and sent to 80 in container
volumes:
- /home/docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
  1. From windows Command prompt run docker-compose up

The above steps helped to run docker-compose. 
If you have any other thoughts please share in comments.

Monday, April 8, 2019

Map windows directory to docker container in windows Kitematic

By default the directory mapped to docker container inside Kitematic will be mapped to VM of the kitematic, not the windows directory,

So the solution is as follows.

  1. Make a directory inside kitematic VM and map it.
  2. Map a Windows directory to the VM through VirtualBox manager and map to the docker.

Using localhost for to access running docker container in windows

In Windows, The docker is run through Kitematic which is basically a VM.

The VM will have an IP address associated with it, So to access from windows you need to specify the IP address of teh Kitematic VM IP instead of localhost for the deployed docker file access.

Refer : https://forums.docker.com/t/using-localhost-for-to-access-running-container/3148

Monday, March 18, 2019

Stack Implementation using Queue - Java Code

Get Implementation below:
     
import java.util.ArrayDeque;
import java.util.Queue;

public class StackUsingQueue {
 Queue q1=new ArrayDeque<>();
 Queue q2=new ArrayDeque<>();
 
 public void push(Integer item) {
  if(!q1.isEmpty())
   q1.add(item);
  else
   q2.add(item);
  System.out.println("PUSH "+item+": Q1: "+q1+"   Q2"+q2);
 }
 public void pop() {
  Integer item ;
  if(!q1.isEmpty()) {
   transfer(q1, q2);
   item = q1.poll();
  }else {
   transfer(q2, q1);
   item = q2.poll();
  }
  System.out.println("POP : Q1: "+q1+"   Q2"+q2+"  -  Poped Item:"+item);
 }
 
 private void transfer(Queue q1, Queue q2) {
  Integer size = q1.size();
  for(int i=0; i< size - 1; i++)
   q2.add(q1.poll());
 }
 public static void main(String[] args) {
  StackUsingQueue stack = new StackUsingQueue();
  stack.push(1);
  stack.push(2);
  stack.pop();
  stack.push(3);
  stack.push(4);
  stack.pop();
  stack.pop();
 }
  }

Result


PUSH 1: Q1: []   Q2[1]
PUSH 2: Q1: []   Q2[1, 2]
POP : Q1: [1]   Q2[]  -  Poped Item:2
PUSH 3: Q1: [1, 3]   Q2[]
PUSH 4: Q1: [1, 3, 4]   Q2[]
POP : Q1: []   Q2[1, 3]  -  Poped Item:4
POP : Q1: [1]   Q2[]  -  Poped Item:3


Wednesday, March 6, 2019

Why Crontab Scripts are not running ?

Sometimes The bash scripts runs good at the Terminal, But doesnt execute while running from cromtab.

I faced same issue with multiple commands chained in a crontab,

Solution: Issue behind the command is, while executing crontab everu command should have have the complete path.

You can find the command path as follows:
for example xargs

  • Execute "which xargs" which will give the complete path as /usr/bin/xargs
So I formated my cronjob as follows:

  • Before Path : 44 * * * * echo $(service MyService status | xargs -n 1 lsof -p | wc -l) 
  • After Path : 44 * * * * echo $(/sbin/service MyService status | /usr/bin/xargs -n 1 /usr/bin/lsof -p | /usr/bin/wc -l) 

Keep Exploring.......

Tuesday, January 8, 2019

Error while building Weblogic Custom Authenticator

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...