13 Replies Latest reply on Sep 22, 2013 1:22 AM by ffang

    Error while osg-fying existing webservice war

    imranrazakhan

      I am deploying my existing webservice war(its working on tomcat) on jboss fuse. I changed my manifest.mf like below

      Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: HelloCxfWS Bundle-SymbolicName: HelloCxfWS Bundle-Version: 1.0.0.qualifier Bundle-ClassPath: WEB-INF/classes/ Required-Bundle: org.apache.cxf.cxf-bundle Import-Package: javax.jws,javax.wsdl,javax.xml.bind,javax.xml.bind.annotation,javax.xml.namespace, javax.xml.ws,META-INF.cxf,META-INF.cxf.osgi, org.apache.cxf.bus, org.apache.cxf.bus.spring,org.apache.cxf.bus.resource, org.apache.cxf.configuration.spring,org.apache.cxf.resource,org.apache.cxf.jaxws, org.apache.servicemix.cxf.transport.http_cxf,org.springframework.beans.factory.config, org.apache.servicemix.cxf.transport.http_osgi Private-Package: com.irk.test.ws.* DynamicImport-Package: *

      But i am getting following error in logs

      13:24:00,757 | WARN | edhat-024/deploy | fileinstall | 7 - org.apache.felix.fileinstall - 3.3.11.redhat-60024 | Error while starting bundle: file:/E:/jboss-fuse-6.0.0.redhat-024/deploy/HelloCxfWS.war org.osgi.framework.BundleException: Unresolved constraint in bundle HelloCxfWS [292]: Unable to resolve 292.0: missing requirement [292.0] osgi.wiring.package; (osgi.wiring.package=org.apache.servicemix.cxf.transport.http_cxf) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4155)[org.apache.felix.framework-4.0.3.redhat-60024.jar:] at org.apache.felix.framework.Felix.startBundle(Felix.java:2055)[org.apache.felix.framework-4.0.3.redhat-60024.jar:] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.0.3.redhat-60024.jar:] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[7:org.apache.felix.fileinstall:3.3.11.redhat-60024] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[7:org.apache.felix.fileinstall:3.3.11.redhat-60024] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1208)[7:org.apache.felix.fileinstall:3.3.11.redhat-60024] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:503)[7:org.apache.felix.fileinstall:3.3.11.redhat-60024] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[7:org.apache.felix.fileinstall:3.3.11.redhat-60024] Please help in this regard

      Regards,

        • 1. Re: Error while osg-fying existing webservice war
          ffang

          Hi,

           

          There's no bundle export package like

           

          org.apache.servicemix.cxf.transport.http_cxf

          org.apache.servicemix.cxf.transport.http_osgi

           

          You shouldn't put those packages into your OSGi Import-Package headers.

           

          Freeman

          • 2. Re: Error while osg-fying existing webservice war
            imranrazakhan

            HI,

             

            i remove them and now getting following error

             

            org.osgi.framework.BundleException: Unresolved constraint in bundle HelloCxfWS [310]: Unable to resolve 310.0: missing requirement [310.0] osgi.wiring.package; (osgi.wiring.package=org.apache.cxf.transport.servlet.CXFServlet)

              at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4155)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

              at org.apache.felix.framework.Felix.startBundle(Felix.java:2055)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

              at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

             

            My manifest.mf is

             

            Manifest-Version: 1.0

            Bundle-ManifestVersion: 2

            Bundle-Name: HelloCxfWS

            Bundle-SymbolicName: HelloCxfWS

            Bundle-Version: 1.0.0.qualifier

            Bundle-ClassPath: WEB-INF/classes/

            Require-Bundle: org.apache.cxf.cxf-bundle

            Import-Package: javax.jws,javax.wsdl,javax.xml.bind,javax.xml.bind.annotation,javax.xml.namespace,

            javax.xml.ws,META-INF.cxf,META-INF.cxf.osgi,

            org.apache.cxf.bus, org.apache.cxf.bus.spring,org.apache.cxf.bus.resource,

            org.apache.cxf.configuration.spring,org.apache.cxf.resource,org.apache.cxf.jaxws,

            org.springframework.beans.factory.config,org.apache.cxf.transport.servlet.CXFServlet

            Private-Package: com.irk.test.ws.*

            DynamicImport-Package: *

             

            Regards

            • 3. Re: Error while osg-fying existing webservice war
              ffang

              Hi,

               

              org.apache.cxf.transport.servlet.CXFServlet is a class but not a package,  you shouldn't import it as well, try org.apache.cxf.transport.servlet instead.

               

              Freeman

              • 4. Re: Error while osg-fying existing webservice war
                imranrazakhan

                Hi,

                 

                i tried it but still its not working

                 

                20:28:49,550 | INFO  | edhat-024/deploy | fileinstall                      | 7 - org.apache.felix.fileinstall - 3.3.11.redhat-60024 | Installed E:\jboss-fuse-6.0.0.redhat-024\deploy\HelloCxfWS.war

                20:28:49,582 | INFO  | Executor: 3      | WebXmlObserver                   | 229 - org.ops4j.pax.web.pax-web-extender-war - 1.1.11 | Using [HelloCxfWS] as web application context name

                20:28:49,582 | INFO  | Executor: 3      | WebXmlObserver                   | 229 - org.ops4j.pax.web.pax-web-extender-war - 1.1.11 | Using [] as web application root path

                20:28:49,582 | INFO  | edhat-024/deploy | fileinstall                      | 7 - org.apache.felix.fileinstall - 3.3.11.redhat-60024 | Started bundle: file:/E:/jboss-fuse-6.0.0.redhat-024/deploy/HelloCxfWS.war

                20:28:49,586 | INFO  | -1.1.11-thread-3 | HttpServiceFactoryImpl           | 100 - org.ops4j.pax.web.pax-web-runtime - 1.1.11 | Binding bundle: [HelloCxfWS [327]] to http service

                20:28:49,587 | INFO  | Executor: 3      | ContextHandler                   | 90 - org.eclipse.jetty.util - 7.6.7.v20120910 | started HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@469fb8}

                20:28:49,589 | INFO  | Executor: 3      | ContextHandler                   | 90 - org.eclipse.jetty.util - 7.6.7.v20120910 | stopped HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@469fb8}

                20:28:49,595 | ERROR | Executor: 3      | RegisterWebAppVisitorWC          | 229 - org.ops4j.pax.web.pax-web-extender-war - 1.1.11 | Registration exception. Skipping.

                java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet not found by HelloCxfWS [327]

                  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

                  at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

                  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]

                  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.7.0_25]

                 

                my updated file is like below

                 

                Manifest-Version: 1.0

                Bundle-ManifestVersion: 2

                Bundle-Name: HelloCxfWS

                Bundle-SymbolicName: HelloCxfWS

                Bundle-Version: 1.0.0.qualifier

                Bundle-ClassPath: WEB-INF/classes/

                Import-Package: javax.jws,javax.wsdl,javax.xml.bind,javax.xml.bind.annotation,javax.xml.namespace,

                javax.xml.ws,META-INF.cxf,META-INF.cxf.osgi,org.apache.cxf.bus,org.apache.cxf.bus.spring,

                org.apache.cxf.bus.resource,org.apache.cxf.configuration.spring,org.apache.cxf.resource,org.apache.cxf.transport.servlet.*;resolution:=optional,

                org.apache.cxf.jaxws,org.springframework.beans.factory.config,org.springframework.web.context

                Private-Package: com.irk.test.ws.*

                DynamicImport-Package: *

                 

                Regards,

                • 5. Re: Error while osg-fying existing webservice war
                  ffang

                  Hi,

                   

                  You should use

                  org.apache.cxf.transport.servlet

                  but not

                  org.apache.cxf.transport.servlet.*

                  Freeman

                  • 6. Re: Error while osg-fying existing webservice war
                    imranrazakhan

                    20:51:12,366 | INFO  | Executor: 2      | XmlBeanDefinitionReader          | 105 - org.springframework.beans - 3.1.3.RELEASE | Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]

                    20:51:15,429 | ERROR | Executor: 2      | ContextLoader                    | 174 - org.springframework.web - 3.1.3.RELEASE | Context initialization failed

                    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]

                    Offending resource: ServletContext resource [/WEB-INF/cxf-beans.xml]

                     

                     

                      at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[105:org.springframework.beans:3.1.3.RELEASE]

                      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)[105:org.springframework.beans:3.1.3.RELEASE]

                      at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)[105:org.springframework.beans:3.1.3.RELEASE]

                      at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:316)[105:org.springframework.beans:3.1.3.RELEASE]

                    • 7. Re: Error while osg-fying existing webservice war
                      ffang

                      Hi,

                       

                      That spring NamespaceHandler is in CXF JAXWS module, the package is org.apache.cxf.jaxws.spring, so you need Import-Package org.apache.cxf.jaxws.spring as well.

                       

                      Freeman

                      • 8. Re: Error while osg-fying existing webservice war
                        imranrazakhan

                        Hi,

                         

                        I am still facing same issue

                         

                        Please look at my manifest.mf

                         

                        Manifest-Version: 1.0

                        Bundle-ManifestVersion: 2

                        Bundle-Name: HelloCxfWS

                        Bundle-SymbolicName: HelloCxfWS

                        Bundle-Version: 1.0.0.qualifier

                        Bundle-ClassPath: WEB-INF/classes/

                        Import-Package: javax.jws,javax.wsdl,

                        javax.xml.namespace,

                        META-INF.cxf,

                        META-INF.cxf.osgi,

                        org.apache.cxf.annotations,

                        org.apache.cxf.bus,

                        org.apache.cxf.bus.spring,

                        org.apache.cxf.bus.resource,

                        org.apache.cxf.configuration.spring,

                        org.apache.cxf.resource,

                        org.apache.cxf.transport.http,

                        org.apache.cxf.transport.servlet,

                        org.apache.cxf.jaxws.spring,

                        org.springframework.beans.factory.config,

                        org.springframework.aop,

                        org.springframework.aop.config,

                        org.springframework.aop.scope,

                        org.springframework.aop.framework,

                        org.springframework.web.context,

                        org.aopalliance.aop,

                        Private-Package: com.irk.test.ws.*

                        DynamicImport-Package: *

                        • 9. Re: Error while osg-fying existing webservice war
                          imranrazakhan

                          Hi Freeman,

                           

                          I have done one hack, i pick my class files from .war and create new jar file with OSGI-INF folder and blueprint.xml. Its working as per expectation.

                           

                          But i still want to deploy war. please let me know what i m missing? and how this blueprint.xml resolve everything, which mean jboss has all required packages.

                           

                          Regards,

                          Imran

                          • 10. Re: Error while osg-fying existing webservice war
                            ffang

                            Hi,

                             

                            First of all, use normal bundle(like you do now) to deploy CXF endpoint in OSGi container should be more straightforward.

                             

                            And could you please append the war project which I can build and reproduce this error, I will take a close look when I get chance.

                             

                            Freeman

                            • 11. Re: Re: Error while osg-fying existing webservice war
                              imranrazakhan

                              Hi,

                               

                              Please find eclipse kepler for jee, project file.

                               

                              Thanks in advance for your kind help.

                               

                              Regards,

                              Imran

                              • 12. Re: Error while osg-fying existing webservice war
                                imranrazakhan

                                Hi,

                                 

                                You got opportunity to see my file?

                                 

                                Regards,

                                • 13. Re: Error while osg-fying existing webservice war
                                  ffang

                                  Hi,

                                   

                                  Not yet.

                                   

                                  Could you please elaborate how can I build it as a binary war?  Could you please create a maven project which can describe the dependency, just can ensure we are on the same page in terms of dependency if I can build it as a war.

                                   

                                  Freeman