[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-2166) no-interface view implementation based on MC constructs is brittle
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Fri Oct 1 10:17:40 EDT 2010
[ https://jira.jboss.org/browse/EJBTHREE-2166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12554645#action_12554645 ]
jaikiran pai commented on EJBTHREE-2166:
----------------------------------------
Ales, here's the relevant stacktrace that shows that trying to push the context doesn't work:
Caused by: java.lang.UnsupportedOperationException: Cannot invoke set on unmodifiable wrapper.
at org.jboss.dependency.spi.helpers.UnmodifiableControllerContext.setRequiredState(UnmodifiableControllerContext.java:149) [jboss-dependency.jar:2.2.0.Alpha10]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:936) [jboss-dependency.jar:2.2.0.Alpha10]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
at org.jboss.ejb3.nointerface.impl.view.factory.StatefulNoInterfaceViewFacade.createNoInterfaceView(StatefulNoInterfaceViewFacade.java:95) [:1.0.0-alpha-6]
... 99 more
As can be seen, MC returns a UnmodifiableControllerContext whose state cannot be changed. The code where this is being done is available here http://github.com/jbossejb3/jboss-ejb3-nointerface/blob/e78003f553e2a715d89063496c1e784224e68e6d/impl/src/main/java/org/jboss/ejb3/nointerface/impl/invocationhandler/NoInterfaceViewInvocationHandler.java. The KernelControllerContext passed to that class is injected through the following API:
// add dependency
AbstractInjectionValueMetaData injectMetaData = new AbstractInjectionValueMetaData(containerMCBeanName);
injectMetaData.setDependentState(ControllerState.DESCRIBED);
injectMetaData.setFromContext(FromContext.CONTEXT);
// Too bad we have to know the field name. Need to do more research on MC to see if we can
// add property metadata based on type instead of field name.
builder.addPropertyMetaData("endpointContext", injectMetaData);
The entire exception stacktrace is attached
> no-interface view implementation based on MC constructs is brittle
> ------------------------------------------------------------------
>
> Key: EJBTHREE-2166
> URL: https://jira.jboss.org/browse/EJBTHREE-2166
> Project: EJB 3.0
> Issue Type: Bug
> Components: nointerface
> Affects Versions: depchain-1.0.0-alpha-4
> Reporter: jaikiran pai
> Assignee: jaikiran pai
> Priority: Critical
> Fix For: EJB 3.1
>
>
> Currently the no-interface view proxy that gets bound into JNDI, internally uses a KernelControllerContext (MC construct) corresponding to the endpoint container of the EJB. The proxy depends just on DESCRIBED state of the endpoint. The invocation handler of that proxy, on first invocation, pushes the context to INSTALLED state (if not already in INSTALLED stated) and then invokes on the endpoint.
> This approach won't work out because MC returns an UnModifiable kernel controller context which throws an exception when we try to change the state of that context. More on this in the "Important" note at the end of this MC chapter http://docs.jboss.org/jbossmc/docs/2.0.x/userGuide/ch11s04.html:
> <quote>
> All context information is wrapped into unmodifiable objects to prevent the user from changing anything outside of the microcontainer's control.
> </quote>
> It's just plain luck that no-interface view works currently, because the first invocation on the nointerface view happens after the context has already been set to INSTALLED state by MC.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list