Need help with "class file contains wrong class"

I have a dbUtil package as
package dbUtil;
public class dbConfig {
public String getHost(String db) {
This file called dbConfig.java has been compiled with -d option and rthe class files resides in dir <install_dir>/webapps/test/WEB-INF/classes/eb/dbUtil/
I have a jsp file in <install_dir>/webapps/test/test.jsp which imports the dbUtil package
<%@ page import="eb.dbUtil.dbConfig" %>
and I am getting this error:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
[javac] Compiling 1 source file
/opt/hpws/tomcat/work/Standalone/localhost/test/test_jsp.java:12: cannot access eb.dbUtil.dbConfig
bad class file: /opt/hpws/tomcat/webapps/test/WEB-INF/classes/eb/dbUtil/dbConfig.class
class file contains wrong class: dbUtil.dbConfig
Please remove or make sure it appears in the correct subdirectory of the classpath.
import eb.dbUtil.dbConfig;
^
1 error
Can anyone tell me what am I doing wrong? I am using tomcat 4.1
Thanks!
L.

Given your java file, the fully qualified name of the class is dbUtil.dbConfig.
What you are importing is eb.dbUtil.dbConfig
These things are not the same.
The root of the classpath for the webapp is the classes directory.
So either
1 - specify dbConfig.java to be in package eb.dbUtil
2 - move the class file into web-inf/classes/dbUtil/dbConfig.class, and import dbUtil.dbConfig.
Also, by convention, classnames should start with a capital letter ie dbUtil.DbConfig.
Cheers,
evnafets

Similar Messages

  • Need help with classes

    I''ve just started out with Java and I need help with my latest program.
    The program looks someting like this:
    public class MultiServer {
       public static void main(Straing[] args) {
          ServerGUI GUI = new ServerGUI();
    public class ServerGUI extends JFrame implements ActionListener {
       private TextArea textArea;
       public ServerGUI() {
          //setting up the JFrame and stuff like that
       public void actionPerformed(ActionEvent event) {
          if(button == addButton) {
             addGUI add = new addGUI();
    public class addGUI extends JFrame implements ActionListener {
        private TextField t1 = new TextField(25);
        public addGUI() {
          //setting up the JFrame and stuff like that
       public void actionPerformed(ActionEvent event) {
          if(button == printButton) {
             textArea.append("THIS DOES NOT WORK!");
    }   The problem is as follows: I want to be able to write text in the textArea in class ServerGUI from the class addGUI, but I can't. I hope you understand what I mean.
    How is this fixed? Please help me!

    public void actionPerformed(ActionEvent event) {
          if(button == addButton) {
             addGUI add = new addGUI(textArea);
    public class addGUI extends JFrame implements ActionListener {
        private TextArea textArea;
        public addGUI(TextArea textArea) {
            this.textArea = textArea;
        }/Kaj

  • Need help with connecting file inputs to arrays

    In this assignment I have a program that will do the following: display a list of names inputed by the user in reverse order, display any names that begin with M or m, and display any names with 5 or more letters. This is all done with arrays.
    That was the fun part. The next part requires me to take the names from a Notepad file, them through the arrays and then output them to a second Notepad file.
    Here is the original program: (view in full screen so that the code doesn't get jumbled)
    import java.io.*;       //Imports the Java library
    class progB                    //Defines class
        public static void main (String[] arguments) throws IOException
            BufferedReader keyboard;                                  //<-
            InputStreamReader reader;                                 //  Allows the program to
            reader = new InputStreamReader (System.in);               //  read the the keyboard
            keyboard = new BufferedReader (reader);                  //<-
            String name;                 //Assigns the name variable which will be parsed into...
            int newnames;               //...the integer variable for the amount of names.
            int order = 0;              //The integer variable that will be used to set the array size
            String[] array;             //Dynamic array (empty)
            System.out.println (" How many names do you want to input?");   //This will get the number that will later define the array
            name = keyboard.readLine ();
            newnames = Integer.parseInt (name);                                         // Converts the String into the Integer variable
            array = new String [newnames];                                               //This defines the size of the array
            DataInput Imp = new DataInputStream (System.in);       //Allows data to be input into the array
            String temp;                                       
            int length;                                                                  //Defines the length of the array for a loop later on
                for (order = 0 ; order < newnames ; order++)                                //<-
                {                                                                           //  Takes the inputed names and
                    System.out.println (" Please input name ");                            //  gives them a number according to
                    temp = keyboard.readLine ();                                           //  the order they were inputed in
                    array [order] = temp;                                                  //<-
                for (order = newnames - 1 ; order >= 0 ; order--)                                //<-
                {                                                                                //  Outputs the names in the reverse 
                    System.out.print (" \n ");                                                   //  order that they were inputed
                    System.out.println (" Name " + order + " is " + array [order]);             //<-
                for (order = 0 ; order < newnames ; order++)                                  //<-
                    if (array [order].startsWith ("M") || array [order].startsWith ("m"))     //  Finds and outputs any and all
                    {                                                                         //  names that begin with M or m
                        System.out.print (" \n ");                                            //
                        System.out.println (array [order] + (" starts with M or m"));         //
                    }                                                                         //<-
                for (order = 0 ; order < newnames ; order++)                                            //<-
                    length = array [order].length ();                                                   //
                    if (length >= 5)                                                                    //  Finds and outputs names
                    {                                                                                  //  with 5 or more letters
                        System.out.print (" \n ");                                                      //
                        System.out.println ("Name " + array [order] + " have 5 or more letters ");      //<-
    }The notepad file contains the following names:
    jim
    laruie
    tim
    timothy
    manny
    joseph
    matty
    amanda
    I have tried various methods but the one thing that really gets me is the fact that i can't find a way to connect the names to the arrays. Opening the file with FileInputStream is easy enough but using the names and then outputing them is quite hard. (unless i'm thinking too hard and there really is a simple method)

    By "connect", do you just mean you want to put the names into an array?
    array[0] = "jim"
    array[1] = "laruie"
    and so on?
    That shouldn't be difficult at all, provided you know how to open a file for reading, and how to read a line of text from it. You can just read the line of text, put it in the array position you want, until the file is exhausted. Then open a file for writing, loop through the array, and write a line.
    What part of all that do you need help with?

  • Need Help with .nnlp File.............A.S.A.P.

    I'm having a problem also with my JNLP file. I have downloaded the program onto one computer and that computer is using j2re1.4.2_04
    The other computers I believe are all running j2re 1.4.2_05
    I'm not sure if that's make a difference, but on the computer with j2re 1.4.2_05 when going to the site where the .jnlp file is located, the application comes up and says Starting Application. After it gets to that screen it just stays there. I really need help with this as soon as possible.
    Here is my .jnlp file listed below:
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp
      spec="1.0+"
      codebase="http://www.appliedsolutions.com/placewiz"
      href="Placewiz.jnlp">
      <information>
        <title>Placement Wizard 4.0</title>
        <vendor>Applied Solutions, Inc.</vendor>
        <homepage href="index.html"/>
        <description>Placement Wizard 4.0</description>
        <description kind="short">Short description goes here.</description>
        <offline-allowed/>
      </information>
      <resources>
        <j2se version="1.4+"/>
        <j2se version="1.3+"/>
         <j2se version="1.5+"/>
        <jar href="Placewiz.jar"/>
      </resources>
      <security>
          <all-permissions/>
      </security>
      <application-desc main-class="com/asisoftware/placewiz/loader/Exec">
    </jnlp>

    This was due to a change in 1.4.2_05
    the main class attribute
    main-class="com/asisoftware/placewiz/loader/Exec">is wrong - it should be:
    main-class="com.asisoftware.placewiz.loader.Exec">this didnt seem to mater before 1.4.2_05, but some change in java since then caused this bad class specification to stop loading.
    /Andy

  • Need help with class design

    I want to design and use one or more classes for a particular project I am working on.
    I need some advice hopefully from someone who has experience in this area. Basically,
    for this particular problem I have two database tables. I want the first class to
    represent the first database table and the second class to represent the second
    database table. An object of the first class will be created first, and then if certain
    criteria are met then an object of the second class will be created.
    Question:
    Should I use classical inheritance and let the first class inherit from the second class?
    Or should I use the containment delegation model and embed an object of the second
    class in the first class?
    ----Tables------
    For example, my first table ET_UserData looks something like this:
    ET_UserData
    (PK)UserName
    Password
    FirstName
    LastName
    My second table ET_DetailedUserData looks like this
    ET_DetailedUserData
    (FK)UserName
    WorkAddress
    WorkPhoneNumber
    CityWhereEmployed
    SocialSecurityNumber
    City
    State
    StreetAdress
    PrimaryTelephoneNumber
    AlternatePhoneNumber
    HasRegistered
    RegistrationDate
    RegistrationTime
    CreditCardNumber
    NameOfPrimaryContact
    DateOfBirth
    Weight
    EyeColor
    Height
    Member
    Here is are some pseudo classes for the two classes.
    Class UserData
    string UserName
    string FirstName
    string LastName
    Class DetailedUserData /* For a classical approach, sub class off of class UserData */
    /* UserData ThisUser --> Containment delegation model */
    string (FK)UserName
    string WorkAddress
    string WorkPhoneNumber
    string CityWhereEmployed
    string SocialSecurityNumber
    string City
    string State
    string StreetAdress
    Int PrimaryTelephoneNumber
    Int AlternatePhoneNumber
    Bool HasRegistered
    Int RegistrationDate
    Int RegistrationTime
    Int CreditCardNumber
    String NameOfPrimaryContact
    Int DateOfBirth
    Int Weight
    Int EyeColor
    Int Height
    bool Member
    }

    Thank you for your help. If you can continue to help me I would appreciate it.
    I and another developer did the database design. Pretty solid design. Plus we have all of the requirements
    which are very good too.
    Originally I wanted just one table to contain all of the data associated with a user. Instead of ET_UserData and ET_Detailed user data I wanted just one table. But I decided to break this table up into the two tables for the following reason.
    1.) This is a web application where each user logs into a web form. At a minimum, in order to use the website the session associated with each user needs the UserName, Password, First and last name.
    This is the data in the first table.
    If they choose to do more specialized functions on this website, then they will need all of the information (Attributes) that are located in the second table. In general 40% of the time all users will need information located in the second table.
    My reasoning for breaking the table into two seperate tables is that I wanted to minimize the amount of data involved in a result set, created from the sql query. The math tells me that 60% of the time most of the data in the result set will not be used.
    2.) If I create one class to represent all of the data/attributes in both tables, then my reasoning is that their will be alot of overhead in the single class because 60% of the time, a majority of the attributes are not needed and used.
    I would deeply appreciate your help with this. You seem to have great insight and advice. Please help me as I increase the duke dollars Sir.

  • Where to start? Need help with classes

    My question involves those classes he wants us to make. I don't really get the concept of classes, so could someone tell me what they think he wants us to do? And try to explain it to me in terms I might be able to understand. Does that mean for us to use subclasses or use separate files for each class? Or could I do either? I'm so confused :(
    Assignment: Write a program that consists of the classes listed below.
    Player Class: The Player Class consists of at least two elements -- the player name and a list of scores for
    games. The score attribute is not used in Program #3 but will be needed in Program #4. Include in the
    class appropriate accessor and mutator methods for each element in the class. You may have other
    attributes if needed.
    Team Class: The Team class consists of at least 6 elements -- the name of the team and five players from
    the Player class. Include in the class appropriate accessor and mutator methods for each element in the
    class. You may have other attributes if needed.
    Course Syllabus Page 3
    Input3 class: The Input3 class is provided for you. The Input3 class supplies data for your program. The
    Input3 class has a public method called getNextString, which returns a string with the input for your
    program, one after the other. You must use this class to get the data for your program. See Input3.java on
    WebCT to understand the class construction.
    Your program should display the roster of each team in alphabetical order by last name.
    This is the Input3 that he gave us to work with if anyone needs to see it:
    public class Input3
         private String[] input = new String[40];
         private static int StringNum = -1;
         public static final int NUMBER_OF_TEAMS = 3;
         public static final int NUMBER_OF_PLAYERS = 5;
         public Input3()
              //The first six inputs will be for the first team
              input[0] = "LAKERS";
              input[1] = "Kobe Bryant";
              input[2] = "Derek Fisher";
              input[3] = "Shaquille O'Neal";     
              input[4] = "Karl Malone";
              input[5] = "Brian Cook";
              //The next six inputs will be for the second team
              input[6] = "MAVERICKS";
              input[7] = "Antoine Walker";
              input[8] = "Dirk Nowitzki";
              input[9] = "Tony Delk";
              input[10] = "Shawn Bradley";
              input[11] = "Travis Best";
              //The next six inputs will be for the third team
              input[12] = "KNICKS";
              input[13] = "Mike Sweetney";
              input[14] = "Allan Houston";
              input[15] = "Howard Eisley";
              input[16] = "Kurt Thomas";
              input[17] = "Shanon Anderson";
         //This method returns the strings one after the other.
         public String getNextString()
              StringNum++;
              return input[StringNum];
    }<br>
    <br>
    <br>
    Thanks

    You could put the classes in separate files, but it's not necessary. They wouldn't be called 'subclasses' here, as that word is specific to inheritance, which you don't need here. Here's an example of using multiple classes:
    public class MainClass {
        public static void main(String [] args) {
         OtherClass1 oc1 = new OtherClass1(3);
         OtherClass2 oc2 = new OtherClass2("hello");
         System.out.println("" + oc1.getInt());
         System.out.println(oc2.getString());
    class OtherClass1 {
        int someInt;
        public OtherClass1(int i) {
            someInt = i;
        public getInt() {
         return someInt;
    class OtherClass2 {
        String someString;
        public OtherClass2(String s) {
            someString = s;
        public getString() {
            return someString;
    }and like BDLH said above, it's preferred to put them in separate files. Just make sure the file name is EXACTLY the same as the class name, followed by .java

  • I need help with viewing files from the external hard drive on Mac

    I own a 2010 mac pro 13' and using OS X 10.9.2(current version). The issue that I am in need of help is with my external hard drive.
    I am a photographer so It's safe and convinent to store pictures in my external hard drive.
    I have 1TB external hard drive and I've been using for about a year and never dropped it or didn't do any thing to harm the hardware.
    Today as always I connected the ext-hard drive to my mac and click on the icon.
    All of my pictures and files are gone accept one folder that has program.
    So I pulled up the external hard drive's info it says the date is still there, but somehow i can not view them in the finder.
    I really need help how to fix this issue!

    you have a notebook, there is a different forum.
    redundancy for files AND backups, and even cloud services
    so a reboot with shift key and verify? Recovery mode
    but two or more drives.
    a backup, a new data drive, a drive for recovery using Data Rescue III
    A drive can fail and usually not if, only when
    and is it bus powered or not

  • Need help with backup files made by HP Recovery.

    So in 2011 I had made a post about a DV9 series HP laptop I had that I felt needed a harddrive. Well the laptop has been sold to a friend of mine and he has since fixed the issue it had. My curent deboggle is trying to deal with the 36GB of data it backed up onto an external USB powered harddrive. The information was saved from a system that ran Windows VISTA, on that same DV9 Pavilion. I have a new laptop and it's a Pavilion DV6 running windows 7. Is there some sort of 3rd party application or an uncommon HP utility that can open, run or modify. Specificaly I need to some files but not all, but if my only option is to extract all then that would be fine also. There is an executible in the backup folder but it doesn't extract anything it just locks up. 
    For the TLR portion, need to access backup files made on an older HP laptop with windows vista to a newer HP latop running windows 7.

    Terribly sorry for the post, I should have researched more before posting. I found the answer to my issue in another thread here on the HP forums! Thanks so much!!

  • Need help with fla.file

    Hi!
    I'm always having trouble with a fla.file in cs3 professional. Every time i try to reopen the file in flash i get this:
    failed to open document/users.desktop/jason/social.fla
    pls help reopen this file
    jay

    create a new directory and move your fla there and try and open.  if that fails, change the file's name and try and reopen.  if that fails and you created the fla, it's probably corrupt.

  • Need help with batch file for javac.exe and java.exe

    I have this in my batch file:
    c:\jdk1.3.1_05\bin\javac
    What symbol do I need to be able to run this from cprompt with any file following it

    Thanks could remember that for nothing

  • Need help with copying files onto external drive

    I need help! Trying to copy downloaded movie files from Vuze (which have downloaded successfully) and copy onto external hard drive to view them but it wont let me copy over to the external device. Any ideas how to fix this please???

    Can you explain the steps you used, and the error message (or symptom), that says the copy did not work? 

  • Need help with Class-Path and NCDFE

    This isn't a new issue, but I'm getting a variation of a problem a lot of people seem to have had. I was hoping someone out there can help me out.
    I have a jar file (imex.jar) sitting in c:\temp\imextest. I also have another jar file, commons-cli-1.0.jar sitting in c:\temp\imextest\lib.
    I want to run the jar in a standalone manner. My manifest has the following entries.
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.5.3
    Created-By: 1.4.2_01-b06 (Sun Microsystems Inc.)
    Main-Class: com.foo.imex.DirectoryImportExport
    Class-Path: lib/commons-cli-1.0.jar
    I am invoking it using the following command (from c:\temp\imextest)
    java -jar imex.jar -i -f c:\matt\RRBus\jiyun.xml -v
    I get this result:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
    It seems to me that I have my directory structure and manifest set up correctly, but maybe I don't (as it's not working). Does anyone see what I'm doing wrong here? (the "missing" class is in commons-cli-1.0.jar).
    Thanks,
    Matt

    perhaps jar file needed for parsing is not there in classpath...set it...in the classpath..

  • Need help with class info and cannot find symbol error.

    I having problems with a cannot find symbol error. I cant seem to figure it out.
    I have about 12 of them in a program I am trying to do. I was wondering if anyone could help me out?
    Here is some code I am working on:
    // This will test the invoice class application.
    // This program involves a hardware store's invoice.
    //import java.util.*;
    public class InvoiceTest
         public static void main( String args[] )
         Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
         System.out.println("Original invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    // change invoice1's data
         invoice1.setPartNumber( "001234" );
         invoice1.setPartDescription( "Yellow Hammer" );
         invoice1.setQuantity( 3 );
         invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
         System.out.println("Updated invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    and that uses this class file:
    public class Invoice
    private String partNumber;
    private String partDescription;
    private int quantityPurchased;
    private double pricePerItem;
         public Invoice( String ID, String desc, int purchased, double price )
              partNumber = ID;
         partDescription = desc;
         if ( purchased >= 0 )
         quantityPurchased = purchased;
         if ( price > 0 )
         pricePerItem = price;
    public double getInvoiceAmount()
         return quantityPurchased * pricePerItem;
    public void setPartNumber( String newNumber )
         partNumber = newNumber;
         System.out.println(partDescription+" has changed to part "+newNumber);
    public String getPartNumber()
         return partNumber;
    public void setDescription( String newDescription )
         System.out.printf("%s now refers to %s, not %s.\n",
    partNumber, newDescription, partDescription);
         partDescription = newDescription;
    public String getDescription()
         return partDescription;
    public void setPricePerItem( double newPrice )
         if ( newPrice > 0 )
    pricePerItem = newPrice;
    public double getPricePerItem()
    return pricePerItem;
    Any tips for helping me out?

    System.out.println("Part number:
    "+invoice1.getPartNumber;
    The + sign will concatenate invoice1.getPartNumber()
    after "Part number: " forming only one String.I added the plus sign and it gives me more errors:
    C:\>javac InvoiceTest.java
    InvoiceTest.java:16: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ",   + invoice1.getPartNumber() );
                                                  ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:19: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:20: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    InvoiceTest.java:24: cannot find symbol
    symbol  : method setPartDescription(java.lang.String)
    location: class Invoice
            invoice1.setPartDescription( "Yellow Hammer" );
                    ^
    InvoiceTest.java:25: cannot find symbol
    symbol  : method setQuantity(int)
    location: class Invoice
            invoice1.setQuantity( 3 );
                    ^
    InvoiceTest.java:30: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ", + invoice1.getPartNumber() );
                                                ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:33: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:34: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    16 errors

  • Need help with class I'm trying to write for school

    Hi,I'm taking my first Java class, and we're learning how to write classes. I've got MOST of the program and class to work, but I'm still having trouble with it.
    In the class I wrote, if I delete the "getWindTempF(strAlt)" the program runs fine, other than not doing the conversion to Fahrenheit. So, I'm guessing that there's a problem with my getWindTempF method. However, it is almost exactly a duplicate of my getWindTempC method, so I can't figure out what I'm doing wrong. The errors I get when I keep the "getWindTempF(strAlt)" in the prtWindInfo method are:
    java.lang.NumberFormatException: For input string: " "
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         at java.lang.Integer.parseInt(Integer.java:426)
         at java.lang.Integer.parseInt(Integer.java:476)
         at NWSFD.getWindTempF(NWSFD.java:94)
         at NWSFD.prtWindInfo(NWSFD.java:162)
         at a19004.main(a19004.java:30)
    Exception in thread "main"
    ----jGRASP wedge2: exit code for process is 1.
    Again, the program and class work perfectly except for the getWindTempF. Any ideas would be greatly appreciated, and sorry for such a long post
    Here is the main program:
    import cs1.Keyboard;
    import java.text.NumberFormat;
    import java.text.SimpleDateFormat;
    import java.text.DateFormat;
    import java.util.Date;
    public class a19004
         // Instantiates the windsAloft object by using the NWSFD class
         public static void main (String[] args)
              final String FAA_FD="SAN 1405 2908+26 2911+19 2809+11 1307-09 0308-20 " +
              "032433 012543 352853";
              NWSFD windsAloft = new NWSFD(FAA_FD);     //Instantiate the NWSFD object
              System.out.println ("Winds Aloft");
              System.out.println ("as of " + windsAloft.getDate());
              System.out.println ("");
              System.out.println ("STA Alt Dir Speed TempC TempF");
              System.out.println ("");
              System.out.println (windsAloft.prtWindInfo("03"));
              System.out.println (windsAloft.prtWindInfo("06"));
              System.out.println (windsAloft.prtWindInfo("09"));
              System.out.println (windsAloft.prtWindInfo("12"));
              System.out.println (windsAloft.prtWindInfo("18"));
              System.out.println (windsAloft.prtWindInfo("24"));
              System.out.println (windsAloft.prtWindInfo("30"));
              System.out.println (windsAloft.prtWindInfo("34"));
              System.out.println (windsAloft.prtWindInfo("39"));
    And for the sake of brevity, just a part of the NWSFD class:
    import java.text.*;
    import java.util.Date;
    public class NWSFD
         // Set up variables
         private String strWea;
         // 3.a. Constructor
         public NWSFD (String strVar)
              strWea=strVar + " ";
         // 3.d.
         public String getWindTempC (String strAlt)
              String strVar;
              strVar = strWea.substring(getPos(strAlt) + 4, getPos(strAlt) + 7);
              if (strAlt.equals("03"))
                   strVar = strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 5);
              if (strAlt.equals("30"))
                   strVar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strAlt.equals("34"))
                   strVar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strAlt.equals("39"))
                   strVar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strVar.equals(" "))
                   strVar = "N/A";
              return strVar;
         // 3.ed.
         public String getWindTempF (String strAlt)
              String strVar;
              String strFar;
              int intRet;
              int intFar;
              strFar = strWea.substring(getPos(strAlt) + 5, getPos(strAlt) + 7);
              if (strAlt.equals("03"))
                   strFar = strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 5);
              if (strAlt.equals("30"))
                   strFar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strAlt.equals("34"))
                   strFar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strAlt.equals("39"))
                   strFar = "-" + strWea.substring(getPos(strAlt) +4, getPos(strAlt) + 6);
              if (strFar.equals(" "))
                   strVar = "N/A";
              intRet = Integer.parseInt(strFar);
              intFar = intRet * (9/5) + 32;
              strVar = Integer.toString(intRet++);
              return strVar;
         // 3.h.
         public String prtWindInfo (String strAlt)
              String strRet;
              strRet = strWea.substring(0,3) + " " + strAlt + "000" + " " +
                   getWindDir(strAlt) + " " + getWindSpeed(strAlt) + " " +
                   getWindTempC(strAlt) + "C " + getWindTempF(strAlt) + "F";
              return strRet;
    }

    Thank you for the reply, soni29. here is the code:
    public int getPos(String strAlt)
              int intAlt;
              int intRet;
              intAlt = Integer.parseInt(strAlt);
              switch (intAlt)
                   case 3:
                        intRet = 4;
                        break;
                   case 6:
                        intRet = 9;
                        break;
                   case 9:
                        intRet = 17;
                        break;
                   case 12:
                        intRet = 25;
                        break;
                   case 18:
                        intRet = 33;
                        break;
                   case 24:
                        intRet = 41;
                        break;
                   case 30:
                        intRet = 49;
                        break;
                   case 34:
                        intRet = 56;
                        break;
                   default:
                        intRet = 63;
              } //     Close switch
              return intRet;
    However, I really don't think there's a problem with any of the coding there. The only times I have problems with the program is when I'm trying to display the data from getWindTempF. If I omit that method, the program works perfectly. Basically, what the program is supposed to do, is hand a string (FAA_FD) to the NWSFD class, which then extracts data from it. Thank you again for the help...any other advice?

  • Need help with class object? Please somoen

    hey guys,
    It's been few days since i'm working on making a small bingogame program but i'm getting stuck frequantly.
    I've different classes, in the main class i'm asking the user to input number of players who would like to play then i'm asking the player's name and how many bingoCards each player wants.
    I'm stroing all that info in a BingoPlayer class's array object. But for some reason when i get out from the loop and try to retrive the info from that array it only gives me the last input entry (player's name & number of cards) at any index of the array.
    Can please someone tell me how i can store the given information for each player in that object array on different indices of the array?
    I'm providing the code where i've the problems:
    public class BingoGame
        public static BingoPlayer players[] = new BingoPlayer[5];
        public static void main() throws IOException {
            int numPlayers = 0;
            int numCards [] = new int [5];
            String name [] = new String[4];
            BufferedReader input = new BufferedReader (new InputStreamReader(System.in)); //allows input
    // ask for the number players who wants to play
            System.out.print("Please enter the number of players in this game (2-5): ");
            numPlayers = Integer.parseInt(input.readLine());
    // make sure the entered value is within range
            while (numPlayers < 2 || numPlayers > 5) {
                System.out.println("Invalid number of players ");
                System.out.print("Please enter the number of players in this game (2-5): ");
                numPlayers = Integer.parseInt(input.readLine());
            System.out.println();
    //ask for the names and numebr of cards for entered number of players
    // and make sure the number of cards are within the range,
    //and assign the players that many cards using the BingoPlayer object 
            for (int i = 1; i <= numPlayers; i++) {
                System.out.print("Please enter name of player " + i + " : ");
                name[i] = input.readLine();
                System.out.println();
                System.out.print("Please enter the number of cards (1-5) for player " + i + " : ");
                numCards[i] = Integer.parseInt(input.readLine());
                while (numCards[i] < 1 || numCards[i] > 5) {
                    System.out.println("Invalid number of cards for the player " + i);
                    System.out.print("Please enter the number of cards (1-5) for player " + i + " : ");
                    numCards[i] = Integer.parseInt(input.readLine());
                System.out.println();
                players[i] = new BingoPlayer(name, numCards[i]);
    * here it only prints out the information for the last player, instead it should return the information for both of the player
    for (int k = 1; k <= numPlayers; k ++) {
    System.out.println(players[k]);
    //players[k].genCards();
    for example if i enter 2 players:
    Player1: name: Jami, number of cards 1
    Player2: name: Joey, number of cards 2
    in the last loop it just prints out :"Joey, 2" 2 times instead of printing out: "Jami, 1" & "Joey, 2"
    Please someone help! i really need to complete this within 2 days. Thanks in advance

    Without seeing BingoPlayer's implementation, all it
    would be would be a guess.
    My guess: The name and numCards members of that class
    are declared as static, so all instances share the
    same values.Thanks it worked, declaring them static was the main probelm..thank you very much

Maybe you are looking for

  • Message File Adapter - XI Integration Server not arriving

    We have configured a file adapter to read a file.  According to the audit log the file is successfully read and converted to XML; however, the message is never posted to XI.  We have checked to make sure that no XI* users are locked and we have bounc

  • Automatic Payment Program-problems with check printing/viewing

    Hello: I am new to the SAP field. I have been trying to make the automatic payment program work for me. I have been having trouble trying to view the print preview of checks by going to system->own spool requests. Steps followed ---Automatic Payment

  • Listcube to Planning Area

    Hello Experts, While releasing the value from listcube to supply planning book ( via tx - /sapapo/rel_to_snp), an error pop-up. "Characteristic combination XXXXXXX ( Mat. No) - XXXX ( plant No ) : Negative values set to Zero" Any clue why is this hap

  • After Effects CS 11.0.4.2: Problem loading project file (error loading plugins etc.)

    Hello Adobe community, after creating a new project a few days ago, my After Effects CS6 v.11.0.4 has a problem with opening the project. Only this project can't open (everything else opens). I atteched some pictures to explain my problem better. I c

  • IViews return HTTP 400 message - web page not found

    Hello SDN members. We have encountered a problem with some iViews in our portal, since we installed NW SPS18. The iViews based on the KM Document iView template no longer work: u2022     The message in the browser is: u201DHTTP 400 Page not foundu201