[JBoss JIRA] Created: (JBMICROCONT-165) Add support for Install items
by Adrian Brock (JIRA)
Add support for Install items
-----------------------------
Key: JBMICROCONT-165
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-165
Project: JBoss MicroContainer
Issue Type: Task
Components: Dependency
Reporter: Adrian Brock
Assigned To: Ales Justin
We already support contextual dependency injection
(injected based on class)
@Inject
public void setSomething(X x);
and installation into "repositories"
<bean name="Queue1">
<install bean="JMSBroker" method="addQueue"/>
</bean>
There should be additional support for more dynamic injection/installation.
In annotations the three new features are:
1) The injection is dynamic
- the service will start even if the dependency is not satisifed
- the service might get the injection later when it is available
@Inject(optional=true)
public void setSomething(X x);
2) Installation of "services" by type
- Inject all implementors of a particular class
- Keep reinjecting as implementors come and go
- The cardinality specifies the minimum number
that must exist for the service to start
@Install(cardinality=0)
public void setSomethings(Collection<X> x)
3) Like (2) but with add/remove methods
@Install(cardinality=0)
public void addSomething(X x)
@Uninstall
public void removeSomething(X x)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[JBoss JIRA] Created: (JBMICROCONT-176) Injection of KernelController fails in bootstrap xml
by Scott M Stark (JIRA)
Injection of KernelController fails in bootstrap xml
----------------------------------------------------
Key: JBMICROCONT-176
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-176
Project: JBoss MicroContainer
Issue Type: Bug
Affects Versions: JBossMC_2_0_0 Beta3
Reporter: Scott M Stark
If I attempt to the KernelController into the HDScanner defined in the conf/bootstrap-beans.xml using:
<!-- Hotdeployment of applications -->
<bean name="HDScanner"
class="org.jboss.system.server.profileservice.hotdeploy.HDScanner">
<property name="mainDeployer"><inject bean="MainDeployer"/></property>
<property name="controller"><inject bean="jboss.kernel:service=Kernel" property="controller"/></property>
<property name="profileService"><inject bean="ProfileService"/></property>
<property name="scanPeriod">5000</property>
<property name="scanThreadName">HDScanner</property>
</bean>
this fails with:
10:10:51,406 ERROR [AbstractKernelController] Error installing to Configured: name=HDScanner state=Instantiated
java.lang.IllegalArgumentException: Wrong arguments. setController for target org.jboss.system.server.profileservice.hotdeploy.HDScanner@568bf3ec expected=[org.jboss.kernel.spi.dependency.KernelController] actual=[org.jboss.kernel.Kernel]
at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:224)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:108)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:137)
at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:60)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
at org.jboss.system.ServiceController.doInstall(ServiceController.java:638)
at org.jboss.system.ServiceController.register(ServiceController.java:344)
at org.jboss.system.ServiceController.start(ServiceController.java:415) 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:194)
at org.jboss.aop.deployment.AspectManagerService.postRegister(AspectManagerService.java:634)
at org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
at org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:336)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431) at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
at org.jboss.aop.deployers.AspectManagerJMXRegistrar.start(AspectManagerJMXRegistrar.java:57)
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 org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:108)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:145)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:84)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:232)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
at org.jboss.Main.boot(Main.java:210)
at org.jboss.Main$1.run(Main.java:522)
at java.lang.Thread.run(Thread.java:595)
Going through the code, the failure occurs because the AbstractDependencyValueMetaData.getValue requires a property != null && lookup instanceof AttributeDispatchContext. The lookup in this case is a KernelRegistryEntry, so the property value is not retrieved and instead the bean is used as the value.
public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
{
ControllerState state = dependentState;
if (state == null)
state = ControllerState.INSTALLED;
Controller controller = context.getController();
ControllerContext lookup = controller.getContext(value, state);
if (lookup == null)
throw new Error("Should not be here - dependency failed! " + this);
Object result = lookup.getTarget();
if (property != null && lookup instanceof AttributeDispatchContext)
{
AttributeDispatchContext adc = (AttributeDispatchContext) lookup;
result = adc.get(property);
}
return info != null ? info.convertValue(result) : result;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[JBoss JIRA] Created: (JBAOP-441) NPE On ConsCall Per Instance Interceptions
by Flavia Rainone (JIRA)
NPE On ConsCall Per Instance Interceptions
------------------------------------------
Key: JBAOP-441
URL: http://jira.jboss.com/jira/browse/JBAOP-441
Project: JBoss AOP
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.0.0.alpha5
Reporter: Flavia Rainone
Assigned To: Flavia Rainone
Priority: Critical
Fix For: 2.0.0.beta
Here is the stack trace:
java.lang.NullPointerException
at org.jboss.aop.GeneratedClassAdvisor.copyInfoFromClassAdvisor(GeneratedClassAdvisor.java:188)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1InstanceAdvisor.initialiseInfosForInstance(POJOCaller1$POJOCaller1InstanceAdvi
sor.java)
at org.jboss.aop.GeneratedClassAdvisor$InstanceAdvisorStrategy.initialise(GeneratedClassAdvisor.java:1495)
at org.jboss.aop.GeneratedClassAdvisor.initialise(GeneratedClassAdvisor.java:115)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1Advisor.initialise(POJOCaller1$POJOCaller1Advisor.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1Advisor.<init>(POJOCaller1$POJOCaller1Advisor.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1InstanceAdvisor.<init>(POJOCaller1$POJOCaller1InstanceAdvisor.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1Advisor.createInstanceAdvisor(POJOCaller1$POJOCaller1Advisor.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1._getInstanceAdvisor(POJOCaller.java)
at org.jboss.test.aop.beforeafterthrowingscoped.JoinPoint_CByC__1org_jboss_test_aop_beforeafterthrowingscoped_TargetPOJO1_N_397299418508535556_2.invo
keJoinpoint(JoinPoint_CByC__1org_jboss_test_aop_beforeafterthrowingscoped_TargetPOJO1_N_397299418508535556_2.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1$POJOCaller1Advisor.aop$constructorCall_con__1org_jboss_test_aop_beforeafterthrowingscoped
_TargetPOJO1_N_397299418508535556(POJOCaller1$POJOCaller1Advisor.java)
at org.jboss.test.aop.beforeafterthrowingscoped.POJOCaller1.<init>(POJOCaller.java:97)
at org.jboss.test.aop.beforeafterthrowingscoped.CallerJoinpointScopedTestCase.assertConByCon(CallerJoinpointScopedTestCase.java:84)
at org.jboss.test.aop.beforeafterthrowingscoped.CallerJoinpointScopedTestCase.testConByCon(CallerJoinpointScopedTestCase.java:61)
This is happening because initialization of per instance advisor is taking place before the call to initialiseCallers (method that initializes caller infos on class advisor). This instance advisor initialization assumes that all info fields of class advisor are already initialized and, hence, the NPE occurs.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[JBoss JIRA] Created: (JBMICROCONT-191) NPE in DeployersImpl.checkComplete
by Carlo de Wolf (JIRA)
NPE in DeployersImpl.checkComplete
----------------------------------
Key: JBMICROCONT-191
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-191
Project: JBoss MicroContainer
Issue Type: Bug
Components: Deployment
Environment: snapshot 20070709
Reporter: Carlo de Wolf
NullPointerException in DeployersImpl.checkComplete after redeploying a failing jar twice.
java.lang.NullPointerException
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:570)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:398)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:386)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:814)
at org.jboss.deployment.MainDeployer.redeploy(MainDeployer.java:587)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years