Error starting Sonar - intellij-idea

I'm using SONAR for my project.
While using "StartSonar.bat" for launch of Sonar, it is throwing the following exception.
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Error occurred during initialization of VM
jvm 1 | java/lang/NoClassDefFoundError: java/lang/Object
wrapper | JVM exited while loading the application.
wrapper | Launching a JVM...
jvm 2 | Error occurred during initialization of VM
jvm 2 | java/lang/NoClassDefFoundError: java/lang/Object
wrapper | JVM exited while loading the application.
wrapper | Launching a JVM...
jvm 3 | Error occurred during initialization of VM
jvm 3 | java/lang/NoClassDefFoundError: java/lang/Object
wrapper | JVM exited while loading the application.
wrapper | Launching a JVM...
jvm 4 | Error occurred during initialization of VM
jvm 4 | java/lang/NoClassDefFoundError: java/lang/Object
wrapper | JVM exited while loading the application.
wrapper | Launching a JVM...
jvm 5 | Error occurred during initialization of VM
jvm 5 | java/lang/NoClassDefFoundError: java/lang/Object
wrapper | JVM exited while loading the application.
wrapper | There were 5 failed launches in a row, each lasting less than 300 seconds.
Giving up.
wrapper | There may be a configuration problem: please check the logs.
wrapper | <-- Wrapper Stopped
Press any key to continue . . .
Using Java 1.7.0._09. Please help me in getting out of this.
Also, I tried configuring Sonar in IntelliJ IDEA 11 Community Edition. It fails in the startup of IDE. Are any plugins available for Community Edition to run Sonar.

what value do you have for the 'wrapper.java.command' in the wrapper.conf file? Seems like the is no JVM available

Are you sure you have installed a JDK, and not just the JRE?
Also Check JAVA_HOME is configured correctly. Make sure to set the JAVA_HOME environment variable to point to the JDK root folder.

Do one thing, go to <sonarDirectory>\conf and edit the wrapper.conf file and set these 2 lines:
wrapper.java.command=C:\Program Files\Java\jdk1.8.0_20\bin\java
#wrapper.java.command=java

Related

How to fix ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain in debug?

I am running several projects as spring boot applications, one of them specifically cannot start and is throwing:
java.lang.ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:304)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Exception in thread "main" FATAL ERROR in native method: processing of -javaagent failed
Disconnected from the target VM, address: '127.0.0.1:64279', transport: 'socket'
Process finished with exit code 1
The command line has the option:
-javaagent:[...].m2/repository/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.5.0/kotlinx-coroutines-core-1.5.0.jar
And this jar exists.
this happened after updating my Intellij'Idea to 2021.2
This issue happens only in debug mode.
Any idea how to solve this?
It is a known problem in the Kotlin plugin. As a workaround disable the coroutine agent option under Settings/Preferences | Build, Execution, Deployment | Debugger | Data Views | Kotlin | enable "Disable coroutine agent".
Please follow https://youtrack.jetbrains.com/issue/KTIJ-19345 , for updates.

Hyperledger besu with permissioning enabled error

