2012-02-20 14 views
0

JBossで簡単なサービスをテストするのに問題があります。JBossにデプロイされたRESTfulサービスが応答しない

私はプロジェクトを構築し、JBossに配備しました。

<?xml version="1.0"?> 

<web-app> 
    <servlet-mapping> 
     <servlet-name>com.mxyy.orderservice.deploy.Deployer</servlet-name> 
     <url-pattern>/orderservice/*</url-pattern> 
    </servlet-mapping> 
</web-app> 

これは私のRESTfulなサービス・インターフェースをScalaで書かれている:

@Provider 
@Path("/customers") 
trait ICustomerService { 
    @POST 
    @Consumes(Array("application/xml")) 
    def createCustomer(is: InputStream): Response 

    @GET 
    @Path("{id}") 
    @Produces(Array("application/xml")) 
    def getCustomer(@PathParam("id") id: Int): StreamingOutput 

    @PUT 
    @Path("{id}") 
    @Consumes(Array("application/xml")) 
    def updateCustomer(@PathParam("id") id: Int, is: InputStream): Unit 
} 

このインタフェースが実装されている。これは私のweb.xmlのある

import javax.ws.rs.core.Application; 

public class Deployer extends Application { 

} 

:これは私のDeployerのは、Javaを使って書かれています。

私は、JBossに展開した後、私は次のように入力してサービスにアクセスしようとしました:

http://localhost:8080/orderservice/customers/1 

HTTP Status 404 - /orderservice/customers/1  

type Status report  
message /orderservice/customers/1  
description The requested resource (/orderservice/customers/1) is not available. 

と、ブラウザの応答は、誰かが私が間違って何をしたかを指摘することはできますか?

多くのありがとうございます。

答えて

0

「/」という小さな間違いを除いて、すべてが問題ないと思います。それが動作するかどうかをお知らせ

@Provider 
@Path("/customers") 
trait ICustomerService { 
@POST 
@Consumes(Array("application/xml")) 
def createCustomer(is: InputStream): Response 

@GET 
@Path("/{id}") 
@Produces(Array("application/xml")) 
def getCustomer(@PathParam("id") id: Int): StreamingOutput 

@PUT 
@Path("/{id}") 
@Consumes(Array("application/xml")) 
def updateCustomer(@PathParam("id") id: Int, is: InputStream): Unit 
} 

: は、同じように編集します。 :)

+0

こんにちは。お返事をありがとうございます。残念ながら、これは問題を解決しません:( – Kevin

関連する問題