Deployment problem with finder method

I have a problem deploying an application that was working prior to my adding a finder method to one of the entity beans. Here is the Descriptor from the EJB Module that i created (which appears to be ok):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>RFXModule</display-name>
<enterprise-beans>
<session>
<display-name>RFXManager</display-name>
<ejb-name>RFXManager</ejb-name>
<home>au.com.alphawest.trader.rfx.business.management.RFXManagerHome</home>
<remote>au.com.alphawest.trader.rfx.business.management.RFXManagerRemote</remote>
<ejb-class>au.com.alphawest.trader.rfx.business.management.RFXManagerBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/rfx/RFXDocument</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocal</local>
<ejb-link>RFXDocument</ejb-link>
</ejb-local-ref>
</session>
<entity>
<display-name>RFXAttachment</display-name>
<ejb-name>RFXAttachment</ejb-name>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocal</local>
<ejb-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentAttachment</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>RFXAttachment</abstract-schema-name>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>type</field-name>
</cmp-field>
<cmp-field>
<field-name>attachmentContents</field-name>
</cmp-field>
<primkey-field>name</primkey-field>
</entity>
<entity>
<display-name>RFXDocument</display-name>
<ejb-name>RFXDocument</ejb-name>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocal</local>
<ejb-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentPK</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>RFXDocument</abstract-schema-name>
<cmp-field>
<field-name>documentGUID</field-name>
</cmp-field>
<cmp-field>
<field-name>creationDate</field-name>
</cmp-field>
<cmp-field>
<field-name>creatorGUID</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<cmp-field>
<field-name>dueDate</field-name>
</cmp-field>
<cmp-field>
<field-name>emailAddress</field-name>
</cmp-field>
<cmp-field>
<field-name>faxNo</field-name>
</cmp-field>
<cmp-field>
<field-name>locked</field-name>
</cmp-field>
<cmp-field>
<field-name>notes</field-name>
</cmp-field>
<cmp-field>
<field-name>organisationName</field-name>
</cmp-field>
<cmp-field>
<field-name>ownerGUID</field-name>
</cmp-field>
<cmp-field>
<field-name>requestId</field-name>
</cmp-field>
<cmp-field>
<field-name>subject</field-name>
</cmp-field>
<cmp-field>
<field-name>telephoneNo</field-name>
</cmp-field>
<cmp-field>
<field-name>unitGUID</field-name>
</cmp-field>
<cmp-field>
<field-name>buyer</field-name>
</cmp-field>
<cmp-field>
<field-name>organisationGUID</field-name>
</cmp-field>
<cmp-field>
<field-name>sourceId</field-name>
</cmp-field>
<ejb-local-ref>
<ejb-ref-name>ejb/rfx/RFXDocumentAttachment</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocal</local>
<ejb-link>RFXAttachment</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<description>A line item attached to this document</description>
<ejb-ref-name>ejb/rfx/RFXLineItem</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocal</local>
<ejb-link>RFXLineItemBean</ejb-link>
</ejb-local-ref>
<query>
<description>Find the rfx documents related to the given supplier through it's line items</description>
<query-method>
<method-name>findBySupplierId</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(d) FROM RFXDocument AS d, IN(d.lineItems) l WHERE l.supplierGuid = 'DummySupplierGuid'</ejb-ql>
</query>
</entity>
<entity>
<display-name>RFXLineItem</display-name>
<ejb-name>RFXLineItem</ejb-name>
<local-home>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocalHome</local-home>
<local>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocal</local>
<ejb-class>au.com.alphawest.trader.rfx.business.data.RFXLineItemBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.math.BigDecimal</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>RFXLineItem</abstract-schema-name>
<cmp-field>
<field-name>itemId</field-name>
</cmp-field>
<cmp-field>
<field-name>rfxGuid</field-name>
</cmp-field>
<cmp-field>
<field-name>contractCode</field-name>
</cmp-field>
<cmp-field>
<field-name>supplierGuid</field-name>
</cmp-field>
<cmp-field>
<field-name>productCode</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<cmp-field>
<field-name>quantity</field-name>
</cmp-field>
<cmp-field>
<field-name>units</field-name>
</cmp-field>
<primkey-field>itemId</primkey-field>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<ejb-relation-name>RFXDocument-RFXAttachment</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>RFXDocument</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>RFXDocument</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>attachments</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>RFXAttachment</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete/>
<relationship-role-source>
<ejb-name>RFXAttachment</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
<ejb-relation>
<ejb-relation-name>RFXDocument-RFXLineItem</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>RFXDocument</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>RFXDocument</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>lineItems</cmr-field-name>
<cmr-field-type>java.util.Set</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>RFXLineItem</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete/>
<relationship-role-source>
<ejb-name>RFXLineItem</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
<assembly-descriptor>
<container-transaction>
<description>This value was set as a default by Sun ONE Studio.</description>
<method>
<ejb-name>RFXAttachment</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<description>This value was set as a default by Sun ONE Studio.</description>
<method>
<ejb-name>RFXDocument</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<description>This value was set as a default by Sun ONE Studio.</description>
<method>
<ejb-name>RFXLineItem</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<description>This value was set as a default by Sun ONE Studio.</description>
<method>
<ejb-name>RFXManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
I get the following error message when i try to run the EJB Module through the Sun One Verifier Tool:
Error: ** Error trying to process file: java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
at com.sun.enterprise.deployment.xml.EjbNode.parseQueries(EjbNode.java:700)
at com.sun.enterprise.deployment.xml.EjbNode.completeLoadingDescriptor(EjbNode.java:671)
at com.sun.enterprise.deployment.xml.EjbBundleNode.completeLoadingDescriptor(EjbBundleNode.java:524)
at com.iplanet.ias.deployment.EjbBundleXmlReader.load(EjbBundleXmlReader.java:249)
at com.iplanet.ias.deployment.EjbBundleXmlReader.loadStdAloneModule(EjbBundleXmlReader.java:162)
at com.sun.enterprise.tools.verifier.Verifier.openEjbJar(Verifier.java:2421)
at com.sun.enterprise.tools.verifier.Verifier.loadEjbJar(Verifier.java:1318)
at com.sun.enterprise.tools.verifier.Verifier.loadJar(Verifier.java:866)
at com.sun.enterprise.tools.verifier.gui.MainPanel.run(MainPanel.java:187)
at java.lang.Thread.run(Thread.java:536)
Look in file "RFXModule.jar_verified.xml" for detailed results on test assertions.
Any help would be greatly appreciated.
Mark Hesketh

Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
The title of the Console window should be All Messages. If it isn't, select
          SYSTEM LOG QUERIES ▹ All Messages
