JDK 1.5 bug: FileContentsImpl.setMaxLength()

OK - not only is this a bug, but it's a good example of how incredibly horrid the new logging format is. The bug is in the JWS Swing code that displays a dialog asking the user if they want to increase the maxLength of a file. Here is the smallest relevant part of the log spewage:
(Maybe I wouldn't mind so much if com.sun.deploy.util.LoggerTraceListener was documented and provided an option to "normalize" this)
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614993</millis>
<sequence>146</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message>Exception occurred during event dispatching:
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614993</millis>
<sequence>147</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message>java.lang.IllegalArgumentException: Invalid remove
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614996</millis>
<sequence>148</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at javax.swing.JTextArea.replaceRange(JTextArea.java:505)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614996</millis>
<sequence>149</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.deploy.util.ConsoleWindow$24.run(ConsoleWindow.java:572)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614997</millis>
<sequence>150</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:201)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614997</millis>
<sequence>151</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614997</millis>
<sequence>152</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614997</millis>
<sequence>153</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614997</millis>
<sequence>154</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614998</millis>
<sequence>155</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.Dialog+1.run(Dialog.java:514)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614998</millis>
<sequence>156</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.awt.Dialog.show(Dialog.java:535)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614998</millis>
<sequence>157</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.SmartSecurityDialog.getUserDecision(SmartSecurityDialog.java:110)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>158</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.SmartSecurityDialog.access$100(SmartSecurityDialog.java:22)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>159</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.SmartSecurityDialog$1.run(SmartSecurityDialog.java:67)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>160</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.security.AccessController.doPrivileged(Native Method)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>161</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.SmartSecurityDialog.showDialog(SmartSecurityDialog.java:64)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>162</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.SmartSecurityDialog.showDialog(SmartSecurityDialog.java:59)
</message>
</record>
<record>
<date>2004-02-17T23:13:34</date>
<millis>1077077614999</millis>
<sequence>163</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.PersistenceServiceImpl$10.run(PersistenceServiceImpl.java:362)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615000</millis>
<sequence>164</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at java.security.AccessController.doPrivileged(Native Method)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615001</millis>
<sequence>165</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.PersistenceServiceImpl.askUser(PersistenceServiceImpl.java:356)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615001</millis>
<sequence>166</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.PersistenceServiceImpl.reconcileMaxSize(PersistenceServiceImpl.java:185)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615002</millis>
<sequence>167</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.PersistenceServiceImpl.checkSetMaxSize(PersistenceServiceImpl.java:168)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615002</millis>
<sequence>168</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.PersistenceServiceImpl.setMaxLength(PersistenceServiceImpl.java:97)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615002</millis>
<sequence>169</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.sun.jnlp.FileContentsImpl.setMaxLength(FileContentsImpl.java:143)
</message>
</record>
<record>
<date>2004-02-17T23:13:35</date>
<millis>1077077615003</millis>
<sequence>170</sequence>
<logger>com.sun.deploy</logger>
<level>FINE</level>
<class>com.sun.deploy.util.LoggerTraceListener</class>
<method>print</method>
<thread>10</thread>
<message> at com.wss.c.setNewMaxLength(c.java:1697)
</message>
</record>

I just wanted to add that this is a showstopper for me as the TV-listings data just doesn't fit in the 256KB default size.

