Replacing java -Xlog from java 8 to java 17 - java-8
I am trying to update logging framework -Xlog from java 8 to java 17
This is the one used in java 8 version:
JVM_LOG="-Xloggc:./logs/${COMPONENT_TAG}-GC.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=2 -XX:GCLogFileSize=5M"
I have updated it to java 17 as follows:
JVM_LOG="-Xlog:logging=debug:time,level,tags::filecount=2,filesize=5M -Xlog:gc*=debug:file=./logs/${COMPONENT_TAG}-GC.log -Xlog:age*=debug"
But it seems despite I use debug option, not a lot of logs are printed as opposed to java 8 version which prints quite a lot of logs.
But when I separate the filecount and following part into separate flag, I see lots of lines printing.
JVM_LOG="-Xlog:logging=debug:time,level,tags -Xlog::::filecount=2,filesize=5M -Xlog:gc*=debug:file=./logs/${COMPONENT_TAG}-GC.log -Xlog:age*=debug"
Is the way I mapped wrong? What is the correct mapping I should utilize?
I utilized this guide: https://docs.oracle.com/javase/9/tools/java.htm#GUID-BE93ABDC-999C-4CB5-A88B-1994AAAC74D5__CONVERTGCLOGGINGFLAGSTOXLOG-A5046BD1
EDIT:
I tried to do as in this page (https://confluence.atlassian.com/confkb/unrecognized-jvm-gc-options-when-using-java-11-1002472841.html). But still not seeing detailed logs as in java 8.
JVM_LOG="-Xlog:gc*,gc+age*=trace:file=./logs/${COMPONENT_TAG}-GC.log:tags,time,uptime,level:filecount=2,filesize=5M"
Related
Error while generating report in apache-jmeter-5.4.1.tgz
sh jmeter.sh -n -t filePath.jmx -l outFilePath.jtl -e -o folderPath Error generating the report: org.apache.jmeter.report.dashboard.GenerationException: Error while processing samples: Consumer failed with message :Consumer failed with message :Consumer failed with message :Consumer failed with message :Begin size 0 is not equal to fixed size 5 In resume Consumer failed with message :Begin size 0 is not equal to fixed size 5 currently using Java version "17" 2021-09-14 LTS MacOS big SUR version 11.4 the properties files are fresh and values are equal to the default ones Jmeter 5.4.1 outFile.jtl timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1632430450882,1117,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3824,557,3,3,Url_hidden,1111,0,256 1632430450448,1755,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3836,557,3,3,Url_hidden,1755,0,690 1632430450448,1755,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,3,3,Url_hidden,1755,0,690 1632430452312,585,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3836,557,3,3,Url_hidden,585,0,144 1632430452238,758,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3832,557,3,3,Url_hidden,757,0,137 1632430452301,806,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,3,3,Url_hidden,805,0,136 1632430452962,550,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3824,557,3,3,Url_hidden,550,0,152 1632430453328,593,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,2,2,Url_hidden,592,0,135 1632430453276,815,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3840,557,1,1,Url_hidden,814,0,142 The thread run successfully and the jtl file is created as well. I quite new on Jmeter and tried to see where that "size" attribute is currently locate to see how change it, but could not find it on any *.properties file any though how can be this fixed, what the message is referring to? thanks
This error is likely due to an incompatibility of JMeter with Java 17 (as mentioned by Dmitri T). Whilst we wait for a fix, a workaround would be downgrading to Java 16. I can confirm this solved the issue for me.
I had the same issue with: MacOS big SUR version 11.6 Jmeter 5.4.1 (installed via brew) Temurin 11 (LTS) OpenJDK & Temurin 8 (LTS) OpenJDK Running Jmeter with Java 8 solved my issue. The problem was, that Jmeter always used Java 11. I struggled some days to find out, how to set the Jmeter Java version: set the correct Java 8 Home in: /usr/local/Cellar/jmeter/5.4.1/bin/jmeter: JAVA_HOME=$JAVA_8_HOME exec "/usr/local/Cellar/jmeter/5.4.1/libexec/bin/jmeter" "$#" Maybe there are easier ways to set Java 8 for Jmeter - but this was the only solution which worked for me.
I had Java 8 installed however, the JMeter was picking up Java 1.17 which was nowhere in my system. So uninstalling and reinstalling jmeter, worked like a charm for me.
I cannot reproduce your issue using: openjdk:8-jre-alpine docker image JMeter 5.4.1 Test plan Test.jmx from extras folder of JMeter Demo: If you cannot reproduce the above behaviour I think you made some changes either to Results File Configuration or to Reporting Configuration or both so you need to inspect all the JMeter Properties which differ from the defaults and restore their values to the original ones. If you need further support you need to share at least first 2 lines of your outFilePath.jtl results file. Better if possible the full file and all the .properties files from JMeter's "bin" folder.
exec commandline /usr/libexec/java_home -V enter image description here replace bin of jmeter JAVA_HOME enter image description here and then ,it is success.
How to generate an HTML JFR report on JMC 8?
I hope somebody could help with the following. In JMC6 to generate a JFR report the syntax was: java com.oracle.jmc.flightrecorder.rules.report.JfrRulesReport file.jfr -format html|json -min ok Then I had to move to JMC8 (http://jdk.java.net/jmc/8/) and started to have issues with the syntax of that report. Based on https://github.com/openjdk/jmc , it should be: java -cp <the built core jars> org.openjdk.jmc.flightrecorder.rules.report.html.JfrHtmlRulesReport <file> [<outputfile>] The output shows no error and a 16K HTML is generated no matter what JFR file is passed as an argument. When viewing that HTML in a browser, it shows nothing but "Show OK Results". I tried with Mozilla, Chrome, and Edge, with similar results. According to the source code of that html, some images are created, but I found no way to see them. This Oracle JDK1.8u301 on Win10: $ java -version java version "1.8.0_301" Java(TM) SE Runtime Environment (build 1.8.0_301-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode) $ echo %CLASSPATH% plugins\org.openjdk.jmc.flightrecorder.rules_8.0.1.qualifier.jar;plugins\org.openjdk.jmc.flightrecorder_8.0.1.qualifier.jar;plugins\org.openjdk.jmc.common_8.0.1.qualifier.jar;plugins\org.lz4.lz4-java_1.7.1.jar;plugins\org.owasp.encoder_1.2.3.jar Has anybody generated a HTML JFR report on JMC8 successfully to provide tips? Thank you very much!
An additional jar file was required to produce the output: org.openjdk.jmc.flightrecorder.rules.jdk_8.1.0.qualifier.jar In the latest version of JMC8.1.0, the list of jar files is: org.openjdk.jmc.flightrecorder.rules_8.1.0.qualifier.jar; org.openjdk.jmc.common_8.1.0.qualifier.jar; org.openjdk.jmc.flightrecorder_8.1.0.qualifier.jar; org.lz4.lz4-java_1.7.1.jar; org.owasp.encoder_1.2.3.jar; org.openjdk.jmc.flightrecorder.rules.jdk_8.1.0.qualifier.jar
Starting a payara 5 has encountered
I have build a very simple project of hello world in Payara 5 (5.181) JSF 2.3 JDK 1.8 CDI 2.0 Maven and encountered a problem Unable to start server due following issues: Launch process failed with exit code 1 in console it throws an error of : Error: Could not find or load main class server\payara5\glassfish.lib.grizzly-npn-bootstrap.jar [PIC] Payara 5 Error
It seems that the Payara Tools for Eclipse suffer by several bugs that may cause this. In my case, the following workarounds helped: The Payara installation path should not contain spaces (e.g. Program Files\Payara) It seems that only Java 8 is supported at the time Open the domain.xml configuration file for the domain you are trying to start (typically payara_install_path/glassfish/domains/domain1/config/domain1.xml) and search for "Xbootclasspath". You should find a couple of lines like <jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options> <jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options> <jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options> <jvm-options>[1.8.0u191|1.8.0u500]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options> Depending of your installed Java version (try running java --version) and choose the appropriate line (most likely the last one). Remove the remaining lines and remove the [...] part at the beginning of the chosen line so you will get something like <jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options> After this, the tools seem to start normally.
The Problem is with Java version. The grizzly-npn-bootstrap-1.8.1.jar Jar is placed in bootclasspath, thats why it requires proper java version to start payara server. So remove unnecessary bootstrap jar from domain.xml. In Windows: 1) Go To ---C:\Users\xxxx\payara5\glassfish\domains\domain1\config\domain.xml 2) According to my java verson(java version "1.8.0_191") I deleted the following lines from domain.xml. So delete according to your java version. <jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options> <jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options> <jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options> 3) Remove this [1.8.0u191|1.8.0u500] part from jvm-options & Edit the line in your domain.xml(w.r.t java -version) as shown below <jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options> 4) restart your server.
As Radkovo said, "The Payara installation path should not contain spaces (e.g. Program Files\Payara)", so I moved the Payara to the Documents folder. Problem solved!
ES Won't Start on Win x64 Java SE 8 u 171/2
I have Win 10 x64. I updated to Java 8 Update 171. Attempting to run ES up with this command line cd bin elasticsearch.bat -Ecluster.name=ABTest_Cluster_00 -Enode.name=ABTest_Node_00 resulted in failure to start with this rather cryptic error Common was unexpected at this time I upgraded to 172 and it was the same. (Disclaimer: It might have been "not expected" rather than "unexpected" but I'm not re-installing 172 to check it and then downgrading again.) I had a look in jvm.options and the only place I could find "common" was in a comment # turn off a JDK optimization that throws away stack traces for common # exceptions because stack traces are important for debugging -XX:-OmitStackTraceInFastThrow Downgrading to je 8 U 162 fixed the issue and all was well. My local DynamoDB ran up OK under the latest Java. Is this an issue with how I'm starting ES (don't think so - it's been working for ages)? Is an issue with ES or Java? Is there a work around that anyone knows of as I'd rather run the latest Java.
For me helped to change in elasticsearch.bat from %JAVA% to !JAVA! in line 47
With elastic 6.6.2 change line 46 of elasticsearch.bat - from %JAVA% to !JAVA! change line 60 of elasticsearch-env.bat - from %JAVA% to !JAVA!
Test Case failures with a java.lang.ArrayIndexOutOfBoundsException: 28526 with JDK 8 and terracotta 3.4.0
I currently moved maven java code from jdk7 to jdk8 which uses terracotta and was working properly but after changing it to jdk8 , my test cases are getting failed. I am getting following error and I didn't get any clues through searching. java.lang.ArrayIndexOutOfBoundsException: 28526 at com.tc.asm.ClassReader.readClass(ClassReader.java:2015) at com.tc.asm.ClassReader.getClassName(ClassReader.java:229) at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:305) at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.createClassInfoFromStream(AsmClassInfo.java:717) at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:256) at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getInterfaces(AsmClassInfo.java:558) at com.tc.aspectwerkz.expression.regexp.TypePattern.matchInterfaces(TypePattern.java:147) at com.tc.aspectwerkz.expression.regexp.TypePattern.matchInterfaces(TypePattern.java:147) at com.tc.aspectwerkz.expression.regexp.TypePattern.matchSuperClasses(TypePattern.java:120) at com.tc.aspectwerkz.expression.regexp.TypePattern.matchType(TypePattern.java:92) at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:437) at com.tc.aspectwerkz.expression.ast.ASTClassPattern.jjtAccept(ASTClassPattern.java:24) at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1016) at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:237) at com.tc.aspectwerkz.expression.ast.ASTWithin.jjtAccept(ASTWithin.java:22) at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100) at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22) at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88) at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74) at com.tc.object.config.ClassExpressionMatcherImpl.match(ClassExpressionMatcherImpl.java:24) at com.tc.object.config.CompoundExpressionMatcher.match(CompoundExpressionMatcher.java:18) at com.tc.object.config.StandardDSOClientConfigHelperImpl.shouldBeAdapted(StandardDSOClientConfigHelperImpl.java:1242) at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transformInternal(DefaultWeavingStrategy.java:184) at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:134) at com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:288) at com.tc.object.bytecode.hook.impl.DSOContextImpl.transform(DSOContextImpl.java:392) at org.terracotta.express.ClusteredStateLoader.transform(ClusteredStateLoader.java:124) at org.terracotta.express.ClusteredStateLoader.loadClass(ClusteredStateLoader.java:83) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory$1.call(TerracottaClusteredInstanceFactory.java:319) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory$1.call(TerracottaClusteredInstanceFactory.java:317) at org.terracotta.api.Terracotta.lookupOrCreateRoot(Terracotta.java:47) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getStoreRoot(TerracottaClusteredInstanceFactory.java:316) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getStoreMapForCacheManager(TerracottaClusteredInstanceFactory.java:77) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStore(TerracottaClusteredInstanceFactory.java:68) at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createStore(TerracottaClusteredInstanceFactory.java:64) at net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.createStore(StandaloneTerracottaClusteredInstanceFactory.java:40) Thank you
As stated in one of the comments, Terracotta 3.4.0 is not Java 8 compatible and given the way the old Terracotta version worked, this is not a surprise. You will have to update to a later version if you must have Java 8 support. The exact version will depend on the usage you are making of Terracotta - if you need DSO support, you have to stick with the 3.7.x line. For Ehcache support, it is recommended to upgraded to the latest version in the 4.3.x line.