Showing posts with label troubleshoot. Show all posts
Showing posts with label troubleshoot. Show all posts

Tuesday, June 16, 2020

SBT Troubleshoot: Error on SBT Scala Compilation Because of Incompatible Java Version

Have you ever getting this kind of problem when trying to run your SBT command to compile your Scala code?


$ sbt compile
[info] Done updating.
error: error while loading String, class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/null)
[error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
[error]         at java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:176)
[error]         at scala.tools.nsc.classpath.JrtClassPath.asURLs(DirectoryClassPath.scala:204)




Usually, this problem happens the first time you set up your project on your computer. This happens because you're using an incompatible Java version to compile your scala code. You can check the scala to Java compatibility in this page https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

Now, how can you fix this? You need to find out which Java version is being used by SBT and then set the correct one to use. Do you try to use java -version command?

$ java -version



While the java -version command helps you telling which java is being used by your system, SBT might use a different version. For SBT specific, you can use sbt -J-showversion command as follow:

$ sbt -J-showversion
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (Zulu 8.33.0.1-macosx) (build 1.8.0_192-b01)
OpenJDK 64-Bit Server VM (Zulu 8.33.0.1-macosx) (build 25.192-b01, mixed mode)



After knowing your Scala compatibility and your SBT's Java version you can follow any of these solutions in this page https://users.scala-lang.org/t/telling-sbt-to-use-different-jdk-version/4608/10

I hope this helps anyone having a similar problem.

Wednesday, October 5, 2016

Ubuntu Troubleshoot: Fixing missing and flickering mouse cursor

After fresh install Ubuntu I found that sometimes my mouse cursor is missing and flickering so much. In order to solve this problem we need to disable unknown displays settings as explained below.

1. Open Displays settings from Ubuntu Start Menu.

Open Displays Settings

2. If you are lucky you will see two rectangles shape in the Displays window (red and green). Click on the green colored rectangle with "Unknown Display" on it, as seen below.

Displays Settings "Unknown Display"

3. As you can see in previous image, the Unknown Display is turned on. Click on the switch to turn it off. Then click on "Apply" button.

Turned off Unknown display

That's how I fixed my problem with the mouse cursor. If you find this tips helpful, please leave a comment below. Thank you :)


Saturday, February 27, 2016

Wordpress Troubleshoot: Error Updating Plugins After Upgrade My PHP Version to PHP7



