SmartObject Server Exception: Unable to load one or more of the requested types

Recently I run into interesting case when attempt to register K2 for SharePoint app failed with quite strange error: “SmartObject Server Exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information”.

K2 for SP 4.6.10 app registration error

What is more interesting it was clean installation of K2 4.6.10 environment using latest installer available from K2 portal. After environment was reinstalled three times (you know that “reboot three times” approach I guess? 😉 ) and all conceivable prerequisites were double checked I decided to do what you never ever should do, namely to register SharePoint 2013 service instance using SmartObjects Services Tester Tool. Note (for the sake of redundancy): you should never use this tool to add or edit your SharePoint 2013 service instances all of those should be created from SharePoint interface by means of so called “appify” operation.

As I saw that registration wizard throws this error on SharePoint Service broker registration step I decided just try to create SharePoint 2013 service instance with tester tool just to see if I get some error message there. And I was able to see this:

K2 for SP 4.6.10 tester tool error

So this was clear indicator that our K2 server missing some dependencies. Long story short, thanks to input from some colleagues (which is omitted here to prettify the narrative :) ), solution to this was found.

So in case you was early adopter of K2 4.6.10 or downloaded 4.6.10 installer early enough you may have noticed that there were couple of minor versions of it which were superseded by one currently available in downloads section of K2 portal (it has .2 in the very end of all components versions). So .0 & .1 4.6.10 installers were available for a while but now replaced with .2 which addressed number of issues identified in its predecessors: (Item References coldfix for K2 4.6.10) (Known Issue: Developer license coldfix for K2 4.6.10 ) (Known Issue: Delete workflow coldfix for K2 4.6.10)

So check out your installation files and make sure that you have .2 installer so that you don’t have to mess with coldfixes later. But there is a minor issue with .2 installer of K2 for SharePoint 4.6.10, namely it contains “wrong” version of SharePoint client components (sharepointclientcomponents_x64.msi) – 16.0.4002.1211 (1,8 MB) and installs it on K2 server – and when this version only is installed you are going to see errors I mentioned above. 4.6.9 installer and presumably 4.6.10 .0/.1 installers contained 15.0.4481.1505 version of SharePoint Client Components and once you install it onto your K2 server above mentioned issues solved.

K2 for SP 4.6.10 app registration error - solution

So it seems that we should not expect .3 installer for 4.6.10, but no worries this will be “fixed” in 4.6.11 installer which we will be able to see soon. As for now just take a note that if you are doing clean install of K2 for SharePoint 4.6.10 (separate installer which you need to use in case you have SharePoint 2013 in your environment) using installation package currently available on K2 downloads portal make sure that you additionally install K2 for SharePoint Client Components 15.0.4481.1505 which you can grab from 4.6.9 installer for example.


Unable to start K2 host service: Data at the root level is invalid

Just a note on one issue to pin down exact error cause. You may see the situation when K2 host service is unable to start failing on Initializing Role Provider step for provider with label “K2″ with the following error:

Here is screenshot:

Unable to Start K2 service - K2 label issue

So if you read a few line above the error itself it should give you a clue – as we see that it fails attempting to initialize Role Provider with label “K2″… Already guessed what is wrong here?

So it seems that something wrong with security label K2, likely with RoleInit XML field. Tried to enable ADUM logging maybe? If yes just review SQL query you used to do this, likely it has minor error causing above mentioned issue. Correct & re-run SQL script and your K2 service is back up and running again :)


Understanding computations in R

Well it is actually not even a post, but I just wanted to jot down this quote of John Chambers, the creator of R, which is helpful for understanding computations in R:

To understand computations in R, two slogans are helpful:  1. Everything that exists is an object. 2. Everything that happens is a function call.

John Chambers, the creator of R


Configuring HTTPS for K2 SmartObject Services

There is a quite good section at which describes what you have to do in order to enable HTTPS for K2 SmartObject Services – “Windows Authentication with SSL for K2 SmartObject Services”. This post is sort of recap of that section with few extra bits of information.

