Phoenix/HBase throws NoSuchMethodError: sun.misc.Unsafe.putLong on Windows - java

Our product uses Phoenix JDBC driver to connect HBase and it works fine on Linux. I wanted to run it on Windows but the connection failed.
I tried to connect from IntelliJ Idea's Database and it failed on the same error. I used to have a connection in Idea to another HBase installation which was working fine there in July. But it fails with the same error too.
2020-11-18 11:36:54,835 [ 119005] INFO - .DatabaseConnectionEstablisher - Connecting to: jdbc:phoenix:dev.internal:2181:/hbase-unsecure
2020-11-18 11:36:57,362 [ 121532] WARN - .DatabaseConnectionEstablisher - Connecting to: jdbc:phoenix:dev.internal:2181:/hbase-unsecure
2020-11-18 11:36:57,364 [ 121534] WARN - .DatabaseConnectionEstablisher - [08004][103] ERROR 103 (08004): Unable to establish connection.
2020-11-18 11:36:57,368 [ 121538] WARN - ic.GenericDatabaseErrorHandler - ERROR 103 (08004): Unable to establish connection.
java.sql.SQLException: ERROR 103 (08004): Unable to establish connection.
at org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:542)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:150)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.openConnection(ConnectionQueryServicesImpl.java:460)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.access$400(ConnectionQueryServicesImpl.java:292)
at at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:3077)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:142)
at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
Caused by: java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.putLong(java.lang.Object, int, long)'
at org.apache.hadoop.hbase.util.UnsafeAccess.putLong(UnsafeAccess.java:248)
at org.apache.hadoop.hbase.util.Bytes$ConverterHolder$UnsafeConverter.putLong(Bytes.java:1489)
at org.apache.hadoop.hbase.util.Bytes.putLong(Bytes.java:788)
at org.apache.hadoop.hbase.client.ClientIdGenerator.generateClientId(ClientIdGenerator.java:51)
at org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator.<init>(PerClientRandomNonceGenerator.java:37)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:698)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:649)
Idea decompiled sun.misc.Unsafe and there is:
#Deprecated
public void putLong(Object o, int offset, long x) {
putLong(o, (long)offset, x);
}
Environment:
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
Classpath in Idea:
echo %HADOOP_HOME%
C:\dev\core\jdbc\winutils
echo %PATH%
C:\WINDOWS\system32;C:\dev\core\jdbc\winutils\bin;
JDBC folder:
16.11.2020 17:05 <DIR> winutils
08.07.2020 12:43 20 764 hbase-annotations-1.1.0.jar
08.07.2020 12:43 1 239 829 hbase-client-1.1.0.jar
08.07.2020 12:43 523 263 hbase-common-1.1.0.jar
08.07.2020 12:23 489 884 log4j-1.2.17.jar
17.12.2019 07:12 109 750 805 phoenix-4.15.0-HBase-1.5-client.jar
08.07.2020 12:16 3 074 133 phoenix-core-4.4.0-HBase-1.1.jar
08.07.2020 12:35 55 186 484 phoenix-shaded-4.4.0-HBase-1.1-1.jar
08.07.2020 12:48 533 455 protobuf-java-2.5.0.jar
08.07.2020 12:21 25 962 slf4j-api-1.6.4.jar
08.07.2020 12:21 8 869 slf4j-log4j12-1.7.5.jar
08.07.2020 12:50 792 964 zookeeper-3.4.6.jar
How to fix it?

I needed to add thin:url=http:// before the hostname (or IP) to fix that.
I was getting similar error in DBeaver Windows client and the problem was misconstructed jdbc URL. And i was using thin client jar got from installation directory of Phoenix.
Without the addition jdbc URL was missing this part.

Related

TestContainers Could not find a valid Docker environment