Today, I really surprised that I can't update any plugins in my Wordpress website. All of function were working well but still can't update any plugins. I though only this one site was broken until I opened my other site and it was broken too!!! What happened!? That was like a nightmare :((
Then, I searched for the error log in the Wordpress admin directory and there were many errors occurred. Here are some of the error messages.

[25-Feb-2016 14:47:10 UTC] PHP Fatal error:  Uncaught Error: Function name must be a string in /wp-content/plugins/shareaholic/lib/social-share-counts/curl_multi_share_count.php:53
Stack trace:
#0 /wp-content/plugins/shareaholic/public.php(444): ShareaholicCurlMultiShareCount->get_counts()
#1 /wp-includes/plugin.php(525): ShareaholicPublic::share_counts_api('')
#2 /wp-admin/admin-ajax.php(89): do_action('wp_ajax_shareah...')
#3 {main}  thrown in /wp-content/plugins/shareaholic/lib/social-share-counts/curl_multi_share_count.php on line 53 
[25-Feb-2016 14:51:48 UTC] PHP Fatal error:  Uncaught Error: Function name must be a string in /wp-content/plugins/shareaholic/lib/social-share-counts/curl_multi_share_count.php:53
Stack trace:
#0 /wp-content/plugins/shareaholic/public.php(444): ShareaholicCurlMultiShareCount->get_counts()
#1 /wp-includes/plugin.php(525): ShareaholicPublic::share_counts_api('')
#2 /wp-admin/admin-ajax.php(99): do_action('wp_ajax_nopriv_...')
#3 {main}  thrown in /wp-content/plugins/shareaholic/lib/social-share-counts/curl_multi_share_count.php on line 53 
[26-Feb-2016 23:16:50 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /wp-content/plugins/author-or-user-image/author_image.php:107
Stack trace:
#0 /wp-includes/plugin.php(525): zm_author_image->adinit('')
#1 /wp-admin/admin.php(168): do_action('admin_init')
#2 /wp-admin/update-core.php(10): require_once('/')
#3 {main}  thrown in /wp-content/plugins/author-or-user-image/author_image.php on line 107 
I googled for those error messages and found nothing related except an old post related to deprecated function ereg() in the older version of PHP. Aha! Maybe that is the source of the problems. I remembered that I changed the PHP version of my hosting from PHP 5.6 to PHP 7 about two days ago. My hosting provider said that by upgrading the PHP version to PHP 7 would improve the performance of Wordpress up to 130% of current performance. I totally sold to that advertisement at that time and changed my PHP version immediately.

I opened my cpanel and quickly downgraded my PHP version to 5.6.  Everything is working well now. I can update my plugins now. :) Lesson learned, don't too quick adopt the latest technology until it is stable enough and widely use.

Please leave a comment bellow if you find it useful.

Tuesday, December 1, 2015

Laravel Troubleshoot: Get the composer install working

In my spare time, I started my new hobby project. And I chose Laravel framework for this project. After a few weeks working on this project, I changed my workspace and started with a new clone from my git repository. But when I tried to run :

$ php artisan serve

the code seemed not working. I got this kind of error:

require(../bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in .../bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /../bootstrap/autoload.php on line 17

And I realized that I forgot to run:

$ composer install

a command to resolve all Laravel dependencies. But I got another error on that command :(

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/framework v5.0.14 -> satisfiable by laravel/framework[v5.0.14].
    - laravel/framework v5.0.14 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

So, I did my search on this error and found out that I needed to install another PHP extension my crypt with these commands:

$ sudo apt-get install mcrypt
$ sudo apt-get install php5-mycrypt
$ sudo php5enmod mcrypt

After that I ran the composer install to resolve all the dependencies and php artisan serve seemed to be working again :)

Tuesday, January 6, 2015

CPNTools Troubleshoot: Beta execution aborted Reference is none.

Long time no see. Installing CPNTools for Windows is easy, but today I have a problem when installing cpntools on a Windows Server 2008. Actually the problem was not within the installation process but I can't run the CPNTools because there was an error that keep saying "CreateWindow failed. Error: 0. Create Child Window failed. Error 1406. # Beta execution aborted: Reference is none. # Error during dump: Access violation. Abortion." and creating a quite long dump file. 

I did searching for the error, and followed some guides like:
  • reinstalled the JDK/JRE.
  • made sure the system environment variable JAVA_HOME points to the installation location (e.g., c:\Program Files\Java\jre8)
  • made sure my PATH includes the bin directory under JAVA_HOME (in the example, it would have to include c:\Program Files\Java\jre8\bin).

But none of them worked. So I keep searching, but still no answer. And suddenly I remembered that there is a feature which is called Data Execution Prevention (DEP). DEP is a security feature that can help prevent damage to your computer from viruses, harmful programs, and other security threats. But sometimes DEP can also prevent your programs from being executed, and this also happened to my CPNTools. So to solve this I needed to add my cpntools.exe

You can solve it by following this step: 
Control Panel -> System and Security -> System -> Advanced System Settings.
It will open the System Properties Dialog and move to the Advanced tab and click the "Settings" button. Another dialog will be opened, and you need to go to "Data Execution Prevention" tab and add the cpntools.exe to the whitelist. And now my CPNTools works nicely. :D

======================================================
Bellow is the complete content of my cpntools.dump:

Beta execution aborted: Reference is none.

Call chain: (nti_ms)

  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
  item <*> in ~beta/guienv/private/winnt/guienv_ntibody
    -- * in ~beta/guienv/guienv
  item <*> in ~beta/guienv/guienv
    -- frame# in ~beta/guienv/guienv
  item <frame#> in ~beta/guienv/guienv
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
  item <*> in ~beta/guienv/guienv
    -- size# in ~beta/guienv/guienv
  item <size#> in ~beta/guienv/guienv
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
  item <create#>create# in ~beta/guienv/guienv
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
  item create#<create#> in ~beta/guienv/guienv
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
  item <*> in ~beta/guienv/private/winnt/guienv_ntibody
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
  item open#open#<open#> in ~beta/guienv/guienv
    -- main#window#interfaceObject# in ~beta/postwimp/foundation/guisurface
  item <init#>init# in ~beta/postwimp/foundation/guisurface
    -- GUISurface#Surface# in ~beta/postwimp/foundation/guisurface
  item init#<init#> in ~beta/postwimp/foundation/abstractsurface
    -- GUISurface#Surface# in ~beta/postwimp/foundation/guisurface
  item <*> in ~beta/postwimp/foundation/private/worldbody_nti
    -- * in ~beta/postwimp/foundation/private/worldbody_nti
  item <*> in ~beta/postwimp/foundation/private/worldbody_nti
    -- platformSetWindowEnv# in ~beta/postwimp/foundation/private/worldbody
  item <platformSetWindowEnv#> in ~beta/postwimp/foundation/private/worldbody
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
  item <setWindowEnv#> in ~beta/postwimp/foundation/world
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
  item <start#> in ~beta/guienv/private/winnt/guienvntsystemenvbody
    -- PIOPRIVATE-~ in ~beta/guienv/private/winnt/guienvntsystemenvbody
  comp <BASICSCHEDULER-~>SysHead# in ~beta/guienv/private/winnt/guienvntsystemenvbody
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
  comp BASICSCHEDULER-~<SysHead#> in ~beta/basiclib/basicsystemenv
    -- BETAENV-~ in ~beta/basiclib/betaenv

  item <*> in ~beta/basiclib/betaenv
    -- BETAENV-~ in ~beta/basiclib/betaenv
  basic component in ~beta/basiclib/betaenv


Low level information:

Call chain: (nti_ms)

  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97Warning! nm(DumpSectionTable): Couldn't find section number of .text
 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <handleframeChanged#> in ~beta/guienv/private/winnt/guienv_ntiprivate
  { PC  0x49cb97 < +0x2ecb96>, object 0x2977938, proto 0x9ae2e2 handleframeChanged# [ast: 0x0008,0x0003] < +0x7fe2e1> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <*> in ~beta/guienv/private/winnt/guienv_ntibody
  { PC  0x4a0d9b < +0x2f0d9a>, object 0x29777b8, proto 0x9a8262 * [ast: 0x0069,0x0002] < +0x7f8261> }
    -- * in ~beta/guienv/guienv
    { Surrounding object 0x2977748, proto 0x9bad8e * [ast: 0x0001,0x071f] < +0x80ad8d> }
  item <*> in ~beta/guienv/guienv
  { PC  0x4a091f < +0x2f091e>, object 0x2977748, proto 0x9bad8e * [ast: 0x0001,0x071f] < +0x80ad8d> }
    -- frame# in ~beta/guienv/guienv
    { Surrounding object 0x2977718, proto 0x9bad56 frame# [ast: 0x0001,0x0717] < +0x80ad55> }
  item <frame#> in ~beta/guienv/guienv
  { PC  0x4a1425 < +0x2f1424>, object 0x2977718, proto 0x9bad56 frame# [ast: 0x0001,0x0717] < +0x80ad55> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <*> in ~beta/guienv/guienv
  { PC  0x4a1235 < +0x2f1234>, object 0x2977628, proto 0x9baecc * [ast: 0x0001,0x075f] < +0x80aecb> }
    -- size# in ~beta/guienv/guienv
    { Surrounding object 0x29775f0, proto 0x9bae9e size# [ast: 0x0001,0x0757] < +0x80ae9d> }
  item <size#> in ~beta/guienv/guienv
  { PC  0x444681 < +0x294680>, object 0x29775f0, proto 0x9bae9e size# [ast: 0x0001,0x0757] < +0x80ae9d> }
    -- windowContents#canvas#windowitem#interfaceObject# in ~beta/guienv/private/winnt/guienv_ntiprivate
    { Surrounding object 0x2974020, proto 0x9afe0a windowContents# [ast: 0x0007,0x003f] < +0x7ffe09> }
  item <create#>create# in ~beta/guienv/guienv
  { PC  0x443ab3 < +0x293ab2>, object 0x2976558, proto 0x9bbeea create# [ast: 0x0001,0x0a0d] < +0x80bee9> }
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x2976518, proto 0x9a40f2 open# [ast: 0x0001,0x08ae] < +0x7f40f1> }
  item create#<create#> in ~beta/guienv/guienv
  { PC  0x49864a < +0x2e8649>, object 0x2976558, proto 0x9b8f46 create# [ast: 0x0001,0x01a5] < +0x808f45> }
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x2976518, proto 0x9a40f2 open# [ast: 0x0001,0x08ae] < +0x7f40f1> }
  item <*> in ~beta/guienv/private/winnt/guienv_ntibody
  { PC  0x4986ce < +0x2e86cd>, object 0x2976548, proto 0x9a6e34 * [ast: 0x0021,0x0002] < +0x7f6e33> }
    -- open#open#open# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x2976518, proto 0x9a40f2 open# [ast: 0x0001,0x08ae] < +0x7f40f1> }
  item open#open#<open#> in ~beta/guienv/guienv
  { PC  0x498676 < +0x2e8675>, object 0x2976518, proto 0x9b8f14 open# [ast: 0x0001,0x01a1] < +0x808f13> }
    -- main#window#interfaceObject# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x29735c8, proto 0x9a4090 main# [ast: 0x0001,0x08a8] < +0x7f408f> }
  item <init#>init# in ~beta/postwimp/foundation/guisurface
  { PC  0x48ed08 < +0x2ded07>, object 0x2976458, proto 0x9a46a8 init# [ast: 0x0001,0x0b59] < +0x7f46a7> }
    -- GUISurface#Surface# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x2973258, proto 0x9a3236 GUISurface# [ast: 0x0001,0x0048] < +0x7f3235> }
  item init#<init#> in ~beta/postwimp/foundation/abstractsurface
  { PC  0x739047 < +0x589046>, object 0x2976458, proto 0xad4702 init# [ast: 0x0001,0x0b45] < +0x924701> }
    -- GUISurface#Surface# in ~beta/postwimp/foundation/guisurface
    { Surrounding object 0x2973258, proto 0x9a3236 GUISurface# [ast: 0x0001,0x0048] < +0x7f3235> }
  item <*> in ~beta/postwimp/foundation/private/worldbody_nti
  { PC  0x48d8a3 < +0x2dd8a2>, object 0x2973248, proto 0x9a2cec * [ast: 0x0008,0x0039] < +0x7f2ceb> }
    -- * in ~beta/postwimp/foundation/private/worldbody_nti
    { Surrounding object 0x2972f38, proto 0x9a2cc0 * [ast: 0x0008,0x0002] < +0x7f2cbf> }
  item <*> in ~beta/postwimp/foundation/private/worldbody_nti
  { PC  0x48d792 < +0x2dd791>, object 0x2972f38, proto 0x9a2cc0 * [ast: 0x0008,0x0002] < +0x7f2cbf> }
    -- platformSetWindowEnv# in ~beta/postwimp/foundation/private/worldbody
    { Surrounding object 0x2972f08, proto 0xa11aaa platformSetWindowEnv# [ast: 0x0003,0x0003] < +0x861aa9> }
  item <platformSetWindowEnv#> in ~beta/postwimp/foundation/private/worldbody
  { PC  0x48d627 < +0x2dd626>, object 0x2972f08, proto 0xa11aaa platformSetWindowEnv# [ast: 0x0003,0x0003] < +0x861aa9> }
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
    { Surrounding object 0x2970c10, proto 0xa0e0a0 PROGRAM-~ [ast: 0x0001,0x0001] < +0x85e09f> }
  item <setWindowEnv#> in ~beta/postwimp/foundation/world
  { PC  0x631d6b < +0x481d6a>, object 0x2972ef8, proto 0xacf3ac setWindowEnv# [ast: 0x0001,0x1da3] < +0x91f3ab> }
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
    { Surrounding object 0x2970c10, proto 0xa0e0a0 PROGRAM-~ [ast: 0x0001,0x0001] < +0x85e09f> }
  item <start#> in ~beta/guienv/private/winnt/guienvntsystemenvbody
  { PC  0x44c4b7 < +0x29c4b6>, object 0x2972ee8, proto 0x96ddc4 start# [ast: 0x0005,0x01aa] < +0x7bddc3> }
    -- PIOPRIVATE-~ in ~beta/guienv/private/winnt/guienvntsystemenvbody
    { Surrounding object 0x2971f30, proto 0x96db8e PIOPRIVATE-~ [ast: 0x0005,0x0001] < +0x7bdb8d> }
  comp <BASICSCHEDULER-~>SysHead# in ~beta/guienv/private/winnt/guienvntsystemenvbody
  { PC  0x44ba90 < +0x29ba8f>, object 0x2972dc0, proto 0x96dade BASICSCHEDULER-~ [ast: 0x0002,0x0001] < +0x7bdadd> }
    -- PROGRAM-~CPNWorkSpace#Workspace#World#SystemEnv#SysHead# in C:/cpn2000/cpntools/cpntools
    { Surrounding object 0x2970c10, proto 0xa0e0a0 PROGRAM-~ [ast: 0x0001,0x0001] < +0x85e09f> }
  comp BASICSCHEDULER-~<SysHead#> in ~beta/basiclib/basicsystemenv
  { PC  0x740b4b < +0x590b4a>, object 0x2972dc0, proto 0xadb516 SysHead# [ast: 0x0001,0x0310] < +0x92b515> }
    -- BETAENV-~ in ~beta/basiclib/betaenv
    { Surrounding object 0x2970060, proto 0x94e3a0 BETAENV-~ [ast: 0x0001,0x0001] < +0x79e39f> }

  item <*> in ~beta/basiclib/betaenv
  { PC  0x48b24c < +0x2db24b>, object 0x2970b48, proto 0x9509aa * [ast: 0x0001,0x0c3c] < +0x7a09a9> }
    -- BETAENV-~ in ~beta/basiclib/betaenv
    { Surrounding object 0x2970060, proto 0x94e3a0 BETAENV-~ [ast: 0x0001,0x0001] < +0x79e39f> }
  basic component in ~beta/basiclib/betaenv

Legend:

The above dumps show the dynamic call stack of invoked objects.
Each dump starts at the object that was the current object when
the error occurred and continues down towards the basic component.
The descriptions have the following meaning:
1. Items are shown in two lines, like this:
      item <name#>pname1#pname2#pname3 in ifile
        -- sname#spname1#spname2 in sfile
   meaning that the item is an instance of the pattern "name" which
   has prefix "pname1" which has prefix "pname2", etc.
   This item is defined in the file "ifile".
   The part of the prefix chain enclosed in "<" and ">" indicates
   where in the action sequence the error occurred.
   The line beginning with "--" shows the textually surrounding
   pattern using the same notation.
2. The descriptor names used in the above description will normally
   have one or more "meta characters" appended. These mean:
      #  The descriptor belongs to a pattern, e.g. P: (# ... #)
      ~  Singular named descriptor, e.g. X: @(# ... #)
      *  Singular unnamed descriptor, e.g. ... ; (# ... #) ; ...
      -  Descriptor SLOT.
3. Components are shown using a notation similar to that of items:
      comp <name#>pname1#pname2#pname3 in cfile
4. The bottommost component corresponding to the basic environment is
   shown like an ordinary component, but indicated with
      basic component <name#>pname1#pname2#pname3 in cfile
5. In case the error occurred in some external code called from BETA,
   the top of the call stack is shown as
      [ EXTERNAL ACTIVATION PART ]
6. In case the BETA code has called some external code which has in
   turn called back into the BETA code, and the callback is still
   active at the point of the error, the intermediate call stack part
   is shown as
      [ EXTERNAL ACTIVATION PART ]
7. The section labeled "Low level information" can be avoided by
      set BETART=SimpleDump
   before subsequent executions of the program.

Tuesday, November 25, 2014

Ubuntu Troubleshoot: Ubuntu can't change display device brightness

After installing my Ubuntu 14.04 all control works fine except for the brightness controller. The brightness button on my keyboard is just fine and able to show the brightness level is changing, but the display brightness is not changing. To fix this I must add a new file named 20-intel.conf in the /usr/share/X11/xorg.conf.d/ directory and enter the below configuration as the content .

Section "Device"
Identifier  "card0"
Driver      "intel"
Option      "Backlight"  "intel_backlight"
BusID       "PCI:0:2:0"EndSection

and now my brightness controller works as I expect.


Thursday, November 6, 2014

WALA Tips: Problems/errors when you are trying to run WALA examples

Today I tried to run examples of WALA, and I found and tackled some problems that you might find also. I made this post to help me remember how I solve those problem. :).

For a complete configuration manual you can refer to this WALA wiki. Here are the problem list:

1. The import org.eclipse.pde.internal.core.PDEStateHelper cannot be resolved

I use the latest Eclipse version (Luna) when this post written. This problem happens when I tried to build the com.ibm.wala.ide project. There is EclipseProjectPath.java that you can find in com.ibm.wala.ide.util package, needs to import the org.eclipse.pde.internal.core.PDEStateHelper.

So to resolve this problem I downloaded the org.eclipse.pde.core_3.3.jar that contain  the org.eclipse.pde.internal.core.PDEStateHelper class. And add that file to my java build path libraries.  You can do that by right click you project, and then from the context menu you choose: 
"Build Path -> Configure Build Path...". It will open the project Java Build Path configuration dialog. After that you can open "Libraries" tab and then click "Add External JARs", it will open file browser and select you org.eclipse.pde.core_3.3.jar. Close your Java Build Path configuration dialog by clicking on "OK" button. Then try to build your project once again. Viola! I hope your error will vanish just like what I did. 


2. Problem when trying to run example 1 (the SWTTypeHierarchy) 

When you are trying to run example 1, SWTTypeHierarchy that you can find in com.ibm.wala.core.tests, probably you could get this error:

"{resource_loc:/com.ibm.wala.core.testdata/JLex.jar} "

or 

"com.ibm.wala.util.debug.UnimplementedError: java.io.FileNotFoundException"

This problem happen because the SWTTypeHierarchy expecting the JLex.jar to be found at com.ibm.wala.core.testdata directory. So what you need to do is put your JLex.jar file in the root of com.ibm.wala.core.testdata project root directory. After doing this step you will able to run the example 1 correctly. If successful, you should see a new window pop up with a tree view of the class hierarchy of JLex.

3. Problem when trying to run example 2 (the PDFTypeHierarchy)

When you are trying to run example 2, probably you're going to have several problems. First problem is the wala.properties configuration file. This configuration file contain path configuration of your java runtime directory "java_runtime_dir" and "output" directory. If you haven't yet created the wala.properties file you'll get this message:

"com.ibm.wala.util.WalaException: Unable to set up wala properties "

To solve that you need to create the wala.properties file in com.ibm.wala.core project dat directory. You can copy or rename the wala.properties.sample (that exist in the dat directory) into wala.properties. After that try to run the example once more and you'll get another error (sorry guys).

"java.io.IOException: property_file_unreadable wala.examples.properties"

To solve that you need to configure another file, the wala.examples.properties. This file contain executable path configuration of your pdf viewer and graphviz (you can install in Linux by using apt-get install graphviz). You need to create wala.example.properties in com.ibm.wala.core.tests project and put them in the dat directory. You can copy or rename the wala.example.properties.sample (that exisst in the dat directory) into wala.examples.properties. And then try to run once more your project. If there is another error please stay put with me. :). 

If you get these exceptions:

1. Exception in thread "main" com.ibm.wala.util.debug.UnimplementedError

Probably you didn't set the java runtime directory correctly in your wala.properties file. You must direct your path to the java jre library path. In case of my environment it should be like this: 

"/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/"

2. spawning process [null, -Tpdf, -o, com.ibm.wala.core/results/cg.pdf, -v, com.ibm.wala.core.tests/temp.dt]Exception in thread "main" 
java.lang.NullPointerException

Probably you haven't set your an output directory in your wala.properties file. Make sure to create the directory because WALA won't create it for you.

Please make sure you're checking your wala.properties and wala.examples.properties configuration files first. Make sure all properties are set correctly such as the java, output, dot_exe, and pdfview_exe paths. If all correctly configured you'll see the a PDF file representing the type hierarchy. 

Hope this post will help you. If you find another problem or you find this post help your problem, please leave a comment below. See you in my next post.


Finally, C# 9 record, the equivalent of Scala's case class

While C# is a wonderful programming language, there is something that I would like to see to make our life programmer easier. If you are fam...