Return-Path: Delivered-To: apmail-beehive-user-archive@www.apache.org Received: (qmail 73838 invoked from network); 2 Sep 2007 05:37:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2007 05:37:45 -0000 Received: (qmail 28614 invoked by uid 500); 2 Sep 2007 05:37:39 -0000 Delivered-To: apmail-beehive-user-archive@beehive.apache.org Received: (qmail 28595 invoked by uid 500); 2 Sep 2007 05:37:39 -0000 Mailing-List: contact user-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list user@beehive.apache.org Received: (qmail 28584 invoked by uid 99); 2 Sep 2007 05:37:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Sep 2007 22:37:39 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.13.19.116] (HELO kgb13.kgbinternet.com) (69.13.19.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Sep 2007 05:38:43 +0000 Received: from secure.kgbinternet.com (kgb13.kgbinternet.com [127.0.0.1]) by kgb13.kgbinternet.com (8.12.10/8.12.8) with ESMTP id l825bDY3025154; Sat, 1 Sep 2007 23:37:13 -0600 From: "w i l l b o y d" To: user@beehive.apache.org Reply-To: will@javafreelancer.net Subject: Why is "Key PropertyKey" not valid for an extended interface? Date: Sat, 1 Sep 2007 23:37:13 -0600 Message-Id: <20070902053713.M25671@javafreelancer.net> X-Mailer: Open WebMail 1.70 20020712 X-OriginatingIP: 81.179.68.227 (javafreelancer) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org hi all, i've created a couple custom bea weblogic workshop 8.1 controls in the past. but i've just now started dabbling with beehive v 1.02. i went through the tutorial at http://beehive.apache.org/docs/1.0/controls/tutorial_controls.html. instead of implementing the tutorial verbatim, i improvised by implementing an ldap control instead of a jms control. overall, the ldap control control i built works. going along with the tutorial, i managed to successfully create, build and run an extension to a base ldap control. my question is: why am i getting this error when i try to access a property that is defined in my extensible base control - from the invoke() method of the base control's implementation class? java.lang.IllegalArgumentException: Key PropertyKey: com.sun_certified.tutorials.security.csc.utils.LDAPControl$WhichApi.value is not valid for interface com.sun_certified.tutorials.security.csc.utils.LDAPCertStoreControl ... see below for full stack trace the code that throws that exception is similar to the code in the "JmsMessageControlImpl" class in the controls tutorial on the beehive website; except i've adapted it to an ldap-related solution: @ControlInterface public interface LDAPControl { ... public enum ApiType { JNDI, LDAP_JDK } @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface WhichApi{ public ApiType value() default ApiType.JNDI; } ... } @ControlImplementation public class LDAPControlImpl implements LDAPControl, Extensible, Serializable { ... public Object invoke(Method method, Object[] args) throws Throwable { ... LDAPControl.WhichApi apiProp = ctx.getMethodPropertySet(method, LDAPControl.WhichApi.class); ... switch (apiProp.value()) { //<-- this is the line where the exception is thrown case JNDI: ... break; case LDAP_JDK: ... break; default: ... break; } // end switch ... } @ControlExtension public interface LDAPCertStoreControl extends LDAPControl { ... @WhichApi Object[] getCertificatesByDN(@Host(name="ldapDirServer") InetAddress host, @LookingFor(name="subjectDN") String subjectSN); ... } any help would be sincerely appreciated. thanks in advance. ============================= java.lang.IllegalArgumentException: Key PropertyKey: com.sun_certified.tutorials.security.csc.utils.LDAPControl$WhichApi.value is not valid for interface com.sun_certified.tutorials.security.csc.utils.LDAPCertStoreControl at org.apache.beehive.controls.api.properties.AnnotatedElementMap.getProperty(AnnotatedElementMap.java:108) at org.apache.beehive.controls.api.properties.PropertySetProxy.invoke(PropertySetProxy.java:108) at $Proxy7.value(Unknown Source) at com.sun_certified.tutorials.security.csc.utils.LDAPControlImpl.invoke(LDAPControlImpl.java:58) at com.sun_certified.tutorials.security.csc.utils.LDAPCertStoreControlBean.getCertificatesByDN(LDAPCertStoreControlBean.java:120) at com.sun_certified.tutorials.security.csc.utils.LDAPCertStoreControlTestCase.testGetCertificatesByDN(LDAPCertStoreControlTestCase.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)