Getting IncompatibleClassChangeError while running shark-0.9.0 with hadoop 2.2.0 - scala

I am getting the following error while running shark 0.9.0.
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class scala.collection.mutable.ArrayOps, but interface was expected
at shark.SharkCliDriver$.main(SharkCliDriver.scala:82)
at shark.SharkCliDriver.main(SharkCliDriver.scala)
Any solution regarding the problem is highly appreciable.

Its a backward compatibility issue.
This exception is raised when the version of scala-library.jar is different during compilation and execution. Make sure that you use the same library version during compiling and executing.

if you are using hadoop 2.x version, do the below steps
find path to shark installation folder -name hadoop-core-1.0.4.jar
remove all the hadoop-core-1.0.4.jar
check this
http://bigdataanalyze.blogspot.com/2014/03/issues-on-shark-with-cdh5-beta2-1.html

Related

How to solve the 'Unable to find Asm for stackmap generation' error on startup of STS?

I am trying to use the Spring Tool Suite 3.8.3 on Ubuntu 16.04. Upon startup I get this error:
An internal error occured during: "Initializing Java Tooling"
with the detailed message:
An internal error occurred during: "Initializing Java Tooling". Unable
to find Asm for stackmap generation (Looking for
'aj.org.objectweb.asm.ClassReader'). Stackmap generation for woven
code is required to avoid verify errors on a Java 1.7 or higher
runtime when weaving type org.eclipse.jdt.core.search.SearchPattern
when weaving classes when weaving
I have to admit that I have no idea what I should do here and I failed to find any pointers online. Any advice or hint is welcome.
It was for me due to the scala plug-in which I have installed a few days back. Uninstall the scala plugin and change to JDK 8 or JDK 11 it will work.
If anyone is still having a similar problem with Eclipse and needs to use Java 11 or higher (Eclipse nowadays seems to require Java 11) then have a look into this plugin as it seems to be required for the kotlin plugin.
https://marketplace.eclipse.org/content/aspectj-development-tools
I think you have installed Java 9 on your system. That's why you are facing compatibility issue and getting the stated errors. I therefore suggest you to degrade your java version to 8 for which it will work well and you wont be facing any error issue in that.
You can install java8 from this link!
I had to downgrade the JRE used to run Eclipse. Downgrading from Java 15 to Java 11 solved the problem.
Use the -vm option in eclipse.ini, eg.
-vm
c:\Dev\jdk-11\bin
My STS did not even start after installing scala plugin. I had to manually delete scala jars and folders from the STS /plugins. After that it started working.

akka-kryo-serialization ClassNotFoundException: scala.Enumeration$Val

Sometimes when updating a dependency version for my project, when I would run the project I would get the following error:
ERROR 09:31:34:241 apply$mcV$sp - Class could not be loaded and/or registered: scala.Enumeration$Val
ERROR 09:31:34:247 apply$mcV$sp - exception caught during akka-kryo-serialization startup: java.lang.ClassNotFoundException: scala.Enumeration$Val
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
I usually got lucky and was able to fix this by tweaking the versions of my dependencies.
Until I updated my akka version from 2.3.6 to 2.3.12, specifically akka-contrib which contains akka-cluster, akka-remote and akka-peristance.
Turns out that the problem was actually occurring during the transition between akka 2.3.8 and 2.3.9. Looking at the change log, I found that between these two versions the Scala version was upgraded from 2.11.4 to 2.11.5.
My project was building on scala 2.11.4. Upgrading to 2.11.5 fixed the problem.
I couldn't find any help online for this, and lost a couple days trying to figure this out. I'm hoping that this will help someone else out.

Issue getting SBT to work on Mac OS X

I'm trying to use Miles Sabin's HList of his Shapeless project. So I installed sbt from Macports (this is version 0.11).
Unfortunately, when launching sbt, I have the following error message:
java.lang.IncompatibleClassChangeError: Expected static method scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Error during sbt execution: java.lang.IncompatibleClassChangeError: Expected static method scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
Search google seems to point that sbt-launch.jar would be in classpath. But even though I export CLASSPATH to "", I still have the issue.
I also directly downloaded the sbt-launch.jar from typesafe, and running with java -jar, with exactly the same problem.
Any idea? Other people having the same issue?
EDIT
I've tracked the problem down to a Java extension under ~/Library/Java/Extensions/scala-library.jar
I have removed it and the problem is gone. I think this has been installed by the TypeSafe stack (TBC).
I have had this error, and generally uninstalling Java, and installing it again will resolve it.
OP posted:
I've tracked the problem down to a Java extension under ~/Library/Java/Extensions/scala-library.jar
I have removed it and the problem is gone. I think this has been installed by the TypeSafe stack (TBC).

Compilation error: BUG! exception after Griffon project upgrade

I've working in a rich client with an Griffon 0.3.1 enviroment during the last couple of months.
That version is getting old and now I'm required to upgrade the project into a 0.9.3.
After doing:
griffon upgrade
And getting the latest releases of the required plugins I'm facing the following error:
Compilation error: BUG! exception in phase 'canonicalization' in source unit 'C:\maestro\desarrollo\projects\interactionManager\sgmentia-client\griffon-app\controllers\com\nortia\sgmentia\client\campaign\CampaignController.groovy' ClassNode#getTypeClass for com.nortia.sgmentia.business.Seleccion is called before the type class is set
There were no compilation errors before the upgrading after trying several things I haven't got a clue.
Thanks in advance.
Ivan.
Try upgrading to 0.9.4. There were some corner cases in previous versions due to the introduction of AST injection behavior. Also, don't forget to invoke the clean command right after upgrade.
After some research, I write my own conclusions in order to help anyone with the same problem.
There is a big leap between Griffon 0.3.x and Griffon 0.9.x, some Apis have changed dramatically and AST Injection has been introduced.
The following links MUST be read in order to understand what's going on:
http://griffon.codehaus.org/Griffon+0.9.2-rc1?print=1
http://dist.codehaus.org/griffon/guide/guide/9.%20Threading.html#9.3%20Annotation%20Based%20Threading
If upgrading the straight way has not worked for you, try first disabling Threading injection:
griffon.disable.threading.injection=true
Finally, once you get your code compiled you can try to clean your controllers step by step.
Hope it helps.

Scala 2.8.0 problems on Windows 7

I installed scala 2.8.0 last night and I seem to be having some issues getting it running. If I type scala at the command prompt it comes up with the following:
> scala
Exception in thread "main" java.lang.NoSuchMethodError: scala.collection.mutable.ListBuffer.toList()Lscala/collection/immutable/List;
at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:399)
at scala.collection.mutable.ArrayOps.toList(ArrayOps.scala:34)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:33)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Anyone have any ideas? I'm on Windows 7 professional, with Oracle JRE 1.6.0_21
Did you set the SCALA_HOME environment variable to point to the correct directory?
Did you have an older version installed? If that's still on your path then it may be causing problems...
EDIT
Can you paste the contents of your PATH and CLASSPATH environment variables? Perhaps using pastie or pastebin if they're on the large side.
You should also update to Java 1.6.0_22 if at all possible, due to this bug which was present in update 21: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6969236
Turns out this problem occurred because I put the sbt-launch.jar in the lib directory for my scala installation. Once I moved it into another directory scala worked fine.