NoClassDefFoundError on ProfilerRuntimeObjLiveliness error when profiling on WildFly in Netbeans - netbeans

I am trying to profile a web application running on WildFly (8.2.0.Final "Tweek" version) in Netbeans 8.0.2. I keep getting a NoClassDefFoundError on ProfilerRuntimeObjLiveliness. I tried adding "org.netbeans.lib.profiler.server" to JAVA_OPTS in standalone.conf.bat, but that didn't change anything. The app deploys fine when I'm not trying to profile it.
I've tried jdk7 and 8 (both 64 bit)
Calling "D:\WildFlyTC-8585\bin\standalone.conf.bat"
"JAVA_OPTS already set in environment; overriding default settings with values: -Xms128m -Xmx512m -Djboss.modules.system.pkgs=org.netbeans.lib.profiler.server -server -Dhttp.nonProxyHosts=localhost,127.0.0.1,ComputerName -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -agentpath:D:\NetBeans8.0.2\profiler\lib\deployed\jdk16\windows-amd64\profilerinterface.dll=D:\NetBeans8.0.2\profiler\lib,5140 -Dnbprofiler.agentid=468771422"
Setting JAVA property to "C:\Program Files\Java\jdk1.8.0_40\bin\java"
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: "D:\WildFlyTC-8585"
JAVA: "C:\Program Files\Java\jdk1.8.0_40\bin\java"
JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms128m -Xmx512m -Djboss.modules.system.pkgs=org.netbeans.lib.profiler.server -server -Dhttp.nonProxyHosts=localhost,127.0.0.1,ComputerName -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -agentpath:D:\NetBeans8.0.2\profiler\lib\deployed\jdk16\windows-amd64\profilerinterface.dll=D:\NetBeans8.0.2\profiler\lib,5140 -Dnbprofiler.agentid=468771422"
===============================================================================
Profiler Agent: Waiting for connection on port 5140 (Protocol version: 15)
Profiler Agent: Established connection with the tool
Profiler Agent: Local accelerated session
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeObjLiveness
at org.wildfly.security.manager.WildFlySecurityManager.<clinit>(WildFlySecurityManager.java:75)
at org.jboss.as.server.Main.main(Main.java:97)
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:497)
at org.jboss.modules.Module.run(Module.java:320)
at org.jboss.modules.Main.main(Main.java:464)
Caused by: java.lang.ClassNotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness from [Module "org.wildfly.security.manager:main" from local module loader #6df2af02 (finder: local module finder #4c030fe1 (roots: D:\WildFlyTC-8585\modules,D:\WildFlyTC-8585\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
... 8 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeObjLiveness
at org.jboss.as.server.SystemExiter.getExiter(SystemExiter.java:45)
at org.jboss.as.server.SystemExiter.exit(SystemExiter.java:41)
at org.jboss.as.server.Main.abort(Main.java:113)
at org.jboss.as.server.Main.main(Main.java:105)
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:497)
at org.jboss.modules.Module.run(Module.java:320)
at org.jboss.modules.Main.main(Main.java:464)
Caused by: java.lang.ClassNotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeObjLiveness from [Module "org.jboss.as.server:main" from local module loader #6df2af02 (finder: local module finder #4c030fe1 (roots: D:\WildFlyTC-8585\modules,D:\WildFlyTC-8585\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
... 10 more
Profiler Agent: Connection with agent closed
Profiler Agent: Connection with agent closed
Profiler Agent: Initializing...
Profiler Agent: Options: >D:\NetBeans8.0.2\profiler\lib,5140<
Profiler Agent: Initialized successfully
Profiler Agent: Redefining 100 classes at idx 0, out of total 500
Profiler Agent: Redefining 100 classes at idx 100, out of total 500
Profiler Agent: Redefining 100 classes at idx 200, out of total 500
Profiler Agent: Redefining 100 classes at idx 300, out of total 500
Profiler Agent: Redefining 100 classes at idx 400, out of total 500
Press any key to continue . . .
What can I do to fix that?

Related

Tomcat 9.0.52 crashes with "java.util.zip.ZipException: invalid LOC header (bad signature)" when started in debug mode - any work-around?

When trying to start Tomcat (9.0.52) in debug mode ("Debug on Server") from Eclipse (v2020-12 (4.18.0) / Build id: 20201210-1552) I get the following error (see full stacktrace further below):
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
...
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
While the reasons seems clear - there is some issue reading a .jar file - the question I have is:
How can I find out, WHICH .jar is causing this issue? Is there some option to get more info on the root cause: which library (either from Tomcat or which application-jar?) that it tries to read is causing this?
The odd thing is: When I start this up in normal "run" mode in Eclipse or as a Windows Service, then Tomcat as well as the application start up fine. This zip-file problem only happens when I try to start it in debug mode! And - when starting Tomcat from Eclipse - then no .war-file is created but rather Tomcat's classpath is adjusted such, that the class files are used in-situ (i.e. directly from the target directory where they have been compiled to). So there is no additional .jar file created compared to the non-debug mode (which is why I am puzzled why this happens only in debug mode).
Eclipse uses Java 14 (if I am correct) but is configured to compile to 1.8 compatibility and the runtime (i.e. Tomcat and our application) uses Java 1.8 (I have installed the "almost latest" AdoptOpenJDK v1.8 / jdk-8.0.292.10-hotspot).
Tomcat's download page (https://tomcat.apache.org/whichversion.html) claims, that Tomcat 9.0.52 runs with Java "8 and later", so IMHO I should be OK in terms of prereq's.
Any idea how to get the above setup starting up/working in debug mode?
Full stacktrace:
...
16-Aug-2021 13:52:11.275 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1232] milliseconds
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.52]
16-Aug-2021 13:52:11.866 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
16-Aug-2021 13:52:13.860 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,954] milliseconds.
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
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.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:726)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
... 21 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readNBytes(IOUtils.java:180)
at sun.misc.IOUtils.readAllBytes(IOUtils.java:116)
at java.util.jar.JarFile.getBytes(JarFile.java:426)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
... 34 more
Later addition: I also tried the entire setup using a Java 11 VM for Tomcat but with the same result. So, this issue with some .jar-file having an invalid header or signature is apparently NOT a Java<=(1.)8 vs. Java >=v9 issue. So I reverted back to Java 1.8.
A day later:
This morning when I tried to restart Tomcat again in debug mode to investigate further, the server started up! No more .zip-file issues! The problem just vanished... :-)
Thanks to all who responded!

