Incorrect constant pool entry count

Hi ,
I found with this simple class , the class file has incorrect constant pool count,
public class Smpl
public final long j = 0;          
class file dumped is :
0xCA 0xFE 0xBA 0xBE
0x00 0x00 0x00 0x32
0x00 {color:#ff0000}0x14 <- pool count is 0x14 -1 = 0x13 , but I can just read 0x12 !{color}
0x0A 0x00 0x04 0x00 0x10
0x09 0x00 0x03 0x00 0x11
0x07 0x00 0x12
0x07 0x00 0x13
0x01 0x00 0x01 0x6A
0x01 0x00 0x01 0x4A
0x01 0x00 0x0D 0x43 0x6F 0x6E 0x73 0x74 0x61 0x6E 0x74 0x56 0x61 0x6C 0x75 0x65
0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x01 0x00 0x06 0x3C 0x69 0x6E 0x69 0x74 0x3E
0x01 0x00 0x03 0x28 0x29 0x56
0x01 0x00 0x04 0x43 0x6F 0x64 0x65
0x01 0x00 0x0F 0x4C 0x69 0x6E 0x65 0x4E 0x75 0x6D 0x62 0x65 0x72 0x54 0x61 0x62 0x6C 0x65
0x01 0x00 0x0A 0x53 0x6F 0x75 0x72 0x63 0x65 0x46 0x69 0x6C 0x65
0x01 0x00 0x09 0x73 0x6D 0x70 0x6C 0x2E 0x6A 0x61 0x76 0x61
0x0C 0x00 0x0A 0x00 0x0B
0x0C 0x00 0x05 0x00 0x06
0x01 0x00 0x04 0x53 0x6D 0x70 0x6C
0x01 0x00 0x10 0x6A 0x61 0x76 0x61 0x2F 0x6C 0x61 0x6E 0x67 0x2F 0x4F 0x62 0x6A 0x65 0x63 0x74
0x00 0x21 acc flag
0x00 0x03 this class
0x00 0x04 super class
0x00 0x00 interfaces count
0x00 0x01 fields count
0x00 0x11 acc flag
0x00 0x05 name idx
0x00 0x06 desc idx
0x00 0x01 attrs count
0x00 0x07 name idx
0x00 0x00 0x00 0x02 attr len
0x00 0x08 info
0x00 0x01 methods count
0x00 0x01 acc flag
0x00 0x0A name idx
0x00 0x0B desc idx
0x00 0x01 attrs count
0x00 0x0C name idx
0x00 0x00 0x00 0x26 attr len
0x00 0x03 max stack
0x00 0x01 max loacls
0x00 0x00 0x00 0x0A code len
0x2A 0xB7 0x00 0x01 0x2A 0x09 0xB5 0x00 0x02 0xB1 code
0x00 0x00 exception table len
0x00 0x01 attr count
0x00 0x0D name idx
0x00 0x00 0x00 0x0A attr len
0x00 0x02 0x00 0x00 0x00 0x01 0x00 0x04 0x00 0x03 info
0x00 0x01 attrs count
0x00 0x0E name idx
0x00 0x00 0x00 0x02 attr len
0x00 0x0F
Could anyone help me? thank you
I'm using jdk6

sunnyyu wrote:
Hi ,
I found with this simple class , the class file has incorrect constant pool count,
public class Smpl
public final long j = 0;          
0x0A 0x00 0x04 0x00 0x10
0x09 0x00 0x03 0x00 0x11
0x07 0x00 0x12
0x07 0x00 0x13
0x01 0x00 0x01 0x6A
0x01 0x00 0x01 0x4A
0x01 0x00 0x0D 0x43 0x6F 0x6E 0x73 0x74 0x61 0x6E 0x74 0x56 0x61 0x6C 0x75 0x65
0x05 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x01 0x00 0x06 0x3C 0x69 0x6E 0x69 0x74 0x3E
0x01 0x00 0x03 0x28 0x29 0x56
0x01 0x00 0x04 0x43 0x6F 0x64 0x65
0x01 0x00 0x0F 0x4C 0x69 0x6E 0x65 0x4E 0x75 0x6D 0x62 0x65 0x72 0x54 0x61 0x62 0x6C 0x65
0x01 0x00 0x0A 0x53 0x6F 0x75 0x72 0x63 0x65 0x46 0x69 0x6C 0x65
0x01 0x00 0x09 0x73 0x6D 0x70 0x6C 0x2E 0x6A 0x61 0x76 0x61
0x0C 0x00 0x0A 0x00 0x0B
0x0C 0x00 0x05 0x00 0x06
0x01 0x00 0x04 0x53 0x6D 0x70 0x6C
0x01 0x00 0x10 0x6A 0x61 0x76 0x61 0x2F 0x6C 0x61 0x6E 0x67 0x2F 0x4F 0x62 0x6A 0x65 0x63 0x74 I make that 0x13 entries (minus the unusable entry at 0x9)
0x000b 0x01: 0xa 0x4,0x10
0x0010 0x02: 0x9 0x3,0x11
0x0015 0x03: 0x7 0x12
0x0018 0x04: 0x7 0x13
0x001b 0x05: 0x1 "j"
0x001f 0x06: 0x1 "J"
0x0023 0x07: 0x1 "ConstantValue"
0x0033 0x08: 0x5 0x0000000000000000
0x003c 0x0a: 0x1 "<init>"
0x0045 0x0b: 0x1 "()V"
0x004b 0x0c: 0x1 "Code"
0x0052 0x0d: 0x1 "LineNumberTable"
0x0064 0x0e: 0x1 "SourceFile"
0x0071 0x0f: 0x1 "Smpl.java"
0x007d 0x10: 0xc 0xa,0xb
0x0082 0x11: 0xc 0x5,0x6
0x0087 0x12: 0x1 "Smpl"
0x008e 0x13: 0x1 "java.lang.Object"Remember that longs and doubles take two slots.

Similar Messages

  • Palm OS: Invalid constant pool entry - What's that?

    Hello,
    I'm a newbie in developing application 4 my palm. (midp4palm 1.0 installed)
    I started with a "hello world"... everything went fine on my tungsten t3 emulator. Label + TextField.
    Then I wrote a little calculator... and now I get the following message: "Invalid constant pool entry".
    I used switch(), some static final doubles and that's it.
    Do you know what the problem could be... I didn't find a solution.
    Thank you
    mastix mc

    A quick google search yielded this - hope it helps.
    http://archives.java.sun.com/cgi-bin/wa?A2=ind9911&L=kvm-interest&F=&S=&P=8868
    Summary:
    * "This is usually caused by a null reference not caught by the KVM, or sometimes an instanceof sometime before."
    * "I was having exactly this problem on a Palm V.
    I re-downloaded the KVM from Sun's site. I am using a Mac, and I noticed
    this time, after running ZipIt to unzip the files, that the types of the
    files have now been correctly set. I re-installed the files, and now
    everything is working fine.
    My guess is that something is corrupted in your KVMClassDB.pdb file. I've
    done a couple of upgrades to my Mac software and the OS upgrade, so I'd
    recommend doing every possible software upgrade, then download the KVM again
    and re-install it."

  • Alert: Invalid constant pool entry

    Hi, When I install midlet application in mobile phone I got this error "Alert: Invalid constant pool entry" and says "Application Error". When I create a object of a class at that time this error occurred. In that class I have used a constant which value is 1.5. After googling so many people are saying this because of floating point value. That May be the problem. Because when I change that 1.5 value to 1 then application get installed and run. But earlier also I used to create the object of that class. At that time mobile phone did not throw any error. But why this time throw error. I did not understand what could be the problem. Please any one help me.

    gnat wrote:
    hmm let's see if I understand you correctly.
    Before, you were using jar "as-is", ie without compiling it, right? - so you basically don't know if the class in it was using floating point or not?
    Now, you compile a piece of code that was supposedly used in that jar (but you don't know for sure if it was because you didn't build that jar) and you obtain the problem - correct?hmm let's see if I understand you correctly.
    Before, you were using jar "as-is", ie without compiling it, right? - so you basically don't know if the class in it was using floating point or not?
    Now, you compile a piece of code that was supposedly used in that jar (but you don't know for sure if it was because you didn't build that jar) and you obtain the problem - correct?
    No. No. Both Jars are compiled and built by myself. I find out the problem. problem is costructing the object of that class (which have float value) from startApp(). I got my old Jar which was working earlier. There I costruct the object of that class. So now old jar also giving the "Invalid constant Pool entry" Error. Any that float value I am going to change. Still unclear is What the difference construct object inside startApp() block and ouside startApp() block. Anyway Thank you Guys.

  • Is there any change in the constant pool entires with JDK1.4?

    Hi,
    Here is my simple java class,
    class Base
    String manuf = "MRF";
    class Derived extends Base
    Derived() {
    manuf = "ABC";
    After compiling this class with JDK 1.3 and JDK1.4, i could see the difference in constant pool entries
    so please let me know more about these cahnges.
    P.S. : written a java program TClass.java to browse the constant pool entries.
    i.e if compiled with JDK1.3 , constant pool entries looks as follows,
    E:\bugs\jdk1.4\pramila>java TClass E:\bugs\jdk1.4\pramila\Derived.class
    There are 21 + 1 entries in the Constant Pool:
    Index Tag Reference(s)/Value(s)
    1 10 5 15
    2 8 16
    3 9 5 17
    4 7 18
    5 7 19
    6 1 <init>
    7 1 ()V
    8 1 Code
    9 1 LineNumberTable
    10 1 LocalVariableTable
    11 1 this
    12 1 LDerived;
    13 1 SourceFile
    14 1 Test.java
    15 12 6 7
    16 1 ABC
    17 12 20 21
    18 1 Derived
    19 1 Base
    20 1 manuf
    21 1 Ljava/lang/String;
    There are 1 methods:
    Code array in method <init> of length 11 starting at byte 231.
    If compiled with JDK1.4 constant pool entries looks as follows,
    E:\bugs\jdk1.4\pramila>java TClass E:\bugs\jdk1.4\pramila\Derived.class
    There are 21 + 1 entries in the Constant Pool:
    Index Tag Reference(s)/Value(s)
    1 10 5 15
    2 8 16
    3 9 4 17
    4 7 18
    5 7 19
    6 1 <init>
    7 1 ()V
    8 1 Code
    9 1 LineNumberTable
    10 1 LocalVariableTable
    11 1 this
    12 1 LDerived;
    13 1 SourceFile
    14 1 Test.java
    15 12 6 7
    16 1 ABC
    17 12 20 21
    18 1 Derived
    19 1 Base
    20 1 manuf
    21 1 Ljava/lang/String;
    There are 1 methods:
    Code array in method <init> of length 11 starting at byte 231.
    There is a change in the index 3 can be noticed.
    i.e
    with JDK1.3 it is "3 9 5 17"
    with JDK1.4 it is "3 9 4 17"
    Thanks in advance.
    Pramila

    javac v1.4 emits by default Java 1.2 compatible .class files while all javac implementations since between 1.1.0 and 1.3.1 emit byte default Java 1.1 .class files.
    Check to see what effect using the -target option in javac to get the two versions to produce Java 1.1, 1.2, or 1.3 .class files.
    Chuck

  • Why constant pool with 0 entries?

    I'm writing a tool that parses SWF files. Recently I see some
    SWF file that has constant pool of 0 entries, yet a lot of bytes
    followed. The spec does not describe what this means. For example,
    using swfdump there is something like:
    [00c] 141 DOACTION
    ( 0 bytes) action: Not
    ( 2 bytes) action: If 5
    ( 131 bytes) action: Constantpool(0 entries)
    String:"ˆB" (remainder of 126
    bytes:"\5\0wf_toolbar.swf\0toolbar_mc\0loadMovie\0toobar\0createEmptyMovieClip\0›\16\0Loa dToolbar\0\0\0\20\0–\9\0\8\0\7\1\0\0\0\8\1\28–\2\0\8\2R\23–\16\0\8\1\7\2\0\0\0\8\3\7\2\0\0 \0\8\4=<")
    ( 0 bytes) action: End
    The constant pool contains 0 entries. Yet the total byte size
    of this action is 131 bytes. Clearly there is meaningful
    information contained in these bytes. But I just cannot find in the
    spec how to parse these bytes.
    Anyone can help? Thanks.

    I'm writing a tool that parses SWF files. Recently I see some
    SWF file that has constant pool of 0 entries, yet a lot of bytes
    followed. The spec does not describe what this means. For example,
    using swfdump there is something like:
    [00c] 141 DOACTION
    ( 0 bytes) action: Not
    ( 2 bytes) action: If 5
    ( 131 bytes) action: Constantpool(0 entries)
    String:"ˆB" (remainder of 126
    bytes:"\5\0wf_toolbar.swf\0toolbar_mc\0loadMovie\0toobar\0createEmptyMovieClip\0›\16\0Loa dToolbar\0\0\0\20\0–\9\0\8\0\7\1\0\0\0\8\1\28–\2\0\8\2R\23–\16\0\8\1\7\2\0\0\0\8\3\7\2\0\0 \0\8\4=<")
    ( 0 bytes) action: End
    The constant pool contains 0 entries. Yet the total byte size
    of this action is 131 bytes. Clearly there is meaningful
    information contained in these bytes. But I just cannot find in the
    spec how to parse these bytes.
    Anyone can help? Thanks.

  • Jvm runtime constant pool

    Hi there,
    this is my query:
    As we know java builds a constant pool for all the symbols if a class in a class file. This class file when loaded by VM, the constant pool is translated into the runtime constant pool in the method area of the Heap.
    Does any one know if there is only 1 runtime constant pool per class or is it 1 per class instance(Object). The JVM spec did not clarify on this. Also if its 1 per class then how does the JVM know where all the instances of a class are while resolving references and also when garbage collecting???
    thank a lot.
    Rishabh.

    rishabhchandra wrote:
    As we know java builds a constant pool for all the symbols if a class in a class file. This class file when loaded by VM, the constant pool is translated into the runtime constant pool in the method area of the Heap.
    Symbols?
    It builds it for literals.
    Does any one know if there is only 1 runtime constant pool per class or is it 1 per class instance(Object). Certainly not by instance.
    And more likely it is per class loader. A class can't be unloaded unless its class loader is unloader so there would be no point in managing a pool per class when it could be managed via the class loader.
    The JVM spec did not clarify on this. Nor should it. That is an implementation detail of how the VM is implemented.
    Also if its 1 per class then how does the JVM know where all the instances of a class are while resolving references and also when garbage collecting???Not sure that question is sensical. The only reason it would need to know is because it is using the class. And the class might not own the pool, but it certainly references it.
    As for garbage collection that only occurs in the context of this question if the class loader is collected.

  • How to construct the constant pool?

    Greetings,
    I seems to have a little bit of a problem.
    I have a text file, generated by the javap -c <class_name> command,
    i.e.:
    javap -c myClass > myClass.txt
    This myClass.txt is the input I've got. I do not have the myClass.class, from which it was generated.
    What I wish to do, is to generate, from this text file, a leagal, runnable, class file (i.e., myClass.class).
    But, I have problems understanding how to construct the constant pool array.
    I have read the VM spec (java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html).
    The thing is, that it does not explain how to extract the needed information from the text file.
    Can someone assist?
    Would appreciate,
    Ohad.

    Compiled from Hello.java
    public class Hello extends java.lang.Object {
        public Hello();
        public static void main(java.lang.String[]);
    Method Hello()
       0 aload_0
       1 invokespecial #6 <Method java.lang.Object()>
       4 return
    Method void main(java.lang.String[])
       0 new #4 <Class java.util.Timer>
       3 dup
       4 invokespecial #7 <Method java.util.Timer()>
       7 new #2 <Class Hello$1>
      10 dup
      11 invokespecial #5 <Method Hello$1()>
      14 lconst_0
      15 lconst_1
      16 invokevirtual #8 <Method void schedule(java.util.TimerTask, long, long)>
      19 returnWell in this example, you have opcodes with arguments which are expressed as (for example) "#7 <Method java.util.Timer()>". This describes a constant pool element. I assume #7 refers to the location within the constant pool, and the text description tells you that it's an item of type method, and gives you the method name. So for all arguments expressed in this form, you'll need to reconstruct a constant pool item.

  • Outbound Connection Pool Entry Missing for DBAdapter in Clustered Weblogic Congfiguration

    Hi ,
    When I created an outbound connection pool entry in DBAdapter through weblogic console in a clustered environment ( 1-Admin server and 2-managed servers) and updated DB adapter, I indentified that connection entry is updated in only in plan.xml of one managed server and for other managed server it is not updated. Due to this we are unable to access Datasources for some requests from application.
    As a work around if we update plan.xml file of other managed server manually with required connection entry and update DB Adapter we are able to find the connection entry for both the managed servers.
    Apart from work around is there any other solution for this issue so that I can add a DB adapter connection entry through console which will update both plan.xml files.
    Thanks & Regards,
    Venkat

    I can suggest you to keep the Plan.xml file in shared drive that is accessible from all the server nodes,this will reduce the manual work.
    Regards
    Albin I
    http://www.albinsblog.com/

  • Exception with newFixedThreadPool -  Illegal constant pool index

    Hi,
    I got the following exception :
    Exception in thread "main" java.lang.ClassFormatError: Illegal constant pool index 1536 for method signature in class file java/util/concurrent/LinkedBlockingQueue
         at java.util.concurrent.Executors.newFixedThreadPool(Unknown Source)
    When executing the following line:
    ExecutorService es = Executors.newFixedThreadPool(10);
    What this error mean ?
    Thanks

    From the javadoc for java.lang.ClassFormatError:
    'Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file.'
    Reinstall.

  • "Illegal UTF8 string in constant pool"

    I'm running a jsp application on JRun 3.1 with an Appache web server. Every once in while I get this error when trying to access a jsp. "Illegal UTF8 string in constant pool". If I hit refresh or reload the page loads fine. It appears to be random and not very often. Does anybody know what is causing this or what I might do to eliminate this problem? Thanks

    Thanks for your reply. However the answer to that question does not appear to apply here. I'm not using the URLConnection.getInputStream().read() method. on my jsp page. The entire error is below:
    javax.servlet.ServletException: jrun__sub_topic2ejspe (Illegal UTF8 string in constant pool)
    java.lang.ClassFormatError: jrun__sub_topic2ejspe (Illegal UTF8 string in constant pool)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:438)
    at allaire.jrun.servlet.JSPClassLoader.loadClass(JSPClassLoader.java:82)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(JRunServletLoader.java:221)
    at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(JRunServletLoader.java:190)
    at allaire.jrun.servlet.JRunServletLoader.loadServlet(JRunServletLoader.java:177)
    at allaire.jrun.servlet.JRunServletLoader.reloadServlet(JRunServletLoader.java:161)
    at allaire.jrun.servlet.JRunSE.reloadServlet(JRunSE.java:1377)
    at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:205)
    at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:169)
    at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
    at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
    at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
    at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
    at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
    at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:382)
    at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
    at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
    As mentioned before the error occurs infrequently,and randomly. If you refresh or reload the page everything works fine. Does anybody know what might cause this error and/or what I can do to prevent it. Thanks

  • Class format error: Invalid constant pool tag found

    I am simply attempting to create an instance of an object and I get Class format error: Invalid constant pool tag found. Does anyone know what this means and how to fix it?
    Thanks.

    If you're compiling with J2SDK 1.4 or higher, you need to use "-target 1.1" on the javac command line.
    Also make sure you're not using any float constants such as 1.0 in your code.

  • Allow edit strings in constant pool + show index of constant pool items

    Please allow us to edit strings in constant pool and show the numeric index of constant pool items.

    Editing the strings in the constant pool takes some work since you have to re-adjust several length values throughout the SWF. However, SWF Investigator does show the index of the constant pool items in the disassembler tab.  Any time a constant is used, you will see " //nameIndex = #" at the end of the line. This number will represent the index of that constant in the constant pool.

  • Whats a String constant pool?

    I was reading an article about weak references and came across a peice of code
       Map<String,String> map = new WeakHashMap<String, String>();
          map.put(new String("Scott"), "McNealey");They also said
    if you don't call new String(), the reference for the map key will be to the system's string constant pool. This never goes away, so the weak reference will never be released. To get around this, new String("Scott") creates a reference to the reference in the string constant pool. The string contents are never duplicated. They stay in the constant pool. This simply creates a separate pointer to the string constant in the pool.
    I never heard of String constant pool could any one enlighten me. I didnt get the point of what above paragraph says also.
    Jubs

    No it won't: it will only be removed when the garbage collector rears
    its ugly head. Until then the reference will be present in the map.Okay it was unprecise. The item MAY be removed immediately after it
    has been inserted because the key object is only referenced from the
    Map itself.Yes, that is true, but mind though: any object that still has a strong
    reference to it will not be removed from that map. I use such weak maps
    for localization reasons a lot. When a localization changes (while the
    application is running), a whole lot of visual components must have
    their text part changed. They are all stored in such a weak reference map.
    Of course quite some visual components can be garbage collected
    at some time (think of labels etc. in JDialogs after the dialog has been
    disposed).
    These maps are ideal for those purposes.
    kind regards,
    Jos

  • What does "Illegal Constant Pool Type" error signify ?

    Hello,
    I have developed an application on a windows system that connects to a database, places values onto an object, and displays on a screen. When I run on a windows environment everything works fine. When I export to my external server, which is linux system, I get an "Illegal Constant Pool Type" error.
    What does this mean and how can I rectify?
    The error message can be found at:
    http://www.blazingvibes.com/blazinvibes/indexhome.jsp
    Thank you all for your help.

    No idea since I can't see the error or code.
    And I don't know about anyone else but I don't click on links unless I know the source, so its current location isn't going to help in that matter.
    Presumably you are doing printStackTrace() so the location of the error is obvious.

  • Question about String constant pool

    Is there is any function available to find how many Sring literal in String Constant pool

    Well, there's stuff like BCEL.
    But it may not do what you want.
    Why do you want to find out what's in the constant pool?

Maybe you are looking for

  • HT5035 how do i find out what the balance of a redeemed gift card is on itunes

    I have redeemed gift cards and want to see how much is left on the account. Where can I find the remaining balance?

  • FMS 2 on Suse Linux  9.1 - Rootserver

    Hi, i installed the Flash Server 2.0.1 developer version on my Suse Linux 9.1 Root Server. I can't loggin to the FlashServer Management Console Interface What exactly i need type in to the "Server Adress" Field? I tried ServerIp:PortNr and ServerHost

  • FM update - clearing of a down payment

    Hi everyone! So, this is the case: I have posted two invoices and two down payments (transaction F-48 for down payments and FB60 for invoices). Then I closed all those documents with one transaction (F-44: clear vendor). The result in FM are some str

  • Disable explicit content in iTunes store on iPad

    In iTunes preferences on my Mac I can go to Parental Preferences and click on restrict explicit content, how do I do the same thing for the iTunes store on the iPad? I know how to restrict explicit content from being played on the iPad, but I can't s

  • Manage Session Management

    Hi, Long story short, we're accessing APEX through a MS Access application. The Access application displays an inline IE window. It passes in a username and a encrypted code which APEX then parses to verify that it's a valid user etc... Before I cont