How to get data in the remote system from local system.

Hi everybody,
I have developed four classes.
FileInterface.java:-
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface FileInterface extends Remote {
public byte[] downloadFile(String fileName) throws
RemoteException;
FileServer.java:-
import java.io.*;
import java.rmi.*;
public class FileServer {
public static void main(String argv[]) {
if(System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
try {
FileInterface fi = new FileImpl("FileServer");
Naming.rebind("//10.161.15.219/FileServer", fi);
} catch(Exception e) {
System.out.println("FileServer: "+e.getMessage());
e.printStackTrace();
FileImpl.java:-
import java.io.*;
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class FileImpl extends UnicastRemoteObject
implements FileInterface {
private String name;
public FileImpl(String s) throws RemoteException{
super();
name = s;
public byte[] downloadFile(String fileName){
try {
File file = new File(fileName);
byte buffer[] = new byte[(int)file.length()];
BufferedInputStream input = new
BufferedInputStream(new FileInputStream(fileName));
input.read(buffer,0,buffer.length);
input.close();
return(buffer);
} catch(Exception e){
System.out.println("FileImpl: "+e.getMessage());
e.printStackTrace();
return(null);
FileClient.java:-
import java.io.*;
import java.rmi.*;
public class FileClient{
public static void main(String argv[]) {
if(argv.length != 2) {
System.out.println("Usage: java FileClient fileName machineName");
System.exit(0);
try {
String name = "//" + argv[1] + "/FileServer";
FileInterface fi = (FileInterface) Naming.lookup(name);
byte[] filedata = fi.downloadFile(argv[0]);
File file = new File(argv[0]);
BufferedOutputStream output = new
BufferedOutputStream(new FileOutputStream(file.getName()));
output.write(filedata,0,filedata.length);
output.flush();
output.close();
} catch(Exception e) {
System.err.println("FileServer exception: "+ e.getMessage());
e.printStackTrace();
After that when i compile classes when i give the command as
rmic FileImpl
in command prompt error is coming like this.
error: Class FileImpl not found.
*1 error*
Can anyone help me please,urgent.

It is generating stub and skeleton classes but when iam running FileClient after starting rmiregistry,it is coming something like
FileServer exception: FileServer
java.rmi.NotBoundException: FileServer
     at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:106)
     at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
     at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
     at sun.rmi.transport.Transport$1.run(Transport.java:153)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
     at java.lang.Thread.run(Thread.java:595)
     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at java.rmi.Naming.lookup(Naming.java:84)
     at FileClient.main(FileClient.java:9)
Can u help me

Similar Messages

  • How to get  data with the raw pattern from resultset ?

    would you tell me how to get data with the raw pattern from resultset ?
    thank you in advance!
    longgger2000

    I tried getBytes() and getObject()
    , but I can not get the right result , for example the
    data in oracle database is 01000000DFFF, when In used
    the method of getBytes() and getObject(), I get the
    result of [B@1c2e8a4, very different , please tell me
    why !
    thank you
    longgger2000
    [B is byte arrayseem that it return an bytes array for you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get data on the next page in case of templates if data is more ?

    please tell me how to get data on the next page while i m using template in my first page , if data is more howw it can be displayed on the next page ?

    HI Asim,
    template is fixed we  it can't be expand . u can better to use table line it can automaticlly expending if data is more ... u can create one more page like page 2 and create a window for entire second page ..then assign it in first page (next page page2).
    regards
    kiran kumar.

  • How to process data in the past based from data in the present

    hello guys,
    i have a problem in my labview programs. how to process data in the past based from data in the present ?
    i have a formula self-organizing maps
    this formula is looking for D1, D1 is neuron index that will be searched for the smallest value.and the result are D1=2 ,D2=5, D3=17 from calculating with formula  .it means the smallest value is 2, "2" from weight [2 2] in file attached.
    and then it will be in other formula
    it mean [2 2] + 0.5 ( [1 1]-[2 2] ) = [1.5 1.5]
    and the weight will be  [1.5 2 2 ] in matrix
                                              1.5 3 5
    I would appreciate any input/help on solving this
    thanks
    Attachments:
    dika.vi ‏16 KB
    weight.txt ‏1 KB
    data .txt ‏1 KB

    Hi Ronny Hanks,
    Moving your records from internal table into the database table depends upon various scenarios :-
    1. If you use INSERT statement.
    INSERT <database_table> FROM TABLE <internal_table>.
    But in this case, you need to make sure that you don't have any duplicate entries in your internal table that violates data entry into database table, else you will get a dump.
    INSERT <database_table> FROM TABLE <internal_table> ACCEPTING DUPLICATE KEYS.
    In this case, you are forcefully inserting duplicate records into your database table which may lead to data redundancy in your database table.
    2. If you use UPDATE statement.
    UPDATE <database_table> FROM TABLE <internal_table>.
    This will update the existing records in your database table from the internal table.
    3. If you use MODIFY statement.
    MODIFY <database_table> FROM TABLE <internal_table>.
    This statement works both in combination of INSERT & UPDATE statements.
    Existing records (in database table) will be eventually updated/modified and new records (not in database table currently) will be successfully inserted into the database table.
    Hope this solves your problem.
    Thanks & Regards.
    Tarun Gambhir.

  • HT3702 i want to change my region and i don't know how to get rid of the remaing amout from my gift card ($0.48)

    i want to change my region and i don't know how to get rid of the remaing amout from my gift card ($0.48)

    Request that iTunes Support zreo balance your account.
    iTunes Support -
    http://www.apple.com/support/itunes/

  • How to get rid of the old songs from iPhone that do not show up in iTunes?

    Every time I delete my entire iTunes library and sync iPhone with it, my music is still loaded with old songs but do not appear on my iTunes. And when I add new songs to my library, the new songs get mixed with old songs.
    How to get rid of the old songs?

    hey buddy....u have to delete the songs from ur iphone....i have got the same issue.....songs are not showing in itunes!!!!!

  • How to access data in the remote system

    Hi everybody,
    I have developed four classes.
    FileInterface.java:-
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface FileInterface extends Remote {
    public byte[] downloadFile(String fileName) throws
    RemoteException;
    FileServer.java:-
    import java.io.*;
    import java.rmi.*;
    public class FileServer {
    public static void main(String argv[]) {
    if(System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    FileInterface fi = new FileImpl("FileServer");
    Naming.rebind("//10.161.15.219/FileServer", fi);
    } catch(Exception e) {
    System.out.println("FileServer: "+e.getMessage());
    e.printStackTrace();
    FileImpl.java:-
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    public class FileImpl extends UnicastRemoteObject
    implements FileInterface {
    private String name;
    public FileImpl(String s) throws RemoteException{
    super();
    name = s;
    public byte[] downloadFile(String fileName){
    try {
    File file = new File(fileName);
    byte buffer[] = new byte[(int)file.length()];
    BufferedInputStream input = new
    BufferedInputStream(new FileInputStream(fileName));
    input.read(buffer,0,buffer.length);
    input.close();
    return(buffer);
    } catch(Exception e){
    System.out.println("FileImpl: "+e.getMessage());
    e.printStackTrace();
    return(null);
    FileClient.java:-
    import java.io.*;
    import java.rmi.*;
    public class FileClient{
    public static void main(String argv[]) {
    if(argv.length != 2) {
    System.out.println("Usage: java FileClient fileName machineName");
    System.exit(0);
    try {
    String name = "//" + argv[1] + "/FileServer";
    FileInterface fi = (FileInterface) Naming.lookup(name);
    byte[] filedata = fi.downloadFile(argv[0]);
    File file = new File(argv[0]);
    BufferedOutputStream output = new
    BufferedOutputStream(new FileOutputStream(file.getName()));
    output.write(filedata,0,filedata.length);
    output.flush();
    output.close();
    } catch(Exception e) {
    System.err.println("FileServer exception: "+ e.getMessage());
    e.printStackTrace();
    After that when i compile classes when i give the command as
    rmic FileImpl
    in command prompt error is coming like this.
    error: Class FileImpl not found.
    1 error
    Can anyone help me please,urgent.

    It is generating stub and skeleton classes but when iam running FileClient after starting rmiregistry,it is coming something like
    FileServer exception: FileServer
    java.rmi.NotBoundException: FileServer
         at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl.java:106)
         at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
         at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
         at java.lang.Thread.run(Thread.java:595)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)
         at FileClient.main(FileClient.java:9)
    Can u help me

  • How to get data into the mySQL database?

    First some background.
    I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
    There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
    A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
    Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
    These were my initial thoughts:
    1. Data collection:
    To avoid spending all our energy and time  on correcting typo's, getting missing data, correcting errors, I am  investigating the use of CPU-Z in Ghost mode to create a .txt or .html  file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds  data like number of memory sticks, DDR timings, stock clock speed and  BCLK setting, video card info and VRAM size, etc.
    To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
    This can all be done without user intervention in an automatic way, but  maybe I need to add an Auto-It file to the test to make it all run as  desired.
    If this works and I'm able to extract the relevant data from the created  file and can insert it into the database, we may be in business for the  next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot  easier, because there is less data to fill out.
    2. Data submission:
    The submission form can be simplified if  the CPU-Z data can be used. We have to create an automatic way to attach  the created .html file from CPU-Z to the submission form and we have to  streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It  currently is manual labor and very time consuming.
    3. Adding to Database:
    I have to find a way to create database  records from the Gmail forms I receive. All incoming mail messages need  to be checked on relevancy and if relevant, need to be added  automatically to the database and then offered for approval before final inclusion in the database. Data included in the database  will then include submission date and time, Email address,  IP address  used, plus links to the files submitted and available on the website.
    4. Publication of the database:
    After approval of new records from step  3, all updates will be automatically applied to the database and  accessible for users. I do not yet intend to introduce a user account ,  requesting login before all functionality is accessible. Too much trouble and administration.
    Queries should be possible on things like CPU (check box), so include  17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory  (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar  options.
    The biggest problem is to keep the color grading and statistical  indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated  queries. Say you make a query which results in 20 observations, this  should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends  do need to reflect that. Question in my mind, does the RPI remain  constant, independent of the query or does that need to be recalculated  on the basis of the query?
    Next thing is to allow a user to select a specific observation and by  simply clicking on it be shown, in a separate window (detail page) or  accordion, all the CPU-Z related information about the hardware.
    The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
    5. Ideally, external links:
    In an ideal situation, one could link the  CPU-Z data to external price databases, looking up current prices for  CPU, memory, video card, disks, raid controller, etc. to get instant  BFTB charts, based on the query made. But that is the next step.
    Situation now:
    I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
    Question:
    I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
    "Ref_ID","-","filename"
    Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
    20110204-6cf5-Output(99).txt
    I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
    Graphically,
    is what I want to achieve.
    This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
    Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
    I hope someone can help me.

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • How to get data passed back to server from Web Start client ?

    dear experts,
    my web application allows users to launch a web start window from the jsp page, after users enters some data in the web start page and press "OK", the data entered should be passed back server for process. i just have not much clue how to do this....
    thanks.

    Use the java networking library to send a request to a url that takes the arguments you want to pass in.
    Example:
    URL url = new URL("http://yourserver/yourhandler.do?arg1=foo&arg2=bar");
    HttpURLConnection conn = (HttpURLConnection) URL.openConnection(url);
    ... any output testing, etc...
    conn.disconnect();It's not the prettiest, but it ought to get the job done.
    You should probably (at least) use the BasicService to get the codebase back to the server that served up the jnlp file.
    -Mike

  • In MSC2n - Get date in the classification tab from  basic data 1 tab

    Hi All,
    My requirement is as follows.
    WHen I execute the tcode MSC2N,
    Relevent data for the fields Batch, Material and Plant and hit the enter Key.
    This displays Tabs like BASIC DATA1, BASIC DATA 2 , CLASSIFICATION  etc.
    when I change the production date in the BASIC DATA1 and then click on the CLASSIFICATION tab, the prodiction date should get displayed automatically in this tab.
    There  is no USER-EXIT or BAdi for this.
    I need an enhancement point.
    Plz help me .
    Regards,
    Renuka
    Edited by: Renuka Sarode on May 11, 2010 9:51 AM

    Hi Reddy,
    Its doesnt work for me...
    Plz suggest me som enhancement..
    Regards,
    Renuka

  • How to get rid of the DC-offset from a signal?

    Hello
    i have a speech signal which i need to process. I have estimated its DC-offset (using the AC-DC estimate vi) to be approximately 126 V. I have read some posts here that some reccomend to just subtract this value from the array of data or use a filter to do it. What is the difference, which one should perform better? I have also broke down my initial array of 50000 samples into sub-arrays of 512. Where should be the best place to get rid of the DC? Once and out from the initial array or later on from the subarrays?
    When someone says subtact that value (DC value) from the signal, what exactly has to be done?
    When using a filter, what shall i be looking for to do?Specifications of it?
    Any help is appreciated

    Hello Lynn
    So you are just saying, get the DC offset since it stays almost constant, from the AC/DC Estimate VI and just subtract it from my initial array at the beginning once and out and further on move with the rest of my process? That's it as it shows in the pic below?
    Attachments:
    untitled.PNG ‏14 KB

  • Help:  How to get rid of the default None from Radio buttons?

    Hi, I searched the forum and found a work around for inputSelect. It seemed it does not work for Radio buttons, i.e., inputSelectGroup with multiple=false.
    Please anyone help us to get rid of the none choice for gender among female and male. Thank you very much in advance.
    ZD

    The 'none' choice is automatically displayed for fields that allow nulls.

  • How to get data in the fileds

    hi,
    i have used where clause but not getting any data...?
    this is the coding which i am trying to execute..
    '' select vbakkunnr VBakernam VBAkaudat vbakaufnr vbapKWMENG vbapmatnr vbap~matkl
    up to 10 rows
    from vbak inner join vbap on vbakvbeln = vbapvbeln
    into table IT_VBAKUK
    where vbak~kunnr = s_sales
    and VBak~ernam = s_sales
    and VBAk~audat = s_date
    and vbak~aufnr = s_sales
    and vbap~matnr = s_sales
    and vbap~matkl = s_sales.''
    Kindly give me some solution or example or identify my coding mistake,so i can prepare this report

    >
    Vikranth.Reddy wrote:
    > Am afraid you are just learning to write a select statement. Please SEARCH in SCN before posting.
    Thread locked for this reason
    Edited by: Matt on Mar 12, 2010 11:23 AM

  • Help!  :  How to get data of the DB02's Tablespaces Overview

    Hi, All
    I'm running netweaver 2004s on oracle 10.2 db ,is there any function module by which we can get the data of tablespaces's overview in DB02? i will call them in my customizing program.
    Edited by: Cui diming on Mar 16, 2008 7:42 AM

    hi,Angi
    i tried to set session breakpoint in these corresponding function modules and touched off the node (DB02>space>Tablespaces---->Overview). but the debugger didn't answer. to DB02 the function group is unuseful.maybe...

  • How to get connection of the db lite from java stored procedure?

    Hello! All.,
    I have a written java stored procedures to assign sequence keys, and update some tables. The procedure is working as per our need by using the following connection information.
    try {
    int rowFetched = 0;
    Class.forName("oracle.lite.poljdbc.POLJDBCDriver");
    // connect to the database
    Connection conn = DriverManager.getConnection("jdbc:polite:polite",
    "system", "manager");
    My question is, It is possible in db lite to get a default connections like we use in the enterprise database
    conn = new OracleDriver().defaultConnection();
    Could anybody please shed some light on this.
    Thanks in advance.
    Kathir

    Hello Upi! out of curiosity if you happen to know the answer for the following, I do appreciate it.
    Hello! We are using BC/ADF JClient to select and for any DML operation against Oracle Lite database. We may have more than one user(s) log on to our application, so we requires to authenticate oracle lite user credential using JDBC dynamically.
    I am utilizing the features of JCLoginDialog.java and manipulation bc4j.xcfg file. This work real good for accepting username/password credentials dynamically, since we have multiple database in one computer I have to accept DSN name and if possible built my own configuration file.

Maybe you are looking for

  • I have a problem with iTunes Match...

    ...and not like an 'oh man, this bolt's too big for this hole' problem, more of a 'hey man, if you don't stop doing that then you and me gona have a problem' problem. For starters, I found that enabling the iTunes Match service means that I can't man

  • Contact on ipad and iphone duplicated or triplicated

    both iphone and ipad have my contacts triplicated or quadruplicated. How can I sink them so they only appear once in each devise?

  • Mac equivalent to PC shortcuts

    Hi I've been trying to get use to the keyboard shortcuts I used to use on my PC. For word processing I could hit <ctrl> <arrow right or left> and quickly scroll to the beginning of the next work. Is there a Mac equivalent feature? I could also hit <h

  • Rounding Value is not considered for MB lot size

    Hi I have a scenario where MB (Monthly Lot size) lot size is used with rounding value. Example as below: Lot size: MB Min Lot size: 15000 Rounding Value: 20000 DEMAND: 16000 When MRP run, System is creating the 16000 as P Req instead of 20000 which i

  • Safari for Windows plugin

    Hi, I'm trying to develop a plugin for Safari for Windows. I am using the same codebase for FF3 (Windows and Mac) and Safari (Mac), all of which work fine. Safari for Windows is not finding the plugin, however, despite the fact that I placed the DLL