SBT <project name> project refresh failed - java

Whenever I try to enable auto-import in IntelliJ it always gives me this error:
SBT 'mobile-aggregator' project refresh failed
Error:Error while importing SBT project:[error] at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:107)
[error] at sbt.io.Using.apply(Using.scala:22)
[error] at sbt.MainLoop$.runWithNewLog(MainLoop.scala:101)
[error] at sbt.MainLoop$.runAndClearLast(MainLoop.scala:57)
[error] at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:42)
[error] at sbt.MainLoop$.runLogged(MainLoop.scala:34)
[error] at sbt.StandardMain$.runManaged(Main.scala:113)
[error] at sbt.xMain.run(Main.scala:76)
[error] at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error] at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error] at xsbt.boot.Launch$.run(Launch.scala:109)
[error] at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error] at xsbt.boot.Launch$.launch(Launch.scala:117)
[error] at xsbt.boot.Launch$.apply(Launch.scala:18)
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error] at xsbt.boot.Boot$.main(Boot.scala:17)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.CreateTasks$
[error] Use 'last' for the full log.
[info] shutting down serverSee complete log in href="file:/C:/Users/Rahman/.IdeaIC2017.2/system/log/sbt.last.log">file:/C:/Users/Rahman/.IdeaIC2017.2/system/log/sbt.last.log

This happens quite a few times when your compiler / editor tries to use your cached project data.
To fix this, perform the following steps:
Exit IntelliJ & Delete .idea folder from the root project folder
Delete target folder from root_project_folder\target & root_project_folder\project\target
Make sure you have a valid name for your project name inside build.sbt. It should be in the following format: name := "projectname"
Again start your intelliJ and reinitialize your project.
Hopefully, that should have solved your problem

Related

mvnw clean install throwing the following errors

I am trying to set up nvim for java development, I am rather new to all this, and hence am following this tutorial, because it didn't work when I tried on my own.
tutorial
I first cloned this repo using ssh, then i did a mvnw clean install as told.
and i got the following errors
1 error #
#
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR] The project com.microsoft.java:com.microsoft.java.debug.plugin:0.41.0 (/home/demo/.config/nvim/java-debug/com.microsoft.java.debug.plugin/pom.xml) has 1 error
[ERROR] Invalid artifact repository: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) Error in custom provider, java.lang.TypeNotPresentException: Type org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout not present
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:2.7.3, parent: java.net.URLClassLoader#2cb4c3ab] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:2.7.3, parent: java.net.URLClassLoader#2cb4c3ab] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout annotated with #com.google.inject.name.Named(value=p2)
[ERROR]
[ERROR] 1 error: org/eclipse/tycho/core/p2/P2ArtifactRepositoryLayout has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR]
[ERROR] The project com.microsoft.java:com.microsoft.java.debug.repository:0.41.0 (/home/demo/.config/nvim/java-debug/com.microsoft.java.debug.repository/pom.xml) has 1 error
[ERROR] Invalid artifact repository: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) Error in custom provider, java.lang.TypeNotPresentException: Type org.eclipse.tycho.core.p2.P2ArtifactRepositoryLayout not present
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:2.7.3, parent: java.net.URLClassLoader#2cb4c3ab] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:2.7.3, parent: java.net.URLClassLoader#2cb4c3ab] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
[ERROR] while locating org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout annotated with #com.google.inject.name.Named(value=p2)
[ERROR]
[ERROR] 1 error: org/eclipse/tycho/core/p2/P2ArtifactRepositoryLayout has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[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/ProjectBuildingException
Is there any chance that this could be a firewall error? Because I am on a public network currently
The error is because you are trying to build that project using Java 8 (class file 52.0) and some of its dependencies requires Java 11 (class file version 55.0).
See:
https://www.java.com/releases/
https://en.wikipedia.org/wiki/Java_class_file#General_layout

java.lang.UnsatisfiedLinkError when starting the play project

Im trying to start a project on play in IntelliJ IDEA Ultimate MacBook Pro on M1, I get the following error in the console:
[error] java.lang.UnsatisfiedLinkError:
/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp:
dlopen(/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp,
0x0001): tried:
'/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp'
(fat file, but missing compatible architecture (have 'i386,x86_64',
need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
I tried to reinstall the JDK on the arm architecture after deleting all the JDKs, it did not help
What needs to be tricked to fix this?
Full StackTrace:
[error] java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
[error] at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
[error] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
[error] at java.base/java.lang.Runtime.load0(Runtime.java:768)
[error] at java.base/java.lang.System.load(System.java:1837)
[error] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
[error] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
[error] at com.sun.jna.Native.<clinit>(Native.java:195)
[error] at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:19)
[error] at io.methvin.watchservice.jna.CFStringRef.toCFString(CFStringRef.java:23)
[error] at io.methvin.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:101)
[error] at io.methvin.watchservice.WatchablePath.register(WatchablePath.java:50)
[error] at io.methvin.watcher.DirectoryWatcher.register(DirectoryWatcher.java:352)
[error] at io.methvin.watcher.DirectoryWatcher.registerAll(DirectoryWatcher.java:317)
[error] at io.methvin.watcher.DirectoryWatcher.<init>(DirectoryWatcher.java:167)
[error] at io.methvin.watcher.DirectoryWatcher$Builder.build(DirectoryWatcher.java:118)
[error] at play.dev.filewatch.DefaultFileWatchService.watch(DefaultFileWatchService.scala:38)
[error] at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:87)
[error] at play.runsupport.Reloader.<init>(Reloader.scala:414)
[error] at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:259)
[error] at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:251)
[error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:271)
[error] at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:99)
[error] at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:83)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:106)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3$adapted(PlayRun.scala:68)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run 'last Compile / run' for the full output
[error] (Compile / run) java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
Found a solution:
Inside sbt 1.4.6 there is a JNA library version 5.5.0, which apparently does not have the necessary files for the arm64 architecture processor
Raising the sbt version to 1.6.2 helped

