jstack unable to print java thread stacks from Windows crash dump - java

I'm trying to extract a java heap dump from a native dump taken by WER when it crashed:
jstack -m -l "c:\Program Files\Java\jre6\bin\java.exe" WER.tmp.hdmp
but I get the following exception:
Attaching to core c:\Users\xxx\Desktop\WER.tmp.hdmp from executable c:\Program Files\Java\jre6\bin\java.exe, please wait...
sun.jvm.hotspot.debugger.NoSuchSymbolException: Could not find symbol "gHotSpotVMTypes" in any of the known library names (jvm.dll, jvm_g.dll)
at sun.jvm.hotspot.HotSpotTypeDataBase.lookupInProcess(HotSpotTypeDataBase.java:389)
at sun.jvm.hotspot.HotSpotTypeDataBase.readVMTypes(HotSpotTypeDataBase.java:104)
at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:85)
at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:565)
at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:348)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:169)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.tools.jstack.JStack.runJStackTool(JStack.java:118)
at sun.tools.jstack.JStack.main(JStack.java:84)
Debugger attached successfully.
jstack requires a java VM process/core!
I've double checked that:
I'm running the same version of java as the system that the crash occurred on
The bitness of Windows (32) matches the system that the crash occurred on
jvm.dll is in the path
windbg is installed
I get exactly the same error if I try to extract a java heap dump using jmap.
Does anyone know what could be going wrong?

Related

jhsdb can't attach the java process in MacOS Monterey

macOS Monterey version is 12.5
and jdk version is 11
I was going with sudo jhsdb jmap --heap --pid xxxx to analyze java process. Then I got the error followed
Password:
Attaching to process ID 47413, please wait...
ERROR: attach: task_for_pid(47413) failed: '(os/kern) failure' (5)
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.
at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.execute(BsdDebuggerLocal.java:169)
at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach(BsdDebuggerLocal.java:283)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:672)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebuggerDarwin(HotSpotAgent.java:660)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:342)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:141)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176)
at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:369)
at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:538)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.
at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal.attach0(Native Method)
at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$1AttachTask.doit(BsdDebuggerLocal.java:274)
at jdk.hotspot.agent/sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal$BsdDebuggerLocalWorkerThread.run(BsdDebuggerLocal.java:144)
I'v tried use jdk14,18,and didn't work out for me.
so any solution?

How to connect JPL with SWI-Prolog in Mac OS X

Hi i have a problem with a jpl interface. I want connect JPL with swi-prolog installed with mac-ports with eclipse. I have a jpl.jar and i have tried to import the jar file in eclipse with build path but i have this error: "no jpl in java.library.path".
So i have copied libjpl.dylib in a /opt/local/lib/swipl-7.1.29/bin/ and when i execute the code i have this error: "Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib: dlopen(/opt/local/lib/swipl-7.1.29/bin/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /opt/local/lib/swipl-7.1.29/bin/libjpl.dylib
Reason: image not found"
After a anoying waste of time i found the solution about that problem.
First of all, its completely necesary to install swi-prolog via macports, if not, as i did, when you point in the
Djava.library.path=/users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0
this exception will apear
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib: dlopen(/Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib, 1): Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin13.0.0/libswipl.dylib
Referenced from: /Users/rivax/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin13.0.0/libjpl.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at jpl.JPL.loadNativeLibrary(JPL.java:100)
at jpl.fli.Prolog.<clinit>(Prolog.java:85)
at jpl.Query.open(Query.java:286)
at jpl.Util.textToTerm(Util.java:162)
at jpl.Query.<init>(Query.java:198)
at consultasProlog.Consultas.consultaFicheroProlog(Consultas.java:19)
at utilidades.RellenarModelo.ejecutarArchivo(RellenarModelo.java:30)
at javaprolog.JavaProlog.main(JavaProlog.java:30)
Java Result: 1
So follow these steps.
port install swi-prolog on terminal , if you dont have install already macports command not found will apear so go to https://www.macports.org/install.php and install macports.
navigate to the path of swi prolog macports installation which mine is
/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
copy this path and set in java.library.path in the java VM as -Djava.library.path=/opt/local/lib/swipl-6.6.6/lib/x86_64-darwin14.0.0
Now .pl with jpl.jar will be able to execute and the consults will run.
Hope it will help you and every person who find this hell problem.
Cheers frank.

