Strange Behaviour in File class

Hi,
I noticed a strange behaviour. There is a file contains unicode letters in its name. I tried
File file=new File("c:\@ℏℑ\@�⅙0.txt");
file.exists() // I checked existence of file using this statement which returns false although file is exist.
What can I do ?
Thanks

Hi,
Thanks for the reply.
I am showing the sample:
//This is a list method
static void list(File file) {
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            if (files != null) {
                for (int i = 0; i < files.length; i++) {
                    if(files.isDirectory()){
list(files[i]);
}else{
System.out.println(files[i].getAbsolutePath() + " " + files[i].exists());
System.out.println(file.getAbsolutePath() + " " + file.exists());
if I call this method like this from main method:
File file=new File("C:\\Documents and Settings\\Neha\\Desktop\\ttt\\@&#8463;&#8465;\\@�&#8537;0.txt");
list(file);
output:
C:\Documents and Settings\Neha\Desktop\ttt\@??\@�?0.txt false [with Jre5]
C:\Documents and Settings\Neha\Desktop\ttt\@??\@�?0.txt true [with Jre6]
if I call like this
File file=new File("C:\\Documents and Settings\\Neha\\Desktop\\ttt");
list(file);
Output:
C:\Documents and Settings\Neha\Desktop\ttt\@??\@�?0.txt true
C:\Documents and Settings\Neha\Desktop\ttt\@??\Chambal25.txt true
C:\Documents and Settings\Neha\Desktop\ttt\@?? true
C:\Documents and Settings\Neha\Desktop\ttt true

Similar Messages

  • Very strange behaviour of RGBImageFilter class

    Hi!
    I found very strange behaviour of RGBImageFilter class and problem is
    that I need to solve that problem :/ So, situation is next:
    I decided to use filtering process for collecting information about
    image. So, I extended my own class from RGBImageFilter and overwrite
    filterRGB( ... ) method ( everything is absolutely the same as in
    documentation ) and also added my own code for 'no matter what'.
    This code changes some class variable and my idea was to read those
    variables after filtering process end, but... Suddenly I realized that
    those variables, many times changed while filtering were performed
    ( I checked it ) after filtering gave the same value as in constructor!
    The only one clue and idea about what happened is that class instance
    were cloned and then executed, but thats not a functionality I was
    searching. :/ I made some example of that 'effect'.
    Image file name goes in command line.
    Please pay attention on -3 value on exit: Filtering works, count growing
    ( just uncomment setPixels() method to see it ) but, but...
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    class ToForum
         public static void main( String[] args )
              try
                   JFrame frame = new JFrame( "now i beleave in x-files!" );
                   frame.setDefaultCloseOperation( frame.DISPOSE_ON_CLOSE );
                   Toolkit kit = Toolkit.getDefaultToolkit();
                   Image origin = kit.getImage( args[0] );
                   RedBlueSwapFilter filter = new RedBlueSwapFilter();
                   Image filtered = frame.createImage( new FilteredImageSource( origin.getSource(), filter ) );
                   MediaTracker tracker = new MediaTracker( frame );
                   tracker.addImage( filtered, 1 );
                   tracker.waitForAll();
                   System.out.println( "AND WE GOT: "+filter.getCount()+" !!!" );
                   Container content = frame.getContentPane();
                   content.setLayout( new FlowLayout() );
                   JLabel label = new JLabel( new ImageIcon( filtered ) );
                   content.add( label );
                   frame.pack();
                   frame.setVisible( true );
              catch( Exception ex )
                   System.out.println( "Exception in main():\n"+ex );
    class RedBlueSwapFilter extends RGBImageFilter
         private int count=-5;
         public RedBlueSwapFilter()
              count = -3;
              canFilterIndexColorModel = true;
         // uncommenting this function will show that filterRGB method IS calling !!!
         // so, why then AFTER filtering count is still ( or again ??? ) equals to 0 ?
         public void setPixels( int x, int y, int w, int h, ColorModel model, int pixels[], int off, int scansize )
              System.out.println( "on entering in setPixels count="+count );
              super.setPixels( x, y, w, h, model, pixels, off, scansize );
              System.out.println( "on exiting from setPixels count="+count );
         public int filterRGB( int x, int y, int rgb )
              count++;
              return ( (rgb&0xff00ff00) | ((rgb&0xff0000) >> 16) | ((rgb&0xff) << 16) );
         public int getCount()
              return count;

    Cliff, Hi. I'm curious because this can't work. I have no problem synching with the exchange - as long as i accept the message that the certificate of the exchange (which is not the certificate of the exchange but the certificate of dig @reighthandsideofmailadress) is not valid (expired, wrong common name etc).

  • Strange behaviour of File.saveDlg on MacOSX

    I have a very simple script:
    #target photoshop
        var saveFile = new File("test.ext");
        saveFile = saveFile.saveDlg ("Select location", "*.ext");
    On Windows, I got save dialog prompt, which shows correctly "test.ext" as predefined file.
    If I run the same script on MacOSX what it shows the dialog, but with file name "test.ext.ext.ext". If you use the checkbox "Hide extension", you are getting additional ".ext" in name.
    Is this issue in ExtendScript or my fault, if this is an issue, is there some workaround available?
    Thanks,
    --Petr

    I found the root issue: if you put the path ending with extension, which is known to Mac (such as .txt) everything works fine. If you put the extension which is not registered (.aaa for example), save dialog will offer you .aaa.aaa.aaa which will be growing endlessely if you click hide extension checkbox.

  • View Master mode strange behaviour with jpg files

    Hy all,
    I'm using Aperture, and I'm tweakin a lot the SW to discover all secrets ....
    I'm really concerned about a strange behaviour of the SW in view mode.
    If I open a jpg file, do not apply ANY modification, and apply the "show master" command (pressing M), there's a subtle behaviour :
    *the images get sharper !!!!*
    It behaves as if an "edge sharpening" was applied !!!!!!
    With _RAW files this thing doesn't happen at all._
    Even stranger, if I zoom to full definition (by pressing Z), and toggle between normal view and "show master" view, the immage remains the same !
    The effect is not so evident with all images, but sometimes it is !!
    Anyway, I expect not to have such kind of things with a professional SW.
    With professional cameras and good quality files it's really annoying not to beeing sure what's the REAL content of the jpg image.
    Has anyone noted this thing ? Is there a reasonable explanation ?
    The only one I tried to figure out is the following : may be Aperture applies some kind of resampling algorithm with jpg files (bicubic, bilinear, etc).
    May be this resampling is not applied with 100% magnification, as weel as with raw files.
    But it's only my guessing. Now, I'm tweaking other viewers and other SW to understand what's the real jpg image stored in the file : the blurer one form normal view or the sharper one with "show master" mode.
    I stress once again : of course, the jpg file I'm talking about have no settings at all, just imported and toggled with M button.
    Thanks in advance.
    Regards,
    Enzo

    Hy,
    I'm afraid I'm not been clear.
    The problem is this :
    1) jpg image opened in normal view mode, no zoom, (no quick preview, of course) : image with a certain amount of blour
    2) jpg image opened in show master mode, no zoom, (no quick previre, of course) : image SHARPER with respect with the previous.
    No edit applied from import, so "show master" command shouln't apply any change in rendering, should it ?
    The only thing I said on 100% view is that such difference (between normal mode e show mastermode) is not present with 100% magnification.
    That was the issue.
    Enzo

  • A strange behaviour throwing Threads via anonymous class technique

    Hi friends!
    I've noted a strange behaviour executing the next code:
    public class ResolAnonimes
         private int value;
         public ResolAnonimes(int value)
              this.value = value;
         public ResolAnonimes myMethod(int nThreads)
              final ResolAnonimes a = this;
              int nThreadsFor = nThreads - 1;
              for( int i=0; i < nThreadsFor; i++)
                   new Thread(){
                        public void run()
                                System.out.println(Thread.currentThread().getName() + " has begun processing");
                                     doSomethingWith(a);
                                System.out.println(Thread.currentThread().getName() + " has finished processing");
                   }.start();
                   this.value++;
              }//for loop
              return a;
         public static void doSomethingWith(ResolAnonimes a)
              System.out.println(a.value);
         public static void main(String Args[])
              ResolAnonimes first = new ResolAnonimes(1);
              ResolAnonimes result = first.myMethod(5);
    }When I execute it, that's the output I get:
    Thread-0 has begun processing
    2
    Thread-0 has finished processing
    Thread-0 has begun processing
    3
    Thread-0 has finished processing
    Thread-0 has begun processing
    4
    Thread-0 has finished processing
    Thread-0 has begun processing
    5
    Thread-0 has finished processingWhere's the "1" printed? It doesn't appear! It seems it has thrown only 4 threads, not 5.
    Am I doing anything wrong? Is it a bug?
    Can you help me, please?
    Thank you in advance.

    Oh I'm sorry. I was changing the code because of privacy rerasons and I finally didn't type what I want.
    Consider an array which all cells must be typed with the array lentgh. Moreover, the work is distributed by some threads.
    I'm refering to something like this:
    import java.util.Random;
    import java.util.LinkedList;
    public class MyArray
         private static int initialRow = 0;
         private static int lastRow = 0;
         private int[] vector;
         public MyArray(int size)
              vector = new int[size];
         public static boolean correctIndex(MyArray a )
              for(int i = 0; i< a.vector.length; i++)
                   if(a.vector[i] != a.vector.length)
                        return false;
              return true;
         public String toString()
              String s ="";
              for(int i=0; i < this.vector.length; i++)
                   s += this.vector[i] + " ";
              return s;
         public MyArray  operationWith(int nThreads)
              MyArray a = this;
              MyArray result = null;
              final Contenidor ctros = new Contenidor(new LinkedList());
              result = a.putTheIndexValue(nThreads, ctros);
              Thread consumerThread = new Thread( new Consumer( ctros, nThreads));
              consumerThread.start();
              try
                   consumerThread.join();
              catch(InterruptedException ie){}
              return result;
         public MyArray putTheIndexValue(int nThreads, Contenidor ctros) //Este metode encara es experimental
              final MyArray a = this;
              final MyArray result = new MyArray( a.vector.length);
              final Contenidor ctrosR = ctros;
              for(int i = 0; i < result.vector.length; i++)
                        result.vector= 0;
              int incRows = a.vector.length / nThreads - 1;
              initialRow = 0;
              lastRow= incRows;
              int nFilsFor = nThreads - 1;
              Thread[] vectorFils = new Thread[nThreads];
              for( int i=0; i < nFilsFor; i++)
                   /*vectorFils[i] = */ new Thread()
                                                 public void run()
                                                      System.out.println(Thread.currentThread().getName() + " has begun processing");
                                                      MyArray.putTheIndexValue( a, initialRow, lastRow);
                                                      System.out.println(Thread.currentThread().getName() + " has finished processing");
                                                      String s = Thread.currentThread().getName();
                                                      ctrosR.put(s);                         
                   vectorFils[i]*/.start();
                   initialRow = initialRow + 1;
                   lastRow = initialRow + incRows;
              new Thread()
                   public void run()
                        System.out.println(Thread.currentThread().getName() + " has begun processing");
                        MyArray.putTheIndexValue( a, initialRow, a.vector.length - 1);
                        System.out.println(Thread.currentThread().getName() + " has finished processing");
                        String s = Thread.currentThread().getName();
                        ctrosR.put(s);                         
                   vectorFils[i]*/.start();
              return result;
         public static void putTheIndexValue( MyArray a, int initialRow, int lastRow)
              for(int i = initialRow; i <= lastRow; i++)
                   a.vector[i] = a.vector.length;
    public class Interface
         public static void main(String Args[])
              int nThreads = 2;
              int arraySize = 5;
              MyArray ma = new MyArray(arraySize);
              MyArray result = ma.operationWith(nThreads);
              if(MyArray.correctIndex(result))
                   System.out.println("The operation has been done correctly");
              else
                   System.out.println("THE OPERATION HAS NOT BEEN CORRECTLY!");
              System.out.println(ma.toString());
    public class Consumer implements Runnable
         private Contenidor ctros;
         private int nFils;
         public Consumer(Contenidor ctros, int nFils)
              this.ctros = ctros;
              this.nFils = nFils;
         public void run()
              System.out.println(Thread.currentThread().getName() + "is waiting the total process to be finished");
              for(int i = 0; i< nFils; i++)
                      System.out.println( Thread.currentThread() + " is waiting a thread to give me its chunk");
                      String s = ctros.get();
                      System.out.println( Thread.currentThread() + ":  " + s + " has already given me its chunk");
                 System.out.println(Thread.currentThread().getName() + "says all threads have finished");
    import java.util.Queue;
    import java.util.LinkedList;
    public class Contenidor
        private int nDadesNoves;
        private Queue contenidor;
        public Contenidor(Queue contenidor)
            this.contenidor = contenidor;
            this.nDadesNoves = 0;
        public synchronized String get()
            while(nDadesNoves < 1)
                try
                    wait();
                catch(InterruptedException ie){}
            nDadesNoves--;
            notifyAll();
            return (String)contenidor.poll();
        public synchronized void put(String s)
            contenidor.offer(s);
            nDadesNoves++;
            notifyAll();
    }The output I get sometimes is:
    THE OPERATION HAS NOT BEEN CORRECTLY!
    5 5 5 5 5And I get also sometimes that:
    THE OPERATION HAS NOT BEEN CORRECTLY!
    0 5 5 5 5That's what I wanted to refer last post. I think I'm doing a correct synchronization. Am I wrong?
    I don't understand that behaviour.
    Anyone can help me, please?
    Thank you in advance.

  • Aliases file - Strange Behaviour

    Greetings all,
    I've been having some strange behaviour with my Postfix installations lately. My logfiles are filled with intermittent entries of:
    Oct 17 18:52:10 xserve1 postfix/smtpd[4117]: table hash:/etc/aliases(0,lock|fold_fix) has changed -- restarting
    Oct 17 18:52:12 xserve1 postfix/local[4129]: table hash:/etc/aliases(0,lock|no_regsub|no_proxy|no_unauth|fold_fix) has changed -- restarting
    This would seem to be a minor nuissance, but unfortunately it seems that mails are arriving in the second or two it takes for Postfix to restart, and are getting rejected or delayed because the service isn't available.
    Looking at the /etc/aliases/postfix file, something seems to be intermittently touching it. I don't see any changes to the file content, but the modification date is updated, and an extended (@) file attribute is added for "com.apple.TextEncoding".
    The only recent changes I have made to my config were to enable SASL with some directives ("smtpd_tls_auth_only = yes" for example) to ensure proper security.
    My servers are running 10.6.5 and 10.6.4. Any suggestions would be appreciated. Thanks.

    Looking at the logs, I'm begining to suspect that the offender is "com.apple.wikid.mailinglists". I don't use group mailing lists so I've disabled this item by adding disabled-true to its plist. Hopefully this solves the problem.

  • Strange behaviour on text insert into a HTML pane

    Hi all,
    I am trying to fix a problem on inserting a span tag into an existing html page (in an EDITABLE JEditorPane).
    The behaviour:
    Assuming the cells in a table (3 rows, 2 columns) are numbered from 1 to 6, with cell one being the top left most, cell 2 top right, cell 3 middle left, etc.
    1. Inserting the text "<span></span>" in cell 4 causes during any attempt to later type into cell 5 the characters to be appended instead into cell 4, directly after the close span tag.
    2. The insertion in the first place behaves strange. If I have the caret positioned for cell 5 so that I can insert there
    (via the function void javax.swing.text.html.HTMLEditorKit.insertHTML(HTML Document doc, int offset, String html, int popDepth, int pushDepth, Tag insertTag) )
    even though the caret position is visible in cell 5, the insertion seems to take place in cell 4.
    I can sort of compensate for this by adding 1 to the offset. However, then when inserting into a line of text, for example, "the quick red fox jumped over the lazy dog"
    I insert directly before the 'j' in 'jumped', the insertion looks like this "the quick red fox j<span>..</span>umped over the lazy dog"
    So that is no solution.
    IMPORTANT! Just to prove it is not the span tag causing the trouble, if this span tag already exists in a cell on 'Load' of the html file, the strange behaviour is not observed.
    Something is going wrong here. It is me? Or is it a bug?
    Please help!!
    Here is a test app, and the test html you can use (place in current directory).
    Please test like this:
    1. run application (the html should be loaded into the pane)
    2. the span tag is programmed to automatically insert at cell 4 (by using the +1 method on the insert)
    3. another span tag was already existing in the html file, at cell 8
    4. Attempt to type into cell 5
    result: the text appears instead at cell 4
    5. Type into cell 9
    result: the text correctly is entered into cell 9
    See the difference!!
    Help!
    The test java app:
    package small.test;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.StringReader;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    import javax.swing.text.JTextComponent;
    import javax.swing.text.html.HTML;
    import javax.swing.text.html.HTMLDocument;
    import javax.swing.text.html.HTMLEditorKit;
    import javax.swing.text.html.parser.ParserDelegator;
    public class HtmlInsertTest extends JEditorPane
         public HtmlInsertTest()
         public static void main(String args[])
              JFrame frame = new JFrame("Loading/Saving Example");
              Container content = frame.getContentPane();
              frame.setSize(600, 600);
              final HtmlInsertTest editorPane = new HtmlInsertTest();
              editorPane.setEditable(true);
              JScrollPane scrollPane = new JScrollPane(editorPane);
              content.add(scrollPane, BorderLayout.CENTER);
              editorPane.setEditorKit(new HTMLEditorKit());
              JPanel panel = new JPanel();
              content.add(panel, BorderLayout.SOUTH);
              frame.setSize(600, 600);
              doLoadCommand(editorPane);
              editorPane.insertHTML("<span>inserted text</span>", 84);
              frame.setVisible(true);
         public static String getHTML()
              return
              "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"+
              "<HTML>"+     "<HEAD>"+
              "     <META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"text/html; charset=utf-8\">"+
              "     <TITLE></TITLE>"+          
              "</HEAD>"+
              "<BODY LANG=\"en-AU\" DIR=\"LTR\">"+
              "<P STYLE=\"margin-bottom: 0cm\">This is a test xhtml document. "+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">Here is a table:</P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <p></p>"+
               "     <TABLE WIDTH=100% BORDER=1 BORDERCOLOR=\"#000000\" CELLPADDING=4 CELLSPACING=0>"+
         "          <TR VALIGN=TOP>"+
         "               <TD WIDTH=50%>"+
         "                    <P>It has</P>"+
         "               </TD>"+
         "               <TD WIDTH=50%>"+
         "                    <P>2 columns</P>"+
         "               </TD>"+
         "          </TR>"+
         "          <TR VALIGN=TOP>"+
         "               <TD WIDTH=50%><P>And 4 rows</P></TD>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "          </TR>"+
         "          <TR VALIGN=TOP>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "          </TR>"+
         "          <TR VALIGN=TOP>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "               <TD WIDTH=50%><P><span>existing text</span></P></TD>"+
         "          </TR>"+
         "          <TR VALIGN=TOP>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "               <TD WIDTH=50%><P></P></TD>"+
         "          </TR>"+
         "     </TABLE>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">We will test the drag and drop"+
         "     functionality with this document. "+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">It will be loaded with the hlml editor.</P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     <P STYLE=\"margin-bottom: 0cm\">"+
         "     </P>"+
         "     </BODY>"+
         "     </HTML>";
         public static void doLoadCommand(JTextComponent textComponent)
              StringReader reader = null;
              try
                   System.out.println("Loading");
                   reader = new StringReader(getHTML());
                   // Create empty HTMLDocument to read into
                   HTMLEditorKit htmlKit = new HTMLEditorKit();
                   HTMLDocument htmlDoc = (HTMLDocument)htmlKit.createDefaultDocument();
                   // Create parser (javax.swing.text.html.parser.ParserDelegator)
                   HTMLEditorKit.Parser parser = new ParserDelegator();
                   // Get parser callback from document
                   HTMLEditorKit.ParserCallback callback = htmlDoc.getReader(0);
                   // Load it (true means to ignore character set)
                   parser.parse(reader, callback, true);
                   // Replace document
                   textComponent.setDocument(htmlDoc);
                   System.out.println("Loaded");
              catch (Exception exception)
                   System.out.println("Load oops");
                   exception.printStackTrace();
              finally
                   if (reader != null)
                        reader.close();
         public void insertHTML(String text, int offset)
              SwingUtilities.invokeLater(new insertAction(this, text, offset));
         class insertAction implements Runnable
              String text = "";
              int offset = 0;
              JEditorPane jEditorPane1 = null;
              public insertAction(JEditorPane _jEditorPane1, String _text, int _offset)
                   jEditorPane1 = _jEditorPane1;
                   text = _text;
                   offset = _offset;
              @Override
              public void run()
                   HTMLDocument doc = (HTMLDocument)jEditorPane1.getDocument();
                   HTMLEditorKit kit = (HTMLEditorKit)jEditorPane1.getEditorKit();
                   try
                        System.out.println("reading from string reader");
                        kit.insertHTML(     doc,
                                          offset,//+1
                                          text,
                                          0,//0
                                          0,//0
                                          HTML.Tag.SPAN);
                        System.out.println(jEditorPane1.getText());
                   catch (Exception e)
                        System.out.println("error inserting html: " + e);
    }Edited by: svaens on Jul 16, 2009 6:34 PM
    fix another stuffed up attempt at a SSCCE.

    Well, I know nothing about HTML in JEditorPanes. I have never been able to figure out how insertions work.
    My comment was a warning to others. Some people (like me) avoid answering posting of this type for reasons given in the JavaRanch link. Others will answer anyway. Other might first check the other site to see if they are wasting there time, but they can only do that if a link was posted with the original question.
    The only suggestion I have is to repost the question, (since this posting is now completely off topic) making sure to then respond to this posting stating that a fresh question has been asked so you don't get a discussion going on in two places.

  • Strange behaviour or not?

    Hi all...I'm new in this forum and I have a question to you. I think my curiosity is about the compiler, so I post here.
    I use Java SE 1.5 and 1.6. If I write a simple class like the following
    public class Prova{
    public static void main(String[] args){
    Integer a1=128;
    Integer a2=128;
    /*1*/System.out.println(a1==a2);
    /*2*/System.out.println(a1);
    /*3*/System.out.println(a2);
    I get the following strange result
    /*1*/ prints true if a1 and a2 are both inizialized between -128 and 127 (exactly 256 values, the ones obtainable from a byte) and false for values less then -128 or bigger then 127...
    Is this a strange behaviour or not? Why do I obtain such results?
    please note that /*2*/ and /*3*/ ALWAYS print the declared values (in this case 128).
    thank you!

    Shadow-DK wrote:
    From version 1.5 that declaration began correct and the result was similar to Integer i = new Integer(100);
    No that wouldn't permit caching. Its like Integer i = Integer.valueOf(100);The caching MUST occur for values -128 thru 127, it may occur for other values. I would not rely on caching not occurring outside that range.
    See [the language spec section on boxing conversion|http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7]
    If you aren't sure what the compiler is doing, it can be informative to use the javap command with the -c option to view the classfile.
    Usage: javap <options> <classes>...
    where options include:
       -c                        Disassemble the code
       -classpath <pathlist>     Specify where to find user class files
       -extdirs <dirs>           Override location of installed extensions
       -help                     Print this usage message
       -J<flag>                  Pass <flag> directly to the runtime system
       -l                        Print line number and local variable tables
       -public                   Show only public classes and members
       -protected                Show protected/public classes and members
       -package                  Show package/protected/public classes
                                 and members (default)
       -private                  Show all classes and members
       -s                        Print internal type signatures
       -bootclasspath <pathlist> Override location of class files loaded
                                 by the bootstrap class loader
       -verbose                  Print stack size, number of locals and args for met
                                 If verifying, print reasons for failureBruce

  • Strange behaviour when running parameterized test

    Hello,
    I am using Flex 4.5 and FlexUnit 4.1 inside of the Flashdevelop IDE and I am experiencing some very strange behaviour.
    If I have 5 parameters to my test the test runs fine. When I add a sixth parameter of the type Array, I get the following error:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    Please see below for my example code.
    The following parameterized test case runs without a problem:
    package {
        import org.flexunit.runners.Parameterized;
        [RunWith('org.flexunit.runners.Parameterized')]
        public class ParameterizedTest {
            [Parameters]
            public static var testData:Array = [
                [1,1,new Array(),1,1]
            public function ParameterizedTest(
                param1:uint,
                param2:uint,
                param3:Array,
                param4:uint,
                param5:uint
            ):void {
            [Test]
            public function testOne():void {
                // Test to go here.
    When I add an Array as the sixth parameter :
    package {
        import org.flexunit.runners.Parameterized;
        [RunWith('org.flexunit.runners.Parameterized')]
        public class ParameterizedTest {
            [Parameters]
            public static var testData:Array = [
                [1,1,new Array(),1,1,new Array()]
            public function ParameterizedTest(
                param1:uint,
                param2:uint,
                param3:Array,
                param4:uint,
                param5:uint,
                param6:Array
            ):void {
            [Test]
            public function testOne():void {
                // Test to go here.
    I get this error :
    com.berog.proj_drum_machine.tests.matrix_test_suite.test_cases::MatrixConstructorTest.test One (1,1,,1,1,) .
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at flex.lang.reflect::Constructor/newInstanceApply()[E:\hudson\jobs\FlexUnit4-Flex4.1\worksp ace\FlexUnit4\src\flex\lang\reflect\Constructor.as:253]
        at TestClassRunnerForParameters/createTest()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\Flex Unit4\src\org\flexunit\runners\Parameterized.as:455]
        at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()[E:\hudson\jobs\FlexUnit4-Fl ex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:314]
        at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4 .1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:152]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Parameterized/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runners\Parameterized.as:273]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUni t4\src\org\flexunit\runners\Suite.as:151]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUni t4\src\org\flexunit\runners\Suite.as:151]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()[E:\hudson\jobs\FlexUnit4-Flex4.1 \workspace\FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:348]
        at org.flexunit.runner::FlexUnitCore/runRunner()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\ FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:307]
        at org.flexunit.runner::FlexUnitCore/runRequest()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:283]
        at org.flexunit.runner::FlexUnitCore/runClasses()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:269]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at org.flexunit.runner::FlexUnitCore/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUn it4\src\org\flexunit\runner\FlexUnitCore.as:245]
        at com.berog.proj_drum_machine.tests::TestMain()[E:\Actionscript\projects\DrumMachine\src\co m\berog\proj_drum_machine\tests\TestMain.as:18]
    com.berog.proj_drum_machine.tests.matrix_test_suite.test_cases::MatrixConstructorTest.test One (1,1,,1,1,) E
    Time: 0.013
    There was 1 failure:
    1 com.berog.proj_drum_machine.tests.matrix_test_suite.test_cases::MatrixConstructorTest.tes tOne (1,1,,1,1,) TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at flex.lang.reflect::Constructor/newInstanceApply()[E:\hudson\jobs\FlexUnit4-Flex4.1\worksp ace\FlexUnit4\src\flex\lang\reflect\Constructor.as:253]
        at TestClassRunnerForParameters/createTest()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\Flex Unit4\src\org\flexunit\runners\Parameterized.as:455]
        at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()[E:\hudson\jobs\FlexUnit4-Fl ex4.1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:314]
        at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()[E:\hudson\jobs\FlexUnit4-Flex4 .1\workspace\FlexUnit4\src\org\flexunit\runners\BlockFlexUnit4ClassRunner.as:152]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Parameterized/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runners\Parameterized.as:273]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUni t4\src\org\flexunit\runners\Suite.as:151]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runners::Suite/runChild()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUni t4\src\org\flexunit\runners\Suite.as:151]
        at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()[E:\hudson\jobs\FlexUni t4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ChildRunnerSequencer.as: 82]
        at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\ statements\StatementSequencer.as:141]
        at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()[E:\hudson\jobs\F lexUnit4-Flex4.1\workspace\FlexUnit4\src\org\flexunit\internals\runners\statements\Stateme ntSequencer.as:109]
        at org.flexunit.runners::ParentRunner/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexU nit4\src\org\flexunit\runners\ParentRunner.as:483]
        at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()[E:\hudson\jobs\FlexUnit4-Flex4.1 \workspace\FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:348]
        at org.flexunit.runner::FlexUnitCore/runRunner()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\ FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:307]
        at org.flexunit.runner::FlexUnitCore/runRequest()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:283]
        at org.flexunit.runner::FlexUnitCore/runClasses()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace \FlexUnit4\src\org\flexunit\runner\FlexUnitCore.as:269]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at org.flexunit.runner::FlexUnitCore/run()[E:\hudson\jobs\FlexUnit4-Flex4.1\workspace\FlexUn it4\src\org\flexunit\runner\FlexUnitCore.as:245]
        at com.berog.proj_drum_machine.tests::TestMain()[E:\Actionscript\projects\DrumMachine\src\co m\berog\proj_drum_machine\tests\TestMain.as:18]
    FAILURES!!! Tests run: 1, 1 Failures:
    Can anyone help me?

    Actually, I do see what's wrong.
    When you call a method in the ActionScript universe, you can can usually do a function.apply() and pass it a variable number of args. Unfortunately, constructors are the one type of method where this doesn't work. You can't actually do an apply() so we have to fake it by having a map of static functions which each know how to apply a given number of arguments to the constructor. There is a check in the code that tests if the number of arguments you have exceeds what our static map knows how to apply.
    It looks like that check should have thrown the error:
    throw new ArgumentError("Sorry, we can't support constructors with more than " + argMap.length + " args out of the box... yes, its dumb, take a look at Constructor.as to modify on your own");
    It didn't and I am guessing its because there is a border condition here. So, what happening is that we only support up to 5 arguments right now. That number is arbitrary. When it was written it just seemed like a reasonable number, however, this class was written before Parameterized testing was introduced.
    Your three choices right now would be to use the TestNG style of Parameterized testing, which uses functions and not constructor args so it will not suffer this same fate, change the code and compile flexunit for yourself, or we could put a patched Constructor class in your project which fixes it. Longer term, I would like you to file a bug that we should increase the number to 10 or some other quasi-reasonable number. We will never be able to support an infinite number and we will always need to pick som arbitrary line in the sand. It just seems our line should be farther out.
    Mike

  • Strange behaviour of Mouse-Events and Range size

    Hello,
    i found a strange behaviour of the Paragraph-Ranges in Word and can't explain this myself.
    I have a add-in with a Custom Task Pane "UserControl1" and a button "Button1":
    dropbox.com/s/zz2m0out5rvds0m/word.jpg
    This is the Code for the user control:
    public partial class UserControl1 : UserControl
    public UserControl1()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    showRanges();
    private void button1_MouseEnter(object sender, EventArgs e)
    showRanges();
    private void showRanges()
    Debug.WriteLine("-------------------------------------");
    foreach (Microsoft.Office.Interop.Word.Paragraph para in Globals.ThisAddIn.Application.ActiveDocument.Paragraphs)
    Debug.WriteLine(para.Range.Start.ToString() + " - " + para.Range.End.ToString() + " | " + para.Range.Text.ToString());
    The mouse-enter and mouse-click events of the button, prints out the ranges of the current paragraphs. In this example it outputs:
    0 - 15 | The first line
    15 - 32 | And a second one
    Thats fine!
    And now the strange stuff starts: When i change something in the first line in the document like "The VERY first line" and use the button again, i got different range outputs for mouse-enter and mouse-click events.
    mouse-enter event (wrong ranges):
    -------------------------------------0 - 143 | The VERY first line
    143 - 160 | And a second one
    mouse-click event (correct ranges):
    0 - 20 | The VERY first line
    20 - 37 | And a second one
    Why the hell I get wrong Ranges when I use the mouse-enter event??? (When I enter the button with mouse a second time, it shows the correct ranges again).

    Hi Torben,
    What is Word version?
    According to my test in Word 2013, the code you provided works fine for me.
    I changed the code as below:
    private void showRanges(string eventname)
    Debug.WriteLine(eventname + "-------------------------------------");
    foreach (Microsoft.Office.Interop.Word.Paragraph para in Globals.ThisAddIn.Application.ActiveDocument.Paragraphs)
    Debug.WriteLine(para.Range.Start.ToString() + " - " + para.Range.End.ToString() + " | " + para.Range.Text.ToString());
    private void button1_MouseEnter(object sender, EventArgs e)
    showRanges("Button MouseEnter");
    private void button1_Click(object sender, EventArgs e)
    showRanges("Button Click");
    The document:
    The output:
    The result is same.
    There might be something else at the end of the first line.
    If you change current document to .zip and find document.xml, what does it look like?
    Here is my document.xml:
    <w:body>
    <w:p w:rsidR="001347D9" w:rsidRPr="001511D8" w:rsidRDefault="001511D8">
    <w:pPr>
    <w:rPr>
    <w:sz w:val="72"/><w:szCs w:val="72"/>
    </w:rPr>
    </w:pPr>
    <w:r w:rsidRPr="001511D8">
    <w:rPr>
    <w:sz w:val="72"/>
    <w:szCs w:val="72"/>
    </w:rPr>
    <w:t>The VERY first line</w:t>
    </w:r>
    </w:p>
    <w:p w:rsidR="001511D8" w:rsidRPr="001511D8" w:rsidRDefault="001511D8" w:rsidP="001511D8">
    <w:pPr>
    <w:rPr>
    <w:sz w:val="72"/><w:szCs w:val="72"/>
    </w:rPr>
    </w:pPr>
    <w:r w:rsidRPr="001511D8">
    <w:rPr>
    <w:sz w:val="72"/>
    <w:szCs w:val="72"/>
    </w:rPr>
    <w:t>And a second one</w:t>
    </w:r>
    <w:bookmarkStart w:id="0" w:name="_GoBack"/>
    <w:bookmarkEnd w:id="0"/>
    </w:p>
    <w:sectPr w:rsidR="001511D8" w:rsidRPr="001511D8">
    <w:pgSz w:w="12240" w:h="15840"/>
    <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
    <w:cols w:space="720"/>
    <w:docGrid w:linePitch="360"/>
    </w:sectPr>
    </w:body>
    Is there anything different?
    I have uploaded the sample document for your test, please check:
    https://onedrive.live.com/redir?resid=AD77AE76D657E280!166&authkey=!AFfIP0eVTDQdMAc&ithint=file%2cdocx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Strange Behaviour in Pentium IV machine

    Hi all. I put this post in Java HotSpot forum, but that forum seems not to be as popular as this, so I've decided to post it here too.
    I've been reading posts in this forum (and another in this site) for more than a week trying to find any idea that could help me with my "strange" problem, but with no success.
    I've developed an application that manages some info stored in Mysql. My developing machine is a Pentium II (400MHz) with Red Hat 7.3 Valhalla installed. I use Mysql 3.23.49 and J/Connector (version 2.0.14) downloaded from Mysql site and JRE version 1.4.1.-b21.
    The production machine is a Pentium IV (1.60 GHz) , with the same Red Hat version, the same JRE version and Mysql 3.23.51.
    Well, in developing machine I am able to run up to 4 instances of the application witout crashing, only decreasing timing performance. But in production machine, I get and "strange" behaviour. Sometimes (1 of each 10 times) the application crashes (even the machine crashes sometimes), and I get Hot Spot log files (hs_err_pid####.log) like these
    Type 1 ------------------------------------->
    Unexpected Signal : 11 occurred at PC=0x403291D8
    Function=skip_method_invoke_and_aux_frames__12vframeStream+0x58
    Library=/usr/java/j2sdk1.4.1/jre/lib/i386/client/libjvm.so
    Current Java thread:
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.io.Converters.getDefaultEncodingName(Converters.java:66)
    at java.lang.StringCoding.decode(StringCoding.java:226)
    at java.lang.String.<init>(String.java:383)
    at com.mysql.jdbc.Buffer.readLenString(Unknown Source)
    at com.mysql.jdbc.MysqlIO.getResultSet(Unknown Source)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
    at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source)
    at com.mysql.jdbc.Connection.execSQL(Unknown Source)
    - locked <0x448f92d0> (a com.mysql.jdbc.jdbc2.IO)
    at com.mysql.jdbc.Connection.execSQL(Unknown Source)
    at com.mysql.jdbc.Statement.executeQuery(Unknown Source)
    - locked <0x448f92d0> (a com.mysql.jdbc.jdbc2.IO)
    at com.mysql.jdbc.jdbc2.Statement.executeQuery(Unknown Source)
    at GeneraTablaDiasCerrados.<init>(GeneraTablaDiasCerrados.java:99)
    at GeneraTablaDiasCerrados.main(GeneraTablaDiasCerrados.java:425)
    Type 2------------------------------------------------>
    Unexpected Signal : 11 occurred at PC=0x424AC980
    Function=sqlQueryDirect (//or nextRow//) (compiled Java code) (or nextRow)
    Library=(N/A)
    Current Java thread: (//No output in this case//)
    Type 3------------------------------------------------------>
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 11 occurred at PC=0x4212E3B0
    Function=(null)+0x4212E3B0
    Library=java
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    - locked <0x44901b38> (a java.io.BufferedInputStream)
    at com.mysql.jdbc.MysqlIO.readPacket(Unknown Source)
    at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source)
    at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source)
    at com.mysql.jdbc.Connection.execSQL(Unknown Source)
    - locked <0x448f92e8> (a com.mysql.jdbc.jdbc2.IO)
    at com.mysql.jdbc.Connection.execSQL(Unknown Source)
    at com.mysql.jdbc.Statement.executeQuery(Unknown Source)
    - locked <0x448f92e8> (a com.mysql.jdbc.jdbc2.IO)
    at com.mysql.jdbc.jdbc2.Statement.executeQuery(Unknown Source)
    at GeneraTablaDiasCerrados.<init>(GeneraTablaDiasCerrados.java:99)
    at GeneraTablaDiasCerrados.main(GeneraTablaDiasCerrados.java:425)
    ---------------------------------------------->
    After this text, I get Dynamic libraries info.
    I can't figure out what's happening. I have read in these forums that Signal 11 is about Segmentation Fault, or JVM trying to write in forbidden positions.
    Later I read that JVM could crash on Pentium IV processors under certain circumstances, but isn't those issues supossed to be fixed in version 1.4.1?
    The last trail I'm following is J/Connector, because in error messages type 2 and 3 are involved mysql classes. But it doesn't explain the fact that in developing machine everything runs properly.
    I also consider the posibility of corrupted files in hard disk, but all of them seem to be OK (sizes in production machine matches those in developing machine).
    Can anyone help me showing me another trail to follow?
    Thanks to all in advance.
    Note: Please, forgive my English and the length of this post.

    Hi OMcGovern. Thanks for your answer.
    I've a couple of theorys,
    1) The second last stack trace call is for encoding.
    The basic US version of the JRE only supports about
    ut 8 basic encoding schemes. You could try running it
    with the international version of the JRE.
    ( To check version : if i18n.jar is in JRE's lib
    directory, it's the international version )I've checked it and I don't have the international version (not in production machine and not in developing machine). I downloaded the "Linux RPM in self-extracting file" version, (in both cases) and there is no choice for downloading any "international" version or something like this. I'll search for it in sun site. It seems to be a good guess to follow, because production machine is allocated in the USA, and developing machine is here in Spain.
    2) Running java -Xint ( interpreted mode ), might
    rule out any hotspot errors. It could give you more
    debugging information too.
    Worth a shot.I'm not running with that option.
    3) It doesn't quite make sense that the last stack
    trace entry is a
    security call, in an application. Are you doing
    ng anything strange ?
    Eg. writing your own classloaders or the like ?No I'm not doing. Maybe a problem with J/Connector, but my deep doubt and what's driving me crazy is : Why is runnig all ok (I was really proud of this fact because this is my first "big" app in Java) in my developing machine and crashing in production machine?
    I'll look for i18n.jar, will install it and let's see what happens..
    Thanks again.

  • APEX Listener and EPG - strange behaviour

    Hi
    For some years, I've used EPG for APEX but have struggled with performance particularly as I can have up to 150 student developers using at any one time.
    I do a fair amount of work using ORDImage and have successfully developed APEX applications to upload image files and display full-size and thumbnail images.
    After upgrading to APEX 4.1 (from 4.0), I decided to install APEX Listener standalone.
    Before I did so I checked that my applications still worked in 4.1 and they did.
    However, just installing APEX Listener but not configuring it (yet) has meant that my image display in a report using a procedure based on wpg_docload.download_file( l_ordimage_image.source.localData ) no longer works in EPG - the images are not displayed.
    Configuring APEX Listener and running the same application through that DOES display the images.
    So this part of the application works under APEX Listener but not under EPG.
    My application also allows users to upload images from APEX_APPLICATION_FILES using standard code. Under APEX Listener after uploading, I'm left with a blank page with a wwv_flow.accept URL although the image does indeed upload. Under EPG it works as expected and I get a success confirmation.
    So this part of the application works under EPG but not under APEX Listener.
    Has anyone else come across different behaviour depending on the mode of connection?
    Thanks
    Brian
    [Oracle EE 11gR2, Windows Server 2008R2, APEX 4.1, APEX Listener 1.1.3]

    Hi Brian,
    it sounds like you have both EPG and APEX Listener running on the same machine, so your problem might result from a port conflict. Note that both services use TCP port 8080 as default.
    At least a port conflict would explain the strange behaviour in your case, some things working on one web server and some on the other.
    Some parts of your initial post hint to that direction, e.g.
    However, just installing APEX Listener but not configuring it (yet) has meant that my image display in a report using a procedure based on >wpg_docload.download_file( l_ordimage_image.source.localData ) no longer works in EPG - the images are not displayed.... because the APEX Listener only interfere with the EPG if it is at least running on the same machine as your database and furthermore, if it is unconfigured in terms of ist database connection, a port conflict might be the only way it could cause anything like that.
    However, if you are sure that's not the issue, please check if you see any error in the APEX Listener's log for the following action you performed:
    My application also allows users to upload images from APEX_APPLICATION_FILES using standard code. Under APEX Listener after uploading, I'm left with a blank >page with a wwv_flow.accept URL although the image does indeed uploadIf you actually see just a blank screen, something very bad must have happened and you should see some kind of stack trace there.
    For further investigations, if necessary, it would be helpful to know how you deployed or started your APEX Listener and which JDK version you use.
    For the moment, I still think the port conflict is my best guess.
    You could avoid it by either changing the port for EPG (I'd not recommend that if you have other users still using it) or by changing the port for your APEX Listener.
    -Udo

  • Strange behaviour of Runtime.getRuntime().exec(command)

    hello guys,
    i wrote a program which executes some commands in commandline (actually tried multiple stuff.)
    what did i try?
    open "cmd.exe" manually (administrator)
    type "echo %PROCESSOR_ARCHITECTURE%" and hit enter, which returns me
    "AMD64"
    type "java -version" and hit enter, which returns me:
    "java version "1.6.0_10-beta"
    Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
    Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)"
    type "reg query "HKLM\SOFTWARE\7-zip"" returns me:
    HKEY_LOCAL_MACHINE\SOFTWARE\7-zip
    Path REG_SZ C:\Program Files\7-Zip\
    i wrote two functions to execute an command
    1) simply calls exec and reads errin and stdout from the process started:
    public static String execute(String command) {
              String result = "";
              try {
                   // Execute a command
                   Process child = Runtime.getRuntime().exec(command);
                   // Read from an input stream
                   InputStream in = child.getInputStream();
                   int c;
                   while ((c = in.read()) != -1) {
                        result += ((char) c);
                   in.close();
                   in = child.getErrorStream();
                   while ((c = in.read()) != -1) {
                        result += ((char) c);
                   in.close();
              } catch (IOException e) {
              return result;
         }the second function allows me to send multiple commands to the cmd
    public static String exec(String[] commands) {
              String line;
              String result = "";
              OutputStream stdin = null;
              InputStream stderr = null;
              InputStream stdout = null;
              // launch EXE and grab stdin/stdout and stderr
              try {
                   Process process;
                   process = Runtime.getRuntime().exec("cmd.exe");
                   stdin = process.getOutputStream();
                   stderr = process.getErrorStream();
                   stdout = process.getInputStream();
                   // "write" the parms into stdin
                   for (int i = 0; i < commands.length; i++) {
                        line = commands[i] + "\n";
                        stdin.write(line.getBytes());
                        stdin.flush();
                   stdin.close();
                   // clean up if any output in stdout
                   BufferedReader brCleanUp = new BufferedReader(
                             new InputStreamReader(stdout));
                   while ((line = brCleanUp.readLine()) != null) {
                        result += line + "\n";
                   brCleanUp.close();
                   // clean up if any output in stderr
                   brCleanUp = new BufferedReader(new InputStreamReader(stderr));
                   while ((line = brCleanUp.readLine()) != null) {
                        result += "ERR: " + line + "\n";
                   brCleanUp.close();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return result;
         }so i try to execute the commands from above (yes, i am using \\ and \" in java)
    (1) "echo %PROCESSOR_ARCHITECTURE%"
    (2) "java -version"
    (3) "reg query "HKLM\SOFTWARE\7-zip""
    the first function returns me (note that ALL results are different from the stuff above!):
    (1) "" <-- empty ?!
    (2) java version "1.6.0_11"
    Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
    Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
    (3) ERROR: The system was unable to find the specified registry key or value.
    the second function returns me:
    (1) x86 <-- huh? i have AMD64
    (2) java version "1.6.0_11"
    Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
    Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
    (3) ERROR: The system was unable to find the specified registry key or value.
    horray! in this version the java version is correct! processor architecture is not empty but totally incorrect and the reg query is still err.
    any help is wellcome
    note: i only put stuff here, which returns me strange behaviour, most things are working correct with my functions (using the Runtime.getRuntime().exec(command); code)
    note2: "reg query "HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0" /t REG_SZ" IS working, so why are "some" queries result in ERR, while they are working if typed by hand in cmd.exe?

    ok, i exported a jar file and execute it from cmd:
    java -jar myjar.jar
    now the output is:
    (1) "" if called by version 1, possible to retrieve by version 2 (no clue why!)
    (2) "java version "1.6.0_10-beta"
    Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
    Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)"
    (3) C:\Program Files\7-Zip\
    so all three problems are gone! (but its a hard way, as i need both functions and parse a lot of text... :/ )
    thanks for the tip, that eclipse changes variables (i really did not knew this one...)

  • Strange behaviour: two servers on the same port

    Hi!
    I hope this is the right section for this post. I need help about a strange behaviour involving a ServerSocket.
    For my thesis I need to write a program that receives data from a pre-existing DSMS client, filters them and then sends them to a pre-existing DSMS server. And here is my problem: if I try to create a ServerSocket on the same port of the DSMS server, my program throws no exception, and the servers seem running on the same port. This is a behaviour that I'd like to avoid, but I cannot understand what the problem is. Can you help me?
    The source code of the DSMS server can be found here (it's written in C++): http://infolab.stanford.edu/stream/code/stream-0.6.0.tar.gz
    The source code of my server class, instead, is this one:
    import java.io.*;
    import java.net.*;
    public class ThreadGenerator {
         private ServerSocket server;
         public void connect(String servPort, String cHost, String cPort) {
              try {
                   server = new ServerSocket(servPort);
                   System.out.println("SERVER running on port "+servPort);
              } catch (BindException e) {
                   System.out.println("Address already in use!");
              } catch (Exception e) {
                   System.err.println(e);
              try {
                   while(true){
                        Socket client = server.accept();
                        StreamThread T = new StreamThread(client, cHost, cPort);
                        T.start();
              } catch (EOFException e) {
                   System.out.println("Server closed connection!");
              } catch (Exception e) {
                   System.err.println(e);
    }I'm programming on Mac OSX Tiger, with Java 1.5.0.
    Thanks in advance for your help.

    The problem is still happening to me, I tried in this very moment. The code I'm using is the one I posted, and the second server is the one that I linked. I don't think there's anything else to add.
    If you're sure that the problem is not in my code, then it means that it is in the linked server, which partially solves the problem. But I'd like to know, if it's possibile, if there is any other way to check if the port is already in use.

  • Windows 8.1 Enterprise Evaluation- Strange behaviour of network adapter

    Hello there are discussions and questions around this community about network adapter dropping connection while system is running. But I have found unique problem with my network adapter driver.
    I have tried to state my problem as clearly as possible. Please ask if any detail is required.
    My network status shows no access on following occasions:
    1. On alternate system wakeups.
        eg:  
    a. System boots up 
    Internet accessible
    no problem
    b. I put system to sleep(first time) and wake it up
    No access to internet !!!
    When I check in network and sharing center not even adapter shows in disabled status.(See video from the link given below).
    c. Without restarting system or without installing network adapter again,  I put system to sleep again and wake it up (2nd time).
    Internet accessible
    d. I put system to sleep for (3rd time) and wakes it up.
    No access to internet!!
    If I put system to sleep again and wake it up definitly I get network access.
    2. If I switch off the modem before windows shutdown completely or in the process of shutdown, next time when I boot system, even though the modem is switched on before booting the system, No internet access tooltip will be shown on network
    sysbol.
    Another strange behaviour is on no internet access status, I start installing adapter, and it loads required files and prompt me to click "next" and "click" install.
    But the thing is before I go to "next" button, I will get network access as shown in this link
    http://youtu.be/sPlXVEiYBeo. Ignore virtualbox adapter. Same behaviour was there when there is no vbox adapter. Same was happening in Windows 8 Pro, but not in windows 7, so that there is no H/W problem I think. 
    Any idea on how to fix this or any alternate solution ? 

    Hi,
    Firstly, access your network adapter official website to get the proper driver applied to your system.
    Then going to Control Panel > Device Manager, right click your adapter > Properties. Under the Power Management tab, make sure "Allow the computer to turn off this device to save power" checkbox unchecked.
    If it still persists, try to disable "fast startup" as below steps:
    1.In Control Panel, open the Power Options item.
    2.Click the Choose what the power buttons do link.
    3.Clear the Turn on fast startup (recommended) check box.
    4.Click Save Settings.
    Karen Hu
    TechNet Community Support

Maybe you are looking for

  • Can't download file hoy-telenovelas-besos-101220.flv to quicklime

    why am i unable to download this file hoy-telenovelas-bess-101220.flv to quicktime player?

  • XML into a table??

    I am making an application that takes an XML file and puts the content into a table. I managed to parse the document with a SAX parser so far, but I am not sure how i can put the parsed results into the table, if anyone has done a similar thing, then

  • Using sql query

    I want to use sql query in interface mapping. how can i do that?

  • What is the role of OSR (Oracle service registry) in CRMOD-EBS PIP

    Hello All, We are installing the PIP Oracle Lead to Order Integration Pack for Oracle CRM On Demand and E-Business Suite 2.5. As per the implementation guide, seems Oracle Service Registry (OSR) 10.3.0.0 is an optional component. Curious to know what

  • Lint to BPS fro WEb Template

    Dear friends, I need a huge helps from you all as based on my requirement. Is it possible to give a link from the web template to the BPS dialoge function where the user can enter the values? Also from the web template chart when i click on a particu