Details
Description
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
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:465)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
A bit of debugging through the source showed that the original error generated was this:
JNDI_ERROR:java.lang.NoSuchMethodException: org.apache.openejb.resource.jdbc.managed.local.ManagedDataSource.getDriverClass().
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.