Griffon JMX Plugin 0.3 don't work.(update descript) - groovy

Griffon JMX Plugin 0.3 don't work.
anyone use this version
1.got error: no lib folder
then i download the src, cp lib/griffon-jmx-addon-0.3.jar
2.create a service
class SmsManagerService {
static expose = ['jmx:service=Country,type=special']
def serviceMethod() {
"a"
}
}
3.run-app && connect by jconsole, by did not find my mbean.
am i missing some step? plz help,thanks

Andres Almiray :
1 fixed in version 0.4 of the plugin
2 you are selection the wrong Java process. You must select the process that runs the application (griffon.swing.SwingApplication) not the one that runs the griffon command (o.c.g.GriffonMain).
3 JmxGriffonAddon and JmxGriffonPlugin are the only sources needed by the plugin

Related

How to configure plugin verifier as it runs during JetBrains Marketplace admission?

Can you advise how to configure the plugin verifier so it would return errors as JetBrains marketplace does, please?
Error from the marketplace:
[plugin] depends on plugin com.jetbrains.php that couldn't be resolved with respect to IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4)
Note that the [plugin] cannot be installed into IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4) without mandatory com.jetbrains.php
Found 1 incompatibility with IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4), some of which may be caused by the missing dependencies.
When running runPluginVerifier locally everything is fine:
2020-12-11T13:01:29 [main] INFO verification - Finished 1 of 2 verifications (in 3.1 s): IU-202.8194.7 against com.lokalise.jetbrainsideplugin:1.0.0-alpha: Compatible
2020-12-11T13:01:30 [main] INFO verification - Finished 2 of 2 verifications (in 3.6 s): PS-202.6948.87 against com.lokalise.jetbrainsideplugin:1.0.0-alpha: Compatible
I would like to catch such an error during CI at most instead of throwing the plugin at the marketplace team.
Here is the gradle task configuration (Kotlin):
import org.jetbrains.intellij.tasks.RunPluginVerifierTask
...
tasks.runPluginVerifier {
ideVersions("PS-202.6948.87,IU-202.8194.7")
setFailureLevel(RunPluginVerifierTask.FailureLevel.ALL)
}
I struggled with it quite a bit. Found it.
tasks {
runPluginVerifier {
ideVersions.set(listOf("PS-202.6948.87","IU-202.8194.7"))
}
...
}

Unable to run JaCaMo project: how to configure it properly?

I already have a jason project which is running well in Jason and now I am trying to run using JaCaMo. I have both plugins (Jason and JaCaMo) in eclipse. What I am trying to do is in a simple way to compile this current Jason project in JaCaMo for further improvements.
My mas2j file which is running well:
MAS tp_cnp {
infrastructure: Centralised
agents:
i initiator [beliefs="expectedResponses(2)"] #2;
p participant #2;
r rejector #1;
c controller [beliefs="expectedDones(2)"] #1;
aslSourcePath:
"src/asl";
}
The jcm I've created:
mas tp_cnp {
agent i : initiator {
beliefs: message("expectedResponses(2)"),
instances: 2
}
agent p : participant {
instances: 2
}
agent r : rejector
agent c : controller {
beliefs: message("expectedDones(2)"),
}
asl-path: src/asl
}
When I've tryed to run this JaCaMo project the system returned this:
BUILD SUCCESSFUL
Total time: 2 seconds
Launching tp_cnp
reading from file /home/cleber/Projetos/tp_cnp/tp_cnp.jcm ...
JaCaMo is not configured, creating a default configuration.
Wrong configuration for jacamo, current is null
jacamo not found
Wrong configuration for jason, current is null
jason not found
Wrong configuration for jade, current is null
jade not found
Wrong configuration for jason, current is null
jason not found
file /home/cleber/Projetos/tp_cnp/tp_cnp.jcm parsed successfully!
Ant is not properly configured! Current value is /libs
Problem defining the command to run the MAS!
How to configure JaCaMo properly? Is this "translation" (mas2j to jcm) right?
you can configure JaCaMo by running jacamo-XXX.jar application (where XXX is the version). You can either double click on the jar file or run
java -jar jacamo-XXX.jar
You find more details in the JaCaMo "hello world" tutorial, where links for configuring the eclipse plugin or the shell command environment are provided.
Regarding your .jcm file, file names (after ":") must include the .asl:
...
agent i : initiator.asl {
beliefs: message("expectedResponses(2)"),
instances: 2
}
Best,
Jomi

