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.

Similar Messages

  • How to fix the constant noise in the left corner of the Macbook Air which is connected not with a fan?

    How to fix the constant noise in the left corner of the Macbook Air which is connected not with a fan?

    Unfortunately if there are various colours across the screen then you have broken the LCD Screen and it will need replacing. If the colours change when you press the area lightly then this is another symptom that you've broken the screen.
    Sorry to give the bad news!

  • How to display the Message Pool Messages in CE 7.2

    Hi Experts,
    Please let me know how to display the Message Pool Messages in CE 7.2.
    I have tried with reportContextAttributeMessage, but it is deprecated in CE 7.2.
    Please do the needful.Its Urgent.
    Thanks & Regards,
    SatheshKumar R

    Hi Sathesh,
    Do the following steps:
    1.) After creating a component, under it you will see Message Pools. Double click and open it.
    2).Click "Add Message" and add a new message. (Give a message key, type of message (either warning, error etc ) and message text).
    3). Save the metadata.
    4). Raise this message where all you want by using following code(For example, on click of a button) :
          IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
          msgnr.reportMessage(IMessage<component name>.<message>,null,true);
    For example, I have a component name TestAppComp and under message pool I have message called message1, then use lik this:
            IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
            msgnr.reportMessage(IMessageTestAppComp.MESSAGE1,null,true);
    Reply me if you any doubt.
    Regards,
    Jithin

  • How to print the Module pool screen using a push button in the screen

    Hi Every one,
                         i have developed a module program , which have a selection screen and it display the output in a structured way.
    output includes boxes, texts etc...
    my problem is :---
    How to print the Module pool screen using a push button in the screen.

    When the "Print" button is pressed:
    leave to list-processing and return to screen 100.  "(current screen)
    Call a transaction that runs your print program.
    Rob

  • 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

  • How to degub the module pool program

    Hi friends,
    could anyone tell me "How to degub the module pool program"...!!
    Thanks in advance..!!

    Hi
    Debugging of module pool is same as reports, use /h or put breakpoint
    but u shud know what u want to check
    there are generally two event used in module pool
    PBO
    This event is used before displaying the screen,It is used to clear fields table, show table control, tabstrip and most important conditionally modify the scrren .
    PAI
    is used to validate the fields which are entered on the screen with database values and then fetch records from table.
    i mean all values to make available in internal table
    now u would be sure which part u want to debug.
    Rewards if helpful..............

  • How to construct the component tree in my custom component?Help!

    Hi, i am writing a custom component like this:
    public class HtmlCategory extends HtmlPanelGrid
         public void processRestoreState(javax.faces.context.FacesContext context,
                java.lang.Object state)
              setColumns(1);
              HtmlCommandLink link=new HtmlCommandLink();
              link.setValue("Let's Bingo");
              MyUtil.setActionListener(context,link,"#{temp.mytest}");
              UIParameter param=new UIParameter();
              param.setName("name");
              param.setValue("Robin!");
              link.getChildren().add(param);
              param.setParent(link);
              getChildren().add(link);
              link.setParent(this);
              super.processRestoreState(context,state);
    }         you see, i want to construct the compont tree at Restore View phase this way,because the structure of the component tree will always be the same, so i don't the user to write extra code.
    But the children of the component are not rendered,the renderer of the HtmlCategory component just extends the HtmlGridRenderer(myfaces) directly,and always calls the "super" methods in the encode methods of the renderer.
    I got a message from the console:
    Wrong columns attribute for PanelGrid id0:id4: -2147483648
    but i have set the columns attribute in the code above, so what's happening? or please give some advice about how to render the component tree by myself in Restore View with the tree constructing code in the custom component class code,just lke the code above.
    Best Regards:)
    Robin

    Well, i don't know if i have got my question clear.
    usually, according to the tags you use in the jsf page, a component tree will be created at the Restore View phase,for example:
    <f:form>
      <h:panelGrid ...........>                         
              <h:dataTable ................>
              </h:dataTable>
       </h:panelGrid>
    </f:form>but because i am writing a component for my web app, all the child components and their attributes are not likely to change. so i want to reduce the tags into one custom tag, and construct the component tree internally by myself.But it is not the case of backing bean.So i wrote the the code in the method:
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)as it is shown in my orginal message.But it seems that it is not right way to construct my component tree.So where should i put the code that construct the component tree?Overriding the method :
    public void processRestoreState(javax.faces.context.FacesContext context,java.lang.Object state)is not the right way?
    Best Regards:)
    Robin

  • How to change the constant with which you multiplied a column

    Hello,
    I'm making a spreadsheet with prices in Dollars and then converting them to Euros. Obviously the exchange rate changes all the time, so I was wondering how I could multiply my column A of dollar prices by the current exchange rate to get my column B of Euro prices and then change the prices when the exchange rate changes.
    Is it possible to just give the new exchange rate so that my numbers in column B automatically change?
    I know I can just always click c1 = b1*1,34 (for example) and then fill down, and then at a later date remove all the prices again and do C1= B1*1,30 and fill down again but I was wondering whether there was an easier way to change the Constant with which you previously multiplied a column.
    Thanks for your help, I hope my question was sort of understandable!
    I've looked but couldn't find a similar post, sorry if I missed it!
    Larissa

    LarissaG wrote:
    Hi,
    This definitely helps! But is a bit inconvenient when you have lots and lots of rowns in Column A.
    Oh well! I better get started.
    Thank you!
    That's because you are thinking about typing formulas into each an every row by hand. That would be horrendously inefficient and people would despise designing spreadsheets if it had to be done that way.
    Using Jerry's example as the starting point,
    Type the formula =B3*C$1 into cell C3 and hit enter.
    Select cell C3
    Drag down on the little circle at the bottom right corner of the selection box to complete the column. Alternatively, you can Copy then select the rest of the column and Paste.

  • How to construct the HashMap

    Hey there, Im new to hashmaps (I always felt fine using Arrays for the simple scripts i made thusfar). Now I have a list that lookst like this:
    Word > synomym1, synonym 2
    Word2 > synomym1, synonym 2
    etc...
    How do I construct the Hashmap for this purpose?

    Depends on what you want to use it for. One option is a HashMap<String, List><String>>.Do you mean to use HashMap<String, List> ?

  • HOW TO CONSTRUCT THE URL WITH INTRADOCUMENT LINKS (#...)?

    I have a url and i want to access or construct the full URL in jsp without losing the # links in the url. If I make a call to the URL lets say using the below mentioned way. when I issue the request.get... Methods to construct the URL inside the JSP page the #doclink were lost. The issue I have is people who have bookmarked a page like this should be automatically taken to that part of the document where the intra document link is define (or book mark link) using anchor tag.
    Is there any method or technique available to get the full url including the #doclink
    http://www.blahblah.com/blah.jsp?pg=/path/otherpath/blah.html#doclink
    is there a way to do it.
    You help in this regard will be greatly appreciated
    Thanks.

    Hey thanks for your reply, I want how can I retain the #doclink in a JSP page without losing it when someone types something like the below mentioned in the browser address bar. If they have bookmarked it this way, this is the way the browser is going to make the request.
    http://www.blahblah.com/blah.jsp?pg=/path/otherpath/blah.html#doclink
    So, inside the JSP page, getRequestURL, getRequestURI, and getQueryString, helps me reconstruct the URL but the #doclink gets missed. I can use the URLEncoding when it's inside the HREF or something, but when called from a browser the above way, I cant do anything really.
    Your help is greatly appreciated.
    Thanks a lot.

  • How to Troubleshoot the Connection Pool Exception?

    Dear Oracle Gurus, very good afternoon to you.
    I'm looking forward for some tips/troubleshoting guide to escape from the below exception, that occres very frequently to one of application that 100+ users will login from different locations & work on and update the data and save their work, where all in sudden they can't acces the application and it gets down.
    Most of the times in the server log I observed below.
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    Please help me on, how to overcome this kind of exception.
    In Weblogi c server I see below kind of Warnings.
    If you set the buffer size to zero in a servlet, it would fail to respond and would initiate an infinite loop in the server. WebLogic Server would ultimately display a Errors:
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    I searched over google for this kind of error, See otherusers posted the same kind of errors but didn't have any positive replies to troubleshoot this issue.
    I also got Oracle Dev link on Weblogic version upgrade product where they fixed similar kind of error it seems. Which is shown below.
    http://docs.oracle.com/cd/E13222_01/wls/docs61/notes/bugfixes2.html -- BUG # CR106186
    details:
    "Suspend Checker Thread" prio=10 tid=0x23eb90 nid=0xfec runnable
    <May 14, 2003 10:53:34 AM PDT> <Warning> <WebLogicServer> <000337>
    <ExecuteThread: '10' for queue: 'default' has been busy for "1,181" seconds working on the request "Http Request: servlet_uri", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.>
    This problem was solved with a code fix.
    Looking forward for some help, Thank you inadvance.
    FYI..
    I'm using oracle thin driver JDBC connection/Weblogic 8.1
    Edited by: user1072948 on Apr 26, 2012 11:55 AM

    I agree that looking into the number of connections that you have open when you see
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    would be a good idea; but I would suggest that you don't increase without thinking about the consequences. I would look more closely at what the connections to the database are doing, for instance, how long are the connection being left open for? What are the queries that are being run? Should you expect to see all the connections in the connection pool being used? What is the current connection pool limit? Are you simply going to increase the number of connections to find that they are also waiting? What is the load on the database at the time?
    It's the other error that you say you see
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    What does this JSP do? Why would this be busy for so long? Is it related to the previous exception that you have? I'd ask you delevelopment team to look into this.
    In short, it sounds like you have load issues on your server(s) and a careful tuning of the system after a full analysis (thread dumps, heap profiling, connection pool monitoring and code review) would probably be beneficial. It may be that restricting the thread pool may help, it may be that increasing the connection pool would help. I'd not plump for a quick fix here.

  • How to copy the module pool program ( Screens, codeing ) ?

    Hi guys,
           How can I copy the Module pool program to another program including screen and every thing?
          can anyone help me....

    1. GO TO SE80, and select program from drop down
    2. Enter Source Prog Name and press enter
    3. Below Object name, right click on the program
    4. Select COPY and enter the (New) Target Prog Name
    it ll ask for following check box options
    -Source
    -Text Element
    -Documentation
    -Variant...etc.
    5 Select all and press enter.
    Hope this ll be helpful.
    Thanks & Regards
    Vinsee

  • How to calculate the shared pool size ..........

    Does anyone know if there is a decent algorithm/method to calculate the shared pool size in Oracle 8.1.7.

    look my answer on your thread about db cache size
    How to Calculate the DB Block Buffer value.

  • How to change the connection pool configuration on OC4J?

    Hi everybody,
    I am developing an application with JDeveloper which is running on an OC4J standalone server, we have 2 enviroments, the develop server and the server of the client, and the data base connection configurations are differents.
    The problem is that if we try to deploy the application (we have deploy on the develop server) on the client server and try to change the connection pool configuration the application cannot connect to the data base, we need to re-build the project with the client connection pool configuration.
    We tried to change the configuration on the enterprise manager of the OC4J, on "JDBC Resources" panel, and the test the connection is ok, but when try to access to the application we get an Exception. After that we try to do that changing the parameters from the datasources.xml file on the application, but the result is the same.
    How can we change the DataBase configuration without re-build the project?
    Thanks very much
    Tony

    Meaning you have created just the empty data-sources.xml and not configured any Connection Pool and DataSource in JDev?
    In Oracle AS 10.1.3 you have two ways to do this:
    1. Use JDev and configure the data-sources.xml (Context Menu -> Properties)
    2. In Oracle AS: Select application -> Administration -> Services -> JDBC Resources -> Create Pool and Create DataSource
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to create the connection pool using jdbc20 driver?

    Hi all,
    My configuration is WL4.5 SP5 + jdk1.2.2+WinNT+ Oracle thin driver
    8.1.6.
    It is creating the connections with weblogic.jdbc.pool.Driver, whereas i
    want the connections in the pool to be created with jdbc20 driver. This
    how my pool definition is defined.
    weblogic.jdbc.connectionPool.PoolName=\
    url=jdbc:oracle:thin:@<IP address>:<Instance>,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=40,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=5,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=XXXX;password=XXXX
    The reason is I want to use BLOB's. I have a message posted in jdbc news
    group with the exception i got. But since this more of a environement
    issue i am posting it here.
    Any help is appreciated,
    Thanks
    John

    Here is the correct pool definition.
    ################JDBC20 Driver#########################
    weblogic.jdbc.connectionPool.jdbc20Pool=\
    url=jdbc20:weblogic:oracle,\
    driver=weblogic.jdbc20.oci.Driver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=1,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=SCOTT;password=tiger;server=goldengate
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.jdbc20Pool=guest
    Hope this helps,
    --Kumar
    Kuppuswamy Seshadhri wrote:
    I think you are missing the port number.
    A working example,
    Ensuring
    - TSNAMES is setup and the service is running
    - set ORACLE_HOME variable in setenv.cmd
    weblogic.jdbc.connectionPool.theOraclePool=\
    url=jdbc:oracle:thin:@IPADRESS:1521:orcl,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=XXXX;password=XXXX;
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.theOraclePool=everyone
    Kuppu
    "John Galt" <[email protected]> wrote in message
    news:[email protected]..
    Hi all,
    My configuration is WL4.5 SP5 + jdk1.2.2+WinNT+ Oracle thin driver
    8.1.6.
    It is creating the connections with weblogic.jdbc.pool.Driver, whereas i
    want the connections in the pool to be created with jdbc20 driver. This
    how my pool definition is defined.
    weblogic.jdbc.connectionPool.PoolName=\
    url=jdbc:oracle:thin:@<IP address>:<Instance>,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=40,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=5,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=XXXX;password=XXXX
    The reason is I want to use BLOB's. I have a message posted in jdbc news
    group with the exception i got. But since this more of a environement
    issue i am posting it here.
    Any help is appreciated,
    Thanks
    John

Maybe you are looking for