GetResources() gives null's after using RMI (ClassLoader problem???)

Hi
I have just put RMI into my app and it works fine, connects to a remote server, runs a method on the server and returns the results.
The problem is when I try to use a line like:
URL url = MyClass.class.getResources("image/save.gif");
The url is null. This code will work before my RMI function is run. Also, every dialog the application opens after running RMI has a line at the top of the pane saying: "Java Applet Window".
Is RMI playing with the Classloader?
Do I have to instaniate the ClassLoader or do something else to get my resources again and get rid of the text on each of the dialog boxes???
Thanks in advance.

if your class is Remote object, you use the RMI CLassLoader when you do:
URL url = MyClass.class.getResources("image/save.gif");you shoud use instead:
URL url = Classloader.getSystemResources("image/save.gif");

Similar Messages

  • RMI classloading mechanism:unable to bind an object

    hai all,
    I am facing a problem when i use rmi classloading mechanism.
    I am using suns ClassFileServer to load classes dynamiclly into my server and client.
    In my server i want to load the class and and get a static object of the same class and bind it to registry so that clents can access it.
    but i am unable to do that.
    I have a doubt regarding what happens to the static variables when class loading is done.

    I am posting my validateImpl and DynamicServer here .please look into it
    validateImpl.java:
    import java.io.FileInputStream;
    import java.io.PrintStream;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.util.*;
    public class validateImpl extends UnicastRemoteObject
    implements validate
    public static validateImpl getInstance()
    return validateInst;
    public validateImpl()
    throws RemoteException
    System.out.println("Inside validateimpl constructor");
    try
    Naming.rebind(new String("myserverObj"), this);
    catch(Exception exception)
    System.out.println("Exception occurred: " + exception);
    public boolean validateUser(String s, String s1)
    System.out.println("user name"+s);
    String s2 = propFile.getProperty(s);
    System.out.println("from records /t"+s2);
    if(s2 == null)
    String s3 = " User Name: " + s + " is Not Configured \n";
    System.out.println("username not found");
    StringTokenizer stringtokenizer = new StringTokenizer(s2, "~");
    PFusername = (String)stringtokenizer.nextElement();
    PFpassword = (String)stringtokenizer.nextElement();
    return PFusername.equals(s) && PFpassword.equals(s1);
    private static Hashtable cache;
    private static String PFusername;
    private static String PFpassword;
    private static Properties propFile;
    private static validateImpl validateInst;
    static
    propFile = new Properties();
    try
         System.out.println("In Static Block");
    validateInst = new validateImpl();
    propFile.load(new FileInputStream("usersandpasswords.properties"));
    catch(Exception exception)
    System.out.println("Exception in creating an instance" + exception);
    DynamicServer.java
    import java.rmi.Naming;
    import java.rmi.Remote;
    import java.rmi.RMISecurityManager;
    import java.rmi.server.RMIClassLoader;
    import java.util.Properties;
    public class DynamicServer {
    public static void main(String args[]) {
    // Create and install a security manager
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    Properties p = System.getProperties();
    String url = p.getProperty("java.rmi.server.codebase");
    Class serverclass = RMIClassLoader.loadClass(url, "validateImpl");
    Naming.rebind("/myserverObj", (Remote)serverclass.newInstance());
    /*here is the problem.instead of creating a newInstance i want to bind thevalidateinstance in validateImpl class to be bound to the registry.
    but how can i access it.*/
    System.out.println("HelloServer bound in registry");
    } catch (Exception e) {
    System.out.println(e);
    }

  • Should may application use RMI?

    Here is the client of a news ticker i have produced. i wish to use client/ server to some how update the news items the client displays. At the moment i am 80% into implementing sockets but with further research am now considering RMI. My only problem is that i have around 2 weeks till my deadline so will not pursue this if it is too much work.
    i am using a 2d array in the client code that holds he news item title and URL. Would the RMI server hold this array instead and the client ask for this information at fixed intervals?
    help would be greatly appreciated.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    import java.io.*;
    public class Test7 extends JFrame
      private JFrame tickerFrame;
      private JPanel tickerpanel,stocktickerpanel;
      private JTextField displayArea;
      //private Socket client;
      //private String NewsServer;
      private ObjectOutputStream output;
      private ObjectInputStream input;
            public Test7 ()
                    super("client");
                    tickerFrame = new JFrame("Notification Ticker");
                    tickerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    tickerFrame.setSize(new Dimension(100, 100));
                    displayArea = new JTextField();
                    tickerFrame.getContentPane().add(new JScrollPane( displayArea ), BorderLayout.NORTH );
                    tickerFrame.getContentPane().add(new Marquee( getTexts() ), BorderLayout.CENTER);
                    tickerFrame.getContentPane().add(new Stock( getStocks() ), BorderLayout.SOUTH);
                    tickerFrame.pack();
                    tickerFrame.setVisible(true);
                    //stocktickerpanel = new JPanel ();
                    //stockpanel.setSize (stockpanel.getPreferredSize ());
                    //add (stockpanel);
            public String[][] getStocks ()
              return new String[][]
                  {"BARC", "+2.1"},
                  {"PFC", "0.5"},
                  {"HDF", "-3.2"},
                  {"DDF", "+3.8"}
            public String[][] getTexts ()
                    return new String[][]
                            {"National","This is a national headline", "http://news.bbc.co.uk/1/hi/world/middle_east/3665775.stm"},
                            {"Busines","This is a business headline", "http://news.bbc.co.uk/1/hi/business/3665193.stm"},
                            {"Political","Here is a political headline", "http://news.bbc.co.uk/1/hi/uk_politics/3697675.stm"},
                            {"Enterainment","Entertainment headline here", "http://news.bbc.co.uk/1/hi/entertainment/music/3665545.stm"}
           private class Stock extends JPanel
                   private boolean paused;
                   public Stock (String[][] stocks)
                            MouseListener listener = new MouseAdapter ()
                                    public void mouseEntered (MouseEvent event)
                                            paused = true;
                                    public void mouseExited (MouseEvent event)
                                            paused = false;
                            addMouseListener (listener);
                            stocktickerpanel = new JPanel ();
                            stocktickerpanel.addMouseListener (listener);
                            for( int i = 0; i < stocks.length;  i ++ )
                                    if( i > 0 )
                                            stocktickerpanel.add (Box.createHorizontalStrut (20));
                                    }StockDisp stck = new StockDisp (stocks[0],stocks[i][1]);
    stck.addMouseListener (listener);
    stocktickerpanel.add (stck);
    add (stocktickerpanel);
    paused = false;
    new Thread (new Runnable ()
    public void run ()
    while( true )
    if( ! paused )
    int x = stocktickerpanel.getX () - 1;
    if( x < -stocktickerpanel.getWidth () )
    x = getWidth ();
    stocktickerpanel.setLocation (x, 0);
    }try
    Thread.sleep (22);
    catch( InterruptedException exception )
    }).start ();
    private class StockDisp extends JLabel
    URL url;
    public StockDisp (String name, final String price)
    setText ("<html><u>"+ name +(" : ") + price + "</u></html>");
    setForeground (Color.RED);
    addMouseListener (new MouseAdapter ()
    private class Marquee extends JPanel
    {              //private JPanel panel;
    private boolean paused;
    public Marquee (String[][] texts)
    MouseListener listener = new MouseAdapter ()
    public void mouseEntered (MouseEvent event)
    paused = true;
    setCursor( Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    public void mouseExited (MouseEvent event)
    paused = false;
    addMouseListener (listener);
    tickerpanel = new JPanel ();
    tickerpanel.addMouseListener (listener);
    for( int i = 0; i < texts.length; i ++ )
    if( i > 0 )
    tickerpanel.add (Box.createHorizontalStrut (20));
    }Link link = new Link (texts[i][0],texts[i][1],texts[i][2]);
    link.addMouseListener (listener);
    tickerpanel.add (link);
    tickerpanel.setLocation (0, 0);
    tickerpanel.setSize (tickerpanel.getPreferredSize ());
    add (tickerpanel);
    paused = false;
    new Thread (new Runnable ()
    public void run ()
    while( true )
    if( ! paused )
    int x = tickerpanel.getX () - 1;
    if( x < -tickerpanel.getWidth () )
    x = getWidth ();
    tickerpanel.setLocation (x, 0);
    }try
    Thread.sleep (30);
    catch( InterruptedException exception )
    }).start ();
    public Dimension getPreferredSize ()
    Dimension preferredSizeOfPanel = tickerpanel.getPreferredSize ();
    return new Dimension (preferredSizeOfPanel.width / 2, preferredSizeOfPanel.height);
    private class Link extends JLabel
    URL url;
    public Link (String type,String text, final String surl)
    setText ("<html>"+ type +(" : ") + text + "</html>");
    setForeground (Color.BLUE);
    addMouseListener (new MouseAdapter ()
    public void mouseClicked (MouseEvent event)
    {                                   //System.out.println (text);
    try
    url = new URL( surl );
    catch( MalformedURLException e )
    //System.out.println (url);
    //BrowserControl.displayURL(text);
    BrowserControl.displayURL(surl);
    private static void createAndShowGUI()
    {        //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    Test7 ticker = new Test7();
    //ticker.runClient();
    public static void main(String[] args)
    //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();

    Yeah, I would say you could use RMI no problem. You might use UDP if you need more speed, but RMI is fine and will gaurantee message delivery. You could just use JMS or messaging I suppose, or even JMX, or other of a million possible solutions.
    I guess I'd do it like this:
    Central data (network/data model) is on some server.
    When data changes on the server, push out to client (multicast if needed?)
    How and what you push (the data) depends on how much data needs to be sent and how often

  • How to make a Struts message null after used in JSP?

    Hi,
    In the context of Struts/JSP,
    An action class might write error messages by
    ActionError msg = new ActionError("msg.request.something");
    ActionErrors msgs = new ActionErrors();
    msgs.add(ActionErrors.GLOBAL_ERROR,msg);
    saveErrors(request,msgs);
    This message will produce a popup modal window by the following JSP code:
    <logic:messagesPresent>
    <html:messages id="error">
    <!--<li class="infomsg"><bean:write name="error"/></li> -->
    <script>javascript:alert('<%=error%>')</script>
    </html:messages>
    </logic:messagesPresent>
    The problem is that this JSP page is shared by serveral actions: when another action invoke this page again, the previous error message will take effect again.
    So my question is how to make message null after used once by its author.
    Thx.
    PY

    msgs = null;

  • Exception when using RMI in tomcat 5.5, after reloading webapp

    When I freshly start tomcat and deploy my web app, I can use RMI by creating a local registry and binding my objects.
    However, as soon as I reload the web application, RMI no longer works and gives me this exception:
    RMI error: error unmarshalling return; nested exception is:
            java.io.EOFException
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.io.EOFException
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
            at java.rmi.Naming.lookup(Naming.java:84)
            at nl.heliotrope.tropebiz.tools.NutchRestarter.main(NutchRestarter.java:33)
    Caused by: java.io.EOFException
            at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2498)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1273)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
            at sun.rmi.server.MarshalInputStream.readLocation(MarshalInputStream.java:285)
            at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:167)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1544)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
            ... 3 moreThe code to register my RMI object:
            logger.debug("Setting up RMI");
            //bind remote manager object to rmi resource
            RemoteManager remoteManager = new RemoteManager();
            try {
                Naming.rebind(rmiResource, remoteManager);
            } catch (MalformedURLException e) {
                throw new RuntimeException("Cannot happen: " + e.getMessage());
            } catch (RemoteException e) {
                /* perhaps the registry was not started yet? Attempt.
                 * Cannot create registry automatically at web application startup,
                 * because another app may have done so already.
                logger.debug("Error registering remote manager to RMI, " +
                        "service not running? Starting the registry.");
                try {
                    LocateRegistry.createRegistry(1099);
                    Naming.rebind(rmiResource, remoteManager);
                    logger.debug("RMI Registry started and remote manager registered");
                } catch (RemoteException e2) {
                    logger.error("Failed to start RMI registry or register RemoteManager!");
                    throw new RemoteException("rebind: " + e2.getMessage());
                } catch (MalformedURLException e2) {
                    throw new RuntimeException("Cannot happen: " + e.getMessage());
            logger.debug("RMI set up successfully");And client code:
                IRemoteManager remoteManager = (IRemoteManager)Naming.lookup(RemoteManager
                        .getRMIResource("127.0.0.1", 1099));Trying set a RMISecurityManager breaks tomcat horribly by the way, but since RMI works with a fresh tomcat startup, I suppose there's no problems there.

    Hi all!
    I get the same Exception using Tomcat 5.5. When registering an object outside tomcat lookup works fine. Only when registering an object inside a webapp!
    Would be great if anyone got a tip to solve it!
    Greetings...

  • My keyboard freezes after using the option key... what gives?

    I have a 17" MacBookPro with OSX 10.6.8
    The problem:   My keyboard key freeze after using the " option key"  in Photoshop or  when downloading a file using the option key.
    I can usually use it 2 or 3 times before it makes a chirping cricket like sound… then my keys freeze up.? The only way to correct it is to restart.
    Anyone else have or had this issue?   it's frustrating.  What's the deal?

    hausman wrote:
    tianmiao0304 wrote:
    Thanks for your explanation!
    Can I just bring my laptop to the nearest service center and get this problem solved directly? You know, usually it will takes several days to receive the backup keyborad, I can't wait
    You'll have to phone the service center and ask. (When I lived not far from Lenovo's Canadian service center and wanted to bring in a ThinkPad for warranty repair they said that would be OK with them but my unit would be put on a queue the same as if I'd shipped it in. They simply didn't offer walk-in, while you wait service.)
    In the interim it may or may not be possible to reattach the key, even just temporarily, depending on whether it wasn't put on properly at the factory or if it's physically broken in some way. Or you could use an external keyboard until Lenovo sends you a replacement, etc.
    I've just call the local service center, he told me that he can not repair individual key, they can just replace the whole keyboard..... How bad luck I am!!!

  • Remote Browsing using RMI

    Hi,
    Read a lot of forums about how to create a Remote file browser using RMI and JFileChooser.
    Not done any RMI coding I thought I'd give it a try. I have finally after 2 days managed to do it.
    This is an overview.
    Create a RemoteFile class that extends Remote.. eg.
    import java.rmi.*;
    import java.io.*;
    import java.net.*;
    public interface RemoteFile extends Remote {
        public boolean canRead() throws RemoteException;
        public boolean canWrite() throws RemoteException;
        public int compareTo(File pathname) throws RemoteException;etc.etc
    Then create an implementation class...
    import java.rmi.server.*;
    import java.io.*;
    import java.net.*;
    public class RemoteFileImpl extends UnicastRemoteObject implements RemoteFile {
        private File f;
        public RemoteFileImpl(File sf) throws java.rmi.RemoteException {
            f=sf;
        public boolean canRead() throws java.rmi.RemoteException {
            return f.canRead();
        }etc etc for all other File functions.
    Then we create a RemoteFileSystemView interface, again extending remote...
    public interface RemoteFileSystemView extends Remote {
        public RemoteFile createFileObject(File dir, String filename) throws RemoteException;
        public RemoteFile createFileObject(String path) throws RemoteException;blah blah
    Then An implementation class...
    import javax.swing.filechooser.*;
    import java.io.*;
    public class RemoteFileSystemViewImpl extends java.rmi.server.UnicastRemoteObject implements RemoteFileSystemView {
        int length;
        private FileSystemView fs;
        public RemoteFileSystemViewImpl() throws java.rmi.RemoteException {
            fs=FileSystemView.getFileSystemView();
        public RemoteFile createFileObject(String path) throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.createFileObject(path));
        public RemoteFile createFileObject(java.io.File dir, String filename) throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.createFileObject(dir,filename));
        //public RemoteFileImpl createFileSystemRoot(java.io.File f) throws java.rmi.RemoteException {
        //    return new RemoteFileImpl(fs.createFileSystemRoot(f));
        public RemoteFile createNewFolder(java.io.File containingDir) throws java.rmi.RemoteException {
            RemoteFile tempf;
            try{
                tempf= new RemoteFileImpl(fs.createNewFolder(containingDir));
            } catch (IOException e){System.out.println(e); tempf=null;}
            return  tempf;
        public RemoteFile getDefaultDirectory() throws java.rmi.RemoteException {
            return new RemoteFileImpl(fs.getDefaultDirectory());
        public String[] getFiles(java.io.File dir, boolean useFileHiding) throws java.rmi.RemoteException {
            String[] tempf= new String[fs.getFiles(dir,useFileHiding).length];
            int i;
            File[] f = fs.getFiles(dir,useFileHiding);
            for(i=0;i<tempf.length;i++) tempf=f[i].toString();
    return tempf;
    public RemoteFile getHomeDirectory() throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getHomeDirectory());
    public RemoteFile getParentDirectory(java.io.File dir) throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getParentDirectory(dir));
    public String[] getRoots() throws java.rmi.RemoteException {
    String[] tempf= new String[fs.getRoots().length];
    System.out.println("fs is-"+fs.getRoots().length);
    int i;
    File[] f = fs.getRoots();
    for(i=0;i<tempf.length;i++) {tempf[i]=f[i].toString();}
    System.out.println("Roots="+tempf[0]);
    return tempf;
    public String getSystemDisplayName(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemDisplayName(f);
    public javax.swing.Icon getSystemIcon(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemIcon(f);
    public String getSystemTypeDescription(java.io.File f) throws java.rmi.RemoteException {
    return fs.getSystemTypeDescription(f);
    public boolean isComputerNode(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isComputerNode(dir);
    public boolean isDrive(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isDrive(dir);
    public boolean isFileSystem(java.io.File f) throws java.rmi.RemoteException {
    return fs.isFileSystem(f);
    public boolean isFileSystemRoot(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isFileSystemRoot(dir);
    public boolean isFloppyDrive(java.io.File dir) throws java.rmi.RemoteException {
    return fs.isFloppyDrive(dir);
    public boolean isHiddenFile(java.io.File f) throws java.rmi.RemoteException {
    return fs.isHiddenFile(f);
    public boolean isParent(java.io.File folder, java.io.File file) throws java.rmi.RemoteException {
    return fs.isParent(folder,file);
    public boolean isRoot(java.io.File f) throws java.rmi.RemoteException {
    return fs.isRoot(f);
    public Boolean isTraversable(java.io.File f) throws java.rmi.RemoteException {
    return fs.isTraversable(f);
    public RemoteFile getChild(File parent, String fileName) throws java.rmi.RemoteException {
    return new RemoteFileImpl(fs.getChild(parent,fileName));
    Notice that whenever I should be passing a File, I pass a RemoteFile instead! Also.. when I am passing a File Array, I instead pass a String array. Reason is.. I havent managed to get File arrays through RMI.. Any Help anyone?!?!?!?!
    I got round it by simply passing a String array and relying on the client to reconstruct a File array locally using the String array. Messy... perhaps.. any suggestions welcome!
    Next.. use rmic to create Stubs and Skels for the 2 implementations and write an RMI server.. eg.
    import java.rmi.Naming;
    public class RemoteServerRMI {
        /** Creates a new instance of RemoteServerRMI */
        public RemoteServerRMI() {
            try {
                RemoteFileSystemView c = new RemoteFileSystemViewImpl();
                Naming.rebind("rmi://localhost:1099/FileService", c);
            } catch (Exception e) {
                System.out.println("Trouble: " + e);
        public static void main(String[] args) {
            new RemoteServerRMI();
    }Yes.. simple and shamelessly lifted from the tutorials.
    and Finally the client....
    import javax.swing.filechooser.*;
    import java.rmi.*;
    import java.net.MalformedURLException;
    import java.io.*;
    import javax.swing.*;
    public class RemoteFileSystemViewClient extends FileSystemView {
        static RemoteFileSystemView c;
        public RemoteFileSystemViewClient() {
            try {
                c = (RemoteFileSystemView) Naming.lookup("rmi://localhost:1099/FileService");
            catch (MalformedURLException murle) {
                System.out.println();
                System.out.println(
                "MalformedURLException");
                System.out.println(murle);
            catch (RemoteException re) {
                System.out.println();
                System.out.println(
                "RemoteException");
                System.out.println(re);
            catch (NotBoundException nbe) {
                System.out.println();
                System.out.println(
                "NotBoundException");
                System.out.println(nbe);
        public File getHomeDirectory() {
            File tempf;
            try {
                tempf= new File(c.getHomeDirectory().gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createFileObject(File dir, String filename) {
            File tempf;
            try {
                tempf= new File(c.createFileObject(dir, filename).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createFileObject(String path) {
            File tempf;
            try {
                tempf=new File(c.createFileObject(path).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File createNewFolder(File containingDir) throws RemoteException {
            File tempf;
            try {
                tempf=new File(c.createNewFolder(containingDir).getAbsolutePath());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File getChild(File parent, String fileName) {
            File tempf;
            try {
                tempf=new File(c.getChild(parent,fileName).gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File getDefaultDirectory() {
            File tempf;
            try {
                tempf=new File(c.getDefaultDirectory().gettoString());
            } catch (RemoteException re){System.out.println(re);tempf=null;}
            return tempf;
        public File[] getFiles(File dir, boolean useFileHiding) {
            File[] tempf;
            try {
                tempf=new File[c.getFiles(dir,useFileHiding).length];
                String[] rtempf=c.getFiles(dir, useFileHiding);
                int i;
                for(i=0;i<c.getFiles(dir, useFileHiding).length;i++) tempf=new File(rtempf[i]);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public File getParentDirectory(File dir) {
    File tempf;
    try {
    tempf= new File(c.getParentDirectory(dir).gettoString());
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public File[] getRoots(){
    File[] tempf;
    try {
    String[] rtempf= c.getRoots();
    System.out.println("in");
    tempf=new File[rtempf.length];
    int i;
    for(i=0;i<c.getRoots().length;i++) tempf[i]=new File(rtempf[i]);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public String getSystemDisplayName(File f) {
    String tempf;
    try{
    tempf=c.getSystemDisplayName(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public javax.swing.Icon getSystemIcon(File f) {
    javax.swing.Icon tempf;
    try{
    tempf=c.getSystemIcon(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public String getSystemTypeDescription(File f) {
    String tempf;
    try {
    tempf=c.getSystemTypeDescription(f);
    } catch (RemoteException re){System.out.println(re);tempf=null;}
    return tempf;
    public boolean isComputerNode(File dir) {
    boolean tempf;
    try {
    tempf= c.isComputerNode(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isDrive(File dir) {
    boolean tempf;
    try {
    tempf= c.isDrive(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFileSystem(File f) {
    boolean tempf;
    try {
    tempf= c.isFileSystem(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFileSystemRoot(File dir) {
    boolean tempf;
    try {
    tempf= c.isFileSystemRoot(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isFloppyDrive(File dir) {
    boolean tempf;
    try {
    tempf= c.isFloppyDrive(dir);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isHiddenFile(File f) {
    boolean tempf;
    try {
    tempf= c.isHiddenFile(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isParent(File folder, File file) {
    boolean tempf;
    try {
    tempf= c.isParent(folder,file);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public boolean isRoot(File f) {
    boolean tempf;
    try {
    tempf= c.isRoot(f);
    } catch (RemoteException re){System.out.println(re);tempf=false;}
    return tempf;
    public Boolean isTraversable(File f) {
    Boolean tempf;
    try {
    tempf= c.isTraversable(f);
    } catch (RemoteException re){System.out.println(re);tempf=new Boolean(false);}
    return tempf;
    public static void main(String[] args) {
    RemoteFileSystemViewClient rc = new RemoteFileSystemViewClient();
    JFileChooser fch= new JFileChooser(rc);
    fch.showOpenDialog(null);
    Notice.. the getFiles and getRoots, procedures, get String arrays from the RMI and reconstruct local File arrays.
    I managed to browse up and down directories with this, and even.. to my surprise, create folders!
    If you got any improvements please let me know at [email protected]

    Copyright &copy; Esmond Pitt, 2007. All rights reserved.
    * RemoteFileSystem.java
    * Created on 13 May 2007, 14:39
    import java.io.File;
    import java.io.IOException;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.swing.Icon;
    * @author Esmond Pitt
    public interface RemoteFileSystem extends Remote
         File createFileObject(String path) throws RemoteException;
         File[] getFiles(File dir, boolean useFileHiding) throws RemoteException;
         File createFileObject(File dir, String filename) throws RemoteException;
         File getChild(File parent, String fileName) throws RemoteException;
         boolean isFloppyDrive(File dir) throws RemoteException;
         boolean isFileSystemRoot(File dir) throws RemoteException;
         boolean isFileSystem(File f) throws RemoteException;
         boolean isDrive(File dir) throws RemoteException;
         boolean isComputerNode(File dir) throws RemoteException;
         File createNewFolder(File containingDir) throws RemoteException, IOException;
         File getParentDirectory(File dir) throws RemoteException;
         String getSystemDisplayName(File f) throws RemoteException;
         Icon getSystemIcon(File f) throws RemoteException;
         String getSystemTypeDescription(File f) throws RemoteException;
         File getDefaultDirectory() throws RemoteException;
         File getHomeDirectory() throws RemoteException;
         File[] getRoots() throws RemoteException;
         // File     createFileSystemRoot(File f) throws RemoteException;
    import java.io.File;
    import java.io.IOException;
    import java.rmi.RemoteException;
    import java.rmi.server.UnicastRemoteObject;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.Icon;
    import javax.swing.filechooser.FileSystemView;
    * @author Esmond Pitt
    * @version $Revision: 3 $
    public class RemoteFileSystemServer extends UnicastRemoteObject implements RemoteFileSystem
         private FileSystemView     fs = FileSystemView.getFileSystemView();
         private Logger     logger = Logger.getLogger(this.getClass().getName());
         /** Creates a new instance of RemoteFileSystemServer */
         public RemoteFileSystemServer(int port) throws RemoteException
              super(port);
              logger.log(Level.INFO, "exported on port {0} and receiving calls fs={1}", new Object[]{port, fs});
         public File createFileObject(String path)
              logger.log(Level.FINE, "createFileObject({0})", path);
              return fs.createFileObject(path);
         public File createFileObject(File dir, String filename)
              logger.log(Level.FINE, "createFileObject({0},{1})", new Object[]{dir, filename});
              return fs.createFileObject(dir, filename);
         public File[] getFiles(File dir, boolean useFileHiding)
              logger.log(Level.FINE, "getFiles({0},{1})", new Object[]{dir, useFileHiding});
              return fs.getFiles(dir, useFileHiding);
         public File getChild(File parent, String fileName)
              logger.log(Level.FINE, "getChild({0},{1})", new Object[]{parent, fileName});
              return fs.getChild(parent, fileName);
         public boolean isFloppyDrive(File dir)
              logger.log(Level.FINE, "isFloppyDrive({0})", dir);
              return fs.isFloppyDrive(dir);
         public boolean isFileSystemRoot(File dir)
              logger.log(Level.FINE, "isFileSystemRoot({0})", dir);
              return fs.isFileSystemRoot(dir);
         public boolean isFileSystem(File f)
              logger.log(Level.FINE, "isFileSystem({0})", f);
              return fs.isFileSystem(f);
         public boolean isDrive(File dir)
              logger.log(Level.FINE, "isDrive({0})", dir);
              return fs.isDrive(dir);
         public boolean isComputerNode(File dir)
              logger.log(Level.FINE, "isComputerNode({0})", dir);
              return fs.isComputerNode(dir);
         public File createNewFolder(File containingDir) throws IOException
              logger.log(Level.FINE, "createNewFolder({0})", containingDir);
              return fs.createNewFolder(containingDir);
         public File getParentDirectory(File dir)
              logger.log(Level.FINE, "getParentDirectory({0})", dir);
              return fs.getParentDirectory(dir);
         public String getSystemDisplayName(File f)
              logger.log(Level.FINE, "getSystemDisplayName({0})", f);
              return fs.getSystemDisplayName(f);
         public Icon getSystemIcon(File f)
              logger.log(Level.FINE, "getSystemIcon({0})", f);
              return fs.getSystemIcon(f);
         public String getSystemTypeDescription(File f)
              logger.log(Level.FINE, "getSystemTypeDescription({0})", f);
              return fs.getSystemTypeDescription(f);
         public File getDefaultDirectory()
              logger.log(Level.FINE, "getDefaultDirectory()");
              return fs.getDefaultDirectory();
         public File getHomeDirectory()
              logger.log(Level.FINE, "getHomeDirectory()");
              return fs.getHomeDirectory();
         public File[] getRoots()
              logger.log(Level.FINE, "getRoots()");
              return fs.getRoots();
          public File createFileSystemRoot(File f)
              return fs.createFileSystemRoot(f);
    import java.io.File;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.rmi.Naming;
    import java.rmi.NotBoundException;
    import java.rmi.RemoteException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.Icon;
    import javax.swing.filechooser.FileSystemView;
    * @author Esmond Pitt
    * @version $Revision: 4 $
    public class RemoteFileSystemView extends FileSystemView
         private Logger     logger = Logger.getLogger(this.getClass().getName());
         private RemoteFileSystem     fs;
         public RemoteFileSystemView(String host)
         throws NotBoundException, RemoteException, MalformedURLException
              String     url = "rmi://"+host+"/"+RemoteFileSystem.class.getName();
              this.fs = (RemoteFileSystem)Naming.lookup(url);
              logger.log(Level.INFO, "Connected to {0} via {1}", new Object[]{url, fs});
         public File createFileObject(String path)
              logger.entering(this.getClass().getName(), "createFileObject", path);
              try
                   return fs.createFileObject(path);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "path="+path, exc);
                   return null;
         public File[] getFiles(File dir, boolean useFileHiding)
              logger.entering(this.getClass().getName(), "getFiles", new Object[]{dir, useFileHiding});
              try
                   return fs.getFiles(dir, useFileHiding);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir+" useFileHiding="+useFileHiding, exc);
                   return null;
         public File createFileObject(File dir, String filename)
              logger.entering(this.getClass().getName(), "createFileObject", new Object[]{dir, filename});
              try
                   return fs.createFileObject(dir, filename);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir+" filename="+filename, exc);
                   return null;
         public File getChild(File parent, String fileName)
              logger.entering(this.getClass().getName(), "getChild", new Object[]{parent, fileName});
              try
                   return fs.getChild(parent, fileName);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "parent="+parent+" fileName="+fileName, exc);
                   return null;
         public boolean isFloppyDrive(File dir)
              logger.entering(this.getClass().getName(), "isFloppyDrive", dir);
              try
                   return fs.isFloppyDrive(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isFileSystemRoot(File dir)
              logger.entering(this.getClass().getName(), "isFileSystemRoot", dir);
              try
                   return fs.isFileSystemRoot(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isFileSystem(File file)
              logger.entering(this.getClass().getName(), "isFileSystem", file);
              try
                   return fs.isFileSystem(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return false;
         public boolean isDrive(File dir)
              logger.entering(this.getClass().getName(), "isDrive", dir);
              try
                   return fs.isDrive(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public boolean isComputerNode(File dir)
              logger.entering(this.getClass().getName(), "isComputerNode", dir);
              try
                   return fs.isComputerNode(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return false;
         public File createNewFolder(File containingDir) throws IOException
              logger.entering(this.getClass().getName(), "createNewFolder", containingDir);
              try
                   return fs.createNewFolder(containingDir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "containingDir="+containingDir, exc);
                   return null;
         public File getParentDirectory(File dir)
              logger.entering(this.getClass().getName(), "getParentDirectory", dir);
              try
                   return fs.getParentDirectory(dir);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "dir="+dir, exc);
                   return null;
         public String getSystemDisplayName(File file)
              logger.entering(this.getClass().getName(), "getSystemDisplayName", file);
              try
                   return fs.getSystemDisplayName(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public Icon getSystemIcon(File file)
              logger.entering(this.getClass().getName(), "getSystemIcon", file);
              try
                   return fs.getSystemIcon(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public String getSystemTypeDescription(File file)
              logger.entering(this.getClass().getName(), "getSystemTypeDescription", file);
              try
                   return fs.getSystemTypeDescription(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "file="+file, exc);
                   return null;
         public File getDefaultDirectory()
              logger.entering(this.getClass().getName(), "getDefaultDirectory");
              try
                   return fs.getDefaultDirectory();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getDefaultDirectory()", exc);
                   return null;
         public File getHomeDirectory()
              logger.entering(this.getClass().getName(), "getHomeDirectory");
              try
                   return fs.getHomeDirectory();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getHomeDirectory()", exc);
                   return null;
         public File[] getRoots()
              logger.entering(this.getClass().getName(), "getRoots");
              try
                   return fs.getRoots();
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "getRoots()", exc);
                   return null;
         protected File createFileSystemRoot(File file)
              logger.entering(this.getClass().getName(), "createFileSystemRoot", file);
              logger.log(Level.SEVERE, "createFileSystemRoot called with ({0})", new Object[]{file});
              try
                   return fs.createFileSystemRoot(file);
              catch (RemoteException exc)
                   logger.log(Level.SEVERE, "", exc);
              return null;
    }

  • [SOLVED] Getting freezes after using dwm for some time and exiting it

    Hello, I have an Asus Ux51, with a fresh (less than a month) arch installation. If I recall correctly I had a couple of freezes in other occasions but I don't remember much about those so I rather focus on the only freeze I can more or less reproduce and I've been having lately. After using dwm for some time with a couple of programs opened (rTorrent, browser, and some terminals for instance), if I close dwm or just press the power button to shut down, it starts closing everything and either stays with a black screen, or hangs while X prints the log information. It's not always though, for example, if I just boot it, open dwm and close it without giving it much use it usually closes fine.
    Tried googling a bit to see the usual ways to troubleshoot this but didn't get really far.
    This is my /var/log/Xorg.0.log
    [ 7.573]
    X.Org X Server 1.14.2
    Release Date: 2013-06-25
    [ 7.573] X Protocol Version 11, Revision 0
    [ 7.573] Build Operating System: Linux 3.9.7-1-ARCH x86_64
    [ 7.574] Current Operating System: Linux arch 3.10.3-1-ARCH #1 SMP PREEMPT Fri Jul 26 11:26:59 CEST 2013 x86_64
    [ 7.574] Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=74e92d67-41b6-4911-8ceb-009ae8c9cdab ro quiet add_efi_memmap i915.i915_enable_rc6=1 pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 "acpi_osi=!Windows 2012"
    [ 7.574] Build Date: 01 July 2013 10:48:42AM
    [ 7.574]
    [ 7.574] Current version of pixman: 0.30.0
    [ 7.574] Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
    [ 7.574] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [ 7.574] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Aug 10 19:08:34 2013
    [ 7.574] (==) Using config directory: "/etc/X11/xorg.conf.d"
    [ 7.575] (==) No Layout section. Using the first Screen section.
    [ 7.575] (==) No screen section available. Using defaults.
    [ 7.575] (**) |-->Screen "Default Screen Section" (0)
    [ 7.575] (**) | |-->Monitor "<default monitor>"
    [ 7.575] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
    [ 7.575] (==) Automatically adding devices
    [ 7.575] (==) Automatically enabling devices
    [ 7.575] (==) Automatically adding GPU devices
    [ 7.578] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
    [ 7.578] Entry deleted from font path.
    [ 7.578] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
    [ 7.578] Entry deleted from font path.
    [ 7.578] (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
    [ 7.578] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
    [ 7.578] Entry deleted from font path.
    [ 7.578] (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
    [ 7.578] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/TTF/,
    /usr/share/fonts/OTF/
    [ 7.578] (==) ModulePath set to "/usr/lib/xorg/modules"
    [ 7.578] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
    [ 7.578] (II) Loader magic: 0x7fdc20
    [ 7.578] (II) Module ABI versions:
    [ 7.578] X.Org ANSI C Emulation: 0.4
    [ 7.578] X.Org Video Driver: 14.1
    [ 7.578] X.Org XInput driver : 19.1
    [ 7.578] X.Org Server Extension : 7.0
    [ 7.578] (II) xfree86: Adding drm device (/dev/dri/card1)
    [ 7.579] (II) xfree86: Adding drm device (/dev/dri/card0)
    [ 7.580] (--) PCI:*(0:0:2:0) 8086:0166:1043:15a7 rev 9, Mem @ 0xf7400000/4194304, 0xd0000000/268435456, I/O @ 0x0000f000/64
    [ 7.580] (--) PCI: (0:1:0:0) 10de:0fd1:1043:15a7 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288
    [ 7.580] Initializing built-in extension Generic Event Extension
    [ 7.580] Initializing built-in extension SHAPE
    [ 7.580] Initializing built-in extension MIT-SHM
    [ 7.580] Initializing built-in extension XInputExtension
    [ 7.580] Initializing built-in extension XTEST
    [ 7.580] Initializing built-in extension BIG-REQUESTS
    [ 7.580] Initializing built-in extension SYNC
    [ 7.580] Initializing built-in extension XKEYBOARD
    [ 7.580] Initializing built-in extension XC-MISC
    [ 7.580] Initializing built-in extension SECURITY
    [ 7.580] Initializing built-in extension XINERAMA
    [ 7.580] Initializing built-in extension XFIXES
    [ 7.580] Initializing built-in extension RENDER
    [ 7.581] Initializing built-in extension RANDR
    [ 7.581] Initializing built-in extension COMPOSITE
    [ 7.581] Initializing built-in extension DAMAGE
    [ 7.581] Initializing built-in extension MIT-SCREEN-SAVER
    [ 7.581] Initializing built-in extension DOUBLE-BUFFER
    [ 7.581] Initializing built-in extension RECORD
    [ 7.581] Initializing built-in extension DPMS
    [ 7.581] Initializing built-in extension X-Resource
    [ 7.581] Initializing built-in extension XVideo
    [ 7.581] Initializing built-in extension XVideo-MotionCompensation
    [ 7.582] Initializing built-in extension XFree86-VidModeExtension
    [ 7.583] Initializing built-in extension XFree86-DGA
    [ 7.583] Initializing built-in extension XFree86-DRI
    [ 7.584] Initializing built-in extension DRI2
    [ 7.584] (II) LoadModule: "glx"
    [ 7.585] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 7.586] (II) Module glx: vendor="X.Org Foundation"
    [ 7.586] compiled for 1.14.2, module version = 1.0.0
    [ 7.586] ABI class: X.Org Server Extension, version 7.0
    [ 7.586] (==) AIGLX enabled
    [ 7.587] Loading extension GLX
    [ 7.587] (==) Matched intel as autoconfigured driver 0
    [ 7.587] (==) Matched nouveau as autoconfigured driver 1
    [ 7.587] (==) Matched nvidia as autoconfigured driver 2
    [ 7.587] (==) Matched nv as autoconfigured driver 3
    [ 7.587] (==) Matched intel as autoconfigured driver 4
    [ 7.587] (==) Matched vesa as autoconfigured driver 5
    [ 7.587] (==) Matched modesetting as autoconfigured driver 6
    [ 7.587] (==) Matched fbdev as autoconfigured driver 7
    [ 7.587] (==) Assigned the driver to the xf86ConfigLayout
    [ 7.587] (II) LoadModule: "intel"
    [ 7.588] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
    [ 7.592] (II) Module intel: vendor="X.Org Foundation"
    [ 7.592] compiled for 1.14.2, module version = 2.21.12
    [ 7.592] Module class: X.Org Video Driver
    [ 7.592] ABI class: X.Org Video Driver, version 14.1
    [ 7.592] (II) LoadModule: "nouveau"
    [ 7.592] (WW) Warning, couldn't open module nouveau
    [ 7.592] (II) UnloadModule: "nouveau"
    [ 7.592] (II) Unloading nouveau
    [ 7.592] (EE) Failed to load module "nouveau" (module does not exist, 0)
    [ 7.592] (II) LoadModule: "nvidia"
    [ 7.592] (WW) Warning, couldn't open module nvidia
    [ 7.592] (II) UnloadModule: "nvidia"
    [ 7.592] (II) Unloading nvidia
    [ 7.592] (EE) Failed to load module "nvidia" (module does not exist, 0)
    [ 7.592] (II) LoadModule: "nv"
    [ 7.592] (WW) Warning, couldn't open module nv
    [ 7.592] (II) UnloadModule: "nv"
    [ 7.592] (II) Unloading nv
    [ 7.592] (EE) Failed to load module "nv" (module does not exist, 0)
    [ 7.592] (II) LoadModule: "vesa"
    [ 7.593] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so
    [ 7.593] (II) Module vesa: vendor="X.Org Foundation"
    [ 7.593] compiled for 1.14.0, module version = 2.3.2
    [ 7.593] Module class: X.Org Video Driver
    [ 7.593] ABI class: X.Org Video Driver, version 14.1
    [ 7.593] (II) LoadModule: "modesetting"
    [ 7.593] (WW) Warning, couldn't open module modesetting
    [ 7.593] (II) UnloadModule: "modesetting"
    [ 7.593] (II) Unloading modesetting
    [ 7.593] (EE) Failed to load module "modesetting" (module does not exist, 0)
    [ 7.593] (II) LoadModule: "fbdev"
    [ 7.593] (WW) Warning, couldn't open module fbdev
    [ 7.593] (II) UnloadModule: "fbdev"
    [ 7.593] (II) Unloading fbdev
    [ 7.593] (EE) Failed to load module "fbdev" (module does not exist, 0)
    [ 7.593] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,
    i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,
    E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,
    965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,
    4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,
    Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),
    Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),
    Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),
    Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),
    Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,
    Ivybridge Server (GT2), HD Graphics, HD Graphics 4600,
    Haswell Desktop (GT3), HD Graphics, HD Graphics 4600,
    Haswell Mobile (GT3), HD Graphics, HD Graphics P4600/P4700,
    Haswell Server (GT3), Haswell (GT1), Haswell (GT2), Haswell (GT3),
    HD Graphics, Haswell (GT2), Haswell (GT3), Haswell SDV Desktop (GT1),
    Haswell SDV Desktop (GT2), Haswell SDV Desktop (GT3),
    Haswell SDV Mobile (GT1), Haswell SDV Mobile (GT2),
    Haswell SDV Mobile (GT3), Haswell SDV Server (GT1),
    Haswell SDV Server (GT2), Haswell SDV Server (GT3),
    Haswell SDV (GT1), Haswell SDV (GT2), Haswell SDV (GT3),
    Haswell SDV (GT1), Haswell SDV (GT2), Haswell SDV (GT3),
    Haswell ULT Desktop (GT1), Haswell ULT Desktop (GT2),
    Iris(TM) Graphics 5100, HD Graphics, HD Graphics 4400,
    HD Graphics 5000, Haswell ULT Server (GT1), Haswell ULT Server (GT2),
    Iris(TM) Graphics 5100, Haswell ULT (GT1), Haswell ULT (GT2),
    Iris(TM) Graphics 5100, HD Graphics, HD Graphics 4200,
    Iris(TM) Graphics 5100, Haswell CRW Desktop (GT1), HD Graphics 4600,
    Iris(TM) Pro Graphics 5200, Haswell CRW Mobile (GT1),
    HD Graphics 4600, Iris(TM) Pro Graphics 5200,
    Haswell CRW Server (GT1), Haswell CRW Server (GT2),
    Iris(TM) Pro Graphics 5200, Haswell CRW (GT1), Haswell CRW (GT2),
    Iris(TM) Pro Graphics 5200, Haswell CRW (GT1), Haswell CRW (GT2),
    Iris(TM) Pro Graphics 5200, ValleyView PO board
    [ 7.594] (II) VESA: driver for VESA chipsets: vesa
    [ 7.594] (++) using VT number 1
    [ 7.594] (WW) Falling back to old probe method for vesa
    [ 7.594] (II) intel(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
    [ 7.594] (==) intel(0): Depth 24, (--) framebuffer bpp 32
    [ 7.594] (==) intel(0): RGB weight 888
    [ 7.594] (==) intel(0): Default visual is TrueColor
    [ 7.594] (--) intel(0): Integrated Graphics Chipset: Intel(R) Ivybridge Mobile (GT2)
    [ 7.594] (**) intel(0): Relaxed fencing enabled
    [ 7.594] (**) intel(0): Wait on SwapBuffers? enabled
    [ 7.594] (**) intel(0): Triple buffering? enabled
    [ 7.594] (**) intel(0): Framebuffer tiled
    [ 7.594] (**) intel(0): Pixmaps tiled
    [ 7.594] (**) intel(0): 3D buffers tiled
    [ 7.594] (**) intel(0): SwapBuffers wait enabled
    [ 7.594] (==) intel(0): video overlay key set to 0x101fe
    [ 7.594] (II) intel(0): Output eDP1 has no monitor section
    [ 7.595] (--) intel(0): found backlight control interface /sys/class/backlight/acpi_video1
    [ 7.596] (II) intel(0): Output VGA1 has no monitor section
    [ 7.596] (II) intel(0): EDID for output eDP1
    [ 7.596] (II) intel(0): Manufacturer: LGD Model: 323 Serial#: 0
    [ 7.596] (II) intel(0): Year: 2012 Week: 0
    [ 7.596] (II) intel(0): EDID Version: 1.4
    [ 7.596] (II) intel(0): Digital Display Input
    [ 7.596] (II) intel(0): 6 bits per channel
    [ 7.596] (II) intel(0): Digital interface is DisplayPort
    [ 7.596] (II) intel(0): Max Image Size [cm]: horiz.: 35 vert.: 19
    [ 7.596] (II) intel(0): Gamma: 2.20
    [ 7.596] (II) intel(0): No DPMS capabilities specified
    [ 7.596] (II) intel(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4
    [ 7.596] (II) intel(0): First detailed timing is preferred mode
    [ 7.596] (II) intel(0): Preferred mode is native pixel format and refresh rate
    [ 7.596] (II) intel(0): redX: 0.629 redY: 0.350 greenX: 0.349 greenY: 0.614
    [ 7.596] (II) intel(0): blueX: 0.154 blueY: 0.112 whiteX: 0.313 whiteY: 0.329
    [ 7.596] (II) intel(0): Manufacturer's mask: 0
    [ 7.596] (II) intel(0): Supported detailed timing:
    [ 7.596] (II) intel(0): clock: 138.0 MHz Image Size: 345 x 194 mm
    [ 7.596] (II) intel(0): h_active: 1920 h_sync: 1952 h_sync_end 1988 h_blank_end 2088 h_border: 0
    [ 7.596] (II) intel(0): v_active: 1080 v_sync: 1085 v_sync_end 1090 v_blanking: 1102 v_border: 0
    [ 7.596] (II) intel(0): LG Display
    [ 7.596] (II) intel(0): LP156WF4-SPB1
    [ 7.596] (II) intel(0): EDID (in hex):
    [ 7.596] (II) intel(0): 00ffffffffffff0030e4230300000000
    [ 7.596] (II) intel(0): 00160104952313780a25b5a159599d27
    [ 7.596] (II) intel(0): 1c505400000001010101010101010101
    [ 7.596] (II) intel(0): 010101010101e83580a8703816402024
    [ 7.596] (II) intel(0): 550059c2100000180000000000000000
    [ 7.596] (II) intel(0): 00000000000000000000000000fe004c
    [ 7.596] (II) intel(0): 4720446973706c61790a2020000000fe
    [ 7.596] (II) intel(0): 004c503135365746342d535042310069
    [ 7.596] (II) intel(0): Not using default mode "320x240" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "400x300" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "400x300" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "512x384" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "640x480" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "640x512" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "800x600" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "896x672" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "928x696" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "960x720" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "700x525" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Not using default mode "1024x768" (doublescan mode not supported)
    [ 7.597] (II) intel(0): Printing probed modes for output eDP1
    [ 7.597] (II) intel(0): Modeline "1920x1080"x60.0 138.00 1920 1952 1988 2088 1080 1085 1090 1102 -hsync -vsync (66.1 kHz eP)
    [ 7.597] (II) intel(0): Modeline "1400x1050"x60.0 122.00 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync (64.9 kHz d)
    [ 7.597] (II) intel(0): Modeline "1280x1024"x60.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync (64.0 kHz d)
    [ 7.597] (II) intel(0): Modeline "1280x960"x60.0 108.00 1280 1376 1488 1800 960 961 964 1000 +hsync +vsync (60.0 kHz d)
    [ 7.597] (II) intel(0): Modeline "1024x768"x60.0 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync (48.4 kHz d)
    [ 7.597] (II) intel(0): Modeline "800x600"x60.3 40.00 800 840 968 1056 600 601 605 628 +hsync +vsync (37.9 kHz d)
    [ 7.597] (II) intel(0): Modeline "800x600"x56.2 36.00 800 824 896 1024 600 601 603 625 +hsync +vsync (35.2 kHz d)
    [ 7.597] (II) intel(0): Modeline "640x480"x59.9 25.18 640 656 752 800 480 490 492 525 -hsync -vsync (31.5 kHz d)
    [ 7.598] (II) intel(0): EDID for output VGA1
    [ 7.598] (II) intel(0): Output eDP1 connected
    [ 7.598] (II) intel(0): Output VGA1 disconnected
    [ 7.598] (II) intel(0): Using exact sizes for initial modes
    [ 7.598] (II) intel(0): Output eDP1 using initial mode 1920x1080
    [ 7.598] (II) intel(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
    [ 7.598] (II) intel(0): Kernel page flipping support detected, enabling
    [ 7.598] (==) intel(0): DPI set to (96, 96)
    [ 7.598] (II) Loading sub module "fb"
    [ 7.598] (II) LoadModule: "fb"
    [ 7.598] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 7.599] (II) Module fb: vendor="X.Org Foundation"
    [ 7.599] compiled for 1.14.2, module version = 1.0.0
    [ 7.599] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 7.599] (II) Loading sub module "dri2"
    [ 7.599] (II) LoadModule: "dri2"
    [ 7.599] (II) Module "dri2" already built-in
    [ 7.599] (II) UnloadModule: "vesa"
    [ 7.599] (II) Unloading vesa
    [ 7.599] (==) Depth 24 pixmap format is 32 bpp
    [ 7.599] (II) intel(0): [DRI2] Setup complete
    [ 7.599] (II) intel(0): [DRI2] DRI driver: i965
    [ 7.599] (II) intel(0): Allocated new frame buffer 1920x1080 stride 7680, tiled
    [ 7.599] (II) UXA(0): Driver registered support for the following operations:
    [ 7.599] (II) solid
    [ 7.599] (II) copy
    [ 7.599] (II) composite (RENDER acceleration)
    [ 7.599] (II) put_image
    [ 7.599] (II) get_image
    [ 7.599] (==) intel(0): Backing store disabled
    [ 7.599] (==) intel(0): Silken mouse enabled
    [ 7.600] (II) intel(0): Initializing HW Cursor
    [ 7.600] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
    [ 7.600] (==) intel(0): DPMS enabled
    [ 7.600] (==) intel(0): Intel XvMC decoder enabled
    [ 7.600] (II) intel(0): Set up textured video
    [ 7.600] (II) intel(0): [XvMC] xvmc_vld driver initialized.
    [ 7.600] (II) intel(0): direct rendering: DRI2 Enabled
    [ 7.600] (==) intel(0): hotplug detection: "enabled"
    [ 7.613] (--) RandR disabled
    [ 7.634] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
    [ 7.634] (II) AIGLX: enabled GLX_INTEL_swap_event
    [ 7.634] (II) AIGLX: enabled GLX_ARB_create_context
    [ 7.634] (II) AIGLX: enabled GLX_ARB_create_context_profile
    [ 7.634] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
    [ 7.634] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
    [ 7.634] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
    [ 7.634] (II) AIGLX: Loaded and initialized i965
    [ 7.634] (II) GLX: Initialized DRI2 GL provider for screen 0
    [ 7.634] (II) intel(0): Setting screen physical size to 508 x 285
    [ 7.669] (II) config/udev: Adding input device Video Bus (/dev/input/event9)
    [ 7.669] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
    [ 7.669] (II) LoadModule: "evdev"
    [ 7.669] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
    [ 7.670] (II) Module evdev: vendor="X.Org Foundation"
    [ 7.670] compiled for 1.14.2, module version = 2.8.1
    [ 7.670] Module class: X.Org XInput Driver
    [ 7.670] ABI class: X.Org XInput driver, version 19.1
    [ 7.670] (II) Using input driver 'evdev' for 'Video Bus'
    [ 7.670] (**) Video Bus: always reports core events
    [ 7.670] (**) evdev: Video Bus: Device: "/dev/input/event9"
    [ 7.670] (--) evdev: Video Bus: Vendor 0 Product 0x6
    [ 7.670] (--) evdev: Video Bus: Found keys
    [ 7.670] (II) evdev: Video Bus: Configuring as keyboard
    [ 7.670] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:01/input/input10/event9"
    [ 7.670] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD, id 6)
    [ 7.670] (**) Option "xkb_rules" "evdev"
    [ 7.670] (**) Option "xkb_model" "pc104"
    [ 7.670] (**) Option "xkb_layout" "us"
    [ 7.684] (II) config/udev: Adding input device Video Bus (/dev/input/event8)
    [ 7.684] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
    [ 7.684] (II) Using input driver 'evdev' for 'Video Bus'
    [ 7.684] (**) Video Bus: always reports core events
    [ 7.684] (**) evdev: Video Bus: Device: "/dev/input/event8"
    [ 7.684] (--) evdev: Video Bus: Vendor 0 Product 0x6
    [ 7.684] (--) evdev: Video Bus: Found keys
    [ 7.684] (II) evdev: Video Bus: Configuring as keyboard
    [ 7.684] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:03/LNXVIDEO:00/input/input9/event8"
    [ 7.684] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD, id 7)
    [ 7.684] (**) Option "xkb_rules" "evdev"
    [ 7.684] (**) Option "xkb_model" "pc104"
    [ 7.684] (**) Option "xkb_layout" "us"
    [ 7.684] (II) config/udev: Adding input device Power Button (/dev/input/event2)
    [ 7.685] (**) Power Button: Applying InputClass "evdev keyboard catchall"
    [ 7.685] (II) Using input driver 'evdev' for 'Power Button'
    [ 7.685] (**) Power Button: always reports core events
    [ 7.685] (**) evdev: Power Button: Device: "/dev/input/event2"
    [ 7.685] (--) evdev: Power Button: Vendor 0 Product 0x1
    [ 7.685] (--) evdev: Power Button: Found keys
    [ 7.685] (II) evdev: Power Button: Configuring as keyboard
    [ 7.685] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input2/event2"
    [ 7.685] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 8)
    [ 7.685] (**) Option "xkb_rules" "evdev"
    [ 7.685] (**) Option "xkb_model" "pc104"
    [ 7.685] (**) Option "xkb_layout" "us"
    [ 7.685] (II) config/udev: Adding input device Lid Switch (/dev/input/event1)
    [ 7.685] (II) No input driver specified, ignoring this device.
    [ 7.685] (II) This device may have been added with another device file.
    [ 7.685] (II) config/udev: Adding input device Sleep Button (/dev/input/event3)
    [ 7.685] (**) Sleep Button: Applying InputClass "evdev keyboard catchall"
    [ 7.685] (II) Using input driver 'evdev' for 'Sleep Button'
    [ 7.685] (**) Sleep Button: always reports core events
    [ 7.685] (**) evdev: Sleep Button: Device: "/dev/input/event3"
    [ 7.685] (--) evdev: Sleep Button: Vendor 0 Product 0x3
    [ 7.685] (--) evdev: Sleep Button: Found keys
    [ 7.685] (II) evdev: Sleep Button: Configuring as keyboard
    [ 7.685] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3/event3"
    [ 7.685] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD, id 9)
    [ 7.685] (**) Option "xkb_rules" "evdev"
    [ 7.685] (**) Option "xkb_model" "pc104"
    [ 7.685] (**) Option "xkb_layout" "us"
    [ 7.685] (II) config/udev: Adding drm device (/dev/dri/card1)
    [ 7.685] (II) config/udev: Adding drm device (/dev/dri/card0)
    [ 7.686] (II) config/udev: Adding input device USB2.0 HD UVC WebCam (/dev/input/event6)
    [ 7.686] (**) USB2.0 HD UVC WebCam: Applying InputClass "evdev keyboard catchall"
    [ 7.686] (II) Using input driver 'evdev' for 'USB2.0 HD UVC WebCam'
    [ 7.686] (**) USB2.0 HD UVC WebCam: always reports core events
    [ 7.686] (**) evdev: USB2.0 HD UVC WebCam: Device: "/dev/input/event6"
    [ 7.686] (--) evdev: USB2.0 HD UVC WebCam: Vendor 0x4f2 Product 0xb36e
    [ 7.686] (--) evdev: USB2.0 HD UVC WebCam: Found keys
    [ 7.686] (II) evdev: USB2.0 HD UVC WebCam: Configuring as keyboard
    [ 7.686] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.3/3-1.3:1.0/input/input6/event6"
    [ 7.686] (II) XINPUT: Adding extended input device "USB2.0 HD UVC WebCam" (type: KEYBOARD, id 10)
    [ 7.686] (**) Option "xkb_rules" "evdev"
    [ 7.686] (**) Option "xkb_model" "pc104"
    [ 7.686] (**) Option "xkb_layout" "us"
    [ 7.686] (II) config/udev: Adding input device HDA Intel PCH Headphone (/dev/input/event5)
    [ 7.686] (II) No input driver specified, ignoring this device.
    [ 7.686] (II) This device may have been added with another device file.
    [ 7.686] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
    [ 7.686] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
    [ 7.686] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard'
    [ 7.686] (**) AT Translated Set 2 keyboard: always reports core events
    [ 7.686] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event0"
    [ 7.686] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1
    [ 7.686] (--) evdev: AT Translated Set 2 keyboard: Found keys
    [ 7.686] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard
    [ 7.686] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input0/event0"
    [ 7.686] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 11)
    [ 7.686] (**) Option "xkb_rules" "evdev"
    [ 7.686] (**) Option "xkb_model" "pc104"
    [ 7.686] (**) Option "xkb_layout" "us"
    [ 7.686] (II) config/udev: Adding input device ETPS/2 Elantech Touchpad (/dev/input/event7)
    [ 7.686] (**) ETPS/2 Elantech Touchpad: Applying InputClass "evdev touchpad catchall"
    [ 7.686] (**) ETPS/2 Elantech Touchpad: Applying InputClass "touchpad catchall"
    [ 7.687] (**) ETPS/2 Elantech Touchpad: Applying InputClass "Default clickpad buttons"
    [ 7.687] (II) LoadModule: "synaptics"
    [ 7.687] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
    [ 7.687] (II) Module synaptics: vendor="X.Org Foundation"
    [ 7.687] compiled for 1.14.1, module version = 1.7.1
    [ 7.687] Module class: X.Org XInput Driver
    [ 7.687] ABI class: X.Org XInput driver, version 19.1
    [ 7.687] (II) Using input driver 'synaptics' for 'ETPS/2 Elantech Touchpad'
    [ 7.687] (**) ETPS/2 Elantech Touchpad: always reports core events
    [ 7.687] (**) Option "Device" "/dev/input/event7"
    [ 7.810] (II) synaptics: ETPS/2 Elantech Touchpad: found clickpad property
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: x-axis range 0 - 3260 (res 32)
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: y-axis range 0 - 2119 (res 32)
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: pressure range 0 - 255
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: finger width range 0 - 15
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: buttons: left double triple
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: Vendor 0x2 Product 0xe
    [ 7.810] (**) Option "TapButton1" "1"
    [ 7.810] (**) Option "TapButton2" "2"
    [ 7.810] (**) Option "TapButton3" "3"
    [ 7.810] (**) Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
    [ 7.810] (--) synaptics: ETPS/2 Elantech Touchpad: touchpad found
    [ 7.810] (**) ETPS/2 Elantech Touchpad: always reports core events
    [ 7.853] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio4/input/input8/event7"
    [ 7.853] (II) XINPUT: Adding extended input device "ETPS/2 Elantech Touchpad" (type: TOUCHPAD, id 12)
    [ 7.853] (**) synaptics: ETPS/2 Elantech Touchpad: (accel) MinSpeed is now constant deceleration 2.5
    [ 7.853] (**) synaptics: ETPS/2 Elantech Touchpad: (accel) MaxSpeed is now 1.75
    [ 7.853] (**) synaptics: ETPS/2 Elantech Touchpad: (accel) AccelFactor is now 0.051
    [ 7.853] (**) ETPS/2 Elantech Touchpad: (accel) keeping acceleration scheme 1
    [ 7.853] (**) ETPS/2 Elantech Touchpad: (accel) acceleration profile 1
    [ 7.853] (**) ETPS/2 Elantech Touchpad: (accel) acceleration factor: 2.000
    [ 7.853] (**) ETPS/2 Elantech Touchpad: (accel) acceleration threshold: 4
    [ 7.853] (--) synaptics: ETPS/2 Elantech Touchpad: touchpad found
    [ 7.853] (II) config/udev: Adding input device ETPS/2 Elantech Touchpad (/dev/input/mouse0)
    [ 7.853] (**) ETPS/2 Elantech Touchpad: Ignoring device from InputClass "touchpad ignore duplicates"
    [ 7.853] (II) config/udev: Adding input device PC Speaker (/dev/input/event4)
    [ 7.853] (II) No input driver specified, ignoring this device.
    [ 7.853] (II) This device may have been added with another device file.
    Found this recent thread in the forums, I'll give REISUB a try late, but the times it freezed I remember trying to blindly reboot it, or switching off virtual console and couldn't.
    In case it's of any use, this is my # uname -a
    Linux arch 3.10.3-1-ARCH #1 SMP PREEMPT Fri Jul 26 11:26:59 CEST 2013 x86_64 GNU/Linux
    Could it have something to do with the nvidia optimus setup that this laptop has? When installing arch I found out that there was no support yet for it so I'm just using the intel drivers (following what the arch wiki said).
    Any ideas or advice to point me in the right direction would be very much appreciated.
    Thanks in advance.
    Last edited by contiver (2013-08-16 20:25:34)

    I don't start st in my .xinitrc. I launch it from dmenu and usually everything is fine. If I launch it from dwm's internal command using Alt-Shf-Return, X freezes 100% of the time. A workaround was suggested by st's main developer to call st like this:
    static const char *termcmd[] = { "/bin/sh", "-c", "st", NULL };
    but it didn't work for me.
    Very rarely X will freeze anyway. I haven't been able to pin it down. When X fails, my journal returns this:
    BUG: unable to handle kernel paging request at ffffc90014ce8000
    IP: [<ffffffff812bfe7f>] bitfill_aligned+0x8f/0x140
    PGD 7c00b067 PUD 7c018067 PMD 7b3eb067 PTE 0
    Oops: 0002 [#1] PREEMPT SMP
    Modules linked in: nls_cp437 vfat fat snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi snd_seq_device snd_pcm snd_page_alloc snd_timer
    CPU: 1 PID: 7520 Comm: X Not tainted 3.10.5-1-ck #1
    Hardware name: /D410PT, BIOS MOPNV10N.86A.0155.2009.1106.0430 11/06/2009
    task: ffff88007aa786b0 ti: ffff8800797ee000 task.ti: ffff8800797ee000
    RIP: 0010:[<ffffffff812bfe7f>] [<ffffffff812bfe7f>] bitfill_aligned+0x8f/0x140
    RSP: 0018:ffff8800797efaa8 EFLAGS: 00010212
    RAX: 0000000003ffff5c RBX: 0000000000000000 RCX: 0000000000000000
    RDX: 0000000003ffff5c RSI: ffffc90014901520 RDI: ffffc90014ce7fe0
    RBP: ffff8800797efab8 R08: 00000000ffffd700 R09: 0000000003f83204
    R10: 0000000000000000 R11: ffffc90014ce7fd8 R12: ffffffffffffffff
    R13: ffffc90014901520 R14: ffffffff812bfdf0 R15: 0000000000000320
    FS: 00007fb350033880(0000) GS:ffff88007ea80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: ffffc90014ce8000 CR3: 000000007b104000 CR4: 00000000000007e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Stack:
    0000000000000000 ffff88007a4d3000 ffff8800797efb28 ffffffff812bfbb9
    ffffffff00000000 ffff88007c00c000 0000000000000000 ffffffff8186f240
    0000000000000000 ffffffff00000006 ffffd700797efb58 ffff88007a4d3000
    Call Trace:
    [<ffffffff812bfbb9>] cfb_fillrect+0x1c9/0x400
    [<ffffffff812ba2e5>] bit_clear_margins+0x165/0x190
    [<ffffffff812b3633>] fbcon_clear_margins+0x63/0x90
    [<ffffffff812b7a9f>] fbcon_switch+0x3df/0x570
    [<ffffffff813200bd>] redraw_screen+0x17d/0x240
    [<ffffffff812b6eeb>] fbcon_blank+0x20b/0x2d0
    [<ffffffff81320767>] do_unblank_screen+0xa7/0x1b0
    [<ffffffff813175d1>] vt_ioctl+0x10d1/0x1170
    [<ffffffff8130b407>] tty_ioctl+0x277/0xb90
    [<ffffffff8118fb21>] ? mntput_no_expire+0x41/0x150
    [<ffffffff81183a3e>] do_vfs_ioctl+0x2de/0x4c0
    [<ffffffff8117328e>] ? ____fput+0xe/0x10
    [<ffffffff8107766c>] ? task_work_run+0x9c/0xe0
    [<ffffffff81183ca3>] SyS_ioctl+0x83/0xa0
    [<ffffffff814bab9d>] system_call_fastpath+0x1a/0x1f
    Code: 08 45 01 d8 31 d2 44 89 c0 41 f7 f1 83 f8 07 89 c2 76 4f 44 8d 08 48 8d 3e 0f 1f 00 4c 89 17 4c 89 57 08 4c 89 57 10 4c 89 57 18 <4
    RIP [<ffffffff812bfe7f>] bitfill_aligned+0x8f/0x140
    RSP <ffff8800797efaa8>
    CR2: ffffc90014ce8000
    ---[ end trace aff6cb5ad5097aef ]---

  • Chat Applet using RMI .... trouble running the Applet using the IE browser.

    Hi,
    I'm trying to run a chat application using RMI technology. Actually, this wasn't created from the scratch. I got this one from from the cd that comes with the book I bought and I did some refinements on it to suit what I wanted to:
    These are the components of the chat application:
    1. RApplet.html - invokes the applet
    html>
    <head>
    <title>Sample Applet Using Dialog Box (1.0.2) - example 1</title>
    </head>
    <body>
    <h1>The Sample Applet</h1>
    <applet code="RApplet.class" width=460 height=160>
    </applet>
    </body>
    </html>
    2. RApplet.java - Chat session client applet.
    import java.rmi.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.rmi.server.*;
    //import ajp.rmi.*;
    public class RApplet extends Applet implements ActionListener {
    // The buttons
    Button sendButton;
    Button quitButton;
    Button startButton;
    Button clearButton;
    // The Text fields
    TextField nameField;
    TextArea typeArea;
    // The dialog for entering your name
    Dialog nameDialog;
    // The name the server knows us as
    String privateName;
    // The name we want to be known as in the chat session
    String publicName;
    // The remote chats erver
    ChatServer chatServer;
    // The ChatCallback
    ChatCallbackImplementation cCallback;
    // The main Chat window and its panels
    Frame mainFrame;
    Panel center;
    Panel south;
    public void init() {
    // Create class that implements ChatCallback.
    cCallback = new ChatCallbackImplementation();
         // Create the main Chat frame.
         mainFrame = new Frame("Chat Server on : " +
                        getCodeBase().getHost());
         mainFrame.setSize(new Dimension(600, 600));
         cCallback.displayArea = new TextArea();
         cCallback.displayArea.setEditable(false);
         typeArea = new TextArea();
         sendButton = new Button("Send");
         quitButton = new Button("Quit");
         clearButton = new Button("Clear");
         // Add the applet as a listener to the button events.
         clearButton.addActionListener(this);
         sendButton.addActionListener(this);
         quitButton.addActionListener(this);
         center = new Panel();
         center.setLayout(new GridLayout(2, 1));
         center.add(cCallback.displayArea);
         center.add(typeArea);
         south = new Panel();
         south.setLayout(new GridLayout(1, 3));
         south.add(sendButton);
         south.add(quitButton);
         south.add(clearButton);
         mainFrame.add("Center", center);
         mainFrame.add("South", south);
         center.setEnabled(false);
         south.setEnabled(false);
         mainFrame.show();
         // Create the login dialog.
         nameDialog = new Dialog(mainFrame, "Enter Name to Logon: ");
         startButton = new Button("Logon");
         startButton.addActionListener(this);
         nameField = new TextField();
         nameDialog.add("Center", nameField);
         nameDialog.add("South", startButton);
         try {
         // Export ourselves as a ChatCallback to the server.
         UnicastRemoteObject.exportObject(cCallback);
         // Get the remote handle to the server.
         chatServer = (ChatServer)Naming.lookup("//" + "WW7203052W2K" +
                                  "/ChatServer");
         catch(Exception e) {
         e.printStackTrace();
         nameDialog.setSize(new Dimension(200, 200));
         nameDialog.show();
    * Handle the button events.
    public void actionPerformed(ActionEvent e) {
         if (e.getSource().equals(startButton)) {
         try {
              nameDialog.setVisible(false);;
              publicName = nameField.getText();
              privateName = chatServer.register(cCallback, publicName);
              center.setEnabled(true);
              south.setEnabled(true);
              cCallback.displayArea.setText("Connected to chat server as: " +
                             publicName);
              chatServer.sendMessage(privateName, publicName +
                             " just connected to server");
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(quitButton)) {
         try {
              cCallback.displayArea.setText("");
              typeArea.setText("");
              center.setEnabled(false);
              south.setEnabled(false);
              chatServer.unregister(privateName);
              nameDialog.show();
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(sendButton)) {
         try{
              chatServer.sendMessage(privateName, typeArea.getText());
              typeArea.setText("");
         catch(Exception ex) {
              ex.printStackTrace();
         else if (e.getSource().equals(clearButton)) {
         cCallback.displayArea.setText("");
    public void destroy() {
         try {
         super.destroy();
         mainFrame.setVisible(false);;
         mainFrame.dispose();
         chatServer.unregister(privateName);
         catch(Exception e) {
         e.printStackTrace();
    3. Chatcallback.java - interface used by clients to connect to the server.
    import java.rmi.*;
    public interface ChatCallback extends Remote {
    public void addMessage(String publicName,
                   String message) throws RemoteException;
    4. ChatcallbackImplementation.java - implements Chatcallback interface.
    import java.rmi.*;
    import java.io.*;
    import java.awt.event.*;
    import java.awt.*;
    public class ChatCallbackImplementation implements ChatCallback {
    // The buttons
    // The Text fields
    TextArea displayArea;
    public void addMessage(String publicName,
                   String message) throws RemoteException {
    displayArea.append("\n" + "[" + publicName + "]: " + message);
    5. Chatserver.java - interface for the chat server.
    import java.rmi.*;
    import java.io.*;
    public interface ChatServer extends Remote {
    public String register(ChatCallback object,
                   String publicName) throws RemoteException;
    * Remove the client associated with the specified registration string.
    * @param registeredString the string returned to the client upon registration.
    public void unregister(String registeredString) throws RemoteException;
    * The client is sending new data to the server.
    * @param assignedName the string returned to the client upon registration.
    * @param data the chat data.
    public void sendMessage(String registeredString, String message) throws RemoteException;
    6. ChatServerImplementation.java - implements Chatserver interface.
    import java.rmi.*;
    import java.util.*;
    import java.rmi.server.*;
    import java.io.*;
    * A class that bundles the ChatCallback reference with a public name used
    * by the client.
    class ChatClient {
    private ChatCallback callback;
    private String publicName;
    ChatClient(ChatCallback cbk, String name) {
         callback = cbk;
         publicName = name;
    // returns the name.
    String getName() {
         return publicName;
    // returns a reference to the callback object.
    ChatCallback getCallback() {
         return callback;
    public class ChatServerImplementation extends UnicastRemoteObject
    implements ChatServer {
    // The table of clients connected to the server.
    Hashtable clients;
    // Tne number of current connections to the server.
    private int currentConnections;
    // The maximum number of connections to the server.
    private int maxConnections;
    // The output stream to write messages to.
    PrintWriter writer;
    * Create a ChatServer.
    * @param maxConnections the total number if connections allowed.
    public ChatServerImplementation(int maxConnections) throws RemoteException {
         clients = new Hashtable(maxConnections);
         this.maxConnections = maxConnections;
    * Increment the counter keeping track of the number of connections.
    synchronized boolean incrementConnections() {
         boolean ret = false;
         if (currentConnections < maxConnections) {
         currentConnections++;
         ret = true;
         return ret;
    * Decrement the counter keeping track of the number of connections.
    synchronized void decrementConnections() {
         if (currentConnections > 0) {
         currentConnections--;
    * Register with the ChatServer, with a String that publicly identifies
    * the chat client. A String that acts as a "magic cookie" is returned
    * and is sent by the client on future remote method calls as a way of
    * authenticating the client request.
    * @param object The ChatCallback object to be used for updates.
    * @param publicName The String the object would like to be known as.
    * @return The actual String assigned to the object for removing, etc. or
    * null if the client could not register.
    public synchronized String register(ChatCallback object, String publicString) throws RemoteException {
         String assignedName = null;
         if (incrementConnections()) {
         ChatClient client = new ChatClient(object, publicString);
         assignedName = "" + client.hashCode();
         clients.put(assignedName, client);
         out("Added callback for: " + client.getName());
         return assignedName;
    * Remove the client associated with the specified registration string.
    * @param registeredString the string returned to the client upon registration.
    public synchronized void unregister(String registeredString) throws RemoteException {
         ChatCallback cbk;
         ChatClient sender;
         if (clients.containsKey(registeredString)) {
         ChatClient c = (ChatClient)clients.remove(registeredString);
         decrementConnections();
         out("Removed callback for: " + c.getName());
         for (Enumeration e = clients.elements(); e.hasMoreElements(); ) {
              cbk = ((ChatClient)e.nextElement()).getCallback();
              cbk.addMessage("ChatServer",
                        c.getName() + " has left the building...");
         else {
         out("Illegal attempt at removing callback (" + registeredString + ")");
    * Sets the logging stream.
    * @param out the stream to log messages to.
    protected void setLogStream(Writer out) throws RemoteException {
         writer = new PrintWriter(out);
    * The client is sending new message to the server.
    * @param assignedName the string returned to the client upon registration.
    * @param data the chat data.
    public synchronized void sendMessage(String registeredString, String message) throws RemoteException {
         ChatCallback cbk;
         ChatClient sender;
         try {
         out("Recieved from " + registeredString);
         out("Message: " + message);
         if (clients.containsKey(registeredString)) {
              sender = (ChatClient)clients.get(registeredString);
              for (Enumeration e = clients.elements(); e.hasMoreElements(); ) {
                   cbk = ((ChatClient)e.nextElement()).getCallback();
                   cbk.addMessage(sender.getName(), message);
         else {
              out("Client " + registeredString+ " not registered");
         catch(Exception ex){
         out("Exception thrown in newData: " + ex);
         ex.printStackTrace(writer);
         writer.flush();
    * Write s string to the current logging stream.
    * @param message the string to log.
    protected void out(String message){
         if(writer != null){
         writer.println(message);
         writer.flush();
    * Start up the Chat server.
    public static void main(String args[]) throws Exception {
         try {
         // Create the security manager
         System.setSecurityManager(new RMISecurityManager());
         // Instantiate a server
         ChatServerImplementation c = new ChatServerImplementation(10);
         // Set the output stream of the server to System.out
         c.setLogStream(new OutputStreamWriter(System.out));
         // Bind the server's name in the registry
         Naming.rebind("//" + args[0] + "/ChatServer", c);
         c.out("Bound in registry.");
         catch (Exception e) {
         System.out.println("ChatServerImplementation error:" +
                        e.getMessage());
         e.printStackTrace();
    Using my own machine (connected to a network), I tried to test this one out by setting mine as the server and also the client. I did the following:
    1. Compile the source code.
    2. Use rmic to generate the skeletons and/or stubs from the ChatCallbackImplementation and ChatServerImplementation.
    3. Start the rmiregistry with no CLASSPATH
    4. Start the server successfully.
    5. Start the applet using the AppletViewer command.
    It worked fined.
    The problem is when I ran the applet using the browser, IE explorer, the dialog boxes, frame and buttons did appear. I was able to do the part of logging on. But after that, the applet seemed to have hang. No message appeared that says I'm connected (which appeared using the appletviewer). I clicked the send button. No response.
    I double-checked my classpath. I did have my classpath set correctly. I'm still trying to figure out the problem. Up to now, I don't have any clue what it is.
    I will appreciate much if someone can help me figure what's could have possibly been wrong ....
    Thanks a lot ...

    Hi Domingo,
    I had a similar problem running applet/rmi with IE.
    Looking in IE..view..JavaConsole error messages my applet was unable to find java.rmi.* classes.
    I checked over java classes in msJVM, they're not present.
    ( WinZip C:\WINDOWS\JAVA\Packages\9rl3f9ft.zip and others from msVM installed )
    ( do not contain the java.rmi.* packages )
    I have downloaded and installed the latest msJVM for IE5. ( I think its included in later versions)
    @http://www.objectweb.org/rmijdbc/RJfaq.html I found ref to rmi.zip download to provide
    these classes. I couldn't get the classes from the site but I managed to find a ref to IBM
    site @http://alphaworks.ibm.com/aw.nsf/download/rmi which had similar download.
    The download however didn't solve my problems. I was unable to install rmi.zip with
    RmiPatch.exe install.
    I solved this by extracting the class files from rmi.zip and installing them at C:\WINDOWS\JAVA\trustlib ( msJVM installation trusted classes lib defined in
    registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM\TrustedLibsDirectory )
    This solved the problem. My rmi/applet worked.
    Hope this helps you.
    Chris
    ([email protected])

  • How to access streaming vedio from server using RMI

    Hello please provide me the solution
    i have one vedio file in remote system and i want to import it to my local system using RMI after that i have to control it like vedio player.This entire application should be developed in struts.
    please give me a basic idea how to approch and wht r the files i need to import and is there any classes available to control the remote streaming vedio.

    If you are using Struts then you are in a web environment. So there is no RMI for the client (browser), it is just HTTP.
    About streaming video take a look at JMF (Java Media Framework). And if you are over HTTP you can use something like this to embed your video streaming:
    <html>
    <body>
    <object width="320" height="63"
    classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
    ccclassid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
    standby="Cargando los componentes del Reproductor de Windows Media de Microsoft..."
    type="application/x-oleobject">
                <param name="filename" value="http://192.168.1.31:1025/01_Alegria.mp3">
                <param name="url" value="http://200.32.112.67/Estacion_del_Sol">
                <param name="AutoStart" value="true">
                <param name="volume" value="100">
                <param name="uiMode" value="mini">
                <embed type="application/x-mplayer2"
            pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
            width=218
            height=129> </embed>
            </object>
                <param name="url" value="http://200.59.146.10/rockandpop-ba">
    </body>
    </html>Hope it helps

  • Guide for J2ME PP to use RMI and Bluetooth

    hi
    i have a current project its about an Ordering System, and i was thinking of using ppc as an order client
    before i want to get on with this i was just wondering if i can get some help from here.
    i just want to ask would it be any problem if i use J2SE to write a server to communicate with the ppc using rmi methology and bluetooth as network device (USB bluetooth for PC). can some one please give me some direction of how to do it, or maybe there's a beta way to do something like this?
    do i just write the code as how you would normally write for rmi application for PC?
    do i need to use third party driver for bluetooth (PC and PPC)?
    btw my PPC is HP Pocket PC 2003 running Window CE and use J9 JVM
    thank you for in advance as i would really appreciate and so is others :)

    Hi,
    I have the same message "Error: Unable to query value..."
    But I can't read from serial port com8. I need to read data from gps, but first I want to read anything from com8.
    My application looks like that:
    import java.util.*;
    import javax.comm.*;
    import java.io.*;
    public class Porty {
    static CommPortIdentifier portId,tym;
    static Enumeration portList;
    private InputStream cos;
    private SerialPort porty;
    public Porty(){
         CommPortIdentifier portID = null;
         for (Enumeration portList = CommPortIdentifier.getPortIdentifiers();
              portList.hasMoreElements() ;) {
         CommPortIdentifier portId = (CommPortIdentifier)portList.nextElement();
         if (portId.getName().equals("COM8:")) {
              tym = portId;
         if (tym == null) {
         // Unable to find COM8
              System.out.println("No Com8");
         return;
         else {
         // found COM8
              System.out.println("Yes!!! Com8");
         try{
              cos = porty.getInputStream();
         }catch (IOException e){}
         System.out.println("Data from Com8");
         System.out.println(cos);
    public static void main(String[] args){
         Porty porcik = new Porty();
    What is wrog. Could samebody help me !!! What I suppouse to do !!! Could You send me same application, which is working and it reads from port.
    Thank You...

  • Problem transferring video using RMI

    Hi frnds...I have a code which transfers images using rmi.....this code works fine.....but if i give a .avi file instead of a .jpeg the file gets transferred to the other machine but it gets corrupt...the size is also the same.....do i have to encode the video ??
    please help me solve the problem..
    thanks..
    Nik

    here is the code....
    import java.io.*;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.datasink.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import java.rmi.*;
    import java.sql.*;
    public class TestQuickCamPro
         private static boolean                    debugDeviceList = false;
         private static String                    defaultVideoDeviceName = "vfw:Microsoft WDM Image Capture (Win32):0";
         private static String                    defaultAudioDeviceName = "DirectSoundCapture";
         private static String                    defaultVideoFormatString = " ";
         private static String                    defaultAudioFormatString = "linear, 16000.0 hz, 8-bit, mono, unsigned";
         private static CaptureDeviceInfo     captureVideoDevice = null;
         private static CaptureDeviceInfo     captureAudioDevice = null;
         private static VideoFormat               captureVideoFormat = null;
         private static AudioFormat               captureAudioFormat = null;
         public static void main(String args[])
                 debugDeviceList = false;
                  new TestQuickCamPro();
    public TestQuickCamPro(){
              Stdout.log("get list of all media devices ...");
              java.util.Vector deviceListVector = CaptureDeviceManager.getDeviceList(null);
              if (deviceListVector == null)
                   Stdout.log("... error: media device list vector is null, program aborted");
                   System.exit(0);
              if (deviceListVector.size() == 0)
                   Stdout.log("... error: media device list vector size is 0, program aborted");
                   System.exit(0);
              for (int x = 0; x < deviceListVector.size(); x++)
                   // display device name
                   CaptureDeviceInfo deviceInfo = (CaptureDeviceInfo) deviceListVector.elementAt(x);
                   String deviceInfoText = deviceInfo.getName();
                   if (debugDeviceList)
                        Stdout.log("device " + x + ": " + deviceInfoText);
                   // display device formats
                   Format deviceFormat[] = deviceInfo.getFormats();
                   for (int y = 0; y < deviceFormat.length; y++)
                        // serach for default video device
                        if (captureVideoDevice == null)
                             if (deviceFormat[y] instanceof VideoFormat)
                             if (deviceInfo.getName().indexOf(defaultVideoDeviceName) >= 0)
                             captureVideoDevice = deviceInfo;
                             Stdout.log(">>> capture video device = " + deviceInfo.getName());
                        // search for default video format
                        if (captureVideoDevice == deviceInfo)
                             if (captureVideoFormat == null)
                             if (DeviceInfo.formatToString(deviceFormat[y]).indexOf(defaultVideoFormatString) >= 0)
                             captureVideoFormat = (VideoFormat) deviceFormat[y];
                             Stdout.log(">>> capture video format = " + DeviceInfo.formatToString(deviceFormat[y]));
                        // serach for default audio device
                        if (captureAudioDevice == null)
                             if (deviceFormat[y] instanceof AudioFormat)
                             if (deviceInfo.getName().indexOf(defaultAudioDeviceName) >= 0)
                             captureAudioDevice = deviceInfo;
                             Stdout.log(">>> capture audio device = " + deviceInfo.getName());
                        // search for default audio format
                        if (captureAudioDevice == deviceInfo)
                             if (captureAudioFormat == null)
                             if (DeviceInfo.formatToString(deviceFormat[y]).indexOf(defaultAudioFormatString) >= 0)
                             captureAudioFormat = (AudioFormat) deviceFormat[y];
                             Stdout.log(">>> capture audio format = " + DeviceInfo.formatToString(deviceFormat[y]));
                        if (debugDeviceList)
                             Stdout.log(" - format: " +  DeviceInfo.formatToString(deviceFormat[y]));
              Stdout.log("... list completed.");
              // if args[x] = "-dd" terminate now
              if (debugDeviceList)
                   System.exit(0);
              // setup video data source
              MediaLocator videoMediaLocator = captureVideoDevice.getLocator();
              DataSource videoDataSource = null;
              try
                   videoDataSource = javax.media.Manager.createDataSource(videoMediaLocator);
              catch (IOException ie) { Stdout.logAndAbortException(ie); }
              catch (NoDataSourceException nse) { Stdout.logAndAbortException(nse); }
              if (! DeviceInfo.setFormat(videoDataSource, captureVideoFormat))
                   Stdout.log("Error: unable to set video format - program aborted");
                   System.exit(0);
              // setup audio data source
              MediaLocator audioMediaLocator = captureAudioDevice.getLocator();
              DataSource audioDataSource = null;
              try
                   audioDataSource = javax.media.Manager.createDataSource(audioMediaLocator);
              catch (IOException ie) { Stdout.logAndAbortException(ie); }
              catch (NoDataSourceException nse) { Stdout.logAndAbortException(nse); }
              if (! DeviceInfo.setFormat(audioDataSource, captureAudioFormat))
                   Stdout.log("Error: unable to set audio format - program aborted");
                   System.exit(0);
              // merge the two data sources
              DataSource mixedDataSource = null;
              try
                   DataSource dArray[] = new DataSource[2];
                   dArray[0] = videoDataSource;
                   dArray[1] = audioDataSource;
                   mixedDataSource = javax.media.Manager.createMergingDataSource(dArray);
              catch (IncompatibleSourceException ise) { Stdout.logAndAbortException(ise); }
              // create a new processor
              // setup output file format  ->> msvideo
              FileTypeDescriptor outputType = new FileTypeDescriptor(FileTypeDescriptor.MSVIDEO);
              // setup output video and audio data format
              Format outputFormat[] = new Format[2];
              outputFormat[0] = new VideoFormat(VideoFormat.INDEO50);
              outputFormat[1] = new AudioFormat(AudioFormat.GSM_MS /* LINEAR */);
              // create processor
              ProcessorModel processorModel = new ProcessorModel(mixedDataSource, outputFormat, outputType);
              Processor processor = null;
              try
                   processor = Manager.createRealizedProcessor(processorModel);
              catch (IOException e) { Stdout.logAndAbortException(e); }
              catch (NoProcessorException e) { Stdout.logAndAbortException(e); }
              catch (CannotRealizeException e) { Stdout.logAndAbortException(e); }
              // get the output of the processor
              DataSource source = processor.getDataOutput();
              // create a File protocol MediaLocator with the location
              // of the file to which bits are to be written
              MediaLocator dest = new MediaLocator("file:testcam.avi");
              // create a datasink to do the file
              DataSink dataSink = null;
              MyDataSinkListener dataSinkListener = null;
              try
                   dataSink = Manager.createDataSink(source, dest);
                   dataSinkListener = new MyDataSinkListener();
                   dataSink.addDataSinkListener(dataSinkListener);
                   dataSink.open();
              catch (IOException e) { Stdout.logAndAbortException(e); }
              catch (NoDataSinkException e) { Stdout.logAndAbortException(e); }
              catch (SecurityException e) { Stdout.logAndAbortException(e); }
              // now start the datasink and processor
              try
                   dataSink.start();
              catch (IOException e) { Stdout.logAndAbortException(e); }
              processor.start();
              Stdout.log("starting capturing ...");
              try { Thread.currentThread().sleep(5000); } catch (InterruptedException ie) {}     // capture for 10 seconds
              Stdout.log("... capturing done");
              // stop and close the processor when done capturing...
              // close the datasink when EndOfStream event is received...
              processor.stop();
              processor.close();
              dataSinkListener.waitEndOfStream(10);
              dataSink.close();
              Stdout.log("[all done]");

  • Using custom ClassLoader

    Is there a way to make my custom ClassLoader the default ClassLoader for my program?
    ie. Can I just set up my program to use my ClassLoader whenever it needs to access class files?
    Geoff.

    Hi,
    The main class is always loaded by the boot strap class loader(also called System ClassLoader). You can't change it. After that all the classes are loaded by the classloader of the loading class. i.e.
    If class A is loading class B, then class B's classloader will be the classloader of class A.
    So, basically you need to write a classloader, and a wrapper class for your main class like:
    public class WrapperClass
        public void main(String[] args) throws Exception
           MyClassLoader myClassLoader = new MyClassLoader();
           Class mainClass = myClassLoader.loadClass("MainClass");
           Method mainMethod = mainClass.getMethod("main", new Class[] {args.getClass()});
           mainMethod.invoke(null, args);
    }then rest of the classes including MainClass are loaded by the MyClassLoader. If you need help you writing ClassLoader please reply back.
    Hope this helps.

  • Urgent help:send image over network using rmi

    hi all,
    i have few question about send image using rmi.
    1) should i use ByteArrayOutputStream to convert image into byte array before i send over network or just use fileinputstream to convert image into byte array like what i have done as below?
    public class RemoteServerImpl  extends UnicastRemoteObject implements RemoteServer
      public RemoteServerImpl() throws RemoteException
      public byte[] getimage() throws RemoteException
        try{
           // capture the whole screen
           BufferedImage screencapture = new Robot().createScreenCapture(new     Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
           // Save as JPEG
           File file = new File("screencapture.jpg");
           ImageIO.write(screencapture, "jpg", file);
            byte[] fileByteContent = null;
           fileByteContent = getImageStream("screencapture.jpg");
           return fileByteContent;
        catch(IOException ex)
      public byte[] getImageStream(String fname) // local method
        String fileName = fname;
        FileInputStream fileInputStream = null;
        byte[] fileByteContent = null;
          try
            int count = 0;
            fileInputStream = new FileInputStream(fileName);  // Obtains input bytes from a file.
            fileByteContent = new byte[fileInputStream.available()]; // Assign size to byte array.
            while (fileInputStream.available()>0)   // Correcting file content bytes, and put them into the byte array.
               fileByteContent[count]=(byte)fileInputStream.read();
               count++;
           catch (IOException fnfe)
         return fileByteContent;           
    }2)if what i done is wrong,can somebody give me guide?else if correct ,then how can i rebuild the image from the byte array and put it in a JLable?i now must use FileOuputStream but how?can anyone answer me or simple code?
    thanks in advance..

    Hi! well a had the same problem sending an image trough RMI.. To solve this i just read the image file into a byte Array and send the array to the client, and then the client creates an imegeIcon from the byte Array containing the image.. Below is the example function ton read the file to a byte Array (on the server) and the function to convert it to a an imageIcon (on the client).
    //      Returns the contents of the file in a byte array.
        public static byte[] getBytesFromFile(File file) throws IOException {
            InputStream is = new FileInputStream(file);
            // Get the size of the file
            long length = file.length();
            // You cannot create an array using a long type.
            // It needs to be an int type.
            // Before converting to an int type, check
            // to ensure that file is not larger than Integer.MAX_VALUE.
            if (length > Integer.MAX_VALUE) {
                // File is too large
            // Create the byte array to hold the data
            byte[] bytes = new byte[(int)length];
            // Read in the bytes
            int offset = 0;
            int numRead = 0;
            while (offset < bytes.length
                   && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
                offset += numRead;
            // Ensure all the bytes have been read in
            if (offset < bytes.length) {
                throw new IOException("Could not completely read file "+file.getName());
            // Close the input stream and return bytes
            is.close();
            return bytes;
        }to use this function simply use something like this
    public byte[] getImage(){
    byte[] imageData;
              File file = new File("pic.jpg");
              // Change pic.jpg for the name of your file (duh)
              try{
                   imageData = getBytesFromFile(file);
                   // Send to client via RMI
                            return imageData;
              }catch(IOException ioe){
                           // Handle exception
                           return null; // or whatever you want..
    }and then on the client you could call a function like this
    public ImageIcon getImageFromServer(){
         try{
              // get the image from the RMI server
              byte[] imgBytes = myServerObject.getImage();
              // Create an imageIcon from the Array of bytes
              ImageIcon ii = new ImageIcon(imgBytes);
              return ii;
         }catch(Exception e){
              // Handle some error..
              // If yo get here probably something went wrong with the server
              // like File Not Found or something like that..
              e.printStackTrace();
              return null;
    }Hope it helps you..

  • Is there any problems in IE if using RMI.?

    Hello buddies,
    this is my 3rd attempt to get answer. before it i tried 2 times but didn't get answered.
    actually i m making a chat application. in that there is a canvas on which we can draw something and send it to all users. i make an applet and from within the applet i m calling a frame. all this awt components like canvas and buttons etc. displays in the frame. applet is just a platform do call the frame. i m using RMI to do the chat. i tried to run it first in appletviewer and it works fine. but when i tried to run in IE from <applet> tag no frame is displays. i am trying to solve it from last 20 days but still unsolved. here is the code if anybody wishes to try it.
    // clinet frame...
    import java.rmi.*;
    import java.rmi.server.*;
    import canvas.Drawer;
    import java.awt.*;
    import java.applet.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.util.*;
    import ru.zhuk.graphics.*;
    /*<applet code="ChatClient" width=600 height=300>
    </applet>
    public class ChatClient extends Frame implements IChatClient,ActionListener,MouseListener,MouseMotionListener
         // GLOBAL VARIABLES USED IN THE PROGRAMME...
         boolean flag=false;
         int n;
         String str="";
         String Coord=null;
         IChatService service=null;
         FrameApplet fa=null;
         TextField servername,serverport,username;
         Button connect,disconnect;
         TextField message;
         Button send,sendText;
         TextArea fromserver;
         int i=0,j=0;
         int x[] = new int[1000];
         int y[] = new int[1000];
         Drawer canvas;
         boolean connected=false;
         String title,user="";
         // Class Members //
         public ChatClient()
         public ChatClient(String str)
              super(str);
              setBounds(50,20,600,450);
              setLayout(new FlowLayout(FlowLayout.CENTER,45,10));
              title=str;
              setStatus();
              // Create controls //
              add(new Label("Chat Server Name : "));
              servername=new TextField(20);
              add(servername);
              servername.setText("localhost");
              add(new Label("Chat Server Port : "));
              serverport=new TextField(20);
              add(serverport);
              serverport.setText("900");
              add(new Label("Your User Name : "));
              username=new TextField(20);
              add(username);
              username.setText("Umesh");
              connect=new Button("Connect");
              connect.addActionListener(this);
              add(connect);
              disconnect=new Button("Disconnect");
              disconnect.addActionListener(this);
              add(disconnect);
              message=new TextField(30);
              add(message);
              sendText=new Button("Send Text");
              sendText.addActionListener(this);
              add(sendText);
              fromserver=new TextArea(10,50);
              add(fromserver);
              fromserver.setEditable(false);
    canvas = new Drawer();
              canvas.setSize(250,250);
              canvas.setBackground(Color.cyan);
              add(canvas);
              canvas.addMouseListener(this);
              canvas.addMouseMotionListener(this);
              send=new Button("Send");
              send.addActionListener(this);
              add(send);
              try
                   UnicastRemoteObject.exportObject(this);
              catch(Exception e)
              setVisible(true);
              for(j=0;j<1000;j++)
                   x[j]=0;
                   y[j]=0;
              Coord = new String();
              Coord = "";
    //          fa=new FrameApplet();
         public void mousePressed(MouseEvent me){}
         public void mouseReleased(MouseEvent me)
              Coord = Coord + "r";
         public void mouseClicked(MouseEvent me){}
         public void mouseEntered(MouseEvent me){}
         public void mouseExited(MouseEvent me){}
         public void mouseDragged(MouseEvent me)
              if (Coord == "")
                   Coord = me.getX() + "," + me.getY();
              else
                   Coord = Coord + " " + me.getX() + "," + me.getY();
         public void mouseMoved(MouseEvent me){}
         // RMI connection //
         private void connect()
              try
                   service = (IChatService)Naming.lookup("rmi://pcname/ChatService");
                   service.addClient(this);
                   connected=true;
                   setStatus();
                   user=username.getText();
                   Coord = "";
              catch(Exception e)
                   fromserver.append("Error Connecting ...\n" + e);
                   System.out.println(e);
                   connected=false;
                   setStatus();
                   service=null;
         private void disconnect()
              try
                   if(service==null)
                        return;
                   service.removeClient(this);
                   service=null;
              catch(Exception e)
                   fromserver.append("Error Connecting ...\n");
              finally
                   connected=false;
                   setStatus();
         private void setStatus()
              if(connected)
                   setTitle(title+" : Connected");
              else
                   setTitle(title+" : Not Connected");
         // IChatClient methods //
         public String getName()
              return user;
         public void sendMessage(String msg)
              fromserver.append(msg+"\n");
         public void SendCanvasObject(String str)
              this.str = str;
              fromserver.append(str + "\n");
              Graphics g = canvas.getGraphics();
              paint(g);
         // Actionlistener //
         public void actionPerformed(ActionEvent e)
              if(e.getSource()==connect)
                   connect();
                   if(connected)
                        servername.setEnabled(false);
                        serverport.setEnabled(false);
                        username.setEnabled(false);
                        connect.setEnabled(false);
                        Coord = "";
              else
              if(e.getSource()==disconnect)
                   disconnect();
                   servername.setEnabled(true);
                   serverport.setEnabled(true);
                   username.setEnabled(true);
                   connect.setEnabled(true);
              else
              if(e.getSource()==send)
                   flag = true;
                   if(service==null)
                        return;
                   try
                        fromserver.append("Sending an image...\n");
                        service.SendCanvasObject(this,Coord);
                        i=0;
                        for(j=0;j<1000;j++)
                             x[j]=0;
                             y[j]=0;
                        Coord = "";
                        fromserver.append("\n" + "Image Sent...");
                   catch(RemoteException re)
                        fromserver.append("Error Sending Message ...\n" + re);
                   catch(Exception ee)
                        fromserver.append("Error Sending Message ...\n" + ee);
              else
              if(e.getSource()==sendText)
                   if(service==null)
                        return;
                   try
                        service.sendMessage(this,message.getText());
                        message.setText("");
                   catch(RemoteException exp)
                        fromserver.append("Remote Error Sending Message ...\n" + exp);
                   catch(Exception ee)
                        fromserver.append("Error Sending Message ...\n" + ee);
         public void paint(Graphics g)
              if(flag==true)
                   i=0;
                   StringTokenizer stoken = new StringTokenizer(str,"r");
                   String strin = "";
                   while(stoken.hasMoreTokens())
                        strin = stoken.nextToken();
                        fromserver.append("\n" + strin + "\n");
                        StringTokenizer stoken1 = new StringTokenizer(strin," ");
                        String strin1 = "";
                        j=0;
                        while(stoken1.hasMoreTokens())
                             strin1 = stoken1.nextToken();
                             fromserver.append("\n" + strin1 + "\n");
                             x[j]=Integer.parseInt(strin1.substring(0,strin1.indexOf(",")));
                             y[j]=Integer.parseInt(strin1.substring(strin1.indexOf(",")+1,strin1.length()));
                             j++;
                        for(int k=0;k<j-1;k++)
                             g.drawLine(x[k],y[k],x[k+1],y[k+1]);     
                   i++;
    import java.rmi.*;
    import java.rmi.server.*;
    import canvas.Drawer;
    import java.util.*;
    import ru.zhuk.graphics.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class FrameApplet extends Applet implements ActionListener
         ChatClient f;
         public void init()
              Button b = new Button("Start Chat");
              b.addActionListener(this);
              add(b);
         public void actionPerformed(ActionEvent ae)
              f=new ChatClient("Chat");
              f.show();
              f.setSize(400,400);
    here is html file which i calls from IE
    <html>
    <title>Micky Chat</title>
    <body>
    <br>
    <br>
    <center>
    <applet code="FrameApplet.class" width=200 height=200>
    </applet>
    </center>
    </body>
    </html>
    and at last a shocking thing is it is runs in Netscape displaying frames but not calling paint method.
    pls. help me
    thanks a lot
    umesh

    Hi Umesh!
    Sorry that I cannot be too concrete about that since it has to be centuries ago when I fell over this problem.
    As far as I can remember, the JDK provided by MS has no RMI built-in. These was probably one of the main reasons why Sun sued Microsoft concering its handling of Java.
    Afterwards MS released a path for its Java Runtime that included RMI support, but AFAIK they never included it in the standard package. So much luck when searching for the ZIP! (-;
    A little bit of googling might help, e.g.:
    http://groups.google.com/groups?hl=de&lr=&ie=UTF-8&oe=UTF-8&threadm=37f8ddf6.4532124%40news.online.no&rnum=17&prev=/groups%3Fq%3Dmicrosoft%2Bjvm%2Brmi%2Bsupport%26start%3D10%26hl%3Dde%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D37f8ddf6.4532124%2540news.online.no%26rnum%3D17
    cheers,
    kdi

Maybe you are looking for