Spring Tool Suite: Cannot Execute a Simple Demo because of Spring Boot Build Path ERROR - spring

The Error is as follows:
Description Resource Path Location Type The project was not built
since its build path is incomplete. Cannot find the class file for
org.springframework.context.ConfigurableApplicationContext. Fix the
build path then try building this project springbootdemo Unknown Java
Problem
2 ERROR items:
Description Resource Path Location Type The type
org.springframework.context.ConfigurableApplicationContext cannot be
resolved. It is indirectly referenced from required .class
files MainActivity.java /springbootdemo/src/main/java/springbootdemo line
10 Java Problem
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class MainActivity {
public MainActivity() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
//this is where the ERROR happens beginning at
// "SpringApplication.run(MainActivity.class, args);"
ApplicationContext ctx = SpringApplication.run(MainActivity.class, args);
}
}
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>labs.noogui.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot course-api</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
</properties>
</project>
Project Structure:
**Spring Tool Suite**
Version: 3.9.4.RELEASE
Build Id: 201804120921
Platform: Eclipse Oxygen.3a (4.7.3a)
I'm following the Spring Boot tutorial from Edureka!
How do I fix this build path error? I mean, this is like a spring boot hello world and I'm already running into errors?

Just use below code,
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class MainActivity {
public static void main(String[] args) {
SpringApplication.run(MainActivity.class, args);
}
}
or if you want to use ApplicationContext to start the application then use below line but both are almost same.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
#SpringBootApplication
public class MainActivity {
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(MainActivity.class, args);
}
}

You are using ApplicationContext from org.apache.catalina.core.
Import and use this org.springframework.context.ApplicationContext instead.
Your IDE is showing compile errors. Error message should probably lead you to the right direction.

Thanks for the folks who tried to help but I found out that the problem is with maven's 'corrupted' repository (again). So as always, deleting the .m2/repository and updating your maven project resolves the issue.
Related post in this github forum. This is a recurring issue with maven.

Related

Minecraft Spigot/Paper best way to receive info to site?

How to best way to receive info to cite from minecraft plugin? Maybe used simple http servlet, but how start him without Tomcat? Or, maybe, better to use websockets?
I'm creating a project used plugin "Minecraft" like spigot plugin and try to add spring boot web starter but i don't know how to connect him to plugin.
I've added dependencies and change plugin to:
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.sniklz</groupId>
<artifactId>snikkzPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SnikkzPlugin</name>
<description>asdasd</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
</project>
SniklzPlugin.class:
package com.sniklz.snikkzplugin;
import org.bukkit.plugin.java.JavaPlugin;
public final class SnikkzPlugin extends JavaPlugin {
#Override
public void onEnable() {
// Plugin startup logic
new Thread(() -> {
SniklzPluginApp.start();
}).start();
}
#Override
public void onDisable() {
// Plugin shutdown logic
}
}
sniklzPluginApp.class:
package com.sniklz.snikkzplugin;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
#Configuration
#EnableAutoConfiguration
#ComponentScan
public class SniklzPluginApp {
public static void start() {
SpringApplication.run(SniklzPluginApp.class);
}
}
controller->firstController.class:
package com.sniklz.snikkzplugin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
#RequestMapping("/home")
public class FirstContoller {
#GetMapping
public String homeController() {
System.out.println("Hello World");
return "Hello world";
}
}
But when I build the plugin and start it from server, I get this error:
Exception in thread "Thread-6" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
[09:02:43 WARN]: at snikkzPlugin-1.0-SNAPSHOT.jar//com.sniklz.snikkzplugin.SniklzPluginApp.start(SniklzPluginApp.java:14)
[09:02:43 WARN]: at snikkzPlugin-1.0-SNAPSHOT.jar//com.sniklz.snikkzplugin.SnikkzPlugin.lambda$onEnable$0(SnikkzPlugin.java:11)
[09:02:43 WARN]: at java.base/java.lang.Thread.run(Thread.java:833)
[09:02:43 WARN]: Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
[09:02:43 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151)
[09:02:43 WARN]: at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103)
[09:02:43 WARN]: at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
The issue come from that you don't have the spring code with your plugin. To fix this, you should include dependencies as jar.
You can also add a jar of spring in the class loader.
Finally, you can do new Thread(SniklzPluginApp::start).start(); for a one-line starter

Spring Boot in javaFX application (modularity problems)

