3 Replies Latest reply on Jul 2, 2012 3:33 AM by Thomas Diesler

    exported service not recognized

    Jignesh Patel Newbie

      I am trying to deploy OSGI bundle on 7.1.1.Final  through maven using mvn package jboss-as:deploy command. While at the deployment time I am getting following error.

       

      13:44:14,176 ERROR [registration] (Thread-76) FrameworkEvent ERROR: org.apache.felix.log.LogException: org.osgi.framework.BundleException: Cannot resolve bundle resModule: [registration:1.0.0.BUILD-2012-06-25]

                at org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:157)

                at org.jboss.osgi.framework.internal.AbstractBundleState.ensureResolved(AbstractBundleState.java:551)

                at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:211)

                at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)

                at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)

                at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)

                at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)

                at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)

                at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]

                at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]

      Caused by: org.apache.felix.log.LogException: org.jboss.osgi.resolver.XResolverException: Unable to resolve Module[registration:1.0.0.BUILD-2012-06-25]: missing requirement [Module[registration:1.0.0.BUILD-2012-06-25]] package; (package=com.icare.rpc.registration.service)

                at org.jboss.osgi.resolver.felix.FelixResolver.resolveInternal(FelixResolver.java:117)

                at org.jboss.osgi.resolver.spi.AbstractResolver.resolve(AbstractResolver.java:149)

                at org.jboss.osgi.framework.internal.ResolverPlugin.resolve(ResolverPlugin.java:155)

                ... 11 more

       

      However in pom.xml file I exporting the package.

       

            <plugins>

               <plugin>

                  <!-- This plugin takes care of packaging the artifact as an OSGi Bundle -->

                  <groupId>org.apache.felix</groupId>

                  <artifactId>maven-bundle-plugin</artifactId>

                  <version>2.3.7</version>

                  <extensions>true</extensions>

                  <configuration>

                     <instructions>

                        <!-- OSGi Manifest Metadata is specified here -->

                        <!-- The Bundle SymbolicName is the same as the artifact ID -->

                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

                       

                        <Bundle-Version>1.0.0.BUILD-2012-06-25</Bundle-Version>

       

                        <!-- Specify the Bundle activator, which is invoked when

                             the Bundle is started -->

                        <Bundle-Activator>com.icare.rpc.registration.RegistrationActivator</Bundle-Activator>

                       

                        <Bundle-Vendor>iCare.com</Bundle-Vendor>

       

                        <!-- Automatically compute all the necessary Import-Package statements -->

                        <Import-Package>*</Import-Package>

       

                        <!-- This bundle export following packages -->

                        <Export-Package>com.icare.rpc.registration.service</Export-Package>

                        <!--  <Private-Package>com.icare.rpc.conn.service</Private-Package>-->

                        <Export-Package>com.chrisuyehara.vista.rpc</Export-Package>

                        <Export-Package>com.chrisuyehara.vista.rpc.exceptions</Export-Package>

                         <Export-Package>com.icare.rpc.registration</Export-Package>

                        <!-- Packages that are not exported but need to be included

                             need to be listed as Private-Package -->

                       <Private-Package>com.icare.rpc.registration.model</Private-Package>

                       <Private-Package>com.icare.rpc.conn.exception</Private-Package>

                        <Private-Package>com.icare.rpc.conn.model</Private-Package>

                        <Private-Package>com.icare.rpc.procedure.ptlist</Private-Package>

                         <Private-Package>com.icare.rpc.procedure.registration</Private-Package>

                           <Private-Package>com.icare.rpc.registration.service.impl</Private-Package>

                         <!--   <Private-Package>om.icare.rpc.conn.service.impl</Private-Package>-->

                         <!--  <Private-Package>com.chrisuyehara.vista.rpc.exceptions</Private-Package>-->

                         <Private-Package>com.chrisuyehara.vista.rpc.procedures</Private-Package>

                          <Private-Package>com.chrisuyehara.vista.rpc.models</Private-Package>

                     </instructions>

                  </configuration>

               </plugin>

        • 1. Re: exported service not recognized
          Thomas Diesler Master

          What does the debug log say?

          • 2. Re: exported service not recognized
            Jignesh Patel Newbie

            OK after debugging figured out Maven skips multiple tags with same name and chooses only. So I have updated my maven dependecy and looks like I have jar file generated properly.

            However I am having problem for accessing a non OSGI module(Customize) from Jboss module  package. Here is module.xml file

            <?xml version="1.0" encoding="UTF-8"?>

            <module xmlns="urn:jboss:module:1.1" name="com.chrisuyehara">

                <!--

                <properties>

                    <property name="jboss.api" value="private"/>

                </properties>

                -->

                <resources>

                    <resource-root path="java-vista-rpc-client-1.0.jar"/>

                </resources>

             

             

            </module>

             

            I did mention that package name in my import statement, but didn't work.

            <Import-Package>org.osgi.framework;version="1.3.0",org.slf4j;version="1.6.1",com.chrisuyehara,*</Import-Package>

             

             

            Does jboss supprots loading custom jars(i.e. Modules but non OSGI) to OSGI bundles?

             

            Also oddly when I tried to add following lines in standalone.xml I got runtime exception.

             

                            <property name="org.jboss.osgi.system.modules">

                                org.slf4j,

                            </property>


                            <property name="org.osgi.framework.system.packages.extra">

                                org.slf4j;version=1.6.1,

                            </property>

             

            14:52:17,303 WARN  [org.jboss.modules] (MSC service thread 1-13) Failed to define class org.apache.felix.eventadmin.impl.Activator in Module "deployment.org.apache.felix.eventadmin:1.2.6" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/felix/eventadmin/impl/Activator (Module "deployment.org.apache.felix.eventadmin:1.2.6" from Service Module Loader)

                      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                      at org.jboss.modules.FilteredLocalLoader.loadClassLocal(FilteredLocalLoader.java:46)

                      at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:132)

                      at org.jboss.osgi.framework.internal.HostBundleRevision.loadClass(HostBundleRevision.java:114)

                      at org.jboss.osgi.framework.internal.AbstractBundleState.loadClass(AbstractBundleState.java:415)

                      at org.jboss.osgi.framework.internal.HostBundleState.loadClass(HostBundleState.java:151)

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:294)

                      at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223)

                      at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)

                      at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)

                      at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)

                      at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]

                      at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]

            Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator

                      at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_31]

                      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [classes.jar:1.6.0_31]

                      at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [classes.jar:1.6.0_31]

                      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_31]

                      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                      ... 23 more

            Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator from [Module "deployment.org.apache.felix.eventadmin:1.2.6" from Service Module Loader]

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                      ... 29 more

             

             

            14:52:17,311 ERROR [org.jboss.as.osgi] (MSC service thread 1-13) JBAS011900: Cannot start bundle: org.apache.felix.eventadmin:1.2.6: org.osgi.framework.BundleException: Cannot start bundle: org.apache.felix.eventadmin:1.2.6

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:328) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]

                      at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]

            Caused by: java.lang.ClassNotFoundException: org.apache.felix.eventadmin.impl.Activator from [Module "deployment.org.apache.felix.eventadmin:1.2.6" from Service Module Loader]

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:132) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.osgi.framework.internal.HostBundleRevision.loadClass(HostBundleRevision.java:114) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.AbstractBundleState.loadClass(AbstractBundleState.java:415) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.loadClass(HostBundleState.java:151) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:294) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      ... 10 more

             

             

            14:52:17,321 WARN  [org.jboss.modules] (MSC service thread 1-13) Failed to define class org.apache.aries.jmx.Activator in Module "deployment.org.apache.aries.jmx:0.3.0" from Service Module Loader: java.lang.LinkageError: Failed to link org/apache/aries/jmx/Activator (Module "deployment.org.apache.aries.jmx:0.3.0" from Service Module Loader)

                      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                      at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                      at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                      at org.jboss.modules.FilteredLocalLoader.loadClassLocal(FilteredLocalLoader.java:46)

                      at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:132)

                      at org.jboss.osgi.framework.internal.HostBundleRevision.loadClass(HostBundleRevision.java:114)

                      at org.jboss.osgi.framework.internal.AbstractBundleState.loadClass(AbstractBundleState.java:415)

                      at org.jboss.osgi.framework.internal.HostBundleState.loadClass(HostBundleState.java:151)

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:294)

                      at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223)

                      at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494)

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144)

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119)

                      at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416)

                      at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49)

                      at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]

                      at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]

            Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator

                      at java.lang.ClassLoader.defineClass1(Native Method) [classes.jar:1.6.0_31]

                      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [classes.jar:1.6.0_31]

                      at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [classes.jar:1.6.0_31]

                      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [classes.jar:1.6.0_31]

                      at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                      at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                      ... 23 more

            Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator from [Module "deployment.org.apache.aries.jmx:0.3.0" from Service Module Loader]

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                      ... 29 more

             

             

            14:52:17,333 ERROR [org.jboss.as.osgi] (MSC service thread 1-13) JBAS011900: Cannot start bundle: org.apache.aries.jmx:0.3.0: org.osgi.framework.BundleException: Cannot start bundle: org.apache.aries.jmx:0.3.0

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:328) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]

                      at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]

            Caused by: java.lang.ClassNotFoundException: org.apache.aries.jmx.Activator from [Module "deployment.org.apache.aries.jmx:0.3.0" from Service Module Loader]

                      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:132) [jboss-modules.jar:1.1.1.GA]

                      at org.jboss.osgi.framework.internal.HostBundleRevision.loadClass(HostBundleRevision.java:114) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.AbstractBundleState.loadClass(AbstractBundleState.java:415) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.loadClass(HostBundleState.java:151) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:294) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]

                      ... 10 more

            • 3. Re: exported service not recognized
              Thomas Diesler Master

              Again, what does the debug log say