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:
<snip>
@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);
...
}
</snip>
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)