{"id":6543,"date":"2014-04-20T08:18:12","date_gmt":"2014-04-20T08:18:12","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/exceptionkohanarelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-04-20T08:18:12","modified_gmt":"2014-04-20T08:18:12","slug":"exceptionkohanarelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/20\/exceptionkohanarelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"exception,kohanaRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/aac3dab4f3f535a93d28bc370a5552d6?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nLoom<br \/>\nc++ exception-handling exception logging<br \/>\nI have some function like:void foo() { &#8230; }int main() {&#8230;try {&#8230;foo();&#8230;} catch (const std::exception &amp;e) {std::cout &lt;&lt; &#8220;Fatal error: e.what() &lt;&lt; std::endl();return;}&#8230; }If an exception is thrown from foo, I&#8217;d like to know it. Also I want to know the reason of the original exception. I can split the code like this:int main() {&#8230; try {&#8230; } catch (const std::exception &amp;e) {std::cout &lt;&lt; &#8220;Fatal error: &#8221; &lt;&lt; e.what() &lt;&lt; std::endl;return;}try {foo();} catch<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/2WlWO.png?s=32&amp;g=1\" \/><br \/>\nHAL9000<br \/>\nmysql stored-procedures cursors exception<br \/>\nI&#8217;ve seen two different approaches of cursor handling is MySQL stored procedures. Now I&#8217;m curious about their stability, due to potential MYSQLEXCEPTION risks in stored routines.Assuming, that CURSOR is opened when DBMS raises MYSQLEXCEPTION and goes to EXIT HANDLER if it is declared&#8230;Approach #1:DELIMITER $$CREATE PROCEDURE `test1`() BEGIN DECLARE `EOS` BOOLEAN DEFAULT FALSE;DECLARE `buffer` INT UNSIGNED;DECLARE `MyCursor` CURSOR FOR SELECT`id` FROM`MyTable` LIMIT 50;DECLARE EXIT HANDLER FOR M<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0c2672d183877f7fcd8d46970ef03f1f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHLGEM<br \/>\npostgresql insert exception trigger<br \/>\nI am trying to write my first trigger. It is an insert trigger as follows:&lt;b&gt;Fatal error&lt;\/b&gt;: postgres7 error: [-1: ERROR: INSERT has more target columns than expressions at character 78INSERT INTO dash_pre_queue(ord_obj_guid,ord_entry_type_guid,client_obj_guid, installer_obj_guid, installer_serial_number, datetime, ord_proc_state_guid,created,ord_esc_type_guid,in_error,ord_entry_guid) SELECT(ord_obj_guid,NULL,client_obj_guid,inst_obj.inst_obj_guid,inst_obj.installer_serial_number<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/kTA5j.jpg?s=32&amp;g=1\" \/><br \/>\nchintan khetiya<br \/>\nandroid database http exception<br \/>\nHelp me please with error FATAL EXCEPTION mainI have this error when new activity starts.my code:package com.novator.inweld;import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader;import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONArray; import org.json.JSONObject;import android<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a1239b17791ce881e07cddf9d3e140a6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2619284<br \/>\nandroid multithreading exception android-asynctask<br \/>\nI load an image in Bitmap from the javaCameraView. This one is send to async task in order to send it to php file. During the first-second there is no problem. After this time, I have a problem of thread but I don&#8217;t find a solution. This is the LogCat : 07-25 16:36:29.492: E\/AndroidRuntime(17507): FATAL EXCEPTION: AsyncTask #507-25 16:36:29.492: E\/AndroidRuntime(17507): java.lang.RuntimeException: An error occured while executing doInBackground()07-25 16:36:29.492: E\/AndroidRuntime(17507): a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ac4572644f8ce05ca4872a6f11e6e3b2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1880779<br \/>\njava android listview exception listactivity<br \/>\nI&#8217;m getting this error whenever I&#8217;m trying to start this activity :01-31 02:19:19.558: E\/AndroidRuntime(1318): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.prva\/com.example.prva.ListView}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is &#8216;android.R.id.list&#8217;ListActivity :package com.example.prva;import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.support.v4.widget.SimpleCurso<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/03bd50976dcef418cc200511e9cd9dd9?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSusanna<br \/>\nandroid exception processing minim<br \/>\nI&#8217;m running Processing 2.02 in Windows 8, have jre 7 installed, running an emulator created for API level 11, using the latest Minim version (as of 9\/20\/2013). I wrote a test sketch to make sure I can run things to the emulator (a canvas 100&#215;100 green with a simple line drawn). This works. I then wrote a sketch to test out Minim playing a mp3 sound snippet. The mp3 file is about 201K and is in the data folder The sketch works in java but fails when I switched to Android mode.Can someone please<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6c046fcc635a064a9dfc175b9e910663?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWilliam<br \/>\njava android exception<br \/>\nI am trying to ad admob ads to my app but I am getting this error in the logcat when it launches. The app ran fine before I added the admob so I think it&#8217;s something to do with that.03-16 19:08:00.683: E\/AndroidRuntime(529): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.musicbynumbers.scalesads\/com.musicbynumbers.scalesads.MainMenu}: java.lang.NullPointerException 03-16 19:08:00.683: E\/AndroidRuntime(529): at android.app.ActivityThread.performLaunchActivity(ActivityThre<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f9b8d4314688da411884d1168a3170b9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbilal.haider<br \/>\nandroid eclipse exception main<br \/>\nWith my friends, we&#8217;re working in a project and for it i need to create an andoid application. (i specify, i&#8217;m a beginner at programming in java) So to start i&#8217;ve follow a good tutorial (http:\/\/www.buildcircuit.com\/sensorgraph-using-android-amarino-and-arduino\/) it explain how to create a connection enter your arduino (microcontroller) and your arduino with amarino (bluetooth).The program retrieves the value of the variable voltage and displays it on the phone.But i&#8217;ve trouble, my program doesn<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ac4572644f8ce05ca4872a6f11e6e3b2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1880779<br \/>\njava android exception button onclicklistener<br \/>\nApplication crashes and I&#8217;m getting this error :02-19 13:48:34.168: E\/AndroidRuntime(1070): FATAL EXCEPTION: main 02-19 13:48:34.168: E\/AndroidRuntime(1070): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.prva\/com.example.prva.MainMenu}: java.lang.NullPointerException02-19 13:48:34.168: E\/AndroidRuntime(1070): Caused by: java.lang.NullPointerException 02-19 13:48:34.168: E\/AndroidRuntime(1070): at com.example.prva.MainMenu.onCreate(MainMenu.java:49)When I try<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/nZEUQ.png?s=32&amp;g=1\" \/><br \/>\nPeeHaa<br \/>\nkohana php<br \/>\nI got a fatal error at auto_load function. See the following error, indicating that the specific directory and file &#8216;\/mnt\/webDir\/www\/sossage\/system\/classes\/kohna\/log.php&#8217; file failed opening required. Yes, file doesn&#8217;t exist. Its&#8217;s wrong path. But, I never write the code, also can&#8217;t find anywhere using &#8216;find&#8217; option on my web root.Fatal error: Kohana_Core::auto_load(): Failed opening required &#8216;\/mnt\/webDir\/www\/mysite\/system\/classes\/kohna\/log.php&#8217; (include_path=&#8217;.:\/usr\/share\/php:\/usr\/share\/pear&#8217;)<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MGhY2.png?s=32&amp;g=1\" \/><br \/>\nhakre<br \/>\nphp kohana kohana-3<br \/>\nI&#8217;m using Kohana 3.2 with Controller_Template. Basically what I would like to do is to check the ACL of each action_method. If fail, load the access denied view and skip the rest of the action_method code; else continue loading. I know I could use an if&#8230;else statement to do a simple boolean check (or even do a if(check_permission())return;), but I hope there is a more elegant way of handling it with the least amount of extraneous code in the action_page()&#8230; if possible, just check_permission(<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6f86dcf955db83f6f9037d36efe39be2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLaxus<br \/>\nphp kohana<br \/>\nI&#8217;m giving a look at kohanaphp, and I was perplexed by the internal management of errors. When you initialize the framework, Kohana gives you the ability to disable the internal management of errors. When enabled, all errors (NOTICE, WARNING, etc..) are converted into using ErrorException exceptions. (http:\/\/php.net\/manual\/en\/class.errorexception.php)Kohana makes large use this system to detect errors generated by php, in the form of exceptions. Example:try {$this-&gt;_connection = mysql_connect<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e96a421d76c1fc107a5d291c6999b2ef?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nalex<br \/>\nphp session error-handling kohana kohana-3<br \/>\nI am using the Kohana 3 framework, and am using the native session driver.For some reason, occasionally the sessions fail to write to their file.Warning: session_start() [function.session-start]: open(\/tmp\/sess_*****, O_RDWR) failed: Permission denied (13) in \/home\/site\/public_html\/system\/classes\/kohana\/session\/native.php on line 27I am pretty sure Kohana has its own in built error handler, but it is not triggered with this error (i.e. it shows up like a normal PHP error, not the Kohana error).<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/58b9987fd8faa22f83983424d2b5af72?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndiggersworld<br \/>\nphp kohana uri kohana-3 route<br \/>\nRecently I&#8217;ve been doing some research into SEO and how URIs that use hyphens or underscores are treated differently, particularly by Google who view hyphens as separators.Anyway, eager to adapt my current project to meet this criteria I found that because Kohana uses function names to define pages I was receiving the unexpected &#8216;-&#8216; warning.I was wondering whether there was any way to enable the use of URIs in Kohana like:http:\/\/www.mysite.com\/controller\/function-nameObviously I could setup a ro<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/79c9bc685d8209f3c06a94fb14febaae?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJGSilva<br \/>\nphp kohana kohana-3.2<br \/>\nI&#8217;m testing Kohana AutoModeler, but I think it is an PHP lack of knowledge.I have just set it up and got this error ErrorException [ Parse Error ]: syntax error, unexpected &#8216;[&#8216; in \/classes\/context\/user\/add\/factory.php.When I open the file, Dreamweaver did not recognize this line protected $_data = []; and this line public function __construct(array $data = []) probably because of [].In fact I did not find what is the meaning of $var = [] or how could a resolve this.Any help you&#8217;d be appreciated<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f8f3db32ac21fcbc85c5464079a87c2b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmatino<br \/>\nphp kohana kohana-3<br \/>\nI have 1 controller to load and render the image.&lt;?php defined(&#8216;SYSPATH&#8217;) or die(&#8216;No direct script access.&#8217;);class Controller_Image extends Controller {public function action_topo($id=NULL) {$fornecedor = ORM::factory(&#8216;provider&#8217;)-&gt;where(&#8216;nometag&#8217;, &#8216;=&#8217;, $this-&gt;request-&gt;param($id))-&gt;find();if ($fornecedor-&gt;loaded()) {$local = &#8216;media\/fornecedor\/&#8217; . $fornecedor-&gt;nometag . &#8216;\/&#8217; . $fornecedor-&gt;sis_foto_baner; $image = Image::factory($local);$data = $image-&gt;render(N<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/af53df55a922697b7e18d4909f18af02?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJeremyFelix<br \/>\nphp kohana<br \/>\nAs detailed here: Need assistance with Kohana 3 and catch all route turning into a 404 error as the accepted answer to the question, I&#8217;m attempting to catch errors thrown by Kohana to display pretty error pages and send correct HTTP codes.Here&#8217;s a simplified version to demonstrate the problem:try {\/\/ Instantiate your Request object$request = Request::instance();\/\/ The give it a try, to see if its a valid request$request-&gt;execute(); } catch (Kohana_Request_Exception $e) {header(&#8216;Content-Type:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c4244a66941d915f8e287fe5cb07b526?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAlexander Suhenko<br \/>\nkohana kohana-3 kohana-3.3<br \/>\nMy kohana 3.3 site contains page, which I implemented like:$block_center = &#8216;here is html form&#8217;; $this-&gt;template-&gt;block_center = array($block_center);Of course, I used constructions like View::factory(&#8216; .. &#8216;)-&gt;bind &#8230; &#8211; doesn&#8217;t matters (result is the same).When running site on xampp v3.0.12, It works correctly. But when I run it on hosting (Apache\/2.2.22 (Unix) PHP\/5.3.8) &#8211; the fun starts: Four unexpected symbols appear on top of the page before html tag (for example: 5aeb) and after \/h<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/86f591892bea8a3749828d0f65d74acb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkromol<br \/>\nphp internationalization kohana<br \/>\nHow can I change default locale that is defined in locale.php file in Kohana 2.3.4 in runtime?I use Kohana::config_set(&#8216;locale.language&#8217;, array(&#8216;en&#8217;, &#8216;United States&#8217;)); but after redirect it doesn&#8217;t work, it gets default value(from locale.php).Thanks<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Loom c++ exception-handling exception logging I have some function like:void foo() { &#8230; }int main() {&#8230;try {&#8230;foo();&#8230;} catch (const std::exception &amp;e) {std::cout &lt;&lt; &#8220;Fatal error: e.what() &lt;&lt; std::endl();return;}&#8230; }If an exception is thrown from foo, I&#8217;d like to know it. Also I want to know the reason of the original exception. I can split the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6543","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6543"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6543\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}