from the log list on the left. If you don't see that list, select
          View ▹ Show Log List
from the menu bar at the top of the screen.Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
Please don't indiscriminately dump thousands of lines from the log into this discussion.
Please don't post screenshots of log messages—post the text.
Some private information, such as your name, may appear in the log. Anonymize before posting.

Similar Messages

  • Problem with traverse method

    Hi, I am having this problem:
    I made a CustomItem, a TextField, now I overloaded the traverse method, so if the keycode is Canvas.UP or Canvas.DOWN then return false else return true.
    The problem is that when I press the left or rigth button it also returns false and not true.
    and there is another problem with traverse, before returning false or true I set a boolean and call to repaint to draw it on some way if its selected or not, the paint method is being called but it just dont draw as desired.
    protected void paint(Graphics g, int ancho, int alto) {
              System.out.println ("Dentro del paint, seleccionado="+seleccionado);
              try {
                   g.drawString(label, 0, 0, Graphics.TOP|Graphics.LEFT);
                   if (!seleccionado) {
                        g.setColor(120, 120, 120);
                   g.drawRect(0, 4, tama�oTexto+8, 25);
                   if (seleccionado) {
                        g.setColor(255, 255, 255);
                        g.fillRect(1, 5, (tama�oTexto+8-1), 23);
                   g.setColor(0, 0, 0);
                   if (!seleccionado) {
                        g.setColor(80, 80, 80);
                   g.drawString(texto, 4, 7, Graphics.TOP|Graphics.LEFT);
                   if (seleccionado) {
                        int cursorX=Font.getDefaultFont().charsWidth((texto.substring(0, idLetraActual)).toCharArray(), 0, texto.substring(0, idLetraActual).length())+4;
                        g.drawChar('|', cursorX, 7, Graphics.TOP|Graphics.LEFT);
              } catch (Exception E){
                   E.printStackTrace();
         }the traverse method set the seleccionado variable and calls to repaint but instead of being false the paint method is drawing it as true (most of times).

    I have a problem with findByxxx() method.. in
    Container managed bean.
    i have
    Collection collection =
    home.findByOwnerName("fieldValue");
    specified in my Client Program, where ownerName is the
    cmp fieldname..
    and
    public Collection findByOwnerName(String ownerName)
    throws RemoteException, FinderException
    defined in my home interface.
    i have not mentioned the findBy() method anywhere else
    (Bean class). You have to describe the query in the deployment descriptor.
    >
    Even if i have a same "fieldValue" in the database
    (Oracle), which i specified in findBy() method, iam a
    result of owner Not found, which is not the case as i
    have that owner name.
    for the same application if i use findByPrimaryKey(),
    it is working..
    Can any one please post me the solution.

  • I have problem with pay method

    I have problem with pay method. My card declined. I change card and I have the same problem. What can i do? Why declined my card again?

    Contact iTunes store support: https://ssl.apple.com/emea/support/itunes/contact.html.

  • Problem with prerender method

    Hi,
    I have a problem with the method prerender. A month ago, I started to develop a web project using Sun Studio Creator and a few page beans that i used extended the Abstract Page Bean, so I overrided the prerender and customized it.
    The problem is that, now i'm using eclipse and the configuration files of the project has changed and the prerender method never execute.
    I want to know why it is happening. Maybe the project is "bad-configurated"?
    Thanks

    The code of java bean doesn't change, the only thing that has changed is the configuration files (faces-config.xml, web.xml, etc).
    I put a breakpoint in the prerender method but the lifecycle doesn�t execute this method.
    After serveral changes, I wrote this code in the method prerender :
    int i=0;
    i = 1;
    And the prerender method doesn't execute.
    I'm a bit lost,
    thanks

  • Problem with affinetransformOp method...

    I have a serious problem with filter method
    I Want to make a image flipping or some other filtering by using
    AffineTransformOp
    but it printouts an erro like this
    cannot resolve symbol
    op.filter (img, flipped)
    (the error pointer shows ".after the op")
    a code from my one of the filters
    BufferedImage flipped = new BufferedImage(img.getHeight(), img.getWidth(),BufferedImage.TYPE_INT_RGB);
    AffineTransform trans = new AffineTransform(0, 1, 1, 0, 0, 0);
    AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    op.filter(img, flipped); //img is my buffered image source
    I used some other ways like (img, null) but always give out error.
    thanks..

    Did you declare "img" as BufferedImage or something else?
    What is the full error message?

  • Problem with WindowClosing() method

    Hello everyone,
    I have some problem with WindowClosing() method, in which I gave options
    to quit or not. Quit is working fine but in case of Cancel, its not returning to
    the frame. Can anyone help me ....Here is my code
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    public class TestFrame extends JPanel
         public static void main(String[] args)
              JFrame frame = new JFrame("Frame3");
              WindowListener l = new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        int button = JOptionPane.showConfirmDialog(null,"OK to Quit","",JOptionPane.YES_NO_OPTION, -1);
                        if(button == 0)     {
                             System.exit(0);
                                   else
                                              return;
              frame.addWindowListener(l);
              frame.setSize(1200,950);     
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    }

    Maybe try
    int button = JOptionPane.showConfirmDialog(yourframe,"OK to
    Quit","",JOptionPane.YES_NO_OPTION, -1);

  • Problem with finding a File

    Hi:
    I am having problem with finding a file on the OS
    (using Win2000) when given an absolute pathname;
    here is the rough code:
    //theFile is specified at command line
    File f = new File(theFile);
    BufferedReader in = new BufferedReader(new FileReader(f));When I run the program, I type
    java myProgram C:\aFolder\theFile
    But it can't find theFile. I am not sure what's wrong.
    Thanx

    No that can't be it; he takes the filename from the command line, so escaping isn't an issue (unless he used a shell that unescaped '\\' for him, but I think he's using the win2000 cmd shell).
    Dunno, I have no idea of your filesystem or shell. Just do some debugging, around the lines of:
    File f = new File(theFile);
    if (f.exists()) {
      System.err.println(theFile + " exists.");
    } else {
      System.err.println(theFile + " doesn't exist.");
    }

  • Problem with Vector method addElement

    I am new to Java. I am using JDK 1.3. I am writing a program that will convert a text file to a binary file that stores a Vector object. I have narrowed my problem to the method that reads the text file and creates my vector. Each element in my vector stores an integer and a string variable. The reading of the text file works find and the creation of my record works find. It seems that the storing of the record in the vector is not working. When I print the first 10 elements of the vector, it have the same record(the last record of my text file). What is wrong with the method below? I am also appending the result of running my program.
    private static void readTextFile(File f) {
    try {
    FileReader fileIn = new FileReader(f);
    BufferedReader in = new BufferedReader(fileIn);
    String line;
    int i;
    SsnLocationRecord recordIn = new SsnLocationRecord();
    int ctr = 0;
    while (true) {
    line = in.readLine();
    if (line == null)
    break;
    ctr += 1;
    i = line.indexOf(" ");
    recordIn.putAreaNumber(Integer.parseInt(line.substring(0,i).trim()));
    recordIn.putLocation(line.substring(i+1).trim());
    records.addElement(recordIn);
    if (ctr < 11)
    System.out.println(recordIn);
    in.close();
    } catch (IOException e) {
    System.out.println ("Error reading file");
    System.exit(0);
    for (int i = 0; i < 11; i++)
    System.out.println((SsnLocationRecord) records.elementAt(i));
    RESULTS:
    C:\Training\Java>java ConvertTextFileToObjectFile data\ssn.dat
    0 null
    3 New Hampshire
    7 Maine
    9 Vermont
    34 Massachusetts
    39 Rhode Island
    49 Connecticut
    134 New York
    158 New Jersey
    211 Pennsylvania
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    C:\Training\Java>

    First of all it would be better if you did a priming read and then checked line == null in the while statement instead of the way you have it.
    ctr++ will also accomplish what ctr +=1 is doing.
    you need to create a new instance of SsnLocationRecord for each line read. What you are doing is overlaying the objects data each time you execute the .putxxxx methods. The reference to the object is placed in the vector. The actual object is still being updated by the .putxxx methods (NOTE : THIS IS THE ANSWER TO YOUR MAIN QUESTION).
    you close should be in a finally statement.
    To process through all the elements of a Vector create an Enumeration and then use the nextElement() method instead of the elementAt is probably better. (Some will argue with me on this I am sure).
    Also, on a catch do not call System.exit(0). This will end your JVM normally. Instead throw an Exception (Runtime or Error level if you want an abnormal end).

  • Problem with binarySearch method

    In the code below I've got a problem with my binarySearach method in the IntegerList.java file. When I look at my IntegerTest file, Eclipse give me this message next to my method call for the binarySerch (case 6): (the method binarySearch int[] , int) in the type integerList is not applicable for the arguments (int). So what the heck have I done wrong? I know it's a lot of code to look at but felt you'll need to see both classes to make heads or tales out of this.
    Thanks in advance.
    import java.util.Scanner;
    public class IntegerList //implements Comparable
         int [] list; // values in the list
         //Constructor -- takes an integer and creates a list of that
         //size.  All elements default to value 0.
         public IntegerList(int size)
              list = new int[size];
         //randomize -- fills the array with randomly generated integers
         //between 1 and 100, inclusive
         public void randomize()
              int max = list.length;
              for (int i=0; i < list.length; i++)
                   list[i] = (int) (Math.random() * max) +1;
         //fillSorted -- fills the array with sorted values
         public void fillSorted()
              for (int i =0; i <list.length; i++)
                   list = i + 2;
         //print -- prints array elements with indices, one per line
         public String toString()
              String s = "";
              for (int i = 0; i <list.length; i++)
                   s += i + ":\t" + list[i] + "\n";
              return s;
         //linearSearch -- takes a target value and returns the index
         //of the first occurrence of target in the list. Returns -1
         //if target does not appear in the list
         public int linearSearch (int target)
              int location = -1;
              for (int i = 0; i < list.length && location == -1; i++)
                   if (list [i] == target)
                        location = i;
                   return location;
         //sortIncresing -- uses selection sort
         public void sortIncreasing()
              for (int i =0; i < list.length -1; i++)
                        int minIndex = minIndex(list, i);
                        swap (list, i, minIndex);
    private void swap(int[] list, int index, int min)
    int temp =list [index];
    list [index] = list [min];
    list [min] = temp;
    // private int minIndex(int[] list, int index)
    public int minIndex(int[] list, int lastIndex) {
    int min=list[lastIndex];
    for (int i=lastIndex+1; i<list.length; i++)
    if (list[i]<min)
    lastIndex=i;
    return lastIndex;
    public void sortDecreasing()
              for (int i =0; i > list.length -1; i++)
                        int minIndex = minIndex(list, i);
                        swap (list, i, minIndex);
    public static int binarySearch (int [] list, int val)
    int min = 0, max = list.length, mid =0;
    boolean found = false;
    while (!found && min <= max)
    mid = (min + max) / 2;
    if (list [mid]== val)
    found = true;
         //if the mid point contains the value being searched for
         //then we are done
    else
    if (list[mid]< val)
    max = mid -1;
    else
    min = mid+1;
    if (found)
    return list[mid];
    else
    return -1;
    return val;
    }//end class
    //now for the IntegerListTest class
         //File: integerListTest.java
         //Purpose: Provide a menu-driven tester for the IntegerList class.
         import java.util.*;
         public class IntegerListTest
              static IntegerList list = new IntegerList(10);
              static Scanner scan = new Scanner(System.in);
         // main -- creates an initial list, then repeatedly prints
         // the menu and does what the user asks until they quit
         public static void main(String [] args)
              printMenu();
              int choice = scan.nextInt();
              while (choice != 0)
                        dispatch(choice);
                        printMenu();
                        choice = scan.nextInt();
         // dispatch -- takes a choice and does what needs doing
         public static void dispatch(int choice)
              int loc;
              int val;
              long time1, time2;
              long totalTime;
              switch (choice)
                        case 0:
                             System.out.println("Bye!");
                             break;
                        case 1:
                             System.out.println(list);
                             break;
                        case 2:
                             System.out.println("How big should the list be?");
                             list = new IntegerList (scan.nextInt());
                             System.out.println("List is created.");
                             break;
                        case 3:
                             list.randomize();
                             System.out.println("List is filled with random elements.");
                             break;
                        case 4:
                             list.fillSorted();
                             System.out.println("List is filled with sorted elements.");
                             break;
                        case 5:
                             System.out.print("Enter the value to look for: ");
                             val = scan.nextInt();
                             time1 = System.currentTimeMillis();
                             loc = list.linearSearch(val);
                             time2 = System.currentTimeMillis();
                             totalTime = time1 - time2;
                             System.out.print(totalTime);
                             if (loc != -1)
                                  System.out.println("Found at location " + loc);
                             else
                                  System.out.println("Not in list");
                             break;
                        case 6:
                             System.out.print("Enter the value to look for: ");
                             val = scan.nextInt();
                             loc = list.binarySearch(val);
                             if (loc != -1)
                                  System.out.println("Found at location " + loc);
                             else
                                  System.out.println("Not in list");
                             break;
                        case 7:
                             list.sortIncreasing();
                             System.out.println("List has been sorted.");
                             break;
                        case 8:
                             list.sortDecreasing();
                             System.out.println("List has been sorted.");
                             break;
                        default:
                             System.out.println("Sorry, invalid choice");
         // printMenu -- prints the user's choices
         public static void printMenu()
              System.out.println("\n Menu ");
              System.out.println(" ====");
              System.out.println("0: Quit");
              System.out.println("1: Print the list");
              System.out.println("2: Create a new list of a given size");
              System.out.println("3: Fill the list with random ints in range 1-length");
              System.out.println("4: Fill the list with already sorted elements");
              System.out.println("5: Use linear search to find an element");
              System.out.println("6: Use binary search to find an element " +
                                  "(list must be sorted in increasing order)");
              System.out.println("7: Use selection sort to sort the list into " +
                                  " increasing order");
              System.out.println("8: Use insertion sort to sort the list into " +
                                  " decreasing order");
              System.out.println("\nEnter your choice: ");

    Ah... But now that I have looked at it some more, I have noticed that the array of int is created in your IntegerList class...
    so you want to change your binarySearch() method...
    from...
    public static int binarySearch (int[] list,int val)to
    public int binarySearch (int val)now it will search the list declared in your constructor...
    and also note that static is remove to eliminate the non-static reference from static context error...
    so in IntegerList.java, that method signature should look like this...
    public int binarySearch (int val)// take only one arguement and...
    // check against internal int [] listand you call it like this...
    loc = list.binarySearch(val);// not changednow all you have to do it get your list populated with random integers for the rest to work... I leave that to you...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Problem with getState() method in Thread class

    Can anyone find out the problem with the given getState() method:
    System.out.println("The state of Thread 1: "+aThread.getState());
    The Error message is as follows:
    threadDemo.java:42: cannot resolve symbol
    symbol : method getState ()
    location: class incrementThread
    System.out.println("The state of Thread 1: "+aThread.getState())
    ^
    1 error

    the api doc shows Since: 1.5
    You do use Java 5...if not... it's not available.

  • Deploying problem with remout OC4J (10.1.2)

    Hello!
    I have a problem with PDK-Java Portlet deployng. I'm relatively new in this field.
    I use Jdeveloper 10g (10.1.2). I have read in the Jdeveloper help how to deploy portlet on remout Application Server.
    I start the following comand in server's console where OC4J installed:
    java -jar ${ORACLE_HOME}/j2ee/home/admin.jar ormi://myserver:3204 my_pass -deploy -file Oc4jDcmServlet.ear -deploymentName Oc4jDcmServlet
    and get the Error: Unable to find java:comp/ServerAdministrator: Lookup error: javax.naming.AuthenticationException: Invalid username/password for default (adminuser);
    I login to Enterprise Manager 10g Application Server Control by the same user(adminuser) and the same password (my_pass).
    Anybody know how to resolve this problem?

    did you change the admin password after installation?
    Oracle doesnt change all passwords, the password entered during installation of OC4J is the password you have to use for deployment from JDEV
    atleast, thats my experiance

  • Problem with Finder and Menu Fonts (uppercase A)

    Hello --
    I'm having a problem with fonts. All the characters that appear under icons in the Finder or in the menu for any application appear as uppercase As with boxes around them. There appears to be one uppercase A for each character that should be there. If I click-pause-click to edit the filename in the Finder, the text appears normal during the duration of the change, and then reverts to uppercase A with a box around it again. All other operation of the computer is normal.
    I was watching and downloading video files in iTunes when the problem appeared. When I pressed ESC to exit full-screen mode, the Finder said that my start-up disk was almost full, and I saw the font problem. Upon investigating, I discovered that my start-up disk was completely full (and the download had failed), so the first thing I did was move some video files to an external drive, which freed about 5 GB.
    Since freeing the space, I've tried the following to fix it, in this order:
    1. booted from Tiger CD to run Repair Disk from Disk Utility
    2. rebooted from the boot hard drive to run Repair Disk Permissions from Disk Utility
    3. run through Disk Warrior
    4. created a test admin user and logged in as that user
    5. removed font cache files using terminal
    6. booted in safe mode, logged in as myself, and then rebooted normally
    None of these actions has had any effect. The computer is still operating normally, except for the characters that don't display correctly.
    I'm running 10.4.6 on a Titanium Powerbook 500 MHz with 512MB RAM. A few months ago, I replaced the internal hard drive with an 80GB Seagate.
    Tibook 500   Mac OS X (10.4.6)  

    Hi again, zoobieboots —
    I appreciate your initiating a new thread. Your post here helps to make the situation much clearer than in bmewolf's thread — particularly in terms of what you've already tried. Thanks again.
    A few initial thoughts —
        (a) As I was trying to suggest previously, you're apparently operating (after moving some files to an external drive) with ~6-10% (?) free disk space. Particularly given that you were working with large video files when this appeared, File fragmentation would be expected. While I haven't heard of this particular symptom resulting from fragmentation, that would be a concern to me — particularly since this immediately preceded the problematic behavior.
    I've read some good reports about iDefrag, but haven't used it myself. A demo version is apparently available for HDs < 100GB. But you'd presumably need to free significantly more space first (you haven't actually said whether 5GB or ?? is the total available now). Having never experienced severe fragmentation, I don't fully understand its consequences — but another participant may be able to explain this.
        <b>(b) You don't mention trying to troubleshoot potentially corrupt or incompatible fonts (or font caches), also as outlined in the other thread. As I suggested there, The X Lab's "undoing Font Book" FAQ is a useful resource in this.
        (c) Although I agree it may be an unsatisfying "solution," an Archive & Install did work for bmewolf in the case that you've indicated matches yours closely.
    I hope one of these suggestions is helpful. Please post back to discuss your progress.
    Regards,
    Dean

  • Problem with "find" mode in adf/swing application

    Hi all,
    I'm working on ADF Swing application which uses MS SQL Server 2005 (JDeveloper 10g 10.1.3)
    I think that my issue might be well-known…sorry if it has been already discussed somewhere else…
    I have a problem with the “find” mode for a detail panel in a master-detail form…(To make it clear the “find” mode is switched on when clicking on the special button on a navigation panel).
    So this mode works well in a master panel, but it demonstrates strange behavior on a detail panel, i.e. it takes me two attempts to find the necessary child object and it doesn’t switch back in a simple way from this mode to the normal mode….say if we are in the department 10 (Dept is a master form) we can’t simply find KING employee (Emp is a detail form)…is there any workaround for this?
    Thanks in advance. Alex.

    Hi Frank, please look this issue

  • Problem with finding directory

    Hi,
    I built an application on Windows and I have to find a document within another directory. I am using getAbsolutepath and I am having problems with the following type of path:
    File test = new File("u1/usr/my program/myFile/")
    if(test.isDirectory())
    this works on Windows, however it doesn't work on Unix....I also tried the following on Unix
    File test = new File("u1/usr/my\\ program/myFile/")
    if(test.isDirectory())
    and it also doesn't work.
    thanks in advance for any help!

    I just made a directory with a space in it (on Linux) and created a file to find it, and it worked fine. I have the directory
    /home/joshua/my directory
    And made the call
    File file = new File("/home/joshua/my directory");and the file did exist and was a directory.
    Try testing the call with
    System.out.println("file = " + file.getAbsolutePath());
    And make sure that that file exists.

  • Problem with getPrimaryKeys method in DatabaseMetaData

    I'm using the above mentioned method to get primary keys from a DB2 database. I estimate that 95% of the time it performs as expected, but there are 7 tables in my database, that as far as I can see, are no different to any others and it fails to work with these. Looking at the tables in the DB2 control centre shows them all having keys, no different to any of the other tables. Also of note is that the tables it fails on are next to each other, it fails on tables 68 and 69, 135 and 136 and 200,201 and 202. Just wondering if anyone else has seen this problem before and if they found any solutions for it?
    Just ran through the program again and it's failed on a completely different set of tables, they're all sequential as well, could this be a problem with my connection to the db?
    Edited by: jnaish on Aug 14, 2008 7:38 AM

    post the ddl and code i guess
    i doubt this is related to your connection
    Also of note is that the tables it fails on are next to each other, i can't imagine that would be a problem, but sounds like it'd be easy for you to prove your theory with a simple test

Maybe you are looking for