Bad index in constant pool #1      Code segment has wrong length

java.lang.ClassFormatError: nz/net/quickstep/uiobjects/Cba2efkSflctl (Bad index in constant pool #1)

From your code..
Here is a suggestion
try {
for (int i=0; i<b.length; i++) b[ i ]=0; // zero the array
Class c = defineClass(name, b, 0, b.length);
} catch (ClassFormatError cfe) {
System.out.println("Error trying to load class "+name); //print the name....
for (int i=0; i<b.length; i++) b[ i ]=0; // zero the array
Class c = defineClass(name, b, 0, b.length);This make all bytes to '0'. So how would it create class??

Similar Messages

  • RMI ClassFormatError *_Stub (Bad index into constant pool)

    I get a
    java.lang.ClassFormatError: RollGrinder_Stub (Bad index into constant pool)
    when I try to instatiate my class that extends UnicastRemoteObject in my main RMIServer code.
    java version "1.3.1_01" on RedHat Linux 7.1
    Can anybody help me?

    Never mind I am an idiot. I was using javac & java from 1.3 but was using rmic & rmiregistry from an older version of java

  • ClassFormatError *_Stub (Bad index into constant pool)

    I get a
    java.lang.ClassFormatError: RollGrinder_Stub (Bad index into constant pool)
    when I try to instatiate my class that extends UnicastRemoteObject in my main RMIServer code.
    java version "1.3.1_01" on RedHat Linux 7.1
    Can anybody help me?

    Never mind I am an idiot. I was using javac & java from 1.3 but was using rmic & rmiregistry from an older version of java

  • 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.

  • Reflection error (Illegal constant pool index)

    Heya,
    I use reflection to invoke Java classes and I get Error:
    java.lang.ClassFormatError: AppendToElement (Illegal constant pool index)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:431)
         at XCOClassLoader.loadClass(XCOClassLoader.java:74)
    // AppendToElement is name of class I want to invoke
    I have bunch of classes from someone else, which I need to invoke and I get this error for all of them. When I invoke classes written (and compiled) by me, everything is OK.
    It seems that the problem is that, these external classes were compiled with different version of Java. As they were written by someone else and I don't have source code, I can't recompile them.
    Is cause of that problem, different JVM versions ? Is there a way how to correct it on runtime ?
    Thanks,
    Michal

    The problem isn't one of versions. The files have become corrupted somehow. I suggest you ask for another copy.

  • Different index used in same code segments

    Hi,
    I noticed the following peculiar behaviour when trying to troubleshoot the long running time of an ABAP :
    1) while doing an SQL trace (ST05) of the long running program, the trace results show that index "A" was being used.
    2) when I took that particular SELECT code segment of the program and ran it by itself, the trace results showed that index "B" was used and that the data retrieval was very fast
    It is obvious that index "A" is the incorrect index to be used but how do we "influence" the use of index "B" (the correct index) to be used during program runtime?
    And why did the program use the incorrect index in the first place?
    Has anyone encountered similar situation?
    Thanks in advance.

    Hi Thomas & Siegfried,
    Thanks for your replies.
    Point noted.  Will investigate further.
    Regards

  • 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 constant pool index ????

    Hi
    I wrote a hello world program using J2ME with a view to writing a game for a mobile phone. I'm a C++ programmer and have never looked a java befor so I have no idea what is going on under the sheets.
    The hello world program is called Welcome (straight out of Sun's J2ME book). It seemed to compile ok and left me with a file called Welcome.class
    Following the instructions in the book and working from the Command Line on WindowsXP I typed
    d:\preverify ....etc
    I got the following
    Error preverifying class Welcome
    Class loading error: Illegal constant pool index
    I've double checked everything and can't find a problem - any ideas?
    Cheers
    Steve

    Stupid - hadn't downloaded the runtime

  • 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

  • The code segment cannot be greater than or equal to 64K. - Windows 8

    Hello,
    I am having an issue on some windows 8 systems, a crash occurs in NtSetEvent, the exception thrown is "0x000000C8: The code segment cannot be greater than or equal to 64K.".
    This crash only occurs on Windows 8.
    The callstack doesn't help much
        KERNELBASE.dll!_RaiseException@16()    Unknown
        ntdll.dll!_NtSetEvent@8()    Unknown
        kernel32.dll!@BaseThreadInitThunk@12()    Unknown
        ntdll.dll!__RtlUserThreadStart()    Unknown
        ntdll.dll!__RtlUserThreadStart@8()    Unknown
    Could it be a bug within windows 8 ? If not what steps should I take to find the cause of this crash ?
    Thank you,
    Max

    I have a feeling like you have corrupted something.  Likely by stomping on memory due to a bug in your program such as a buffer overrun or use of a deleted object in C++.
    Although you may have incurred corruption to your registry through a variety of means, not limited to bad disk drives, or the unintentional write of bad data due to a bug in your program, if you are experiencing this on multiple systems, then registry corruption
    is less likely.  Which brings me back to the idea that you have a bug in your code that has trashed memory somehow.
    The stack traces and error codes do not indicate the cause of the problem.
    What does your program do??
    Without seeing at least some of the code, or knowing how big the scope of the code is, it's not useful for me to start guessing specifics of what may have happened.  But since you're not disclosing anything at all about your code apart from your exception,
    I'm forced to do some guesswork and just give general advice.
    Here are some easy classical strategies for locating the cause of the problem:
    Build your code in debug mode and run your code in the debugger.  (Yes, some people need to be told this.)
    Bisect the problem through revision control.  Back up to when the problem didn't happen and find the last revision that causes the problem.  (If you're not using a revision control system, start now.)
    Bisect the problem by eliminating chunks of code.  Trim out functionality until the problem goes away.
    Write unit tests.  Test the various pieces of your program to eliminate bugs.  At the very least, make use of assertions.
    Have a look at what your program is DOING when the crash happens.  Certainly there must be a cause.  Try to isolate the problem by associating it with a certain activity in your program.  Gate off functionality by introducing places where
    your program waits before proceeding.  At some point, you'll pass a point where the error can now occur.
    Run code analysis on your project and see if it comes up with any possible culprits.
    Don't ignore compiler warnings, they often indicate something that can turn into a bigger problem.  Compile at the highest warning level.
    Look at your usage of various API functions for logical mistakes.  Here are some examples:
    When using third party libraries or SDKs, have you initialized libraries appropriately?  Have you called all the appropriate initialization functions and used the APIs as intended?  Read documentation and make sure you are using calls appropriately.
    For functions that take a HANDLE, such as SetEvent, are you passing a valid handle?  Have you closed the handle but kept the old handle value around?
    When storing pointers to objects, have you accidentally deleted an object but kept its pointer around, only to make use of the pointer at a later time in your program?  This is particularly harmful when performing a write operation as you can corrupt
    just about anything.
    Are you using variables without giving them an initial value?  You may get unexpected values for variables if you do not initialize them.  This is particularly important for stack variables.
    When using arrays or string buffers, have you allocated enough storage for the bytes you are writing?  C++ doesn't detect reading or writing with an invalid array index as a problem.  It happily reads or writes past the end of your intended
    storage.  Such offences are called "buffer overruns".
    When multi-threading, are you taking steps to ensure data integrity?  Unsynchronized access to data from multiple threads is a notorious cause of strange and difficult to reproduce bugs.  Your data passes through states that you may not expect
    that can be observed by unsynchronized threads.  Use locking mechanisms appropriately and marshal your data diligently.
    Are you relying on valid input from an external source beyond your control such as a network client, database, or file?  Diligently validate all input that comes from an external source.  Be prepared for any situation that you can't control at
    compile time.
    Are you ignoring error codes?  Some functions may fail, but you may be assuming they have succeeded and then gone on to use invalid data.
    Look for mathematical errors.  Calculation of indices of arrays are a notorious culprit.  Beware of off by one errors.  Indices start at zero and go up to N-1, where N is the number of elements in the array.
    Beware of sentinel values.  Some functions such as "IndexOf" will return an index of -1 when not found and can result in a miscalculation of an actual index.
    Are you making use of
    RAII techniques in your code?  Failing to correctly allocate and deallocate resources can cause problems.
    Are you making use of unsafe casts?  C-Style casts say "I know what I'm doing", and you can get into dangerous situations.  Prefer static_cast<> over a C-Style cast wherever possible.
    Also look at your project settings for problems
    Have you accidentally mixed incompatible compiler settings between components?
    Approach debugging with an open mind.  Mark Twain said, "It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so."

  • 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.

  • 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.

  • 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.

  • 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.

