NPE when running Sonar Runner - sonar-runner

When running Sonar Runner 2.4 against SonarQube 5.1 RC2 I get this error:
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.NullPointerException
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:98)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at sun.nio.fs.AbstractPath.resolve(AbstractPath.java:53)
at org.sonar.api.batch.fs.internal.DefaultInputFile.path(DefaultInputFile.java:72)
at org.sonar.api.batch.fs.internal.DefaultInputFile.file(DefaultInputFile.java:64)
at org.sonar.api.batch.fs.internal.PathPattern$RelativePathPattern.match(PathPattern.java:101)
at org.sonar.batch.scan.filesystem.LanguageDetection.isCandidateForLanguage(LanguageDetection.java:124)
at org.sonar.batch.scan.filesystem.LanguageDetection.language(LanguageDetection.java:97)
at org.sonar.batch.scan.filesystem.InputFileBuilder.completeAndComputeMetadata(InputFileBuilder.java:100)
at org.sonar.batch.scan.filesystem.FileIndexer$1.call(FileIndexer.java:157)
at org.sonar.batch.scan.filesystem.FileIndexer$1.call(FileIndexer.java:154)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Process exited with code 1
Step Start SonarQube Code Analysis (Command Line) failed
The same thing works with SonarQube 5.0.1.
Maybe some defensive programming would have been good in Sonar Runner. A NPE does not tell anything meaningful to a user. I suggest that they include an assertion and if there is a problem that a useful exception message is output.

Most likely some sonar property thats expected a directory were defined with something containing "..". Unfortunately, in my tests, sonar expects an absolut path. I had problems in sonar-ant-runner with sonar.sources, sonar.java.binaries and sonar.projectBaseDir properties.

Related

Run tim error java.lang.ClassNotFoundException: org.littlemonkey.connectivity.NativeConnectivityImpl

My app generates an error message java.lang.ClassNotFoundException: org.littlemonkey.connectivity.NativeConnectivityImpl. at runtime but not at the building process.
I have already imported the org.littlemonkey.connectivity.Connectivity.

[Zeppelin]Cannot call methods on a stopped SparkContext

When we use spark through zeppelin spark interpreter in share per note model, sometimes we get the following error info:
WARN [2019-11-11 13:37:29,610] ({pool-2-thread-16} NotebookServer.java[afterStatusChange]:2302) - Job 20191028-172705_1731645157 is finished, status: ERROR, exception: null, result: %text java.lang.IllegalStateException: Cannot call methods on a stopped SparkContext.
This stopped SparkContext was created at:
org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:925)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.apache.zeppelin.spark.BaseSparkScalaInterpreter.spark2CreateContext(BaseSparkScalaInterpreter.scala:233)
org.apache.zeppelin.spark.BaseSparkScalaInterpreter.createSparkContext(BaseSparkScalaInterpreter.scala:165)
org.apache.zeppelin.spark.SparkScala211Interpreter.open(SparkScala211Interpreter.scala:87)
org.apache.zeppelin.spark.NewSparkInterpreter.open(NewSparkInterpreter.java:102)
org.apache.zeppelin.spark.SparkInterpreter.open(SparkInterpreter.java:62)
org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:69)
org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:617)
org.apache.zeppelin.scheduler.Job.run(Job.java:188)
org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:140)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
The currently active SparkContext was created at:
(No active SparkContext.
we have reproduce this error info by the following steps:
create two notes, one is note A, the other is note B
for note A and B, run some paragraghs and see all succeeded
now, delete note A and then we run next paragragh in B, then the error happened
How can we solve this problem? is this a issue of zeppelin spark interpreter itself?
I have run into the same error message. From your description above I realized that I was running two Zeppelin instances with the same interpreter which were pointing to the same data sources (but different notebooks). On my side, I solved the issue by closing the second Zeppelin instance, and restarting my interpret.
I would suggest that you investigate the configs of your interpreter, being global or per user, to see if that may not be the cause of the problem.

Running Flink Program on a Remote Cluster

I have a program in Apache Flink. I tested and ran it on the local machine and every thing works fine. To run the program on a remote cluster, I did necessary changes as mentioned in Apache Flink Official Website.
I did the following changes:
The two points below
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
ExecutionEnvironment env = ExecutionEnvironment.createRemoteEnvironment("taskManagerName",
portNo,paralelismNo);
Fixing the necessary paths to read input files and write outputs.
Generate a thin jar out of the program and put the necessary jar
libraries into a folder besides my project jar file called
myproj.jar.
copying the data and the jar library and myproj.jar into the cluster
and run the following command remotely on the cluster:
java -cp pathToJarLib \\* -jar myproj.jar
But, I get the below error and I don't have any clue to fix the issue. There are no relevant log files which can aid me in fixing this issue.
Error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/api/common/functions/MapFunction
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
at java.lang.Class.getMethod0(Class.java:2813)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.api.common.functions.MapFunction
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
Your classpath is obviously not complete. Try to submit via bin/flink run myproj.jar. This sets up the classpath correctly.

tomcat 6 startup exception

I'm running tomcat6 on centos 6, keeps getting the following error in the log upon startup. I have a pretty standard out of the box configuration, it's a new install.
org.apache.catalina.mbeans.ServerLifecycleListener lifecycleEvent
SEVERE: destroyMBeans: Throwable
javax.management.MalformedObjectNameException: Cannot create object name for org.apache.catalina.connector.Connector#d02b2b6
at org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:764)
at org.apache.catalina.mbeans.MBeanUtils.destroyMBean(MBeanUtils.java:1416)
at org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:678)
at org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:1005)
at org.apache.catalina.mbeans.ServerLifecycleListener.destroyMBeans(ServerLifecycleListener.java:971)
at org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLifecycleListener.java:154)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:748)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
According to this tomcat6 bug report:
https://issues.apache.org/bugzilla/show_bug.cgi?id=48612
It is a bug in 6.0.24 (current for centos6) and fixed in subsequent versions. We'll have to wait for the fix to trickle down.
Whether there's a workaround is not specified. Whether it is actually SEVERE is not specified... Too bad.
If you install tomcat6-webapps package the error disappears, probably a missed dependency.

org.apache.jasper.JasperException: java.lang.IllegalStateException: No Java compiler available

I have Tomcat 6 when I getting start my server error context start form
SEVERE: Exception processing JAR at resource path /usr/share/java/jakarta-commons-pool-1.3.jar in context
java.util.zip.ZipException: error in opening zip file
When I request to any site it displays an error
org.apache.jasper.JasperException: java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
com.wvmagic.rf.filter.NoCacheFilter.doFilter(NoCacheFilter.java:73)
root cause
java.lang.IllegalStateException: No Java compiler available
org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:581)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:73)
com.wvmagic.rf.filter.NoCacheFilter.doFilter(NoCacheFilter.java:73)
I have tried lot, but cannot resolve the issue.
Please check this file: jasper-jdt.jar. If it doesn't exist in your /lib directory, than you should get one.
Probably means exactly what it says, you don't have a Java compiler. You need to install a SDK so that it can compile JSPs . Check for Java SDK and don't forget to set JAVA_HOME .
See this discussion for troubleshooting your problem.

Resources