Cross-platform object sharing

Hi,
I am developing a file sharing client-server project.
Server is a distributed server in which users are created. Clients used to connect to the server using that user name.
For the first time when the client logged in to the server, a directory is created for that user in his name and set it as the user's home directory for that user.
After that the user's home directory content is filled up in the JTable and it is sent to the client as TableModel object. In client side that TableModel object will be received and that will be set as the tablemodel for its JTable using the following method
client's JTable object .setModel("received TableModel Object from the server");
This is working fine if the server and client both belong to the same OS.
i.e,
I have tested this with server in windows 98 and client in windows 98. Working fine.
I have tested with server in Redhat Linux 9 and client in Redhat Linux 9. Working fine.
But when I tested with server in Redhat Linux and client in windows, there is an error while reading the TableModel object received from the server.
How can i solve this problem?
Please help me soon.
Eagerly waiting for the reply.
Thank you.

The error is ClassNotFoundException. Or the reading of bytes is incomplete.
I have done with a simple client-server example.
In this when the client connect to the server, the server will send its current working directory's content.
Server :
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.net.*;
import java.util.*;
class tblobjSendServer implements Runnable
     ServerSocket server;
     Thread t;
     JTable tblList;
     public tblobjSendServer()
          String[] colNames={"","Name","Type","Size","Date","Path"};
          tblList=new JTable(new newTableModel(new Object[0][0],colNames));
          try
               server=new ServerSocket(2000);
               System.out.println("Listening to the port 2000");
          catch(IOException ie)
          t=new Thread(this);
          t.start();
     public void run()
          while (true)
               try
                    Socket theConnection=server.accept();
                    InputStream rawIn=new BufferedInputStream(theConnection.getInputStream());
                    Reader in=new InputStreamReader(new BufferedInputStream(theConnection.getInputStream()),"ASCII");
                    OutputStream out=new BufferedOutputStream(theConnection.getOutputStream());
                    loadTblList();
                    ByteArrayOutputStream bout=new ByteArrayOutputStream();
                    ObjectOutputStream oout=new ObjectOutputStream(bout);
                    oout.writeObject(tblList.getModel());
                    oout.flush();
                    byte[] tblData=bout.toByteArray();
                    oout.close();
                    bout.close();
                    String msgToSend="OK "+tblData.length+"\n";
                    //sending OK msg : "OK <tblData byte array size>"
                    out.write(msgToSend.getBytes("ASCII"));
                    out.flush();
                    //sending the tblData byte array
                    out.write(tblData);
                    out.flush();
               catch(IOException e)
     public void loadTblList()
          File curDir=new File(System.getProperty("user.dir"));
          //---------------------------- Filtering Directories --------------------------------
          FileFilter dirFilter=new FileFilter()
               public boolean accept(File file)
                    return file.isDirectory();
          File[] dirlist=curDir.listFiles(dirFilter);
          //---------------------------- Filtering Directories end--------------------------          
          //------------ Filtering files ---------------------------------------------------
          FileFilter fileFilter=new FileFilter()
               public boolean accept(File file)
                    return !file.isDirectory();
          File[] filelist=curDir.listFiles(fileFilter);
          //------------ Filtering files end -----------------------------------------------
          ((DefaultTableModel)tblList.getModel()).setNumRows(0);
          if (dirlist.length>0)
               Arrays.sort(dirlist); //sorting dirlist
               String folderImg="";
               String name="";
               String type="DIR";
               String size="";
               String lastModiDate="";
               String fullPath="";
               long longdate;
               Date modiDate;
               Calendar cal;
               for(int i=0;i<dirlist.length;i++)
                    name=dirlist.getName();
                    //------ Calculating Date and Time ------------
                    longdate=dirlist[i].lastModified();
                    modiDate=new Date(longdate);
                    cal=new GregorianCalendar();
                    cal.setTime(modiDate);
                    lastModiDate=cal.get(Calendar.DATE)+"/"+(cal.get(Calendar.MONTH)+1)
                              +"/"+cal.get(Calendar.YEAR);          
                    lastModiDate+=" "+cal.get(Calendar.HOUR)+":"+cal.get(Calendar.MINUTE)+":"
                              +cal.get(Calendar.SECOND);
                    if(cal.get(Calendar.AM_PM)==0)
                         lastModiDate+="AM";
                    else if(cal.get(Calendar.AM_PM)==1)
                         lastModiDate+="PM";     
                    //------- Calculation completed ---------------
                    try
                         fullPath=dirlist[i].getCanonicalPath();
                    catch(IOException e)
                    ((DefaultTableModel)tblList.getModel()).addRow(new Object[]
                    {folderImg,name,type,size,lastModiDate,fullPath
          if (filelist.length>0)
               Arrays.sort(filelist); //sorting filelist
               String fileImg="";
               String name="";
               String type="FILE";
               String size="";
               String lastModiDate="";
               String fullPath="";
               long longdate;
               Date modiDate;
               Calendar cal;
               for(int i=0;i<filelist.length;i++)
                    name=filelist[i].getName();
                    //------ Calculating Date and Time ------------
                    longdate=filelist[i].lastModified();
                    modiDate=new Date(longdate);
                    cal=new GregorianCalendar();
                    cal.setTime(modiDate);
                    lastModiDate=cal.get(Calendar.DATE)+"/"+(cal.get(Calendar.MONTH)+1)
                              +"/"+cal.get(Calendar.YEAR);          
                    lastModiDate+=" "+cal.get(Calendar.HOUR)+":"+cal.get(Calendar.MINUTE)+":"
                              +cal.get(Calendar.SECOND);
                    if(cal.get(Calendar.AM_PM)==0)
                         lastModiDate+="AM";
                    else if(cal.get(Calendar.AM_PM)==1)
                         lastModiDate+="PM";     
                    //------- Calculation completed ---------------
                    //size=(filelist[i].length()/1024f)+" KB";
                    size=filelist[i].length()+" bytes";
                    try
                         fullPath=filelist[i].getCanonicalPath();
                    catch(IOException e)
                    ((DefaultTableModel)tblList.getModel()).addRow(new Object[]
                    {fileImg,name,type,size,lastModiDate,fullPath
     }//end loadTblLocal()
     public static void main(String args[])
          new tblobjSendServer();
class newTableModel extends DefaultTableModel implements Serializable
     public newTableModel(Object[][] data,Object[] columns)
          super(data,columns);
     public boolean isCellEditable(int row,int col)
          return false;
     public Class getColumnClass(int column)
          Vector v=(Vector) dataVector.elementAt(0);
          return v.elementAt(column).getClass();
//end class newTableModel
Client :
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.net.*;
import java.util.*;
class tblobjReceiveClient extends JFrame implements ActionListener
     JTable tblList;
     JButton btnGet;
     public tblobjReceiveClient()
          super("Receive TableModel object from the server");
          //tblList=new JTable(new Object[0][0],colData);
          String[] colNames={"","Name","Type","Size","Date","Path"};
          tblList=new JTable(new newTableModel(new Object[0][0],colNames));
          btnGet=new JButton("Get TableModel");
          btnGet.addActionListener(this);
          Container cpane=getContentPane();
          cpane.add(new JScrollPane(tblList,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS),BorderLayout.CENTER);
          cpane.add(btnGet,BorderLayout.SOUTH);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          setSize(400,300);
          setVisible(true);
     public void actionPerformed(ActionEvent ae)
          if (ae.getSource()==btnGet)
               try
                    Socket theConnection=new Socket("localhost",2000);
                    InputStream rawIn=new BufferedInputStream(theConnection.getInputStream());
                    Reader in=new InputStreamReader(new BufferedInputStream(theConnection.getInputStream()),"ASCII");
                    OutputStream out=new BufferedOutputStream(theConnection.getOutputStream());
                    StringBuffer strbuf=new StringBuffer();
                    int c;
                    while (true)
                         c=in.read();
                         if(c=='\n')
                              break;
                         strbuf.append((char)c);     
                    String msg=strbuf.toString();
                    StringTokenizer st=new StringTokenizer(msg);
                    if (st.hasMoreTokens())
                         String okToken=st.nextToken();
                         if (okToken.equals("OK"))
                              if (st.hasMoreTokens())
                                   String sizeToken=st.nextToken();
                                   int size=0;
                                   try
                                        size=Integer.parseInt(sizeToken);
                                   catch(NumberFormatException nfe)
                                   ByteArrayOutputStream bout=new ByteArrayOutputStream();
                                   c=0;
                                   for(int i=0;i<size;i++)
                                        c=rawIn.read();
                                        bout.write(c);
                                   byte[] tblData=bout.toByteArray();
                                   ObjectInputStream oin=new ObjectInputStream(new ByteArrayInputStream(tblData));
                                   TableModel tblobj=null;
                                   try
                                        tblobj=(TableModel) oin.readObject();
                                   catch(ClassNotFoundException cnfe)
                                        System.out.println("Error occurred while reading the object");
                                   if(tblobj!=null)
                                        tblList.setModel(tblobj);
               catch(IOException ie)
     public static void main(String args[])
          new tblobjReceiveClient();
class newTableModel extends DefaultTableModel implements Serializable
     public newTableModel(Object[][] data,Object[] columns)
          super(data,columns);
     public boolean isCellEditable(int row,int col)
          return false;
     public Class getColumnClass(int column)
          Vector v=(Vector) dataVector.elementAt(0);
          return v.elementAt(column).getClass();
//end class newTableModelNote : I have tested with another simple client-server example which will create and send a simple Student object. It is working fine with different platform.
class Student implements Serializable
     String name,age,city;
     public Student(String name,String age,String city)
          this.name=name;
          this.age=age;
          this.city=city;
     public String toString()
          return "Name : "+name+"\nAge : "+age+"\nCity : "+city;
}Thank You.

Similar Messages

  • External Hard Drive  Formatting  For Cross Platform File Sharing

    I have been doing some research on formatting options that can read/write both OSX and Win7. Someone recommended that I use UDF. I'm curious hearing from the apple community whether there are any downsides to choosing this formatting method. Are there any other better ones to use? Thanks

    Best I can tell, UDF is for DVDs and CDs, not HDDs.
    If you want a compatible format for Mac and Windows on a HDD, FAT 32 or ExFAT will fit the bill.  Fat32 does have a 4 GB file size limitation.  It is best to format these on a PC.
    You can use NTFS, but then you need third party software such as Paragon or Tuxere in order to write to the HDD.
    Ciao.

  • Cross-origin resource sharing (CORS) does not work in Firefox 13.0.1 or 6.0.2

    I have a simple Java HttpServlet and a simple JSP page. They are both served by a WebSphere Application Server at port 80 on my local host. I have created a TCP/IP Monitor at port 8081 in
    Eclipse IDE so as to create a second origin. The protocol output further down comes from this monitor. This should work equally well on a simple Tomcat server.
    When I perform the cross-origin resource sharing test, I see that all of the correct TCP data is exchanged between Firefox and the web server (i.e. HTTP OPTIONS and its response followed by an HTTP POST and its response) but the data in the body of the POST response is never passed to the XMLHttpRequest javascript object's responseText or responseXML variables and I get a status equal to 0. If I click the button while pressing the keyboard control key then the test will work as it will not be performed as a cross-origin request.
    Here are all of the files used in this test:
    Servlet Cors.java
    <pre><nowiki>--------------------------------------------------------------------------------------
    package example.cors;
    import java.io.IOException;
    import java.util.Enumeration;
    import javax.servlet.Servlet;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * Servlet implementation class Cors
    public class Cors extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private static final String APPLICATION_XML_VALUE = "application/xml";
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request, response); // do the same as on the post
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setBufferSize(1024);
    response.setContentType(APPLICATION_XML_VALUE);
    response.setStatus(HttpServletResponse.SC_OK);
    String xml="<?xml version=\"1.0\"?>\n<hello>This is a wrapped message</hello>";
    response.setContentLength(xml.length());
    response.getWriter().append(xml);
    response.getWriter().close();
    * @see HttpServlet#doOptions(HttpServletRequest, HttpServletResponse)
    @SuppressWarnings("unchecked")
    protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Enumeration<String> headers=request.getHeaders("Origin");
    StringBuffer sb=new StringBuffer();
    while (headers.hasMoreElements()) {
    String o=headers.nextElement();
    if (sb.length()!=0) sb.append(", ");
    System.err.println("Origin= "+o);
    sb.append(o);
    response.addHeader("Access-Control-Allow-Origin", sb.toString());
    response.addHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");
    sb=new StringBuffer();
    headers=request.getHeaders("Access-Control-Request-Headers");
    while (headers.hasMoreElements()) {
    String o=headers.nextElement();
    if (sb.length()!=0) sb.append(", ");
    System.err.println("Access-Control-Request-Headers= "+o);
    sb.append(o);
    response.addHeader("Access-Control-Allow-Headers", sb.toString().toUpperCase());
    response.addHeader("Access-Control-Max-Age", Integer.toString(60*60)); // 1 hour
    response.addHeader("Content-Type","text/plain");
    response.addHeader("Allow", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS");
    response.getWriter().print("");
    And a simple JSP page test.jsp:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <%
    String url ="http://localhost:8081/cors/ping";
    String url_ctrl="http://localhost/cors/ping";
    %>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Test CORS</title>
    <script type="text/javascript">
    var invocation;
    var method='POST';
    var body = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><hello>Today</hello>";
    var buttontest2_label="Direct AJAX call";
    function callOtherDomain(event){
    invocation = new XMLHttpRequest();
    if(invocation) {
    var resultNode = document.getElementById("buttonResultNode");
    var resultMessage = document.getElementById("buttonMessageNode");
    resultNode.innerHTML = "";
    document.getElementById("buttontest2").value="Waiting response...";
    var url
    if (event.ctrlKey) url="<%=url_ctrl%>";
    else url="<%=url%>";
    resultMessage.innerHTML = "Sending "+method+" to URL: "+url;
    invocation.open(method, url, true);
    // invocation.withCredentials = "true";
    invocation.setRequestHeader('X-PINGOTHER', 'pingpong');
    invocation.setRequestHeader('Content-Type', 'application/xml');
    invocation.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
    invocation.onerror = function(errorObject) {
    display_progress(resultMessage, "***** error occured=" +errorObject);
    invocation.onreadystatechange = function() {
    display_progress(resultMessage, "onreadystatechange="+invocation.readyState+", status="+invocation.status+", statusText="+invocation.statusText);
    if(invocation.readyState == 4){
    document.getElementById("buttontest2").value=buttontest2_label;
    display_progress(resultMessage, "responseText="+invocation.responseText);
    resultNode.innerHTML = "Response from web service='"+invocation.responseText+"'";
    invocation.send(body);
    function display_progress(node, message) {
    node.innerHTML = node.innerHTML + "<br>" + message;
    </script>
    </head>
    <body>
    <p>The button will create a cross site request (Use the control key to disable this, i.e. no cross site request)</p>
    <p><input type="button" id="buttontest2" onclick="callOtherDomain(event)" name="buttontest2" value="Waiting for page load..."></p>
    <p id="buttonMessageNode"></p>
    <p id="buttonResultNode"></p>
    <script type="text/javascript">
    document.getElementById("buttontest2").value=buttontest2_label;
    </script>
    </body>
    </html>
    When I click on the Direct AJAX call button, I get the following output on my page:
    The button will create a cross site request (Use the control key to disable this, i.e. no cross site request)
    Sending POST to URL: http://localhost:8081/cors/ping
    onreadystatechange=2, status=0, statusText=
    onreadystatechange=4, status=0, statusText=
    responseText=
    ***** error occured=[object ProgressEvent]
    Response from web service=''
    Here is the HTTP traffic produced:
    HTTP REQUEST
    OPTIONS /cors/ping HTTP/1.1
    Host: localhost:8081
    User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Origin: http://localhost
    Access-Control-Request-Method: POST
    Access-Control-Request-Headers: content-type,x-pingother,x-requested-with
    Pragma: no-cache
    Cache-Control: no-cache
    POST /cors/ping HTTP/1.1
    Host: localhost:8081
    User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    X-PINGOTHER: pingpong
    Content-Type: application/xml; charset=UTF-8
    X-Requested-With: XMLHttpRequest
    Referer: http://localhost/cors/client/test.jsp
    Content-Length: 75
    Origin: http://localhost
    Pragma: no-cache
    Cache-Control: no-cache
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><hello>Today</hello>
    HTTP RESPONSE
    HTTP/1.1 200 OK
    Access-Control-Allow-Origin: http://localhost
    Access-Control-Allow-Methods: POST, GET, OPTIONS
    Access-Control-Allow-Headers: CONTENT-TYPE,X-PINGOTHER,X-REQUESTED-WITH
    Access-Control-Max-Age: 3600
    Content-Type: text/plain;charset=ISO-8859-1
    Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS
    Content-Language: en-CA
    Content-Length: 0
    Date: Wed, 11 Jul 2012 17:50:10 GMT
    Server: WebSphere Application Server/7.0
    HTTP/1.1 200 OK
    Content-Type: application/xml
    Content-Length: 62
    Content-Language: en-CA
    Date: Wed, 11 Jul 2012 17:50:10 GMT
    Server: WebSphere Application Server/7.0
    <?xml version="1.0"?>
    <hello>This is a wrapped message</hello>
    --------------------------------------------------------------------------------------</nowiki></pre>

    No errors in error console. No effect using *. I tried using the dns name of my localhost both in the Firefox URL and in the javascript and I get exactly the same. I have spent a huge amount of time looking into this issue.
    One thing I noticed is that if I use the examples on the internet (http://arunranga.com/examples/access-control/preflightInvocation.html or http://saltybeagle.com/cors/) they work in the same browser. These examples however, are accessed through HTTP proxies.
    I am wondering if the issue has to do with using the same hostname just with different ports.

  • DW CS3 cross-platform check in/out file locking

    Here is my setup:
    * Apple X-Serve file server (as a mapped drive on several
    Windows XPsp2
    machines and a shared drive on one Mac 10.4)
    * Up-to-date Dreamweaver CS3 on every machine (3 windows, 1
    mac)
    * Enable file check in and check out (site preference for all
    installations)
    * Contribute compatibility (site preference for all
    installations)
    The problem is that when a file is checked in on the mac, the
    file becomes
    locked such that the windows machines can't check out the
    file. All of the
    windows machines check out and check in files with no problem
    if the mac hasn't
    touched them. Once the mac has checked in a file, I have to
    "unlock" the file
    via the right-click context menu on the file. (This unlock is
    called "Turn off
    Read Only" on the windows version.)
    Windows FTP Log on check out after mac check in:
    /.../public_html/help/faq.php - locked
    /.../public_html/help/faq.php - error occurred - An FTP error
    occurred -
    cannot get faq.php.
    /.../public_html/help/faq.php - unlocked
    Apparently the Mac DW CS3 version of "Check in" and the
    Windows DW CS3 version
    of "Check in" are different and incompatible. Has anyone else
    had this problem
    or know of a solution? Removing the Mac is not an option.
    This may or may not be related, but whenever a file is opened
    on the operating
    system other than last edited (mac opens windows edited file
    or windows opens
    mac edited file), the "Overwrite local copy" dialog shows up
    when checking out
    a file. When a compare is made of the server/local files,
    there are no changes.
    Both mac and windows have the same line ending settings in
    the preferences.
    http://www.hostingforum.ca/700363-cs3-cross-platform-check-out-file-locking.html
    I'm having exactly the same issue. Has anyone experienced
    this before, and if so have a solution?
    Thanks in advance!

    In your Site definition, you need to specify the Remote Info
    of your
    server, and then "Enable file checkin and checkout".
    HTH,
    Randy
    djdeel wrote:
    > I am unable to check out a file using the context menu
    when right clicking on the file.

  • Is InDesign SDK (CS4) cross platform

    Hi
    I am newbie to Adobe SDK and had a quick question.
    I remember reading in some documentation that Adobe SDK CS4 is "almost" cross platform. I am wondering if anyone here has experience with both windows and mac development to mention if that is the case or if there is some big differences. Also  I am wondering if to use InDesign SDK on Mac would I need to use objective C or would C++ work fine. Is using the SDK on Mac as simple as simplying copying the C++ files from windows and doing minor tweaks to them to compile?
    thanks
    Sam

    Hi
    Your source is the same for Windows and MAC
    The only difference is the compiler.
    Meaning if you are using source control, you can check out the same source om both Windows and Mac
    When dealing with files and Strings there are functions that only exist on Windows and some only on MAC
    But it's pretty straight forward....
    Of cource you have to download the SDK for both platforms

  • Migrating Cross-Platform Database ???

    Hi Expert !!
    We have a requirement to move huge database from HP to AIX. The database size is big so we cannot opt exp/imp. The only option left is Transport Tablespace.
    I did search on net and in oracle documentation for a sample example (moving entire database) but couldn't find one. Could any one please forward a link which discusses this in detail?
    Also to note is that, we have a Data Guard configuration in place for this database. How do we move both Primary and Physical Standby from HP to AIX?
    Thanks for sharing your experience.
    Regards

    You could check this document,
    http://www.emc.com/techlib/abstract.jsp?id=1774
    Cross-Platform Oracle Database Migration Using Transportable Tablespaces
    Since you are moving from HP to AIX, endianess seems not a concern, but you still need to make sure tablespaces are self-contained,
    EXEC DBMS_TTS.TRANSPORT_SET_CHECK('TSNAME','TRUE');

  • Will �cross platform app� run on one platform?

    Hi there,
    please forgive my stupidity but if I have a J2ME app which contains one function calling functions from Blackberry library. Can this app be installed and run ok on non Blackberry phones, such as Nokia (suppose that Blackberry related code will not be called under this non-Blackberry phone), within Nokia emulator environment, or real Nokia phones?
    It would be much appreciated if someone could shed some light here so that my time and effort to try it out could be saved.
    Many thanks in advance,
    qmei from London

    Here, let me actually be helpfull...
    It depends on the phone.
    To be able to use the exact same app in multiple devices, when some are calling device specific code is possible, but it really does depend on a few factors...
    1) You must not ever reference or instantiate any classes that import the device specific libraries. If any such classes are referenced directly in your application, the offending class will be loaded into memory, at which point the device's VM will notice that it's trying to reference a library that it doesn't recognize, and likely crash out.
    2) You must only load such offending classes by name, and even then, there must only reference offending classes through an interface. So if you have a canvas class that imports nokia libraries, as well as other canvas classes that import other manufacturer libraries, you must make them all implement the same interface, and do something like this...
    try{
    Class cls = Class.forName("com.nokia.mid.ui.FullCanvas");
    cls = Class.forName("NokiaGameScreen");
    Object o = (cls.newInstance());
    gameScreen = (GameScreen)o;
    gameScreen.init(this);
    }catch(Exception e){
    //cant' use nokia!
    //try another manufacturer...
    }... so I'll explain in greater detail...
    1) Class cls = Class.forName("com.nokia.mid.ui.FullCanvas");This line with throw an exception if no class matches the supplied argument. Generally you'd do something like this to check for the existance of one of the classes you intend to import. If this line does not throw an Exception, than instantiating the desired display should be fine. In this case, if we don't throws an Exception, we can be sure that we are running on a Nokia device.
    2) cls = Class.forName("NokiaGameScreen");This line actually grabbs the class you intend to instantiate, which contains the offending import. Only when we reach this point does the VM load the class into memory, and validate it's imports. We have already determined that we are running on a Nokia device from the previous line.
    3) Object o = (cls.newInstance()); Get an instance of the desired class.
    4) gameScreen = (GameScreen)o;gameScreen is of the type 'GameScreen', which is an interface I defined and is implemented by all of my different manufacturer/device specific Canvas's.
    5) gameScreen.init(this);I am simply calling the 'public void init(Midlet)' function I created that is exposed through my 'GameScreen' interface.
    As you can see in the above example, I never directly reference the 'NokiaGameScreen' class, and instead indirectly reference it through an interface it's implementing called 'GameScreen'.
    This type of 'cross platform' coding works well on many, but not all devices. It's a headache, but some devices go through the entire .jar file and validate each and every .class file during the installation process. These annoying phones will cancel the install if they find any imports that are not recognized. So even if the class is simply accidentally left in the .jar, with no possible way to ever load or instantiate it, the device may decide it won't let you run or install.
    Because of the problem devices, I always create a separate build for each manufacturer, and exclude the other manufacturer's classes from the build entirely.
    Message was edited by:
    hooble

  • JavaCard Secure Object Sharing

    I'm facing problem on passing object as parameter between server and client applet. Does anybody know how to overcome the above problems?

    If client applet and server applet belong to the same package,
    they can "share" an object or array via a class variable (keyword: static)
    because they belong to the same context.
    Otherwise, using javacard.framework.Shareable you can provide
    methods for transfering the data.
    By the way, I don't think there are security issues using the global
    APDU buffer.
    JC 2.2.1, Chapter 6 Applet Isolation and Object Sharing, p. 33:
    "Note � Because of the global status of the APDU buffer, the Application
    Programming Interface for the Java Card� Platform, Version 2.2.1 specifies that this
    buffer is cleared to zeroes whenever an applet is selected, before the Java Card RE
    accepts a new APDU command. This is to prevent an applet�s potentially sensitive
    data from being �leaked� to another applet via the global APDU buffer. The APDU
    buffer can be accessed from a shared interface object context and is suitable for
    passing data across different contexts. The applet is responsible for protecting
    secret data that may be accessed from the APDU buffer."
    How would you interpret this quote?

  • Data Movement in Cross Platform

    Hi,
    Greeting!..
    My scenario is
    Host A - Hp-Unix
    Host B - Window 2003 Server
    1. Is the datapump dump file which is created in Host A can be import in Host B? is it so please forward the steps
    2. from Host A to Host B in need to transfer the data incrementally & regularly. How can i make this as automatic?
    Thanks in Advance
    Baalaji V

    Hi Balaji,
    Yes you can import dump on cross-platform but you may need to check syntax in the Database Utilities guide available on Oracle Technology network. Here is direct lik http://www.oracle.com/pls/db112/to_toc?pathname=server.112%2Fe16536%2Ftoc.htm&remark=portal+%28Books%29
    You can create and schedule two jobs in OEM. First job to export you source schema on predefine interval and store dump file on a shared locaiton that host b can access as well then next job will import that dump file into host b database.
    If your purpose is to replicate data regularly then you should also look using streams.
    Harish Kumar
    http://www.oraxperts.com

  • Webinar (Aug 11): How to create Cross-Platform Automated GUI Tests for Java Apps

    Join Squish expert, Amanda Burma, and learn how to create cross-platform automated GUI tests for your Java applications!
    Register here (multiple time slots)
    August 11th 2014
    Duration: 30 minutes plus Q & A
    This webinar will cover:
    General Squish for Java overview
    Automating BDD Scenarios
    Executing Cross-Platform Automated GUI Tests
    Interacting with Java application objects, properties & API
    See you there!
    Unable to attend? Register and we'll send links to future events and access to our webinar archive following the event.
    Webinar schedule
    Learn more about Squish
    Evaluate froglogic squish

    <property name="messaging.client.jar.path" value="Location in your local drive" />
    <property name="messaging.client.jar.name" value="nameOfYourFile.jar" />

  • "Can Grow" property on Cross-Tab object can not be unlock

    I am using Crystal Reports XI.  My report uses a Cross-Tab object via SQL server.  I am having problem making my data column (Field Row) to increase dynamically in height when my data size increases.  Since the "Can Grow" property in the Format Editor is locked, it would not let me set the "Can Grow" to true to enable this function.  How do I unlock the "Can Grow" function so I can set it to true?

    The only other option I can think of would be to build a virtual cross tab, but in many cases, especially when the number of 'column' values is dynamic, this is not possible.

  • Cross platform CS on PC to CS3 on Mac does not work like video says

    Your video on cross platform workflow states that you can import older Premier CS files on a PC into CS3 on a Mac. I tried this and get the message, "this project was saved in a aversion prior to Adobe Premiere Pro CS3 and cannot be opened on a Mac. Please refer to the User Guide for import options." I guess I have to assume then that the video, www.adobe.com/go/vid0236, is wrong about this? Can someone please explain how I can salvage the work I did 3 years ago on Premiere Pro 1 on a PC when I am now exclusively working on the Mac in CS3?
    Thank you.

    Ty,
    This has come up a few times and the solution is to find a PC CS3 user, who will Open the Project and then Save it in CS3-CS4 for you. I does mean that you'll have to befriend a PC-person, but who knows, maybe you can reciprocate later on. In each previous instance, this workflow, PC to PC to Mac worked perfectly. Note: the same holds for Encore Projects, and there is some PC to PC incompatibilities between very early versions and later versions. I had to Open and Save an Enocre 1.0 Project in CS2, so a CS4 (only) user could then Open in CS4. This stuff happens, and the skip in Mac porting can play a role in it. If I had CS3 on my PC's, I'd do it for you, but CS2 will not hlep you.
    I believe that P 6.5 was the last previous version ported for the Mac, until CS3.
    Good luck,
    Hunt

  • Need Help in Cross Platform Migration

    Hi Gurus,
    can you please tell me best way to do Corss Platform Migration with minimum down time and we are planning to do from AIX TO HP-UX.
    oracle version is 10g
    and can we do the data sync using streems if it is can you give the steps to configure streems in cross platform.
    Thanks in advance.

    High Availability Customer Case Studies, Presentations, Profiles, Analyst Reports, and Press Releases
    [http://www.oracle.com/technology/deploy/availability/htdocs/HA_CaseStudies.html?_template=/ocom/print]
    Check under Transportable Tablespace at the bottom
    [Multi Terabyte Database Migration|http://www.oracle.com/technology/deploy/availability/pdf/TheHartfordProfile_XTTS.pdf]
    HTH
    Anantha

  • External Hard Drive won't appear on PC (want cross platform)

    I have an external USB Hard Drive. I formatted it using the Disk Utility, OS Format and Journaling. Did a small partition in case I needed a system boot drive. Now my sis needed to backup her laptop (Dell laptop), but the drive won't appear in My Computer, it recognizes there is a USB device on the lower task bar, but no drive anywhere.
    Do I have to reformat? what steps do I need to make this USB drive cross-platform friendly?
    Paul

    Hi, Paul.
    You may not want to reformat the drive as FAT-32 since there is a limit on the size of the partition, the maximum file size, and other issues, especially if her Dell's drive is formatted as NTFS (FAT-32 does not support NTFS extended attributes). FAT-32 is unsuitable for backing-up Mac OS X volumes as it cannot preserve the extended attributes (permissions, etc.) employed by Mac OS X.
    It's really best if you each have your own external hard drive for backup, as part of implementing a comprehensive Backup and Recovery solution, such as I use and detail in my "Backup and Recovery" FAQ. You also don't want one person inadvertently writing over another person's backups, which could happen if one is not careful. Furthermore, it is often easiest for recovery.
    How one handles backup in cross-platform environments is tricky and depends on the native formats employed by the different computers involved, and whether backup will be performed over a network or by directly connecting backup drives to the computers one is backing up.
    To enable her Dell to use the Mac-formatted drive, install Mediafour's MacDrive for Windows on the PC. MacDrive for Windows is probably the state-of-the-art application for enabling you to use Mac-formatted disks and hard drives on Windows-based PCs.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Steps to create Cross-Platform Transportable Tablespaces

    hi
    what is the steps to do Cross-Platform Transportable Tablespaces.
    i want to perform this in my pc, i have linux and windows in same PC, i want to migrate from linux to windows and vice versa.
    so can i know complete steps and commands to perform Cross-Platform Transportable Tablespaces. to get complete knowledge i am doing this so i can implement this in my office when any migrate issues comes. so once i do this i will get confidence so that i can do the same in my office which saves my time.
    veeresh s
    oracle-dba
    [email protected]

    Hi, also you can review the Note:413586.1 into metalink site.
    Good luck.
    Regards.

Maybe you are looking for

  • I lost all my pictures in Aperture and I used Time Machine to restore the lost pictures.

    After losing all my pictures on Aperture and not being able to restore the the pictures using Time Machine as instructed by Apple Care.  I searched the web on how to restore the pictures using Time Machine and did not find a good solution.  So with t

  • Why are my photos different from originals in iPhoto 9.5.1?

    Hi I import photos from my iPhone 5S, if I then hit 'revert to original' in 'Edit' mode they look very different? Why is this? Is the iPhone or iPhoto adding certain qualities before I have done anything myself? I want to use the photos for a website

  • No HP programs loaded in my HP all in one computer

    Have a HP Touchsmart Desktop All in One Computer--computer crashed and I ran HP Factory Retore--Computer is now working just fine but there are no HP programs installed on my computer now--How do I get HP programs back into my computer?  My OS is Win

  • Following upgrade to 7, calendar does not synchronise?

    Appointments put in on the iPad are 'pink' and do not sync with my laptop calendar for example....  frustrating!  They do sync the other way round.. What am I doing wrong please? A

  • Using DHCP Airport Extreme WRONG IP ADDY

    I connect my modem directly to my computer and the internet works perfectly. I try and use my Airport Extreme using DHCP and my Airport Extreme ALWAYS automatically picks an INVALID IP address. I have no idea why the Airport Extreme is doing this.