Returning proxy to the client

i tried this one below to send a proxy to the client but i am getting an error
import java.rmi.*;
import java.rmi.registry.*;
import java.lang.reflect.*;
import java.rmi.server.*;
public class Client extends UnicastRemoteObject implements InvocationHandler,x
public Client() throws RemoteException{}
public Object search() throws RemoteException
System.out.println("in the invocation handler");
ClassLoader cl = IVehicle.class.getClassLoader();
return Proxy.newProxyInstance(cl,new Class[] {IVehicle.class},new Client());
public Object invoke(Object proxy, Method m, Object[] args)
throws Exception
System.out.println("in the invocation handler");
IVehicle o=(IVehicle)Naming.lookup("rmi://localhost:/car");
o.start();
return o;
error is:
java.lang.ClassCastException: cannot assign instance of VehicleHandler_Stub to f
ield java.lang.reflect.Proxy.h of type java.lang.reflect.InvocationHandler in in
stance of $Proxy0
can anyone please help me

Pointless new thread continuing [this thread|http://forums.sun.com/thread.jspa?threadID=5426238&tstart=0]. Please don't start new threads for the same topic. Locking this one.

Similar Messages

  • Getting my server to return data to the client

    I am writing a client/server program..
    buttons on the client side make the server side do the work, but how do i get the server to return the work back to the client??
    it is a basic beginners program pressing buttons on the client to say cap a word on the server side... have the buttons working but dont know how to returned the capped word back to the client. the code is really long and there are two programs, but i can put them up if necessary.
    tks

    what technology are you useing for the client and server? client: swing, jsp, applet, applicaiton? server: servlet, http, rmi...? Kind of need to know what you're doing before we can help.

  • Proxy Scenario (abap client)- XI, ICM_CONNECTION_FAILED

    Hi Forum,
    I have a problem with a Proxy Scenario (ABAP client proxy),
    My scenario is R/3 (abap client proxy)--->XI   ,
    the client proxy while sending message to XI throws an error, which is seen in SXMB_MONI as:
    404 Resource not found
    Partner not reached
    Error: -20
    Version: 6040
    Component: ICM
    Date/Time: Fri Jan 25 09:20:54 2008 
    Module: icxxconn_mt.c
    Line: 2124
    Server: xxxap5_RP1_05
    Detail: Connection request from (143/22024/0) to host: xxXP1.xxx.com, service: 8000 failed (NIEHOST_UNKNOWN) AP-T143, U22024, 500 xxUSER, , 09:20:54, M0, W0, , 1/0
    I can see a stuck entry (LUW), for this in SMQ2, even on several re-execution of that LUW in SMQ2, it gives an error:
    SYSFAIL
    XI Error Client_Receive_Filaed

    Hi
    404 Resource not found
    There might be the problem with the server having not to find anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    *Possible Tips:- *
    • 404 is an HTTP response code that indicates that the resource in question couldn't be found. Usually this is due to an incorrect URL, so it is better to cross check all URLs. Check pipeline URL in the SLD in the business system of the Integration Server For this go to SLD->Business System-><yourIntegrtaion Server>->Pipeline URL: It should be like this http://<host>:<port>/sap/xi/engine?type=entry Where host is the host name of the Integration Server and port is the HTTP(8xxx) port. To verify this in Integration Server you can do like this. Go to SXMB_ADM->Integration Engine Configuration->Choose Edit from Menu -> Change Global Configuration Data to switch to change mode. Then select System Landscape - Load Configuration. (This is not required always)
    • Check that the port really is the ICM HTTP Port and not the J2EE port i.e SMICM then menu GOTO --> SERVICES and check the port number for HTTP. It should be HTTP port
    • If the error is Page cannot be displayed, cannot find server in https configurations Check and correct the SSL configuration for the ABAP and the J2EE side of the system
    • If the error is because of integration server when using Proxy communications then check these. i.e SXMB_ADM->Integration Engine Configuration->Corresponding Integration Server enrty should be dest://<Http Integration server-Destination> Where < Http Integration server -Destination > is the RFC destination (SM59) of type HTTP connection (type H) to the Integration Server. In this case, host name, port, and path prefix are saved in the RFC destination
    Refer below link
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Thanks
    Swarup

  • Fetching a partial range of selected result rows from the client side

    It has been a while since I started trying to solve this Oracle puzzle.
    Basically, what I need it is a way to fetch from the client side a run-time
    defined range of result rows of a arbitrary SELECT query.
    In low-end databases like MySQL I can do it simply by appending the LIMIT
    argument to the end of the SELECT query statment passing the number of
    the first row that I want to be returned from the server from the total
    result rows available in the result set and the maximum number of rows
    that it may return if available.
    In higher end databases I am supposed to use server side cursors to skip
    any initial rows before the first that I want to retrieve and fetch only
    the rows I want up to the given limit.
    I am able to achieve this with PostgreSQL and Microsoft SQL server, but I
    am having a hard time with Oracle. The main problem is how do I fetch
    result rows from a server side cursor and have their data returned to a
    client side in a result set like in a straight SELECT query?
    I was able to create a cursor and fecth a row into a server side record
    variable with the following PL/SQL code.
    DECLARE
    CURSOR c IS SELECT * FROM my_table;
    my_row c%ROWTYPE;
    BEGIN
    OPEN c;
    FETCH c INTO my_row;
    CLOSE c;
    END;
    I want to do this from PHP, so I don't have client side ESQL variables to
    store the result set data structure. Anyway, if I can do it just with
    SQLPlus I should be able to do it in PHP.
    If I do straight SELECT I can get the result set, but in a PL/SQL script
    like the one above I don't seem to be able to select the data in the
    fetched row record to have returned to the client. Does a straight SELECT
    query sends the result rows to a default client side variable?
    If anybody can help, I would appreciate if you could mail me at
    [email protected] because I am not able to access this forum all the time in
    the Web. BTW, is it possible to access this forum by e-mail?
    Thanks in advance,
    Manuel Lemos
    null

    Hello Jason,
    On 03-Feb-00 05:34:14, you wrote:
    I'm not sure I totally understand your problem, but I think you might be able
    to solve it by using the ROWNUM variable. ROWNUM returns the sequenc number
    in which a row was returned when first selected from a table. The first row
    has ROWNUM = 1, the second has ROWNUM = 2, etc. Just remember that the
    ROWNUM is assigned as soon as it's selected, even before an order by. So if
    you have an order by clause, it'll mess it up. Here's an example. I hope
    that helps.I though of that before but it doesn't help because if you use ORDER BY the
    first result row might not have ROWNUM=1 and so on. Another issue is that
    I want to be able to skip a given number of result rows before returning
    anything to the client.
    The only way I see to do it is to get the rows with server side cursor.
    But how do I return them to the client? Where does a normal select returns
    the rows? Isn't there a way to specify that the fetch or something else
    return the rows there?
    Regards,
    Manuel Lemos
    Web Programming Components using PHP Classes.
    Look at: http://phpclasses.UpperDesign.com/?user=[email protected]
    E-mail: [email protected]
    URL: http://www.mlemos.e-na.net/
    PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
    null

  • How does ABAP client proxy determine the sender business system

    When we use ABAP client proxy to send a message in XI-SOAP format to the integration engine, how does the client proxy determine what is the sender business system, i.e. how does it know what value it should insert in the sender service field in the SOAP envelop.
    For example, at first, the business system X8A_105 corresponds to the technical system X8A_105, so when the client proxy sends out a message, the sender service is X8A_105. Then I delete the business system X8A_105 in the SLD, and create a new business system that is associated with the technical system X8A_105.when the client proxy sends out a message, the sender_service is still X8A_105, why?

    Hi Annie,
    Execute the following function module in your business system and see what name it returns..
    LCR_GET_OWN_BUSINESS_SYSTEM.
    You can always debug the code inside the above FM to find out how it gets the business system name...
    I think the issue should be related to cache. I would also suggest you to logoff from your business system and then login again.
    Regards,
    Sumit
    Message was edited by:
            Sumit Khetawat

  • How to retrieve the client IP address when Apache acts as a proxy for Tomca

    Hello,
    I am trying to retrieve the client IP address accessing the web
    services. Because Apache is our proxy for all requests, when I try to
    retrieve the client IP I always get the localhost IP: 127.0.0.1
    The following code returns the localhost IP:
    MessageContext msgContext = MessageContext.getCurrentContext();
    if(msgContext != null) {
    return msgContext.getProperty(Constants.MC_REMOTE_ADDR).toString();
    return "Unknown";
    From a servlet, obtaining the client IP address can be achieved using
    this code.
    String ipAddress = request.getHeader("x-forwarded-for");
    if (ipAddress == null) {
    ipAddress = request.getHeader("X_FORWARDED_FOR");
    if (ipAddress == null){
    ipAddress = request.getRemoteAddr();
    return IPaddress ;
    Any help is greatly appreciated.
    Thank you very much

    @ejp....
    thanks buddy....
    u made my world a better place to live.....

  • Sending exceptions back to the client : in return object or in a SOAPFault?

    Hi.
    A question for all the JAX-RPC/SOAP experts out there.
    What is your recommendation for the cleanest way to handle exceptions in a Java web service and send the info back to the client ?
    I am considering two options :
    1- Put the exception info in fields of the object returned by the web service method.
    2- Throw a SOAPFaultException and add any necessary info in the Detail attribute of the Exception using a SAAJ SOAPFactory. In this case, how does the client retrieve the SOAPFaultException attributes ?
    What is the best option ? Pros and cons ?
    Thanks in advance.
    Fabien

    It throws jvm bind error. Please show the full exception stack trace and the block of code it occurs in. The server shouldn't be trying to do a bind at this point.

  • Change in the namespace of the Client proxy?

    Hi All,
       I want to know if there is way to change the name space in an existing client proxy. The problem is the provider system is not fully set up yet. So the provider keeps changing the URL to the web services. What is the best way to handle such a situation ?
    Do I need to re-create the proxy each time the namespace is changed or just the regeneration of the proxy is enough? In either case I believe WSDL file should be updated. Please guide me...
    Regards,
    Vamsi
    Edited by: varaprasad bhagavatula on Apr 20, 2010 7:03 PM

    changing URL of endpoint(webservice) won't affect your proxy but changing namespace will affect (there is difference between namespace and endpoint url),
    1. If URL is changing then there is no need to create proxy again but change configuration part in SOAMANAGER.
    2. If namespace is changed then you need to create proxy again.
    Regards,
    Gourav

  • EWS - Office 365 - "One or more subscriptions in the request reside on another Client Access server. GetStreamingEvents won't proxy in the event of a batch request."

    Hello
    My goal is to subscribe for streaming notifications for multiple users in the same time.
    One way to do that is to create multiple  StreamingSubscriptionConnections each one should contain one  StreamingSubscription for each user. The problem with this method is that in Office 365 the maximum
    number of connections opened is 20.
    Another method to solve this problem is by creating one StreamingSubscriptionConnection and then all StreamingSubscriptions for each user to the connection. This method solves the maximum number of connections
    problem and it works fine with exchange onPrimises. But when trying it with Office 365 it will result with the SubscriptionError:
    "One or more subscriptions in the request reside on another Client Access server. GetStreamingEvents won't proxy in the event of a batch request."
    Can anyone help me here ? 

    With Office365 you need to Group your subscriptions and set the Affinityheaders see
    http://msdn.microsoft.com/en-us/library/office/dn458789(v=exchg.150).aspx and
    http://blogs.msdn.com/b/mstehle/archive/2013/07/17/more-affinity-considerations-for-exchange-online-and-exchange-2013.aspx . Take note of the restrictions on the Group and other throttling restrictions if your using only one service account.
    Cheers
    Glen

  • I'm using firefox version 4 in my network and i want the clients can't change my network proxy that we are using i did it in previous version but it doesn't work in version 4, so how can i do it?

    I've network in my company and installing internal web proxy that allow clients to connect to the internet (ISA 2004). i'm using the Firefox as default browser in my network. so what i need that no one in my network clients can't change the proxy settings or it just be dimmed. i did it in the previous version but when i try the steps in version 4 it doesn't work so I'm asking for solution for that.
    many thanks for help,
    Ahmed Khairy

    Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
    For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • What should we do to return a ResultSet to the client HTML through JSP?

    Hi friends,
    Greetings.
    How do we pass the query Results from one function to another function?
    Actually i have a database in the server and i am the client.
    Client sends the id to the server as an argument. From HTML file this goes to the JSP file(which i am using as a link between HTML and EJB) and then this goes to the RemoteInterface and then to the Bean itself. The functions are written in the bean. Bean connects to the database using jdbc:odbc driver and then a query is written and executed as follows:
    In the Stateless Session Bean, there is one function with the following query.
    public ResultSet check(String id)
    //other code
    ResultSet rs = Statement.("select * from table1 where id=123");
    if(!rs.next)
      // print no such id exists. other ids are
      rs=Statement.("select * from table1");
    return rs;
    }I have written it approximately only because the problem is not with the query :(
    Now, in rs there's a resultset. Now how do i display it in a tabular format in HTML? This should obviously be done using JSP. How can we do it?
    In JSP file if i write
    ResultSet rs1=Remote.check(12);
    i get NullPointerException
    Thank you in anticipation to your reply!
    Regards

    Crossposted over all places:
    [http://forums.sun.com/thread.jspa?threadID=5336533]
    [http://forums.sun.com/thread.jspa?threadID=5336534]
    [http://forums.sun.com/thread.jspa?threadID=5336532]
    [http://forums.sun.com/thread.jspa?threadID=5336519]
    [http://forums.sun.com/thread.jspa?threadID=5336510]
    Stop crossposting. It's very rude.

  • 'm using firefox version 4 in my network and i want the clients can't change my network proxy that we are using i did it in previous version but it doesn't work in version 4, so how can i do it?

    ''locking as a duplicate of this thread - https://support.mozilla.com/en-US/questions/827625''
    I've network in my company and installing internal web proxy that allow clients to connect to the internet (ISA 2004). I'm using the Firefox as default browser in my network. so what i need that no one in my network clients can't change the proxy settings or it just be dimmed. i did it in the previous version but when i try the steps in version 4 it doesn't work so I'm asking for solution for that.
    many thanks for help,
    Ahmed Khairy

    Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
    For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Testing the client proxy

    Hi,
    I generated the client proxy from the WSDL .Created a HTTP destination( Type G ) and also configured the logical port.
    I also tested the HTTP connect, it works fine. But when I test the service I get an error saying
    Error duing proxy processing (PART UNKNOWN (NULL)   )
    I'm I missing something ?
    Regards,
    christina.

    Hi Julius,
    Here is the WSDL....
    http://10.54.154.128:53000/XMII/WSDLGen/Default/Oilandgas/ForTagQuery
    Regards,
    christina.

  • Returning a html status code to the client browser

    Hi,
    Can anyone help me with a problem that I am have with regard to returning a html status code of NO_CONTENT to the client browser?
    The Problem:
    Basically I have a html form with a SAVE button. When the user clicks the SAVE button the data in the form is sent to the web server which then saves it in a database and the same populated form is then sent back to the client. From the users point of view they click the SAVE button and the screen is refreshed with the same data. The problem with this is that the data only needs to be SENT to be saved but not necessarily resent back to the client browser from the server i.e. from a user's point of view I don't want the screen to refresh by disappearing and then coming back again. There is a lot of data in the form so this refresh can take a considerable amount of time as the html can take a while to download.
    The Potential Solution:
    What I want to do is send the data to the server where it will be saved in the database and then return a html status code of NO_CONTENT to the browser (always Internet Explorer) so that the page doen't get refreshed / downloaded unnecessarily. I've implemented this and the save can now take as little as 10% of the time it used to take because the data is only sent and not received again.
    The problem with the potential solution:
    It works fine most of the time but not all of the time. We tested this change and it worked great but when we released it live it didn't work for some people. For most people you can see the status bar at the bottom of IE zip along as the data is sent to the server so you can see when it has finished or received the status code back. For the people it didn't work for they would get an almost full status bar at the bottom but the blue would never quite disappear to indicate that it was finished. It was as if it was sending the data from the server but not getting a response at all when it should have been getting the NO_CONTENT status code.
    The Code:
    I'm using Struts so the line of code I had originally used after the data had been saved to the database was:
         return (mapping.findForward("timesheet"));
    I changed this line of code to:
         response.setStatus(response.SC_NO_CONTENT);
         response.flushBuffer();
         return null;
    Can anyone see what the problem is here? Are the new lines of code not guaranteeing that the response is being sent back to the client? Is there a better way to simply return a status code when you don't want return a JSP page?
    Any help would be greatly appreciated.
    rgds,
    Dave

    I see what you mean now. It's a very good idea but it wouldn't really work for this application. I've taken out the ability to use "back" functionality on this screen. It is launched through javascript so that the window itself has no toolbar and also the page is set to expire so that if you do go "back" to it, you are forced to refresh the page so that it is guaranteed to have the same data as is on the server. This is needed to stop problems with other functionality of the application.
    Thanks for the suggestion though.
    Does anyone know why this code only works most but not all of the time?:
    response.setStatus(response.SC_NO_CONTENT);
    response.flushBuffer();

  • 10gAS, proxy server and client ip address

    Hello,
    We recently deployed an application in a 10G application server, running behind an apache reverse proxy server.
    Our developers want to get the client ip addresses, which the proxy server passes in the the header x-forwarded-for. They're currently using getRemoteAddr to get the ip address of the system making the request, which is always going to be the proxy server.
    If using webcache, it looks like it's possible to toggle webcacheip on in the httpd.conf, which modifies the return value of getRemoteAddr appropriately. Is there a way to modify the application server to pull the ip address out of the x-forwarded-for header instead of the clientip header and return it via getRemoteAddr?
    Should I just have the developers pulling from that x-forwarded-for header value instead?

    I've gotten a few emails on this, what I did was this:
    On the front end apache reverse proxy, I added these lines:
    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} ^(.*)
    RewriteRule ^.* - [env=MY_REMOTE_ADDR:%1]
    RequestHeader set ClientIP "%{MY_REMOTE_ADDR}e
    It's been a while, but I recall having to do some extra work to be able to write this value into a header, I couldn't do it directly, so I did the above four lines instead.
    And then set UseWebCacheIp On on the application server httpd.conf.

Maybe you are looking for

  • [SOLVED] Laptop doesn't suspend anymore when closing lid [GNOME 3]

    Hi there! Since I upgraded to GNOME 3 recently, my laptop (Acer Aspire TimelineX 3820TG) doesn't suspend anymore when I close the lid. Instead, it just turns off the screen. If I choose suspend from the menu, it does suspend properly. I googled a bit

  • New to Aperture, Mac and unsure...

    ...about the age-old "managed vs. referenced" dilemma. I'm seeing many of the pros and cons of letting Aperture 3 manage my photos vs. managing them myself and referencing them with the software. What I'm not clear on is whether there is any way--usi

  • Error:Required product not found

    Hi, When i click the edit in the interactive form component i encounter a message like "Required Product not installed.Install SAP interactive form-livecycle designer to edit the forms." <b>How can i rectify this error? i have installed adode livecyc

  • Can iphoto give a picture an incorrect date?

    I received a picture on my iphone from someone and they said that the photo was taken yesterday but when I import the photo into iphoto it labels and sorts the picture as though it was taken in 2005. I have searched the internet and this does not app

  • Why do I get an error message every time I attept to download firefox?

    Every time I attempt to download it, a message comes up saying the download has been interrupted. I click okay and resume it, only to get a message saying the file is corrupt. I'm using windows 8 and as far as I know everything is up to date and meet