tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Kujawa (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENEJB-2110) ClassCastException in JNDIContext.lookup() (line 465)
Date Fri, 13 Mar 2015 18:17:39 GMT
Chris Kujawa created OPENEJB-2110:
-------------------------------------

             Summary: ClassCastException in JNDIContext.lookup() (line 465)
                 Key: OPENEJB-2110
                 URL: https://issues.apache.org/jira/browse/OPENEJB-2110
             Project: OpenEJB
          Issue Type: Bug
          Components: tomee
    Affects Versions: 4.7.1
         Environment: TomEE+ 1.7.1, JDBC, JNDI. I don't think OS matters in this case, nor
would the fact that we're using DB2
            Reporter: Chris Kujawa
            Priority: Critical


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message