Sonarlint NullPointException when using IBM JDK 8 - eclipse

I'm using IBM JDK 8 for Eclipse Mars (required to connect to WebSphere, Oracle JDK doesn't work). In the eclipse.ini, I added the following:
-vm
C:\IBM\eclipseDevelopmentPackage\ibm_sdk80\jre\bin\javaw.exe
When I run latest version sonarlint 1.2 (installed from eclipse marketplace), I got the following exception. Switch back to Oracle JDK 8, no issue. Any idea?
Also, is it possible to install sonarlint in RAD 8.5.5.1(Eclipse 3.6 based) ?
Sensor JavaSquidSensor
Configured Java source version (sonar.java.source): 6
JavaClasspath initialization...
JavaClasspath initialization done: 213 ms
JavaTestClasspath initialization...
JavaTestClasspath initialization done: 214 ms
Java Main Files AST scan...
1 source files to be analyzed
Error during analysis
org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : 'C:\workspace\........\Service.java'
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:126)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:100)
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:80)
at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:135)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:128)
at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:90)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:249)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:244)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:234)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:133)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:507)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy35.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:273)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
at org.sonarlint.eclipse.core.internal.jobs.SonarRunnerFacade.startAnalysis(SonarRunnerFacade.java:55)
at org.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob$1.run(AnalyzeProjectJob.java:254)
Caused by: java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
at org.sonar.java.se.ProgramState.decreaseReference(ProgramState.java:200)
at org.sonar.java.se.ProgramState.cleanupDeadSymbols(ProgramState.java:244)
at org.sonar.java.se.ExplodedGraphWalker.cleanUpProgramState(ExplodedGraphWalker.java:224)
at org.sonar.java.se.ExplodedGraphWalker.handleBlockExit(ExplodedGraphWalker.java:232)
at org.sonar.java.se.ExplodedGraphWalker.execute(ExplodedGraphWalker.java:175)
at org.sonar.java.se.ExplodedGraphWalker.visitMethod(ExplodedGraphWalker.java:130)
at org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:215)
at org.sonar.java.se.SymbolicExecutionVisitor.visitNode(SymbolicExecutionVisitor.java:41)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:89)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visitChildren(SubscriptionVisitor.java:115)
at org.sonar.java.ast.visitors.SubscriptionVisitor.visit(SubscriptionVisitor.java:91)
at org.sonar.java.ast.visitors.SubscriptionVisitor.scanTree(SubscriptionVisitor.java:72)
at org.sonar.java.ast.visitors.SubscriptionVisitor.scanFile(SubscriptionVisitor.java:65)
at org.sonar.java.model.InternalVisitorsBridge.visitFile(InternalVisitorsBridge.java:125)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:117)
... 33 more

Related

Error in starting Wildfly 8.0 server with JDK 1.8

I get this error when I start the server. I tried everything but still not sure what the cause is . Please help
Thanks
java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:119)
at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:338)
at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:291)
at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:300)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:542)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:300)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:262)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at org.jboss.modules.Main.main(Main.java:438)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:117)
... 17 more
Caused by: java.io.FileNotFoundException: C:\Program Files\wildfly-8.0.0.Final\wildfly-8.0.0.Final\standalone\log\boot.log (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:154)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:105)
at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:192)
at org.jboss.logmanager.handlers.FileHandler.<init>(FileHandler.java:122)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.<init>(PeriodicRotatingFileHandler.java:73)
... 22 more
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
The main error is this one:
Caused by: java.io.FileNotFoundException: C:\Program Files\wildfly-8.0.0.Final\wildfly-8.0.0.Final\standalone\log\boot.log
Check that the file exists and/or there are no permission restrictions which might stop Java from creating that file.
The final line in your question:
22 more Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Seems to suggest that WildFly 8.0 is not Java 8 certified. That is, it was not designed to run on Java 8 so, while there is every likelihood that it will start under Java 8, there may be some unexpected behaviour.
I would recommend that, if possible, you either upgrade your WildFly to the latest stable release (8.2 as of this date) or if that isn't possible, downgrade your Java version to 7.
Are you using windows 10?
Similar issue with windows10
If so, try starting the server through the Command Prompt (admin) rather than just normal cmd.
To access this, just right click Start and you will see it.
Thanks,
Ben

