I have cloned the spark-cassandra-connector in order to fix one of its unresolved issues.
Prior to any code changes, I'm trying to build locally, as explained in the developer guide.
But whichever SBT command that I run, fails with an unresolved dependency errors:
[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.apache.logging.log4j#log4j-api;2.11.1: org.apache#apache;18!apache.pom(pom.original) origin location must be absolute: file:/Users/gcatz/.m2/repository/org/apache/apache/18/apache-18.pom
[error] unresolved dependency: org.apache.logging.log4j#log4j-core;2.11.1: org.apache#apache;18!apache.pom(pom.original) origin location must be absolute: file:/Users/gcatz/.m2/repository/org/apache/apache/18/apache-18.pom
[error] unresolved dependency: com.squareup.okhttp3#okhttp;3.7.0: org.sonatype.oss#oss-parent;7!oss-parent.pom(pom.original) origin location must be absolute: file:/Users/gcatz/.m2/repository/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
...
I'm using a mac (Monterey), Java 1.8.
I wrote some comments regarding the issue in the original thread on DataStax community, but have been asked to open a new thread here instead.
Have you guys ever encountered such an issue with SBT?
It seems the issue was in broken cache (~/.m2, ~/.ivy2). Removing the cache helped with origin location must be absolute
How to fix "origin location must be absolute" error in sbt project (with Spark 2.4.5 and DeltaLake 0.6.1)?
sbt new RuntimeException
Origin location must be absolute error in building a SBT project, IntelliJ
Also wrong version of Java was selected (Java 9 instead of 8). Correcting $PATH helped with error while loading String, class file '/modules/java.base/java/lang/String.class' is broken (class java.lang.NullPointerException/Cannot invoke "scala.tools.nsc.Global$Run.typerPhase()" because the return value of "scala.tools.nsc.Global.currentRun()" is null) [error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI [error] at java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:175)
Related
This question already exists:
Getting Maven build failures while clean and install of my project [closed]
Closed last year.
Hi Please help me to resolve the below issue.
APPLICATION FAILED TO START
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:377)
The following method did not exist:
com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
The method's class, com.fasterxml.jackson.databind.introspect.AnnotatedMember, is available from the following locations:
jar:file:/C:/Users/konteja/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar!/com/fasterxml/jackson/databind/introspect/AnnotatedMember.class
The class hierarchy was loaded from the following locations:
com.fasterxml.jackson.databind.introspect.AnnotatedMember: file:/C:/Users/konteja/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar
com.fasterxml.jackson.databind.introspect.Annotated: file:/C:/Users/konteja/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.4/jackson-databind-2.11.4.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.fasterxml.jackson.databind.introspect.AnnotatedMember
When I want to generate Javadocs with the maven-javadoc-plugin, the process fails with the error message:
[ERROR] javadoc: error - String index out of range: -6
[ERROR]
[ERROR] Command line was: /usr/lib/jvm/java-8-openjdk-amd64/jre/../bin/javadoc #options #packages
I tried enabling Debug Mode of Maven, Debug mode of the Javadoc Plugin, Debug mode of the javadoc generator itself. I have not gotten any more information than the message above. Not even a hint what class it fails to generate JavaDoc for.
Searching for this problem doesn't lead to much results either as all queries end in results for documentation about StringIndexOutOfBoundsException or other exception related problems.
I use version 3.2.0 of the maven-javadoc-plugin. But it doesn't seem to matter what version I use as the problem is also existent in version 2.7.
What I've found out so far is, that this error only occurs if I utilize stuff from a special dependency (currently the problem gets resolved if I remove all references to that dependency in code).
Said dependency is not public and was installed using the mvn install:install-file command. The classes in the dependency have been compiled with Java 6.
This is my last hope to get some information and maybe a solution to the problem.
Edit 1: It is definitely that dependency. If I manually remove it from the 'classpath' of the javadoc command (options file) then the error disappears.
Could it have something to do with me having a package name that matches exactly the package name used in the dependency?
When trying to generate a Javadoc in Eclipse, I get the error module not found: org.junit.jupiter.api
All related problems I found on the internet were solved by adding --add-modules=org.junit.jupiter.api to the Javadoc VM options.
Like in this answer "Module not found" message when generating JavaDocs in Eclipse, I also changed my JAVA_HOME and PATH_TO_FX System Variables (not defined previously). I looked up the normal settings and changed them to C:\Program Files\Java\jdk-15.0.2 and C:\Program Files\Java\jdk-15.0.2\lib respectively.
Yet Javadoc still gives the same error. Any idea what is going wrong?
This is the entire error message:
Loading source file C:\Users\jonas\OneDrive\school\3-Leuven\1ste jaar\OOP\src\pacman\src\module-info.java...
C:\Users\Onedrive\school\3-Leuven\OOP\pacman\src\module-info.java:4: error: module not found: org.junit.jupiter.api
requires org.junit.jupiter.api;
^
1 error
This is my project structure
And here is the module-info.java file
module pacman {
exports pacman;
requires org.junit.jupiter.api; //this is where the error happens
}
I use Eclipse 2020-12 on a Windows 10 machine.
Thanks in advance.
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/).
When I (try to) start Play, I see this:
[info] Loading global plugins from /home/paul/.sbt/plugins
[info] Loading project definition from /home/my-project/project
[error] java.lang.NoClassDefFoundError: sbt/PlayInternalKeys
[error] Use 'last' for the full log
I am loading a custom sbt plugin.
What does that error mean?
(FYI, I'm assuming that last line says I can run play last. I can't. It gives the same error.)
For some reason, I found that my Play project wasn't pulling in the SNAPSHOT versions I was publishing to my local repo for the sbt plugin.
I had to increment the version numbers myself. When I did that, I did not see this error anymore. (I did continue to have to update the version when I changed the plugin.)