Running the same version of TestContainers 1.15.3 in one project is working correctly detecting docker etc but in another it is unable to start due to some sort of signing issue?
2021-08-23 20:35:13.524 INFO [,,,] 49733 --- [ers-lifecycle-0] .t.d.DockerMachineClientProviderStrategy : docker-machine executable was not found on PATH ([/usr/local/bin, /usr/bin, /bin, /usr/sbin, /sbin, /usr/local/bin])
2021-08-23 20:35:14.104 ERROR [,,,] 49733 --- [ers-lifecycle-0] o.t.d.DockerClientProviderStrategy : Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2021-08-23 20:35:14.105 ERROR [,,,] 49733 --- [ers-lifecycle-0] o.t.d.DockerClientProviderStrategy : UnixSocketClientProviderStrategy: failed with exception RuntimeException (java.lang.UnsatisfiedLinkError: /private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp: dlopen(/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp, 1): no suitable image found. Did find:
/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp: code signature in (/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.). Root cause UnsatisfiedLinkError (/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp: dlopen(/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp, 1): no suitable image found. Did find:
/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp: code signature in (/private/var/folders/vr/3wn83fp91j58p74ymdrghq480000gq/T/jna--2036694134/jna17985952756996537821.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.)
2021-08-23 20:35:14.105 ERROR [,,,] 49733 --- [ers-lifecycle-0] o.t.d.DockerClientProviderStrategy : As no valid configuration was found, execution cannot continue
JDK:
brew info adoptopenjdk12
adoptopenjdk12: 12.0.2,10
https://adoptopenjdk.net/
/usr/local/Caskroom/adoptopenjdk12/12.0.2,10 (190MB)
From: https://github.com/adoptopenjdk/homebrew-openjdk/blob/HEAD/Casks/adoptopenjdk12.rb
==> Name
AdoptOpenJDK 12
==> Description
AdoptOpenJDK OpenJDK (Java) Development Kit
==> Artifacts
OpenJDK12U-jdk_x64_mac_hotspot_12.0.2_10.pkg (Pkg)
Working project:
2021-08-23 20:18:23.586 INFO [,,] 47914 --- [ers-lifecycle-0] o.t.d.DockerClientProviderStrategy : Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
2021-08-23 20:18:24.154 INFO [,,] 47914 --- [ers-lifecycle-0] o.t.d.DockerClientProviderStrategy : Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
2021-08-23 20:18:24.156 INFO [,,] 47914 --- [ers-lifecycle-0] org.testcontainers.DockerClientFactory : Docker host IP address is localhost
2021-08-23 20:18:24.198 INFO [,,] 47914 --- [ers-lifecycle-0] org.testcontainers.DockerClientFactory : Connected to docker:
Server Version: 20.10.7
API Version: 1.41
Operating System: Docker Desktop
Total Memory: 5945 MB
JDK:
java --version
openjdk 16.0.2 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7-67)
OpenJDK 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
Any pointers greatly appreciated.
Mac OS Big Sur
Docker Desktop Version 3.5.2 (3.5.2.18)
This looks to be caused by an issue in Adopt Open JDK as documented here:
https://github.com/adoptium/temurin-build/issues/1211#issuecomment-521392147
github.com/testcontainers/testcontainers-java/issues/1773
Switching over to Oracle JDK 12 has resolved the issue.

Elastic APM Tomcat zip file or JAR manifest missing

I am trying to instrument our java webapp based on tomcat using Elastic APM. Tomcat starts fine without the javaagent but refuses to start with it. I do not see any logs in /var/log/tomcat. The following is the log:
Redirecting to /bin/systemctl status -l tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-04-17 01:45:36 UTC; 1s ago
Process: 25660 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=1/FAILURE)
Main PID: 25660 (code=exited, status=1/FAILURE)
arguments used: start
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: Ignoring option PermSize; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error opening zip file or JAR manifest missing : /opt/elastic/elastic-apm-agent-1.15.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument
tomcat.service: main process exited, code=exited, status=1/FAILURE
Unit tomcat.service entered failed state.
tomcat.service failed.
Has anyone faced this before? Any ideas what I could do to fix it?
did you try to give permissions to folder /opt/elastic ?
chmod -R uog+x