I am using the quickstart network provided by Hyperledger besu, and I want to test and see how permissioning works with the permissioning management dapp. I use this repo: https://github.com/bretthenderson/besu-quickstart
So when I run the run-permissioning.sh script to build the dapp and run the test network everything works fine and the network starts succesfully then when I run the run-permissioning-dapp.sh script it works fine and it compiles and deploys the permissioning smart contracts then restarts the network with permissioning enabled but after that the bootnode container crashes with these logs :
2021-04-02 10:25:11.294+00:00 | main | INFO | KeyPairUtil | Loaded public key 0xc1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22 from /opt/besu/keys/key
Setting logging level to INFO
2021-04-02 10:25:42.930+00:00 | main | INFO | AbstractAltBnPrecompiledContract | Using LibEthPairings native alt bn128
2021-04-02 10:25:55.841+00:00 | main | INFO | SECP256K1 | Using native secp256k1
2021-04-02 10:25:55.933+00:00 | main | INFO | Besu | Starting Besu version: besu/v21.1.3/linux-x86_64/oracle_openjdk-java-11
2021-04-02 10:25:59.261+00:00 | main | WARN | Besu | --min-gas-price has been ignored because --miner-enabled was not defined on the command line.
2021-04-02 10:26:00.299+00:00 | main | INFO | Besu | Static Nodes file = /opt/besu/data/static-nodes.json
2021-04-02 10:26:00.322+00:00 | main | INFO | StaticNodesParser | StaticNodes file /opt/besu/data/static-nodes.json does not exist, no static connections will be created.
2021-04-02 10:26:00.351+00:00 | main | INFO | Besu | Connecting to 0 static nodes.
2021-04-02 10:26:00.368+00:00 | main | INFO | Besu | Security Module: localfile
2021-04-02 10:26:00.661+00:00 | main | INFO | DatabaseMetadata | Lookup database metadata file in data directory: /opt/besu/data
2021-04-02 10:26:01.646+00:00 | main | INFO | RocksDBKeyValueStorageFactory | Existing database detected at /opt/besu/data. Version 1
2021-04-02 10:26:03.790+00:00 | main | INFO | KeyPairUtil | Loaded public key 0xc1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22 from /opt/besu/keys/key
2021-04-02 10:26:04.310+00:00 | main | INFO | ProtocolScheduleBuilder | Protocol schedule created with milestones: [Petersburg: 0]
ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.8ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.8ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.8ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.8ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.8ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.8ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.8ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.8
Error: node permissioning contract at address 0x0000000000000000000000000000000000009999 does not match the expected interface version 1
I can't find anything about this error anywhere as hyperledger besu have a very small community...
The fix is to the issue is to add --permissions-nodes-contract-version=2 to your besu command line.
This is because in v 2.0.0 of permissioning smart contracts repo we changed the interface as per the changelog https://github.com/ConsenSys/permissioning-smart-contracts/releases/tag/v2.0.0
It is in the besu docs here https://besu.hyperledger.org/en/stable/HowTo/Limit-Access/Specify-Perm-Version/ but I have already reported this issue and it has been fixed on the documentation of on-chain permissioning tutorial.
you can find more details here
Github issue
Besu Docs
i'm facing the same issue even with --permissions-nodes-contract-version=2 is added, check my post here : https://ethereum.stackexchange.com/questions/132573/hyperledger-besu-onchain-permissioning-error

Mulesoft 3.8 | Error running the application | An internal error occurred during: "<projectname>" | org.eclipse.core.jobs

I am getting below error while running the Mule 3.8 project:
java.lang.NullPointerException
at org.mule.tooling.maven.ui.launch.MavenDeploymentStrategy.findFile(MavenDeploymentStrategy.java:123)
at org.mule.tooling.maven.ui.launch.MavenDeploymentStrategy.getResultingZipFile(MavenDeploymentStrategy.java:116)
at org.mule.tooling.maven.ui.launch.MavenDeploymentStrategy.packageZipFile(MavenDeploymentStrategy.java:104)
at org.mule.tooling.maven.ui.launch.MavenDeploymentStrategy.deployToEmbeddedInstance(MavenDeploymentStrategy.java:68)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.deployProjects(MuleRuntimeLaunchDelegate.java:608)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.performLegacyDeployment(MuleRuntimeLaunchDelegate.java:435)
at org.mule.tooling.runtime.launch.MuleRuntimeLaunchDelegate.launch(MuleRuntimeLaunchDelegate.java:327)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
and this is from Plug-in org.eclipse.core.jobs

Nexus 2 Repository Manager web failed to start

