Hi Thomas,
I did a research and I compared the registered services from the system.bundle of JBoss AS 7.1.1 and JBoss AS 7.2.0alpha.
That's the result of JBoss AS 7.1.1 (the whole log is in the attachment (jboss711.log)
20:22:59,214 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: system.bundle, objectClass: [javax.transaction.TransactionManager]
20:22:59,214 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: system.bundle, objectClass: [javax.transaction.UserTransaction]
20:22:59,214 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: system.bundle, objectClass: [javax.naming.spi.InitialContextFactoryBuilder]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: system.bundle, objectClass: [javax.naming.InitialContext]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: org.apache.felix.gogo.command, objectClass: [org.apache.felix.gogo.command.OBR]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: org.apache.felix.gogo.command, objectClass: [org.apache.felix.gogo.command.Files]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: org.apache.felix.gogo.command, objectClass: [org.apache.felix.gogo.command.Inspect]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: org.apache.felix.gogo.command, objectClass: [org.apache.felix.gogo.command.Basic]
20:22:59,229 INFO [com.mwaysolutions.gofer.test.Activator] (telnetconsole.shell remote=/127.0.0.1:60055) symbolicName: org.apache.felix.scr, objectClass: [org.apache.felix.scr.impl.ScrG
As you can see, the system.bundle is providing the javax.naming.InitialContext
Now, the log of JBoss 7.2.0alpha (jboss720.log)
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.xml.parsers.DocumentBuilderFactory]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.xml.parsers.SAXParserFactory]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.naming.spi.InitialContextFactoryBuilder, org.jboss.as.naming.InitialContextFactoryBuilder]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.transaction.UserTransaction]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.transaction.TransactionManager]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [javax.management.MBeanServer]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.msc.service.ServiceContainer]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.as.controller.client.ModelControllerClient]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.osgi.repository.XRepository, org.osgi.service.repository.Repository]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.osgi.deployment.interceptor.LifecycleInterceptorService]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.osgi.service.packageadmin.PackageAdmin]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.osgi.repository.RepositoryStorageFactory]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.osgi.repository.XRepository, org.osgi.service.repository.Repository]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.osgi.service.url.URLStreamHandlerService]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.osgi.service.startlevel.StartLevel]
20:43:50,363 INFO [stdout] (MSC service thread 1-7) symbolicName: org.jboss.osgi.framework, objectClass: [org.jboss.osgi.deployment.interceptor.LifecycleInterceptor]
As you can see, there is no javax.naming.InitialContext anymore!
And now I know fore sure, im not able to configure my component because of the missing service registration. However, I also added a test case where you can reproduce the issue.
Bundle: Description:
gofer-test-1.0.0 This bundle writes all registered services to the logfile
gofer-database-datasource-jndi That's the bundle which I want to configure. It includes the service component. (actually i want to configure the component not the bundle )
bndlib You need this because I'm using bnd annotations
org.apache.felix.scr-1.6.2 obviously, the SCR
org.apache.felix.gogo.command if you want to check the configuration via the gogo shell
org.apache.felix.gogo.runtime
org.apache.felix.gogo.shell
org.apache.felix.shell.remote
If you want to use the gogo-shell, you also have to configure system-properties like this:
<system-properties>
<property name="osgi.shell.telnet.ip" value="127.0.0.1"/>
<property name="osgi.shell.telnet.port" value="8023"/>
</system-properties>
Now you can call the shell via telnet localhost 8023.
1) lb jndi to list the jndi bundle
2) scr:list [ID of Bundle] to get the components which are included in this bundle
3) scr:info[ID of component] to get a detailed overview
If I configure the component com.mwaysolutions.gofer2.database.datasource.jndi.JndiDataSource with the help of the gogo-shell like this: (It should also be possible to use the jboss config admin web gui)
cm:createFactory com.mwaysolutions.gofer2.database.datasource.jndi.JndiDataSource null name String "java:jboss/datasources/GoferDS" usage String main
Then it's working in JBoss AS 7.1.1. The component reach the state registered, but not in JBoss As 7.2.0alpha. But as we know, it's because of the missing javax.naming.InitialContext service.
Anyway, I would appreciate any fast fix for this.
Thanks in advance.
If you need any support or more information, please feel free to contact me.
cheers
christian
TestCase: https://www.dropbox.com/s/t674fwm2h5wzve8/TestCase.zip
BTW: There is no upload function at all if you just press reply