Spring Boot Application fails after Debug is started

I have a spring boot application which I have started for debug using command:
sudo mvnDebug spring-boot:run
The Spring app shows message:
Preparing to execute Maven in debug mode
Listening for transport dt_socket at address: 8000
Now, I start the debugging from eclipse attaching to listener at locahost:8000.
The Spring Boot application shows error now as below:
17:26:20.747 initApplicationContext: this=com.xxx.platform.sp.spring.SpringApplicationContext#63c29d69 prev=null applicationContext=org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#738f69dd: startup date [Tue Oct 31 17:25:55 IST 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#76a02fc2 (cl=java.net.URLClassLoader#45bb3370)
[WARNING]
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:498)
at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat servlet container
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:165)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:293)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.intuit.cfp.sp.service.taximport.WebApplication.main(WebApplication.java:22)
... 6 more
Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:159)
... 16 more
I am unable to debug. Any help is appreciated.

Not able to integrate Jvisual Vm with Jboss EAP 6.1

I am not able to integrate JVisualVM with jboss EAP 6.1. Below are steps i done:
Edited the startup file and added the below params in that-
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=3614 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
But i am getting below error:
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
Could not load Logmanager "org.jboss.logmanager.LogManager"
java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager
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)
at java.util.logging.LogManager$1.run(LogManager.java:191)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:181)
at java.util.logging.Logger.demandLogger(Logger.java:339)
at java.util.logging.Logger.getLogger(Logger.java:393)
at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:830)
at sun.management.Agent.startAgent(Agent.java:260)
at sun.management.Agent.startAgent(Agent.java:456)
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Aug 17, 2017 5:46:51 AM org.jboss.msc.service.ServiceContainerImpl <clinit>
INFO: JBoss MSC version 1.0.4.GA-redhat-1
Aug 17, 2017 5:46:51 AM org.jboss.as.server.ApplicationServerService start
INFO: JBAS015899: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) starting
Aug 17, 2017 5:46:52 AM org.jboss.as.controller.AbstractOperationContext executeStep
ERROR: JBAS014612: Operation ("parallel-extension-add") failed - address: ([])
java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:99)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440)
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322)
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:232)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:225)
at org.jboss.as.server.ServerService.boot(ServerService.java:333)
at org.jboss.as.server.ServerService.boot(ServerService.java:308)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:188)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:91)
... 10 more
Caused by: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:103)
at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:97)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:127)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:113)
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)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Aug 17, 2017 5:46:52 AM org.jboss.as.server.ServerService boot
FATAL: JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
Thanks & Regards,
Rishabh Jain
To connect with JVisualVM to JBoss, you need to add the jboss-cli-client.jar to the classpath:
$JAVA_HOME/bin/jvisualvm -cp:a $JBOSS_HOME/bin/client/jboss-cli-client.jar
If this jar is not available in your EAP version, then you must add the following modules under $JBOSS_HOME/modules to the classpath:
org/jboss/remoting3/remoting-jmx org/jboss/remoting3 org/jboss/logging org/jboss/xnio org/jboss/xnio/nio org/jboss/sasl org/jboss/marshalling org/jboss/marshalling/river org/jboss/as/cli org/jboss/staxmapper org/jboss/as/protocol org/jboss/dmr org/jboss/as/controller-client org/jboss/threads org/jboss/as/controller
This blog post has a script that you can be used for that. If you are registered customer, you can also download a script here.