So first you have to edit K2HostServer.exe.config file (default location – Program Files(x86)\K2 blackpearl\Host Server\Bin) as follows:

  1. Change enableEndpoints=”false” to enableEndpoints=”true”
  2. Change scheme=”http” to scheme=”https”
  3. Change port=”8888″ to port=”8443″
  4. Change wcf binding=“wsHttpBinding” bindingConfiguration= “wsHttpBinding+Windows” to wcf binding=“wsHttpBinding” bindingConfiguration= “wsHttpBinding+HTTPS”
  5. Change rest binding=“webHttpBinding” bindingConfiguration= “webHttpBinding+Windows” to rest binding=“webHttpBinding” bindingConfiguration= “webHttpBinding+Windows+HTTPS”
  6. Change excluded all=”true” to excluded all=”false”

As usual changes made to this config file will be picked up with K2 service restart, but it is bettor to done additional configuration task before restarting it.

  1. Configure the URL Access Control List so that the service account can use the https url by issuing following command:

  1. Next you need configure the SSL for the port by issuing the following command:

Here some comments may be necessary. For certhash value you have specify value of CertificateThumbrint property of a certificate which is being used for HTTPS binding of your K2 site:

IIS Bindings View Certificate Properties 01

IIS Bindings View Certificate Properties 02

You need to copy Thumbprint value from certificate properties and specify it as a value of certhash property of aforementioned command (no spaces). As for appid property you may use GUID suggesten in K2 help article {4dc3e181-e14b-4a21-b022-59fc669b0914} though according to some sources random GUID can be specified (you can use any valid GUID, as it is only used to allow you to identify the binding later).

So in the end command should look similar to this:

There is an alternative way to get your K2 site SSL certificate thumbrpint with use of PowerShell:

  1. Once all that has been done you can restart K2 service and validate the results by accessing the following url (adjust URL accordingly):

If you see a page similar to one on the screenshot below then you successfully configured HTTPS for K2 SmartObject Services.

HTTPS endpoints.xml


SQL Script: List all tables in DB with their row counts

Often I need to test something and use SQL database table of particular size for my test, and sometimes it is easier to pick up some table of appropriate size (at least in terms of rows number) from what you already have. This is the case when this SQL script may come in handy:


Git 101/intro

Just a tiny note on installing GIt on Windows box as well on some basic settings and commands to get you started.

So you can download Git from the following location:

Install should not cause any troubles, but interesting thing is that you may get some localization language configured for your Git GUI without asking this during Setup (no options there) and with no option to change it surfaced in Git GUI. Quick and dirty solution for this is to remove localization file for your respective language (or to rename it). Default file location is:

Please refer to related question on for other solutions for changing Git GUI language.

Following commands can be used in Git Bash to get you started. Set your user name and email:

Use the following to confirm changes you made:

Next you may want to create a local copy of your repo created on So first you will need to create a local directory to store your local copy:

Next switch to directory you created:

Once there, initialize a local Git repo in this directory:

Next point your local repository at the remote repository on the GitHub server:

To check remote origin URL for current repo:

Next you can clone repo, i.e. create a local copy of it on your computer (in the current folder):

To add files:

git add . adds all new files

git add -u pdates tracking for files that changed names or were deleted

git add -A does both of the previous

You should do this before committing. Committing:

Previous command will only update your local repo, not the remote repo on GitHub. And to push saved local commits to GitHub you use:

And this one is self-explanatory I guess :) :


How to check if the UPA is populated correctly for specific user

Certain SharePoint 2013 features as well as K2 for SharePoint need to have User Profile Application (UPA) working and its database populated with correct data.

Sometimes it is difficult to confirm whether or not UPA is correctly configured as SharePoint UI does not show you all the properties for the users. Moreover, even if UPA is not configured properly users still can login to SharePoint and successfully get OAuth tokern, and this fact complicates troubleshooting.

As a quick way to confirm that UPA is populated correctly for a particular user you may ask him to login to SharePoint and navigate to the following page:

It will return all UPA propeerties for the user. For OAuth tokens to work correctly following properties should be popluated: SPS-ClaimID, SPS-ClaimProviderID, SPS-ClaimProviderType, and SPS-UserPrincipalName.


R lang logo

R – brief history

As I start learning R it is normal to start from the very beginning, i.e. take a look at history of R programming language. This post is based on respective lecture from course I’m currently taking. So what is R? R is a dialect of S.

What is S?

S is a language that was developed by John Chambers (Wikipedia entry, CV at Stanford University web site) and others at now defunct Bell Labs. There is a great book about Bell Labs history – “The Idea Factory: Bell Labs and the Great Age of American Innovation” by Jon Gertner, which tells a story of one of the first innovation factories.


S was initiated in 1976 as an internal statistical analysis environment (for use within Bell Labs) – originally implemented as Fortran libraries (Fortran libraries were used to repeat statistical routines). Fortran is a programming language born in 1956.

Early versions of the language did not contain functions for statistical modeling (that didn’t come until v3 of the language roughly).

In 1988 the system was rewritten in C (to make it more portable across the systems) and began to resemble the system that we have today.

There is a seminal book “Statistical Models in S” by Chambers and Hastie (aka the white book) which documents the statistical analysis functionality.

Version 4 of the S language was released in 1998 and is the version used today. The book “Programming with Data” by John Chambers (aka the green book) documents this version of the language.

So R is an implementation of the S language originally developed in Bell Labs.

Some more historical notes:

In 1993 Bell Labs gave StatSci (now Insightful Corp.) an exclusive license to develop and sell the S language.

In 2004 Insightful purchased the S language from Lucent (this is what Bell Labs become) for $2 million and is the current owner.

In 2006, Alcatel purchased Lucent Technologies and is now called Alcatel-Lucent.

Insightful sells its implementation of the S language under the product name S-PLUS and has built a number of fancy features (GUIs, mostly) on top of it – hence the “PLUS” in its name.

In 2008 insightful is acquired by TIBCO for $25 million. TIBCO is still develops S-PLUS. The fundamentals of the S language itself has not changed dramatically since 1998. In 1998, S won the Association for Computing Machinery’s Software System Award. S Philosophy: “Promote transition from user to programmer”

In “Stages in the Evolution of S”, John Chambers writes:

“We wanted users to be able to begin in an interactive environment, where they did not consciously think of themselves as programming. Then as their needs become clearer and their sophistication increased, they should be able to slide gradually into programming, when the language and system aspects would become more important.”

Back to R

1991: Created in NZ by Ross Ihaka & Robert Gentleman. Their experience developing R is documented in a 1996 JCGS (Journal of Computation and Graphical Statistics) paper.
1993: First announcement of R to the public
1995: Martin Machler convinces Ross and Robert to use the GNU General Public License to make R free software
1996: A public mailing list is created (R-help and R-devel)
1997: The R Core Group is formed (contained some people associated with S-PLUS). The Core Group controls the source code for R (they make changes in primary R source code).
2000: R version 1.0.0 is released
2013: R version 3.0.2 is released on December 2013

Features of R

– Syntax is similar to S, making it easy for S-PLUS users to switch over
– Semantic are superficially similar to S, but in reality are quite different
– Runs on almost any standard computing platform/OS (even on the PlayStation 3)
– Frequent releases (annual + bugfix releases); active development
– Quite lean, as fas as software goes; functionality is divided into modular packages
– Graphics capabilities very sophisticated and better than most general purpose statistical packages
– Useful for interactive work, but contains a powerful programming language for developing new tools (user -> programmer)
– Very active and vibrant user community; R-help and R-devel mailing lists and Stack Overflow
– It’s free! (Both in the sense of beer and in the sense of speech)

On Free Software

With free software, you are granted:

  • The freedom to run the program, for any purpose (freedom 0)
  • The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this.

Drawbacks of R