Maybe you are looking for

  • Remote Voice Over Workflows using FCP - thoughts?

    I am going to try and keep this as simple as possible. I am Producer and host for an Australian Drag Racing Show that we air nationally... We record these shows in Full 1080 HD using modern XFILE systems (EVS) using the Apple ProRes 422 (HQ) codec. O

  • How do I fix an "Insane Object" Error ?

    I am receiving an "Insane Object" error when I load one partuclar VI. Is there any way to "copy" the diagram to a new file to fix the corrupted Object ? I am using Win N/T 4.0 and LabView 6i. The module was originally designed using LabView 5.X and t

  • Java JDK Installation Problem - Need Help!

    Below is my program Access.java which resides in c:\java. It generates a "NoSuchMethodError" when I run it on my Windows 2000 computer at work. When my friend here at work runs the SAME program on his Windows 2000 computer, it runs fine. I have No id

  • T510 how to use COA key, failed , is it possible??

    Hi, my hdd crashed on T510, so I tried to use retail DVD with W7 Pro 64 and tried to enter that key COA and it didn't work. Can anybody tell me  can I use it to have legit W7 and don't pay $60 for restore DVD. Total confused, why they put that key th

  • Is it safe to download the Yosemite on the Macbook pro

    I am wondering if it is safe to download Yosemite to the laptop because it says that it is not comparable with all apps.  Plus it did not suggest it as an upgrade.  What to do?  What to do?