Illegal component position error

Hi I'm new to GUI's and I'm trying to add a menu bar onto my jframe for a creation of a word processor. I'm using the Jtextarea for the text field. I keep getting this message but dont understand what it means:
java.lang.IllegalArgumentException: illegal component position
at java.awt.Container.addImpl(Container.java:325)
at java.awt.Container.add(Container.java:252)
at javax.swing.JMenu.add(JMenu.java:511)
at wordprocessor.WordProcessorDemo.<init>(WordProcessorDemo.java:68)
at wordprocessor.WordProcessorDemo.main(WordProcessorDemo.java:18)Any help would be greatly appreciated. Thanks.

Is that the only thing wrong or is there more to it?

Similar Messages

  • Why do I get Illegal Component position when I say FlowLayout.CENTER

    The code runs fine if you replace the line
    Jp7.add(submitButton, FlowLayout.CENTER);
    with
    Jp7.add(submitButton);
    I know FlowLayout's default location is CENTER. But when I explicitly say to center the button, it crashes during runtime but compiles fine.
    Whats the reason for this? Is this a bug?
    I am using 1.4.0_03.
    I getthe following error.
    Exception in thread "main" java.lang.IllegalArgumentException: illegal component
    position
    at java.awt.Container.addImpl(Container.java:568)
    at java.awt.Container.add(Container.java:327)
    at Mon2.main(Mon2.java:114)
    ALSO CAN I DO THE SAME WITHOUT USING SO MANY JPANELS?????????????????? I AM NOT NEW TO PROGRAMMING BUT I AM NEW TO GUI PROGRAMMING.
    Thanks in advance.
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Mon2 extends JFrame{
    static long i =0;
    static int jobid = 0;
    static String StartTime = "";
    static String LastReport = "";
    static String FinishTime = "";
    static String Description = "";
    static String job_position = "";
    static String desc ="";
    public static String database = "";
    public static String user = "";
    public static String password = "";
    static int counter = 1;
    static boolean valuesEntered = false;
      JButton jButton1 = new JButton();
      JButton jButton2 = new JButton();
      JButton jButton3 = new JButton();
      BorderLayout borderLayout1 = new BorderLayout();
      JLabel jLabel1 = new JLabel();
    JTextPane jTextArea1 = new JTextPane();
    static JTextField userArea = new JTextField();
    static JPasswordField passArea = new JPasswordField();
    static JTextField databaseArea = new JTextField();     
    static JFrame f = new JFrame();
    static JLabel us = new JLabel ("UserName: ");
    static JLabel pa = new JLabel ("Password: ");
    static JLabel da = new JLabel ("Database: ");
      BorderLayout borderLayout2 = new BorderLayout();
      JPanel jPanel1 = new JPanel();
      JLabel jLabel2 = new JLabel();
         public Mon2() {
        try  {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
         public static void main(String args[]) {
              System.out.println("Starting Mon2...");
        f.setSize(300,200);
        f.setTitle("Login");
        f.setLocation(250,250);
        f.setResizable(false);
        Panel Jp1 = new Panel (new BorderLayout());
        Panel Jp3 = new Panel (new BorderLayout());
        Jp3.add(us, BorderLayout.NORTH);
        Jp3.add(pa, BorderLayout.CENTER);
        Jp3.add(da, BorderLayout.SOUTH);
        userArea.setEditable(true);
        userArea.setSize(20,20);
        passArea.setEditable(true);
        databaseArea.setEditable(true);
        JButton submitButton = new JButton("Submit");
        JPanel Jp2 = new JPanel (new BorderLayout());
        JPanel Jp4 = new JPanel (new FlowLayout());
        userArea.setPreferredSize(new Dimension(200,21));
        Jp4.add(userArea, FlowLayout.LEFT);
        Jp4.add(us, FlowLayout.LEFT);
        JPanel Jp5 = new JPanel (new FlowLayout());
        passArea.setPreferredSize(new Dimension(200,21));
        Jp5.add(passArea,FlowLayout.LEFT);
        Jp5.add(pa, FlowLayout.LEFT);
        JPanel Jp6 = new JPanel (new FlowLayout());
        databaseArea.setPreferredSize(new Dimension(200,21));
        databaseArea.setText("DWPROD");
        Jp6.add(databaseArea,FlowLayout.LEFT);
        Jp6.add(da, FlowLayout.LEFT);
        Jp1.add(Jp4, BorderLayout.NORTH);
        Jp1.add(Jp5, BorderLayout.CENTER);
        Jp2.add(Jp6, BorderLayout.NORTH);
       JPanel Jp7 = new JPanel(new FlowLayout());
    ///////////////////////////This is  the line//////////////////
    //If you remove the ,FlowLayout.CENTER it works fine.
    //If you leave it like as it is, it will compile but then give runtime error
        Jp7.add(submitButton, FlowLayout.CENTER);
        Jp2.add(Jp7, BorderLayout.SOUTH);
        Jp1.add(Jp2, BorderLayout.SOUTH);
        f.getContentPane().add(Jp1);
        Image img = Toolkit.getDefaultToolkit().getImage("c:\\appletHeader.gif");
        f.setIconImage(img);
        f.setDefaultCloseOperation(3);
        f.setVisible(true);
        f.pack();
         submitButton.resize(75, 30);
        submitButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(ActionEvent e) {
        user = userArea.getText();
        password = passArea.getText();
        database = databaseArea.getText();
        if((user.equals(null) || password.equals(null) || database.equals(null) || user.equals("") || password.equals("") || database.equals(""))){
        valuesEntered = false;
        else{
             valuesEntered = true;
        if(valuesEntered == true){
        f.setVisible(false);
              Mon2 mainFrame = new Mon2();
              mainFrame.setSize(600, 400);
              mainFrame.setTitle("Monitor");
        mainFrame.setLocation(100,200);
        mainFrame.setResizable(false);
        desc = "ERROR! or there are no locked jobs.";
              mainFrame.setVisible(true);
        else{
        JOptionPane.showMessageDialog(null,"Must enter values for UserName, Password and Database", "Value Required",JOptionPane.INFORMATION_MESSAGE);
    //    System.exit(0);
      private void jbInit() throws Exception {
        this.setDefaultCloseOperation(3);
        jButton1.setText("Refresh");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
          jButton1_actionPerformed(e);
        jButton2.setText(" Exit ");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.exit(0);
        this.getContentPane().setLayout(borderLayout1);
        jButton3.setText("Clear");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            jTextArea1.setText("Click on Refresh to update screen.");
        Panel p = new Panel(new FlowLayout());
        Panel p2 = new Panel (new BorderLayout());
        jLabel1.setText("Monitor for current Job");
        jTextArea1.setPreferredSize(new Dimension(8, 50));
        jTextArea1.setContentType("text/html");
        jTextArea1.setText("");
        jTextArea1.setEditable(false);
        f.setResizable(false);
        f.setTitle("Login");
        jLabel2.setHorizontalTextPosition(SwingConstants.LEFT);
        jLabel2.setText("jLabel2");
        jLabel2.setHorizontalAlignment(SwingConstants.LEFT);
        f.getContentPane().setLayout(borderLayout2);
        jTextArea1.setSize(100,10);
        p.add(jButton1);
        p.add(jButton3);
        p.add(jButton2);
        this.getContentPane().add(jLabel1, BorderLayout.NORTH);
        this.getContentPane().add(jTextArea1, BorderLayout.CENTER);
        p2.add(p, BorderLayout.CENTER);
        this.getContentPane().add(p2, BorderLayout.SOUTH);
        pack();
        f.getContentPane().add(jPanel1, BorderLayout.CENTER);
        jPanel1.add(jLabel2, null);
      void jButton1_actionPerformed(ActionEvent e){
            jTextArea1.setText("Refreshing...");
            long i = 0;
         try{
              jTextArea1.setText("In side try block");
                    Thread.sleep(1000);
                   DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                   jTextArea1.setText("DriverManager");
                  Connection conn=
                   DriverManager.getConnection("jdbc:oracle:thin:@machine:1234:"+ database, user, password);
                                                                          jTextArea1.setText("Got COnnection");
                   Statement stmt = conn.createStatement();
                   jTextArea1.setText("Statement Created");
                   ResultSet rs =
                   stmt.executeQuery("select 1, sysdate, sysdate, sysdate, sysdate, sysdate from dual ");
                   jTextArea1.setText("Query Executed");
                   while(rs.next()){
          jobid = rs.getInt(1);
          StartTime = rs.getString(2);
          LastReport = rs.getString(3);
          FinishTime = rs.getString(4);
          Description = rs.getString(5);
          job_position = rs.getString(6);
          desc = "<b>Count: </b>" + counter + "" +
                     "<p><table border = '1'><tr><td><b>JOB ID:      </b></td><td>" + jobid + "</td></tr>" +
                 "<tr><td><b>Start Time:  </b></td><td>" + StartTime + "</td></tr>" +
                 "<tr><td><b>Last Report: </b></td><td>" + LastReport + "</td></tr>" +
                 "<tr><td><b>FinishTime:  </b></td><td>" + FinishTime + "</td></tr>" +
                 "<tr><td><b>Description: </b></td><td>" + Description + "</td></tr>" +
                 "<tr><td><b>Position:    </b></td><td>" + job_position + "</td></tr></table>";
                  counter = counter + 1;
                     rs.close();
                   conn.close();
                    jTextArea1.setText("Sleeping");
                    jTextArea1.setText(desc);
                    desc = "";
              catch (SQLException se){
              jTextArea1.setText(desc + se);
           catch(Exception ee){
                jTextArea1.setText("Exception occured\n\n" + ee);
    }

    Get your basics checked.
    Go to:
    http://developer.java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html#whatAreLMs
    And find the heading: FlowLayout Variations
    FlowLayout can be customized at construction time by passing the
    constructor an alignment setting:
    FlowLayout.CENTER (the default)
    FlowLayout.RIGHT
    FlowLayout.LEFT

  • Illegal component position when add JLabel to JtextPane

    Hi all,
    I want to add a JLabel to a JTextPane, the label shoud be put in the lines of text just like the normal text. I have some questions:
    1. How can I put the label in the position we want, when I use the method add(label, textPane.getStyledDocument().getLength()), it generates exception :"illegal component position"
    2. How can I set the width and the height of the label so that user cannot know that I used the label. I mean the text on label and the normal text on JTextPane must look the same. Of course I know the length of the caption of the label
    Thank you very much

    How can I put the label in the position we want, I'm not sure you can add a component using that method. I think there is an insertComponent(...) method to use. Also you may need to make the text pane uneditable first if I remember correctly. Something like:
    textPane.setEditable(false);
    textPane.insertComponent(...);
    textPane.setEditable(true);
    How can I put the label in the position we want, label.setFont(textPane.getFont());

  • Illegal component usage

    Hello,
    I created an SC, DC etc. on a fresh NWDI. Created the track on that SC, mde references and checked in SAP-JEE, SAP_BUILDT, SAP_JTECHS (7.00 SP7) (SDA I ttok from my Netweaver Server, had none on NWDI). And I created a new WebDynpro Project on that track with NWDS 7.00 SP 6 (may that be the cause of Problem?).
    The Problem is I get on my still empty project after syncing all SC Archives:
    Check for used DCs failed: Illegal component usage: compartment "MY_COMPONENT" does not use compartment "sap.com_SAP_BUILDT_1" of used DC "sap.com/tc/bi/bp/webDynpro"; using DC: myDC(MYComponent)
    Any clue what that shall tell me????
    I think in generell that procedure is much to complicated with going first to SLD for SC and Product, then to CMS to create a track, give references to SCs, you just have to know which you need. Then you have to check these SCs in and so on (I never understood that step at ALL why that is needed...). To much steps to make errors...
    Best regards,
    Frank

    Sorry in the whole dropdown I see nothing of this three SCs. I'm at the right place to add the three SCs, but I just don't FIND them, because naming ist totally different here.
    Documentation in the nice "do something but don't tell me how" style of SAP sais:
    <b>Create a product and software component in System Landscape Directory (SLD). Define the build dependencies required for J2EE development on the following software components:
    +    SAP_BUILDT
    +    SAP_JTECHS
    +    SAP-JEE
    </b>
    Okay found them finally Its
    + SAP J2EE ENGINE <Release> (SAP-JEE <Release>)
    + DI BUILD TOOL <Release> (SAP_BUILDT <Release>)
    + SAP JAVA TECHNOLOGY SERVICES <Release> (SAP_JTECHS <Release>)
    for all other who are searching for them. Found it at:
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/de/e1/2aa0753d12479cb6f21c38371299a7/content.htm">Creating a SC in the SLD</a>
    and guessed that SAP Build Tool is now the DI Build Tool...

  • Help needed to fix : 400 Illegal SSL Request error in Portal

    Hi All,
    We are working on SAP CRM 2007. We have brought some transaction on to WEB UI using transaction launcher. These transactions are working as expected in Web UI.
    We have moved this to Portal as per clients req, but when we launch these transactions from Portal,
    we are getting an error saying "400 Illegal SSL Request, Error - 19, Component ICM, etc."
    Sometimes, we are encountering time out error.
    And the Back, Exit, Execute buttons are appearing twice in the Portal.Any pointers on how to resolve this.
    Thanks,
    Udaya
    Edited by: Udaya Bhaskar Perecharla on Aug 29, 2008 12:12 PM

    Hi,
    although I guess you have already solved the problem by yourself, I just wanted to post a possible reason here because we were facing the same problem.
    The error occured after moving from HTTP to HTTPS and the details of the webservice reference were not correct.
    We checked the reference and finally just had to add an 'S' to the URL:
    <add key="SRV_VIEWOPEN.wsdl11" value=httpS://servername:port/sap/bc/soap/rfc/>
    Maybe that helps.
    Regards Daniel

  • Illegal component usage: compartment

    Hi experts,
    We have a Track on NWDI for CAF and WebDynpro development that depends on 12 SAP SCs, those are: CAF, CAF-MF, COMP_BUILDT, ENGFACADE, ENGINEAPI, ESCONF_BUILDT, ESF, FRAMEWORK, MMR_SERVER, MOIN_BUILDT, SAP_BUILDT, WD-RUNTIME. Our CAF DC /caf/ejbmodule is not compiling with build error message:
    ERROR: Check for used DCs failed: Illegal component usage: compartment "mycompany.com_COMPONENTSERVICES_1" does not use compartment "sap.com_COMP_BUILDT_1" of used DC "sap.com/bie/sca/scdl/contributors/ejb"; using DC: com.sap.tc.devconf.internal.DCProxyMake@152d5de
       Build failed with errors.
    At CBS, the COMP_BUILDT is not compiling as well, even after the reimport of the DCs on CMS Transport Studio. On CBS Details of build are "USAGE IS FORBIDDEN BY SOFTWARE COMPONENT".
    Searchig on SDN I´ve found this Wiki (NWDI)(CMS)Problems-P0007 that leads to SAP Note 669669. After the update of SLD CIM to model version 1.6.16 and CR Content SAP_CR 7.0 we made "Update CMS" and also reimported the SAP DCs on that track, but the error didn´t disappear.
    What am I doing wrong?

    Did you manage to solve the problem?

  • Invalid Cursor Position Error

    Help!
    I am using JRun3.1 and developing a web interface to a database. In this particular screen, I am using CachedRowSet (I downloaded this and added it to jrun classpath). I am getting "Invalid cursor position" error.
    I feel there is a problem with the usebean tag.
    This is my code:
    what is wrong with this?
    <%@ page language = "java" import="java.sql.*, java.util.*, javax.sql.*, sun.jdbc.rowset.*" %>
    <%
    String indSub = request.getParameter("indSub");
    String areaname = request.getParameter("selarea");
    %>
    <jsp:useBean id="crs" class="CachedRowSet" scope="session" >
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    crs.setUrl("jdbc:odbc:asphData");
    crs.setCommand("SELECT siccode, sicdesc from siccode where sictitle = '" + indSub + "'");
    crs.execute();
    %>
    </jsp:useBean>
    <%@ include file="header2.htm" %>
    <link rel="stylesheet" href="http://localhost:8100/empData/almis.css" type="text/css">
    <br>
    <br>
    <table align="center">
    <tr><td class="moduleDesign" align="center">Employers Database</td></tr>
    </table>
    <br><br>
    <font size="+2" face="verdana sans-serif">
    <form action="employerDetail.jsp" method="post">
    <p><center><font color="Blue">Employers in the �<%= indSub %>� Industry
    <br>
    SIC Code:�<%= crs.getString("siccode") %>
    <br>State: Utah<br>
    Region: �<%=areaname %><br>
    </font></center></p>
    <p>
    <b>Description:</b>�<%= crs.getString("sicdesc") %>
    </p>
    </form>
    <jsp:include page="footer2.htm" />
    </body>
    </html>
    srajaman2

    Never mind!
    I have to issue a next() command to get to the first line of the resultset!
    srajaman2

  • Invalid Cursor Position Error on Windows XP using CachedRowSet

    Hello, I don't know if this question lies here, but I thought it would be the well suited place so please pardon me if it isn't. I am trying to access multiple pages from my database on my XP machine but I am getting an "invalid cursor position" error when trying to access the next page. I don't know how this error is coming about because it works well on a Vista machine with no errors. I don't know if it is my drivers or something that brings about the problem. I am using mysql connecter 5.1.10, JRE 1.6.0_02 and windows XP SP2
    Below is a simple code that brings the error.
    package Admin; import javax.sql.rowset.CachedRowSet; import com.sun.rowset.CachedRowSetImpl; public class test { public void table() { try { CachedRowSet crs=new CachedRowSetImpl(); crs.setUrl("jdbc:mysql://host:3306/database");         crs.setUsername("User");         crs.setPassword("password"); crs.setCommand("select * from myTable"); int[] keys = {1}; crs.setKeyColumns(keys); crs.execute(); crs.last(); if(crs.getRow()>500){ //new overLimit(); } crs.setPageSize(3); crs.execute(); while (crs.next()) { System.out.print("page one----"); System.out.println(crs.getString(1)); } while(crs.nextPage()){ System.out.println("page two---"); while (crs.next()) { System.out.println("in page two"); System.out.println(crs.getString(1)); } } } catch (Exception e) { e.printStackTrace(); } } public static void main(String []args){ new test().table(); } }

    Yes I am running the same code on both machines. The output I get on the XP machine is shown below. I modified the code I posted earlier and replaced the "page two" text with "page (then page number)" and also omitted the "in page two" text for better readability---------PAGE 0---------
    DB09140110
    DU35463010
    EX29201810
    ---------PAGE 1---------
    EX38341510
    EX40471810
    KZ280299
    ----------PAGE 2---------
    LA130299
    LC130299
    MC081009
    ----------PAGE 3---------
    RZ300502
    VA130299
    VI020209
    ----------PAGE 4---------
    YX101008
    ZE220299
    ZF231105and vista....
    ----------PAGE 0---------
    EX38341510
    EX40471810
    KZ280299
    ----------PAGE 1---------
    LA130299
    LC130299
    MC081009
    ----------PAGE 2---------
    RZ300502
    VA130299
    VI020209
    ----------PAGE 3---------
    YX101008
    ZE220299
    ZF231105

  • How to resolve illegal cross join error

    Can someone please tell me how can we avoid illegal cross join error in modeling? If someone has any reference document , please share it.
    I have 5 tables - Dim (A, B , C,E) and Fact( D). C is lookup table which is used to resolve the lookup code column in table E.
    The relationships between these are
    A--< B--< E >--C
    & A--<D
    My requirement is i have to expose Attributes of A,B ,C & E within Dimension.
    These attributes (from B,C,E) will be treated as property of A.
    Someone may query these attributes without selecting any column from fact table.
    Thanks & Regards,
    Ashish

    Hi Ashish,
    it's not the first time you come up with this kind of question and I'm wondering if you understand the principle of granularity when I read your questions.
    On physical level, a fact table must always join with the lowest level of detail of your dimension table. Let me explain, by giving an example which looks like your situation.
    Assume I have three tables:
    Table "E" contains products, which has attributes like: product_id and product_name
    Table "B" contains order line items, which has attributes like: order_line_item_id, order_id and product_id.
    Table "A" contains orders, which has attributes like: order_id and customer_name.
    Table "D" contains facts ("metrical data") about my order: which has attributes like: order_id, order_revenue.
    This will be the diagram on physical level: E--<B--<A--<D
    Here are my joins: E.product_id on B.produc_id, B.order_id on A.order_id, A.order_id--<D.order_id
    Now, my question to you is: will I be able to get the revenue of a certain product?
    The answer is: No, because I don't know what part of my order is spent on a certain product. The problem is thus that the data in the fact table isn't stored on that level of detail, or in other words the fact and dimension table don't share the same level of granularity.
    How it should be:
    If you want to get the revenue per product, you will need to have a second fact table "G", which has data which is stored on order line item level. This table contains the following attributes: order_line_item_id, product_id and order_line_item_revenue.
    This will become your diagram on physical level:
    B--<G>--E
    Joins: B.order_line_item_id on G.order_line_item_id and E.product_id on G.product_id
    Table E has become a dimension of fact table G.
    The first physical diagram should look like this:
    A--<D
    If you want you can model both physical diagrams into one logical diagram, assuming that A and D (order dimension and fact table) are aggregates of B and G (order line items dimension and fact table). In that case you should read this blog item: http://obiee101.blogspot.com/2008/11/obiee-making-it-aggregate-aware.html
    Regards,
    Stijn

  • Position error

    I am having encoder position issues.
    I am using 3 Kollmorgen servos attached to 3 AKD Ethercat drives. I have a cRio running as the Ecat master. All of my Vis are running in scan mode on the cRio.
     I am building a capstan pulling system that will have a constantly changing velocity based upon position within a 3 meter repeating cycle. I change the velocity based upon sensor input every mm of the cycle and then start the 3 meter cycle over. The velocity various from 1 RVS to 10RVS.  I use the encoder position to determine my position within a cycle. The system runs great for around 5 minutes and then my encoder goes crazy. Even when I stop the servo the encoder continues to increase. In the help for the “Reset Position” command I noticed that encoder values higher than 2^52 can be unstable. Does this apply to user units or RAW encoder pulses?
      I have tried the following methods to try and fix the problem.
    Test and verified that the issue occurs in the Axis test panel.
    I just set a long move at a given speed. After a time the position error goes crazy as in 4.0 e +12 and the position continues to increase after the servo stops.
    I removed my units and used just encoder pulses and again after a few minutes the same thing occurred.
    Changed my VI so that after each 3 meter cycle the encoder was reset to zero. Again after roughly the same amount of time the issue occurred.
    One strange thing is that I can still control the servo accurately. If I tell it to go 100mm it goes 100mm, but once there I cannot read the position because it returns a very large and inaccurate number.
    A further observation is that I can recover by resetting the cRio. This makes me think that the encoder number is exceeding some register U32 or U64. If that were the case I would have thought that resetting it after each cycle would have fixed it. Unless when you reset the position you are just setting an offset that is subtracted for the actual encoder from that point forward.
     I am sure that I have confused you all but any and all help is greatly appreciated.
    Perpetual LabView noob…..
    Jeff Lee

    Hi Jeff,
    I have a few questions for you to help me get a better understanding of the issue:
    - What version of LabVIEW software is your application written in (2010? 2011 SP1?, 2012? etc)?
    - Have you tried swapping your motor with a different one?  Or your Drive?  Did you still observe the same behavior?  If possible, I think this would be a useful test to help narrow down the issue.
    - What does your motion system look like at a high level (What components are involved and how are they connected to eachother)?  Does the encoder feedback connect back to the drive or back to your cRIO controller?  
    Andrew T.
    National Instruments

  • Illegal character \92 error.Tried everything

    Hi, Im trying to make a calculator program and in the line where I divide a by b, im getting an Illegal Character:\92 error for some reason. To type \ im using \\ as an escape character, and it seems to work earlier in the program with no problem.
    Heres the code:
    import java.io.*;
    public class PA83 //Simple calc
        public void calculator()
            try
                InputStreamReader isr = new InputStreamReader(System.in);
                BufferedReader br = new BufferedReader(isr);
                System.out.println("Enter number 1");
                double a = ((double) br.readLine());
                System.out.println("Enter number 2");
                double b = ((double) br.readLine());
                System.out.println("1.Add\n2.Subtract a-b\n3.Subtract b-a\n4.Multiply\n5.Divide a\\b\n6.Divide b\\a\n7.Quit");
                int c = Integer.parseInt(br.readLine());
                switch(c)
                    case 1:System.out.println(a+"+"+b+" = "+(a+b));
                    break;
                    case 2:System.out.println(a+"-"+b+" = "+(a-b));
                    break;
                    case 3:System.out.println(b+"-"+a+" = "+(b-a));
                    break;
                    case 4:System.out.println(a+"x"+b+" = "+(a*b));
                    break;
                    case 5:System.out.println(a+"\\"+b+" = "+(a\b));
                    break;
                    case 6:System.out.println(b+"\\"+a+" = "+(b\a));
                    break;
                    case 7:break;
                    case default:System.out.println("Invalid Option. Please select a number from 1-6");
                    break;
            catch(Exception e)
                System.out.println("Error: "+e.getMessage());
    }              It highlights case 5 and gives me an illegal character:\92 error, but ive used the double slashes(\\) earlier in the println to choose an option without any problem there.
    I dont understand why this is happening! Even if i remove the "\\" i get the same error , and as BlueJ suggested, i tried typing the line again to avoid some invisible character causing problems..

    Hi,
    I think we use "/" for division and not "\" .
    thanks & regards,
    Manoj

  • "Column Width should be positive" error

    I have a flash chart that has a fairly simple query (whic works fine when run via SQLPLUS etc), that when I run via Apex I get "Column Width should be positive" errors. What does this mean, and how do I debug it?

    I realise that I have to have a chart query to generate the chart. The query (see below) runs perfectly fine in SQLPLUS, TOAD, SQL Developer etc, with no negative values returned.
    select null, to_char(targcompdate , 'RRRR-IW'), count(*)
    from work_tab
    where worktype = 'RO'
    and integ_priority in ('2','3','4')
    and comp_person = 'Structural'
    and targcompdate >= sysdate
    and status = 'APPR'
    group by to_char(targcompdate , 'RRRR-IW')
    order by to_char(targcompdate , 'RRRR-IW')

  • Pojo/List/ManagedBean/ADF RF component yeilds error "Target Unreachable", J

    Hello JDevelopers;
    (Pojo/List/ManagedBean/ADF RF component yields error "Target Unreachable", JSF component does not.)
    I am attempting to convert a page with jsf/html components to a page with ADF RF components.
    I am using a pojo that returns a List.
    The pojo is registered as a ManagedBean in adfc-config file.
    I am not using a data control.
    It all works fine with jsf/html components.
    The following <h:inputText> works fine when using jsf/html component.
         <h:inputText value="#{taskRnDController.task.taskNum}" required="true" </h:inputText>
    Changing it to an <af:inputText component and running the app produces the error listed below;
         <af:inputText value="#{taskRnDController.task.taskNum}" id="it1" label="Label 1" required="true"/>
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.el.PropertyNotFoundException: Target Unreachable, 'task' returned null
         at com.sun.el.parser.AstValue.getTarget(Unknown Source)
         at com.sun.el.parser.AstValue.isReadOnly(Unknown Source)
         at com.sun.el.ValueExpressionImpl.isReadOnly(Unknown Source)
    this is the adfc-config file
    <managed-bean id="__3">
    <managed-bean-name id="__2">taskRnDController</managed-bean-name>
    <managed-bean-class id="__1">com.myorg.facade.TaskRnDController<;/managed-bean-class>
    <managed-bean-scope id="__4">session</managed-bean-scope>
    </managed-bean>
    I need an <af:form> and an <af:table> components on the same page so that when a user
    inserts a new record on the form and presses save btn it is immediately displayed
    within the <af:table>.
    I am stuck and any help is much appreciated.
    Edited by: 848693 on Jun 15, 2011 4:28 PM

    you just want to bind your input text to backing bean .then why you are using list ?
    It is very simple just use any variable and bind with your UI component
    Thanks
    Prateek

  • Weblogic crash after "Illegal memory access" error

    hi all. Weblogic application crashed after receiving an illegal memory access error. any thoughts....
    Error Message: Illegal memory access. [54]
    Signal info : si_signo=11, si_code=2 si_addr=0xb5778850
    Version : BEA JRockit(R) R27.4.0-90_CR358515-94243-1.5.0_12-20080118-1154-l
    inux-ia32
    The Weblogic Admin Console will not start since the Jrockit crash. I've attached the log from the failed startup.
    <Jan 8, 2009 11:13:22 AM MDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.la
    ng.ClassFormatError: com/bea/xbean/store/Xobj$DocumentXobj : invalid LineNumberTable pc at 27684
    java.lang.ClassFormatError: com/bea/xbean/store/Xobj$DocumentXobj : invalid LineNumberTable pc at 27684
    log from weblogic admin stdout:
    Java home=/ps_opt/wl92/jrockit_150_12
    Java command line=java -jrockit -Xms256m -Xmx256m -Dweblogic.Chunksize=65536 -Djava.util.logging.config.file=/ps_opt/wl92/webserv/myserver/applications/peoplesoft/logging.properties -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Dweblogic.Name=WebLogicAdmin -Dps_vault=/ps_opt/wl92/webserv/myserver/psvault -Djavax.net.ssl.trustStore=/ps_opt/wl92/webserv/myserver/keystore/pskey -Dweblogic.ProductionModeEnabled=true -Djava.security.policy=/ps_opt/wl92/weblogic92/server/lib/weblogic.policy -Dssl.debug=false -Dps_home=/ps_opt/wl92 weblogic.Server
    Java options=-jrockit -Xms256m -Xmx256m -Dweblogic.Chunksize=65536
    <Jan 8, 2009 11:13:20 AM MDT> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
    /ps_opt/wl92/weblogic92/platform/lib/p13n/p13n-schemas.jar:/ps_opt/wl92/weblogic92/platform/lib/p13n/p13n_common.jar:/ps_opt/wl92/weblogic92/platform/lib/p13n/p13n_system.jar:/ps_opt/wl92/weblogic92/platform/lib/wlp/netuix_common.jar:/ps_opt/wl92/weblogic92/platform/lib/wlp/netuix_schemas.jar:/ps_opt/wl92/weblogic92/platform/lib/wlp/netuix_system.jar:/ps_opt/wl92/weblogic92/platform/lib/wlp/wsrp-common.jar:/ps_opt/wl92/webserv/myserver/lib/endorsed/xalan.jar:/ps_opt/wl92/webserv/myserver/lib/pluto-1.0.1.jar:/ps_opt/wl92/webserv/myserver/lib/portlet-api-1.0.jar:/ps_opt/wl92/webserv/myserver/lib/ps_patch.jar>
    <Jan 8, 2009 11:13:21 AM MDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with BEA JRockit(R) Version R27.4.0-90_CR358515-94243-1.5.0_12-20080118-1154-linux-ia32 from BEA Systems, Inc.>
    <Jan 8, 2009 11:13:22 AM MDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.ClassFormatError:
    com/bea/xbean/store/Xobj$DocumentXobj : invalid LineNumberTable pc at 27684
    java.lang.ClassFormatError: com/bea/xbean/store/Xobj$DocumentXobj : invalid LineNumberTable pc at 27684
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at com.bea.xbean.store.Cur$Locations.<clinit>(Cur.java:482)
         at com.bea.xbean.store.Locale.<init>(Locale.java:168)
         at com.bea.xbean.store.Locale.getLocale(Locale.java:235)
    >
    <Jan 8, 2009 11:13:22 AM MDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
    <Jan 8, 2009 11:13:22 AM MDT> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
    <Jan 8, 2009 11:13:22 AM MDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>

    Hi Nicolas.
    What Weblogic 9.2 patch is it ?92MP3 no patches
    What Peopletools version is it ?849.09
    What OS ?Linux 2.6.9-67.0.20.ELsmp
    Is it crashed on the startup ? yes it fails when we try to startup the admin server
    let me know thanks

  • Illegal dependency ACL error: DBpool DC

    Hi all,
    in my NW 7.00 SP17, I have my track and SC with correct dependencies from JEE, JTECHS, BUILDT.
    Everything builds fine. Now I need to use the public part from standard DC dbpool.
    I get Illegal dependency: ACL error.
    How am I supposed to use it?
    Thanks in advance
    regards
    Vincenzo

    The dependencies are defined both in CMS and in SLD.
    The dependency is from our DC it.sap.XXXX towards the sap.com DC dbpool.
    Moreover we have found out that actually the dbpool ACL prevents components other than sap.com/* ones to reference it.
    How should we work around? Using entity references and a sap.com DC as a wrapper?
    Thanks
    regards
    Vincenzo

Maybe you are looking for

  • Purchase order in PDF Form

    Hi Gurus, What is the procedure to get purchase order print out in the form of PDF Regards Vivek

  • Re: HDMI Resolution Chopping Border on my TV.

    Hello, Just bought a new Mac Mini. I hooked it up to the mini-dvi to dvi cable. I then connected that dvi-to-hdmi and hooked it up to my 42" LG TV. I started configuring it for HDMI resolution. It chops the border of the screen off. I called Apple an

  • Can't get my contacts from SIM card?

    I have taken my SIM card out of a really old  Samsung and cut it down, put it in my iPhone 4s it works but have no contacts....? How do I get them?

  • Issue with XSL transformation in Java Stored Procedure

    Hi, Am having issue applying XSL transformation in Java Stored procedure. I have loaded the java class as well as .XSL files through loadjava uility and their status in DB is VALID. Below is the code in the java stored procedure: public static String

  • Please help me with PL/SQL problem

    Hi to all This is my problem. I have a database with several tables. I will mention just some important for this problem. I have a table called Invoice, where I have following atributes sifrac number(9) not null primary key, datrac date default sysda