Running precompiled java files from the command line (Ubuntu)

I checked (based on cannot execute binary file and some other SO questions) that the java file I'm trying to run is indeed executable on Ubuntu 12.04.
$ file ORA/include/OraFiles/bin/ora
ORA/include/OraFiles/bin/ora: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
But when I try to run it
$ ORA/ora.sh -measures ORA/include/OraFiles/xml/ora_xml_measures.xml -script junkin.xml -log 1999-progress.log
Exception in thread "main" java.lang.NoClassDefFoundError: edu/cmu/casos/OraUI/controller/OraMain
Caused by: java.lang.ClassNotFoundException: edu.cmu.casos.OraUI.controller.OraMain
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: edu.cmu.casos.OraUI.controller.OraMain. Program will exit.
or
$ ORA/include/OraFiles/bin/ora -measures ORA/include/OraFiles/xml/ora_xml_measures.xml -script junkin.xml -log 1999-progress.log
ORA/include/OraFiles/bin/ora: error while loading shared libraries: liborautils.so.0: cannot open shared object file: No such file or directory
however liborautils.so.0 does in fact exist:
$ ls ORA/include/OraFiles/bin/
construct.exe libjogl_cg.so libora.so.0
dynetml2orgahead.exe libjogl.jnilib libora.so.0.0.0
gluegen-rt.dll libjogl.so liborautils.so
html_to_ppt_converter.exe libnetstatplusfog.so **liborautils.so.0**
j3dcore-ogl.dll libnetstatplusfog.so.0 liborautils.so.0.0.0
jogl_awt.dll libnetstatplusfog.so.0.0.0 libtinyxml.so
jogl_cg.dll libnetstatplus.so libtinyxml.so.0
jogl.dll libnetstatplus.so.0 libtinyxml.so.0.0.0
libcasos_utils.so libnetstatplus.so.0.0.0 ora
libcasos_utils.so.0 libnewran.so ora.exe
libcasos_utils.so.0.0.0 libnewran.so.0 ora_jni.dll
libgluegen-rt.jnilib libnewran.so.0.0.0 ora_log.txt
libgluegen-rt.so libora_jni.so orgahead.exe
libjogl_awt.jnilib libora_jni.so.0 orgahead_perf.exe
libjogl_awt.so libora_jni.so.0.0.0
libjogl_cg.jnilib libora.so
How do I make Java see that it's there? I'm trying to run ng-nailgun but the instructions on nailgun quickstart don't seem to relate to the Ubuntu sudo apt-get install nailgun.
I installed ant, nailgun, and maven2 in the hopes that their dependencies would install whatever java stuff I need. This is on a 64-bit EC2 prebuild of Ubuntu 12.04.1.
UPDATE: Here is the text of ora.sh:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./include/OraFiles/bin/lib:./include/OraFiles/bin
java -splash:include/OraFiles/images/ORA-splash-screen.png -Xmx1024m -cp ora.jar:lib/jfreechart-1.0.13.jar:lib/jfreechart-1.0.13-swt.jar:lib/TableLayout.jar:lib/jcommon-1.0.9.jar:lib/httpcore-nio-4.0-beta3.jar:lib/j3dcore.jar:lib/httpcore-4.0-beta3.jar:lib/jung.jar:lib/twitter4j-1.1.7.jar:lib/jcalendar.jar:lib/rssutils.jar:lib/omj3d.jar:lib/json-1.0.jar:lib/commons-collections-3.1.jar:lib/jsi-generics.jar:lib/opencsv-1.7.jar:lib/trove-2.0.4.jar:lib/xml-writer.jar:lib/commons-logging-api-1.1.1.jar:lib/junit.jar:lib/jts-1.7-generics.jar:lib/casosparser.jar:lib/jgraphlayout.jar:lib/htmlparser.jar:lib/facebook-util-1.8-final.jar:lib/j3d-vrml97.jar:lib/omcorba.jar:lib/ant-launcher.jar:lib/colt.jar:lib/wwj/worldwind-ora.jar:lib/freehep/freehep-graphics2d-2.0.jar:lib/gt2-2.3.3/gt2-widgets-swing-2.3.3.jar:lib/gt2-2.3.3/batik-svggen-1.6.jar:lib/gt2-2.3.3/spatialdb-0.1.jar:lib/gt2-2.3.3/velocity-1.4.jar:lib/gt2-2.3.3/gt2-go-2.3.3.jar:lib/gt2-2.3.3/jsr108-0.01.jar:lib/gt2-2.3.3/db2jcc_dummy-8.2.1.jar:lib/gt2-2.3.3/gt2-postgis-2.3.3.jar:lib/gt2-2.3.3/gt2-xml-gml3-2.3.3.jar:lib/gt2-2.3.3/gt2-xml-2.3.3.jar:lib/gt2-2.3.3/concurrent-1.3.4.jar:lib/gt2-2.3.3/gt2-image-2.3.3.jar:lib/gt2-2.3.3/jaxb-impl-1.3.jar:lib/gt2-2.3.3/gt2-tiger-2.3.3.jar:lib/gt2-2.3.3/imageioext-asciigrid-1.0-rc1.jar:lib/gt2-2.3.3/gt2-api-2.3.3.jar:lib/gt2-2.3.3/gt2-shapefile-2.3.3.jar:lib/gt2-2.3.3/gt2-main-2.3.3.jar:lib/gt2-2.3.3/gt2-validation-2.3.3.jar:lib/gt2-2.3.3/commons-jxpath-1.2.jar:lib/freehep/freehep-graphicsio-svg-2.0.jar:lib/gt2-2.3.3/ecore-2.1.0.jar:lib/gt2-2.3.3/postgis-driver-1.0.jar:lib/gt2-2.3.3/commons-beanutils-1.4.jar:lib/gt2-2.3.3/relaxngDatatype-X.jar:lib/gt2-2.3.3/gt2-db2-2.3.3.jar:lib/gt2-2.3.3/geowidgets-1.0-M1.jar:lib/jai_codec.jar:lib/freehep/freehep-graphicsio-2.0.jar:lib/jogl/jogl.jar:lib/freehep/freehep-io-2.0.1.jar:lib/freehep/freehep-xml-2.0.1.jar:lib/gt2-2.3.3/ant-optional-1.5.1.jar:lib/gt2-2.3.3/gt2-vpf-2.3.3.jar:lib/gt2-2.3.3/gt2-demo-property-2.3.3.jar:lib/gt2-2.3.3/commons-pool-1.3.jar:lib/gt2-2.3.3/gt2-cql-2.3.3.jar:lib/gt2-2.3.3/geoapi-nogenerics-2.1-M2.jar:lib/gt2-2.3.3/gt2-sde-dummy-2.3.3.jar:lib/gt2-2.3.3/vecmath-1.3.1.jar:lib/gt2-2.3.3/velocity-dep-1.4.jar:lib/gt2-2.3.3/gt2-coverage-2.3.3.jar:lib/gt2-2.3.3/batik-util-1.6.jar:lib/gt2-2.3.3/gt2-wms-2.3.3.jar:lib/gt2-2.3.3/jaxb-api-1.3.jar:lib/omsvg.jar:lib/gt2-2.3.3/batik-xml-1.6.jar:lib/gt2-2.3.3/batik-bridge-1.6.jar:lib/gt2-2.3.3/commons-lang-2.1.jar:lib/gt2-2.3.3/gt2-render-2.3.3.jar:lib/gt2-2.3.3/batik-dom-1.6.jar:lib/gt2-2.3.3/gt2-graph-2.3.3.jar:lib/gt2-2.3.3/gt2-epsg-hsql-2.3.3.jar:lib/gt2-2.3.3/gt2-indexed-shapefile-2.3.3.jar:lib/gt2-2.3.3/jlfgr-1.0.jar:lib/gt2-2.3.3/gt2-hsql-2.3.3.jar:lib/java-getopt-1.0.13.jar:lib/gt2-2.3.3/batik-svg-dom-1.6.jar:lib/gt2-2.3.3/common-2.1.0.jar:lib/gt2-2.3.3/gt2-geotiff-2.3.3.jar:lib/toolkits_1-2-0.jar:lib/milStd2525_png.jar:lib/j3dutils.jar:lib/JAXWS2.1.3-20071218.jar:lib/Jama-1.0.1.jar:lib/commons-codec-1.3.jar:lib/gt2-2.3.3/gt2-imagemosaic-2.3.3.jar:lib/iText-2.1.0.jar:lib/commons-math-1.2.jar:lib/gt2-2.3.3/postgresql-8.1-407.jdbc3.jar:lib/freehep/freehep-util-2.0.1.jar:lib/idw-1.5.0/idw.jar:lib/gt2-2.3.3/batik-awt-util-1.6.jar:lib/gt2-2.3.3/gt2-gtopo30-2.3.3.jar:lib/gt2-2.3.3/gt2-wfs-2.3.3.jar:lib/gt2-2.3.3/picocontainer-1.2.jar:lib/gt2-2.3.3/gt2-arcgrid-2.3.3.jar:lib/gt2-2.3.3/gt2-mysql-2.3.3.jar:lib/gt2-2.3.3/gt2-openoffice-2.3.3.jar:lib/gt2-2.3.3/batik-ext-1.6.jar:lib/gt2-2.3.3/gt2-oracle-spatial-2.3.3.jar:lib/gt2-2.3.3/batik-gvt-1.6.jar:lib/gt2-2.3.3/gt2-svgsupport-2.3.3.jar:lib/svgSalamander-tiny.jar:lib/jhall.jar:lib/gt2-2.3.3/batik-css-1.6.jar:lib/gt2-2.3.3/gt2-mappane-2.3.3.jar:lib/gt2-2.3.3/gt2-demo-mappane-2.3.3.jar:lib/gt2-2.3.3/gt2-directory-2.3.3.jar:lib/gt2-2.3.3/gt2-geomedia-2.3.3.jar:lib/activation.jar:lib/commons-logging-1.1.1.jar:lib/gt2-2.3.3/gt2-mif-2.3.3.jar:lib/openmap-4.6.5.jar:lib/gt2-2.3.3/gt2-xml-filter-2.3.3.jar:lib/httpmime-4.0-beta2.jar:lib/gt2-2.3.3/junit-3.8.1.jar:lib/jai_core.jar:lib/gt2-2.3.3/xml-apis-1.0.b2.jar:lib/mail.jar:lib/gt2-2.3.3/hsqldb-1.8.0.1.jar:lib/jogl/gluegen-rt.jar:lib/gt2-2.3.3/commons-cli-2.0-gt2-pre1.jar:lib/gt2-2.3.3/commons-io-1.2.jar:lib/gt2-2.3.3/xsd-2.1.1.jar:lib/gt2-2.3.3/gt2-demo-data-2.3.3.jar:lib/gt2-2.3.3/batik-transcoder-1.6.jar:lib/javaml-0.0.12.jar:lib/gt2-2.3.3/gt2-epsg-access-2.3.3.jar:lib/gt2-2.3.3/jta-1.0.1B.jar:lib/gt2-2.3.3/gt2-epsg-postgresql-2.3.3.jar:lib/gt2-2.3.3/gt2-referencing-2.3.3.jar:lib/freehep/freehep-graphicsio-pdf-2.0.jar:lib/gt2-2.3.3/gt2-brewer-2.3.3.jar:lib/gt2-2.3.3/xercesImpl-2.7.1.jar:lib/commons-httpclient-3.1.jar:lib/gt2-2.3.3/imageioext-customstreams-1.0-rc1.jar:lib/gt2-2.3.3/jdbc-stdext-2.0.jar:lib/httpclient-4.0-beta2.jar:lib/gt2-2.3.3/jaxb-libs-1.3.jar:lib/gt2-2.3.3/gt2-imagepyramid-2.3.3.jar:lib/gt2-2.3.3/batik-script-1.6.jar:lib/gt2-2.3.3/xsdlib-20050614.jar:lib/facebook-java-api-1.8-final.jar:lib/gt2-2.3.3/gt2-arcsde-2.3.3.jar:lib/gt2-2.3.3/gt2-coveragetools-2.3.3.jar:lib/MDateSelector14-00347.jar:lib/rome-1.0.jar:lib/gt2-2.3.3/gt2-shapefile-renderer-2.3.3.jar:lib/gt2-2.3.3/gt2-epsg-wkt-2.3.3.jar:lib/gt2-2.3.3/gt2-gml-2.3.3.jar:lib/gt2-2.3.3/log4j-1.2.6.jar:lib/gt2-2.3.3/xml-apis-xerces-2.7.1.jar:lib/gt2-2.3.3/batik-parser-1.6.jar:lib/gt2-2.3.3/gt2-xml-gml2-2.3.3.jar:lib/gt2-2.3.3/gt2-referencing3D-2.3.3.jar:lib/jdom-1.1.jar:lib/jide-oss-2.8.8.jar edu.cmu.casos.OraUI.controller.OraMain

