unable to start server Glassfish 4 on eclipse unsing java 8 - glassfish

I am configuring my computer for implement primesface and primefaces mobiles. I installed apache-tomcat, GlassFish 4 and java 8 (jdk 1.8). I configured GlassFish on eclipse, but when I want to start it, I receive this message
Starting GlassFish 4 at localhost [domains1] has encountered a problem :
Unable to start server due following issues:
Launch process failed with exit code 1
and the log file give me this
Launching GlassFish on Felix platform
ERROR: Unable to create cache directory: C:\Program
Files\glassfish-4.1\glassfish\domains\domain1\osgi-cache\felix
ERROR: Error creating bundle cache. (java.lang.RuntimeException:
Unable to create cache directory.) java.lang.RuntimeException: Unable
to create cache directory. at
org.apache.felix.framework.cache.BundleCache.(BundleCache.java:131)
at org.apache.felix.framework.Felix.init(Felix.java:640) 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:645) at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.RuntimeException: Unable to create cache
directory. at
org.apache.felix.framework.cache.BundleCache.(BundleCache.java:131)
at org.apache.felix.framework.Felix.init(Felix.java:640) ... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483) at
com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
Caused by: org.glassfish.embeddable.GlassFishException:
java.lang.NullPointerException at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:170)
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:241)
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:135)
... 9 more Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException at
com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=192m;
support was removed in 8.0
Can I have some solution please?

Related

Exceptions running HotSwapAgent 1.4.1 with standalone JBoss 7.3 EAP

I just installed the HotSwapAgent 1.3.0 plugin in IntelliJ IDEA 2021.2.3 community edition and added the hotswap-agent.properties file with the watchResources=src/target/classes parameter in one of the modules from the multimodule project. I would like to deploy it in a standalone JBoss container, so I have added the -XXaltjvm and -javaagent options in the JBoss startup file. However, on JBoss, it does not work with the following exception:
[2022-06-02 15:46:57,810] [ ] [ERROR] [Controller Boot Thread] [org.jboss.as.controller.management-operation] [] [] [] [] WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "app.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"app.ear\".\"app.war\".undertow-deployment" => "javax.servlet.ServletException: UT010013: Could not instantiate PROD DESIGN
Caused by: javax.servlet.ServletException: UT010013: Could not instantiate PROD DESIGN
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
Caused by: javax.enterprise.inject.CreationException
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: com/vaadin/flow/server/VaadinService
Caused by: java.lang.ClassNotFoundException: com.vaadin.flow.server.VaadinService"}}

java.lang.NoClassDefFoundError spark-submit in yarn cluster mode, cluster being setup using Ambari

