Can't build kie-wb-webapp 6.1.x (JBPM) - gwt

I need to modify KIE Workbench source and I have two issues that are stopping me from building with Maven 3.2.5, one on Windows and one on Linux.
On Windows 7, I am getting an error that says
[deletia...]SNAPSHOT\uberfire-backend-api-0.4.0-SNAPSHOT-sources.jar,
com.google.gwt.dev.Compiler,-logLevel, INFO, -style, OBF, -war,
c:\kie-wb-webapp\target\kie-wb-webapp-6.1.1-SNAPSHOT, -localWorkers, 1,
-strict, -XfragmentCount, -1, -deploy, c:\kie-wb-webapp\target\gwt-symbols-deploy, -gen,
c:\kie-wb-webapp\target\.generated, org.kie.workbench.FastCompiledKIEWebapp]:
Error while executing process. Cannot run program "c:\development\software\jdk\jdk1.7.0_71\jre\bin\java":
CreateProcess error=206, The filename or extension is too long.
So I looked it up and apparently, this is well known limitation since gwt-maven-plugin creates a command-line that is longer than 8191 chars and this is forbidden. So I gave it a shot on Ubuntu.
On Ubuntu,
I am getting:
[INFO] --- gwt-maven-plugin:2.5.1:compile (gwt-compile) # kie-wb-webapp [ERROR] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[ERROR] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
[INFO] Compiling module org.kie.workbench.FastCompiledKIEWebapp
[INFO] Validating units:
[INFO] [ERROR] Errors in 'jar:file:/home/rich/.m2/repository/com/google/guava/guava-gwt/14.0.1/guava-gwt-14.0.1.jar!/com/google/common/primitives/Booleans.java'
[INFO] [ERROR] Line 29: The import java.util.BitSet cannot be resolved
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE*
It's really important that I find a workaround to 1 or both of these issues (my guess is that if I clear the command-line issue on Windows, I'll just run into the guava issue again). Also, unless it's absolutely necessary, I can't upgrade to 6.2.x, because this would cause a lot of work for my project.
Has anyone run into this?

If you don't need Java 8 support, you may be able to solve the problem by using an earlier version of the JDK. I believe that you do this by setting JAVA_HOME for your Maven run. You can download a JDK 7 here.
You could also build Guava yourself from HEAD, as the problem has been fixed there but not included in a release. Or you could wait for a 19.0-rc1, which we hope to have out soon.

Related

sbt server fails to start throwing error 231

When I am trying to start sbt, it fails throwing an IO exception.
Version of SBT - 1.1.2
Version of Scala - 2.12.6
Error:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\Users\username\IdeaProjects\projectname\project
[info] Loading settings from build.sbt ...
[info] Set current project to example (in build file:/C:/Users/username/IdeaProjects/projectname/)
[error] server failed to start on local:sbt-server-ad238fc8ee352b69065c. java.io.IOException: Could not create lock for
\\.\pipe\sbt-server-ad238fc8ee352b69065c_lock, error 231
Analysing the source of the throw it seems error code 231 refers to Windows error:
ERROR_PIPE_BUSY
231 (0xE7)
All pipe instances are busy.
The pipe cannot be accessed because another process is using it, so try closing down IntelliJ and any other SBT server running, and try again later. Perhaps even reboot the machine, and then start a single system SBT server (not IntelliJ), and see if the issue persists.

Library cannot be resolved

When I package Scala project using SBT, I face the following problem:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025229' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
at scala.sys.package$.error(package.scala:27)
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\appContainer.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=6, col=17]
And the 5-7 lines code in app.raml like that:
uses:
appContainer: appContainer.raml
artifact: artifact.raml
the directory of app.raml and appContainer.raml is "D:\marathon-master\docs\docs\rest-api\public\api\v2/types/" both. So I change 6 line of app.raml like that:
appContainer: v2/types/appContainer.raml
But when I run "sbt package" again, a warning shows up:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m;
support was removed in 8.0
[info] Loading project definition from D:\marathon-master\project
Version '20170916T025721' is not fully supported, please update the git tags.
[info] Set current project to marathon (in build file:/D:/marathon-master/)
[warn] File D:\marathon-master\docs\docs\rest-api\public\api\v2\types\v2\types\appContainer.raml does not exist (referenced by
D:\marathon-master\docs\docs\rest-api\public\api\v2\types\app.raml)
[info] Constructing RAML model
java.lang.RuntimeException: Library cannot be resolved: D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
...
[error] (marathon/compile:ramlGenerate) Library cannot be resolved:
D:\marathon-master\docs\docs\rest-api\public\api\artifact.raml -- D:\marathon-master\docs\docs\rest-api\public\api\v2/types/app.raml [line=7, col=13]
why have this warning? Any idea?

error while loading <root>, Error accessing .ivy2/cache/org.apache.spark/spark-core_2.11/jars/spark-core_2.11-1.4.0.jar