I have downloaded and installed Nexus 2 according to official guide.
Then run it. Nothing strange can't see in log files.
But when I can try to get web interface http://apphost:9990/nexus/, I see on the web page:
Directory: /nexus/
LICENSE.html 12043 bytes May 31, 2017 7:39:55 AM
WEB-INF/ 4096 bytes May 31, 2017 7:39:55 AM
favicon.ico 1150 bytes May 31, 2017 7:39:49 AM
favicon.png 1179 bytes May 31, 2017 7:39:49 AM
images/ 4096 bytes May 31, 2017 7:39:55 AM
robots.txt 86 bytes May 31, 2017 7:39:49 AM
It seems Java is not running correctly, because it shows just static content.
Screenshot
Java is installed:
[opt]$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
Nexus home:
echo $NEXUS_HOME
/opt/nexus
Log file:
jvm 1 | 2017-06-01 05:20:43,496-0700 DEBUG [jetty-main-1] *SYSTEM org.sonatype.nexus.NxApplication - Started
jvm 1 | 2017-06-01 05:20:43,496-0700 INFO [jetty-main-1] *SYSTEM org.sonatype.nexus.webapp.WebappBootstrap - Initialized
jvm 1 | 2017-06-01 05:20:43,552-0700 INFO [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.InstrumentedSelectChannelConnector - Metrics enabled
jvm 1 | 2017-06-01 05:20:43,570-0700 INFO [jetty-main-1] *SYSTEM org.eclipse.jetty.server.AbstractConnector - Started InstrumentedSelectChannelConnector#0.0.0.0:9990
jvm 1 | 2017-06-01 05:20:43,570-0700 INFO [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Running
jvm 1 | 2017-06-01 05:20:43,570-0700 INFO [WrapperListener_start_runner] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Started
jvm 1 | 2017-06-01 05:20:47,915-0700 DEBUG [HC4x-EvictingThread] *SYSTEM org.sonatype.nexus.apachehttpclient.Hc4ProviderImpl$ManagedClientConnectionManager - Closing expired connections
jvm 1 | 2017-06-01 05:20:47,916-0700 DEBUG [HC4x-EvictingThread] *SYSTEM org.sonatype.nexus.apachehttpclient.Hc4ProviderImpl$ManagedClientConnectionManager - Closing connections idle longer than 30000 MILLISECONDS
Thanks for any advice
I have resolved the issue.
I guess archive was corrupted.
Nexus were successfully run after complete reinstall.

How can I give the Intellij compiler more heap space?

When I make an Intellij project, I keep getting the following out of memory error.
I already increased my heap size in idea.vmoptions:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=64m
-ea
But I still get this error:
Information:The system is out of resources.
Information:Consult the following stack trace for details.
Information:java.lang.OutOfMemoryError: Java heap space
Information: at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139)
Information: at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
Information: at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1105)
Information: at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512)
Information: at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
Information: at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804)
Information: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:353)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:279)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:270)
Information: at com.sun.tools.javac.Main.compile(Main.java:69)
Information: at com.sun.tools.javac.Main.main(Main.java:54)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Information: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Information: at java.lang.reflect.Method.invoke(Method.java:597)
Information: at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:Compiler internal error. Process terminated with exit code 3
What am I missing?
Current version:
Settings (Preferences on Mac) | Build, Execution, Deployment | Compiler |
Build process heap size.
Older versions:
Settings (Preferences on Mac) | Compiler | Java Compiler | Maximum heap size.
Compiler runs in a separate JVM by default so IDEA heap settings that you set in idea.vmoptions have no effect on the compiler.
Since IntelliJ 2016, the location is File | Settings | Build, Execution, Deployment | Compiler | Build process heap size.
I had a similar problem with Ant build (started by hand from IDEA GUI). In my case there was the right solution to right click on the Ant task, choose properties and set a higher value to "Maximum heap space (Mb):" and "Maximum stack space (Mb):" input fields.
To resolve this issue follow the below given steps-
1). In inteli Go to File> Setting Option and Search for Vm Option In the field of Vm Option for Importer give value -Xmx512m.
Intelij Setting Options
2). Go to Control Pannel Select View by :Large icons then Go to Java one promp window will appear with name java control pannel then go to java
Java VM Options
select view option.
java view options
In Java Run time Environment Setting pass Run time Parameters as -Xmx1024m.
3). If above given options does not work then change the size of pom.xml
GWT in Intellij 12
FWIW, I was getting a similar error with my GWT application during 'Build | Rebuild Project'.
This was caused by Intellij doing a full GWT compile which I didn't like because it is also a very lengthy process.
I disabled GWT compile by turning off the module check boxes under 'Project Structure | Facets | GWT'.
Alternatively there is a 'Compiler maximum heap size' setting in that location as well.
I was facing "java.lang.OutOfMemoryError: Java heap space" error while building my project using maven install command.
I was able to get rid of it by changing maven runner settings.
Settings | Build, Execution, Deployment | Build Tools | Maven | Runner | VM options to -Xmx512m
In my case the error was caused by the insufficient memory allocated to the "test" lifecycle of maven. It was fixed by adding <argLine>-Xms3512m -Xmx3512m</argLine> to:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<argLine>-Xms3512m -Xmx3512m</argLine>
Thanks #crazycoder for pointing this out (and also that it is not related to IntelliJ; in this case).
If your tests are forked, they run in a new JVM that doesn't inherit Maven JVM options. Custom memory options must be provided via the test runner in pom.xml, refer to Maven documentation for details, it has very little to do with the IDE.
I like to share a revelation that I had. When you build a project, Intellij Idea runs a java process that resides in its core(ex: C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\jbr\bin). The "build process heap size", as mentioned by many others, changes the heap size of this java process. However, the main java process is triggered later by the Idea's java process, hence have different VM arguments. I noticed that the max heap size of this process is 1/3 of the Idea's java process, while min heap is the half of max(1/6). To round up:
When you set 9g heap on "build process heap size" the actual heap size for the compiler is max 3g and min 1,5g. And no need for restart is neccessary.
PS: tested on version 2020.3
On android studio 4.2 or newer Arctic fox version you will option under appearance & behavior
Windows: file > settings > appearance & behavior > system settings > memory settings
Mac: file > preferences > appearance & behavior > system settings > memory settings
https://i.stack.imgur.com/PEqBK.png
There is a
idea64.exe
starter in
IntelliJ IDEA 13.1.5\bin
so you can address more space.