How to show full compile error messages info in Checker FrameWork with line numbers etc

I just started using Checker Framework and have a problem that is exactly reproducible on one of the example projects from authors of this framework. This project is available here:
https://github.com/typetools/checker-framework/tree/master/docs/examples/GradleExamples
When i run this command from root:
>gradle compileJava
i receive this compilation output:
public static /*#Nullable*/ Object nullable = null;
^
required: #Initialized #NonNull Object
list.add(null); // error on this line
^
required: #Initialized #NonNull String
2 errors
:compileJava FAILED
As you can see there is no any information about where errors occur like class name, line number in code etc.
I did not find any information in their official manual about any compiler parameters that can change output format appropriately. I want error messages look like this:
~\GradleExample.java:33 error: ';' expected
UPDATE:
I achieve this behaviour on 3 machines:
OS: Microsoft Windows 7 x64 Ultimate SP1 [version 6.1.7601];
Java: 1.8.0_73;
Gradle: 2.14.
OS: Microsoft Windows 10 x64 Pro [version 10.0.14393];
Java: 1.8.0_121;
Gradle: 3.4.1.
OS: Microsoft Windows 7 x64 Ultimate SP1 [version 6.1.7601];
Java: 1.8.0_121;
Gradle: 3.4.1.
The absence of line numbers and class names is experienced only when running with Gradle. I also tried to run checker with Maven and with Javac from command line and it worked perfectly.
To configure Checker Framework with Gradle i followed steps from manual. There are 3 steps:
Download framework;
Unzip it to create a checker-framework directory;
Configure Gradle to include Checker Framework on the classpath.
As i understand, Gradle will do steps 1 and 2 automatically when providing needed Checker Framework's jars through dependency management. Nevertheless i tried both options:
dependency management:
I simply downloaded example project and executed "gradle compileJava" from root
of the GradleJava7Example project.
manually writing paths in gradle build file:
allprojects {
tasks.withType(JavaCompile).all { JavaCompile compile ->
compile.options.compilerArgs = [
'-processor', 'org.checkerframework.checker.nullness.NullnessChecker',
'-processorpath', "C:\\checker-framework-2.1.10\\checker\\dist\\checker.jar",
"-Xbootclasspath/p:C:\\checker-framework-2.1.10\\checker\\dist\\jdk8.jar",
'-classpath', 'C:\\checker-framework-2.1.10\\checker\\dist\\checker.jar;C:\\checker-framework-2.1.10\\checker\\dist\\javac.jar'
]
}
}
I've found a workaround. I'll explain it later, but now if somebody has the same problem, add this line to you JavaCompile tasks configuration:
allprojects {
tasks.withType(JavaCompile).all { JavaCompile compile ->
System.setProperty("line.separator", "\n") // <<<<<< add this line
compile.options.compilerArgs = [
'-processor', 'org.checkerframework.checker.nullness.NullnessChecker',
'-processorpath', "${configurations.checkerFramework.asPath}",
"-Xbootclasspath/p:${configurations.checkerFrameworkAnnotatedJDK.asPath}"
]
}
}
First of all i must say that problem was not in Checker Framework at all. I managed to reproduce the same behavior as mentioned in question without Checker Framework. I have created a little custom Annotation Processor. Here is the code:
#SupportedSourceVersion(value = SourceVersion.RELEASE_8)
#SupportedAnnotationTypes(value = {"*"})
public class MyProcessor extends AbstractProcessor{
#Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
String sepr = System.getProperty("line.separator");
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "[error code] " + sepr + " catched!!!");
return true;
}
}
As you can see, all it does is printing a message right away from start. Note that i used a line separator provided by java.lang.System class to split message. When i registered this processor and tried to run "gradle compileJava" from gradle project it produced the following output:
:compileJava
catched!!!
1 error
:compileJava FAILED
The property "line.separator" for Windows OS returns CR+LF: "\r\n". I don't know why Messager.printMessage(Diagnostic.Kind kind, CharSequence msg) has this behaviour, because when i type System.err.print("[error code] " + sepr + " catched!!!") instead, everything works fine (note also that this problem occur only when i use Gradle, if i run manually javac with all arguments or use Maven everyting is fine).
I found that if i substitude the provided by system separator with simple "\n" symbol compiler error messages are displayed correctly.
For now i choose this solution as a workaround.

