Jump to content

stpeln

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About stpeln

  • Rank
    Newbie
  1. Hi! Background:I am maintaining a Java application where I create a http server (using the class org.apache.http.protocol.HttpService). The http server creates a socket on port 6060. From an Ajax script executed in a browser on the same machine, a xmlhttp request is sent to localthost port 6060. The request is transmitted to the Java application and and response is sent, works fine. As long as the solution is executed on a client machine (desktop computer). The Java application executes in ONE instance since it is ONE machine with ONE user. The application is designed to handle requests from one user only. Problem:When the solution is executed on a terminal server (through Windows Remote Desktop Connection), each user will start a new instance of the Java application, that is if there are five users logged in the the terminal server, there will be five running instances of the Java application. The first started instance allocates port 6060 on localhost. But when the following instances tries to allocate port 6060 on localhost, it fails since it is already allocated by the first instance. I expected this to work, since I thought that each user on a terminal server executed in a own session with a memory and ports of its own, but obviously this is not the case. I have however heard that it should be possible to allocate a "virtual" port (i.e. unique for my session) instead of a machine physical port. Does anyone have a clue about how to solve this, I am in urgent need of advises... I insert parts of my Java code where I create the http server: ServerSocket mSocket = new ServerSocket( 6060);HttpParams mHttpParams = new SyncBasicHttpParams();mHttpParams .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, DEFAULT_TIMOUT ) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, DEFAULT_BUFFER_SIZE ) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false ) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true ) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1") .setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, "UTF-8"); // Set up the HTTP protocol processorHttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] { new ResponseDate(), new ResponseServer(), new ResponseContent(), new ResponseConnControl() }); // Set up request handlersHttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();reqistry.register("*", new GadgetRequestHandler( mGadgetIntegrator )); // Set up the HTTP HttpService mService = new HttpService(httpproc, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory(),reqistry,mHttpParams); Thanks!
  2. Through a so called manifest file (xml) that referres to the script.So you think this is a domain security problem?
  3. The script is included in a Google Mail Contextual Gadget, which means that the URL in navigation bar is not visible. That is, the user is logged in to the domain in Google Apps.Sequence:1. Mail is loaded and the script displays the button.2. The button clicked and the script attempts to do the following things: - Send an xmlhttp reuqest on localhost. - Download and start a Java application through Java web start (this application listenes to the xmlhttp request sent by the script).I.e. both the script and the Java application executes on the same machine.
  4. I don't understand. Do you mean that I should change the actual script or change the location from where I execute it? And how will the latter be done since the script is (and will also be when deployed) located on a webserver?
  5. I have Wamp installed but I do not use it (for this Javascript purpose I use DropBox).
  6. Thanks for your quick reply.I thought that since the script is executed on my machine (though located on a webserver) both the script and my machine were in the same domain?Well, any hints about how I solve it? I want the script to send an xmlhttp request to a Java program (downloaded and started through Java Web Start) on the SAME machine as the script (that's why localhost is used).
  7. Hi!I have implenented a gmail contextual gadget with Java script. When the script is executed (triggered by a button click from an email), an xmlhttp request is sent. This works fine in Chrome but not in Internet Explorer (I have tested with 8 and 9).The reason is that the call xmlhttprequest.open throws an axception. My call sequence looks like the following: <script type="text/javascript"> if( deployJava.versionCheck( '1.6.0+' )) deployJava.createWebStartLaunchButtonWithCallback( launchUrl, '1.6.0', startSendingGMailId );</script> where launchUrl = jnlp file (java web start) on a DropBox address (I use DropBox as a simple web server for test).In the method startSendingGMailId, the following call is made: xmlHttp = new XMLHttpRequest();xmlHttp.onreadystatechange = <function call>;xmlHttp.open( "POST", localUrl, true ); where localUrl = "http://127.0.0.1:6060"and the exception I get is "Access denied".I just cannot figure out why it works in Chrome but not in IE (I've tried several different security settings). Since I am using localhost for the open call, my machine must be wihtin the domain?I am very new to Java Script and really would appreciate help, thanks!
×
×
  • Create New...