Jforex Troubleshouting... (part 2)
Prologue: In my last article one user posted a comment asking about how to clear Java cache on Mac OSX. I don't have a Apple Mac but you can find usefull information about it clicking here. Just use it if you need.
In continuation of previous articles about JForex (JForex in one click and JForex troubleshouting) we are going deeper on the last one in this article. There are ocasions that we face some errors in JForex, and clearing Java cache doesn't solve them. We contact Dukascopy Support with screens, account, trade, strategy code, and all information we think that is needed to solve the problem. However we can provide some more detailed information with the logs generated by Java Virtual Machine (Think about it as a operating system for JForex such as your real operating system is for your computer). In this article we are going talk about the access to Java Console, how to save the logs and where they are located. Here, we will focus on Windows operating system but if you have any questions about other operating systems just comment the article or send me a private message and i will try to help or indicate a way to find a answer.
Java Console is hidden by default on Java instalation for Java WebStart. To get access we have to activate it. To do that we need to open Java Control Panel and we do this with the instructions in my last article where you can read about it by clicking here. After we open Java Control Panel we click in "Advanced" tab and there we have a tree of settings. We focus on the first two nodes we need for this task. The first one - "Debugging" node - (indicated by arrow 1 on the following image) we check all the options if we want to store automatically all the logs. Later i will inform where you can get/see this logs but i won't go for the internal details of them. All we need eventually is send them to Dukascopy Support. The second - "Java Console" node - is where we are going to activate the visualization of Java Console when we run JForex. For that we check the option "Show console". Finish by clicking "Apply" followed by "OK" and we are ready to have logs stored and/or see console output depending on the options chosen.
After that, when we run JForex Client, and if we activated the console, we get an aditional window where is displayed the console output as we can see in next image. At the top of the the text window is displayed some information about Java: the Java Webstart version, the Java version that is in use, and the path to "home" of the actual user running it. After we have several options, i will explain the needed ones below.
This options are executed by pressing the correspondent letter or number in keyboard with console window active:
- 0 - 5 (one of the numbers between 0 and 5) - define the detail of logs. The higher the number, the greater the detais of the logs (Saying it in a simple way). Usually while debugging i use the last one.
- c - Clears the content of console window.
- f - If some java objects that are queued for finalization, they are finalized.
- g - Cleans memory removing all objects that are checked for deletion.
- m - Displays memory allocated to Java Virtual Machine and the memory in use by JForex in KB. Also, we get the free memory available on JVM (Note that JVM can allocate more memory if needed). Here we can see if there are some problems in memory utilization if the values are too high.
- o - If we don't activated to store the logs automatically in Control Pannel before, we can redirect the output to the log files.
- s - Displays some system, java and JForex properties - usefull to see if we have something misconfigured in Java or JForex.
- t - Displays the running threads (all the "little parts" of JForex running) and their status - to see if any is missing, extra or wrong.
Usually we put this window minimized or behind JForex window. With JForex running we will try to reproduce the error by performing the steps for that to happen. We can also use it to see if we have connection problems normally at the startup of JForex or even later. When we want too see what happens "behind the scene", we maximize or we bring to front the Console Window. There, we can have a lot of information of what happened during this time. We get something like the next image.
Some lines are pretty easy to understand what happened, for others are needed some knowledge of Java programming language. If we are contacting Dukascopy Support to help us with the problem, we can send to them this information. To do that, all we need to do is to save all this information to a plain text file. To do this we click in "Copy" button of Java Console window (the contents of the log is placed on the clipboard). After, you can paste this content in a e-mail or community forum. Alternatively we can paste this content into a plain text file and use it later.
If on the other hand we chosed to automatically store the logs, every time we run JForex or other Java WebStart application, a log, a trace (extension on the name of the file) and some others files are created. If we want to send this files, we have to select the last two (.log and .trace) ones and not all of them. We can check this by the date of creation of the files. The place where this files are created and stored may depend on the version of windows we use. If we use Windows XP, 2000 or 2003 these files are stored in "C:\Documents and Settings\<user>\Application Data\Sun\Java\Deployment\log" where we replace "<user>" with our windows username. If we use Windows Vista, 2008, Seven or Eight they are in "C:\Users\<user>\AppData\LocalLow\Sun\Java\Deployment\log". As before, change "<user>" to match your windows username.
Finally, if we want to restore to the old settings, we do the inverse steps in Java Control Panel: uncheck all checkboxes on "Debugging" node and/or select "Hide java console" on "Java console" node.
I hope you don't need this article, it means likely everything is running smoothly, but who knows...
If needed, i hope you find some utility for it such as my two previous articles. Please comment your toughts or opinions as they can be important to our community.
Trade well and good luck.
Disclaimer: this text maybe not accurate at any level because of the lack of experience of the author. It's just a history that describes the path of the autor learning Forex markets, the trade actions and some personal tougths and the share of them with Dukascopy Community. The natural language of the autor don't is the english language, and that may reflect some errors along the text. Thanks in advance for compreension of this facts.