Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Troubles with REST extensions on Jetty

I am trying to develop a REST extension following the article: 
https://jazz.net/library/LearnItem.jsp?href=content/docs/web-ui-programming/web-ui-todo-rest.html

But I got some troubles for deploying the examples on the Jetty Server:

java.lang.IllegalArgumentException: The com.example.jazz.todo.common bundle's plugin.xml file contains a <service> element that has a missing 'uri' attribute value.
	
at com.ibm.team.repository.common.transport.AbstractElementDescriptor.checkAttributeIsSet(AbstractElementDescriptor.java:196)
at com.ibm.team.repository.common.transport.AbstractElementDescriptor.checkAttributeIsSet(AbstractElementDescriptor.java:166)

What uri should be used?

Other messages:
[ERROR] 2015-03-25 11:11:17.550 - FrameworkManager: An error event has occurred involving the bundle "org.eclipse.emf.edit_2.5.0.v200906151043 [54]".
	
org.osgi.framework.BundleException: The bundle "org.eclipse.emf.edit_2.5.0.v200906151043 [54]" could not be resolved. Reason: Another singleton version selected: org.eclipse.emf.edit_2.6.0.v20100914-1218
	
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)

0 votes



One answer

Permanent link
Hello... the referenced article is from 2007 and the plug-in API has changed.  If you have access to the jazz wiki, an article that shows how to create a REST service is here: https://jazz.net/wiki/bin/view/Main/JAFTutorialStepREST

This describes a REST service called as:

The plug-in format to create the service is...
 
 <plugin> 
   <extension point="com.ibm.team.repository.common.components">
        <component id="com.ibm.team.jaf.sdk.samples.hellojaf" name="Hello JAF">
            <service kind="MODELLED_REST" name="Hello JAF Rest Service"
                uri="com.ibm.team.jaf.sdk.samples.hellojaf.IHelloService"
                version="1"/>
        </component>
    </extension>
    
    <extension point="com.ibm.team.repository.service.serviceProvider">
        <serviceProvider componentId="com.ibm.team.jaf.sdk.samples.hellojaf" 
            implementationClass="com.ibm.team.jaf.sdk.samples.hellojaf.HelloService">
            <provides>
                <providedService interface="com.ibm.team.jaf.sdk.samples.hellojaf.IHelloService" />
            </provides>
        </serviceProvider>
    </extension>
    <extension point="com.ibm.team.jfs.app.appMode">
        <appMode
            delegatingAuthentication="true"
            transitioningToJAF="false">
        </appMode>
    </extension>
    <extension point="com.ibm.team.jazz.foundation.server.products">
        <product
            id="com.ibm.team.jaf.sdk.samples.hellojaf"
            name="Hello JAF"
            requiredJtsVersions="[4.0.0,6.1.0)"
            type="APPLICATION"
            version="4.0.0.0">
        </product>
    </extension>
</plugin>
The appmode and products extensions are not needed but I kept them here to keep the sample file complete.

The java file is: 
package com.ibm.team.jaf.sdk.samples.hellojaf;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ibm.team.jfs.app.http.util.HttpConstants;
import com.ibm.team.repository.service.TeamRawService;

public class HelloService extends TeamRawService implements IHelloService {
    @Override
    public void perform_GET(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setCharacterEncoding(HttpConstants.DEFAULT_ENCODING);
        response.setContentType(HttpConstants.CT_TEXT_PLAIN);
        PrintWriter writer = response.getWriter();
        writer.write("Hello world");
    }
}

Lawrence Smith [IBM]

1 vote

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Mar 25 '15, 6:22 a.m.

Question was seen: 3,166 times

Last updated: Mar 25 '15, 8:32 a.m.

Confirmation Cancel Confirm