I installed SonarQube 6.1 with MSBuild.SonarQube.Runner-2.2.0.24 to analyse a C# solution. When I run an analysis, I get the following error:
WARN: SCM provider autodetection failed. No SCM provider claims to
support this project. Please use sonar.scm.provider to define SCM of
your project.
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Start pointer [line=90,
lineOffset=89] should be before end pointer [line=90, lineOffset=89]
at
org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at
org.sonar.api.batch.fs.internal.DefaultInputFile.newRangeValidPointers(DefaultInputFile.java:254)
at
org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:238)
at
org.sonarsource.dotnet.shared.plugins.AbstractSensor$SarifParserCallbackImplementation.onIssue(AbstractSensor.java:144)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleAnalysisTargetElement(SarifParser01And04.java:109)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleIssue(SarifParser01And04.java:73)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.handleIssues(SarifParser01And04.java:55)
at
org.sonarsource.dotnet.shared.sarif.SarifParser01And04.parse(SarifParser01And04.java:43)
at
org.sonar.plugins.csharp.CSharpSensor.importRoslynReport(CSharpSensor.java:183)
at
org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:118)
at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:85)
at
org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at
org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
at
org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
at
org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at
org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at
org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
at
org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
at
org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)
at
org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47) at
org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at
org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at
org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at
org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118) at
org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source) at
org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at
org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110) at
org.sonarsource.scanner.cli.Main.execute(Main.java:74) at
org.sonarsource.scanner.cli.Main.main(Main.java:61) ERROR: ERROR:
Re-run SonarQube Scanner using the -X switch to enable full debug
logging. The SonarQube Scanner did not complete successfully
08:42:09.074 Post-processing failed. Exit code: 1
When I start the SonarQube Scanner with the -X like it was recommended in the error message, I get this:
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.238 Unrecognized command line argument: -X
2016-11-14T14:33:27.2720044Z ##[error]15:33:27.261 Expecting at least the following command line argument:
2016-11-14T14:33:27.2730045Z ##[error]- SonarQube project key
2016-11-14T14:33:27.2730045Z ##[error]When connecting to a SonarQube server earlier than version 6.1, the following command line arguments are also required:
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project name
2016-11-14T14:33:27.2740046Z ##[error]- SonarQube project version
2016-11-14T14:33:27.2750047Z ##[error]The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
2016-11-14T14:33:27.2750047Z ##[error]15:33:27.261 Pre-processing failed. Exit code: 1
I start the scanner with:
SonarQube.Scanner.MSBuild.exe begin /k:ProjectKey /n:ProjectName /v:4.0.70
The end command is
SonarQube.Scanner.MSBuild.exe end
Start is definively called before end.
What could be wrong?
I've stumbled in the same trouble and it could be caused by a not UTF-8 or a BOM enabled UTF-8 encoding, see here for reference:
Analysis of Visual Studio Solutions containing some C# source files using a non UTF-8 encoding fails
As a possible WA waiting for a fix, try to force source encoding to UTF-8 and, if not enough, to explicitly convert your sources to BOM-less UTF-8 encoding.
I have same problem and I found some issue in the code source.
public class Myclass : BaseClass
{
public Myclass(OtherClass inputs) : base() => Initialize(); //OK
public Myclass(OtherClass inputs) : base() => Initialize(inputs); //NOK
//Sonar cannot analyze this method because of arguments insides Initiliaze //method with inline method only when I use : base(...) => Func(With Arguments);
//Solution is
public Myclass(OtherClass inputs) : base()
{
Initialize(inputs);}
}
}
Related
I'm writing a library based on code generation.
This library generating dagger's module via annotations. How do I run my annotation processor before dagger's code generation?
Now it crashes on build because dagger trying to build the component before modules was generated.
Error:
.ktC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:6: error: cannot find symbol
#dagger.Component(modules = {BookModule.class})
^
symbol: class BookModuleC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:7: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface AppComponent {
^Attempt to reopen a file for path C:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\generated\source\kapt\debug\dev\syncended\blade\BookModule.kt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
So, I'm attempting to build a simple JavaFX application in Apache Netbeans 11.1 using the non-modular from IDE instructions from this site:
https://openjfx.io/openjfx-docs/
I'm using JDK 13 and JavaFX 13.
The instructions work up until the point when they tell you to modify the VM options under Properties --> Run. I add the --module-path and --add-modules arguments as indicated, but still get an error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Ant set to Verbose using Tools-->Options-->Java-->Ant, verbosity level set to verbose.
Output with verbose:
Detected Java version: 13 in: D:\Programs\JavaStuff\jdk-13
Detected OS: Windows 10
Trying to override old definition of task java
Trying to override old definition of task input
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/extide/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
Trying to override old definition of task javac
Trying to override old definition of task delete
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/profiler/ant/nblib/org-netbeans-modules-profiler-nbimpl.jar!/org/netbeans/modules/profiler/nbimpl/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files/NetBeans-11.1/netbeans/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml with URI = file:/C:/Users/BLAHBLAH/AppData/Local/NetBeans/Cache/11.1/executor-snippets/run.xml
Project base dir set to: C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets
Build sequence for target(s) `run' is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run]
Complete build sequence is [-init-paths, -init-macrodef-java-with-modules, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-modules, run, ]
-init-paths:
Override ignored for property "run.jvmargs"
Override ignored for property "work.dir"
Override ignored for property "application.args"
-init-macrodef-java-with-modules:
Skipped because property 'named.module.internal' not set.
-init-macrodef-java-with-unnamed-module:
creating macro call-java
-init-macrodef-java-without-modules:
Skipped because property 'modules.supported.internal' set.
run:
Executing 'D:\Programs\JavaStuff\jdk-13\bin\java.exe' with arguments:
'-Dfile.encoding=UTF-8'
'--module-path=D:\Programs\JavaStuff\javafx-sdk-13\lib\'
'--add-modules=javafx.controls,javafx.fxml'
'-classpath'
'D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx-swt.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.base.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.controls.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.fxml.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.graphics.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.media.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.swing.jar;D:\Programs\JavaStuff\javafx-sdk-13\lib\javafx.web.jar;C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'--module-path'
'C:\Users\BLAHBLAH\OneDrive\Documents\NetBeansProjects\HelloFX1\build\classes'
'hellofx.HelloFX'
The ' characters around the executable and arguments are
not part of the command.
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.controls not found
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\BLAHBLAH\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:68: Java returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:566)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 0 seconds)
Any ideas?
I appreciate the responses I received - they helped me to do more research and document a solution thoroughly for myself, my colleagues, and my students.
So, I hope that this will help others who are receiving similar errors and issues while trying to install OpenJDK, NetBeans 11.1, OpenJFX (Open JavaFX), and Scene Builder.
I uploaded a PDF and sample projects to which I refer in said PDF, to the following repository:
https://github.com/profjpbaugh/apache-netbeans-openjdk-openjfx
Thanks!
Please find the error when I run the initialize_services command in cmd
SEVERE: Caught an exception while invoking method 'run' on object 'InitialSetup'. Releasing locks.
Caused by java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl invoke0 - null
Caused by com.endeca.soleng.eac.toolkit.exception.AppControlException
com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript - Unknown error executing a BeanShell script.
Caused by bsh.EvalError
bsh.BSHMethodInvocation eval - Sourced file: inline evaluation of: `` IFCR.provisionSite(); CAS.importDimensionValueIdMappings("Disco . . . '' : Error in method invocation: Method importDimensionValueIdMappings( java.lang.String, java.lang.String ) not found in class'com.endeca.soleng.eac.toolkit.component.CustomComponent'
Failure to initialize EAC application.
According to this adding casStubs.jar from CAS_ROOT\lib\cas-dt\ to classpath in runcommand script will solve the problem.
set CLASSPATH=%CLASSPATH%;C:\Endeca\CAS\11.1.0\lib\cas-dt\casStubs.jar
When trying to generate JavaDoc in Android Studio, it acts up and shows countless errors concerning non-existing packages and unknown symbols (mostly Android-related stuff).
Finally I get this error message:
Standard Doclet version 1.7.0_55
Building tree for all the packages and classes...
java.lang.NullPointerException
at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:83)
at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:44)
at com.sun.tools.javadoc.ClassDocImpl.superclassType(ClassDocImpl.java:496)
at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:459)
at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:497)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.processType(ClassTree.java:194)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.buildTree(ClassTree.java:146)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.<init>(ClassTree.java:91)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:123)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
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:606)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
342 warnings
javadoc exited with exit code 1
Once you are in javadoc generation wizard
Check include jdk and library sources
Add this line in front of Other command line arguments
-encoding utf-8 -bootclasspath /path/to/sdk/platforms/android-##/android.jar
I have set up a glassfish server for learning about it. After setting up and configuring depending on the quickstart guide, I was able to run the server and domain1 without any problems. after some time, it started to log the lines below:
[#|2013-01-11T15:43:45.246+0800|WARNING|glassfish3.1.2|java.util.prefs|_ThreadID=105;_ThreadName=Thread-2;|Could not lock User prefs. Unix error code 5.|#]
[#|2013-01-11T15:43:45.246+0800|WARNING|glassfish3.1.2|java.util.prefs|_ThreadID=105;_ThreadName=Thread-2;|Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.|#]
And I made a little googling about this and found this link and applied the option which was recommended there. After restarting glassfish although the server log says it started, I am seeing this in the commandline:
./asadmin start-domain domain1
Waiting for domain1 to start .............Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error)
java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
at org.apache.felix.framework.Felix.init(Felix.java:629)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException: org.osgi.framework.BundleException: Error creating bundle cache.
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:90)
Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
at org.apache.felix.framework.Felix.init(Felix.java:634)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
at org.apache.felix.framework.Felix.init(Felix.java:629)
... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:164)
at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157)
at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112)
... 6 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.newFramework(OSGiGlassFishRuntimeBuilder.java:230)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:133)
... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)
Command start-domain failed.
I have tried to find a solution, removing the cache folder in the domain directory or changing access permissions but the problem keeps occuring and i cant start my domain.
any ideas how to fix this problem?
I had the same IO Error as in that stack after installing Glassfish and found out the following:
Glassfish 3.1.2 is using the felix library for OSGI stuff and this one wants to lock files using the core Java method java.nio.channels.FileChannel.tryLock(). This appears not to work when the file to be locked is on a filesystem residing on certain kinds of NAS and leads to an IO error after a long timeout.
Make sure to install critical parts or all of the Glassfish on local disks and this error will disappear.
The error can easily be reproduced running the following Java class:
import java.io.File;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;
public class TryLock {
/**
* #param args
*/
public static void main(String[] args) {
// name of a file is the only parameter
File lockFile = new File(args[0]);
FileChannel fc = null;
FileOutputStream fos = null;
try {
fos = new FileOutputStream(lockFile);
fc = fos.getChannel();
// This is the code that fails on some NAS (low-level operation?):
fc.tryLock();
} catch( Throwable th) {
th.printStackTrace();
}
System.out.println("Success");
}
}