Spring Batch csv FIle to Mongo DB "Error creating bean mongoTemplate" - mongodb

Spring Batch CSV to MongoDB
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'batchConfig': Unsatisfied dependency
expressed through field 'mongoTemplate'; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'mongoTemplate' defined in class path
resource
[org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'mongoTemplate'
parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'mongoDbFactory' defined in class path
resource
[org/springframework/boot/autoconfigure/data/mongo/MongoDataAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.data.mongodb.core.SimpleMongoDbFactory]: Factory
method 'mongoDbFactory' threw exception; nested exception is
java.lang.NoSuchMethodError:
org.springframework.data.mongodb.core.SimpleMongoDbFactory.(Lcom/mongodb/MongoClient;Ljava/lang/String;)V
Pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ge</groupId>
<artifactId>springbatch-csv-postgresql</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringBatchCSVPostgreSQL</name>
<description>Project for Spring Batch CSV Data to postgresql</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver ->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.7.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

Related

Caused by: java.lang.NoClassDefFoundError: com/netflix/discovery/shared/resolver/EurekaEndpoint

Looks like new spring cloud version of netflix has some issues.I am trying to run eureka server locally and trying to register to it and i see the following exception.I thought spring boot will pull all dpendencies.
Here is the exception:
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.boot.Bootstrapper : org.springframework.cloud.netflix.eureka.config.EurekaConfigServerBootstrapper
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:475)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:457)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:450)
at org.springframework.boot.SpringApplication.getBootstrapRegistryInitializersFromSpringFactories(SpringApplication.java:294)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:285)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:266)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at org.example.MyApp.main(MyApp.java:10)
Caused by: java.lang.NoClassDefFoundError: com/netflix/discovery/shared/resolver/EurekaEndpoint
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3305)
at java.base/java.lang.Class.getConstructor0(Class.java:3510)
at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2691)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:470)
... 8 more
Caused by: java.lang.ClassNotFoundException: com.netflix.discovery.shared.resolver.EurekaEndpoint
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 13 more
My Application.yml
server:
port: 8081
spring:
application:
name: MyApp
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8677/eureka/
my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>SimpleBootApp</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.5.6</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!-- Thanks for using https://jar-download.com -->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2020.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
I dont find any one reporting this issue Please help
You need add dependency:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

Cannot connect to PostgreSQL database from Spring Boot application - FATAL: database does not exist

I just configured new project with https://start.spring.io/
My pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>tower</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tower</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>9</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
and my application.properties:
spring.datasource.url= jdbc:postgresql://localhost:5432/tower
spring.datasource.username=postgres
spring.datasource.password=XXX
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
I got an error org.postgresql.util.PSQLException: FATAL: database "tower" does not exist. It says that my database is not up but I can easily get into it with pgAdmin3/4 and runs queries. I also use localhost:5432 with database name tower, user postgres and my password which is correct for sure. Why then I got and error that my database is not up.
I also tried:
Class.forName("org.postgresql.Driver");
Connection connection = null;
connection = DriverManager.getConnection(
"jdbc:postgresql://localhost:5432/tower","postgres", "XXX");
and got exactly the same error- database "tower" does not exists.
Why I got such an error when database is up?
Turn on logging, at least you will see if you're trying to connect in Postgesql. Also try without using PGAdmin, like using the Squirrel SQL client which, unlike PGAdmin, will require you to set up the connection exactly how you describe ie URL = jdbc:postgresql://localhost:5432/tower
If Squirrel connects then it's more like your code than PGAdmin
I know this is an old question but what worked for me is creating the db tower

Build error when upgrade spring-cloud-starter-dataflow-server-local to 1.3.0

