Announcement Announcement Module
Collapse
No announcement yet.
DM Server and CXF Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DM Server and CXF

    Hi everybody,

    I newly started to look DM Server, I am not seeing in documentation anything about webservices, particulary for CXF....

    Is the integration is so straight forward that nobody has felt the need of writing about it or it is not possible at the moment...

    I used the CXF in OSGi environment inside of Servicemix so I know it is possible but what should I do in dm server...

    Just place the CXF Servlet in a web.xml and it would work or a complex configuration is necessary?

    Thx for the answers...

  • #2
    AFAIK, CXF should just work in dm Server. If you give it a go and encounter problems let us know and we'll do what we can to help.

    Comment


    • #3
      Thx for the answer an then the first question....

      While I don't want to fight with all manifest configuration for cxf, I took the cxf bundle from Servicemix 4 and try to install it to dm server....

      The correct way of doing this, I think is to places it under repository/bundles/usr at dm server (at least from what I read from the documentation)...

      And then I started the dm server with -clean parameter and I expected to see in osgi panel (installed but not resolved) a cxf bundle but after several attempts nothing is there....

      I am sure this artifact is a OSGi Bundle because it deploys in Servicemix 4 and the manifest entries are there...

      So my guess it is not deployed because of some missing dependencies but there is nothing in the logs, where should I look to understand what is going wrong? Should I have the increase log level somewhere....

      If somebody like to see the artifact it is under fuse
      system\org\apache\cxf\cxf-bundle\2.2.2.1-fuse
      directory with the name
      cxf-bundle-2.2.2.1-fuse.jar

      Comment


      • #4
        dm Server provisions dependencies from its repository as they're needed. This means that it will only install a bundle from its repository if the bundle is depended upon by something else that's been deployed, e.g. another bundle that imports a CXF package or a plan that lists the CXF bundle as one of its dependencies.

        If you want to see if the CXF bundle will install and start in dm Server, the easiest way is probably to drop it into the pickup directory.

        Comment


        • #5
          I've done a project in DM Server with a web service, Hibernate and ActiveMQ connectivity. I tried to get CXF to work but failed. That is, it worked fine if I structured the web service component as a standard web application, but not if I structured it as an OSGI bundle, which is what I wanted to do. There were a lot of conflicts among the dependencies of these three components so that I ended up having to incorporate some of the dependencies as jars within the bundle rather than separate bundles in DM Server, but that seems to make the dependencies unavailable if you want to instantiate a service declaratively in the Spring files. Also, there was a configuration problem with CXF having to do with CXF having hyphens in package names (i.e., WEB-INF as a package in the jar) that made it impossible to do the Spring configuration of endpoints the way the CXF literature tells you to. So, I ended up using straight JAX-WS from Sun with the Spring jar from JAX-WS Commons instead. CXF does work well in Servicemix 4, but I've found DM Server hugely easier to work with, particularly because of its integration with Eclipse/STS and because it doesn't depend on doing everything with Maven, as seems to be the case with Servicemix.

          I'm hoping the thing with CXF gets ironed out in DM Server 2.0, because it's a great package, and the Sun web site is one of the slowest and quirkiest I've ever had to work with.

          Originally posted by posthumecaver View Post
          Hi everybody,

          I newly started to look DM Server, I am not seeing in documentation anything about webservices, particulary for CXF....

          Is the integration is so straight forward that nobody has felt the need of writing about it or it is not possible at the moment...

          I used the CXF in OSGi environment inside of Servicemix so I know it is possible but what should I do in dm server...

          Just place the CXF Servlet in a web.xml and it would work or a complex configuration is necessary?

          Thx for the answers...

          Comment


          • #6
            Great to hear that you like dm Server

            This is the first that I've heard of problems with getting CXF running in dm Server. If you could provide us with some more info, or even just a pointer to the CXF bundle that you tried to use, we'd be happy to dig into it.

            Thanks,
            Andy

            Comment


            • #7
              Unfortunately, I've overwritten everything and don't have the configuration files I used or the jars I tried. I know I tried the Fuse bundle version of CXF, the bundles that ship with Servicemix 4 and Fuse ESB 4, and the version of the CXF bundles that support OSGi Remote Services, and I also tried sticking the straight CXF jars into MODULE-INF/WEB-INF/lib. The project was done about six months ago on DM Server 1.0.2 before SR02. I'm pretty sure the hyphen problem had to do with the cxf.xml file.

              I think a lot of the problems I've had with dependencies are because most of the bundles for things like CXF and ActiveMQ seem to favor importing packages rather than bundles, and when you use several of those components that all have their own dependencies, there ends up being a lot of package overlap among the bundles in the container, so that it has a hard time resolving package imports.

              Comment


              • #8
                Hi,

                first of all thx for the answer...

                I got it working in 2.0M6 server....

                Here is what I have done until now

                I have to copy following bundle to repository/usr

                org.apache.servicemix.bundles.neethi-2.0.4_1.jar
                org.apache.servicemix.bundles.asm-2.2.3_1.jar
                org.apache.servicemix.bundles.bundles.xmlresolver-1.2_1.jar
                org.apache.servicemix.bundles.xmlschema-1.4.3_1.jar
                org.apache.servicemix.bundles.xmlsec-1.3.0_1.jar
                com.springsource.com.sun.xml.fastinfoset-1.2.2.jar
                com.springsource.com.javax.wsdl-1.6.1.jar
                org.apache.cxf-bundle-2.2.2.1-fuse.jar

                and a war file that is only containing web xml with cxf servlet, its only relevant context is

                <servlet>
                <servlet-name>dispatcher</servlet-name>
                <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
                </servlet>

                <servlet-mapping>
                <servlet-name>dispatcher</servlet-name>
                <mapping>/services/*</mapping>
                </servlet-mapping>

                (servicemix bundles you can be obtained from their repository or under system directory of the fuse installation structure...)

                then

                I have plan for the deployment so that bundles can be in correct order deployed....(in pickup directory)

                <plan ...
                <artifact type="bundle" name="org.apache.servicemix.bundles.asm" />
                <artifact type="bundle" name="org.apache.servicemix.bundles.neethi" />
                <artifact type="bundle" name="org.apache.servicemix.bundles.xmlresolver" />
                <artifact type="bundle" name="org.apache.servicemix.bundles.xmlschema" />
                <artifact type="bundle" name="com.springsource.com.sun.xml.fastinfoset" />
                <artifact type="bundle" name="com.springsource.javax.wsdl" />
                <artifact type="bundle" name="org.apache.cxf.bundle" />
                <artifact type="bundle" name="cxf.dmserver" />

                </plan>

                And my template.mf looks like this....

                Manifest-Version: 1.0
                Bundle-ManifestVersion: 2
                Bundle-Name: CXF dm server
                Bundle-SymbolicName: cxf.dmserver
                Bundle-Vendor: Test
                Import-Package:
                org.apache.cxf.transport.servlet,
                com.springsource.server.web.dm;version="[2.0.0,3.0.0)"
                Import-Library:
                org.springframework.spring;version="[2.5.6.A,3.1]"
                Excluded-Imports:
                org.springframework.test.*,
                org.junit.*

                Voila....

                Comment

                Working...
                X