I'm trying to create a fresh Java application using Play Framework 2.2.3, I run JDK 1.8.0_60.
Running play new does work and generates the project I want, however when I try to set it to work with Eclipse Luna by typing play eclipse it fails to compile and writes this:
[info] About to create Eclipse project files for your project(s).
[info] Compiling 4 Scala sources and 2 Java sources to D:\EclipseTest\FileUpload
\target\scala-2.10\classes...
[error] D:\EclipseTest\FileUpload\app\controllers\Application.java:3: error: pac
kage play does not exist
[error] import play.*;
[error] ^
[error] D:\EclipseTest\FileUpload\app\controllers\Application.java:4: error: pac
kage play.mvc does not exist
[error] import play.mvc.*;
[error] ^
[error] D:\EclipseTest\FileUpload\app\controllers\Application.java:8: error: can
not find symbol
[error] public class Application extends Controller {
[error] ^
[error] symbol: class Controller
[error] D:\EclipseTest\FileUpload\app\controllers\Application.java:10: error: ca
nnot find symbol
[error] public static Result index() {
[error] ^
[error] symbol: class Result
[error] location: class Application
[error] D:\EclipseTest\FileUpload\app\controllers\Application.java:11: error: ca
nnot access Html
[error] return ok(index.render("Your new application is ready."));
[error] ^
[error] class file for play.api.templates.Html not found
[error] 5 errors
[error] (compile:compile) javac returned nonzero exit code
[error] Could not create Eclipse project files:
[error] Error evaluating task 'dependencyClasspath': error
I tried looking up the solution but all solutions refer to Scala. I saw a solution which modified the build.sbt, saying the code parts couldn't find the libraries they depend on. I removed the libraries found in the Seq section, but it was unhelpful.
EDIT:
Here's my build.sbt file:
name := "FileUpload"
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
javaJdbc,
javaEbean,
cache
)
play.Project.playJavaSettings
And my project/plugins.sbt:
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.3")
EDIT 2:
In the log above it says that the play libraries are missing: play.*, play.mvc.* & play.api.templates.Html. How could this be though? I only just created the project.
The problem was the location of my Play library files had characters that were not English nor numerical, such a rookie mistake...
Related
I have a maven project that works perfectly fine locally but after I've pushed it to a remote repository on GitHub and cloned it somewhere else (even to a new location on the same computer), one of the imports does not work because
Cannot resolve symbol 'DefaultMouseManager'
and of course maven install is failing with a lot of compilation errors like this one:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/.../CustomMouseManager2.java:[6,36] cannot find symbol
symbol: class DefaultMouseManager
location: package org.graphstream.ui.view.util
Is there anything I should check that may cause this problem?
Is the problem the class DefaultMouseManager or is it something more general?
I am trying to parse OPEN API V3 document using swagger-parser-v3 (https://github.com/swagger-api/swagger-parser) 2.0.29 library. But when I compile the code I get the following error.
[ERROR] io.swagger.v3.oas.models.servers.Server is not exported
[ERROR] io.swagger.v3.oas.models.OpenAPI is not exported
[ERROR] io.swagger.v3.oas.models.PathItem is not exported
[ERROR] io.swagger.v3.oas.models.Operation is not exported
[ERROR] io.swagger.v3.oas.models.Paths is not exported
[ERROR] io.swagger.v3.parser.OpenAPIV3Parser is not exported
Here is my code
import io.swagger.v3.parser.OpenAPIV3Parser;
OpenAPI openAPI = new OpenAPIV3Parser().read(swaggerFilePath);
I am seeing this issue while building using maven.
Can someone please help to address this issue.
Javadoc says package doesnt exist in all the imports. This same setup worked for Java1.8 but with java 11 it has this issue
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9:jar (attach-javadocs) on project esymac: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /home/JDK/com/SelfMonServiceLocator.java:23: error: package com does not exist
[ERROR] import com.SelfMonConstants;
[ERROR] ^
It was working in java1.8 properly with the same classes and pom.xml. But with java11 it fails to find packages.
I run maven using mvn clean verify -U -e -DskipITs=true
and get the following compilation error. When I run with the debug option -X it points me to the https://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException but I cannot find the underling problem.
These packages are part of the magnolia-pages-app-5.6.4.jar with is
in my .m2 directory under
/Users/asusti/.m2/repository/info/magnolia/pages/magnolia-pages-app/5.6.4/magnolia-pages-app-5.6.4.jar
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/asusti/Projects/xxx-wcms/xxx-module-versioning/src/main/java/ch/xxx/module/versioning/VersionSelector.java:[5,38] package info.magnolia.pages.app.editor does not exist
[ERROR] /Users/asusti/Projects/xxx-wcms/xxx-module-versioning/src/main/java/ch/xxx/module/versioning/VersionSelector.java:[6,48] package info.magnolia.pages.app.editor.extension does not exist
[ERROR] /Users/asusti/Projects/xxx-wcms/xxx-module-versioning/src/main/java/ch/xxx/module/versioning/VersionSelector.java:[12,38] cannot find symbol
symbol: class AbstractExtension
[ERROR] /Users/asusti/Projects/xxx-wcms/xxx-module-versioning/src/main/java/ch/xxx/module/versioning/VersionSelector.java:[15,17] cannot find symbol
symbol: class PageEditorPresenter
location: class ch.xxx.module.versioning.VersionSelector
[ERROR] /Users/asusti/Projects/xxx-wcms/xxx-module-versioning/src/main/java/ch/xxx/module/versioning/VersionSelector.java:[18,83] cannot find symbol
symbol: class PageEditorPresenter
location: class ch.xxx.module.versioning.VersionSelector
I added this into my module's pom file and after that maven worked:
<!-- magnolia pages extensions for pagebar functionality -->
<dependency>
<groupId>info.magnolia.pages</groupId>
<artifactId>magnolia-pages-app</artifactId>
<version>5.6.4</version>
</dependency>
During using mvn install or mvn compile i got error that maven can not find symbol with different methods and variables in mozilla rhino classes. I made exclusions everywhere where it is possible and said to use 7r5 build for rhino. Also i decompiled jar and got sure that mentioned classes and methods in maven were in that classes. I had pom deps and i couldnt exclude all 3d libraries. So in classpath i saw also path to rhino 6r5 library. I thought that problem was there. So i also decompiled that jar but i saw that methods in the error were also there. My question is how i can debug maven and see what library or class it is using for compiling class. All mozilla rhino libraries which are set in classpath have that methods.
PS: I wanted to mention that mvn eclipse:eclipse works fine and i have no errors in eclipse.
[ERROR] ...path_to_class...:[264,65] cannot find symbol
[ERROR] symbol: method getLength()
[ERROR] location: class org.mozilla.javascript.NativeArray
[ERROR] ...path_to_class...:[288,18] cannot find symbol
[ERROR] symbol: method getWrapFactory()
[ERROR] location: variable cx of type org.mozilla.javascript.Context
[ERROR] ...path_to_class...:[322,49] cannot find symbol
[ERROR] symbol: method getLength()
[ERROR] location: variable array of type org.mozilla.javascript.NativeArray