I'm using the spark-submit command as below:
spark-submit --class com.example.hdfs.spark.RawDataAdapter --master yarn --deploy-mode cluster --jars /home/hadoop/emr/deployment/server/emr-core-1.0-SNAPSHOT.jar home/hadoop/emr-spark-1.0-SNAPSHOT.jar hdfs://111.11.11.111:8020/user/hdfsinputfile.zip 8000
However, it gives me the error java.lang.NoClassDefFoundError: com/example/emr/parser/IParser3. Though the IParser3.class is present in emr-core-1.0-SNAPSHOT.jar. I don't understand why it throws that error. I tried several ways but couldn't succeed. How can I resolve this?
I am able to run the same command in client mode and also as a standalone spark application. Getting this error only when in yarn cluster mode.
Exception from container-launch. Container id: container_e37_1526066605784_0014_02_000001 Exit code: 15 Container exited with a non-zero exit code 15. Error file: prelaunch.err. Last 4096 bytes of prelaunch.err : Last 4096 bytes of stderr : g.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at com.example.hdfs.spark.utils.SimpleClassLoader.loadJarFile(SimpleClassLoader.java:126) at com.example.hdfs.spark.utils.SimpleClassLoader.(SimpleClassLoader.java:38) at com.example.hdfs.spark.input RawInputFormat.loadPlugins(RawInputFormat.java:71) at com.example.hdfs.spark.RawDataAdapter.run(RawDataAdapter.java:54) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at com.example.hdfs.spark.RawDataAdapter.main(RawDataAdapter.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.yarn.ApplicationMaster$anon$3.run(ApplicationMaster.scala:646) 18/05/14 14:00:13 ERROR ApplicationMaster: Uncaught exception: org.apache.spark.SparkException: Exception thrown in awaitResult: at org.apache.spark.util.ThreadUtils$.awaitResult(ThreadUtils.scala:205) at org.apache.spark.deploy.yarn.ApplicationMaster.runDriver(ApplicationMaster.scala:423) at org.apache.spark.deploy.yarn.ApplicationMaster.run(ApplicationMaster.scala:282) at org.apache.spark.deploy.yarn.ApplicationMaster$anonfun$main$1.apply$mcV$sp(ApplicationMaster.scala:768) at org.apache.spark.deploy.SparkHadoopUtil$anon$2.run(SparkHadoopUtil.scala:67) at org.apache.spark.deploy.SparkHadoopUtil$anon$2.run(SparkHadoopUtil.scala:66) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1869) at org.apache.spark.deploy.SparkHadoopUtil.runAsSparkUser(SparkHadoopUtil.scala:66) at org.apache.spark.deploy.yarn.ApplicationMaster$.main(ApplicationMaster.scala:766) at org.apache.spark.deploy.yarn.ApplicationMaster.main(ApplicationMaster.scala) Caused by: java.util.concurrent.ExecutionException: Boxed Error at scala.concurrent.impl.Promise$.resolver(Promise.scala:55) at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$resolveTry(Promise.scala:47) at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:244) at scala.concurrent.Promise$class.tryFailure(Promise.scala:112) at scala.concurrent.impl.Promise$DefaultPromise.tryFailure(Promise.scala:153) at org.apache.spark.deploy.yarn.ApplicationMaster$anon$3.run(ApplicationMaster.scala:664) Caused by: java.lang.NoClassDefFoundError: com/example/emr/parser/IParser3 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at com.example.hdfs.spark.utils.SimpleClassLoader.findClass(SimpleClassLoader.java:152) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at com.example.hdfs.spark.utils.SimpleClassLoader.loadJarFile(SimpleClassLoader.java:126) at com.example.hdfs.spark.utils.SimpleClassLoader.(SimpleClassLoader.java:38) at com.example.hdfs.spark.input.RawInputFormat.loadPlugins(RawInputFormat.java:71) at com.example.hdfs.spark.RawDataAdapter.run(RawDataAdapter.java:54) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at com.example.hdfs.spark.RawDataAdapter.main(RawDataAdapter.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.yarn.ApplicationMaster$anon$3.run(ApplicationMaster.scala:646) Failing this attempt. Failing the application.
Quoting from Spark Documentation :-
http://spark.apache.org/docs/latest/running-on-yarn.html
In client mode, the driver runs in the client process, and the application master is only used for requesting resources from YARN.
In cluster mode, the Spark driver runs inside an application master process which is managed by YARN on the cluster, and the client can go away after initiating the application
So in cluster mode, the jar is executed on any available node so , so you can try these 2 ways :-
1) Copy the dependency jar to each node .
2) You can try to copy the jar to Distributed (HDFS system) and then use it .
For more details you can have a look into :
https://spark.apache.org/docs/latest/submitting-applications.html#advanced-dependency-management

Not able to start Datastax Cassandra due to missing SystemInfo class

I have installed Datastax Cassandra 5.0.4 on my mac but when i try to start, it is giving me error for SystemInfo class.
Here is related log:
Exception (com.google.inject.ProvisionException) encountered during startup: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoClassDefFoundError: com/datastax/hadoop/hive/util/SystemInfo
at com.datastax.bdp.plugin.HiveMetaStorePlugin.(HiveMetaStorePlugin.java:39)
at com.datastax.bdp.DseHiveModule.configure(Unknown Source) (via modules: com.datastax.bdp.DseModule -> com.datastax.bdp.DseAnalyticsModule -> com.datastax.bdp.DseHiveModule)
while locating com.datastax.bdp.plugin.HiveMetaStorePlugin
1 error
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error injecting constructor, java.lang.NoClassDefFoundError: com/datastax/hadoop/hive/util/SystemInfo
at com.datastax.bdp.plugin.HiveMetaStorePlugin.(HiveMetaStorePlugin.java:39)
at com.datastax.bdp.DseHiveModule.configure(Unknown Source) (via modules: com.datastax.bdp.DseModule -> com.datastax.bdp.DseAnalyticsModule -> com.datastax.bdp.DseHiveModule)
while locating com.datastax.bdp.plugin.HiveMetaStorePlugin
1 error
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1025)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at com.datastax.bdp.plugin.PluginManager.register(PluginManager.java:139)
at com.datastax.bdp.plugin.PluginManager.postSetup(PluginManager.java:68)
at com.datastax.bdp.server.DseDaemon.postSetup(DseDaemon.java:824)
at com.datastax.bdp.server.DseDaemon.setup(DseDaemon.java:447)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:568)
at com.datastax.bdp.DseModule.main(DseModule.java:91)
Caused by: java.lang.NoClassDefFoundError: com/datastax/hadoop/hive/util/SystemInfo
at com.datastax.bdp.plugin.HiveMetaStorePlugin.(HiveMetaStorePlugin.java:40)
at com.datastax.bdp.plugin.HiveMetaStorePlugin$$FastClassByGuice$$7e2893c3.newInstance()
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)

