Sencha Touch + DeftJS - touch

I'm trying out the DeftJS framework in a Sencha Touch application.
But i'm having troubles implementing the newest version (0.6.5)
when it goes over the following lines:
classDefinition = Ext.ClassManager.get(this.getClassName());
where
this.getClassName() outputs "TimeSheetApp.store.TotalActualStore"
so the following line
if (classDefinition.singleton)
throws this exception:
Uncaught TypeError: Cannot read property 'singleton' of null
Any idea what i'm doing wrong here?

The issue here is that the specified class has either not been loaded or does not exist.
Double-check that the class name you've specified is exactly correct and that it has been loaded via Ext.require() in your primary JavaScript file before Ext.onReady(), or via the requires: annotation on your root Sencha Touch application class.
Even as the author of the Deft JS framework, I ran into this problem this week, too. The error being thrown as of v0.6.5 is not particularly helpful. I filed an issue on GitHub capturing this problem, so you can track progress there:
https://github.com/deftjs/DeftJS/issues/16
We will be adding better error handling and notification in v0.6.6.
In the meantime, correcting the name or adding the missing class requirement should get you going again.
Thanks for checking out Deft JS!

Related

NSInvalidUnarchiveOperationException?

The current app I have been working on has been running fine with no issues and suddenly, what seems like out of the blue as I hadn't made any changes, crashes at launch with an NSInvalidUnarchiveOperationException.
I made zero code changes and the only thing I did was to run the app on my Mac to see how it would look on MacOS. I then ran it again on my iPhone and that's when the problem started to occur. I use CoreData and CloudKit so decided to delete all data to see if that would solve the issue (not thinking it would based on the console log) and it still crashes.
The console states the following:
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSFontDescriptor) for key (UIFontDescriptor) because no class named "NSFontDescriptor" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver'
The thing is, although I use attributed strings I clearly haven't created a class named NSFontDescriptor. NSFontDescriptor is part of the SDK so I have no idea what's going on and how to fix this issue.
Any help would be much appreciated.

Call to a member function getDateFormat() on null, laravel/passport install

I am getting a
[Symfony\Component\Debug\Exception\FatalThrowableError] Call to a member function getDateFormat() on null
when running "php artisan passport:install" on a laravel/mongodb api project. I have tried changing "use Illuminate\Database\Eloquent\Model;" to "use Jenssegers\Mongodb\Eloquent\Model as Model;" in my user and client.php but it still throws the exception.
any ideas??
I also encountered this problem while developing a same type of project. This occurs because Laravel Passport doesn't support Jenssegres\laravel-mongodb. It uses the Illuminate\Database\Eloquent\Model by default.
Now there are two solutions to this.
You can go on changing every Illuminate\Database\Eloquent\Model to Jenssegres\Mongodb\Eloquent\Model in the Laravel Passport's vendor folder(there are about 6 files you will have to change), but this is not recommended, as when you will try you push this project on the production server, the vendor folder is ignored, and you will have to do all the changes again. Also if they change something and you update it, all the changes will be lost.
Another way of doing this, which I would recommend is, using designmynight/laravel-mongodb-passport package. This package will do the above-stated things and will do it efficiently. Installation is also pretty simple. You can go through the documentation here and you can have it up and running in no time.
Hope this can solve your problem.
Documentation link: https://github.com/designmynight/laravel-mongodb-passport

Getting error trying to use UnityEngine.Security.LoadAndVerifyAssembly()

I'm using Unity version 5.5.0f3 and getting an error during development. It's showing an error on this line of code:
var assembly = Security.LoadAndVerifyAssembly(www.bytes);
The error message I'm getting:
UnityEngine.Security.LoadAndVerifyAssembly(byte[])' is obsolete:This was an internal method which is no longer used'
As per the documentation, this method is used by the Web Player. However:
Note that web player is not supported from 5.4.0, so this function no longer serves a purpose and will be deprecated.
If you really want to continue using this method, you can try downloading a prior version of Unity from the Download Archive - though I would recommend against working on Web Player projects since they will become even more difficult to maintain going forward without official support.

STACK_MESSAGE error thrown by NetSuite

Recently I've been getting an Error from NetSuite. We have a Custom Restlet which is receiving a JSON which is used to create Sales Order inside of NetSuite. In SandBox it worked fine so far, but in production not.
Error:
STACK_MESSAGE: java.lang.IllegalStateException: wrap should never be called unless shutter.visibleToScripts is called first.class com.netledger.app.common.scripting.nlobjError/class java.lang.Class
Can anyone help me with this?
NetSuite has this cute little thing where it throws Java exceptions when running JS. My presumption is that the JS is compiled as Java before being run, so sometimes you can get unhandelable execptions like this one (or having fixed sized arrays in JS.. crazy right!).
IllegalStateException
Signals that a method has been invoked at an illegal or inappropriate time.
http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/java/lang/IllegalStateException.html
What you can do is try doing some unit testing to find out what part of your code is causing the bug, then try to find a workaround as if it were Java code.

Entity Framework: Unable to load one or more of the requested types

I am getting a specific exception that I am confused about. I recently changed the target framework of my application from .net Framework 4.0 client profile to .net Framework 4.5. That has apparently caused my entity framework to go a little haywire. I get this exception when I run my application...
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the
LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.Data.EntityUtil.GetTypesSpecial(Assembly assembly)
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.LoadTypesFromAssembly()
at System.Data.Metadata.Edm.ObjectItemAssemblyLoader.Load()
at System.Data.Metadata.Edm.ObjectItemAttributeAssemblyLoader.Load()
at System.Data.Metadata.Edm.AssemblyCache.LoadAssembly(Assembly assembly, Boolean loadReferencedAssemblies, ObjectItemLoadingSessionData loadingData)
The thing is it used to work before I made this change... What did I manage to mess up? Do I need to regenerate these entities? How do I go about trouble shooting and fixing this problem? Thanks.
Two ways to debug this:
Run your program in the debugger, turn on break-on-unhandled exceptions and then inspect the LoaderExceptions property of the exception like the message says. That should give you an idea of which type is not loading.
Run fuslogvw.exe and inspect the failure that is logged there. If an assembly was not found or could not be loaded, it will tell you which one and possibly why.