Previously I was using spring-cloud-starter-dataflow-server-local 1.2.3.RELEASE and it worked perfectly. When I upgrade to 1.3.0.RELEASE, the build failed with the compilation error:
org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: In
vocation of init method failed; nested exception is org.hibernate.AnnotationExce
ption: AttributeConverter and explicit Type cannot be applied to same attribute
[org.springframework.cloud.dataflow.registry.domain.AppRegistration.metadataUri];remove #Type or specify #Convert(disableConversion = true)
Related MAVEN configurations in my pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-cloud.version>Dalston.SR4</spring-cloud.version>
<spring-cloud-dataflow-dependencies.version>1.3.0.RELEASE</spring-cloud-dataflow-dependencies.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-dataflow-server-local</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
So any suggestions? Thanks in advance.
Solved by adding the dependencis:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.12.Final</version>
</dependency>

java.lang.NoClassDefFoundError: Lorg/openspaces/core/GigaSpace

I'm trying to use Gigaspaces with Spring! I have two eclipse projects. A spring rest-service that consumes a space of Gigaspaces (the other eclipse project). I have a master eclipse project where I have both projects.
My problem is that I want to deploy my rest-service on my Tomcat v7.0 it crashes and show me:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.payulatam.prototype.services.IClientService com.payulatam.prototype.controllers.ClientController.clientService; nested exception is java.lang.NoClassDefFoundError: Lorg/openspaces/core/GigaSpace;
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Seems that tomcat can't found gigaspace's jars. But I'm including them on my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.payulatam.prototype</groupId>
<artifactId>rest-service</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>rest-service</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.payulatam.prototype</groupId>
<artifactId>PayUBank</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<properties>
<gsVersion>9.6.2-9900-RELEASE</gsVersion>
<spring.version>3.2.2.RELEASE</spring.version>
<jackson.version>1.9.10</jackson.version>
<jdk.version>1.6</jdk.version>
</properties>
<dependencies>
<dependency>
<groupId>com.gigaspaces</groupId>
<artifactId>gs-openspaces</artifactId>
<version>${gsVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.payulatam.prototype</groupId>
<artifactId>common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
<build>
<finalName>rest-service</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
</plugins>
</build>
Any idea how to fix it?
You specified that com.gigaspaces will be provided by the server or executor service you are using when you put <scope>provided</scope> in the dependency declartion for com.gigaspaces, which you are missing on the classpath as per the stacktrace said.
The most probable case here is that it is not bieng provided by the server, so try to delete/change the line <scope>provided</scope> to <scope>compile</scope> in your pom for the dependency declaration for the Gigaspaces library; So maven will be the one that provides it.
Help from: Difference between compile and provided scope
Change this section in your pom.xml
<dependency>
<groupId>com.gigaspaces</groupId>
<artifactId>gs-openspaces</artifactId>
<version>${gsVersion}</version>
<scope>provided</scope>
</dependency>
To
<dependency>
<groupId>com.gigaspaces</groupId>
<artifactId>gs-openspaces</artifactId>
<version>${gsVersion}</version>
<scope>compile</scope>
</dependency>
Just for your own understanding before you make the changes check in your deployed war file if you have the gs-openspaces.xxx.jar file. You will not see it there. Now make the changes rebuild and redeploy and again check this time you should see the jar file.
Maven Dependency Scope explained
Also see the links provided by DirkyJerky in his answer.

java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Plugin

I am using eclipse Kepler.
Version: Kepler Service Release 1
Build id: 20130919-0819
I installed Drools plugin and created a maven project that I converted to a
drools project.
( Could figure out how to create a maven enabled drools project directly )
I then create a new Drools project from the Drools menu, and choose to
create sample files, rules, test classes etc. Copy those file to my maven
drools project.
But when running the DroolsTest.java I get ..
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Plugin
here is my pom.xml :
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample</groupId>
<artifactId>drools</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>drools</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<type>pom</type>
<version>6.0.0.Final</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<scope>runtime</scope>
<version>6.0.0.Final</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I added :
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.resources</artifactId>
<version>3.7.100</version>
</dependency>
But now I get :
Error creating Groovy language support:
java.lang.ClassNotFoundException: org.codehaus.jdt.groovy.integration.internal.GroovyLanguageSupport
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
You need to add eclipse-core lib in your dependencies
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.runtime</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.1.5-03</version>
</dependency>
Add this as your dependency. Your issue will be resolved.