powered by Jive Software

Problem with REST webservice

Hey guys!

I’m trying to implementing a plugin using RESTEasy but i can’t access my webservice url. I can deploy my plugin without an error.

Here is what i did:

web-custom.xml

<web-app>     <context-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>testapp.openfire.TestApplication</param-value>
    </context-param>     <listener>
        <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
    </listener>     <servlet>
        <servlet-name>Resteasy</servlet-name>
        <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
    </servlet>     <servlet-mapping>
        <servlet-name>Resteasy</servlet-name>
        <url-pattern>/plus/*</url-pattern>
    </servlet-mapping>
</web-app>

And the class that represents my web service:

@Path("/user")
public class UserResource {     @GET
    @Path("/teste")
    @Produces({MediaType.TEXT_PLAIN})
    public String teste(){
        System.out.println("HERE WE ARE");
        return "test";
    } }

The class that implements Plugin

public class TestPlugin implements Plugin {        @Override    public void initializePlugin(PluginManager manager, File pluginDirectory) {
        System.out.println("START");
    }     @Override
    public void destroyPlugin() {
        System.out.println("DESTROY");
    }
}

What’s wrong?

Can i use REST webservices or i need to use Servlets to interact with clients?

Thanks in advance.

David