– Essentially base on 40 year old technology (S, other drawbacks are results of it)
– Little built in support for dynamic or 3-D graphics (but things have improved greatly since the “old days”)
– Functionality is based on consumer demand and user contributions. If no one feels like implementing your favorite method, then it’s your job! (or you need to pay somebody to do it)
– Objects must generally be stored in physical memory; but there have been advancements to deal with this too (both in R and on hardware side with cheaper memory). * This can be a limitation for big data era.
– Not ideal for all possible situations (but this is a drawback of all software packages)

Design of the R system

The R system is divided into 2 conceptual parts:
1. The “base” R system you download from CRAN
2. Everything else
R functionality is divided into a number of packages:
– The “base” R system contains, among other things, the base package which is required to run R and contains the most important functions.
– The other packages contained in the “base” system include utils, stats, datasets, graphics, grDevices, grid, methods, parallel, compiler, splines, tcltk, stats4.
– “Recommend” packages: boot, class, cluster, codetools, foreign, KernSmooth, lattice, mgcv, nlme, rpart, survival, MASS, spatial, nnet, Matrix.
And there are many other packages available:
– There are about 4000 packages on CRAN that have been developed by users and programmers around the world.
– There are also many packages associated with the Bioconductor project ( which is project of implementing R software for genomic and biological analysis.
– People often make packages available on their personal websites; there is no reliable way to keep track of how many packages are available in this fashion.

Some R Resources

Available from CRAN (
– An Introduction to R
– Writing R Extensions
– R Data Import/Export
– R Installation and Administration (mostly for building R from sources)
– R Internals (not for the faint of heart)

Some Useful Books on S/R

Standard texts
– Chambers (2008). Software for Data Analysis, Springer.
– Chambers (1998). Programming with Data, Springer.
– Venables & Ripley (2002). Modern Applied Statistics with S, Springer.
– Venables & Ripley (2000). S programming, Springer.
– Pinheiro & Bates (2000). Mixed-Effects Models in S and S-PLUS, Springer.
– Murell (2005). R Graphics, Chapman & Hall/CRC Press.
Other resources
– Springer has a series of books called Use R!
– A longer list of books is at


R – installing swirl package

As I started “R Programming” course on Coursera one of the first things to do was installation of swirl R package which allow you to “learn R, in R”. So as laconic instruction says you should be able to install this package in R with following command:

But sometimes this does not work until you specify CRAN repositorty (by the way CRAN stands for Comprehensive R Archive Network). This issue seems to be specific to the latest version of R as of today (version 3.2.1 (2015-06-18) — “World-Famous Astronaut”). So if aforementioned command does not work for you, try this:

To list all installed packages you may use:

And to start using swirl you have to type in:


My blog moved

After some downtime my blog is up and running again. I moved it from and now running it off Synology NAS. Migration process was relatively easy but with some little difficulties, so I am jotting down the outline of whole procedure here:

1. Domain name transfer from to another domain name registrar so that you can point your domain name to public IP of your router.

2. Install WordPress and phpMyAdmin packages on Synology. WordPress installation will enable Web Station feature on your Synology box for you. Set custom and secure passwords for MariaDB and your wordpress blog.

3. Use WordPress import/export features to migrate your content.

4. Enable “Virtual Server / Port Forwarding” feature on your router to allow HTTP access from WAN to Synology device behind it.

5. Now your main issue is that default WordPress installation on Synology create subfolder in web folder, so you can’t access it via IP/domain name only but have to additionally specify “/wordpress” after it. To address this you need to go to your Web Station settings and add 2 virtual host entries (subfolder/hostname/protocol/port):

wordpress HTTP 80

wordpress HTTP 80

Other solutions is to add forwarders in public DNS or move your wordpress installation to the root folder instead of hosting it beneath web folder. First one not the best one because domain registrars tend to take up to 48 hours to fully apply forwarders and the second one is more complex and not the best thing to do from security prospective maybe.

6. Final steps. Use phpMyAdmin to edit the following settings in wp_options table of wordpress database:



But even this is not enough and you also have to locate your wp_config.php file and the following line there:

define(‘WP_SITEURL’, ‘’);