Creating DFS Services using Documentum Composer

I’m not sure how many people realize it but when you create a Documentum “artifact” project within composer, it is also a “dfs services” project.  If you right click one of your Documentum projects and bring up its properties, then select the Java Build Path, then the Libraries tab you should see something similar to this:-

image

An if you select Properties->Builders, you should see something like this:-

image

When an “artifact” project is created it also adds all the necessary DFS resources to allow you to develop Documentum services.  It will deploy a copy of the DFS SDK to your core project (incidentally this is why creating the first project in a workspace takes a little longer than you might expect) and add the DFS Services Library to your project’s java build path.  And add a DFS Builder for building your services.

Creating a Service Consumer

Just as a quick aside if you do need to create a consumer, select the “DFS Services Library” entry and then select Edit, you should see something like this:-

image

As you can see there are in fact 4 flavours of DFS services library.  The first, and the default, is concerned with developing services (today’s topic).  The remaining three are actually concerned with developing service consumers.  They are pretty self-explanatory.  The only one that perhaps requires a little explanation is the last; “DFS Local Client”.  You add this type of library to projects that are acting as “functional tests” for your services projects.  Typically, you create one or more of these “functional test” projects in the same workspace as your services projects and configure them with this type of library.  This then allows you to debug from the client into the service and back again without having to deploy to a server.  A useful feature.  I will talk more about developing service consumers in a future articles.

Building a Service

OK, so back to developing the services themselves.  As you can see your project is all set up for service development.  Now you need to develop a service.  As you will probably all be aware there are a couple of flavours of DFS service; one based on a POJO and another based on a BOF SBO (service-based object).  They are, in fact, very similar and are just annotated java classes.  You can read more about DFS and its annotations from the DFS developer’s guide.  I won’t go into these here.  We’ll use the POJO variant here.  And for convenience we’re going to use one of the samples provided in the DFS SDK; <DFS SDK install dir>/samples/HelloWorldService.  All we need to do is navigate to <DFS SDK install dir/samples/HelloWorldService/src/service folder and copy the top level folder of the source tree, “com” in this case.  Then paste it into the the /Web Services/src folder of your Documentum project.

Once you drop these sources packages and class files into the Web Services folder, and assuming that you have “automatic build” turned on, then you should see the DFS Builder leap into life and attempt to build the service.  In your Console view you’ll get a build report:-

image

And if you open the standard Navigator view (Window->Open View->Navigator) and navigate to the Web Services/bin/gen-src folder you should also see a set of generated source.  This is actually a jax-ws web service that has been generated from your POJO service.  And under the classes folder you should see a set of classes and wsdl.  These classes are an aggregate compilation of your POJO (and associated classes) and the generated jax-ws web service.  The wsdl is obviously just standard wsdl also generated from your POJO:-

image

If for some reason your service fails to compile then you will of course get all the same familiar productivity tools for dealing with these issues that you have for plain old java development.  For example you’ll get errors and warnings reported in your Problem view:-

image

And just so you know the DFS Builder does support incremental builds and will only rebuild services that have changed since the last build so it should be reasonably efficient.

Testing the service

So now we’ve reached the point where we have a service that needs testing.  There are two approaches to this.  The first is to create a parallel test project with Junit tests that exercise your service.  To facilitate this your test project would be configured with the local client library, as described above, so that it can make local invocations to your service.  This project should of course be placed under the same version control as your services project.

The second approach is to export your services as an ear, deploy it to an application server and exercise your service again via another project capable of making remote service invocations.  Before you do this though you must remember to set the archive’s context root and module name as both of these affect the eventual URL of your service.  This is a one time deal though so just right-click on the project and select Properties->Documentum Project->DFS Module:-

image

Just so you are aware.  Typically all EMC DFS services share a context root of “services” and a module name that describes their general function.  Core for core services, bpm for business process, etc.  These will then be available via URLs such as http://localhost:8080/services/core… and http://localhost:8080/services/bpm…

Once these settings are made you can export the service.  Right-click on the project and select Export->Documentum->Export Service Archive:-

image

