[Design the new POJO MicroContainer] - Should @Inject find an alias?
by scott.stark@jboss.org
I'm seeing a failure to inject a bean by its alias. Given this bean:
| <!-- An InitialContextFactory that uses the NamingContext.getLocal() Naming -->
| <bean name="InitialContextFactory#1" class="org.jboss.naming.InitialContextFactoryBean">
| <alias>InitialContextFactory</alias>
| <property name="env">
| <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
| <entry>
| <key>java.naming.factory.initial</key>
| <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
| </entry>
| <entry>
| <key>java.naming.factory.url</key>
| <value>org.jboss.naming:org.jnp.interfaces</value>
| </entry>
| </map>
| </property>
| <depends>testLocaNamingBeanImpl#1</depends>
| </bean>
|
This injection into a unit test:
| @Inject(bean="InitialContextFactory", property="ctx")
| public void setInitialContext(InitialContext ctx)
| {
| this.ctx = ctx;
| }
|
fails with:
| java.lang.IllegalStateException: Incompletely deployed:
|
| *** DEPLOYMENTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
| b4fb6399-bd84-41be-a3bc-4a0ddc0da8e6 -> InitialContextFactory{Installed:** NOT FOUND **}
|
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:290)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
| at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.validate(MicrocontainerTestDelegate.java:262)
| at org.jboss.test.kernel.junit.MicrocontainerTest.afterSetUp(MicrocontainerTest.java:117)
| at org.jboss.test.kernel.junit.MicrocontainerTest.setUp(MicrocontainerTest.java:91)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182727#4182727
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182727
16 years, 3 months
[Design of POJO Server] - Re: JSR77 View
by scott.stark@jboss.org
"alesj" wrote :
| ...
| It's the TODOs that I don't know how to get / create.
| And I guess I'm gonna face the same problems in EJB, JCA, RAR, ...
|
| Perhaps in this case I could even get WebModule ObjectName.
| From (making it static) AbstractWarDeployer::getObjectName(JBossWebMetaData).
| But then in TomcatDeployment, we create another ObjectName,
| and set it to WebApplication instance (WebApplication::setAppData).
| Which one is it? ;-)
|
| Or is my approach with deployers + metadata completely wrong? :-)
I think its wrong in that there is no point in hooking to the actual components for the first iteration. Just create the jsr77 namespace without stats, operations, and we'll correctly produce the mbeans from the management view later.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182691#4182691
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182691
16 years, 3 months