Cassandra's server starting error on OS X

I'm trying to set up apache cassandra on my OS X macbook. I'm trying to test NoSql databases, I've already set up memcached and redis. But with cassandra I'm having
I'm using jdk 1.7.0_09 from oracle
I've followed the installation instructions, but when I'm trying to start the server, I get this the issue from the console:
MacBook-Air-Urij:bin urijvoskresenskij$ ./cassandra -f
xss = -ea -javaagent:./../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms1024M -Xmx1024M -Xmn200M -XX:+HeapDumpOnOutOfMemoryError
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /var/log/cassandra/system.log (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:136)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:395)
at org.apache.log4j.PropertyWatchdog.doOnChange(PropertyConfigurator.java:922)
at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
at org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:914)
at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:461)
at org.apache.cassandra.service.AbstractCassandraDaemon.initLog4j(AbstractCassandraDaemon.java:100)
at org.apache.cassandra.thrift.CassandraDaemon.<clinit>(CassandraDaemon.java:61)
INFO 17:40:17,717 Logging initialized
INFO 17:40:17,720 JVM vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.7.0_09
INFO 17:40:17,720 Heap size: 1052770304/1052770304
INFO 17:40:17,721 Classpath: ./../conf:./../build/classes/main:./../build/classes/thrift:./../lib/antlr-3.2.jar:./../lib/apache-cassandra-1.1.7.jar:./../lib/apache-cassandra-clientutil-1.1.7.jar:./../lib/apache-cassandra-thrift-1.1.7.jar:./../lib/avro-1.4.0-fixes.jar:./../lib/avro-1.4.0-sources-fixes.jar:./../lib/commons-cli-1.1.jar:./../lib/commons-codec-1.2.jar:./../lib/commons-lang-2.4.jar:./../lib/compress-lzf-0.8.4.jar:./../lib/concurrentlinkedhashmap-lru-1.3.jar:./../lib/guava-r08.jar:./../lib/high-scale-lib-1.1.2.jar:./../lib/jackson-core-asl-1.9.2.jar:./../lib/jackson-mapper-asl-1.9.2.jar:./../lib/jamm-0.2.5.jar:./../lib/jline-0.9.94.jar:./../lib/json-simple-1.1.jar:./../lib/libthrift-0.7.0.jar:./../lib/log4j-1.2.16.jar:./../lib/metrics-core-2.0.3.jar:./../lib/servlet-api-2.5-20081211.jar:./../lib/slf4j-api-1.6.1.jar:./../lib/slf4j-log4j12-1.6.1.jar:./../lib/snakeyaml-1.6.jar:./../lib/snappy-java-1.0.4.1.jar:./../lib/snaptree-0.1.jar:./../lib/jamm-0.2.5.jar
INFO 17:40:17,722 JNA not found. Native methods will be disabled.
INFO 17:40:17,734 Loading settings from file:/Users/urijvoskresenskij/apache-cassandra-1.1.7/conf/cassandra.yaml
INFO 17:40:17,924 DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
INFO 17:40:18,149 Global memtable threshold is enabled at 334MB
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:317)
at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:219)
at org.xerial.snappy.Snappy.<clinit>(Snappy.java:44)
at org.apache.cassandra.io.compress.SnappyCompressor.create(SnappyCompressor.java:46)
at org.apache.cassandra.io.compress.SnappyCompressor.isAvailable(SnappyCompressor.java:56)
at org.apache.cassandra.io.compress.SnappyCompressor.<clinit>(SnappyCompressor.java:38)
at org.apache.cassandra.config.CFMetaData.<clinit>(CFMetaData.java:76)
at org.apache.cassandra.config.KSMetaData.systemKeyspace(KSMetaData.java:84)
at org.apache.cassandra.config.DatabaseDescriptor.loadYaml(DatabaseDescriptor.java:438)
at org.apache.cassandra.config.DatabaseDescriptor.<clinit>(DatabaseDescriptor.java:114)
at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:127)
at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:389)
at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:106)
Caused by: java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at org.xerial.snappy.SnappyNativeLoader.loadLibrary(SnappyNativeLoader.java:52)
... 17 more
WARN 17:40:18,269 Cannot initialize native Snappy library. Compression on new tables will be disabled.
ERROR 17:40:18,317 Exception encountered during startup
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:155)
at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:389)
at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:106)
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:155)
at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:389)
at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:106)
Exception encountered during startup: Directory /var/lib/cassandra/data is not accessible.
</pre></code>
I don't know how to solve the problem. Please, help me, guys :)
You don't have permission to write to /var/log, which is to be expected. You'll need to run Cassandra as sudo or create the directory yourself with the proper permissions.
config/cassandra.yaml - contains paths to all folders required by Cassandra. Change those paths to place where your user has write access so that you do not need to run it as sudo.
I think a potentially less intrusive solution for working on local dev machines is not to mess with root permissions at all. Just change the log locations to anywhere you want by editing the log4j properties file in the <cassandra_install_dir>/conf directory.