when i deploy the web application in glassfish server then glassfish server is displaying the following error

When i deploy the web aplication in glassfish server then glassfish server is displaying the following error :
C:\Program Files\glassfish-3.1.2\glassfish\bin>asadmin start-domain domain1
java.nio.file.AccessDeniedException: C:\Program Files\glassfish-3.1.2\glassfish\
domains\domain1\logs\server.log.lck
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at java.util.logging.FileHandler.openFiles(Unknown Source)
at java.util.logging.FileHandler.<init>(Unknown Source)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(
GFLauncherLogger.java:100)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:18
9)
at com.sun.enterprise.admin.cli.StartDomainCommand.createLauncher(StartD
omainCommand.java:209)
at com.sun.enterprise.admin.cli.StartDomainCommand.executeCommand(StartD
omainCommand.java:107)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:264)
at com.sun.enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.j
ava:306)
at com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:238)
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 parsing system bundle export statement: org.osgi.framework;
version
=1.6.0, org.osgi.framework.launch;
version=1.0.0,
org.osgi.framework.wiring; ver
sion=1.0.0, org.osgi.framework.startlevel;
version=1.0.0,
org.osgi.framework.hoo
ks.bundle; version=1.0.0,
org.osgi.framework.hooks.resolver;
version=1.0.0, org.
osgi.framework.hooks.service; version=1.1.0,
org.osgi.framework.hooks.weaving; version=1.0.0,
org.osgi.service.packageadmin; version=1.2.0, org.osgi.service.sta
rtlevel; version=1.1.0, org.osgi.service.url; version=1.0.0,
org.osgi.util.track
er; version=1.5.0, ,
org.glassfish.embeddable;org.glassfish.embeddable.spi;versi
on=3.1.1 (org.osgi.framework.BundleException: Exported package names
cannot be z
ero length.)
ERROR: Unable to create cache directory: C:\Program Files\glassfish- 3.1.2
\glassf
ish\domains\domain1\osgi-cache\felix
ERROR: Error creating bundle cache. (java.lang.RuntimeException:
Unable to create cache directory.)
org.osgi.framework.BundleException: Exported package names cannot be
zero length
.
at
org.apache.felix.framework.util.manifestparser.ManifestParser.normali
zeExportClauses(ManifestParser.java:729)
at
org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(
ManifestParser.java:191)
at org.apache.felix.framework.ExtensionManager.<init>
(ExtensionManager.j
ava:220)
at org.apache.felix.framework.Felix.<init>(Felix.java:374)
at org.apache.felix.framework.FrameworkFactory.newFramework
(FrameworkFac
tory.java:28)
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher.lau
nchOSGiFrameWork(OSGiFrameworkLauncher.java:77)
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.build(OSGiGlassFishRuntimeBuilder.java:128)
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)
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
(GlassFishMa
in.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
java.lang.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>
(BundleCache.java:
131)
at org.apache.felix.framework.Felix.init(Felix.java:629)
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.r
un(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException:
org.osgi.framework.Bu
ndleException: Error creating bundle cache.
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.r
un(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.r
un(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.RuntimeException: Unable to create cache directory.
at org.apache.felix.framework.cache.BundleCache.<init>
(BundleCache.java:
131)
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
(GlassFishMa
in.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: org.glassfish.embeddable.GlassFishException:
java.lang.NullPointerExc
eption
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.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.OSGiGlassFishRuntimeBuild
er.newFramework(OSGiGlassFishRuntimeBuilder.java:230)
at
com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuild
er.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(G
lassFishMain.java:203)
Java HotSpot(TM) Client VM warning: ignoring option
MaxPermSize=192m;
support was removed in 8.0
Java Hotot(TM) Client VM warning: ignoring option PermSize=64m;
support was re
moved in 8.0
Command start-domain failed.
C:\Program Files\glassfish-3.1.2\glassfish\bin>
I'm not a glassfish expert, but normally you read stack traces from bottom to top. The topmost error message is therefore the most detailed one. The topmost error message in this stack trace is:
file.AccessDeniedException`
on the file
C:\Program Files\glassfish-3.1.2\glassfish\ domains\domain1\logs\server.log.lck`
I also see in the second part of the log:
ERROR: Unable to create cache directory: C:\Program Files\glassfish- 3.1.2\glassfish\domains\domain1\osgi-cache\felix`
It looks to me like a file permissions problem, or a directory that is expected to be there that isn't.
You have use command line as administrator for connecting to server. You should get the next:
command-1:
cd C:\Program Files\glassfish4.1\glassfish\bin //Here your glassfish bin directory
command-2:
asadmin start-domain

Glassfish startup failure

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");
}
}