ANTLR Plugin in eclipse

sorry for my english! I install plagin in eclipse, but wen i run my little project i have this problem. Why its not work?
error(10): internal error: Can't get property indirectDelegates using
method get/isIndirectDelegates from org.antlr.tool.Grammar instance :
java.lang.NullPointerException
java.util.Objects.requireNonNull(Unknown Source)
java.util.ArrayList.removeAll(Unknown Source)
org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)
org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2620)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.antlr.stringtemplate.language.ASTExpr.invokeMethod(ASTExpr.java:564)
org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:515)
org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:417)
org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
org.antlr.stringtemplate.language.ActionEvaluator.templateApplication(ActionEvaluator.java:216)
org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:126)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.stringtemplate.language.ASTExpr.writeTemplate(ASTExpr.java:750)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:680)
org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:660)
org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149)
org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705)
org.antlr.codegen.CodeGenerator.write(CodeGenerator.java:1281)
org.antlr.codegen.Target.genRecognizerFile(Target.java:94)
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:466)
org.antlr.Tool.generateRecognizer(Tool.java:641)
org.antlr.Tool.process(Tool.java:454)
ANTLR 3 produces this message when used with Java 8. However, it doesn't seem to affect the actual output. Until the fix is released in a new version of ANTLR 3, you can either ignore the message, or use Java 7.
Related issue:
#151: NPE in CompositeGrammer.getIndirectDelegates in Java 8
I got a similar error running ANTLR 3.1.1 with Java 1.8. In my Ant Build file, I changed the attribute of the "java" task to "failonerror="false". I still got the error message, but my build stopped failing and produced the output that I wanted.
For java 8 and antlr 3, change the jar to "antlr-3.5.2-complete.jar" and the error will go away.
update the ANTLR plugin to version 2.1.2
Go to project properties-> ANTLR -> Building
Uncheck "Enable project specific settings"
Click "Configure Workspace Settings" -> ANTLR -> Builder -> Building
Remove the installed 3.5.2 package
Add installed packages and point it to the folder of "antlr-3.5.2-complete.jar"
Save and come back to enable project specific settings.
In the General-> ANTLR Runtime, select 3.5.2

JavaCV and parameters installation

After many research on internet about install JavaCV in Eclipse or Net Beans. I write this text because i do not found how fix my problem.
Java SE Developement kit update 10 ( I use JDK 1.7 )
OpenCV 2.4.2 (in c:\ )
JavaCV 0.2 bin (in c:\ )
JNA 3.4.0 (C:\javacv-bin\JNA)
Windows 7 32 bits.
Eclips IDE for Java Developers 32 bits.
Microsoft Visual C++ 2010 Redistributable Package (x86) installed
I created a new project in Eclipse.
I added in environement variables: C:\opencv\build\x86\vc10\bin; C:\opencv\build\common\tbb\ia32\vc10
Added all external library
I fixed dependency problems with depends.exe and added "IEShims.dll" because missing.
And now when i launch my program i have always his errors.
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\SweetLive\AppData\Local\Temp\jniopencv_core3957460997136742229.dll:
Can't find dependent libraries at
java.lang.ClassLoader$NativeLibrary.load(Native Method) at
java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939) at
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864) at
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825) at
java.lang.Runtime.load0(Runtime.java:792) at
java.lang.System.load(System.java:1059) at
com.googlecode.javacpp.Loader.loadLibrary(Loader.java:403) at
com.googlecode.javacpp.Loader.load(Loader.java:342) at
com.googlecode.javacpp.Loader.load(Loader.java:316) at
com.googlecode.javacv.cpp.opencv_core.(opencv_core.java:131)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
com.googlecode.javacpp.Loader.load(Loader.java:335) at
com.googlecode.javacv.cpp.opencv_imgproc.(opencv_imgproc.java:96)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
com.googlecode.javacpp.Loader.load(Loader.java:335) at
com.googlecode.javacv.cpp.opencv_objdetect.(opencv_objdetect.java:96)
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:264) at
com.googlecode.javacpp.Loader.load(Loader.java:335) at
com.googlecode.javacpp.Loader.load(Loader.java:316) at
com.googlecode.javacv.cpp.opencv_objdetect$CvHaarClassifierCascade.>(opencv_objdetect.java:175) at DetectVisage.main(DetectVisage.java:50)
For all this, i used:
http://code.google.com/p/javacv/wiki/Windows7AndOpenCV
http://www.cs.dartmouth.edu/~cs10/install/javacv-win/
And i can't see on blogspot because this website blocked in China (I'm foreign student in China)
Someone has an idea to solve my problem? thanx in advance.