Unable to get thread dump? Any ideas why my app blocks?

I have a basic java server app that has 100 worker threads that do simple HEAD requests on urls. I'm using HttpClient 4.x for this.
A few minutes into the run my program just freezes for a couple minutes and I cannot figure out why. Check out the screen shot of what visual vm monitor reports. You can see it flatline. During this time I'm unable to get a good thread dump and visual vm just freezes until it's unblocked. Does anyone have any ideas on what I can do to try and start debugging this guy?
Visual VM: http://tinypic.com/view.php?pic=2i915bs&s=7
Here is the output when I tried to take a jstack dump while it was frozen:
jstack -F 4325
Attaching to process ID 4325, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 16.3-b01
Deadlock Detection:
No deadlocks found.
Thread 4557: (state = BLOCKED)
Error occurred during stack walking:
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.execute(LinuxDebuggerLocal.java:152)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet(LinuxDebuggerLocal.java:466)
at sun.jvm.hotspot.debugger.linux.LinuxThread.getContext(LinuxThread.java:65)
at sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess.getCurrentFrameGuess(LinuxAMD64JavaThreadPDAccess.java:92)
at sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:256)
at sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:218)
at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:76)
at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
at sun.jvm.hotspot.tools.JStack.run(JStack.java:60)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.tools.jstack.JStack.runJStackTool(JStack.java:118)
at sun.tools.jstack.JStack.main(JStack.java:84)
Caused by: sun.jvm.hotspot.debugger.DebuggerException: get_thread_regs failed for a lwp
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.getThreadIntegerRegisterSet0(Native Method)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.access$800(LinuxDebuggerLocal.java:51)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1GetThreadIntegerRegisterSetTask.doit(LinuxDebuggerLocal.java:460)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$LinuxDebuggerLocalWorkerThread.run(LinuxDebuggerLocal.java:127)
I've seen several bug reports about jstack on Linux with a similar trace:
JVM Bug Id: 6494722 (is supposed to be fixed)
Ubuntu Bug #597098 (this one is not)
Do you get the same result with a kill -3 <pid>?
Very likley due to too much memory usage causing GC. Add the params to java:
-verbosegc -XX:+PrintGCDetails
And see if you notice anything obvious in the output/logs
What worked for me was running jstack as the process owner without -F.

Categories

Resources