You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by samz2000 <zh...@gmail.com> on 2014/04/07 20:58:26 UTC

CXF failed to publish endpoints in Eclipse 4.2.2 OSGi, Jetty 8.1.14 and Spring 3.0.7 environment

I'm trying to run CXF on a server platform based on Equinox 4.2.2, Spring
3.0.7 and Jetty 8.1.14. However, I struggle a long time to make CXF working,
I hope somebody can shed some light on it. 

You can download the complete research project from my google drive (about
45mb).
https://drive.google.com/file/d/0BwQeEkWPle9cYUZjbkpuVXJEQ00/edit?usp=sharing

To setup the enviornment in Eclipse, 
a) you need to unzip the file, then import those projects into your Eclipse
workspace (use File | Import | Existing projects into workspace). 
b) Then use 'jetty-config8b/targetRuntime/target8bReduced.target' to setup
your Eclipse runtime target
c) Then launch 'jetty-config8b/launcher/jettyLauncher8bReduced.launch' to
fire up the server

I used the following components in my research. 

Eclipse runtime(based on 4.2.2)
Jetty (based on 8.1.14, working fine)
Slf4j (based on 1.7.6, working fine)
Spring (based on 3.0.7, working fine)
Apache CXF (based on 2.6.13, not working)

The Spring and Jetty works fine. The standalone war gets deployed (see
http://localhost:48080/hello). The bundlized war gets deployed too (See
http://localhost:48080/test/helloServlet, or
http://localhost:48080/test/hello/index.html). the Spring is also
instantantiated (EchoService published).
 
However, I couldn't get the CXF to be published to the default endpoint
http://localhost:48080/cxf (I used port 48080). It seems the CXF servlet is
never instantiated and mapped to the context path '/cxf'. If however, I
changed the 'address' attribute to use absolute address, for example,
'http://localhost:38080/myservice/HelloWorld', the web services endpoint
gets published. See file hello.spring.xml (in the web service demo bunlde:
com.demo.frameworks.interop.webservices.hello) for the configuration. I
cannot force to use port 48080 for the absolute address, it will blow off
the Jetty startup. It seems CXF fire up a complete different Jetty instance. 

Folder structures:
==================
com.demo.frameworks.interop.webservices.hello (partially working, CXF web
service)
  +META-INF
    +spring
	  +hello.spring.xml
com.demo.frameworks.spring.test (working, spring service, EchoService)
com.demo.frameworks.web.example.hello (working, bundlized war, context path:
/test/helloServlet, /test/hello/index.html)
jetty-config8b
  +jetty.home
    +etc (jetty configuration xmls and logback xml)
	+logs (store the logs)
	+webapps (Jetty watch folder)
	  +hello.war (a hello world war to be deployed to Jetty)
  +launcher (Eclipse launcher to launch the demo)
  +targetRuntime (Use this .target to setup Eclipse target runtime)
MyTargetRuntime (Target runtime plugins)

Thanks a lot.
Sam



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-failed-to-publish-endpoints-in-Eclipse-4-2-2-OSGi-Jetty-8-1-14-and-Spring-3-0-7-environment-tp5742547.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: CXF failed to publish endpoints in Eclipse 4.2.2 OSGi, Jetty 8.1.14 and Spring 3.0.7 environment

Posted by Sergey Beryozkin <sb...@gmail.com>.
Christian fixed it for the incoming 3.0.0

Sergey
On 18/04/14 18:30, samz2000 wrote:
> The current CXF 2.6.13 or 2.7.10 - the blueprint xml files contain name space
> handler from Apache Aries, which prevent other Blueprint implementation such
> as Eclipse Gemini (https://www.eclipse.org/gemini/) to initialize CXF. I
> think CXF should not locked itself in Apache Aries, just my 2 cents.
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
>
>             xsi:schemaLocation="
>              http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>
>    <cm:property-placeholder persistent-id="org.apache.cxf.osgi"
> id="cxfOsgiProperties">
>
>      <cm:default-properties>
>
>        <cm:property name="org.apache.cxf.servlet.context" value="/cxf"/>
>        <cm:property name="org.apache.cxf.servlet.name"
> value="cxf-osgi-transport-servlet"/>
>        <cm:property name="org.apache.cxf.servlet.hide-service-list-page"
> value="false"/>
>        <cm:property name="org.apache.cxf.servlet.disable-address-updates"
> value="false"/>
>        <cm:property name="org.apache.cxf.servlet.base-address" value=""/>
>        <cm:property name="org.apache.cxf.servlet.service-list-path"
> value=""/>
>        <cm:property name="org.apache.cxf.servlet.static-resources-list"
> value=""/>
>        <cm:property name="org.apache.cxf.servlet.redirects-list" value=""/>
>        <cm:property name="org.apache.cxf.servlet.redirect-servlet-name"
> value=""/>
>        <cm:property name="org.apache.cxf.servlet.redirect-servlet-path"
> value=""/>
>        <cm:property name="org.apache.cxf.servlet.service-list-all-contexts"
> value=""/>
>        <cm:property
> name="org.apache.cxf.servlet.service-list-page-authenticate" value="false"/>
>        <cm:property
> name="org.apache.cxf.servlet.service-list-page-authenticate-realm"
> value="karaf"/>
>      </cm:default-properties>
>
>    </cm:property-placeholder>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/CXF-failed-to-publish-endpoints-in-Eclipse-4-2-2-OSGi-Jetty-8-1-14-and-Spring-3-0-7-environment-tp5742547p5743036.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>


Re: CXF failed to publish endpoints in Eclipse 4.2.2 OSGi, Jetty 8.1.14 and Spring 3.0.7 environment

Posted by samz2000 <zh...@gmail.com>.
The current CXF 2.6.13 or 2.7.10 - the blueprint xml files contain name space
handler from Apache Aries, which prevent other Blueprint implementation such
as Eclipse Gemini (https://www.eclipse.org/gemini/) to initialize CXF. I
think CXF should not locked itself in Apache Aries, just my 2 cents. 

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"

           xsi:schemaLocation="
            http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

  <cm:property-placeholder persistent-id="org.apache.cxf.osgi"
id="cxfOsgiProperties">

    <cm:default-properties>

      <cm:property name="org.apache.cxf.servlet.context" value="/cxf"/>
      <cm:property name="org.apache.cxf.servlet.name"
value="cxf-osgi-transport-servlet"/>
      <cm:property name="org.apache.cxf.servlet.hide-service-list-page"
value="false"/>
      <cm:property name="org.apache.cxf.servlet.disable-address-updates"
value="false"/>
      <cm:property name="org.apache.cxf.servlet.base-address" value=""/>
      <cm:property name="org.apache.cxf.servlet.service-list-path"
value=""/>
      <cm:property name="org.apache.cxf.servlet.static-resources-list"
value=""/>
      <cm:property name="org.apache.cxf.servlet.redirects-list" value=""/>
      <cm:property name="org.apache.cxf.servlet.redirect-servlet-name"
value=""/>
      <cm:property name="org.apache.cxf.servlet.redirect-servlet-path"
value=""/>
      <cm:property name="org.apache.cxf.servlet.service-list-all-contexts"
value=""/>
      <cm:property
name="org.apache.cxf.servlet.service-list-page-authenticate" value="false"/>
      <cm:property
name="org.apache.cxf.servlet.service-list-page-authenticate-realm"
value="karaf"/>
    </cm:default-properties>

  </cm:property-placeholder>



--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-failed-to-publish-endpoints-in-Eclipse-4-2-2-OSGi-Jetty-8-1-14-and-Spring-3-0-7-environment-tp5742547p5743036.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: CXF failed to publish endpoints in Eclipse 4.2.2 OSGi, Jetty 8.1.14 and Spring 3.0.7 environment

Posted by samz2000 <zh...@gmail.com>.
Resolved by doing the following:

1. Add Apache Aries 1.0.0
2. Fix CXF bundle MANIFEST (add bundle dependency on Apache Aries blueprint)
3. Add ops4j whiteboard
4. Add equinox ds, cs
5. Define system property org.osgi.framework.bootdelegation=*.





--
View this message in context: http://cxf.547215.n5.nabble.com/CXF-failed-to-publish-endpoints-in-Eclipse-4-2-2-OSGi-Jetty-8-1-14-and-Spring-3-0-7-environment-tp5742547p5743035.html
Sent from the cxf-dev mailing list archive at Nabble.com.