SonarQube stopped and is not running

I'm trying to setup SonarQube 7.8 version. Once i start sonar.sh file it is running but after that sonar stops.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh start
Starting SonarQube...
Started SonarQube.
root#automation:/opt/sonarqube-7.8/bin/linux-x86-64# ./sonar.sh status
SonarQube is not running.
I checked the logs and this is what i get:
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2019.10.15 21:01:37 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube-7.8/temp
2019.10.15 21:01:37 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2019.10.15 21:01:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube-7.8/elasticsearch]: /opt/sonarqube-7.8/elasticsearch/bin/elasticsearch
2019.10.15 21:01:37 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] no modules loaded
2019.10.15 21:01:38 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2019.10.15 21:01:41 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2019.10.15 21:01:41 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
es.log file is here :
2019.10.15 21:01:41 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.8.0.jar:6.8.0]
I'm not sure why SonarQube stops. Could you help me with that please?
SOLVED:
First, don't run sonarqube as the root user
Create user
command: useradd username (put username as sonaradmin(if you don't want to change any command)
Create a password command: passwd username
goto /opt/ directory
3.1) Rename sonarqube.x.x.x to sonarqube command:sudo mv sonarqube.x.x.x sonarqube(X.X.X you should change directory name)
Change permissions command:chmod 775 -R sonarqube(folder name may change Sonarqube )
Add Created user to sonaradmin group command: chown -R sonaradmin:sonaradmin sonarqube
goto : cd /opt/sonarqube/bin/linux-x86-64/
Command: su sonaradmin
Enter password
command:./sonar.sh start
Command:./sonar.sh status
Now goto browser check http://localhost:9000/sonar
Hoping this helps.... I have gone through the same issue,solved
ok, i found the solution. All i had to do is to change #RUN_AS_USER= in /opt/sonarqube-7.8/bin/linux-x86-64/sonar.sh line 48 to RUN_AS_USER=sonar
Your solution for me doesn't works, cause console show me this messagge (after edit to sonar.sh file)
groups: "sonar": no such user
chown: utente non valido: "sonar:sonar"
su: user sonar does not exist
if baya prakash reddy's answer doesn't work, so you can look at the documentation https://docs.sonarqube.org/latest/requirements/requirements/ where it says that you must ensure that:
vm.max_map_count is greater than or equal to 524288
yo can set it like this:
sysctl -w vm.max_map_count=524288
Ensure your sonarQube server has at least 4GB of RAM. I had this issue after installing SonarQube with 1GB of RAM. Running SonarQube as sonar did not resolve the issue. Once I installed on RHL with 4GB RAM, issue was resolved

cannot start dbeaver on ubuntu 18.04

Prelim: I installed dbeaver on ubuntu 18.04. Unfortunately I can't remember how exactly I installed it, but I think I followed the instructions here. I also remember that I had problems installing the latest java version. Here some output from the command window:
$ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+130)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+130, mixed mode)
Problem: I can't get Dbeaver to run. When I start dbeaver from the terminal I get the following:
$ dbeaver
2019-06-23 21:51:30.368 - Create display
and then a whole set of errors along the lines of
(DBeaver:15178): GLib-CRITICAL **: 21:51:30.414: g_base64_encode_step: assertion 'in != NULL' failed
(DBeaver:15178): GLib-CRITICAL **: 21:51:30.414: g_base64_encode_step: assertion 'in != NULL' failed
and the list goes on endlessly. Then at the end of the endless outputlist it goes:
2019-06-23 21:51:30.643 - > Start org.jkiss.dbeaver.core [6.1.0.201906091949]
2019-06-23 21:51:30.648 - DBeaver 6.1.0.201906091949 is starting
2019-06-23 21:51:30.649 - OS: Linux 4.15.0-47-generic (amd64)
2019-06-23 21:51:30.649 - Java version: 9-ea by Oracle Corporation (64bit)
2019-06-23 21:51:30.649 - Install path: '/usr/share/dbeaver'
2019-06-23 21:51:30.649 - Instance path: 'file:/home/myname/.dbeaver4/'
2019-06-23 21:51:30.650 - Memory available 80Mb/1024Mb
2019-06-23 21:51:30.667 - Starting RMI server at 59084
2019-06-23 21:51:30.755 - Run workbench
2019-06-23 21:51:30.769 - > Start org.eclipse.e4.ui.workbench.swt [0.14.500.v20190214-0851]
2019-06-23 21:51:30.771 - > Start org.eclipse.e4.core.services [2.1.400.v20181215-2145]
2019-06-23 21:51:30.774 - > Start org.eclipse.e4.core.contexts [1.8.0.v20190214-1713]
2019-06-23 21:51:30.789 - > Start org.eclipse.e4.ui.services [1.3.400.v20190212-2214]
and then:
2019-06-23 21:51:30.828 - Internal error in workbench lifecycle
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:422)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:333)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:497)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:511)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:211)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:589)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.jkiss.dbeaver.core.application.DBeaverApplication.start(DBeaverApplication.java:201)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base#9-ea/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base#9-ea/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base#9-ea/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base#9-ea/Method.java:533)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
at org.eclipse.equinox.launcher.Main.main(Main.java:1449)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:411)
... 23 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.7.100.v20180817-1215
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:460)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.lang.ClassLoader.loadClass(java.base#9-ea/ClassLoader.java:419)
... 25 more
Eventually it gives up after a fierce struggle:
2019-06-23 21:51:30.834 - DBeaver is stopping
2019-06-23 21:51:30.835 - Stop RMI server
2019-06-23 21:51:30.863 - < Stop org.jkiss.dbeaver.ext.mssql.ui [1.0.9.201906091949]
2019-06-23 21:51:30.863 - < Stop org.jkiss.dbeaver.ext.mssql [1.0.104.201906091949]
2019-06-23 21:51:30.863 - < Stop org.jkiss.dbeaver.ext.oracle [2.1.95.201906091949]
2019-06-23 21:51:30.863 - < Stop org.jkiss.dbeaver.ext.ui.tipoftheday [1.0.16.201906091949]
What to do? How do I get dbeaver to run?
This is an eclipse issue with Java 9+ that was fixed in newer Eclipse versions. I suspect the dbeaver version you downloaded probably used an older version which still has the problem. Either:
Try installing Java 8 instead of Java 9.
or install a newer eclipse, and the dbeaver plugins on top of that
After some updates suddenly my dbeaver was not opening in Windows, to fix it , I went to below location C:\Users\NikhilKamani\AppData\Roaming\DBeaverData\workspace6
and deleted metadata folder and started dbeaver again and it worked
Note: If you delete metadata you will have to add driver again when you try to access your databse.

Glassfish 3.1.1 start fails

I'm running glassfish 3.1.1. on my development machine (using Windows XP) for some time now, but this morning it fails to start. Running
asadmin start-domain domain1
it reports:
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
Completed shutdown of GlassFish runtime
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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: java.lang.NullPointerException
at com.sun.enterprise.server.logging.GFFileHandler.postConstruct(GFFileH
andler.java:159)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.
java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreato
r.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.jav
a:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.jav
a:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingIn
habitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantIm
pl.java:76)
at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
at java.util.AbstractList$Itr.next(AbstractList.java:358)
at com.sun.enterprise.server.logging.LogManagerService.postConstruct(Log
ManagerService.java:374)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.
java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreato
r.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.jav
a:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.jav
a:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingIn
habitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantIm
pl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.ja
va:229)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartu
p.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.
java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishI
mpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(Glass
FishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(O
SGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
GlassFishMain.java:117)
... 6 more
However, the server.log reads:
Jan 16, 2
012 10:59:14 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
Information: JVM invocation command line:
C:\Programme\Java\jdk1.7.0\bin\java.exe
-cp
C:/glassfish3/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:C:/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.keyStore=C:\glassfish3\glassfish\domains\domain1/config/keystore.jks
-Djava.awt.headless=true
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=C:\glassfish3\glassfish/modules/endorsed;C:\glassfish3\glassfish/lib/endorsed
-Dfelix.fileinstall.bundles.startTransient=true
-Djavax.net.ssl.trustStore=C:\glassfish3\glassfish\domains\domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=C:\glassfish3\glassfish\domains\domain1/config/login.conf
-Dgosh.args=--nointeractive
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=C:\glassfish3\glassfish/modules/autostart/
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=C:\glassfish3\glassfish\domains\domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.aas.instanceRoot=C:\glassfish3\glassfish\domains\domain1
-Dcom.sun.aas.installRoot=C:\glassfish3\glassfish
-Djava.ext.dirs=C:\Programme\Java\jdk1.7.0/lib/ext;C:\Programme\Java\jdk1.7.0/jre/lib/ext;C:\glassfish3\glassfish\domains\domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.fileinstall
-Djava.library.path=C:/glassfish3/glassfish/lib;C:/Programme/Java/jdk1.7.0/bin;C:/WINDOWS/Sun/Java/bin;C:/WINDOWS/system32;C:/WINDOWS;C:/Programme/NVIDIA Corporation/PhysX/Common;C:/oracle/product/10.2.0/client_1/BIN;C:/WINDOWS/system32/wbem;C:/Programme/Microsoft SQL Server/80/Tools/Binn;C:/WINDOWS/system32/WindowsPowerShell/v1.0;Y:/Maven-3.0.3/bin;C:/TP/ant/bin;Y:/Lotto/JOB-4.3.4-win32/JOB-4.3.4-bin/bin;C:/glassfish3/glassfish/bin
com.sun.enterprise.glassfish.bootstrap.ASMain
-domainname
domain1
-asadmin-args
--host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--debug=false,,,--domaindir,,,C:\glassfish3\glassfish\domains,,,domain1
-instancename
server
-verbose
false
-debug
false
-asadmin-classpath
C:/glassfish3/glassfish/modules/admin-cli.jar
-asadmin-classname
com.sun.enterprise.admin.cli.AsadminMain
-upgrade
false
-type
DAS
-domaindir
C:/glassfish3/glassfish/domains/domain1
-read-stdin
true
Jan 16, 2012 10:59:14 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
Information: Successfully launched in 31 msec.
We updated to JDK7u2 on Friday, but I was able to start the domain afterwards. The log shows it is still using JDK1.7.0. anyway.
Any ideas?
You are seeing http://java.net/jira/browse/GLASSFISH-17161 which is a duplicate of GLASSFISH-17037. GLASSFISH-17037 is in the release notes.
The workaround is to run a CLI command after adjusting/changing the log levels in console.
%asadmin set-log-levels com.sun.enterprise.server.logging.GFFileHandler=ALL
Specify the --target option for a server instance other than the domain administration server (DAS).
This has been fixed in 3.1.2 Release which is scheduled for FCS soon.
We resolved the issue by replacing the "logging.properties" file taken from domain1/config/default-config floder and placed into domains/domain1/config/
Try to uninstall the patch and run your Glassfish server.
Do you install the patch to the same directory? Maybe you have 2 JDK installed? I don't remember, but maybe Glassfish uses it's own JDK and so you have a clash. Anyway, I recommend you to go to JDK 1.7.0 and try again.
Check also windows environment variables as JAVA_HOME and PATH, maybe the problem is there.
You can also try to uninstall JDK completely, and install JDK 1.7.0_02 (patched one).

Categories