sonarqube dies right after I start it

On CentOS-6 box, I am setting up sonarqube-6.4 with postgresql-9.3 Database server running on the same machine. I am using openJDK 8, version below:
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
I only changed below properties which I think is sufficient to connect sonarqube web with postgre DB:
sonar.jdbc.username=sonar
sonar.jdbc.password=*****
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
sonar.web.host=0.0.0.0
sonar.web.port=9100
Now when I start sonar I see following in the sonar.log
--> 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.
2017.06.07 01:53:47 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2017.06.07 01:53:47 INFO app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[es]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-0.b11.el6_9.x86_64/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+
UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/sonar/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.Search
Server /opt/sonar/temp/sq-process5474669563516031830properties
2017.06.07 01:53:53 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
2017.06.07 01:53:53 INFO app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[web]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-0.b11.el6_9.x86_64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx512m -Xms128m -XX:+H
eapDumpOnOutOfMemoryError -Djava.io.tmpdir=/opt/sonar/temp -cp ./lib/common/*:./lib/server/*:/opt/sonar/lib/jdbc/postgresql/postgresql-9.4.1209.jre7.jar org.sonar.server.app.WebServer /opt/sonar/temp/sq-process233758778210871240pro
perties
2017.06.07 01:53:57 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
2017.06.07 01:53:57 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.06.07 01:53:57 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
Not sure why it dies.
Below is in the web.log:
2017.06.07 04:39:04 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost/sonarqube
2017.06.07 04:39:04 ERROR web[][o.s.s.p.Platform] Web server startup failed
java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:108)
at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:75)
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.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.sonar.core.platform.ComponentContainer$1.start(ComponentContainer.java:320)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:88)
at org.sonar.server.platform.Platform.start(Platform.java:231)
at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:190)
at org.sonar.server.platform.Platform.init(Platform.java:86)
at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:43)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: no pg_hba.conf entry for host "127.0.0.1", user "sonar", database "sonarqube", SSL off)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:323)
at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:106)
... 30 common frames omitted
Caused by: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "sonar", database "sonarqube", SSL off
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:451)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:223)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:211)
at org.postgresql.Driver.makeConnection(Driver.java:407)
at org.postgresql.Driver.connect(Driver.java:275)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 35 common frames omitted
2017.06.07 04:39:06 INFO web[][o.a.c.u.SessionIdGeneratorBase] Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,561] milliseconds.
2017.06.07 04:39:06 WARN web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [elasticsearch[Scrier][[timer]]] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
org.elasticsearch.threadpool.ThreadPool$EstimatedTimeThread.run(ThreadPool.java:747)

Error When Starting Wildfly 10 on Linux FileNotFoundException

Hello I cant get the Wildfly 10 Server to start on Linux.
Below is the error message.
I did look into the directory but there is no folder called "log". Do I need to give Netbeans more permissions, so it can create it?
JAVA_OPTS already set in environment; overriding default settings with values: -Xms128m -Xmx512m -server
-Dhttp.nonProxyHosts=localhost,127.0.0.1,AnonPC
-Djava.net.preferIPv4Stack=true
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
-Djboss.management.http.port=9990 -Djboss.http.port=8080
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /opt/wildfly
JAVA: /usr/lib/jvm/default/bin/java
JAVA_OPTS: -Xms128m -Xmx512m -server
-Dhttp.nonProxyHosts=localhost,127.0.0.1,AnonPC
-Djava.net.preferIPv4Stack=true
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
-Djboss.management.http.port=9990 -Djboss.http.port=8080
=========================================================================
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:116)
at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:335)
at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:288)
at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:297)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:546)
at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:514)
at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:476)
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:482)
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:423)
at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:114)
... 17 more
Caused by: java.io.FileNotFoundException: /opt/wildfly/standalone/log/server.log (Datei oder Verzeichnis nicht gefunden)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:151)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:102)
at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:189)
at org.jboss.logmanager.handlers.FileHandler.<init>(FileHandler.java:119)
at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.<init>(PeriodicRotatingFileHandler.java:70)
... 22 more
java.lang.IllegalStateException: WFLYSRV0124: Could not create server data directory: /opt/wildfly/standalone/data
at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:473)
at org.jboss.as.server.Main.determineEnvironment(Main.java:297)
at org.jboss.as.server.Main.main(Main.java:94)
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.jboss.modules.Module.run(Module.java:329)
at org.jboss.modules.Main.main(Main.java:507)
The user controlling the lifecycle of WildFly needs permissions to read and write files. You'd need to give your user permissions to /opt/wildfly directory.