Howto Unload and Load Classes to/from server?

Hi
Have you an idea to load/unload (when i decide it) a classe to/from a server (tcp)?
Thank you.

Thank you
I want to complete the client code, to load some class, from the server side.
Am i clear?
...and "unload" a class, or "finalize" all the instances of a class located remotly (server side), is it possible?
Server:
import java.net.*;
import java.io.*;
public class Serveur{
public static void main(String[] args) throws Exception{
    ServerSocket serveur = new ServerSocket(5000);
    while(true) {
      Socket socket = serveur.accept();
      BufferedReader in = new BufferedReader(
         new InputStreamReader(socket.getInputStream()));
      String cmd = in.readLine();
// parle !!!
      DataOutputStream out = new DataOutputStream( socket.getOutputStream());
      if(cmd.equals("parle")){
        out.write("bonjour\n".getBytes());
      }else{
        out.write("commande inconnue ?\n".getBytes());
      socket.close();
}Client:
import java.net.*;
import java.io.*;
public class Client{
  public static void main(String[] args) throws Exception{
    Socket socket = new Socket("localhost", 5000);
    DataOutputStream out= new DataOutputStream( socket.getOutputStream());
    out.write(args[0].getBytes());
    out.write("\n".getBytes());
    BufferedReader in = new BufferedReader(
       new InputStreamReader(socket.getInputStream()));
    System.out.println(in.readLine());
    socket.close();
}

Similar Messages

  • ITunes 10.5.3, Unable to Load Class Data from Sync Services, Crashes Repeatedly

    Ever since iTunes 10.5.3 on my Windows 7 x64 box, I've been having serious problems keeping iTunes running:
    1)  Any time I connect my iPhone or iPad, or any time they attempt to sync over WiFi, I get the 'Unable to load class data from sync services' error.  It's worth mention that the iPhone or iPad do actually then proceed to sync correctly, and all media / data is synchronized successfully, as far as I've been able to tell.  I've reset sync history, restored the iPhone and iPad, manually moved the SyncServices directory, set both the iPhone and iPad up as new, completely uninstalled iTunes and the mobile device software, re-installed, and *nothing* I do fixes this issue or even seems to impact it.  Uninstalling iTunes 10.5.3 and reinstalling iTunes 10.5.2 resolves this error.
    2)  iTunes 10.5.3 has serious crashing problems on my machine, though I've searched through forums and found a lot of other people with the problem.  In my case, sporadically as iTunes access the iTunes store (for example, I can always make it happen by subscribing to the Diggnation podcast and telling it to refresh the podcast), I get a full application crash which generates the following event in the event log:
    Faulting application name: iTunes.exe, version: 10.5.3.3, time stamp: 0x4f14cc3d
    Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e211319
    Exception code: 0x80000003
    Fault offset: 0x0001280c
    Faulting process id: 0x564
    Faulting application start time: 0x01cce78789dc009a
    Faulting application path: D:\Program Files (x86)\iTunes\iTunes.exe
    Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
    Report Id: ecc77400-537a-11e1-b809-00248c196007
    Again, uninstalling iTunes 10.5.3 and re-installing iTunes 10.5.2 fixes this issue as well, but I really shouldn't have to do that.  Is there any actual solution to these problems other than dowgrading to an older version?
    Yes, I'm running current malware protection (and my system is clean) and yes, I've already checked any other obvious culprits to make sure I don't just have a corrupt library or file somewhere that's causing it.  My Windows 7 install is completely up to date from a Windows Update perspective and also from a driver perspective (even including the motherboard and chipset drivers).  I made sure to do a system file integrity check (sfc /scannow) and it confirmed my install of Windows isn't suspect, but beyond all that I was able to reproduce these failures on a completely separate machine running Windows 7 x64, without any of my media library or data on it -- iTunes 10.5.3 just seems to be bad news on Windows 7 x64 for me, even though I know there are definitely people are using it successfully.  I don't get any other application crashes for any other applications, and I've never had an issue like this with any previous version of iTunes...
    Last but not least, in case it matters, I'm running iOS 5.0.1 on both the iPhone4 and the iPad2.  The iPhone4 is the GSM AT&T model and the iPad2 is the CDMA Verizon model.

    OK, I've given up.  Uninstalled iTunes 10.5.3 permanently.  It's a shame, 10.5.2 works perfectly but 10.5.3 is a complete and total cluster for me.
    Anyone with the same problems who hasn't done this already, just uninstall iTunes and the Apple Mobile Device Service in your Add/Remove Programs, then re-install iTunes 10.5.2.  You won't lose your library or any settings or apps, it will just go back to working again.
    I wish Apple would acknowledge this so that I'd at least know it would be fixed in the future.

  • Do not seem to be able to backup iPad via iTunes on to my PC. Message after connecting is "iTunes was unable to load class information from Sync Services, Reconnect or try later"  Have tried that but get the same result. Can anyone assist?

    Do not seem to be able to backup iPad via iTunes on to my PC.
    Message after connecting is "iTunes was unable to load class information from Sync Services, Reconnect or try later" 
    Have tried that but get the same result.
    Remedies I've tried are:
    wait and try again
    reboot
    reload iTunes
    NB hp is a relatively new machine and has previously backed up quite happily.
    Can anyone assist?

    RHoodnkt-
    Try rebooting the iPad.  Hold down both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  It takes a minute or two to restart.
    Also be sure your iPad battery is not completely discharged.
    Fred

  • "Unable to load workflow actions from server. Please contact your server."

    I get the following error message when I want to create or open a workflow in SharePoint Designer 2007
    "unable to load workflow actions from server. Please contact your server
    administrator."
    I don't receive this error as a site collection administrator, but one of my contributors gets the error.

    What Chris mentioned is kind of abnormal situation described in
    http://office.microsoft.com/en-us/sharepointdesigner/HA102379121033.aspx#20.
    However, normally, you won’t be able to create SPD workflow if you only have Contribute permission level. I give the user Design permission level then he can
    create SPD workflow.
    There are other factors affecting permission to create SPD workflow:
    1.     
    According to
    http://office.microsoft.com/en-us/sharepointdesigner/HA101005871033.aspx#4
    , the SPD workflows are stored in a site-level hidden document library called Workflows. You should make sure that user have permission in this document library so that the created workflow can be saved successfully.
     http://blogs.msdn.com/sharepointdesigner/archive/2008/11/25/locking-down-sharepoint-designer.aspx
    describe the method to manage permission for this hidden Workflows document library: open the site in SharePoint Designer >> right-click the Workflows library >> click Properties >> click the Security tab >> click the link “Manage
    permissions using the browser”
    2.     
    SharePoint Designer contributor setting (http://office.microsoft.com/en-us/sharepointdesigner/HA101174691033.aspx
    ) can also block the user from being able to create workflows.

  • I have an imap account and deleted all mail from server. Once doing this all emails from my iPad -which was on a wi-fi- where automatically deleted. Fortunately these emails are still visible on my iPhone that was without connection. If I send all these e

    I have an imap account and deleted all mail from server. Once doing this all emails from my iPad -which was on a wi-fi- where automatically deleted. Fortunately these emails are still visible on my iPhone that was without connection. If I send all these emails to my iCloud account - they will remain into my outgoing folder until I open my wi-fi- …BUT will they be sent when I open my wi-fi connection, or since they are no longer on my server… be deleted for ever!?

    This is how IMAP works, if you delete from one device it will also be deleted in the other devices.
    iCloud do not backup e-mails.

  • HT203175 unable to load class information from sync services

    I am unable to sync my ipod touch. I get the following error message: Unable to load class information from sync services. Reconnect or try again later. Any suggestions?

    In the course of your troubleshooting to date, have you worked through the following document?
    iTunes for Windows: "Unable to load data class" or "Unable to load provider data" sync services alert

  • Loading .JPG`s from Server and Reusing them in .SWF

    Hi everyone!
    Suppose I want to load a .jpg from the server ONCE and then I want to reuse it a dozen times in my .swf...
    How can I achieve this without adding to the .swf`s file size? I was thinking copying its BitmapData a dozen times, but that adds to the file size, right?
    Thanks!

    The weight of the file doesn't change when you load/create content dynamically.
    (I gotta get my post traffic control system working again--too many close calls lately)

  • Tomcat6 does not load class files from WEB-INF/lib/myjarfile.jar  WHY???

    I have placed my jar file in c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jar
    But, after restarting tomcat6, when i try to import the class file contained in the myjarfile.jar in a servlet, it says
    ProcessFileUpload.java:4: package test.test1 does not exist
    import test.test1.*;
    ^It clearly tomcat's class loading problem.
    As i unzipped my jar and placed the packagefolder structure to
    c:\tomcat6\webapps\my-application\WEB-INF\classes\testand it works perfectly.
    Anyone knows its workaround? please suggest if any configuration changes is required in tomcat or so.
    Thanks.
    ---Sujoy

    Thank you gimbal2 . There was error in creating the jar file myjarfile.jar.
    But, now I have created it again and placed it in place
    c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jarand tried to use one on the Class file included within the jar to compile my servlet. But, still I am getting error at servlet compilation time. I want to place executable jar files in
    c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jar and compile my servlet and execute the servlet.
    I DO NOT WANT TO unzip the jar, placing all unzipped files to
    c:\tomcat6\webapps\my-application\WEB-INF\classes\ folder and comiple my servlet and execute the servlet. But, I am failing to user WEB-INF\lib\ folder facility....please help me why i am not getting class files from WEB-INF\lib\ folder.
    If you please see the small code bit and tell me any possible error that would be very helpful.
    Step 1: my library java file MyClass.java
    package test.test1;
    public class MyClass {
         String myName = "Default return string value";
         public void setMyName(String varName) {
              this.myName = varName;
         public String getMyName() {
              return this.myName;
    }Step2 : Creating jar file of my library class files
    C:\jdk1.6\bin>jar cvf myjarfile.jar test
    added manifest
    adding: test/(in = 0) (out= 0)(stored 0%)
    adding: test/test1/(in = 0) (out= 0)(stored 0%)
    adding: test/test1/MyClass.class(in = 452) (out= 296)(deflated 34%)
    adding: test/test1/MyClass.java(in = 230) (out= 140)(deflated 39%)
    C:\jdk1.6\bin>Step3 : Double checking the created jar file content by listing its content
    C:\jdk1.6\bin>jar tf myjarfile.jar
    META-INF/
    META-INF/MANIFEST.MF
    test/
    test/test1/
    test/test1/MyClass.class
    test/test1/MyClass.java
    C:\jdk1.6\bin>Step4 : Placed myjarfile.jar to
    c:\tomcat6\webapps\my-application\WEB-INF\lib\Step5 : Restarted standalone Tomcat6 in my Windows XP SP2.
    Step6 : Created a simple servlet LibFolderTest.java within my-application\WEB-INF\classes\ folder with code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.test1.*;
    public class LibFolderTest extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              MyClass mc = new MyClass();
              out.println(mc.getMyName());
    }Step7 : Tried to compile my servlet LibFolderTest.java and got the following error
    LibFolderTest.java:4: package test.test1 does not exist
    import test.test1.*;
    ^
    LibFolderTest.java:11: cannot find symbol
    symbol  : class MyClass
    location: class LibFolderTest
                    MyClass mc = new MyClass();
                    ^
    LibFolderTest.java:11: cannot find symbol
    symbol  : class MyClass
    location: class LibFolderTest
                    MyClass mc = new MyClass();
                                     ^
    3 errorsThe above servlet compilation error on Step7 is telling me that myjarfile.jar is not loaded by Tomcat6 or not available for use when compiling servlet. I want to use myjarfile.jar from within WEB-INF\lib\ folder but I can not. please help.
    ---Sujoy

  • Issues loading .txt files from server...

    Hi.
    I have an issue with a script I created that loads text strings from a file on my server.
    The swf file loads a message from a .txt file, displays it in an animation when the animation finishes it loops back to the start and loads the next message and displays it in the animation.
    All works fine. However the script reads the text file from the server on every loop ( 3 seconds ) This will be hard on my server so... Is there a way to read the text file once only and then loop through the eight statements?
    Thanks. Z
    Actionscript 2. Flash CS3. Flash Player 10.
    quotes.txt - text file containing eight quotes
    quote_txt - Dynamic field within animation
    ranQuote = new LoadVars();
    ranQuote.onLoad = function(success) {
        if (success) {
            RanNum = RanNum+1;
            if (RanNum>=9) {
                RanNum = 1;
                ran = this["quote"+(RanNum)];
                quote_txt.text = ran;
            } else {
                ran = this["quote"+RanNum];
                quote_txt.text = ran;
        } else {
            quote_txt.text = "Display if can't load txt file";
    ranQuote.load("quotes.txt");

    Unless I'm missing something, each time you load the file you are loading the entire file.  So you should have all of what's in it stored.  Your load function appears to just be picking out one of them out randomly after they're all loaded.
    I assumed wrongly that this isn't all the code you have and other loading code is what you are trying to inhibit.
    What you probably want to do is take most of your onLoad code and place it into a function.  What you have that is pulling up the quotes should utilize that function.  You shouldn't be using that loading code each time some button or whatever loop cycles.

  • Podcast will not load in safari from server, but will load in other Apps

    Podcast will not load in safari from iWeb Page from server, but will load in Firefox and other web apps.
    Here the problem: I have a podcast page made in iWeb. It is setting on a server with GoDaddy. When I try load page with Safari, I get where the Quicktime Playing Bars are a small Quicktime Logo w/? mark and will not download or play. But in Firefox, My iPad and in Windows side it will load and play. Also it play on a friends Macbook Pro in Safari. (Note it will play in my Safari after Firefox has play -it "very strange to me" like Firefox will open some port, but it will not stay open if quit Safari re-booth-it) I have remove the .plist for Quicktime & Safari. And clean out the Cache for Safari. Also have re-set the Firewall setting to Enable Stealth Mode only. Re-load the site to GoDaddy. This is happening to both Mac's in my network and in all users accounts.
    My Network is a A&TT with a 2Wire w/wrieless turn off. going into and Airport Extreme Base Station w/N generation network. One computer is connected with and ethernet cable to the Airport extreme base station the other is a wireless contection.
    I do feel this and network issue and I can't seem to solve-it. How can I get Safari to open the port and download and play-it on my network?

    We've only discover this yesterday. One of our listeners sent me an e-mail about-it. With a little more research this morning. I've discover that everybody I've had check-it is have the same problem only with Safari 4.0.5. So I'm starting to feel that this is an Apple Safari Bug in 4.0.5 for the Mac only. It seems to be OK everywhere else on other devices. I agree in most cases this is not a problem. But when have older people who do not download into iTunes around the world it is to them. We have 250 or more listeners a week. This is a Church podcast.
    For right now we are planing to post a message on the site saying you will not be able to listen to the podcast in Safari, but can in Firefox and ect.

  • Finding loaded Class file from particular Jar

    Hi,
    I have multiple jars containing same class file.
    How can I find out that the loaded Class file belongs to particular jar?
    Thanks
    madan

    In most cases it's possible with ProtectionDomain and CodeSource:ProtectionDomain pd = YourClass.class.getProtectionDomain();
    CodeSource cs = pd.getCodeSource();
    if (cs != null) {
        System.out.println("It came from " + cd.getLocation());
    } else {
        System.out.println("Location unknown.");
    }For further information see
    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#getProtectionDomain()]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#getProtectionDomain()
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/ProtectionDomain.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/CodeSource.html

  • Compiling (in memory) and Loading classes on fly

    Hiya,
    I have following classes:
    public class Vehicle {Protected Sting reg;}
    public class Car extends Vehicle
    (public void print(){System.out.println(reg);}}
    These classes (or different ones) are stored in one text file. The program must read these files then compile and load them dynamically in memory.
    The link below authored by DCHSW deals with one class only (compile and loading) however it fails with more then one class particularly when it is subclassed.
    http://forum.java.sun.com/thread.jsp?thread=347467&forum=4&message=1439418
    How can we get the code mentioned at link above to compile (in memory) and load subclasses like the ones mentioned above.
    Thanks
    Derik

    Hiya,
    I have following classes:
    public class Vehicle {Protected Sting reg;}
    public class Car extends Vehicle
    (public void print(){System.out.println(reg);}}
    These classes (or different ones) are stored in one
    text file. The program must read these files then
    compile and load them dynamically in memory.
    The link below authored by DCHSW deals with one class
    only (compile and loading) however it fails with more
    then one class particularly when it is subclassed.
    Read the following post for full description of the problem
    http://forum.java.sun.com/thread.jsp?forum=4&thread=417724
    Any ideas?
    Thanks
    Derik
    http://forum.java.sun.com/thread.jsp?thread=347467&foru
    =4&message=1439418
    How can we get the code mentioned at link above to
    compile (in memory) and load subclasses like the ones
    mentioned above.
    Thanks
    Derik

  • How to Enable Plugin before File Opened And Load PDF File From memory?

    hello everyone,
    there have two problems,all i want to do is to show a pdf file encrypted by AES algorithm.
    1.one is how to enable plugin before file opened?
    i developed another two plugin,and each enabled after one pdf file was opened,and now i want to replace the file open command and can do some word by meself,such as decrypt the pdf ?
    2.another is how to load pdf file from memory?
    if i can enable plugin before file opened,and than i can read the file and decrypt it,and now i want to do is do load the decrypt file (in memory) into the adobe?
    i tried many method,but all in vain.who can help me or give me some advice?
    thanks.
    merry chrismas to everyone.

    The proper way to handle other file formats (even where it is really a PDF that has been "wrapped") is to create an AVConversionHandler.
    To load a PDF from a source other than the file system, you need to create a custom AVFileSys.

  • ODI and Loading to/Extracting from Hyperion Planning **?

    All,
    first--I am not a Hyperion expert.
    Clients have 2 requirements:
    #1. Loading data ( flat file format residing in Windows environment) ''to'' Hyperion Planning 9.3.1
    #2. Extracting Data 'From' Hyperion Planning 9.3.1 to a flat file ( residing in Windows environment)
    Questions:
    #1 I have looked at materials at OBE > ( http://ias.us.oracle.com/portal/page?_pageid=33,1704614&_dad=portal&_schema=PORTAL)
    I have been able to reverse engineer a Hyperion application in ODI. but apparently that's not all, and there is additional work to be done in Hyperion itself
    namely---'preparing' dimensional members, before loading any data.
    Let's say the input data is comprised of: Product_code, Account_num, Period, Amount
    Can someone explain how the following recommended steps by Hyperion example can plays out to load this data?
    1) Loading Metadata? ( what needs to be added/changed in Hyperion diemnsion)
    2) Loading Data?
    #2 do we have to use ODI to create interface and extract/write data from Hyperion to a flat file? isn't there any Hyperion 'Facility' which does that?
    any pointers is appreciated.
    Thanks
    ali

    Hello,
    Unfortunately there is no SSO option from "Planning to FDM" via Tasks.
    The URL you should tell Planning to launch in a new window is 'http://<ServerName>/HyperionFDM'
    If Planning can not execute that in a fresh IE window; then there isn't much that can be done.
    It might also be advantageous to post this to the Planning group as well; since this isn't necessarily an FDM discussion.
    Thank you,

  • XML file not loading in FF from server

    I've created a web page that loads an external XML file and
    then uses javascript code to parse the file for requested
    information. I know it's not the best way to do this, but I'm
    trying to get this working before I move on to "better" methods.
    When I run the page using the "Preview/Debug in browser"
    funtionality of DW everything works great both in IE and FF. But
    when I load the page to the server and then load the page in a
    browser, it works in IE but not in FF. It looks as though FF is
    just not loading the XML file. I can't figure out why the page
    would work if launched from DW, but not work if the page is loaded
    on the server and then run from there, and only in FF.
    The code I'm using to load the XML file is supposed to be
    cross-browser compatible. I've seen many versions like from various
    sources, so it should be OK. I'm pretty new to all of this so I'm
    hoping that I'm just missing something simple. Does anyone have any
    idea why this is behaving this way?
    Thanks for any help.

    so, in frame 1 of your fla before you execute that cross-domain load method, use:
    System.security.loadPolicyFile("http:www.yourcrossdomain.com/subdirectoriesIfNeeded/crossd omain2.xml");
    where the following (crossdomain.xml) is in www.yourcrossdomain.com's root (IF you want to allow allow subdirectory policy files):
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    </cross-domain-policy>
    and in the subdirectory (and its descendents) that you want to allow access put crossdomain2.xml:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-access-from domain="www.thedomainthatstryingtoloadcrossdomaindata.com" />
    </cross-domain-policy>

Maybe you are looking for