4 Replies Latest reply on Jan 21, 2005 11:23 AM by David Bloomfield

    JBoss 4.0.0 Bank example compile error

    heman Newbie

      Hi, I've followed the Getting Started with JBoss 4.0 guide step by step, but when I try to compile using ant -f jboss-build.xml compile on Linux Fedora Core 2, I get this output:

      Buildfile: jboss-build.xml

      prepare:

      compile:
      [javac] Compiling 58 source files to /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/build
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java: In class `com.sun.ebank.appclient.BankAdmin':
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java: In method `com.sun.ebank.appclient.BankAdmin.addCustToActFields(java.lang.String,java.lang.String)':
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:351: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] customer = new JTextField(custID);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:357: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] account = new JTextField(actID);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java: In method `com.sun.ebank.appclient.BankAdmin.createCustFields(boolean,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)':
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:377: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] fname = new JTextField(first);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:378: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] lname = new JTextField(last);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:379: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] mi = new JTextField(mid);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:380: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] street = new JTextField(str);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:381: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] city = new JTextField(cty);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:382: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] state = new JTextField(st);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:383: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] zip = new JTextField(zp);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:384: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] phone = new JTextField(tel);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:385: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] e = new JTextField(mail);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:388: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] fname.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:389: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] lname.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:390: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] mi.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:391: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] street.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:392: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] city.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:393: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] state.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:394: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] zip.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:395: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] phone.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:396: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] e.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java: In method `com.sun.ebank.appclient.BankAdmin.createActFields(boolean,java.lang.String,java.math.BigDecimal,java.math.BigDecimal,java.math.BigDecimal,java.util.ArrayList,java.util.Date)':
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:492: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.cust = new JTextField(custIDs);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:497: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.descrip = new JTextField(this.desc);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:498: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.type = new JTextField(type);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:503: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.time = new JTextField(viewtime);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:507: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.bal = new JTextField(balstring);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:510: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.credit = new JTextField(creditstring);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:513: error: Can't find constructor `javax.swing.JTextField(Ljava/lang/String;)' in type `javax.swing.JTextField'.
      [javac] this.begbal = new JTextField(begbalstring);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:524: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] this.bal.setEditable(false);
      [javac] ^
      [javac] /home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/src/com/sun/ebank/appclient/BankAdmin.java:525: error: Can't find method `setEditable(Z)' in type `javax.swing.JTextField'.
      [javac] this.time.setEditable(false);
      [javac] ^
      [javac] 29 errors

      BUILD FAILED
      file:/home/pzw/source/java/j2ee/j2eetutorial14/examples/bank/jboss-build.xml:54: Compile failed; see the compiler error output for details.

      Total time: 2 seconds

      Does anyone know how to fix this problem?

      Best regards,
      Peter

        • 1. Re: JBoss 4.0.0 Bank example compile error
          Norman Richards Master

          I can't explain that one. javap javax.swing.JTextField It looks like it is missing methods on JDK classes.

          Try running javap to see what you have. Does it look like you have the right constructor?

          [orb@toki tmp]$ javap javax.swing.JTextField
          
          Compiled from "JTextField.java"
          public class javax.swing.JTextField extends javax.swing.text.JTextComponent implements javax.swing.SwingConstants{
           public static final java.lang.String notifyAction;
           static java.lang.Class class$java$awt$event$ActionListener;
           public javax.swing.JTextField();
           public javax.swing.JTextField(java.lang.String);
           public javax.swing.JTextField(int);
           public javax.swing.JTextField(java.lang.String,int);
           public javax.swing.JTextField(javax.swing.text.Document,java.lang.String,int);
          ...
          


          • 2. Re: JBoss 4.0.0 Bank example compile error
            exitsfunnel Newbie

            I'm also hitting this error. Google yields a few similar cases but there don't seem to be any solutions posted. It does seem to always occur on Linux. I guess it's either a Linux, JDK, or Ant. I'm going to try to upgrade ANT and my JDK and see if that helps. From which jar file do you expect JTextField to be loaded? It seems it's not in any of the jars jboss installs so I guess it should be coming out of rt.jar. Anyone have any thoughts on this issue?

            -exits

            • 3. Re: JBoss 4.0.0 Bank example compile error
              Norman Richards Master

              Dumb question. Are you using the sun JVM? What version? ("java -version")

              • 4. Re: JBoss 4.0.0 Bank example compile error
                David Bloomfield Newbie

                For what it's worth, I was getting the same problem, on Red Hat Enterprise Linux 3, but fixed it by uninstalling the bundled Ant (1.5.2) and installing version 1.6.2 from ant.apache.org.

                I'm using JBoss 4.0.1 with the Sun 1.4.2_06 SDK.