The archive name and context root should be defaulted for you from your DFS Module settings page.  Choose an output folder.  Uncheck the Generate Publish Manifest.  This is only required is you want to publish your services to a UDDI registry using the DFS tools.  And click finish.  This will produce your ear file.  Once you are in possession of the ear you can deploy it onto your app server using the appropriate app manager console or by dropping it into the hot deploy folder.  Whichever works for you.  Once you have it deployed you can perform a quick sanity check by requesting the service’s WSDL document by requesting something like http://localhost:8080/services/helloworld/HelloWorldService?wsdl.  Assuming you get back the WSDL document (that matches the one that was generated by the builder earlier) then you are good to go.

Next you will need to create yourself another test project.  But this time configure it with one of the two available Remote Client library options, depending on your content transfer requirements.  Again, creating Junit test cases I find is the quickest and easiest.  These can be rolled up into test suites and all can be invoked easily enough through the Composer (eclipse) UI.  And once again, if you can standardize this process across your development team then you can check this test project into source control right along side your services project.

In Summary

In summary we have walked through the out-of-the-box capabilities of a Documentum project with respect to creating DFS services.  Every Documentum project has the capability to host the development and testing of DFS services.  There are four libraries that are at your disposal for development and testing.  Each project has an incremental builder that is capable of automatically building your services.  And finally there is an exporter that can produce an ear file containing your services that is ready for deployment onto any app server.

Looking forward, in future articles I will talk more about another development option which leverages both Composer’s and WTP’s capabilities.  This option gives you far greater control over the contents of your ear and brings remote debugging of your services to your IDE.

In the meantime, happy Composing.