The type org.eclipse.swt.widgets.Control cannot be resolved. It is indirectly referenced from required .class files

I am compling dbeaver-7.2.2 on mips64el platform using the command "mvn package -DskipTests=true". it fails and displays error as follws:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.7.0:compile (default-compile) on project org.jkiss.dbeaver.ui: Compilation failure: Compilation failure:
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:
[ERROR] /*
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Control cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:[1101]
[ERROR] private class SortListener implements Listener {
[ERROR] ^^^^^^^^
[ERROR] Listener cannot be resolved to a type
[ERROR] /root/dbeaver-7.2.2/plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/properties/PropertyTreeViewer.java:[1173]
[ERROR] class PaintListener implements Listener {
[ERROR] ^^^^^^^^
[ERROR] Listener cannot be resolved to a type
[ERROR] 3 problems (3 errors)
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :org.jkiss.dbeaver.ui
the class PaintListener belogs to org.eclipse.swt.gtk.linux.mips64el which has been compiled successfully.i have set org.eclipse.swt.gtk.linux.mips64el classpath ,but it stills fail.
dbeaver-7.2.2 source code:https://github.com/dbeaver/dbeaver/releases/tag/7.2.2
[ERROR] The type org.eclipse.swt.widgets.Control cannot be resolved. It is indirectly referenced from required .class files
the class PaintListener belogs to org.eclipse.swt.gtk.linux.mips64el which has been compiled successfully.i have set org.eclipse.swt.gtk.linux.mips64el classpath ,but it stills fail.

Error while running maven command in gcp console unable to install common package error

unable to install apache maven packages in gcp console please let me know if any one resolves the issue. I'm trying to create dataflow pipeline following the below link
enter link description here
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.368 s
[INFO] Finished at: 2020-08-30T15:27:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:compile (default-compile) on project common: Compilation failure: Compilation failure:
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[78,12] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/utils/CacheUtils.java:[80,30] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.utils.CacheUtils.DataStreamPkCache
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[29,42] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: package com.google.cloud.teleport.v2.utils
[ERROR] /home/prasanna_kumar/DataflowTemplates/v2/common/src/main/java/com/google/cloud/teleport/v2/cdc/mappers/MergeInfoMapper.java:[59,11] cannot find symbol
[ERROR] symbol: class DataStreamClient
[ERROR] location: class com.google.cloud.teleport.v2.cdc.mappers.MergeInfoMapper
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :common
By now this is well known to developers bug, confirmed on my side, getting the same kafka-to-bigquery template compilation error around DataStreamClient class. Seems the new PR for CacheUtils.java is going to appear soon, more info here.

Error while running openIE using scala

i am running openIE in scala. while running sbt run i got error. can any body explain?
Set current project to openie (in build file:/home/user_name/Videos/openie-master/)
[info] Running edu.knowitall.openie.OpenIECli
[error] Exception in thread "main" java.lang.NoSuchFieldError: MODULE$
[error] at scala.util.PropertiesTrait$class.scalaPropOrNone(Properties.scala:65)
[error] at scala.util.Properties$.scalaPropOrNone(Properties.scala:16)
[error] at scala.util.PropertiesTrait$class.$init$(Properties.scala:77)
[error] at scala.util.Properties$.<init>(Properties.scala:16)
[error] at scala.util.Properties$.<clinit>(Properties.scala)
[error] at scala.compat.Platform$.<init>(Platform.scala:112)
[error] at scala.compat.Platform$.<clinit>(Platform.scala)
[error] at scala.App$class.$init$(App.scala:42)
[error] at edu.knowitall.openie.OpenIECli$.<init>(OpenIECli.scala:29)
[error] at edu.knowitall.openie.OpenIECli$.<clinit>(OpenIECli.scala)
[error] at edu.knowitall.openie.OpenIECli.main(OpenIECli.scala)

Categories