io.swagger.v3.parser.OpenAPIV3Parser is not exported - java

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.

Related

Javadoc issue package does not exist in java11

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.

Can't Compile a Java + Play! Framework Project upon 'play eclipse'

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

Maven compile error with full path to file

I am trying to get the full path to the file that the build is failing on however, my compile is only listing the name of the Java file (as shown below). I've searched and have yet to find an answer. There are other developers that are able to see the full path to the file in question...
I'm left to believe that it's because I am on a Ubuntu box and they are using a Mac.
[ERROR] RLXidEventParser.java:[14,0] The import com.google.code.or.binlog.BinlogParserContext cannot be resolved
[ERROR] RLXidEventParser.java:[15,0] The import com.google.code.or.binlog.impl.event.XidEvent cannot be resolved
[ERROR] RLXidEventParser.java:[16,0] The import com.google.code.or.binlog.impl.parser.XidEventParser cannot be resolved
Should look like
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[14,0] The import com.google.code.or.binlog.BinlogParserContext cannot be resolved
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[15,0] The import com.google.code.or.binlog.impl.event.XidEvent cannot be resolved
[ERROR] /home/bob/src/trunk/rest/of/path/RLXidEventParser.java:[16,0] The import com.google.code.or.binlog.impl.parser.XidEventParser cannot be resolved

Maven - Debug - Can not find symbol

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

Maven jar dependency issue package not found on OpenShift server

I'm getting a dependency issue with a jar I'm attempting to use.
I receive the following error
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sparq: Compilation failure: Compilation failure:
remote: [ERROR] /var/lib/openshift/55846322500446673d000007/app-root/runtime/repo/src/main/java/ServerQuery.java:[3,0] error: package com.github.koraktor.steamcondenser does not exist
remote: [ERROR] /var/lib/openshift/55846322500446673d000007/app-root/runtime/repo/src/main/java/ServerQuery.java:[8,8] error: cannot find symbol
remote: [ERROR] class ServerQuery
remote: [ERROR] /var/lib/openshift/55846322500446673d000007/app-root/runtime/repo/src/main/java/ServerQuery.java:[8,34] error: cannot find symbol
Here is the offending java file.
package helpers;
import com.github.koraktor.steamcondenser.*;
public class ServerQuery {
public static String getPlayers() {
SourceServer server = new SourceServer("66.150.155.152",27015);
server.initialize();
return server.toString();
}
}
I've added the following dependency to my pom.xml
<dependency>
<groupId>com.github.koraktor</groupId>
<artifactId>steam-condenser</artifactId>
<version>1.3.9</version>
</dependency>
I've also added the following action_hook pre_build script
mvn install:install-file -Dfile=./app-root/repo/steam-condenser.jar -DgroupId=com.github.koraktor -DartifactId=steam-condenser -Dversion=1.3.9 -Dpackaging=jar
Here's the GitHub for the project
https://github.com/koraktor/steam-condenser-java
And the website for it
http://koraktor.de/steam-condenser/usage/
Any ideas? Completely lost. Help much appreciated.
Since you are including the jar file in your project already, trying to manage the dependency with Maven seems like overkill. You should be able to put the jar file in your project's lib directory like this article describes. Then you won't need to configure that dependency in Maven at all.
I would use Maven for any dependencies that you want to download at the time your application is being built. Any jar files that you are checking into your project shouldn't need to be configured in Maven.
Just by looking at the question and the excerpts provided, I believe you are struggling with the basics of Maven. If I understand the situation correctly you have a library (which is not written by you):
once added to your project as a Maven dependency. This seems reasonable if you want to use it.
once the source code of the library incorrectly added to your own Java project.
remote: [ERROR] /var/lib/openshift/55846322500446673d000007/app-root/runtime/repo/src/main/java/ServerQuery.java:[3,0] error: package com.github.koraktor.steamcondenser does not exist
Based on the errormessage above it seems you have copied one of the sourcefiles from the library into your project. This is now causing problems. The main one is that without your source-folder (src/main/java) correctly representing the package structure declared in the source file (com.github...) it cannot be compiled. Hence the errormessage:
package com.github.koraktor.steamcondenser does not exist.
First of all you need to remove this copy-pasted file entirely an just use the dependency-management feature of Maven to get the library on classpath. After that just follow the examples given by the author of the library using the link you have already found (http://koraktor.de/steam-condenser/usage/).

Categories

Resources