While following an example to deploy an application in Spark, I keep getting the error below while "compile" in sbt.
[info] Updating {file:/home/sankalp/Desktop/spark/SVMexample/}svmexample...
[info] Resolving com.sun.jersey.jersey-test-framework#jersey-test-framework-grizzl[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] Compiling 1 Scala source to /home/sankalp/Desktop/spark/SVMexample/target/scala-2.11/classes...
[error] error while loading <root>, Error accessing /home/sankalp/.ivy2/cache/org.apache.spark/spark-core_2.11/jars/spark-core_2.11-1.4.0.jar
[trace] Stack trace suppressed: run last compile:compileIncremental for the full output.
[error] (compile:compileIncremental) scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
[error] Total time: 21 s, completed Aug 16, 2015 2:36:53 AM
Can anyone help?
Thanks,
I am no expert, but in my case it helped editing:
project/Versions.scala -> val Spark = "1.4.0" -> "1.4.1".
Although it is actually a mystery to me why it did help :).
EDIT:
On the second thought i've noticed by accident, that the file spark-core_2.11-1.4.0.jar was broken (each time it was downloaded by sbt).
It also helped to replacing .jar with valid one from:
http://mvnrepository.com/artifact/org.apache.spark/spark-core_2.11/1.4.0
I suppose it is somehow connected with spark-cassandra-connector build system or repo from which file is downloaded.
Maybe we should file an issue.
EDIT2:
i found out, that broken .jar comes from (at least in my case):
https://jcenter.bintray.com/org/apache/spark/spark-core_2.11/1.4.0/spark-core_2.11-1.4.0.jar
you can see its origin in: .ivy2/cache/org.apache.spark/spark-core_2.11/ivydata-1.4.0.properties
i did not manage to find out why it comes from jcenter (https://bintray.com/bintray/jcenter). maybe it is somehow connected with adding bintray repo to my linux mint or new version of sbt or datastax uses bintray. i will probably investigate later.
The previous suggestions seemed very specific to a particular use case. My solution is inefficient, brute force, but was effective:
Reinstall IntelliJ completely

Trying to install SBT-0.13.8 for Windows 7 installs SBT version 0.12.4

I have (multiple times) tried to install SBT-0.13.8 from the SBT download page via the SBT-0.13.8-MSI button and I always end up getting an SBT version which shows the following output
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\Users\Tina\Desktop\example\project\project
error: error while loading CharSequence, class file 'C:\Program Files\Java\jre1.
8.0_20\lib\rt.jar(java/lang/CharSequence.class)' is broken (bad constant pool tag 15 at byte 1470)
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
> about
[info] This is sbt 0.12.4
[info] No project is currently loaded
[info] sbt, sbt plugins, and build definitions are using Scala 2.9.2
SBT produces an error message and (!) shows itself as version 0.12.4.!!!
I really made sure that I have no other version of SBT installed and I even made a reboot before re-installing it but nothing changed. SBT files have a creation date of March, 21, 2015. This seems to be the newest version but why does this version show up as 0.12.4 and does not work with JDK1.8?
Looks like the directory you're in is wrong, you want to launch sbt from C:\Users\Tina\Desktop\example\project not C:\Users\Tina\Desktop\example\project\project (note 1 project less).
The second problem you're having is you're trying to use sbt 0.12.4 with Java 8. sbt 0.12.4 uses (as can be seen from the output) Scala 2.9.2 which doesn't work with Java 8. I would recommend migrating to sbt 0.13.8, but if not you could always downgrade to Java 7.
Edit after comments below
The progfun Coursera course download is still configured with sbt
0.12.4 which you're having trouble building because you are using Java 8.
I had a quick go at trying to see if upgrading the project to 0.13.8 would work (FYI it involves editing project/build.properties), but then plugins need to be upgraded, then meta-build code needed to be changed because of namespace changes..
Unless you're willing to experiment more and work you're way through the various changes required to use latest sbt and latest Java (which is what I would do if this were for myself), I would recommend as an alternative to:
Downgrade to Java 7
Notify the relevant people involved in running the course that the source material should be updated as it demonstrably does not work on latest, stable Java.
If your default Java is Java 8 but you want to switch to Java 7 for this out-of-date project setup, you need to create an .sbtopts file at the root of the project containing (note: on separate lines!):
-java-home
C:\Users\Tina\PATH\TO\YOUR\JAVA\HOME

how to get more debugging for sbt compile error? "MethodHandle not found"

Attempting to sbt compile a branch of my project ENSIME (experiment if you're interested) under Java 6 is giving a bizarre compiler warning:
[info] Compiling 48 Scala sources to /home/fommil/Projects/ensime-server/target/scala-2.11/classes...
[error] Class java.lang.invoke.MethodHandle not found - continuing with a stub.
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 18 s, completed 03-Sep-2014 22:57:44
It works under Java 7.
Calling last reveals nothing more than the classpath of the compile (this would be equivalent to setting --debug level).
I've removed all the plugins from the project, and the problem still shows.
If I remove all my code - leaving just the build system and dependencies - with some stub scala entry points then there is no problem.
However, I can't exactly bisect my source code file because then it doesn't compile.
When the code is compiled, a grep (including binaries) of MethodHandle doesn't give any hits (although there is a jdk8 file in the tests resources, it is not relevant because the problem appears if it is removed).
It is only one (big) patch that has caused the problem (the previous commit compiles ok).
How can I debug this further in sbt? it doesn't want to give any more info
is this a known problem, or can anyone make an informed guess what is going on?
It turns out that this was caused by pulling in Lucene, which requires Java 7.
A bit of an epic message fail from sbt: there doesn't appear to be any way to get it to output anything sensible.