RESTful service with EJB 3.1 endpoint cannot be found (404)

Hi,
I have a Resource configured as a EJB 3.1 Stateless Bean. I also have an overridden Application class to customize the context root. However, the client just cannot seem to find the Resource. What am I doing wrong? The Resource is packaged and deployed as a war.
Cross posted: http://www.coderanch.com/t/546565/java-Web-Services-SCDJWS/certification/RESTful-service-EJB-endpoint-cannot#2480046
Tests in error:
  testSendRequestAndGetGreeting(name.app.abhi.helloworld.ejb.restful.client.HelloWorldEjbRestfulClientTest): GET http://localhost:9090/practice/helloworld?name=Duke returned a response status of 404 Not Found
Resource:
@Path("helloworld")
@Stateless
public class HelloWorldBean {
    @GET
    @Produces("text/plain")
    public String getQuintessentialGreeting(@QueryParam("name") String name) {
     if (name == null) {
         throw new WebApplicationException(Response.Status.BAD_REQUEST);
     return "Say hello to the world, " + name;
Application class:
@ApplicationPath("practice")
public class ApplicationConfig extends Application {
    @Override
    public Set<Class<?>> getClasses() {
     Set<Class<?>> clazzez = super.getClasses();
     if (clazzez == null) {
         clazzez = new HashSet<Class<?>>();
     clazzez.add(name.app.abhi.helloworld.ejb.restful.service.HelloWorldBean.class);
     return clazzez;
Client:
public class HelloWorldEjbRestfulClient {
    private final static String ENDPOINT_URI = "http://localhost:9090/"
         + "practice/helloworld";
    public String sendRequestAndGetGreeting(String name) {
     Client client = Client.create();
     WebResource webResource = client.resource(ENDPOINT_URI);
     webResource.accept(MediaType.TEXT_PLAIN);
     return webResource.queryParam("name", name).get(java.lang.String.class);
}Edited by: asarkar on Jul 24, 2011 12:20 PM

I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
Edited by: asarkar on Jul 24, 2011 2:45 PM

Similar Messages

  • HT201343 My MBP is Early 2011 but dunno why cant use mirroring with apple TV, the icon cannot be found

    My MBP is Early 2011 but dunno why cant use mirroring with apple TV, the icon cannot be found. So cannot use mirroring.
    I have follow trouble shooting , they recommend to go system preference -> display , thus can find out the mirroring icon if no mean it doesnt support. But according to the web, Early 2011 MBP should be able to use, dunno why.

    Just realise I havent updated my OS to mountain lion and this is the reason why I cannot use mirroring before ^^
    Thanks all

  • HT1414 I have iphone 4; tried to sync it said I need to update software so I clicked ok - it then said I need to restore and did above got to stage 3, clicked restore and update, but it comes up with an error saying iphone cannot be found Please help!!!

    I have iphone 4; tried to sync it said I need to update software so I clicked ok - it then said I need to restore and did above got to stage 3, clicked restore and update, but it comes up with an error saying iphone cannot be found Please help!!!

    Dear Jody..jone5
    Good for you that can't update your iphone because I did it and my iphone dosen't work for example I can't download any app like Wecaht or Twitter..
    Goodluck
    Atousa

  • The page cannot be found 404 Error. Any 1 know how to fix this error?

    I try to open this site.It does try to open but when the page is almost done. it kicks up . The page cannot be found 404 Error
    == URL of affected sites ==
    http://http://profile.myspace.com/Modules/Applications/Pages/Canvas.aspx?appId=104283&friendId=469022772&appParams=null

    Look closely at the URL you posted. The protocol designator (http://) is repeated TWICE.
    Change http://http:// to http:// and it will work fine.

  • Exposing REST service as EJB 3.1 method

    How to convert Restful WebService (RestEasy) to EJB 3.1 Stateless session bean
    In my current project we are using Restful Web Services (Resteasy) combined with Jpos and Jcard with an ISO-8583 message format. The task is to remove all the dependencies of resteasy,jpos and jcard and implement it through EJB 3.1 stateless beans for the current functionality.
    I have seached / googled all over the net with regard to how to proceed but unluckily no success till yet.
    Would be grateful if any one can provide any pointers / suggestions / demo code for the same.
    Please Note - Its a already developed module in Restful + jpos + jcard .. is it possible to convert restful webservice to ejb 3.1 stateless beans ..using jboss server..

    I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
    The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
    Edited by: asarkar on Jul 24, 2011 2:45 PM

  • Testing of Restful Service with ECATT

    HI,
    has anyone experience with testing Restful services via ECATT?
    I didn't find any documentation about this.
    BR,
    Oliver

    I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
    The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
    Edited by: asarkar on Jul 24, 2011 2:45 PM

  • How to call rest service with POST Http method in SMP2.3 HWC?

    Hi Experts,
       I am doing a sample for Rest Service in smp.
    http://192.168.1.119:8086/Test/services/Products
    I am calling the above service in the smp it is pulling the data from the service with GET Http Method.
    Now i want to call this service for login functionality.
    http://192.168.1.119:8086/Test/services/auth?uname=:uname&pass=:pass
    here :uname &:pass values are argument values for the uname & pass.
    the output of the service is
    http://192.168.1.119:8086/Test/services/auth?uname=sravanya.k&pass=sravanya
    <?xml version="1.0" encoding="UTF-8"?>
    <details>
    <responsecode>200</responsecode>
    <profile>
    <firstname>sravanya</firstname>
    <lastname>k</lastname>
    <email>[email protected]</email>
    <chart_type>North</chart_type>
    <location>MACHILIPATNAM</location>
    <language>English</language>
    </profile>
    </details>
    How can i do this?
    Thanks & Regards,
    Sravanya K

    Create a uriTemplate like this
    /auth?uname={uname}&pass={pass}
    use GET method only.
    generate the personalization keys.

  • RESTful services with UCM

    We currently integrate our external web apps with UCM using .NET WCF services to call UCM SOAP services. We would like to change to using RESTful services to integrate with UCM. Is this possible? Can you please point me to any examples/documentation to do this? We are currently on UCM 10gr3 but will be upgrading to web center content 11g. Is this something that is supported in either versions?

    Hi ,
    Actually WC Content does not support CMIS in a stand-alone mode as it support Java / Soap etc . The only way to include / use Rest / CMIS services are through WC Portal . But , there too the limitation is that the operations can be done in Read Only mode only .
    So , I am not sure if going ahead with CMIS / REST based solution is the best approach .
    The only references to  cmis class files are under <WC Portal Home>/webcenter/modules/oracle.webcenter.content.integration11.1.1.0/
    Thanks,
    Srinath

  • RESTful service with POST, GET, PUT and DELETE

    I'm implementing a RESTful service, but mod_plsql only gives me GET, POST and HEAD commands.
    However, if I try to use the PUT command, the response is:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>501 Method Not Implemented</TITLE>
    </HEAD><BODY>
    <H1>Method Not Implemented</H1>
    PUT to *** not supported.<P>
    mod_plsql: request method not supported<P>
    <HR>
    <ADDRESS>Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server Server at *** Port 80</ADDRESS>
    </BODY></HTML>Is it possible to add support for PUT and DELETE in mod_plsql?
    I've search all packages and code, but I haven't found anything that specifies the valid HTTP commands or the source for generating the above error message.

    AIR supports all the specified HTTP methods, but there seems to be a bug in the HTTPService class. Instead you should use URLLoader and URLRequest. If you change to that you won't even need to use the Method Override header.
    Read more here : http://spy6.blogspot.com/2009/06/adobe-air-put-delete-head-http-methods.html .

  • Ipod won't sync with itunes says required disk cannot be found any help plz

    Hi, my ipod basically froze stopped working and then eventually it allowed & recommended me to restore it which i did & lost all the music on there in the process, but when i go to resync it with my itunes it says that it cant be synced as the required disk cannot be found but both my computer and itunes seem to recognise the ipod as it comes up in both, any help would be greatly appreciated.
    Cheers
    Joe

    Any help here?
    http://discussions.apple.com/thread.jspa?messageID=6476702

  • Problem with my itunes - programme path cannot be found - can't uninstall

    Hi I was wondering if anyone can help me...
    I've got a problem with my itunes and I'm at a loss as to what to do!
    I recently went to open itunes and as I did a message came up to say that itunes has not been properly installed and that if I want to burn cds etc, itunes needs to be properly installed. Firstly I don't understand why this message has come up as I have barely been on itunes over the past few weeks, in fact I've barely been on my laptop full stop. Secondly, when I have gone into control panel and then gone to repair itunes it says that itunes64msi path cannot be found, itunes is supposedly stored under my user and under 'app data' which is nowhere to be seen on my computer at all. I then tried to uninstall the programme completely and the same message came up. I then downloaded the newest version of itunes on the apple website but that couldn't be properly installed as there is already itunes on my system. I've also tried to remove the programme whilst in safe mode but haven't had any success.
    SO confused as to what's gone on, don't understand how itunes is still a programme on my computer but appears to be wiped from my computer at the same time.
    I'm running on a windows 7 64 bit operating system and if anyone could help me I'd be so so grateful!!

    Hi PoppyClaire,
    If you are having issues uninstalling and reinstalling iTunes on your Windows machine, you may find the following article useful:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Cheers,
    - Brenden

  • Error while publishing a service with WSPUBLISH: Error publishing Endpoint

    Hallo,
    I've a problem while publishing a service which a had created via proxy. I configured the service and one endpoint (binding) in SOAMANAGER. When I publish the service in WSPUBLISH I get the error:
    'Error publishing Endpoint for SD : <Proxy>, Service : <Service>, EP : <Endpoint>.
    with details:
    '10160A save request exceeded the quantity limits for a given structure type .#Number of BusinessEntities exceeds your limit of 1 (2)'
    In the Service Registry I can find the service but without endpoints.
    Does anybody know what happend ?
    We use a SAP NetWeaver 7.10 with SP05 (SAPKB71005) but the same error happens if I publish a service from a CRM 5.0 with SP15 (SAPKB70015) to the Service Registry of the 7.10
    Christoph

    This is my steps to publish ES to SR:
    1. Create RFC destination in SM59
    2. Create ES Parameter in WSPARAM
    3. Create logical port for SR in LPCONFIG
    4. Release Web Service for SOA Runtime in WSCONFIG
    5. Publish ES in WSPUBLISH.
    When i was using SOAMANAGER to manually create the endpoint, the endpoint in the SR doesnt works though.
    eg,  Business Administration -> WS Administration -> Search for CRM_BPBASICDATABYIDQR -> Apply selection -> Configuration -> Create Service -> enter new service name and new binding name -> user id/password  for HTTP Authentication -> save.
    It works after i released it in WSCONFIG (ya, i know it's old way) and re-publish.
    -julius

  • Error creating business service with EJB transport on Unix

    I have ALSB 3.0 installed on a Unix system and I am unable to create a business service based on the EJB transport. After I associate the client jar to the business service, ALSB recognizes the home and remote interfaces in the jar file but as soon as I click the Next button I see the following error:
    An expected exception occurred during the creation or update of this service: null
    If I install ALSB 3.0 on Windows then I am able to create the identical EJB based business service that fails on Unix.
    Has anyone been able to create an EJB based business service on Unix or is this a known issue with ALSB 3.0?
    Thanks for any help!

    Hi irgendwo,
    user profile server must be required when you need the to enable the People Search feature. and this pre-request.
    you can confg search  but you can used because there are many service which are depeded to each other
    check the link for depended services
    http://technet.microsoft.com/en-us/library/ee662538%28v=office.15%29.aspx
    Please verify all the depended service as well which is required in serach service...
    see the below link from MSDN about serch service application ..
    http://blog.ciaops.com/2012/12/search-service-on-foundation-2013.html
    http://blog.ciaops.com/2012/12/search-service-on-foundation-2013.html
    Please mark the Answe and vote me if it will you while search configuration

  • Web Services with EJB ( Urgent )

    Hi,
    Can any help me??
    I have a Web Services that uses a Java Control ( EJB ) and my EJB Control call Hibernate......
    My problem is caused
    "The transaction is no longer active - status:'Committed'. No further JDBC access is allowed within this transaction".
    What do I do ??
    Thanks....

    Maybe you set the transaction attribute to some too restrictive 'RequiresNew' for the EJB method you are invoking. Try to change it to 'Supports' and leave transaction management to Hibernate if there is no reason for that.

  • TS1398 "No Service" with a brand new phone cannot be fixed

    I have just received a replacment iPhone 5c in the mail, which says "No Service" in the upper left corner, yet I have a check mark next to a network I have seemingly connected with.  I have tried resetting my connections and the network, but nothing seems to help, why?

    We don't know why... We are users. You are not speaking to Apple. Send it back.

Maybe you are looking for

  • Nautilus have problem with opening paths other than /home

    Hi, I have strange problem with nautilus. When I want to open some path ie. /media/*some mounted device* or /tmp usign gnome-menu "Places" I see hourglass cursor for a while and then nothing happens. Only home would open with "Places" however typing

  • Required jar files in using jboss Schedular

    if i have to use org.jboss.varia.schedular.Schedulable what are the jar files that need to be added in my class path thank you

  • Sql 2008 express not listening on port 1433

    I installed sql 2008 express on 2008R2 but it is not listening on port 1433. I check configuration for tcp and enabled that already. also started sql browser service. any idea?

  • Link files and directories in e-mails

    This has probably been asked before, but I cannot seem to find an answer out there... We are a small company that keep all our project files on a shared server. Now I would like to be able to send an e-mail to someone within our company including a l

  • How to add my magazine to newsstand?

    Hello, I am working with this Fashion magazine, and I would like to know how can I add this magazine to Newsstand? We had co-operation with some company who published our last magazine, but we would like to publish the next one by our selves. We'd li