Reputation: 155
i trying to create a basic atmosphere test from the below link. I have everything downloaded what it ask from the pom file. But for some reason the eclipse cannot recogonise "@MeteorService(path = "/*", interceptors = {AtmosphereResourceLifecycleInterceptor.class})"
https://github.com/Atmosphere/atmosphere/blob/master/samples/meteor-chat/src/main/java/org/atmosphere/samples/chat/MeteorChat.java
Any ideas? I am using atmosphere 0.9.7 version
Maven install
=======================
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building atmosphere-meteor-chat 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ atmosphere-meteor-chat ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ atmosphere-meteor-chat ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to Q:\myEdu\atmosphere-meteor-chat\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \myEdu\atmosphere-meteor-chat\src\main\java\org\atmosphere\samples\chat\MeteorChat.java:[31,1] cannot find symbol
symbol: class MeteorService
@MeteorService(path = "/*", interceptors = {AtmosphereResourceLifecycleInterceptor.class})
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.542s
[INFO] Finished at: Tue Jul 24 23:10:57 EDT 2012
[INFO] Final Memory: 7M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project atmosphere-meteor-chat: Compilation failure
[ERROR] \myEdu\atmosphere-meteor-chat\src\main\java\org\atmosphere\samples\chat\MeteorChat.java:[31,1] cannot find symbol
[ERROR] symbol: class MeteorService
[ERROR] @MeteorService(path = "/*", interceptors = {AtmosphereResourceLifecycleInterceptor.class})
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
<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.atmosphere.samples</groupId>
<artifactId>atmosphere-meteor-chat</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>atmosphere-meteor-chat</name>
<properties>
<atmosphere.version>0.9.7</atmosphere.version>
<jersey.version>1.10</jersey.version>
<nettosphere.version>1.3.1</nettosphere.version>
<ahc.version>1.7.4</ahc.version>
<javaee.version>6.0</javaee.version>
<testng.version>6.5.2</testng.version>
<logback.version>1.0.6</logback.version>
<maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version>
<maven-war-plugin.version>2.1.1</maven-war-plugin.version>
<jetty.version>8.1.1.v20120215</jetty.version>
</properties>
<repositories>
<repository>
<id>Sonatype snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>Sonatype releases</id>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-jquery</artifactId>
<version>${atmosphere.version}</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>${atmosphere.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- This is ONLY required if you use Atmosphere's annotation -->
<dependency>
<groupId>eu.infomas</groupId>
<artifactId>annotation-detector</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
Upvotes: 0
Views: 721
Reputation: 21
MeteorService is in atmosphere-runtime version 1.1.0-SNAPSHOT so changing 0.9.7 to 1.1.0-SNAPSHOT shoud fix it.
Also I found m2e-apt Eclipse plugin to help with annotation from Maven stable update site http://download.jboss.org/jbosstools/updates/m2e-extensions/m2e-apt
Upvotes: 2
Reputation: 1705
make sure you have in your pom.xml:
<dependency>
<groupId>eu.infomas</groupId>
<artifactId>annotation-detector</artifactId>
<version>3.0.0</version>
</dependency>
You should see in the log:
6:31:48.712 [main] INFO o.atmosphere.cpr.AtmosphereFramework - Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation 06:31:48.721 [main] INFO o.a.cpr.DefaultAnnotationProcessor - Found Annotation in org.atmosphere.samples.chat.MeteorChat being scanned: interface org.atmosphere.config.service.MeteorService 06:31:48.729 [main] INFO o.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereHandler org.atmosphere.handler.ReflectorServletProcessor mapped to context-path: /* 06:31:48.729 [main] INFO o.atmosphere.cpr.AtmosphereFramework - Installed AtmosphereInterceptor [Atmosphere LifeCycle] mapped to AtmosphereHandler org.atmosphere.handler.ReflectorServletProcessor
Thanks
-- Jeanfrancois
Upvotes: 1