Illegal constant pool type error

hi friends,
i would like to know the possible causes of this error ... i got this as soon as i deployed a class into tomcat ... Given below is the entire error i got while starting the tomcat server .....
java.lang.ClassFormatError: com/infraportal/servlets/ipInitializer (Illegal cons
tant pool type)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:1677)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:900)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1350)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1230)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:979)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
7)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3959)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
284)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85
0)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep
loyer.java:320)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:727)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:477
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:394)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521
at org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:234
5)
at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
i will be glad to see some quick answers / comments on this
thanks and regards
venky

This error can be caused by a corrupt class file. Check it was transferred correctly.

Similar Messages

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

  • "Illegal constant pool type"...how do I fix this????!!

    I have a method that previously ran perfectly and now will not even start. It keeps giving me the following error message:
    "Exception in thread "main" java.lang.ClassFormatError: WF_RevAnalysis (Illegal constant pool type)"
    ...(where 'WF_RevAnalysis is the name of my class)
    Could someone please tell me what an illegal constant pool type is and how I can fix/see/change it???
    Thanks!

    No I haven't installed a new JRE. The method was working fine...then suddenly 15 minutes later it started giving the illegal pool type error.
    Do you by chance know how to find this Constant Pool?

  • Illegal constant pool type??

    Hi there,
    Anyone knows what's going on here????? any help appreciated!
    [java] java.lang.ClassFormatError: com/bellsouth/estore/cbs/sbvs/relatedaccount/ejb/RelatedAccountServiceBean
    (Illegal constant pool type]
    [java] at java.lang.ClassLoader.defineClass0(Native Method)
    [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    [java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    [java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    [java] at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    [java] at weblogic.ejb20.deployer.BeanInfoImpl.loadClass(BeanInfoImpl.java:297)
    [java] at weblogic.ejb20.deployer.BeanInfoImpl.<init>(BeanInfoImpl.java:155)
    [java] at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.<init>(ClientDrivenBeanInfoImpl.java:157)
    [java] at weblogic.ejb20.deployer.SessionBeanInfoImpl.<init>(SessionBeanInfoImpl.java:103)
    [java] at weblogic.ejb20.deployer.BeanInfoImpl.createBeanInfoImpl(BeanInfoImpl.java:327)
    [java] at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDeploymentInfoImpl.java:395)
    [java] at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:126)
    [java] at weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:128)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:358)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:79)
    [java] at weblogic.ejbc20.main(ejbc20.java:460)
    [java] Exception in thread "main"
    [java] Java Result: 1

    Bt the way, there could be another tricky issue. If one uses CVS and checks
    in ejbjar without setting -kb on it, the ejbjar that is cheked out will be
    broken,
    at least for default CVS settings.
    Slava
    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]...
    It looks like a malformed class file. Run the verifier (or javap) against
    that class. Turn off JAR compression. Transport files via ftp with the"bin"
    setting. etc.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Dong" <[email protected]> wrote in message
    news:[email protected]...
    Hi there,
    Anyone knows what's going on here????? any help appreciated!
    [java] java.lang.ClassFormatError:com/bellsouth/estore/cbs/sbvs/relatedaccount/ejb/RelatedAccountServiceBean
    (Illegal constant pool type]
    [java] at java.lang.ClassLoader.defineClass0(Native Method)
    [java] at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    [java] atjava.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    [java] atjava.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    [java] at
    java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    [java] at java.security.AccessController.doPrivileged(NativeMethod)
    [java] atjava.net.URLClassLoader.findClass(URLClassLoader.java:188)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    [java] atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    [java] atweblogic.ejb20.deployer.BeanInfoImpl.loadClass(BeanInfoImpl.java:297)
    [java] atweblogic.ejb20.deployer.BeanInfoImpl.<init>(BeanInfoImpl.java:155)
    [java] at
    weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.<init>(ClientDrivenBeanInfo
    Impl.java:157)
    [java] at
    weblogic.ejb20.deployer.SessionBeanInfoImpl.<init>(SessionBeanInfoImpl.java:
    103)
    [java] at
    weblogic.ejb20.deployer.BeanInfoImpl.createBeanInfoImpl(BeanInfoImpl.java:32
    7)
    [java] at
    weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDep
    loymentInfoImpl.java:395)
    [java] at
    weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoIm
    pl.java:126)
    [java] atweblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:128)
    [java] at weblogic.ejbc20.runBody(ejbc20.java:358)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:79)
    [java] at weblogic.ejbc20.main(ejbc20.java:460)
    [java] Exception in thread "main"
    [java] Java Result: 1

  • Java.lang.ClassFormatError: JavaBanner (Illegal constant pool type)

    How do I resolve this error? If you know please e-mail me @ [email protected] . Thank You. Thomas

    Why do you post the same thing in two different threads? Check the other thread. If you haven't got over it, give me the complete stack trace and the other details.

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

  • 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

  • Illegal start of type error when adding for loop to applet

    I have typed the following applet to print a horizontal row of stars with the length entered by the user (i.e. user enters 4 and applet prints out 4 stars in a row). Here is my code:
    import java.awt.Graphics;
    import javax.swing.*;
    public class Histograms extends JApplet
           String input = "";
            int number;
         public void init()
              input = JOptionPane.showInputDialog ( null,
              "Enter a number\nbetween 1 and 30:" );
              number = Integer.parseInt( input );
         public void paint ( Graphics g )
              for ( int counter = 1; counter <= number; counter++ )
                                    System.out.print( "*" );
               System.out.println();
    };Now I am trying to make it do this 5 times, so it seems like just surrounding the init and paint methods in a for loop (i.e. for ( int i=1; i <= 5; i++ ) ) would do the trick but when I do that I get an illegal start of type error when trying to compile. Does anyone know why this error would show up. The most common reply to questions of this sort seems to be to check the closing braces but I have checked very carefully after adding the for loop and don't see any problems with mismatched braces. Could you please help me get on the right track as to how I can make this applet print a horizontal row of stars five times? All help is appreciated.

    Hello JTMOBOP:
    You were correct in figuring that I was trying to get the applet to print five rows of stars of different length according to five different inputs from the user. I tried your suggestions, and the code now does compile and run, but it still does not run properly (i.e. only asks user once for input and displays row of stars but does not show an input dialog again). Here is the code I have retyped:
    import java.awt.Graphics;
    import javax.swing.*;
    public class Histograms extends JApplet
       String input = "";
       int[] number = new int[5];
       public void init()
          for ( int i = 0; i < 5; i++ )
             input = JOptionPane.showInputDialog ( null,
                "Enter a number\nbetween 1 and 30:" );
             number[i] = Integer.parseInt( input );
       public void paint ( Graphics g )
          for ( int i = 0; i < 5; i++ )
             for ( int myNumber = 0; myNumber <= number; myNumber++ )
    System.out.print( "*" );
    System.out.println();
    Any ideas what's going on here?
    Also, your comments about not being able to loop a method make sense. Thank you for the input so far.

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

  • Error in groovy expression: Illegal type in constant pool

    Hi,
    I intermittently get this error on my page:
    EMGC_OMS1 ERROR] [ http://oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator [tid:
    userId: SYSMAN ecid: 004emUHK7jA9XbWLHyl3if0002JD0011gG,0:1 APP: emgc URI: ... ... ... :Server Exception during PPR, #15[[ javax.servlet.ServletException: java.lang.VerifyError: (class: org/codehaus/groovy/runtime/ArrayUtil, method: createArray signature: ()[Ljava/lang/Object;) Illegal type in constant pool
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    Caused by: java.lang.VerifyError: (class:
    org/codehaus/groovy/runtime/ArrayUtil, method: createArray signature:
    ()[Ljava/lang/Object;) Illegal type in constant pool
             at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
             at bc4j.oracle_sysman_core_event_console_uimodel_view_IssueListVO_PriorityLocalizedLabel_null.gs.run(bc4j.oracle_sysman_core_event_console_uimodel_view_IssueListVO_PriorityLocalizedLabel_null.gs.groovy:1)
             at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:1208)
    The IssueListVO getPriorityLocalizedLabel uses a groovy expression:
    oracle.sysman.core.event.common.uimodel.util.MetadataUtil.getPriorityLabel(Priority.intValue()).
    The Priority field is defined to be numeric, and the repository data shows all records having a value of 0, so this groovy expression should behave correctly.
    We are using Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013.
    Any ideas on how to resolve this?
    Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    cn u chk this
    LinkageError

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

  • Error with illegal start of type

    Hi. I have a problem on illegal start of type at "public BookDetails findBook( String bookTitle ){" this sentence. Can you help me to solve it?
    rest of the class are able to compile.Left with this only...
    here is my class file:
    import java.util.Scanner;
    public class Book{
              private BookDetails[] details;
              public Book(){
              BookDetails[] details = new BookDetails[15];
              details[0] = new BookDetails("The Secret", "Rhonda Byrne", "0001", 10);
              details[1] = new BookDetails("Secrets of Self-Made Millionaires", "Adam Khoo", "0002", 10);
              details[2] = new BookDetails("An Illustrated Biography of the World's Most Successful Investor", "Warren Buffet", "0003", 15);
              details[3] = new BookDetails("How good do we have to be?", "Harold Kushner", "0004", 8);
              details[4] = new BookDetails("Half a Life", "V.S.Naipaul", "0005", 5);
              details[5] = new BookDetails("Subconscious", "Murphy McMahan", "0006", 6);
              details[6] = new BookDetails("The Road Less Travelled", "M. Scott Peck", "0007", 5);
              details[7] = new BookDetails("Stop the insanity!", "Susan Powter", "0008", 5);
              details[8] = new BookDetails("Business As Usual", "Anita Roddick", "0009", 6);
              details[9] = new BookDetails("Rich Kid, Smart Kid", "Robert Kiyosaki", "0010", 6);
              details[10] = new BookDetails("Secrets of the Millionaire Mind", "Harv Eker", "0011", 10);
              details[11] = new BookDetails("Where have all the leaders gone?", "Lee Iacocca", "0012", 15);
              details[12] = new BookDetails("If success is a game, these are the rules", "Cherie Carter", "0013", 8);
              details[13] = new BookDetails("Think Big", "Donald Trump", "0014", 15);
              details[14] = new BookDetails("Blink", "Malcolm Gladwell", "0015", 10);
              do{
                   Scanner input = new Scanner( System.in );
                   System.out.print( "Enter the title of the book.");
                   bookTitle = input.nextLine();
                   public BookDetails findBook( String bookTitle ){
                   int Book = details.length;
                   for( int i = 0; i < Book; i++ ){
                        if( details.getBookTitle().equalsIgnoreCase( bookTitle ))
                        return details[i];
                   System.out.println( "Book title : " + bookTitle + " found" + "\n"
                             + "Details for book title " + bookTitle + "\n"
                             + "Author : " + BookDetails.getAuthor() + "\n"
                             + "CatalogueNo : " + BookDetails.getCatalogueNo() + "\n"
                             + "Cost : $" + BookDetails.getCost());
                   System.out.println( "Proceed to rent? <Y/N> : ");
                   select = input.nextLine();
                   if ( select.equalsIgnoreCase( "Y" ))
                   System.out.print("Enter the name of customer : ");
                   na = input.nextLine();
                   System.out.print("Enter the address of customer : ");
                   add = input.nextLine();
                   System.out.print("Enter the phone number of customer : ");
                   phone = input.nextLine();
                   CustomerDetails person = new CustomerDetails( na, add );
                   System.out.println( "Printing out receipt for " + person.getName() + ".....");
                   System.out.println( "At address : " + person.getAddress() );
                   System.out.println( "Renting book title " + bookTitle + " for $" + BookDetails.getCost());
                   System.out.println( "Serving next customer....." );
                   if ( select.equalsIgnoreCase( "N" ))
                   System.out.println( "Serving next customer....." );
                   }//for
                   System.out.println( "Book title: " + bookTitle + " not found" );
                   System.out.println( bookTitle + " not available" + "\n"
                                  + "Serving next customer....." );
                   return null;
                   }//class
              }while( "E" );

    ok. Now is like this:
    import java.util.Scanner;
    public class Book{
              String bookTitle, na, add, phone, select;
              BookDetails bookDetails = new BookDetails();
              do{
                   Scanner input = new Scanner( System.in );
              do{
                   System.out.print( "Enter the title of the book.");
                   bookTitle = input.nextLine();
                   BookDetails = BookDetails.findBook(book Title);
              }while(Book == null);
                   System.out.println( "Book title : " + bookTitle + " found" + "\n"
                             + "Details for book title " + bookTitle + "\n"
                             + "Author : " + BookDetails.getAuthor() + "\n"
                             + "CatalogueNo : " + BookDetails.getCatalogueNo() + "\n"
                             + "Cost : $" + BookDetails.getCost());
                   System.out.println( "Proceed to rent? <Y/N> : ");
                   select = input.nextLine();
                   if ( select.equalsIgnoreCase( "Y" ))
                   System.out.print("Enter the name of customer : ");
                   na = input.nextLine();
                   System.out.print("Enter the address of customer : ");
                   add = input.nextLine();
                   System.out.print("Enter the phone number of customer : ");
                   phone = input.nextLine();
                   CustomerDetails person = new CustomerDetails( na, add );
                   System.out.println( "Printing out receipt for " + person.getName() + ".....");
                   System.out.println( "At address : " + person.getAddress() );
                   System.out.println( "Renting book title " + bookTitle + " for $" + BookDetails.getCost());
                   System.out.println( "Serving next customer....." );
                   if ( select.equalsIgnoreCase( "N" ))
                   System.out.println( "Serving next customer....." );
                   }//class
              }while( "E" );
    But, there's still error saying illegal start of type at "do{"

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

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

Maybe you are looking for