5 Replies Latest reply on Apr 13, 2010 9:10 PM by ffang

    cxf.xml - FileNotFoundException

    senthilkumara20

      Created a CXF application and packaged it as a bundle using apache felix plugin in maven.

       

      Given the <Import-Package> to include META-INF.cxf

       

      Build was successful and bundle got created, when deployed the bundle got the exception "OSGi resource:META-INF/cxf/cxf.xml" FileNotFoundException.

       

      Code - pom.xml

       

            

       

      Edited by: senthilkumara20 on Apr 13, 2010 12:57 PM

        • 1. Re: cxf.xml - FileNotFoundException
          ffang

          Hi,

           

          I believe you use some spring-dm file like

          src/main/resources/META-INF/spring/beans.xml

          in your bundle, right?

           

          You import

           

           

          from that file, right?

           

          Could you also post that file here?

           

          Freeman

          • 2. Re: cxf.xml - FileNotFoundException
            senthilkumara20

            We called that file as deploy-context.xml and later we changed that as beans.xml and now it is working fine. Thanks.

             

            But we are unable to run our bundle yet. The problem now we facing is,

             

            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'osgiDestinationRegistry': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type to required type [java.lang.Class[]] for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

            at java.security.AccessController.doPrivileged(Native Method)

            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)

            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

            at org.springframework.osgi.extender.internal.dependencies.startup.MandatoryImporterDependencyFactory.getServiceDependencies(MandatoryImporterDependencyFactory.java:63)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.doFindDependencies(DependencyServiceManager.java:272)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.access$700(DependencyServiceManager.java:40)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager$1.run(DependencyServiceManager.java:213)

            at org.springframework.osgi.extender.internal.util.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:124)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager.findServiceDependencies(DependencyServiceManager.java:209)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:248)

            at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)

            at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)

            at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)

            • 3. Re: cxf.xml - FileNotFoundException
              ffang

              Hi,

               

              Your pom.xml miss Import-Package

              org.apache.cxf.transport.http_osgi

               

              Also from your pom.xml I believe you will encounter more CNFE which all caused by missing Import-Package

               

              May be you need take a look at cxf-osgi examples shipped with kit, to get idea what package you need import there.

               

              Freeman

              • 4. Re: cxf.xml - FileNotFoundException
                senthilkumara20

                Hi,

                 

                Thanks for your reply and it is really helpful. We had a look over the jpa-osgi and cxf-osgi (the examples available in kit)

                 

                We imported all the packages available in the examples in our bundle and still we are getting some CNFE. It would be helpful if we get some idea how to find the missing packages and add altogether.

                 

                I have pasted the code snippet for the list of imported packages we added after some trial and error.

                 

                <Import-Package>

                META-INF.cxf,

                META-INF.cxf.osgi,

                org.apache.cxf,

                org.hibernate,

                javassist,

                org.postgresql,

                org.apache.commons.httpclient;version="3.1",

                org.apache.commons.httpclient.methods;version="3.1",

                org.apache.cxf.binding,

                org.apache.cxf.bus,

                org.apache.cxf.bus.resource,

                org.apache.cxf.bus.spring,

                org.apache.cxf.configuration.spring,

                org.apache.cxf.jaxrs.utils,

                org.apache.cxf.resource,

                org.apache.cxf.transport.http_osgi,

                org.springframework.beans.factory.config,

                org.apache.servicemix.common.osgi,

                org.apache.servicemix.cxfse,

                org.hibernate.ejb,

                org.hibernate.hql.ast,

                org.hibernate.proxy,

                org.springframework.orm.jpa,

                org.springframework.orm.jpa.vendor,

                org.apache.cxf.transport,

                org.springframework.transaction.support,org.apache.cxf.wsdl11,org.apache.cxf.workqueue,org.apache.cxf.buslifecycle,*

                • 5. Re: cxf.xml - FileNotFoundException
                  ffang

                  Hi,

                   

                  Generally you should know what bundle you need from the CNFE in log, it's totally depend your business logic.

                   

                  Freeman