Similar Messages

  • Jdk 1.5 bugs

    I sent these to the provided feedback email, but that felt a little too much like a black hole, so I figured that I would post those issues here as well. Please let me know if there is a more appropriate forum. Also, my apologies if these problems have been mentioned before.
    I have noticed runtime and/or compiler errors with the following pieces of code:
    Example:
    List<Integer> list = new ArrayList<Integer>();
    list.add(1);
    for (int i : list) {}
    Error (run-time):
    Exception in thread "main" java.lang.VerifyError: (class: Test1, method: main si
    gnature: ([Ljava/lang/String;)V) Expecting to find integer on stack
    Example:
    int[] array = new int[1];
    array[0] = 1;
    for (Integer i : array) {}
    Error (compile-time):
    An exception has occurred in the compiler (1.5.0-beta). Please file a bug at the
    Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after ch
    ecking the Bug Parade for duplicates. Include your program and the following dia
    gnostic in your report. Thank you.
    java.lang.ArrayIndexOutOfBoundsException: -1
    at com.sun.tools.javac.jvm.Code$State.pop(Code.java:1505)
    at com.sun.tools.javac.jvm.Code.emitop0(Code.java:588)
    at com.sun.tools.javac.jvm.Items$Item.coerce(Items.java:233)
    at com.sun.tools.javac.jvm.Items$Item.coerce(Items.java:246)
    at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:803)
    at com.sun.tools.javac.jvm.Gen.visitVarDef(Gen.java:954)
    at com.sun.tools.javac.tree.Tree$VarDef.accept(Tree.java:502)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:648)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:669)
    at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:720)
    at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:967)
    at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:531)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:648)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:669)
    at com.sun.tools.javac.jvm.Gen.genLoop(Gen.java:1013)
    at com.sun.tools.javac.jvm.Gen.visitForLoop(Gen.java:984)
    at com.sun.tools.javac.tree.Tree$ForLoop.accept(Tree.java:577)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:648)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:669)
    at com.sun.tools.javac.jvm.Gen.genStats(Gen.java:720)
    at com.sun.tools.javac.jvm.Gen.visitBlock(Gen.java:967)
    at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:531)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:648)
    at com.sun.tools.javac.jvm.Gen.genStat(Gen.java:683)
    at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:905)
    at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:841)
    at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:473)
    at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:648)
    at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2167)
    at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:321)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:460)
    at com.sun.tools.javac.main.Main.compile(Main.java:584)
    at com.sun.tools.javac.main.Main.compile(Main.java:536)
    at com.sun.tools.javac.Main.compile(Main.java:41)
    at com.sun.tools.javac.Main.main(Main.java:32)
    Example:
    List<Double> list = new ArrayList<Double>();
    list.add(1.0);
    list.add(2);
    for (Double d : list) { System.out.println(d); }
    Error (run-time):
    1.0
    Exception in thread "main" java.lang.ClassCastException: java.lang.Integer
    at Test1.main(Test1.java:13)
    Sincerely,
    Kevin Regan

    The first example maybe is a normal "feature" hidden somewhere in the specs. It would read something like: "No autoboxing in extended for loops".
    The second example is clearly a bug. It either compiles or not, it should never crash.
    The third example maybe is the appropriate behavior.
    This is a list of Double declared here. Then you add an int to the list.
    I don't think the boxing conversion should convert int to Double.

  • Can not getReadMethod a jdk 1.5 bug?

    import junit.framework.TestCase;
    import org.apache.commons.lang.builder.ToStringBuilder;
    import org.apache.commons.lang.builder.ToStringStyle;
    import org.apache.taglibs.standard.lang.jstl.BeanInfoManager;
    import org.apache.taglibs.standard.lang.jstl.BeanInfoProperty;
    import org.apache.taglibs.standard.lang.jstl.ELException;
    import org.apache.taglibs.standard.lang.jstl.Logger;
    import java.beans.BeanInfo;
    import java.beans.Introspector;
    import java.beans.PropertyDescriptor;
    import java.io.PrintStream;
    public class BeanInfoPropertyTest extends TestCase {
    public Integer[] getPro1() {
    return null;
    public Integer[] getPro1(String n) {
    return null;
    public Integer[] getPro2() {
    return null;
    public Integer[] getPro2(int n) {
    return null;
    // public void testPro1() throws ELException {
    // BeanInfoProperty property = BeanInfoManager.getBeanInfoProperty(BeanInfoPropertyTest.class,
    // "pro1", new Logger(new PrintStream(System.out)));
    // System.out.println(ToStringBuilder.reflectionToString(property,
    // ToStringStyle.MULTI_LINE_STYLE, true));
    // assertNotNull(property.getReadMethod());
    // public void testPro2() throws ELException {
    // BeanInfoProperty property = BeanInfoManager.getBeanInfoProperty(BeanInfoPropertyTest.class,
    // "pro2", new Logger(new PrintStream(System.out)));
    // System.out.println(ToStringBuilder.reflectionToString(property,
    // ToStringStyle.MULTI_LINE_STYLE, true));
    // assertNotNull(property.getReadMethod());
    public void testC() {
         Class c=BeanInfoPropertyTest.class;
    try {
    BeanInfo tagClassInfo = Introspector.getBeanInfo(c);
    PropertyDescriptor[] pd = tagClassInfo.getPropertyDescriptors();
    for (int i = 0; i < pd.length; i++) {
    String name = pd.getName();
    System.err.println(name + " displayName = " +
    pd[i].getDisplayName());
    System.err.println(name + " propertyType = " +
    pd[i].getPropertyType());
    System.err.println(name + " readMethod = " +
    pd[i].getReadMethod());
    System.err.println(name + " writeMethod = " +
    pd[i].getWriteMethod());
    } catch (Throwable v) {
    v.printStackTrace();
    result test with jdk1.4.2_05
    class displayName = class
    class propertyType = class java.lang.Class
    class readMethod = public final native java.lang.Class java.lang.Object.getClass()
    class writeMethod = null
    name displayName = name
    name propertyType = class java.lang.String
    name readMethod = public java.lang.String junit.framework.TestCase.getName()
    name writeMethod = public void junit.framework.TestCase.setName(java.lang.String)
    pro1 displayName = pro1
    pro1 propertyType = class [Ljava.lang.Integer;
    pro1 readMethod = public java.lang.Integer[] com.alibaba.waf.tag.BeanInfoPropertyTest.getPro1()
    pro1 writeMethod = null
    pro2 displayName = pro2
    pro2 propertyType = class [Ljava.lang.Integer;
    pro2 readMethod = public java.lang.Integer[] com.alibaba.waf.tag.BeanInfoPropertyTest.getPro2()
    pro2 writeMethod = null
    result test with jdk1.5.0_6
    class displayName = class
    class propertyType = class java.lang.Class
    class readMethod = public final native java.lang.Class java.lang.Object.getClass()
    class writeMethod = null
    name displayName = name
    name propertyType = class java.lang.String
    name readMethod = public java.lang.String junit.framework.TestCase.getName()
    name writeMethod = public void junit.framework.TestCase.setName(java.lang.String)
    pro1 displayName = pro1
    pro1 propertyType = class [Ljava.lang.Integer;
    pro1 readMethod = public java.lang.Integer[] com.alibaba.waf.tag.BeanInfoPropertyTest.getPro1()
    pro1 writeMethod = null
    pro2 displayName = pro2
    pro2 propertyType = null
    pro2 readMethod = null
    pro2 writeMethod = null
    Why pro2 readMethod is null ,can anyone explain it

    i change the code ,but the result not change
    What?
    Please use code formatting when you post code. See formatting tips:
    http://forum.java.sun.com/help.jspa?sec=formatting
    Kaj

  • JDK 6:  requestPasswordAuthentication called multiple times

    Hi...
    Has anyone else noticed that 'requestPasswordAuthentication' gets called multiple times from HTTPURLConnection in JDK 6? If I create an HTTPURLConnection, and it returns successfully from 'openConnection', if I then do something simple like query for its contentType via 'getContentType', a call to my authenticator requesting password authentication is made MULTIPLE times...
    In JDK 1.5, it was only made once in the same scenario.
    Have there been changes in the recent release that would require me to make changes to my authenticator or to supply more information?
    Thanks!
    Kelly

    We had a problem with NTLM authentication in 1.5 and Java SE 6, which may be the problem that you are seeing. There were actually two bugs in the same area that were fixed, 6520665 and 6357133.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6520665
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6357133
    Both these bugs were fixed in the following releases:
    jdk 7 b12
    jdk 6 u3 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=2148156
    jdk 5u13 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=2149272
    I know that none of these releases are available yet except for jdk7. There is an early access version available from http://download.java.net/jdk7/binaries/ . Maybe you could install it an see if it resolves your problem.

  • JDK1.2.2.12 concurrent GC algorithm (incmarksweep) bug?

    Hi all,
    I have a jdk run time bug. Could you please help me?
    We are currently using Sun JDK 1.2.2.12 native threads. The operating system is Sun Solaris 2.8. Hardware is Sun Netra model 1405 with four processors (sparcv9 processor operates at 440 MHz with sparcv9 floating point processor) and 2G memory. We are using some concurrent GC options as following:
    /usr/jdk1.2.2_12/bin/sparc/native_threads/java -Xgenconfig:4m,4m,semispaces:256m,1200m,incmarksweep
    We had several core dumps with above configuration during long time performance tests last week. The frequency is about twice a week. The output on console is as following:
    SIGSEGV 11 segmentation violation
    si_signo [11]: SEGV
    si_errno [0]:
    si_code [1]: SEGV_MAPERR [addr: 0x4]
    stackpointer=FECC14B0
    We did some simulations and duplicated the core dumps. We figured out that core dumps are somehow associated with concurrent GC algorithm "incmarksweep". The core dump will disappear if we replace "incmarksweep" with "markcompact". There is no problem at all if we do not use concurrency GC options. The request malloc size has significant effect on the core dump frequency. The smaller the request malloc size, the less frequent the core dump occurs. The core dump will happen immediately if we use that option with large memory allocation request size. Just put included jar file in your class path and type,
    usr/jdk1.2.2_12/bin/sparc/native_threads/java -Xgenconfig:4m,4m,semispaces:600m,800m,incmarksweep test 100 1000000
    where,
    100 are the number threads you want to use in JVM and
    1000000 are the number bytes you want JVM to allocate it for you at one time.
    You will see a core dump within couple of minutes. The output on console is listed as following:
    IGSEGV 11 segmentation violation
    si_signo [11]: SEGV
    si_errno [0]:
    si_code [1]: SEGV_MAPERR [addr: 0x4]
    stackpointer=FDFB11B8
    *** Garbage Collection in process, a thread
    *** dump is not possible.
    Abort (core dumped)
    import java.io.*;
    import java.util.*;
    public class coredump extends Thread
        long timewait;
        int  mallocSize;
        public coredump(long time, int mallocSize)
            timewait=time;
            this.mallocSize=mallocSize;
        public void run()
            byte[] test;
            int  counter = 0;
            while(true)
                test = new byte[mallocSize];
                for(int j=0;j<mallocSize;j++)
                    test[j]=(byte)(j%256);
                counter++;
                System.out.println("Total allocated memory by thread " +Thread.currentThread().getName()+":"+counter*mallocSize+" bytes");
    //====================================================================================================================
    public class test
        public static coredump[] threads;
        public static int numThreads;
        public static int mallocSize;
        public test()
        public static void main(String[] args)
            if(args.length != 2)
                System.out.println("Usage: java -Xconfig: 4m,4m,semispaces:600m,800m,incmarksweep test numThreads mallocSize");
                System.exit(1);
            else
                numThreads=Integer.parseInt(args[0]);
                mallocSize=Integer.parseInt(args[1]);
                threads = new coredump[numThreads];
            try
                for(int i=0;i<numThreads;i++)
                    threads=new coredump(1000,mallocSize);
    threads[i].start();
    catch(Exception ee)
    ee.printStackTrace();

    Yes. Sun reproduced and confirmed the bug in JDK 1.2.2_12 and JDK 1.2.2_13(scheduled release on 7/31/02). They are working on fix...
    Thanks
    xin

  • I swear on my unborn children the following is true

    No tricks. No making this up. In all my years of programming, I have never seen a logic failure.
    if (columnIndex >= columns) {
      // Add new TR tag
    }Running in a debugger, I clearly see that columnIndex is 1 and columns is 2.
    JAVA IS TELLING ME 1 >= 2 EVALUATES TO TRUE?
    Yes, it is. I can reproduce the problem at will. I've rebooted and then started the applications in a different order. Same problem. I rebooted and then only started Tomcat. Same problem.
    You might be saying, "Well, debuggers are complex beasts, perhaps there is an issue in Eclipse?" No. When I run the application standalone in Tomcat, the web page produces the same fault (basically, what is in the if clause creates a new TR tag, and I see two rows both running debug in Eclipse and on the standalone without even starting Eclipse after a reboot).
    Is there an error in Tomcat's 'bootstrap' JVM? Or is this possible a JDK 1.5 bug?
    - Saish

    Recompiled their source (which I got in the same distribution) on my own machine. Now, the problem is gone. Using the original class, I still have the issue. So, I have a 'workaround' at least for now. Not sure if they used a non-standard compiler at Apache or not.
    I'll report the error over at Apache and also check whether the lines you suggested appear. Right now, I'm spend. Will also check out a decompiler and run that on the class itself to see what source it generates.
    Thanks all!
    - Saish

  • Gif files takes long time to load..!!

    Hi,
    I found the gif/jpg files takes long time ( more than 5 or 6 seconds depends on size ) to render on JavaHelp viewer EditorPane.. I am using JDK 1.3 / Win 2000 / 256 MB / 1 GHz Pentium. Also found JVM uses 90% of the system resources while loading the pic files. I have noticed it as a JDK 1.3 bug from another thread.
    http://forum.java.sun.com/thread.jsp?forum=42&thread=230409
    I would like to know is there any other solution for this, keeping my JDK Version as it is?
    Thanks
    Reji

    I would convert your images to JPegs if possible since they are so much smaller in size and therefore load much quicker. I had exactly the same problem but I sorted it out this way. I know it's a pain and it will probably screw up your view, but it will speed up your load time ten-fold and I don't know of any other work around. sorry...

  • Weblogic 5.1 behaves erroneously

    Hi,
    We have a Web application running on Weblogic 5.1 and service pack 9 with jdk1.3.
    For one day I do not face any problems with any page. After 1 day ,If I try a
    page 10 times , it shows up 8-9 times but gives an error 1-2 times. This is happening
    with most of the pages.
    When we had upgraded from sp8 to sp9 we started facing these problems immediately
    and had changed the following
    a)
    $JAVA $JAVA_OPTIONS -ms64m -mx64m
    to
    $JAVA $JAVA_OPTIONS -ms128m -mx128m
    b) Increased the PermSize which is a jdk 1.3 bug fix on solaris
    c) Restarted the server
    The problem disappeared but has come after one day again
    Can anyone please help me of whats wrong & how it can be corrected.Please help.
    Thanx in advance.
    Deepak

    Given below is the code for AncestorBean
    package com.channel4.utils.app.ejb;
    import java.sql.*;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.sql.*;
    import java.rmi.*;
    import java.util.Vector;
    import java.util.HashMap;
    import com.channel4.utils.app.bsdlg.*;
    import com.channel4.utils.common.global.*;
    import com.channel4.utils.common.excptn.*;
    import com.channel4.utils.common.errorlog.*;
    * This is the class that is the base class for all session beans.
    * @author Vishal Sharma
    * @version 0.1
    * @since 09-08-2001
    public class AncestorBean implements SessionBean
         protected SessionContext mCtx;
         private static final boolean DEBUG = true;
         //Start Code for CACHE
         private HashMap BOCache=new HashMap();
         private transient HashMap DataStoreCache=new HashMap();
         * This is the getConnection method that will return
         * a java.sql.Connection object.
         * @param     String logicalDBName
         * @return Connection
         * @exception SQLException,NamingException
         * @since     09-08-2001
         * @see
         protected Connection getConnection(String logicalDBName) throws SQLException,NamingException
              logger.log("Inside get Connection 1");
              DataSource datasrc=null;
              Connection conn=null;
              datasrc=(DataSource)DataStoreCache.get(logicalDBName);
              logger.log("Inside get Connection 2");
              if (datasrc==null)
                   logger.log("Inside get Connection 3");
                   //java.util.Properties l_pdProp = new java.util.Properties();
                   //l_pdProp.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   //l_pdProp.put(javax.naming.Context.PROVIDER_URL,"t3://localhost:7001");
                   //InitialContext l_cxInitialContext = new InitialContext(l_pdProp);
                   InitialContext l_cxInitialContext = new InitialContext();
                   logger.log("Inside get Connection 4 logicalDBName->"+logicalDBName);
              datasrc = (DataSource) l_cxInitialContext.lookup(logicalDBName);
                   logger.log("Inside get Connection 5");
                   DataStoreCache.put(logicalDBName,(DataSource)datasrc);
              //conninuse=datasrc.getConnection();;
              logger.log("Inside get Connection 6");
              return datasrc.getConnection();
         }//end of makeConnection()
         * This is the getBO method that dynamically load and cache
         * the Business Object.
         * @param     RequestContainer criteria
         * @param     String type
         * @param     String path
         * @return IBusinessObj
         * @exception Exception
         * @since     09-08-2001
         * @see
         protected IBusinessObj getBO(RequestContainer criteria, String type, String path)
    throws Exception
              Object obj=null;
              String classToLoad=null;
              try
                   classToLoad=path;
                   if (criteria.getParameter("siteid")!=null)
                        if ((criteria.getParameter("siteid")).length()>0)
                             classToLoad+=(String)criteria.getParameter("siteid")+".";
                   classToLoad+=type;
                   logger.log("Inside Ancestor to load->"+classToLoad);
                   obj=BOCache.get(classToLoad);
                   if (obj==null)
                        obj=Class.forName(classToLoad).newInstance();
                        BOCache.put(classToLoad,obj);
              catch(Exception ex)
                   BOCache.put(classToLoad,null);
                   appLog(ex);
                   //ex.printStackTrace();
                   //throw new ChannelException("SystemException",ex);
                   throw ex;
              //bo=(BusinessObj)obj;
              return (IBusinessObj)obj;
         //END Code for CACHE
         * This is the execute method that will be invoked by the EJB and
         * contains the logic for the Business Object.
         * @param     Connection conn
         * @param     RequestContainer criteria
         * @return HashMap
         * @exception ChannelException,SQLException,Exception
         * @since     09-08-2001
         * @see
         protected HashMap processBO(RequestContainer criteria,String type,String connectionPool,
    String pathToBO) throws ChannelException
              HashMap status;
              IBusinessObj queryList=null;
              Connection conn=null;
              try
                   appLog("Just for testing");
                   queryList=getBO(criteria,type,pathToBO);
                   conn=getConnection(connectionPool);
              status=queryList.execute(conn,criteria);
              catch(ChannelException ex)
                   mCtx.setRollbackOnly();
                   appLog(ex);
                   throw ex;
              catch(SQLException ex)
                   //logger.log("processBO SQLException"+ex);
                   //ex.printStackTrace();
                   appLog(ex);
                   throw new EJBException(ex);
              catch(Exception ex)
                   //logger.log("here 111");
                   //logger.log("processBO Exception"+ex);
                   appLog(ex);
                   throw new EJBException(ex);
              finally
                   try
                        if (conn!=null)
                             conn.close();
                   catch(SQLException ex)
                        conn=null;
                        appLog(ex);
                        throw new EJBException(ex);
              return status; //return the status
         }//end of the method
         //For Logging
         private ErrorLogCM logger=null;
         * This is the appLog method that is used to log the
         * message on the app tier.
         * @param     String str
         * @return void
         * @since     09-08-2001
         * @see
         protected void appLog(String str)
              if (DEBUG)
                   if(logger!=null)
                        logger.log(str);
         * This is the appLog method that is used to log the
         * exception on the app tier.
         * @param     Exception ex
         * @return void
         * @since     09-08-2001
         * @see
         protected void appLog(Exception ex)
              if (DEBUG)
                   if(logger!=null)
                        logger.log(ex);
         //End of Code for Logging
    * The statutory methods for Session EJBs
    //----------------------Callback Methods------------------------------------
         * This method is required by the EJB Specification,
         * but is not used by this example.
         public void ejbActivate()
              if (DEBUG) System.out.println("ejbActivate called");
         * This method is required by the EJB Specification,
         * but is not used by this example.
         public void ejbRemove()
              if (DEBUG) System.out.println("ejbRemove called");
         * This method is required by the EJB Specification,
         * but is not used by this example.
    public void ejbPassivate()
              if (DEBUG) System.out.println("ejbPassivate called");
         * Sets the session context.
         public void setSessionContext(SessionContext aCtx)
              if ( DEBUG ) System.out.println("setSessionContext called");
              this.mCtx = aCtx;
         *     ejbCreate method..
    public void ejbCreate () throws CreateException
              if (DEBUG) System.out.println("ejbCreate called");
              try
                   InitialContext ic = new InitialContext();
                   //logger.log("Inside create 1");
                   String logfile = (String) ic.lookup("java:/comp/env/LogFile");
                   System.out.println("Inside create logfile->"+logfile     );
                   logger = new ErrorLogCM(logfile);
              catch (NamingException ne)
                   throw new CreateException("Failed to find environment value "+ne);
         * This method is used to log messages for the purpose of debugging.
         * @param astr
    public static void log(String astr) {
    if (DEBUG) System.out.println(astr);
    }// End of method log..
    Robert Patrick <[email protected]> wrote:
    Can we see the code for the processBO() method in com.channel4.utils.app.ejb.AncestorBean?
    deepak wrote:
    The error that takes place are EJB exceptions
    e.g given below
    java.rmi.UnexpectedException: Unexpected exception in com.channel4.search.app.ejb.search.SearchSB.searchQuestion():
    javax.ejb.EJBException
    at com.channel4.utils.app.ejb.AncestorBean.processBO(AncestorBean.java:116)
    at com.channel4.search.app.ejb.search.SearchSB.searchQuestion(SearchSB.java:144)
    at com.channel4.search.app.ejb.search.SearchSBEOImpl.searchQuestion(SearchSBEOImpl.java:56)
    at com.channel4.search.app.ejb.search.SearchSBEOImpl_ServiceStub.searchQuestion(SearchSBEOImpl_ServiceStub.java:150)
    at com.channel4.search.web.intfc.IFSearch.getSearchResults(IFSearch.java:170)
    at com.channel4.search.web.taglib.SearchQuestionListTag.doEndTag(SearchQuestionListTag.java:295)
    at jsp_servlet._english._eg_srch_searchresults._jspService(_eg_srch_searchresults.java:394)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    ; nested exception is:
    javax.ejb.EJBException
    javax.ejb.EJBException
    at com.channel4.utils.app.ejb.AncestorBean.processBO(AncestorBean.java:116)
    at com.channel4.search.app.ejb.search.SearchSB.searchQuestion(SearchSB.java:144)
    at com.channel4.search.app.ejb.search.SearchSBEOImpl.searchQuestion(SearchSBEOImpl.java:56)
    at com.channel4.search.app.ejb.search.SearchSBEOImpl_ServiceStub.searchQuestion(SearchSBEOImpl_ServiceStub.java:150)
    at com.channel4.search.web.intfc.IFSearch.getSearchResults(IFSearch.java:170)
    at com.channel4.search.web.taglib.SearchQuestionListTag.doEndTag(SearchQuestionListTag.java:295)
    at jsp_servlet._english._eg_srch_searchresults._jspService(_eg_srch_searchresults.java:394)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    "Deepak" <[email protected]> wrote:
    Hi,
    We have a Web application running on Weblogic 5.1 and service pack
    9
    with jdk1.3.
    For one day I do not face any problems with any page. After 1 day,If
    I try a
    page 10 times , it shows up 8-9 times but gives an error 1-2 times.This
    is happening
    with most of the pages.
    When we had upgraded from sp8 to sp9 we started facing these problems
    immediately
    and had changed the following
    a)
    $JAVA $JAVA_OPTIONS -ms64m -mx64m
    to
    $JAVA $JAVA_OPTIONS -ms128m -mx128m
    b) Increased the PermSize which is a jdk 1.3 bug fix on solaris
    c) Restarted the server
    The problem disappeared but has come after one day again
    Can anyone please help me of whats wrong & how it can be corrected.Please
    help.
    Thanx in advance.
    Deepak

  • Flight Recorder does not provide Method Profiling Samples on CentOS 5

    Flight recorder from jdk 1.8.0_05 does not collect information about methods then running under CentOS 5.
    But jdk1.7.0_55 provides "Method Profiling Samples" events on the same machine.
    Steps to reproduce:
    1. Download test class - https://gist.github.com/evsinev/0b136693ef7549ddc9b5
    2. compile it
    3. Run it:
    NOW=$(date +"%H-%M-%S")
    export JAVA_OPTS="$JAVA_OPTS -XX:+UnlockCommercialFeatures -XX:+FlightRecorder"
    export JAVA_OPTS="$JAVA_OPTS -XX:StartFlightRecording=duration=120s,filename=data/profile-startup-${NOW}.jfr,name=Startup,settings=profile"
    export JAVA_OPTS="$JAVA_OPTS -XX:FlightRecorderOptions=samplethreads=true,stackdepth=64"
    /opt/jdk1.8.0_05/bin/java $JAVA_OPTS -cp . Test
    Running with jdk 1.8.0_05 does not provide "Method Profiling Samples"
    Running with jdk 1.7.0_55 provides "Method Profiling Samples"
    Environment:
    CentOS release 5.9 (Final)
    uname:Linux 2.6.18-348.1.1.el5 #1 SMP Tue Jan 22 16:19:19 EST 2013 x86_64
    libc:glibc 2.5 NPTL 2.5

    I've spoken to the developers of the JVM/JDK parts of JFR, and I'm afraid they say this is a known issue
    (https://bugs.openjdk.java.net/browse/JDK-8036090, https://bugs.openjdk.java.net/browse/JDK-8037340)
    that happens on Linux only.
    It will be fixed in 7u60 and 8u20 which will be released later this year.

  • HTTPURLConnection response with multiple Set-Cookie Header key

    I set up a connection to a server and it gives me a response. This response has two header keys but when I loop through like so many reference and how-to sites tell me I only get one and its the last value.
    This is some code that I'm using:
    for (int i=1; (headerName = conn.getHeaderFieldKey(i))!=null; i++) {
         System.out.println(headerName);
         if (headerName.equals("Set-Cookie")) {                 
                     cookie += conn.getHeaderField(i);   }           
         }Has anyone attempted this successfully? This code was copy and pasted from an example claimed to work but I used it myself and it doesn't work.
    This is the response message:
    HTTP/1.1 302 Moved Temporarily
    Date: Mon, 16 Feb 2009 03:47:47 GMT
    Server: Apache
    Set-Cookie: JSESSIONID=E7C54E0ECE8CCFD89EF91FF8A47E34BC; Path=/
    Location: http://<SITEURL>/redirecting.jsp
    Content-Length: 0
    P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE PSA"
    Keep-Alive: timeout=15, max=15
    Connection: Keep-Alive
    Content-Type: text/html;charset=ISO-8859-1
    Set-Cookie: BIGipServerI2O_pool_A=1815557130.20480.0000; path=/

    I just read in the Bug database that this is a JDK 1.4 bug, with no workaround proposed. I am using JDK 1.3.
    Does anyone out there know about a workaround or what other scheme I could use to do the same thing? (For me it's necessary to set at least the User-Agent and the Cookie headers).

  • I can't use JSTL tag for read rss.

    I want to read rss from another web. but I can't read rss . I use Netbeans and I add JSTL Library already. I can use forEach tag but every time when I use xml tag it show error. This is my code for read rss. I don't know how to read rss with JSTL tag please help me.
    <h6><!-- Filename: ShowStudents.jsp -->
    <%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <HTML>
    <BODY>
    <c:import var="xmlDoc" url="http://www.manager.co.th/RSS/Home/Breakingnews.xml"/>
    <x:parse var="parsedDocument" xml="${xmlDoc}"/>
    <table>
    <tr>
    <th>Title : </th>
    <th>Link : </th>
    </tr>
    <x:forEach select="$parsedDocument/channel/item"> // This code I ever been change to $parsedDocument/rss/channel/ and $parsedDocument/rss/channel/title ,but it show same error.
    <tr>
    <td> <x:out select="title" /> </td>
    <td> <x:out select="link" /> </td>
    </tr>
    </x:forEach>
    </table>
    </BODY>
    </HTML></h6>
    when I run this code it show error like this. how to read rss with JSTL tag please help me.
    <h6>
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.test_jsp._jspService(test_jsp.java:101)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    root cause
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
    com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
    com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
    org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
    org.apache.jsp.test_jsp._jspx_meth_x_005fparse_005f0(test_jsp.java:150)
    org.apache.jsp.test_jsp._jspService(test_jsp.java:80)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Filter.ThaiRequest.doFilter(ThaiRequest.java:38)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    </h6>
    Edited by: user12864851 on 15 ม.ค. 2554, 22:59 น.

    Ok, I did a bit more experimenting, and web searching, and found you are the victim of the UTF-8 BOM bug.
    Basically the java UTF-8 reader does not recognise a BOM at the start of a UTF-8 stream, and it has to be discarded manually.
    For details: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
    Here is a 'fixed' JSP for you.
    <%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <%@ page contentType="text/html; charset=UTF-8"%>
    <HTML>
    <BODY>
         <c:import var="xmlDoc"
              url="http://www.manager.co.th/RSS/Home/Breakingnews.xml"
              charEncoding="UTF8" />
         <%--
            JSTL hack to work around the UTF-8 BOM bug in JDK.
            http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
         --%>
         <c:set var="testChar" value="fn:substring(xmlDoc, 0, 1)}"/>
         <c:if test="${testChar != '<'}">
           <c:set var="xmlDoc" value="${fn:substring(xmlDoc, 1, fn:length(xmlDoc))}" />
         </c:if>
         <table>
              <tr>
                   <th>Title :</th>
                   <th>Link :</th>
              </tr>
              <x:parse var="parsedDocument" doc="${xmlDoc}" />
              <x:forEach select="$parsedDocument/rss/channel/item">
                   <tr>
                        <td><x:out select="title" /></td>
                        <td><x:out select="link" /></td>
                   </tr>
              </x:forEach>
         </table>
    </BODY>
    </HTML>cheers,
    evnafets

  • PrintServiceLookup.lookup in Tomcat

    Hi Forum,
    How could I get javax.print.PrintServiceLookup.lookupPrintServices(null,null) to return the current available services while the program that uses lookupPrintServices is running? In a tomcat servlet, I use the lookupPrintServices(..) to get a list of the printer services available. The class works well and returns the
    list but if I install a new printer, the servlet does not list the newly installed service until I restart Tomcat.
    Is there a way to unload and reload the PrintServiceLookup class and then call PrintServiceLookup.lookupPrintServices?
    It appears that the lookupPrintServices(..) returns the list of services that was available when the instance of the virtual machine was started. Hence, while the instance is running, it allways returns the same list of
    services. If I run a program that lists the services and then exits, the program lists the newly added printer on re-run. But if the program never exits (it runs in a loop, re-listing the services every so often), and I add
    a new printer while the program is running, the newly added printer is not listed until I terminate the pogram and re-start it.
    Thanks in advance for your response

    Thank for your response,
    It appears that there is a bug in the JDK. A bug reported against the SUN JDK for this problem and it seeems that the bug has not been resolved yet.
    A ling to the bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4744405
    A brief description of the reported bug:
    Bug ID: 4744405
    Votes 17
    Synopsis RFE: lookupPrintServices() to refresh the printers list dynamically
    Category java:classes_2d
    Reported Against 1.4 , 1.4.1
    Release Fixed
    State In progress, request for enhancement
    Related Bugs 5028849 , 5033703
    Submit Date 10-SEP-2002
    Description *This also happened on Windows platform.
    java version "1.4.1-rc"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
    Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)
    When invoke method lookupPrintServices() on class PrinterJob or PrintServiceLookup, the printers list can not refreshed when adding or deleting printers dynamically.
    Steps to follow to reproduce the problem:
    1. Compile and run the included test case
    2. The print dialog shows up and avaible printers information is printed out on screen. Click "cancel" to dismiss the dialog. The test case is pending.
    3. Use Printer Selector Tool to add a new printer into selected printers list and save changes.
    4. Back to the terminal that run the test case an click "enter" button to continue. Then a new thread will be created to invoke the lookupPrintServices() and pop up the print dialog again.
    5. The screen output shows that invoking lookupPrintServices() doesn't reflect the newly added printer information, neither does the print dialog.
    //-------- source code begin-----------//
    import java.awt.print.*;
    import javax.print.*;
    public class MTPrinterTest extends Thread {
    public static void main(String[] args) {
    MTPrinterTest t1 = new MTPrinterTest();
    t1.start();
    try {
    System.in.read();
    } catch (Exception e){}
    MTPrinterTest t2 = new MTPrinterTest();
    t2.start();
    public void run() {
    PrinterJob printerJob;
    PrintService[] printServices;
    printerJob = PrinterJob.getPrinterJob();
    printServices = printerJob.lookupPrintServices();
    System.out.println("Number of servies found: " + printServices.length);
    for (int i =0; i< printServices.length; i++)
    System.out.println("--> Available Printer " + i + ": " + printServices);
    printerJob.printDialog();
    //-------- source code end ----------//
    Work Around Exit the current running application and run it again, then the printers list get refreshed. Seems the running JVM can not get updated printer information

  • Help to compile SQLJ in Oracle816 r2 with SDK2 v1.3

    Currently I have SDK2 v.1.3 from SUN installed in my Linux box. When I tried to compile an SQLJ file using the "sqlj" command, it seems that it has internal compile error.
    I read the README.txt in the SQLJ directory, and found this:
    "The SQLJ translator now works with JDK 1.2 [Bug 814692]. Ensure that you are using the proper Oracle JDBC driver file (classes12.zip)."
    Now, the default JDBC driver comes with Oracle 8.1.6 r2 is 'classes111.zip'. Is there a patch or something that can upgrade the JDBC driver so I don't have to download 560Mb of Oracle 8.1.7 just to learn how to use sqlj?
    Thanks.

    I would have expected both JDK 1.1 and JDK 1.2 JDBC driver versions to be distributed with your database. (The 1.2 version, while not certified with JDK 1.3 should work reasonably well.)
    The 8.1.7 JDBC driver is downloadable from OTN - the thin drivers (both JDK 1.1 and JDK 1.2) work with all appropriate Java platforms.
    One more thing: SQLJ 8.1.7 does not work properly under JDK 1.3. As a workaround, you can specify the -passes option (though error messages will not be given on the .sqlj file). A better workaround is to create a script (say "myjavac") that calls javac but captures stdout and stderr and sends both to stdout. Then specify -compiler-executable=myjavac in your sqlj.properties file and you should be in business.

  • Oracle XML parser and IBM jdk bug

    Hello,
    From a few messages found in the XML forum it seems that IBM jvm could cause problems with oracle XML parser. ( see http://technet.oracle.com:89/ubb/Forum11/HTML/003823.html )
    I am using IBM jvm (jdk 1.3) on a linux box, and problems are starting to arise:
    I have
    - 1 BC4J based jsp app which works fine.
    - 2 XML parsing BC4J apps which cause strange errors (like parsing 40 documents fine and failing on the 41st for no apparent reason)
    Hopefully, Steven Muench provided precious advice on this (basically, disabling the JIT), however some issues are still open:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>You should file a bug with IBM to get this fixed, using your stylesheet as a testcase. Lots of people have hit this problem.<HR></BLOCKQUOTE>
    Has anyone (from oracle or else) done this yet? I have gone (quickly) through IBM website but I didn't find any bug report utility or the like...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Disable your JIT compiler (or switch JVM's) and you won't have the error.<HR></BLOCKQUOTE>
    Turning off the JIT indeed made the errors vanish, thanks a lot for the tip!
    I have a few more questions though :
    * As the BC4J framework uses the xml parser, It is fairly possible that the ibm jvm bug will affect it...
    I haven't had any problems (yet?) with the BC4J part of my applications, but I'm a bit concerned about having random bugs lurking around (I have more than enough of my own :) )
    Has anyone stumbled upon IBM JVM vs oracle parser issues in BC4J? (oracle.xml.parser.v2.XXXXXX exceptions...)
    * If BC4J is indeed affected, what's the solution?
    - Disable the JIT? (And forget about performance?... hmmm... no)
    - Switch parsers? (oracle parser is too tightly integrated in the BC4J Framework isn't it?.. hmm... not possible either)
    - Wait for a patch from IBM (and use another one in the meantime) / switch JVM :
    In either case, I'd really like to know what is the JVM that oracle people use / would advise.
    Thanks for your help
    null

    For those interested,
    last week i reported this bug in the ibm jvm news forum.
    They said that the problem had been investigated and would be fixed in their next service release.
    FYI: the current release (SR7, labeled "build cx130-20010329) still has various problems wih oracle XML parser.
    Remi
    null

  • Is a BUG about 64bit JDK?

    public class TestThread {
        public static void main(String[] args) {
            IRun ir = new IRun();
            Thread it = new Thread(ir);
            it.start();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
                Logger.getLogger(TestThread.class.getName()).log(Level.SEVERE, null, ex);
            ir.setStop();
        static class IRun implements Runnable {
            boolean exec = true;
            public void setStop() {
                exec = false;
            @Override
            public void run() {
                int c = 0;
                while (exec) {
                    c++;
                System.out.println("exit while loop");
    In 64bit JDK, it will appear a strange logic to run above code. The thread it will not to end, and the program will not exit. But, if there is Object operate(e.g. new, invoke Object's function(can't retrun base data type), System.out.prinltn), it will run normally. For example, modify run() function :
    publicvoid run() { 
    int c = 0; 
    while (exec) { 
        String s = new String(""); 
        c++; 
       System.out.println("exit while loop"); 
    But in 32bit JDK, it will run correctly. Start thread, and wait 1 seconds, print "exit while loop", and exit program.
    Is a BUG about 64bit JDK?

    thanks, it is error forum!

Maybe you are looking for

  • ITunes 64 Bits executa apenas a versão de 32 bits no Windows 7

    Olá gente, Tenho um Windows 7 Professional com AMD Turion II e 8GB de RAM, o meu Windows é 64 Bits, porém quando baixo o iTunes, por mais que ele seja 64 bits, o iTunes é instalado na pasta Arquivos de Programas (x86) ao invés da pasta padrão de 64 b

  • How to re-format an external drive?

    I had a G3 iMac with a 160 GB internal drive that was running an earlier version of OS-X. When I installed that drive, there was a limitation that only allowed it to recognize about 120 GB of that drive. I now have an iMac G5 and want to use the 160

  • Generate XML with tag names generated dynamically.

    Hi Mark, I want to generate xml in the following way using SQLXoperators. But only problem is when i use the operator, the tag name should be supplied before in hand as parameter. So it works well when the data for the tags are stored in seperate col

  • Producer Consumer Start Trigger

    Short Explanation: I'm using a 3rd party device to send a TTL signal to use as my start trigger in my VI. My cDAQ and modules appear to have the ability to send a start trigger independantly but I have been unable to hunt down how to do this in a pro

  • 3D applications in JAVA

    hello my problem is i am trying to make a 3D environment using pure java concepts, im a newbie to java and this is my college project......actually wat i exactly wanna know is.........how can a increase or decrease the size of an image without affect