I am trying to use SpringBoot in javaFX application. I use javafx-weaver-spring-boot-starter, and it works great with java < 9, but there are some problems with java 9+ (modularity).
My project structure:
AppStarter code:
package test;
import javafx.application.Application;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class AppStarter {
public static void main(String[] args) {
Application.launch(JavaFxApplication.class, args);`
}
}
JavaFxApplication Code:
package test;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import net.rgielen.fxweaver.core.FxWeaver;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
public class JavaFxApplication extends Application {
private ConfigurableApplicationContext applicationContext;
#Override
public void init() {
String[] args = getParameters().getRaw().toArray(new String[0]);
this.applicationContext = new SpringApplicationBuilder()
.sources(AppStarter.class)
.run(args);
}
#Override
public void start(Stage stage) {
FxWeaver fxWeaver = applicationContext.getBean(FxWeaver.class);
Parent root = fxWeaver.loadView(MyController.class);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
#Override
public void stop() {
this.applicationContext.close();
Platform.exit();
}
}
MyController code:
package test;
import javafx.event.ActionEvent;
import net.rgielen.fxweaver.core.FxmlView;
import org.springframework.stereotype.Component;
#Component
#FxmlView("hello-view.fxml")
public class MyController {
public void onHelloButtonClick(ActionEvent actionEvent) {
System.out.println("Hello World");
}
}
modules-info.java:
module test {
requires spring.boot.autoconfigure;
requires javafx.graphics;
requires spring.context;
requires net.rgielen.fxweaver.core;
requires spring.boot;
requires javafx.weaver.spring.boot.starter;
requires net.rgielen.fxweaver.spring.boot.autoconfigure;
requires net.rgielen.fxweaver.spring;
exports test;
opens test;
}
pom.xml code:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo2</name>
<description>demo2</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.rgielen</groupId>
<artifactId>javafx-weaver-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17-ea+11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17-ea+11</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>
</project>1
When I try to run the application, I get the following exception:
....
Caused by: java.lang.IllegalAccessError: class test.AppStarter$$EnhancerBySpringCGLIB$$e15856c4 (in module test) cannot access class org.springframework.cglib.core.ReflectUtils (in unnamed module #0x4fb0f9) because module test does not read unnamed module #0x4fb0f9
at test/test.AppStarter$$EnhancerBySpringCGLIB$$e15856c4.CGLIB$STATICHOOK1(<generated>)
at test/test.AppStarter$$EnhancerBySpringCGLIB$$e15856c4.<clinit>(<generated>)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:593)
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363)
at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:585)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
... 21 more
...
module test does not read unnamed module...
how can I fix it?
Spring 5 isn't friendly with the JavaFX Platform Module System
Spring won't really be built for modules until Spring 6/Springboot 3 is released.
Spring Framework 6 is indeed expected to introduce module-info descriptors for all core framework modules, with minimal required dependencies on core Java modules, enabling the JDK's jlink tool to build custom runtime images for Spring setups. There might be constraints with optional third-party libraries and certain configuration strategies, so it is still unclear how popular such explicit module usage will become among Spring users.
For Spring 5-based applications, the framework is not easily compatible with the Java Platform Module System.
So I don't recommend trying to build a modular JavaFX application relying on Spring until:
Spring 6/SpringBoot 3 is released,
AND
the dependent libraries you use are also made to be easily compatible with the Java module system.
For example, when all of your dependencies define a module-info.java.
How to make your project non-modular
However, you can still build a JavaFX 17 application today which relies on Spring 5 by making the JavaFX application non-modular and either providing the JavaFX modules in the base JDK you use or via command-line switches. For more information, see the answer to:
Intellij 2021.3.2, JavaFX Maven project not resolving dependencies correctly
Delete the module-info.java to make the project non-modular. Place only the JavaFX modules on the module path and add them by VM arguments, --module-path and --add-modules. See the openjfx.io for getting started documentation for more information on the settings.
For distribution of your non-modular application, see either:
JPackageScriptFX for Maven-based builds.
badass-runtime-plugin for Gradle-based builds.

Application execution failed and not getting expected outcome

I am developing a simple spring boot application. I am creating a LoginController class and trying to access the API which is present in the LoginController class. I am able to execute the program, but not getting the expected output while I am trying to access the API.
Login Controller
package com.in28minutes.springboot.web.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class LoginController {
#GetMapping("/login")
public String loginMessage() {
return "Welcome to Springboot Application";
}
}
Bootstraping Application
package com.in28minutes.springboot.web.springbootwebexample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class SpringBootWebExampleApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootWebExampleApplication.class, args);
}
}
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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.in28minutes.springboot.web</groupId>
<artifactId>spring-boot-web-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>spring-boot-web-example</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<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>
I run the project several times but don't get the output as expected. Can anyone help me out?
#SpringBootApplication annotation scans the current package and the sub-packages to look for #Component. In your case, LoginController is not in the package, not a sub-package of SpringBootWebExampleApplication.
Either move com.in28minutes.springboot.web.controller in com.in28minutes.springboot.web.springbootwebexample.controller
Or, use #SpringBootApplication(scanBasePackages = "your.package") on your SpringBootWebExampleApplication
package com.in28minutes.springboot.web.springbootwebexample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication(scanBasePackages = "com.in28minutes.springboot")
public class SpringBootWebExampleApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootWebExampleApplication.class, args);
}
}
package com.in28minutes.springboot.web.springbootwebexample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
#ComponentScan("com.in28minutes.springboot")
public class SpringBootWebExampleApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootWebExampleApplication.class, args);
}
}

spring boot error 404 while starting jar

I’m trying to run a spring boot application. I downloaded a code from a tutorial so I know the code works. When I run my jar file, it looks like the applications I running on port 8080 but still I get 404 for any URL, I never got the spring white label page. I checked that I don’t have anything else running on port 8080, and the server I up and running.
I have no clue why my applications are not responding.
running the jar
error 404
package com.virtualpairprogrammers;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by masn on 2017-04-01.
*/
#RestController
public class HelloController {
#RequestMapping("/hello")
public String sayHello(){
return "Hello";
}
}
enter code here
package com.virtualpairprogrammers;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class FleetmanApplication {
public static void main(String[] args) {
SpringApplication.run(FleetmanApplication.class, args);
}
}
enter code here
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.virtualpairprogrammers</groupId>
<artifactId>fleetman</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>fleetman</name>
<description>VPP´s Fleet Management Application</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.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-web</artifactId>
</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>
If you run the command java -jar YourAppName.jar you must be located inside the root folder (fleetman) and NOT INSIDE the target folder where the .jar is located.
This is a common mistake so run the command inside the fleetman folder.
You might want to update the pom.xml with this
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
Just try like this and it will work:
#RestController
public class HelloController {
#RequestMapping(path = "/hello", method = RequestMethod.GET)
public String hello() {
return "hello";
}
}
Here's the screenshot I've taken from my computer:

org.springframework.web.WebAbblicationInitializer.onStartup won't Override interface method

I am attempting a pure java (no web.xml) Spring WebMVC project and I am running into a peculiar issue with the configuration file. I am using exactly the code from this example, where it says "A 100% code-based approach to configuration." However, eclipse says that I must remove the #Override annotation because onStartup does not "implement a superclass method."
This seems like it might be a problem with the versions of Servlet or Spring that I am using, but I don't really know what I might change either of them to which would fix that.
This is a Maven project. I'd like to solve this by adjusting my maven dependencies, rather than using Eclipse configurations.
Here is the configuration file
package com.peak15.jumpgate;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
public class MyWebAppInitializer implements WebApplicationInitializer {
#Override // TODO figure out why this doesn't override
public void onStartup(ServletContext servletContext) throws ServletException {
WebApplicationContext context = getContext();
servletContext.addListener(new ContextLoaderListener(context));
ServletRegistration.Dynamic dispatcher = servletContext.addServlet("DispatcherServlet", new DispatcherServlet(context));
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/*");
}
private AnnotationConfigWebApplicationContext getContext() {
AnnotationConfigWebApplicationContext context
= new AnnotationConfigWebApplicationContext();
context.setConfigLocation("com.peak15.jumpgate");
return context;
}
}
here is 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>jumpgate</groupId>
<artifactId>jumpgate2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>JumpGateII</name>
<properties>
<jdk.version>1.8</jdk.version>
<spring.version>3.2.13.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
</project>
Check if you have installed jdk 1.8 -> if not, Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with #Override, but in Java 1.5 can only be applied to methods overriding a superclass method).
You can also add Maven compiler plugin to your pom to make sure it is working with latest Java version:
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Hope that causes an issue.

Resources