Does groovy run on jamvm? - groovy

I wanted to run groovy on jamvm in an embedded hardware. The following is what I have tried, but nothing works.
1)
$GROOVY_HOME/bin/groovy ...
It complains that JAVA_HOME is not set. Since JamVm is a standalone executable, how, if possible, to set JAVA_HOME in JamVM? If the problem reduces to setting that, it's easy to solve.
2)
jamvm -cp $GROOVY_HOME/embedded/embeddable/groovy-all-2.0.5.jar:. TestClass
I ran the example in http://groovy.codehaus.org/Embedding+Groovy ('full example' part) and got the following exception. I ran the same example on Mac, it was fine.
Exception in thread "main" BUG! exception in phase 'semantic analysis' in source unit '/root/test/Tester.groovy' 0
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:907)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:566)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:515)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:244)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:185)
at TestClass.main(TestClass.java:8)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:396)
3) I tried
java -cp ../groovy-2.0.5/embeddable/groovy-all-2.0.5.jar groovy.lang.GroovyShe
ll <script.groovy>
didn't work, got the following
java.lang.ExceptionInInitializerError
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107)
Please suggest a way to run groovy on jamvm. Thanks!

JAVA_HOME is an environment variable. You can set this one by using the command "export". ExceptionInInitializerError means it could not create a class. To actually know the problem, we would need the embedded exception

Related

CDIIntegrationService errors were found when Weblogic upgrade from 12.1.2 to 12.1.3

I have upgraded Weblogic version in linux server by changing the wl_home path in the setDomainEnv.sh for 12.1.2 to 12.1.3 and restart. when restarting it gives below errors.
Appreciate if anyone can give idea about this.
java.lang.IllegalAccessError: tried to access method com.bea.logging.LogBufferHandler.bufferLogObject(Ljava/lang/Object;)V from class weblogic.logging.log4j.WLLog4jMemoryBufferAppender
java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.diagnostics.lifecycle.LoggingServerService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.diagnostics.lifecycle.DiagnosticFoundationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.diagnostics.lifecycle.DiagnosticFoundationService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.oracle.injection.integration.CDIIntegrationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on com.oracle.injection.integration.CDIIntegrationService
Use the wllog4j.jar which is part of WLS 12.1.3 build. The one part of WLS_HOME/server/lib diretory.
If your domains-home/lib folder holds older wllog4.jar which was part of 12.1.2 then you will face this issue

Execution Error when change the SATSolver from SAT4J to MiniSAT

In my Java code, when i change the SATSolver from SAT4J to MiniSatJNI or MiniSatProverJNI in:
A4Options options = new A4Options();
options.solver = A4Options.SatSolver.SAT4J;
For instance, to:
A4Options options = new A4Options();
options.solver = A4Options.SatSolver.MiniSatProverJNI;
And then call:
A4Solution currentAns = TranslateAlloyToKodkod.execute_command(null,
javaMetamodel.getAllReachableSigs(), command, options);
I receive the following execution error:
Fatal error:
The required JNI library cannot be found: java.lang.UnsatisfiedLinkError: no minisatproverx5 in java.library.path
at edu.mit.csail.sdg.alloy4compiler.translator.TranslateAlloyToKodkod.execute_command(TranslateAlloyToKodkod.java:390)
at ejdolly.JDollyImp.initializeAlloyAnalyzer(JDollyImp.java:128)
at ejdolly.JDolly.hasNext(JDolly.java:181)
at org.testorrery.ForLoopIterator.hasNext(ForLoopIterator.java:40)
at refactoringTest.RefactoringTest.runTests(RefactoringTest.java:145)
at refactoringTest.MainRunner.main(MainRunner.java:83)
Caused by: java.lang.UnsatisfiedLinkError: no minisatproverx5 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at kodkod.engine.satlab.NativeSolver.loadLibrary(NativeSolver.java:73)
at kodkod.engine.satlab.MiniSatProver.<clinit>(MiniSatProver.java:148)
at kodkod.engine.satlab.SATFactory$5.instance(SATFactory.java:106)
at kodkod.engine.fol2sat.Bool2CNFTranslator.translate(Bool2CNFTranslator.java:55)
at kodkod.engine.fol2sat.Translator.toCNF(Translator.java:426)
at kodkod.engine.fol2sat.Translator.generateSBP(Translator.java:365)
at kodkod.engine.fol2sat.Translator.toBoolean(Translator.java:343)
at kodkod.engine.fol2sat.Translator.translate(Translator.java:189)
at kodkod.engine.fol2sat.Translator.translate(Translator.java:143)
at kodkod.engine.Solver$SolutionIterator.next(Solver.java:495)
at kodkod.engine.Solver$SolutionIterator.next(Solver.java:1)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution$Peeker.<init>(A4Solution.java:719)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution$Peeker.<init>(A4Solution.java:709)
at edu.mit.csail.sdg.alloy4compiler.translator.A4Solution.solve(A4Solution.java:941)
at edu.mit.csail.sdg.alloy4compiler.translator.TranslateAlloyToKodkod.execute_command(TranslateAlloyToKodkod.java:388)
... 5 more
java.lang.NullPointerException
at ejdolly.JDolly.hasNext(JDolly.java:182)
at org.testorrery.ForLoopIterator.hasNext(ForLoopIterator.java:40)
at refactoringTest.RefactoringTest.runTests(RefactoringTest.java:145)
at refactoringTest.MainRunner.main(MainRunner.java:83)
Any help?
The solution pointed by #Aleksandar in:
Alloy API resulting in java.lang.UnsatisfiedLinkError
worked for me on linux!!! But it does not work on windows.
Thank you for all the help !
Alloy invokes native solvers (such as MiniSAT) by using JNDI/JNI. That means that the native libraries must be correctly configured before. If you do not have the library correclty configured, Java will produce a "java.lang.UnsatisfiedLinkError" exception.
The Alloy distributable jar includes correctly configured libraries for Windows "x86" and for Linux and Mac in "x86" and "x64". That means that the jar will work in Windows, without any additional configuration, if you are using the Java 32 bits, but not with Java 64 bits. In the other operating systems you can use both Java versions (32 and 64 bits).
You may check other questions in StackOverflow for the same explanation.

