[jboss-as7-dev] Subsystem/Deployers

Magesh Kumar Bojan mbojan at redhat.com
Wed Apr 13 08:59:37 EDT 2011


I am writing a deployer for SwitchYard[1], basically migrating the AS6 code to AS7. I have created some basic Subsystem code that deploys the artifact (a jar file containing switchyard.xml). Now in order to integrate with Weld (the one and only implementation, that we have in SwitchYard), I would like to migrate the AS6 deployer code to AS7. While doing so I encounter the following error:

Caused by: javax.naming.NamingException: Failed to get context with name comp
   at org.jboss.as.naming.context.NamespaceObjectFactory.getObjectInstance(NamespaceObjectFactory.java:71)
   at org.jboss.as.naming.NamingContext.getObjectInstance(NamingContext.java:470)
   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:201)
   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:211)
   at javax.naming.InitialContext.lookup(Unknown Source)
   at org.switchyard.component.bean.deploy.BeanDeploymentMetaData.getJavaComp(BeanDeploymentMetaData.java:146)

I know the code says that the NamespaceContextSelector is null. Is this by design? What should I do to get the JNDI namespace? I transformed the code to use org.jboss.msc.service.Service and it still doesn't help. Is this a *right* way to do stuff? Do you have any advice on how to proceed with this naming issue?

I could see these dependencies in my app that was compiled from[4], it shows that I have a BeanManager @java:module/BeanManager, just the lookup fails.

service jboss.deployment.unit."m1app-0.1.0-SNAPSHOT.jar".beanmanager,
service jboss.deployment.unit."m1app-0.1.0-SNAPSHOT.jar".namespaceselector,
service jboss.naming.context.java.module."m1app-0.1.0-SNAPSHOT"."m1app-0.1.0-SNAPSHOT".ModuleName,
service jboss.naming.context.java.module."m1app-0.1.0-SNAPSHOT"."m1app-0.1.0-SNAPSHOT".BeanManager

The source for BeanDeploymentMetaData is here[2] and the source for the SwitchYard deployer stuff is here[3].

[1] http://www.jboss.org/switchyard
[2] https://github.com/jboss-switchyard/components/tree/master/bean
[3] https://github.com/mageshbk/switchyard-as7-extension
[4] https://github.com/jboss-switchyard/quickstarts

cheers,
Magesh



More information about the jboss-as7-dev mailing list