10 Replies Latest reply on Oct 26, 2010 7:24 AM by steinermite

    Problem running sample  payment-service-se

    sheths

      I did not see any cxf.xml file in the sample for payment-service-se

       

      Here is the error I see in Karaf console

      karaf@root> Exception in thread "SpringOsgiExtenderThread-59" java.lang.IllegalS

      tateException: BeanFactory not initialized or already closed - call 'refresh' be

      fore accessing beans via the ApplicationContext

      at org.springframework.context.support.AbstractRefreshableApplicationCon

      text.getBeanFactory(AbstractRefreshableApplicationContext.java:153)

      at org.springframework.osgi.extender.internal.dependencies.startup.Depen

      dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx

      ecutor.java:345)

      at org.springframework.osgi.extender.internal.dependencies.startup.Depen

      dencyWaiterApplicationContextExecutor.fail(DependencyWaiterApplicationContextExe

      cutor.java:401)

      at org.springframework.osgi.extender.internal.dependencies.startup.Depen

      dencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContex

      tExecutor.java:287)

      at org.springframework.osgi.extender.internal.dependencies.startup.Depen

      dencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContext

      Executor.java:175)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp

      plicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)

      at org.springframework.osgi.extender.internal.activator.ContextLoaderLis

      tener$2.run(ContextLoaderListener.java:718)

      at java.lang.Thread.run(Thread.java:619)

       

      Here is what I see in Karaf.log file:

       

      org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location classpath:META-INF/cxf/cxf.xml

      Offending resource: URL bundleentry://191.fwk13671123/META-INF/spring/beans.xml; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|http://bnd.id=191/|bnd.sym=null]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|http://bnd.id=191/|bnd.sym=null] cannot be resolved to URL because it does not exist

      at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)

      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)

      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:182)

      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)

      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)

      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

      at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)

      at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)

      at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

      at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)

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

      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)

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

      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)

      at java.lang.Thread.run(Thread.java:619)

      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|http://bnd.id=191/|bnd.sym=null]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|http://bnd.id=191/|bnd.sym=null] cannot be resolved to URL because it does not exist

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

      at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

      at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:174)

      ... 23 more

      Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|http://bnd.id=191/|bnd.sym=null] cannot be resolved to URL because it does not exist

      at org.springframework.osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)

      at org.springframework.osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:180)

      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

      ... 27 more

        • 1. Re: Problem running sample  payment-service-se
          maqish

          i am wondering if you have ever solved this problem. I have the same issues. I did load a few features in SMX/Fuse but that did not solve the problem.

           

          i have copied the bundle-context.xml from the example project to see if i had not made any mistakes/typos.

           

          In my project no file named cxf.xml exists. If there should be any, then why does the example project does not have one as well?

           

          i'm kind of lost right now.

           

          this is the part in the bundle-context.xml that i've kopied.

           

           

           

           

          Marc

          • 2. Re: Problem running sample  payment-service-se
            gertv

            L.S.,

             

            The META-INF/cxf files are in the CXF Bundle JAR and some of the CXF binding/transport JARs.  Could you do an osgi:headers  for your bundle and check if it imports the META-INF.cxf package (replacing the / by a . because the import use package naming convention)?

             

            If you look at e.g. examples/cxf-osgi/pom.xml that is being shipped with the kit, you'll notice it has Felix bundle plugin configuration to explicitly import that package as well.

             

            Regards,

             

            Gert

            • 3. Re: Problem running sample  payment-service-se
              maqish

              thanks for the reply..

               

              i've changed my pom so that it (for the felix plugin part) looks like the one that comes with the examples. below you will see the plugin part.

               

              and noticed that i do not see anything that mentions the cxf packages/xml

               

              Manifest-Version = 1.0

              Export-Package = com.madmaq.testBundle;version="0";uses:="javax.jws,nl.dutchworld.helloperson",nl.dutchworld.helloperson;version="0";uses:="javax.jws,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws"

              Unversioned-Imports = *

              Bundle-Classpath = .

              Built-By = maqish

              Bundle-Name = testBundle

              Created-By = Apache Maven

              Build-Jdk = 1.6.0_20

              Spring-DM-Version = 0.0.1-SNAPSHOT

              Bundle-ManifestVersion = 2

              Import-Package = javax.jws,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws,org.apache.log4j

              Bundle-SymbolicName = testBundle

              Archiver-Version = Plexus Archiver

               

               

              in my opinion i should see something that mentions the cxf packages/xml

               

              or am i wrong in thinking that it should be mentioned there?

              • 4. Re: Problem running sample  payment-service-se
                gertv

                L.S.,

                 

                No, you're right -- the information should definitely be visible when you do a an osgi:headers, because that's also the information that the OSGi framework will be using to wire things.

                 

                Could it be that the  setting causes the plugin to generate the MANIFEST.MF in the wrong directory?  I've never had to use that setting before and I don't think you should need it for a simple bundle.  Also, I would recommend you to upgrade to a later version of the maven-bundle-plugin (I think 2.1.0 is the latest) because it has a few useful extras (like being able to look for fully-qualified classnames in your Spring XML files).

                 

                Regards,

                 

                Gert

                • 5. Re: Problem running sample  payment-service-se
                  treyvusa

                  Hi,

                   

                  I had very similar issue and solved it with Freeman's help.

                  Please check this thread:

                   

                  http://fusesource.com/forums/thread.jspa?threadID=1853&tstart=15

                   

                  Alex

                  • 6. Re: Problem running sample  payment-service-se
                    maqish

                    thanks,

                     

                    i've tried the suggestion that you've mentioned but still no luck.

                     

                    i now downloaded the payments-service.zip and followed the README.txt.

                     

                    i'm using 64bit Ubuntu 10.4 with java1.5.0.22(32b) although the 1.6(64b) results is not really different from the 32b version. (it' the same really)

                     

                    i'm quite sure that i've followed the readme.txt correctly and felt quite confident that it would work this time but still the error for not finding the xml is present.

                    i'm quite ready to pull my hair out since this should be so easy but i cannot seem to make it work.

                     

                    the message

                     

                    Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=178|bnd.sym=null] cannot be resolved to URL because it does not exist

                    • 7. Re: Problem running sample  payment-service-se
                      p06392

                      I have the same problem !

                       

                      I'm quite ready to pull my hair out too !!!!

                       

                      Gert, can you help us ?

                       

                       

                      Thanks in advance !

                       

                      JMH

                      • 8. Re: Problem running sample  payment-service-se
                        p06392

                        For me the problem is solved !

                         

                        You need to import explicitly the following resources :

                              

                         

                        I hope that can help you...

                         

                        JMH

                         

                        Edited by: p06392 on May 21, 2010 9:42 PM

                        • 9. Re: Problem running sample  payment-service-se
                          maqish

                          i've created a new project in which i would only get a webservice.

                           

                          so i've added the list mentioned above but the error remains the same.

                           

                          i have downloaded the cxf.jar and others and did see the xml in the META-INF/cxf directory but what to do with these jars?

                           

                          ive copied them into the $/target/jaxws</sourceRoot>                             <wsdlOptions>                                 <wsdlOption>                                     <wsdl>$/src/main/resources/Products.wsdl

                           

                          the headers in fuse/smx 4.2

                           

                          product_ws (218)

                          -


                          Manifest-Version = 1.0

                          Archiver-Version = Plexus Archiver

                          Unversioned-Imports = *

                          Built-By = maqish

                          Created-By = Apache Maven

                          Import-Package = javax.jws,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws

                          Spring-DM-Version = 0.0.1-SNAPSHOT

                          Export-Package = nl.dutchworld.products;version="0";uses:="javax.jws,javax.xml.bind.annotation,javax.xml.namespace,javax.xml.ws",nl.dws.mmi.product_ws;version="0";uses:="javax.jws,nl.dutchworld.products"

                          Bundle-Name = product_ws

                          Bundle-Classpath = .

                          Build-Jdk = 1.5.0_22

                          Bundle-ManifestVersion = 2

                          Bundle-SymbolicName = product_ws

                           

                           

                          The error

                           

                          17:20:49,032 | ERROR | xtenderThread-54 | ContextLoaderListener            | BundleApplicationContextListener   50 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=product_ws, config=osgibundle:/META-INF/spring/*.xml))

                          org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location classpath:META-INF/cxf/cxf.xml

                          Offending resource: URL bundleentry://218.fwk22266741/META-INF/spring/beans.xml; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=218|bnd.sym=product_ws]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=218|bnd.sym=product_ws] cannot be resolved to URL because it does not exist

                               at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

                               at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)

                               at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)

                               at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:182)

                               at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)

                               at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)

                               at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

                               at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

                               at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

                               at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

                               at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:176)

                               at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:142)

                               at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

                               at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)

                               at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)

                               at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)

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

                               at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)

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

                               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)

                               at java.lang.Thread.run(Thread.java:595)

                          Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=218|bnd.sym=product_ws]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=218|bnd.sym=product_ws] cannot be resolved to URL because it does not exist

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

                               at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

                               at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

                               at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:174)

                               ... 23 more

                          Caused by: java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=218|bnd.sym=product_ws] cannot be resolved to URL because it does not exist

                               at org.springframework.osgi.io.OsgiBundleResource.getURL(OsgiBundleResource.java:228)

                               at org.springframework.osgi.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:180)

                               at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

                               ... 27 mor

                           

                          Edited by: maqish on May 28, 2010 3:31 PM

                          • 10. Re: Problem running sample  payment-service-se
                            steinermite

                            Did you manage to fix the problem I have had the same issue for the last few hours running ServiceMix 4.3

                             

                            I have also noticed that my OSGi headers also do not contain any imports

                             

                            karaf@root>

                            karaf@root> osgi:headers 192

                             

                            Bundle 192

                            -


                            Manifest-Version = 1.0

                            Archiver-Version = Plexus Archiver

                            Created-By = Apache Maven

                            Built-By = steinerc

                            Build-Jdk = 1.6.0_20

                             

                            The Exception I am getting is

                             

                            Exception

                            -


                            Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=192|bnd.sym=null]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml|bnd.id=192|bnd.sym=null] cannot be resolved to URL because it does not exist

                             

                            pom.xml (pluggin)

                             

                                         

                                                         META-INF.cxf,

                                                         javax.jws,

                                                         javax.wsdl,

                                                         org.apache.cxf.bus,

                                                         org.apache.cxf.bus.resource,

                                                         org.apache.cxf.bus.spring,

                                                         org.apache.cxf.configuration.spring,

                                                         org.apache.cxf.resource,

                                                         org.springframework.beans.factory.config,

                                                          

                            •                

                                                           

                             

                            My bundle-context.xml

                            -


                             

                             

                             

                             

                            Any help by anyone would be greatly appreciated!!

                             

                            Running ESB 4.3 have install the latest maven-bundle-plugin just not sure else I can do?

                             

                            Regards