facing issue with GWT designer mode

I'm working with Eclipse Helios 3.6 (32-bit). I installed the GWT plug-in and created a new Web application. In the Client folder I was trying to open a file with GWT designer, but unfortunately I was getting an error:
Internal Error encountered unexpected internal error. This could be caused by a bug or by a misconfiguration issue, conflict, partial update, etc.
java.lang.UnsupportedClassVersionError: Bad version number in .class file
Stack trace:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.loadImpl
(HostedModeSupport.java:110)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupport.<init>
(HostedModeSupport.java:83)
at com.google.gdt.eclipse.designer.hosted.tdt.HostedModeSupportFactory.create
(HostedModeSupportFactory.java:32)
at com.google.gdt.eclipse.designer.model.widgets.support.GwtState.getHostedModeSupport
(GwtState... (missing part here)
...org.eclipse.wb.internal.core.editor.errors.ExceptionComposite$3.widgetSelected
(ExceptionComposite.java:129)
--- etc
I have JavaCompiler in project properties 1.6 and from preferences->java->installed JDK/JRE using 1.6.
I am not sure of the specifics but most likely you are trying to run the designer with JDK 1.5. That is the cause of that error. I would recheck everything.
Also off the top of my head I would verify 32 bit versus 64 bit java sdk.
Generally when anything is wrong in JavaCompiler Project properties it will throw error of major/minor version 51.0 . So here most probably by checking the java version installed in the system and the version through which you are working are differnet. Make both of them compatible and the error will be solved.

Apache Sling - OSGI framework exception when starting in Windows

I received the following error message when starting Sling on Windows with Java 1.7 (see below). I'm using Sling 6 (http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-6-standalone.jar). Any idea what could be wrong?
Last time I tried using the same Sling version on Mac OSX and it worked perfectly.
Failed to Start OSGi framework
org.osgi.framework.BundleException: Uncaught Instantiation Issue:
java.lang.ArrayIndexOutOfBoundsException: -1
at
org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:245)
at
org.apache.sling.launchpad.base.app.MainDelegate$1.<init>(MainDelegate.java:159)
at
org.apache.sling.launchpad.base.app.MainDelegate.start(MainDelegate.java:159)
at org.apache.sling.launchpad.app.Main.startSling(Main.java:244)
at org.apache.sling.launchpad.app.Main.<init>(Main.java:107)
at org.apache.sling.launchpad.app.Main.main(Main.java:56)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at
org.apache.felix.framework.BundleImpl.getCurrentModule(BundleImpl.java:1046)
at
org.apache.felix.framework.BundleImpl.getSymbolicName(BundleImpl.java:863)
at
org.apache.sling.launchpad.base.impl.SlingFelix.getSymbolicName(SlingFelix.java:32)
at org.apache.felix.framework.Felix.toString(Felix.java:1012)
at org.apache.felix.framework.Logger.doLog(Logger.java:128)
at org.apache.felix.framework.Logger._log(Logger.java:181)
at org.apache.felix.framework.Logger.log(Logger.java:114)
at
org.apache.felix.framework.ExtensionManager.<init>(ExtensionManager.java:201)
at org.apache.felix.framework.Felix.<init>(Felix.java:374)
at
org.apache.sling.launchpad.base.impl.SlingFelix.<init>(SlingFelix.java:39)
at
org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:235)
I had exactly the same error when using java 1.7. After switching to 1.6 everything seems to be fine. You check your java version by typing java -version in the terminal.