Spark JobServer NullPointerException

I'm trying to start a spark jobserver, here are the steps I'm following:
I configure the local.sh based on the template.
Then I run ./bin/server_deploy.sh and it finishes without any error.
Configure local.conf.
Run ./bin/server_start.sh in the deploy server.
But when I do the last step I get the following error:
Error: Exception thrown by the agent : java.lang.NullPointerException
Note: I'm using spark 1.4.1. I'm using version 0.5.2 from jobserver (https://github.com/spark-jobserver/spark-jobserver/tree/v0.5.2)
Any idea in how I can fix this (or at least debug it).
Thanks
The error log does not provide much information.
I encountered the same error. For my case, I had another instance of the JobServer running (and somehow ./bin/server_stop.sh did not catch it). It works after I manually killed the other process.
Hint : Error: Exception thrown by the agent : java.lang.NullPointerException when starting Java application

Cassandra 2.1.8: Node refuses to start with NPE in removeUnfinishedCompactionLeftovers

I am trying to upgrade a Cassandra 2.1.0 cluster to 2.1.8 (latest release).
When I start a first node with 2.1.8 runtime, I get an error and the node refuses to start.
This is the error's stack trace :
org.apache.cassandra.io.FSReadError: java.lang.NullPointerException
at org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:642) ~[apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:302) [apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:524) [apache-cassandra-2.1.8.jar:2.1.8]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:613) [apache-cassandra-2.1.8.jar:2.1.8]
Caused by: java.lang.NullPointerException: null
at org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:634) ~[apache-cassandra-2.1.8.jar:2.1.8]
... 3 common frames omitted
FSReadError in Failed to remove unfinished compaction leftovers (file: /home/nudgeca2/datas/data/main/segment-97b5ba00571011e49a928bffe429b6b5/main-segment-ka-15432-Statistics.db). See log for details.
at org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:642)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:302)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:524)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:613)
Caused by: java.lang.NullPointerException
at org.apache.cassandra.db.ColumnFamilyStore.removeUnfinishedCompactionLeftovers(ColumnFamilyStore.java:634)
... 3 more
Exception encountered during startup: java.lang.NullPointerException
The cluster has 7 nodes and it turns on AWS Linux EC2 instances.
The node I try to upgrade was stopped after a nodetool drain.
Then I tried to come back to 2.1.0 runtime but I now get a similar error.
I also tried to stop and start another node and everything was ok, the node restarted without any problem.
I tried to touch the missing file (as it should be removed, I thought it would perhaps not need a specific content). I had two other files with the same error that I also touched. And finally the node fails further while trying to read these files.
Anyone has any idea what I should do ?
Thank you for any help.
It might be worth opening a Jira for that issue, so if nothing else, they can catch the NPE and provide a better error message.
It looks like it's trying to open:
file: /home/nudgeca2/datas/data/main/segment-97b5ba00571011e49a928bffe429b6b5/main-segment-ka-15432-Statistics.db
It's possible that it's trying to read that file because it finds the associated data file: (/home/nudgeca2/datas/data/main/segment-97b5ba00571011e49a928bffe429b6b5/main-segment-ka-15432-Data.db). Does that data file exist? I'd be tempted to move it out of the way, and see if it starts properly.

i installed maven in my locale. i was run the demositecommerce project but i get the exception

i installed maven in my locale. i was run the demositecommerce project but i get the exception
my maven paths are:
JAVA_HOME:C:\Program Files\Java\jdk1.7.0\jre
M2_HOME:C:\Program Files\apache-maven-3.3.1
PATH:C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\apache-maven-3.3.1\bin;
whenever i run the jetty-demo i get the Exception
cause Exception:
Buildfile: C:\eclipse-workspace\DemoSite\site\build.xml
start-db:
[echo] Starting Data Base...
jetty-demo:
[artifact:mvn] Listening for transport dt_socket at address: 8000
[artifact:mvn] -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
[artifact:mvn] Java Result: 1
BUILD SUCCESSFUL
Total time: 3 seconds
how can i solve this pls tell me
This seems to be a common problem with Maven 3.3 projects run from Eclipse which can be fixed by explicitly passing the maven.multiModuleProjectDirectory property to the JVM.
So in your case, to fix this error, try to edit the jetty-demo ant task in your site/build.xml file and add the following JVM argument:
<jvmarg value="-Dmaven.multiModuleProjectDirectory=$M2_HOME" />

Resources