27 thoughts on “Creating DFS Services using Documentum Composer

  1. Hi Paul,

    Thanks for the tutorial. I followed the steps that you mentioned and I got the following errors when I copied the folder ‘com’ to the web Services folder. Any ideas on how to resolve this?

    Buildfile: C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\dfs-build.xml
    [echo] defaultclasspath is C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\emc-dfs-rt.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\emc-dfs-services.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\emc-dfs-tools.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\FastInfoset.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\activation.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\http.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxb-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxb-impl.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxb-xjc.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxws-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxws-rt.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jaxws-tools.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jsr173_api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jsr181-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\jsr250-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\resolver.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\saaj-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\saaj-impl.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\sjsxp.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\stax-ex.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\jaxws\streambuffer.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\dfc\bpm_infra.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\dfc\certjFIPS.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\dfc\dfc.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\dfc\dms-client-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\dfc\jsafeFIPS.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\All-MB.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\aspectjrt.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\log4j.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\serializer.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xalan.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xercesImpl.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xml-apis.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xtrim-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xtrim-server.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\server\ucf-server-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\server\ucf-server-impl.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\server\xml-ca.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\MacOSXForker.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\mac_utilities.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\ucf-client-api.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\ucf-client-impl.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\ucf\client\ucf-installer.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\commons\commons-cli-1.0.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\commons\commons-codec-1.3.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\commons\commons-io-1.2.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\commons\commons-lang-2.1.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\javassist.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\javax.servlet.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\servlet.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\tools.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xmlsec.jar;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\lib\utils\xws-security.jar;C:\Documents and Settings\dkannoju\workspace\dfsProject\dfs-gen-rsc;C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\emc-dfs-sdk-6.0\etc
    [echo] projectclasspath is ../;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/rt.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/jsse.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/jce.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/charsets.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/ext/dnsns.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/ext/localedata.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/ext/sunjce_provider.jar;../../../../../Program Files/Java/jdk1.5.0_16/jre/lib/ext/sunpkcs11.jar;../../dfsProject/src;emc-dfs-sdk-6.0/lib/emc-dfs-services.jar;emc-dfs-sdk-6.0/lib/emc-dfs-rt.jar;emc-dfs-sdk-6.0/lib/jaxws/activation.jar;emc-dfs-sdk-6.0/lib/jaxws/FastInfoset.jar;emc-dfs-sdk-6.0/lib/jaxws/http.jar;emc-dfs-sdk-6.0/lib/jaxws/jaxb-api.jar;emc-dfs-sdk-6.0/lib/jaxws/jaxb-impl.jar;emc-dfs-sdk-6.0/lib/jaxws/jaxb-xjc.jar;emc-dfs-sdk-6.0/lib/jaxws/jaxws-api.jar;emc-dfs-sdk-6.0/lib/jaxws/jaxws-rt.jar;emc-dfs-sdk-6.0/lib/jaxws/jsr173_api.jar;emc-dfs-sdk-6.0/lib/jaxws/jsr181-api.jar;emc-dfs-sdk-6.0/lib/jaxws/jsr250-api.jar;emc-dfs-sdk-6.0/lib/jaxws/resolver.jar;emc-dfs-sdk-6.0/lib/jaxws/saaj-api.jar;emc-dfs-sdk-6.0/lib/jaxws/saaj-impl.jar;emc-dfs-sdk-6.0/lib/jaxws/sjsxp.jar;emc-dfs-sdk-6.0/lib/jaxws/stax-ex.jar;emc-dfs-sdk-6.0/lib/jaxws/streambuffer.jar;emc-dfs-sdk-6.0/lib/dfc/dfc.jar;emc-dfs-sdk-6.0/lib/utils/aspectjrt.jar;emc-dfs-sdk-6.0/lib/dfc/certjFIPS.jar;emc-dfs-sdk-6.0/lib/dfc/dms-client-api.jar;emc-dfs-sdk-6.0/lib/dfc/jsafeFIPS.jar;emc-dfs-sdk-6.0/lib/utils/xalan.jar;emc-dfs-sdk-6.0/lib/utils/xercesImpl.jar;emc-dfs-sdk-6.0/lib/utils/xtrim-api.jar;emc-dfs-sdk-6.0/lib/utils/xtrim-server.jar;emc-dfs-sdk-6.0/lib/dfc/bpm_infra.jar;emc-dfs-sdk-6.0/lib/bof/workflow.jar;emc-dfs-sdk-6.0/lib/commons/commons-codec-1.3.jar;emc-dfs-sdk-6.0/lib/commons/commons-io-1.2.jar;emc-dfs-sdk-6.0/lib/commons/commons-lang-2.1.jar;emc-dfs-sdk-6.0/lib/utils/javax.servlet.jar;emc-dfs-sdk-6.0/lib/ucf/client/ucf-installer.jar;emc-dfs-sdk-6.0/lib/ucf/server/ucf-server-api.jar;emc-dfs-sdk-6.0/lib/ucf/server/ucf-server-impl.jar;emc-dfs-sdk-6.0/lib/ucf/server/xml-ca.jar;emc-dfs-sdk-6.0/lib/utils/log4j.jar;emc-dfs-sdk-6.0/lib/utils/xml-apis.jar;../../dfsProject/Web Services;../../dfsProject/dfs-gen-src;
    [echo] default_project_libraries is C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs
    [echo] project_libraries.path is C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs
    [echo] default_project_resources is C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs
    [echo] project_resources.path is C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs
    generate:
    [generateModel] Creating ‘context-root-module-name-service-model.xml’
    [generateModel] || The following EXCEPTION occurred while executing the task:
    [generateModel] || Message: Generation of model file failed.
    [generateModel] || Caused by: Failed to generate model file due to an APT execution error. “{0}”
    [generateModel] || Caused by: APT has returned the following errors:
    [generateModel] Problem encountered during annotation processing;
    [generateModel] see stacktrace below for more information.
    [generateModel] java.lang.NoClassDefFoundError: javax/activation/DataSource
    [generateModel] at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.(RuntimeBuiltinLeafInfoImpl.java:186)
    [generateModel] at com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.(RuntimeTypeInfoSetImpl.java:25)
    [generateModel] at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:89)
    [generateModel] at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:42)
    [generateModel] at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:114)
    [generateModel] at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.(RuntimeModelBuilder.java:49)
    [generateModel] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
    [generateModel] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:253)
    [generateModel] at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:84)
    [generateModel] at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:66)
    [generateModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [generateModel] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [generateModel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [generateModel] at java.lang.reflect.Method.invoke(Method.java:585)
    [generateModel] at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
    [generateModel] at javax.xml.bind.ContextFinder.find(ContextFinder.java:366)
    [generateModel] at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    [generateModel] at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    [generateModel] at com.emc.documentum.fs.tools.impl.XmlGeneratorFactory$DsfProcessor.writePackages(XmlGeneratorFactory.java:153)
    [generateModel] at com.emc.documentum.fs.tools.impl.XmlGeneratorFactory$DsfProcessor.process(XmlGeneratorFactory.java:87)
    [generateModel] at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
    [generateModel] at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
    [generateModel] at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448)
    [generateModel] at com.sun.tools.apt.main.Main.compile(Main.java:1075)
    [generateModel] at com.sun.tools.apt.main.Main.compile(Main.java:938)
    [generateModel] at com.sun.tools.apt.Main.processing(Main.java:95)
    [generateModel] at com.sun.tools.apt.Main.process(Main.java:85)
    [generateModel] at com.sun.tools.apt.Main.process(Main.java:67)
    [generateModel] at com.emc.documentum.fs.tools.impl.ServiceModelGenerator.runAPT(ServiceModelGenerator.java:147)
    [generateModel] at com.emc.documentum.fs.tools.impl.ServiceModelGenerator.generate(ServiceModelGenerator.java:117)
    [generateModel] at com.emc.documentum.fs.tools.GenerateModelTask.executeTask(GenerateModelTask.java:147)
    [generateModel] at com.emc.documentum.fs.tools.impl.ChainedExceptionReportingTask.execute(ChainedExceptionReportingTask.java:18)
    [generateModel] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    [generateModel] at org.apache.tools.ant.Task.perform(Task.java:364)
    [generateModel] at org.apache.tools.ant.Target.execute(Target.java:341)
    [generateModel] at org.apache.tools.ant.Target.performTasks(Target.java:369)
    [generateModel] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
    [generateModel] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
    [generateModel] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
    [generateModel] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
    [generateModel] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
    [generateModel] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
    [generateModel] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

    BUILD FAILED
    C:\Documents and Settings\dkannoju\workspace\DocumentumCoreProject\dfs\dfs-build.xml:203: Generation of model file failed.

    Total time: 4 seconds

  2. Apologies for the late reply.

    Clearly this is a classpath issue.

    Are you using Composer 6.0 or 6.5?

    It looks like you are using Composer 6.5 but perhaps with a project that was originally created in Composer 6.0. The paths looks like 6.5 paths but the actual libraries being included are 6.0 libraries, which, perhaps pertinent to this conversation resided in a different strucutre.

    The easiest thing to do might be to re-create your project in Composer 6.5 and then re-import your sources.

    Hope that helps
    _Paul

  3. Hi Paul,

    I created custom DFS service from Documentum Composer 6.5. Service is deployed on JBoos. Everything works fine except that in some lines in my code I have some cyrilic characters (ш, ћ, ж, ч …) that I write to some html log file. Problem is that insted of writting this characters (ш, ћ, ж, ч …) I see characters Предмет 2Ä….. I put text file encoding to UTF-8 on my project workspace. Whole DFS code executes on JBoos.

    Any help please

  4. Hi Ivica,
    It is unclear where the problems lies at the moment. Composer (woudl appaear doubtful, DFS, java, environmental?).

    My recommendation is that you extract the log writing code (or a sample thereof) into a simple main java class and then try and run it on your *target* machine.

    If this fails then it points at an environmental problem on the target machine or a java problem (I recall some StringBuffer problems on Sun’s VM a while back but cant remember the details I’m afraid).

    If it works then we may need to look at DFS but, if this is the case, you should go through appropriate channels and raise your bug with EMC Tech Support.

    Many thanks

  5. Hi Ivica,
    Compile your code with ANT, and there you can add “encoding” property to the javac task. Eclipse is using file encoding to determine how to display and save a source file, it’s not passing this setting to it’s compiler.

  6. Hello Paul,
    I created simple HelloWorldService using Composer6.5 and i am getting following error. Any help..

    Buildfile: C:\workspace\DocumentumCoreProject\dfs6.5\dfs-build.xml
    [echo] dfs.sdk.home is C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5
    [echo] defaultclasspath is C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\FastInfoset.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\activation.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\http.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxb-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxb-impl.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxb-xjc.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxws-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxws-rt.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jaxws-tools.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jsr173_api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jsr181-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\jsr250-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\resolver.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\saaj-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\saaj-impl.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\sjsxp.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\stax-ex.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\jaxws\streambuffer.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\dfc\certjFIPS.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\dfc\dfc.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\dfc\dms-client-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\dfc\jsafeFIPS.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\All-MB.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\aspectjrt.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\log4j.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\server\ucf-server-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\server\ucf-server-impl.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\server\xml-ca.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\MacOSXForker.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\jacob.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\mac_utilities.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\ucf-ca-office-auto.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\ucf-client-api.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\ucf-client-impl.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\ucf-connection.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\ucf\client\ucf-installer.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\commons\commons-cli-1.0.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\commons\commons-codec-1.3.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\commons\commons-io-1.2.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\commons\commons-lang-2.1.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\javassist.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\servlet.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\tools.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\xmlsec.jar;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\lib\java\utils\xws-security.jar;C:\workspace\TestProject\Web Services\bin\gen-rsc;C:\workspace\DocumentumCoreProject\dfs6.5\emc-dfs-sdk-6.5\etc
    [echo] projectclasspath is emc-dfs-sdk-6.5/lib/java/emc-dfs-services.jar;emc-dfs-sdk-6.5/lib/java/emc-dfs-rt.jar;emc-dfs-sdk-6.5/lib/java/jaxws/activation.jar;emc-dfs-sdk-6.5/lib/java/jaxws/FastInfoset.jar;emc-dfs-sdk-6.5/lib/java/jaxws/http.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jaxb-api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jaxb-impl.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jaxb-xjc.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jaxws-api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jaxws-rt.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jsr173_api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jsr181-api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/jsr250-api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/resolver.jar;emc-dfs-sdk-6.5/lib/java/jaxws/saaj-api.jar;emc-dfs-sdk-6.5/lib/java/jaxws/saaj-impl.jar;emc-dfs-sdk-6.5/lib/java/jaxws/sjsxp.jar;emc-dfs-sdk-6.5/lib/java/jaxws/stax-ex.jar;emc-dfs-sdk-6.5/lib/java/jaxws/streambuffer.jar;emc-dfs-sdk-6.5/lib/java/dfc/dfc.jar;emc-dfs-sdk-6.5/lib/java/utils/aspectjrt.jar;emc-dfs-sdk-6.5/lib/java/dfc/certjFIPS.jar;emc-dfs-sdk-6.5/lib/java/dfc/dms-client-api.jar;emc-dfs-sdk-6.5/lib/java/dfc/jsafeFIPS.jar;emc-dfs-sdk-6.5/lib/java/dfc/xtrim-api.jar;emc-dfs-sdk-6.5/lib/java/dfc/xtrim-server.jar;emc-dfs-sdk-6.5/lib/java/bof/bpm_infra.jar;emc-dfs-sdk-6.5/lib/java/bof/workflow.jar;emc-dfs-sdk-6.5/lib/java/commons/commons-codec-1.3.jar;emc-dfs-sdk-6.5/lib/java/commons/commons-io-1.2.jar;emc-dfs-sdk-6.5/lib/java/commons/commons-lang-2.1.jar;emc-dfs-sdk-6.5/lib/java/ucf/client/ucf-installer.jar;emc-dfs-sdk-6.5/lib/java/ucf/server/ucf-server-api.jar;emc-dfs-sdk-6.5/lib/java/ucf/server/ucf-server-impl.jar;emc-dfs-sdk-6.5/lib/java/ucf/server/xml-ca.jar;emc-dfs-sdk-6.5/lib/java/utils/log4j.jar;emc-dfs-sdk-6.5/lib/java/utils/servlet.jar;
    [echo] default_project_libraries is C:\workspace\DocumentumCoreProject\dfs6.5
    [echo] project_libraries.path is C:\workspace\DocumentumCoreProject\dfs6.5
    [echo] default_project_resources is C:\workspace\DocumentumCoreProject\dfs6.5
    [echo] project_resources.path is C:\workspace\DocumentumCoreProject\dfs6.5
    generate:
    [generateModel] Creating ‘services-sample-service-model.xml’
    [generateArtifacts] Log4j not found. In order to avoid error messages during build process, please include log4j.jar into your classpath or copy it into $ANT_HOME/lib folder
    [generateArtifacts] Generating DFS artifacts
    [generateArtifacts] Generating JAXWS artifacts (wsgen & wsimport)
    [generateArtifacts] C:\workspace\TestProject\Web Services\src\com\service\example\HelloWorldService.java:5: illegal character: \64
    [generateArtifacts] @DfsPojoService(targetNamespace = “http://samples.services.com”)
    [generateArtifacts] ^
    [generateArtifacts] 1 error
    [generateArtifacts] || Task execution failed. Please add “-verbose” to your Ant command line for additional details
    [generateArtifacts] || Message: Failed generating a full set of DFS service artifacts for model file: “C:\workspace\TestProject\Web Services\bin\gen-src\services-sample-service-model.xml”
    [generateArtifacts] || Caused by: Failed generating a full set of DFS service artifacts for model file: “C:\workspace\TestProject\Web Services\bin\gen-src\services-sample-service-model.xml”
    [generateArtifacts] || Caused by: Compile failed; see the compiler error output for details.

    BUILD FAILED
    C:\workspace\DocumentumCoreProject\dfs6.5\dfs-build.xml:192: Failed generating a full set of DFS service artifacts for model file: “C:\workspace\TestProject\Web Services\bin\gen-src\services-sample-service-model.xml”

    Total time: 14 seconds

    Thanks

    • Hi Mohit,

      This is a generated classpath problem.

      I’ve seen something like this before when a user had created or imported his projects through a subst r: drive. Composer was therefore using r: rooted file paths but ant was still trying to use c: rooted file paths.

      Perhaps you have somehting similar.

      I have emailed you at your yahoo address with more detail. Le’s resolve over that channel and then I will follow up here with a post so others can benefit.

      Thanks
      _Paul

  7. Hi,

    It took me little while since I am new but your article left me hanging….

    Do you have the steps for setting up the test project also? I got the service deployed finally….But not sure how to test it…..

    Next you will need to create yourself another test project. But this time configure it with one of the two available Remote Client library options, depending on your content transfer requirements. Again, creating Junit test cases I find is the ……

  8. Thanks for the useful tutorial
    You have mentioned that when source code is copied into the “src” folder (assuming “Build Automatically” is turned on) the artifacts are generated automatically. In case the “Build Automatically” is not turned on, how do I start the DFS Builder so that it can create the artifacts and package the service.

    Thank you

    • You have to manually invoke the project’s builders. Make sure you have the project open and a resource within the project selected, as one naturally would be if you are actively working on it. Then choose Project->Build Project. Or Project->Build All if you want to build all projects in your worksapce.

  9. Also, when the project is build through Composer (using DFS builder) it does not package the dfc.properties into the ear. As a result when I call this service it gives me an authentication error.

    • To add the dfc.properties is pretty simple.

      You add a copy of dfc.properties to your project and place it under source control along with all your other engineering artifacts. Then when you export the service archive, you must select the dfc.properties file as a runtime resource. This will tell the dfs package builder to include it in the ear.

      HTH
      _Paul

  10. Hi Paul. Thank you for this great article.
    I am new to Development services. Can you please provide more description on how to deploy the ear to app server.

    Thank you.

    • Hi Lena,

      If you are using Composer to export a Service Archive then it is typical to set your app server up with a hot deploy directory. This is a directory that the app server polls and upon finding a new version of a ear (or war) redeploys it over the top of the enterprise app (or webapp).

      Of course there are other ways of doing it but with this approach you simply need to copy each new version of your ear to the app server’s hot deploy directory to have it re-deployed.

      Let me know if you need more details.

      HTH
      _Paul

  11. Hi Paul,

    I wanted to know if we can import an .ear file into Composer and how. Is there an alternate way.

    I wanted to setup webtop as a project in composer, or do I revert to using eclipse

    • Hi dctmuser,

      It is possible but it is a little funky at the moment (you’ll see what I mean).

      In this post I explained how to load the Composer plugins into Ganymede. Yes I know this is old. But it is unfortunately the version of eclipse that Composer is developed and tested on at the moment. (IMHO DCTM should stay current and in fact should also distribute Composer via an eclipse update site but that is another story…). Anyway if you follow these steps and install the composer plugins into the JEE version of eclipse you will also get WTP – the web tools project. This will allow you to import ear and war files which can act as a start point for setting up webtop development. I talked a bit about WTP in this post. Although not directly related – it may also help you.

      Let me know if you need more info and I will try and provide.
      Cheers
      _Paul

  12. Hi,

    I am unable to get the Finish button in the Export Service Archive screen. I have selected the export destination, services for export,runtime libraries,runtime resouces. But I do not find the checkbox.

  13. Hi,

    I tried the same. In the above article , if i need to write a consumer then , i need to choose option as “DFS Service Library” . If i write my DFSPOJO service , which option i should choose?

  14. Hi,

    I’ve recently started working on Documentum. I have created simple test application, It builds successfully and when i try to put that .ear file inside deploy folder of Jboss it gives me an error regarding HelloWorldService.class file is missing. I can see the same file inside bin folder.

    I can see BUILD SUCCEESSFUL message in Console but there are no generating artifacts message as well as there are no files inside \Web Service\bin\gen-src folder.
    –> I’m using Documentum Composer 6.6 and Java 1.6.
    –> I’ve also put endorsed folder inside lib folder of jre.
    –> I also tried using Java 1.5 but of no use.

    Is there anything else that I’m missing?

    Please let me know if you need more details on this.

    Thanks in advance.

    • Hi Amol,
      Without seeing the project and is contents it is a little hard to say what the problem is.

      I assume you HelloWorldService has the relevant DFS annotations? And you have created it in the correct web services source folder?

      • Thanks for replying.

        I have single class file inside “Web Services\src\com\service\example”

        package com.service.example;

        import com.emc.documentum.fs.rt.annotations.DfsPojoService;

        @DfsPojoService(targetNamespace = “http://example.service.com”, requiresAuthentication = true)
        public class HelloWorldService {
        public String sayHello(String name) {
        return “Hello ” + name;
        }
        }

        Now I’m getting following exception:
        Creating ‘context-root-module-name-service-model.xml’
        [generateModel] || Task execution failed. Please add “-verbose” to your Ant command line for additional details
        [generateModel] || Message: Generation of model file failed.
        [generateModel] || Caused by: Generation of model file failed.
        [generateModel] || Caused by: Failed to generate model file due to an APT execution error. “{0}”
        [generateModel] || Caused by: APT has returned the following errors:
        [generateModel] Problem encountered during annotation processing;
        [generateModel] see stacktrace below for more information.
        [generateModel] java.lang.NoSuchMethodError: javax.xml.bind.JAXBContext.newInstance([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
        [generateModel] at com.emc.documentum.fs.tools.impl.artifact.dfs.XmlGeneratorFactory$DsfProcessor.writePackages(XmlGeneratorFactory.java:158)
        [generateModel] at com.emc.documentum.fs.tools.impl.artifact.dfs.XmlGeneratorFactory$DsfProcessor.process(XmlGeneratorFactory.java:95)
        [generateModel] at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        [generateModel] at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
        [generateModel] at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
        [generateModel] at com.sun.tools.apt.main.Main.compile(Main.java:1102)
        [generateModel] at com.sun.tools.apt.main.Main.compile(Main.java:964)
        [generateModel] at com.sun.tools.apt.Main.processing(Main.java:95)
        [generateModel] at com.sun.tools.apt.Main.process(Main.java:85)
        [generateModel] at com.sun.tools.apt.Main.process(Main.java:67)
        [generateModel] at com.emc.documentum.fs.tools.impl.artifact.dfs.ServiceModelGenerator.runAPT(ServiceModelGenerator.java:157)
        [generateModel] at com.emc.documentum.fs.tools.impl.artifact.dfs.ServiceModelGenerator.generate(ServiceModelGenerator.java:122)
        [generateModel] at com.emc.documentum.fs.tools.impl.DependencyGenerateModelTask.execute(DependencyGenerateModelTask.java:65)
        [generateModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        [generateModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        [generateModel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        [generateModel] at java.lang.reflect.Method.invoke(Unknown Source)
        [generateModel] at com.emc.documentum.fs.tools.GenerateModelTask.executeTask(GenerateModelTask.java:89)
        [generateModel] at com.emc.documentum.fs.tools.impl.ChainedExceptionReportingTask.execute(ChainedExceptionReportingTask.java:17)
        [generateModel] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        [generateModel] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        [generateModel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        [generateModel] at java.lang.reflect.Method.invoke(Unknown Source)
        [generateModel] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        [generateModel] at org.apache.tools.ant.Task.perform(Task.java:348)
        [generateModel] at org.apache.tools.ant.Target.execute(Target.java:357)
        [generateModel] at org.apache.tools.ant.Target.performTasks(Target.java:385)
        [generateModel] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        [generateModel] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        [generateModel] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        [generateModel] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
        [generateModel] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        [generateModel] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
        [generateModel] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Leave a reply to Deepak Cancel reply