Cassandra source code ConfigurationException expection URI in cassandra.config found cassandra.yaml

For my master thesis, I have to modify the source code of Cassandra. So, as suggested by https://wiki.apache.org/cassandra/HowToBuild, I git clone, then run ant, and everything seems nice (I managed to build the project without any error), but when I run the unitTests (cassandra/test), I have this strange error:
org.apache.cassandra.exceptions.ConfigurationException:
Expecting URI in variable: [cassandra.config].
Found[cassandra.yaml].
Please prefix the file with [file:\\\] for local files and
[file:\\<server>\] for remote files.
If you are executing this from an external tool, it needs
to set Config.setClientMode(true) to avoid loading configuration.
at org.apache.cassandra.config.YamlConfigurationLoader.getStorageConfigURL(YamlConfigurationLoader.java:80)
at org.apache.cassandra.config.YamlConfigurationLoader.loadConfig(YamlConfigurationLoader.java:100)
at org.apache.cassandra.config.DatabaseDescriptor.loadConfig(DatabaseDescriptor.java:252)
at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:131)
at org.apache.cassandra.auth.jmx.AuthorizationProxyTest.setup(AuthorizationProxyTest.java:48)"
I would like to test my modifications on the source code with the unitTests (because I didn't find any tutorial of how to set up cassandra from the source code on Windows, so if you have one, I would like to have the link ^^) but I didn't manage to find any solution for this bug :(. Anyone know a solution to this problem?
I am working on Windows 10 with IntelliJ and I have updated my Jdk and ant to the latest version.
I was facing the same issue. Those variables ("cassandra.config", "cassandra.storagedir", etc...) are System variables.
You can either set them in your code by doing something like:
System.setProperty("cassandra.config", "file:///<PATH>/cassandra.yaml");
You can also set them whilst running the jar file:
java -Dcassandra.config=file:///<PATH>/cassandra.yaml -jar <JAR>
Best,
Shabir
Start a new process in jdk 1.8 and start embedded cassandra in it. and run your junit in your java version. I faced similar isue which jdk11 upgrade. Now i fixed this.
import org.cassandraunit.utils.EmbeddedCassandraServerHelper;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class EmbeddedCassandraApplication {
public static void main(String[] args) throws Exception {
EmbeddedCassandraServerHelper.startEmbeddedCassandra("cassandra-test.yaml");
}
}

Which is the environment variable for Mono/C# library DLLs?

I'm running the frozen Debian 7.0 Testing/Wheezy.
Here is my C# sample code:
using System.Windows.Forms;
using System.Drawing;
public class Simple : Form
{
public Simple()
{
Text = "Simple";
Size = new Size(250, 200);
CenterToScreen();
}
static public void Main()
{
Application.Run(new Simple());
}
}
I got the above C# WinForms code sample working in Monodevelop by using the System.Drawing and System.Windows.Forms references as well as in the command line when compiling with the following command:
mcs /tmp/Simple.cs -r:/usr/lib/mono/4.0/System.Windows.Forms.dll \
-r:/usr/lib/mono/4.0/System.Drawing.dll
I'm trying to make the mcs command work without needing to use the -r switch/parameter (which, by the way, I cannot find information on by looking through man mcs - I basically found this switch/parameter on some random website and it worked).
To check if it worked temporarily, I issued
export PATH=$PATH:/usr/lib/mono/4.0/System.Windows.Forms.dll:/usr/lib/mono/4.0/System.Drawing.dll
prior to issuing mcs /tmp/Simple.cs, which failed with the errors within the following output:
deniz#debian:~$ cd /tmp
deniz#debian:/tmp$ export PATH=$PATH:/usr/lib/mono/4.0/System.Windows.Forms.dll:/usr/lib/mono/4.0/System.Drawing.dll
deniz#debian:/tmp$ mcs Simple.cs
Simple.cs(1,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Simple.cs(2,14): error CS0234: The type or namespace name `Drawing' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 2 error(s), 0 warnings
deniz#debian:/tmp$
The above output tells me that the mcs compiler/utility is not seeing the dll files but I don't know what else to try.
Any help in getting the WinForms and Drawing libraries to be automatically “looked at” would be greatly appreciated!
I'm trying to make the mcs command work without needing to use the -r switch/parameter
This is not possible, mcs will not look for libraries unless you tell it to look for them (which is done with -r:...).

Resources