A bit esoteric, but I defined a datasource in TomEE (using tomee.xml) and deployed my app along with the datasource. I then wrote a quick throwaway app (as a test to prove out an issue I was troubleshooting) that grabbed an org.apache.openejb.client.RemoteInitialContextFactory and attempted to look the datasource up. When I ran this, I get the following:
Exception in thread "main" java.lang.ClassCastException: org.apache.openejb.client.ThrowableArtifact cannot be cast to java.lang.Error
A bit of debugging through the source showed that the original error generated was this:
Of course, the NoSuchMethodException implements Throwable, which is implemented by Error. Perhaps casting the return of getResult() to Throwable might be a better approach?
I can try to take a look at this if you want...just let me know.