Tuesday, March 27, 2012

How to fix : ANT Error - Could not create task or type of type: propertyfile.


If you see this error while running ant build , then follow the listed 3 steps

BUILD FAILED ..../build.xml:234: Could not create task or type of type: propertyfile.
Ant could not find the task or a class this task relies upon.

Solution (1,2 or 3 solves the problem):
1) Check the Ant version
# which ant
# ant -version
Make sure you have atleast version > 1.6.x as its not supported in older ANT versions.

2) Make sure you have this jar "ant-nodeps.jar" in $ANT_HOME/lib. This is the right jar for  PropertyFile.class


3) Make sure that you DON'T have this file /etc/ant.conf. If it exists, then this points to the jpackage version of ant . Just remove this file & ther's the end of the story.   



How to fix: CoreData error "NSInternalInconsistencyException" - iPhone App Development


Migrating this blog post from my old blog. This might help if some one gets stuck with this "NSInternalInconsistencyException".

If you see the following exception while working with core data (iphone sdk):


[Session started at 2010-06-01 22:47:09 -0700.]
2010-06-01 22:47:11.150 MyCoreDataList[88744:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Stock''
2010-06-01 22:47:11.153 MyCoreDataList[88744:20b] Stack: (
    9905243,
    2444394043,
    7893163,
...

This happens because, u r trying to load a DB row from an object context that hasn't been loaded yet. So ur option: u can set-up right ther or just before loading this view...


Solution
Place the following segment in your RootViewController's ViewDidLoad() method


if(managedObjectContext == nil){
managedObjectContext = [(MyCoreDataListAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
}

Fix: cvs setup error with libcom_err.so.3


Recently, i tried to setup cvs on of my dev linux boxes. When i ran cvs command, i got
# cvs

Error while loading shared libraries: libcom_err.so.3: cannot open shared Object File


libcom_err.so comes from Kerberos(Krb5).

How to resolve this:
1) First check your Red hat version. Not sure but there is a weird thing with this file naming convention. For old Red hat versions, the file was named as  "libcom_err.so.3" where as the latest red hat versions of it are "libcom_err.so.2" and "/libcom_err.so.2.1". I know; this should be the other way round & not sure about the reasoing behind this

2) Run locate command to see if you have this .so file or not
# locate libcom_err
/lib/libcom_err.so.2
/lib/libcom_err.so.2.1

On my CentOS, i have this file under /lib. It seems that i am having version 2.x on my machine. Since these are latest versions compared to 3. I tried making a symlink from "3" to "2.1"

# ln -s /usr/lib/libcom_err.so.2.1 /usr/lib/libcom_err.so.3 

This solved the cvs error