Object obj = CMSService.getCommandFactory();
System.out.println(""cmd factory is a " + obj.getClass());
Then you will know what to cast it to. Or we can discuss why the object rerturned by getCommandFactory is what it is.
Thanks for response Peter,
It's solved. For unknown reason I packed portal-cms-lib.jar, jackrabbit-core-1.0.jar and other jars into my portlet's war file, so it gave me that classcast at deploy. Once I got rid of jars in war file - everything works fine.