Application Request Routing (ARR) Dynamic Website Load

I currently have a Cloud Project which contains a web role and a work role, with 2 instances of each.
I have multiple domains which point to the same website and the code uses the domain as an identifier to then load up a website with customised content relevant to that domain.
I would like to go a step further and add a second web role and then be able to be able to choose which website/web role to load that domain. I'd also like to use the database or a cached file to determine which website to load
rather than to hard code it in a web config. This idea would be that I could flick a switch and a different site would be loaded.
I thought that this might be possible with the ARR. 
Does this sound like it is possible to do and any hints on the direction to take?
Thanks in advance.

Hi GBSM,
Thanks for your posting!
Base on my understanding, I guess you want to redirect the specify webrole before the site load. But base on my experience, if you want to redirect to another web role, you need use your domain name and port number, like this :http://www.domainname.com:8080.
So I think you use the "http://www.domainname.com" to access your cloud service, you could visit the default site whose port number is 80. For your requirement, I think you can write your logic code
into gloable. asmx page in your default webrole . When the condition meet your requirement, the site redirect to other web role. Also, you could store your conditions into database or cache.
Another approach is as Benjamin's said, you can use URl Rewrite Map(http://www.iis.net/learn/extensions/url-rewrite-module/using-rewrite-maps-in-url-rewrite-module
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I can't connect to the itunes store and have some problems with other websites. Some websites load OK. I had the same problem on my iPad and changed the DNS, but don't want to do this on my iMac, anyway, surely I should have my router's DNS?

    I can't connect to the iTunes store from my iMac and have problems loading a number of other websites, however some websites load perfectly well. I have had the iTunes store issue on my iPad and resolved it by changing the DNS but surely I should use the DNS for my router. I don't really want to change it for the iMac as I access secure sites with it to internet shop.
    Any ideas, I was going to try loading Chrome but can't get it without going through the iTunes store. Anyway, that is treating the symprom not the cause.

    Adding Open DNS codes to your Network Preferences, should give good results in terms of speed-up as well as added security, (including anti-phishing and redirects) (Full information about Open DNS is here: http://www.opendns.com/home/nobloat ) and further independent information can be read here:
    http://reviews.cnet.com/8301-13727_7-57338784-263/free-dnscrypt-tool-enhances-ma c-web-security/?tag=mncol;txt
    and here:
    http://www.macworld.com/article/1146064/troubleshootdns.html?t=234
    Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu, and in the box marked 'DNS Servers' add the following two numbers:
    208.67.222.222
    208.67.220.220
    (You can also enter them if you click on Advanced and then DNS)
    Sometimes reversing the order of the DNS numbers can be beneficial in cases where there is a long delay before web pages start to load, and then suddenly load at normal speed:
    http://support.apple.com/kb/TS2296

  • AIR application request a xml file from a server (but only legal users)

    Hello guys
    I am conceptualizing a project at the moment and I am thinking of using Adobe AIR to develop the application related to that project.
    But it depends on the ability of AIR to fulfill my project requirements.
    I want your ideas, please...
    Imagine, I finished developing my application and compiled the distributed version using Adobe AIR.
    And I am going to distribute the installation files of the intended application by burning on to a CD.
    Imagine, the user who got that CD, installed it it on his computer and launched the application.
    When the application is running, it needs to load a XML file which is saved in our company server.
    Since it is an important data file I don't want to dispatch it with the installation CD.
    So I am thinking of using URLRequest and URLLoader classes to load this XML file from server dynamically.
    Lets imagine I did codes like this....
    var request:URLRequest = new URLRequest("http://www.mycompany.com/sereverfolder/blabla.xml");
    request.method = URLRequestMethod.POST;
    var loader:URLLoader = new URLLoader();
    loader.load(request);
    But my question is, how safe hardcoding the path for the xml file in the class file as shown above.
    Can anyone get access to xml file path by looking into installation files dispatched via CD?
    Or is there any other safer way to do this?
    Thank you for taking time to read my question and please add your input if you would like to share your knowledge.
    cheers

    wrong forum.

  • Dynamic Class Loading and Stubs

    How Dynamic Class Loading is used on Java RMI, since stubs are generated on clients using Reflection API?
    I was reading Dynamic code downloading using JavaTM RMI (http://java.sun.com/javase/6/docs/technotes/guides/rmi/codebase.html), it seems to be out of date.
    For example, "The client requests the class definition from the codebase. The codebase the client uses is the URL that was annotated to the stub instance when the stub class was loaded by the registry. Back in step 1, the annotated stub for the exported object was then registered with the Java RMI registry bound to a name."

    "Enhancements in J2SETM 5.0
    Dynamic Generation of Stub Classes
    This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use the Java(tm) Remote Method Invocation (Java RMI) stub compiler, rmic, to pregenerate stub classes for remote objects. *Note that rmic must still be used to pregenerate stub classes for remote objects that need to support clients running on _earlier versions_.*
    When an application exports a remote object (using the constructors or static exportObject methods(1) of the classes java.rmi.server.UnicastRemoteObject or java.rmi.activation.Activatable) and a pregenerated stub class for the remote object's class cannot be loaded, the remote object's stub will be a java.lang.reflect.Proxy instance (whose class is dynamically generated) with a java.rmi.server.RemoteObjectInvocationHandler as its invocation handler.
    An existing application can be deployed to use dynamically generated stub classes unconditionally (that is, whether or not pregenerated stub classes exist) by setting the system property java.rmi.server.ignoreStubClasses to "true". If this property is set to "true", pregenerated stub classes are never used.
    Notes:
    * If a remote object has pre-5.0 clients, that remote object should use a stub class pregenerated with rmic or the client will get an ClassNotFoundException deserializing the remote object's stub. Pre-5.0 clients will not be able to load an instance of a dynamically generated stub class, because such a class contains an instance of RemoteObjectInvocationHandler, which was not available prior to this release.
    * Prior to the J2SE 5.0 release, exporting a remote object would throw a java.rmi.StubNotFoundException if the pregenerated stub class for the remote object's class could not be loaded. With the added support for dynamically generated stub classes, exporting a remote object that has no pregenerated stub class will silently succeed instead. A user deploying a server application to support pre-5.0 clients must still make sure to pregenerate stub classes for the server's remote object classes, even though missing stub classes are no longer reported at export time. Such errors will instead be reported to a pre-5.0 client when it deserializes a dynamically generated stub class.
    (1) The static method UnicastRemoteObject.exportObject(Remote) is declared to return java.rmi.server.RemoteStub and therefore cannot be used to export a remote object to use a dynamically generated stub class for its stub. An instance of a dynamically generated stub class is a java.lang.reflect.Proxy instance which is not assignable to RemoteStub."
    http://java.sun.com/j2se/1.5.0/docs/guide/rmi/relnotes.html

  • After Upgrade to latest iTunes, it will not open.Uninstall and reinstall did not help Getting this error message ''  Runtime Error R6034 '' An application has made an attempt to load the C runtime library incorrectly''. 3 windows PCs.1 vista, 2 windows7 7

        I upgraded to the latest iTunes 11.1.4, after a prompt from the iTunes store. But will not open after the upgrade. One of three error messages told me to reinstall. I did. Restarted and scanned.  But no help there. So I unistalled and re installed from Apples' website. The installation was okay as usual but still will not open. Keep getting the same error messages. '' Runtime Error R6034, ''  '' An application has made an attempt to load the C runtime library incorrectly. Please contact the application's support team for more information.''  That's the error messages I get when I try to open the New installed iTunes 11.1.4. Right now there is no iTunes on any of my PCs. Installed but will not open. Please Help.Thanks.
    Jonas.
    3 Windows PCs. Safari 5.1.5 ( One Laptop with Vista. Two Windows 7 64 bit on All in One Sony desktop PCs. )

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • How do i sort out error r6034 on my windows vista when i try to start itunes, the message box is from microsoft visual c++runtime library, it says an application has made an attempt to load the C runtime library incorrectly,

    how do i sort out error r6034 on my windows vista when i try to start itunes ???
    the message box is from microsoft visual c++runtime library, it says an application has made an attempt to load the C runtime library incorrectly, P;ease contact the application's support team for more information.

    Hey deepakmenonfrompune,
    Thanks for the question. I understand that you are experiencing issues with iTunes for Windows. The following article outlines the error message you are receiving and a potential resolution:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Some Windows customers may experience installation issues while trying to install or open iTunes 11.1.4.
    Symptoms may include:
    "The program can't start because MSVCR80.dll is missing from your computer"
    "iTunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows Error 126)”
    "Runtime Error: R6034 - An application has made an attempt to load the C runtime library incorrectly"
    "Entry point not found: videoTracks@QTMovie@@QBE?AV?$Vector@V?$RefPtr@VQTTrack@@@***@@$0A@VCrashOnOverf low@@***@@XZ could not be located in the dynamic link library C:\Program Files(x86)\Common Files\Apple\Apple Application Support\WebKit.dll”
    Resolution
    Follow these steps to resolve the issue:
    Check for .dll files
    1. Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files.
    2. If you find QTMovie.DLL, or any other .dll files, move them to the desktop.
    3. Reboot your computer.
    Note: Depending on your operating system, you may only have one of the listed paths.
    Uninstall and reinstall iTunes
    1. Uninstall iTunes and all of its related components.
    2. Reboot your computer. If you can't uninstall a piece of Apple software, try using theMicrosoft Program Install and Uninstall Utility.
    3. Re-download and reinstall iTunes 11.1.4.
    Thanks,
    Matt M.

  • When I try to Home-Share It works most of the time. It will always show up, but sometimes I tap on the icon of my library then it wont load, I restart my computer, IOS Divice and my router It still wont load my Library .... WHY!

    When I try to Home-Share It works most of the time. It will always show up, but sometimes I tap on the icon of my library then it wont load, I restart my computer, IOS Divice and my router It still wont load my library. I even went and tried to reinstall Itunes and everything nothing works.

    Hi,
    /Users/sarahschadek/Desktop/Safari.app/Contents/MacOS/Safari
    Move the Safari app from the Desktop to the Applications folder.
    Restart your Mac.
    That's why you see this:
    When I try to do the updates my computer says it has ready it goes through like it is downloading them then at the end it says some of the files could not be saved to "/" files.
    After your restart your Mac, click the Apple  menu (top left in your screen) then click:  Software Update ...
    Carolyn  

  • Every time I try to run iTunes I get an error message sayinh: An application has made an attempt to load the C runtime incorrectly. What does this mean

    Every time I try to run iTunes I get an error message sayinh: An application has made an attempt to load the C runtime incorrectly. What does this mean

    Uninstall your existing copy of iTunes. Delete any copies of the iTunesSetup.exe (or iTunes64Setup.exe) installer files from your downloads areas for your web browsers and download a fresh copy of the iTunes installer from the Apple website:
    http://www.apple.com/itunes/download/
    (The current build of the 11.1.4.62 installer was changed a few days ago, which fixed the bulk of the reports of MSVCR80.dll/R6034/APSDaemon.exe/Error-7/AMDS-could-not-start trouble ... but the build number on the installer was not changed. So we're trying to make sure you do the reinstall using a "new good" 11.1.4.62 installer instead of an "old bad".)
    Does the install with the new copy of the installer go through properly? If so, does that clear up the error message?
    If you still have the same error messages cropping up, then try the procedures from the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • IP SLA Request size (ARR data portion) UDP Jitter

    Looking through the documentation for ip sla udp jitter, Cisco says these are the default values -
    "By default, ten packet frames (N), each with a payload size of 10 bytes (S), are generated every 10 ms (T), and the operation is repeated every 60 seconds (F)."
    however, looking at sh ip sla configuration on my router I get different values -
    ip sla 1001
    udp-jitter 2.2.2.2 20000 source-ip 1.1.1.1
    ip sla schedule 1001 life 3000 start-time now
    sh ip sla configuration
    Entry number: 1001
    Owner:
    Tag:
    Operation timeout (milliseconds): 5000
    Type of operation to perform: udp-jitter
    Target address/Source address: 1.1.1.1/2.2.2.2
    Target port/Source port: 20000/0
    Type Of Service parameter: 0x0
    Request size (ARR data portion): 32
    Packet Interval (milliseconds)/Number of packets: 20/10
    This is confusing to me. According to this, the operation is sending 10 frames, at 32 bytes each with 20 ms between frames. Is this correct? Or are these default parameters for UDP Jitter? If so, this definitely does not match up with the data presented on cisco.com
    thanks,
    Alex

    Hi Alex ,
    for UDP-jitter ,  Request Data size is :32( By Default) ,however you can change it .
    NMS-6500(config-ip-sla-jitter)#request-data-size ?
      <16-1500>  Number of bytes in payload
    for ICMP ECHO ,
    Request Data size is :28  ( By Default)
    Thanks-
    Afroz
    [Do rate the useful post]

  • Dynamic Website

    Hi Guys,
    I have created my dynamic website and it works alright, but I need assistant with orginization of my files.
    I have putting together an on-line store for products such as jeans.  My SQL data based is designed as follow:   categories (denim, non denim) body ( boot cut, flare, skinny and etc), style ( style number, description and 4 photos for each style)  These photos are listed in PHP with a  specific number assigned to them like st001.jpg . In Dreamweaver I linked image folder to the area where the photos are to be repeated all the way down the page for each style
    I will have over 500 SKU ( style Number) each SKU will have 4 photos. How would I be able to organize all these photos in folders?
    I found the reapeating region easy andI am planning to use my data base and use the repeat region method to list all the style number.  Do I put 2000 puts in a Image folder, or do I create a main image folder and add sub-folder for each body such as skinny, boot cut, flare and etc.  I also need to fiter these styles based on wash, rise, body and etc. if that make sense.
    Please help me with the correct  and easy method to do this task.
    I also would like the shopper to be able to magnify on the photo.  I am using the "thickbox widget" for my gallery. Please tell me if this is the correct way or suggest if there is better method.
    Thank you so much and everyone have a happy holiday.

    bobbak2011 wrote:
    Well I need a specific look for my website for high end designer clothing. Most shopping bag software I came a cross were really basic.  If there are shopping bags that have good datbase features available i would like to link them in dreamweaver to my website.
    Of course, i would not put all the photos and for each style on one page.  They will be displayed in different pages with filtering capabilities built in to the each page.
    Look should be the least of the concerns.  Most pre-built apps can be skinned to match your site.
    I am attaching an image to this post to describe details below.  It is of a wireframe of your database structure (images are easier to talk with then text in many cases).
    As you describe it you have 4 tables right now and you are trying to organize images.  The 4 tables you describe having now are:
    Products - Contains product data, pricing, and subcategory information
    Categories - Denim, etc.
    Body - Boot cut, etc.
    Style - Style number, etc.
    In the diagram you will see text in 2 colors, red and blue.  The Blue text columns are your primary keys and the Red are where foreign keys should lie.  Because there are foreign keys the tables should be setup with the InnoDB engine as opposed to the default myisam.  The foreign keys create the proper dependancies to ensure the integrity of the data so that all fields entered in are valid (this will help a lot with updating down the road).
    Next, is your images.  The table 5 is a very basic depiction of what your images table should look like.  At the very least you need to know the path, alt_tag (in case image doesn't load and to make page valid), and a foreign key on the product_id column linking to your products table.  To make things easier on your script you should have all the images in one folder.  The database will do the heavy lifting to sort the pictures to the proper items.  And because you have multiple images for each product you have an "Order_By" column to that table as well to ensure that they are printed in the proper order.
    Lastly is the query.  Your query should have the LIMIT and utilize the "offset" to select the specific rows within that range.  More info on the offset can be found here ( http://dev.mysql.com/doc/refman/5.0/en/select.html ).  The page listing query will select the first image for each product and basic information.  Then run a loop to print X number of items to the screen.  Then for your product detail page gather all the data from the multiple tables and you should be good to go.
    That should get you started.  If you have any questions post back.

  • Dynamic Class Loading and Unloading

    I am trying to create a system where the class name and method name is
    picked up from a meta-data database and executed.
    This was accompanied using Dynamic Class loading. I tried to extend this to
    support versioning of meta-data. Here depending on the version of meta-data
    different libraries can be loaded and different implementations of object
    with the same name can be executed. This does not seem to work with Forte
    3.0.
    When the second Library is loaded the method execution does not work.
    (Even though the unload flag on the LoadLibrary is set)
    If the application is stopped and restarted pointing to the second library
    there is no problem. In a running application a dynamically loaded library
    does not seem to unload and reload a new library for the same class names.
    Has anyone tried sometime similar, is there a workaround for this type of
    problem.
    - Vivek

    I am trying to create a system where the class name and method name is
    picked up from a meta-data database and executed.
    This was accompanied using Dynamic Class loading. I tried to extend this to
    support versioning of meta-data. Here depending on the version of meta-data
    different libraries can be loaded and different implementations of object
    with the same name can be executed. This does not seem to work with Forte
    3.0.
    When the second Library is loaded the method execution does not work.
    (Even though the unload flag on the LoadLibrary is set)
    If the application is stopped and restarted pointing to the second library
    there is no problem. In a running application a dynamically loaded library
    does not seem to unload and reload a new library for the same class names.
    Has anyone tried sometime similar, is there a workaround for this type of
    problem.
    - Vivek

  • Dynamic class loading in J2ME

    Hi all,
    Couple of questions. Is dynamic class loading using classloaders supported in any, if not all versions of J2ME? I guess I should ask first, what exactly does J2ME cover? I see KVM, but do watches and PDA's, set top boxes, refrigerators and so forth all run the same J2ME JVM? Or are their "less feature full" versions? I was hoping the J2ME spec would be the "lowest common denominator" to program for, but I thought I read somewhere that small devices like watches may even have a "smaller" J2ME JVM or something, less capable. So can I write code for J2ME and it will run on all small devices like cell phones, pda's, and so forth? Or is there another J2ME version, perhaps small than J2ME.
    So, from what I have found so far, it appears dynamic class loading is done at startup from a DB (of sorts) as opposed to being able to dynamically find/load classes. If this is so, is there any way to support downloading and reloading new classes like you can with J2SE, such as the hot-swap feature of web servers? Does Class.forName() at least work in that you can "replace" a class with a new version, even if it is not able to have a separate classloader instance? My guess is that J2ME supports only a single classloader space, but I thought I read somewhere that Class.forName() is available. J2ME API shows it I believe, but I could be wrong.
    Any help on this topic would be appreciated.
    Thanks.

    Dynamic class loading is not available in most (if not all) J2ME profiles and configurations. Class.forName() is available (at least in the MID profile), but not to be used for dynamic class loading. It can be used when using device-specific APIs where you can try to load a class containing device specific methods (for example a class that works only on certain Nokia phones, and has methods playSound() and vibrate(), which are not available in MIDP), and if you catch a ClassNotFound exception you can load a class that doesn't use the device specific APIs and contains stubs of the methods, or you can disable certain features in you application that need those features. For an example implementation you can have a look at Nokia's Block Game example (available from their developer site - http://www.forum.nokia.com/main.html).
    As for your other more general questions about different JVM's and such, you should read all about the different configurations and profiles available in J2ME (plenty of information using in the J2ME link on this site).

  • Dynamic class loading when CODEBASE is unreachable. A bug?

    Let us suppose that we have a large-scale distributed application with ca. 1000 participants communicating via RMI and utilizing dynamic class loading. As we all know, a HTTP code server must be available for this purpose in order to provide dynamically downloaded code, usually the communication proxy code of remote objects. In a real-world scenario, the HTTP server will never be 100% available, so that we will have cases that a Java process will not be able to download the necessary Java classes, causing the RMI communication to fail with a ClassNotFoundException or similar exception. In such a case, a robust application would perform some recovery activities and retry the remote call. Eventually, the HTTP server becomes available again and the distributed system recovers automatically. This seems to work fine with J2SE 1.4.2_10, but not with 1.4.2_11 and newer versions. Considering Java 5, the Update 9 exhibits the same problem.
    For tracking down the problem, I've written a simple distributed test application, consisting of a client and a server. A server listens on a port, and sends a MarshalledObject to the client. The code of the MarshalledObject is annotated with the value of the "java.rmi.server.codebase" system property. The annotation contains an URL of the JAR file containing the code of the original object. The client connects to the server, reads data form the socket and unmarshalls the original object. This is basically the same procedure as when objects are accross the wire as arguments/return values/exceptions by the RMI/JRMP engine. This procedure is repeated forever in the loop. Due to the fact that the client's CLASSPATH doesn't contain the code of the original object, this code should dynamically be loaded from the HTTP server using the appropriate annotation provided by the server.
    If we start the client while the HTTP server is down, the client will keep generating the ClassNotFoundException over and over again, as expected. So far, so good. If we now start the HTTP server while the client is still running, we will observe different behaviors, depending on the version of the client's JVM:
    1. In J2SE 1.4.2_10, the client will download the code from the HTTP server and successfully unmarshal the original object sent by the server. ClassNotFoundExceptions will not be generated again.
    2. In J2SE 1.4.2_11, 1.4.2_12 and 1.4.2_13 as well as in J2SE 5.0 Update 9, the client will continue generating ClassNotFoundExceptions. Analysis of the HTTP server's access log shows that there were no attempts to download the JAR file required for unmarshaling the object sent by the server.
    It seems that in the newer JVM versions the RMI engine remembers URLs which have failed and does not attempt to access them anymore. Althogh this may have some advantages considering the overall network load, the dynamical class loading becomes practically useless in productive large distributed systems. The very first attempt to load the codebase of the communication peer must succeed, otherwise the whole process must be restarted for the communication to work, which is a very expensive (and for most customers unacceptable) operation in terms of preformance and resources usage.
    Should this be seen as a bug or a feature of the JVM? What do you think?
    Regards,
    Miran
    Here is the code to reproduce:
    Server code
    package server;
    import java.net.*;
    import java.rmi.*;
    import java.io.*;
    public class Server implements Serializable {
      private int value = 42;
      public Server() {
      public String toString() {
        return "The Answer is " + value;
      public static void main( String[] args ) {
        if( args.length!=1 ) {
          System.out.println( "Usage: server.Server <port>" );
          System.exit( 1 );
        try {
          MarshalledObject data = new MarshalledObject( new Server() );
          int port = Integer.parseInt( args[0] );
          ServerSocket serverSocket = new ServerSocket( port );
          System.out.println( "Accepting connections..." );
          while( true ) {
            Socket s = serverSocket.accept();
            new Thread( new SocketHandler( s, data ) ).start();
        } catch( Exception ex ) {
          ex.printStackTrace();
        System.exit( 0 );
      public static class SocketHandler implements Runnable {
        private Socket s;
        private Serializable data;
        public SocketHandler( Socket s, Serializable data ) {
          this.s = s;
          this.data = data;
        public void run() {
          try {
            OutputStream os = s.getOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream( os );
            oos.writeObject( data );
            oos.close();
            os.close();
            s.close();
            System.out.println( "Serving socket succeeded" );
          } catch( Exception ex ) {
            System.out.println( "Serving socket failed" );
            ex.printStackTrace();
    Client code
    package client;
    import java.rmi.*;
    import java.net.*;
    import java.io.*;
    public class Client {
      public static void main( String[] args ) {
        if( args.length!=1 ) {
          System.out.println( "Usage: client.Client <port>" );
          System.exit( 1 );
        try {
          if( System.getSecurityManager()==null ) {
            System.setSecurityManager( new RMISecurityManager() );
          int port = Integer.parseInt( args[0] );
          for( int i = 1; true; ++i ) {
            try {
              Socket s = new Socket( "localhost", port );
              InputStream is = s.getInputStream();
              ObjectInputStream ois = new ObjectInputStream( is );
              Object o = ois.readObject();
              ois.close();
              is.close();
              s.close();
              Object umo = ((MarshalledObject) o).get();
              System.out.println( i + ". Retreiving MarshalledObject succeeded: "
                                  + umo );
            } catch( Exception ex ) {
              System.out.println( i + ". Retreiving MarshalledObject failed" );
              ex.printStackTrace();
            System.out.println( i + ". Waiting for 10 sec" );
            Thread.sleep( 10000 );
        } catch( Exception ex ) {
          ex.printStackTrace();
        System.exit( 0 );
    Start command for the server
    java -cp server.jar -Djava.rmi.server.codebase="http://localhost/playground/server.jar" server.Server 33933
    Start command for the client
    java -cp client.jar -Djava.security.policy=all.policy client.Client 33933
    The policy.all file should look as follows
    // All permissions
    grant {
       permission java.security.AllPermission;
    };The server.jar file should only contain the classes from the server package. This file should also be made accessible via HTTP (e.g. by using the Apache HTTP server).
    The client.jar file should only contain the classes from the client package.

    no body know about this??

  • Dynamic Class Loading with interface

    Hello
    I would appreciate any help on the following problem.
    I need to load all classes in a particular directory and its subdirectories (top directory is known but not in the classpath) which implement a predefined interface. At the moment I am using a lot of reflection to accomplish this and believe it can be avoided somehow using the fact that I know these classes have to implement a predefined interface.
    At the moment, I am searching through the directory and subdirectory, loading all names of classes into a vector using a custom URLClassloader, and then load all classes in the vector into modulecontainers to populate a defaultmutabletree which is displayed on the gui.
    I'm sure that knowing the interface means there's a more straightforward way.
    Thanks in advance.

    Finally i've found out myself, i've read some postings in this forum and put them all together, so that my webstart-application finally works the way i want...
    That was the topic:
    Downloading a jar-file and starting a class from this jar-file within a webstart application (dynamic class loading).
    I'll post my final solution for this problem, may be it would be useful in future for anyone else.
    //grant all permissions on the clientside
    Policy.setPolicy( new Policy() {
    public PermissionCollection getPermissions(CodeSource codesource) {
    Permissions perms = new Permissions();
    perms.add(new AllPermission());
    return(perms);
    public void refresh(){
    //get the current classloader
    ClassLoader cl = MyLoadedClass.class.getClassLoader();
    //create a new url-classloader while using the current classloader
    URL[] urls = new URL[1];
    File f = new File(new String(jarName));
    urls[0] = f.toURL();
    URLClassLoader ul = new URLClassLoader(urls, cl);
    //load a class from jarfile
    Class c = ul.loadClass(new String(className));
    //get an object from loaded class
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof KnownInterface){
    // Yep, lets call a method we know about. */
    KnownInterface client = (KnownInterface) o;
    client.doAnything();

  • Dynamic class loading with Webstart

    Hello !
    //within the jar-file at the webstart-directory
    public interface MyFrame{
    public void createFrame();
    //within the jar-file dynamically downloaded
    public class MyExtFrame extends JFrame implements MyFrame{
    String className = "MyExtFrame";
    ClassLoader cl = ClassLoader.getSystemClassLoader();
    JarClassLoader jarLoader = new JarClassLoader (cl, jarFile));
    /* Load the class from the jar file and resolve it. */
    Class c = jarLoader.loadClass (className, true);
    /* Create an instance of the class.
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof MyFrame){
    // Yep, lets call a method we know about. */
    MyFrame client=(MyFrame) o;
    //call a class-method (here creates the whole gui-object at once)
    client.createFrame();
    This is the code i'm using and i've encountered following problem, if i put this code into an application without webstart, anything works fine, but with webstart i'll get a: java.lang.NoClassDefFoundError
    Then i've put the MyFrame-classes into the downloaded jar-file, but this won't work either, i'll get a ClassCastException.
    What do i have to do, to become it working ?
    Thanks for any conclusions and help.
    Michael

    Finally i've found out myself, i've read some postings in this forum and put them all together, so that my webstart-application finally works the way i want...
    That was the topic:
    Downloading a jar-file and starting a class from this jar-file within a webstart application (dynamic class loading).
    I'll post my final solution for this problem, may be it would be useful in future for anyone else.
    //grant all permissions on the clientside
    Policy.setPolicy( new Policy() {
    public PermissionCollection getPermissions(CodeSource codesource) {
    Permissions perms = new Permissions();
    perms.add(new AllPermission());
    return(perms);
    public void refresh(){
    //get the current classloader
    ClassLoader cl = MyLoadedClass.class.getClassLoader();
    //create a new url-classloader while using the current classloader
    URL[] urls = new URL[1];
    File f = new File(new String(jarName));
    urls[0] = f.toURL();
    URLClassLoader ul = new URLClassLoader(urls, cl);
    //load a class from jarfile
    Class c = ul.loadClass(new String(className));
    //get an object from loaded class
    Object o = c.newInstance();
    /* Are we using a class we specifically know about? */
    if (o instanceof KnownInterface){
    // Yep, lets call a method we know about. */
    KnownInterface client = (KnownInterface) o;
    client.doAnything();

Maybe you are looking for

  • Apple TV - Using multiple accounts

    Is it possible to use Apple TV with two different ITunes accounts and to switch between the two accounts easily? If so, how?

  • Substring with a dynamic length

    Hi All. I need to convert the URL that comes as a https to http. This URL is dynamic and so im not able to give the 'To' value when trying to use the substring functionality. If i have a URL as https://forums.sdn.sap then i need to convert this as ht

  • How do I open photo grid to change number of caption lines

    how do I open photo grid to change number of caption lines?

  • Launching the Debug never complete

    hi everybody and thanks for your attention, when i launch my application in debugging mode, it starts the browser but never complete, it remains pending and gives no message. after about a minute i recive this popup Failed to connect; session timed o

  • Component Install Failed error in CS3

    I have been trying to install the trial version of Illustrator CS3, as I only need to use the program for a short time. I tried installing more than five times now, and right before the installation process is over, it says that my Shared Components