Tuesday, November 15, 2016

[IOS Swift] NSUnknownKeyException, reason: [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key string


Hello everyone,

I just would like to write about these kind of inexplicable exceptions that are very common when we merge code in IOS:

Example1:
2016-11-15 04:46:28.168 Paging_Swift[15793:407011] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7ffdb9512510> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnClickMe.'
*** First throw call stack:

Example2:
2016-11-15 05:16:58.366 Paging_Swift[16020:422108] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fea38c2ee50> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key imageView.'


In order to fix this such inexplicable exceptions, you must understand - they are often a result of an unclean xib file. Open the xib in xcode, select File's Owner and click on the "Connection Inspector" (upper right arrow), to see all outlets at once. Look for !s which indicates a missing outlet.

So, if you go to your storyboard and the ViewController outlets that you are working on, you will probably find some of them with the '!' signal. Like this:




In this particular case, the specific a controller scene came from a different project, it was renamed as brand new viewController. In this case and for other cases that comes with this exception you can go in two different directions. Here they are:


  •  Rebuild the outlets.
  • Just change the class Name in the reference of this new project. Like this: to ViewControllerImage



After change it, you are going to see all the outlets working properly as below.


I hope it helps and happy coding,
Thiago Leoncio.





Saturday, October 8, 2016

Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /j_security_check

Hello everyone,


 Today I would like to share with you one error that took 2 days to get it fixed.


Running WebSphere over a RAD eclipse environment I've configured all the details related of JDBC connection, libraries needed for the project and so on.




But it fails in LDAP piece giving an error once I try to login in my application:

Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /j_security_check




Here it's what I had in my WebSphere configured at that time for Ldap:



The problem is: when you have an LDAP authentication available for you application that's using  WebSphere 8.5, it needs as well a security enable configuration, using a valid userID and password for LDAP purposes. So, you must configure this click two times in your WebSphere App Server in the Eclipse RAD server tab.



So, once you configure it properly your app should be generating the /j_security_check file. And your Admin Console should be login only with a valid ldap_user and password as below:




I hope it helps and fix your ldap/app issues.



happy coding!!
Thiago Leoncio.