Returning strings of the same name in a text file from an array

Hi,
Another quick question. I have a text file with lines consisting of one integer, and four strings. Currently, I am able to search through this file and find any of the variables listed within. However, if any of the variables are listed more than once, and I search for that particular varable name, it only prints out the first line containing that particular variable name.
Basically, how do I modify the following code so that the search method returns all the instances of a particular variable name in the text file?
My current code is as follows,
1. Search method,
public Title lookUpDirector(String requiredDetails) {
        boolean found = false;
        int next = 0;
        while (!found && (next<TitleCount))
            if ( TitleArray[next].getDirector().equals(requiredDetails))
                found = true;
            else next++;
        if (found) return TitleArray[next];
        else return null;
    }2. Test main class
import simplejava.*;
public class SearchTitleDirector
    public static void main(String[] args) {
        String titleDetails;
        SimpleReader keyboard = new SimpleReader();
        SimpleWriter screen = new SimpleWriter();
        SimpleReader inFile = new SimpleReader("title_test.txt");
        TitleList title = new TitleList(inFile);
        TitleList[] sortedArray = new TitleList[]{title};
        titleDetails=keyboard.readLine("Director?");
        Title search = title.lookUpDirector(titleDetails);
        if (search == null)
            screen.println("Not found");
        else screen.println(search);
}Any help or advice appreciated!

Thanks for the reply and advice.
I have tried implementing the lookUpDirector method as follows,
public TitleList lookUpDirector(String requiredDetails) {
        boolean found = false;
        int next = 0;
        TitleList list = new TitleList();
            while (!found && next<titleCount) {
                if ( titleArray[next].getDirector().equals(requiredDetails)) {
                    list.add(titleArray[next]);
                    next++;
          if (found) return list;
          else return null;
        }When I use this method with the previous test main class, it compiles and runs, but after the user inputs the name of the director to search for, the input window freezes indefinitely and no result is achieved. The output pane in NetBeans is as follows,
init:
deps-jar:
compile-single:
run-single:
Director?The only way to stop the process is to terminate it in the Runtime section of NetBeans.
I have no idea why this is happening. Any advice?

Similar Messages

  • Two groups with the same name in File and LDAP realms

    Hi,
    I configured WLS 6.0 SP1 to use an LDAP caching realm
    as default one. In the LDAP server (Netscape Directory)
    I have a group called Administrators. There is a group
    with the same name in WLS own File Realm. When I click
    on the Groups menu item in the administration console
    I only get the Administrators group from the File Realm
    listed. Is that expected? What will happen if I protect
    a resource ti the Administrators group? Which one will
    prevail - the one from the LDAP or the one from File
    Realm? Or maybe the two will be merged?
    Regards,
    Plamen Petrov
    AstraZeneca
    Sweden

    Hi
    First of all I want to know that where you created your class, In SE24 or in any programm.
    if in SE24, then go to se24 open that class go to methods tab and check if that method name accurs at two places, if not, then
    click on that method and check the code.
    or if in a program.
    then you must have defined like
    class <class name> definition.
    public section
    method <method name>
    endclass.
    class <class name> implementation.
    method <method name>
      code for that method.
    endclass.
    It might be possible you have set the implementation part twice for that particular method, So please check and delete one implementation for that method.
    Thanks
    Lalit Gupta

  • Multiple image files with the same name

    I have about 150 images that have been imported into a single lightroom folder that have the same name. These images are from a single event, so Id like to keep them together. The source files are in two different folders on my drive, but they all exist in one folder on lightroom. (for instance, I have two different images, both named CR-0917, both with different retouching). Initially, Lightroom allowed me to do all of my editing on all of the files in one place, even though the names were the same. I have since moved the source folders and files to a different location on my hard drive, but I can't update the files within the folder in lightroom, because lightroom chooses one source, so it gets about half the images right, and half wrong. I spent a ton of time retouching these images and I dont want to have to go back and redo it.
    Is there a way to manually update the source information for each image, without Lightroom automatically using all of the images from a single folder? Or does anyone have any other ideas of what I can do? Please help...

    I am puzzled about how this problem initially arised, too.
    For the issue with several cameras I recommend the following:
    1. If the camera lets you, specify a unique prefix so that each photo will have a unique name directly from camera.
    E.g. Nikon lets you change their default prefix "DSC" to something else. As I even do not want to have recurring filenames after 10'000 shots I choose "yFL" as prefix, where y=number from 0..9, F=starting letter of ther first name of the camera owner, L=last name. Or other 2 digits that point to the camera model.
    For current decade it is even nice to take y=1 for 2011 and so on. As I do roughly 10'000 shutters per year that fits about nicely. [Ok, as of 2020 I will use letters, too. 2046 I have to devise something else hoping that I will still be shooting photos with my same husband.]
    2. If the camera does not facilitate such, as Canon: rename upon LR-import by putting a short prefix in front of the originial filename, e.g. yS90_, yG12_
    I only want from a filename that it be unique in my household and that I have a rough idea where in sequence of time it may belong.
    So if I get pictures from friends I put a prefix for them, too, while importing. Leaving the rest of their original filename is good for further communication about the pic.
    I think usually LR takes more properties into account than just filename when deciding about duplicate, such as camera serial no., capture time etc.
    Anybody who knows for sure?

  • [svn] 889: Add test case for BLZ-82 where HttpService should return multiple headers with the same name .

    Revision: 889
    Author: [email protected]
    Date: 2008-03-21 13:08:05 -0700 (Fri, 21 Mar 2008)
    Log Message:
    Add test case for BLZ-82 where HttpService should return multiple headers with the same name.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-82
    Added Paths:
    blazeds/trunk/qa/apps/qa-regress/remote/MultipleHeadersTest.jsp
    blazeds/trunk/qa/apps/qa-regress/testsuites/mxunit/tests/proxyService/httpservice/MultiHe aderTest.mxml

    Hi again,
    this may be old news to some people, but I just realized we can have the desired benefits I originally listed (encapsulation, reuse, maintainability, security) TODAY by using pipelined functions and using the table() function in Apex report region queries.
    So the report query basically becomes, for example (if get_employees is a pipelined function)
    select * from table(my_package.get_employees(:p1_deptno))
    The only downside compared to a (weakly typed) sys_refcursor is that you have to define the type you are returning in your package spec (or as an SQL type). So it's a bit more coding, but it's still worth it for the other benefits it provides.
    I like Apex even better now! :-)
    - Morten

  • Applet with 2 methods with the same name in ie

    Hi,
    I have a problem with the Java 1.5 plugin for Internet Explorer .
    When my Applet contains 2 methods with the same name but not the same return type, ie does not take the good return type.
    Here is an exemple :
    * Class TestApplet
    package test.applet;
    import java.applet.Applet;
    public class TestApplet extends Applet {
         public void init() {
              System.out.println("init()");
         public void start() {
              System.out.println("start()");
         public String test(String s) {
              System.out.println("test(String) :" + s);
              return s;
         public boolean test(int i) {
              System.out.println("test(int) :" + i);
              return true;
    }I have 2 methods test(), one returns a String and the other a boolean.
    I use the following html code :
    <html>
    <head>
    <script>
    function test() {
         alert(document.DataAccess.test("hello"));
    </script>
    </head>
    <body>
    <applet WIDTH="500" HEIGHT="200" ID="DataAccess" NAME="DataAccess" CODE="test.applet.TestApplet">
    </applet>
    <div onclick="test()">test</div>
    </body>
    </html>
    When I click on "test", the alert show "true" instead of "hello".
    The problem only occurs with a JVM 1.5. It work fine with JVM 1.4.
    Any idea ? Is it a bug ?
    Thanks.

    In your javascript method:
    function test() {
    alert(new String(document.DataAccess.test("hello")));
    MSJVM and SUN jre use different conversion from javaScript objects to Java.
    if you call from javaScript:
    document.getElementById("myApplet").myMethod(22);
    The method in MSJVM should look like this:
    public whatever myMethod(Double d);
    and SUN jre:
    public whatever myMethod(Integer i);
    The best thing to do is this:
    public whatever myMethod(Object o);
                   int col = 0;
                   if (o.getClass().getName().toLowerCase().indexOf("integer") != -1) {
                        col = ((Integer) o).intValue();
                   } else {
                        col = ((Double) o).intValue();
                   }

  • Having multiple nodes with the same name in JTree!!!???

    Hi!
    I want to be able to have folders or files with the same name in different locations in my JTree. But if I do so the last one always overwrites the previous one.
    I have a vector with strings like root\aaa\bbb\ccc\ddd.doc, root\aaa\bbb\eee.doc, root\aaa\ccc\fff.doc etc. In this case ccc\ddd.doc out of the first string would disapear.
    In this post you can see how I add the nodes:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=54920
    Is this because it adds everything in the same level or what? A solution/workaround would be much appreciated.
    Tobias

    Use this example...
    public class TreeDemo {
    private JFrame frame;
    private JTree tree;
    public TreeDemo (JTree tr) throws Exception {
    frame=new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    edit=new JEditorPane();
    frame.getContentPane().add frame.getContentPane().add(tr,BorderLayout.CENTER);
    frame.getContentPane().add(new JButton("ok"),BorderLayout.SOUTH);
    frame.pack();
    frame.show();
    public static void main(String[] argv)
    throws Exception
    Vector v=new Vector();
    v.add(0,"c:\\first\\abc");
    v.add(1,"c:\\first\\abc\\word1.doc");
    v.add(2,"c:\\first\\abc\\description.doc");
    v.add(3,"c:\\first\\def ");
    v.add(4,"c:\\first\\der\\tor1.doc");
    TreeDemo html = new TreeDemo (createTree(v));
    private static JTree createTree(Vector v) {
    JTree tree = null;
    DefaultMutableTreeNode root = null;
    Iterator i = v.iterator();
    String subStr;
    DefaultMutableTreeNode parent=null;
    root = new DefaultMutableTreeNode("ROOT");
    tree = new JTree(root);
    parent=root;
    while (i.hasNext()) {
    String path = (String)i.next();
    StringTokenizer st = new StringTokenizer(path,"\\");
    while (st.hasMoreTokens()) {
    subStr = st.nextToken();
    DefaultMutableTreeNode current=findObject(parent,subStr);
    if (current==null) {
    DefaultMutableTreeNode node = new DefaultMutableTreeNode(subStr);
    parent.add(node);
    parent=node;
    else {
    parent=current;
    parent=root;
    return tree;
    private static DefaultMutableTreeNode findObject(DefaultMutableTreeNode parent,String value) {
    for (int i=0; i<parent.getChildCount(); i++) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)parent.getChildAt(i);
    if (node.getUserObject().equals(value)) {
    return node;
    return null;
    best regards
    Stas

  • PL/SQL Procedures with the same name

    Hi,
    I have some PL/SQL procedures with the same name but different arguments.
    If I try to catalog the second or third ALBPM always catalogs the first and I don't want to use this. ALBPM only catalogs the first one.
    ALBPM Studio Logs:
    Introspecci?n en curso...
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    Agregando procedimiento 'ADM_SGI.UGDIASINOI'
    [Advertencia] No se puede agregar procedimiento 'UGDIASINOI'. Motivo: Duplicar nombre del componente (M?dulo DatabaseRoot.ADM_SGI - Componente UGDIASINOI)..
    [Advertencia] No se puede agregar procedimiento 'UGDIASINOI'. Motivo: Duplicar nombre del componente (M?dulo DatabaseRoot.ADM_SGI - Componente UGDIASINOI)..
    Analizando componentes
    Any solution or idea??
    Thanks!

    I need to retrive data from PL/SQL stored procedures. I am using the DynamicSQL component (2nd workaround) to retrive data from PL/SQL stored procedures. <br><br>
    I am having some problems.<br><br>
    This is the code I am running in Fuego Studio 5.5 SP 11 Build #71108:<br><br>
    dynamicSQL as Fuego.Sql.DynamicSQL<br>
    iterator as Iterator(Any[Any])<br>
    sentence as String<br>
    implname as String<br><br>
    dynamicSQL = Fuego.Sql.DynamicSQL()<br>
    implname = "conexionORBPAU"<br>
    sentence = "var result REFCURSOR; " + <br>
    "exec :result_cursor := pkg_audbpm_bpaasig_indicador.prgetsingle(9999);";<br>
    iterator = executeQuery(DynamicSQL, sentence, implname, inParameters : []);<br><br>
    And, this is the error:<br><br>
    java.sql.SQLException: Falta el parametro IN o OUT en el indice:: 1 <br>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br>      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br>
    oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)<br>
         at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:579)<br>
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:340)<br>
    ...<br><br>
    This is the code of the PL/SQL in the Oracle DB:<br><br>
    CREATE OR REPLACE PACKAGE PKG_AUDBPM_BPAASIG_INDICADOR IS<br>
    TYPE cursor_type IS REF CURSOR;<br>
         FUNCTION prGetSingle<br>
         (<br>
              p_ID_ASIG_INDICADOR IN NUMBER<br>
         )<br>
         RETURN cursor_type;<br><br>
    END PKG_AUDBPM_BPAASIG_INDICADOR;<br><br>
    is my code OK? Any ideas?<br><br>
    Thanks in advance.<br>

  • How do I call methods with the same name from different classes

    I have a user class which needs to make calls to methods with the same name but to ojects of a different type.
    My User class will create an object of type MyDAO or of type RemoteDAO.
    The RemoteDAO class is simply a wrapper class around a MyDAO object type to allow a MyDAO object to be accessed remotely. Note the interface MyInterface which MyDAO must implement cannot throw RemoteExceptions.
    Problem is I have ended up with 2 identical User classes which only differ in the type of object they make calls to, method names and functionality are identical.
    Is there any way I can get around this problem?
    Thanks ... J
    My classes are defined as followes
    interface MyInterface{
         //Does not and CANNOT declare to throw any exceptions
        public String sayHello();
    class MyDAO implements MyInterface{
       public String sayHello(){
              return ("Hello from DAO");
    interface RemoteDAO extends java.rmi.Remote{
         public String sayHello() throws java.rmi.RemoteException;
    class RemoteDAOImpl extends UnicastRemoteObject implements RemoteDAO{
         MyDAO dao = new MyDAO();
        public String sayHello() throws java.rmi.RemoteException{
              return dao.sayHello();
    class User{
       //MyDAO dao = new MyDAO();
       //OR
       RemoteDAO dao = new RemoteDAO();
       public void callDAO(){
              try{
              System.out.println( dao.sayHello() );
              catch( Exception e ){
    }

    >
    That's only a good idea if the semantics of sayHello
    as defined in MyInterface suggest that a
    RemoteException could occur. If not, then you're
    designing the interface to suit the way the
    implementing classes will be written, which smells.
    :-)But in practice you can't make a call which can be handled either remotely or locally without, at some point, dealing with the RemoteException.
    Therefore either RemoteException must be part of the interface or (an this is probably more satisfactory) you don't use the remote interface directly, but MyInterface is implemented by a wrapper class which deals with the exception.

  • A cmr-field and a cmp-field on the bean are using the same name. The names

    Hi:
    I am using weblogic 8.1 and MyEclipse 5.1.1. I am deploying my ear application through MyEclipse 5.1.1 as an ear file.
    When I ran the following EJB QL:
    SELECT OBJECT(p) FROM Product p.category = ?1
    I get the following error:
    n relation Category-Product, a cmr-field and a cmp-field on the bean are using the same name. The names of cmr and cmp fields must be unique.
    It is basically complaining that I have a field
    <cmr-field>
                             <cmr-field-name>category</cmr-field-name>
                        </cmr-field>
    in my ejb-jar.xml and also the same category in the
    <cmp-field><field-name>category</field-name></cmp-field>
    field. The problem is that if I changed the value of the cmr-field, I have to add a get and set in my productLocal.java and when you do that you have to do the same in the ejb-jar.xml.
    Here is my ejb-jar.xml:
    <?xml version="1.0"?>
    <!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>
    <enterprise-beans>
    <entity>
    <ejb-name>CategoryEJB</ejb-name>
    <local-home>com.CategoryHomeLocal</local-home>
    <local>com.CategoryLocal</local>
    <ejb-class>com.CategoryBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Category</abstract-schema-name>
         <cmp-field><field-name>categoryId</field-name></cmp-field>
    <cmp-field><field-name>categoryName</field-name></cmp-field>
    <cmp-field><field-name>picture</field-name></cmp-field>
    <cmp-field><field-name>pictureWidth</field-name></cmp-field>
    <cmp-field><field-name>pictureHeight</field-name></cmp-field>
    <cmp-field><field-name>labelOn</field-name></cmp-field>
         <cmp-field><field-name>labelOff</field-name></cmp-field>
         <cmp-field><field-name>button</field-name></cmp-field>
    <primkey-field>categoryId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
              <query>
                   <query-method>
                        <method-name>findCategory</method-name>
                        <method-params></method-params>
                   </query-method>
                   <ejb-ql>
                        SELECT OBJECT(c) FROM Category c
                   </ejb-ql>
              </query>
         </entity>
         <entity>
    <ejb-name>ProductEJB</ejb-name>
    <local-home>com.ProductHomeLocal</local-home>
    <local>com.ProductLocal</local>
    <ejb-class>com.ProductBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Product</abstract-schema-name>
         <cmp-field><field-name>productId</field-name></cmp-field>
    <cmp-field><field-name>brandName</field-name></cmp-field>
    <cmp-field><field-name>productDescription</field-name></cmp-field>
    <cmp-field><field-name>purchasePrice</field-name></cmp-field>
    <cmp-field><field-name>category</field-name></cmp-field>
    <primkey-field>productId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
              <query>
                   <query-method>
                        <method-name>findProduct</method-name>
                        <method-params>
                        <method-param>com.CategoryLocal</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>
                        SELECT OBJECT(p) FROM Product p.category = ?1
                   </ejb-ql>
              </query>
         </entity>
    </enterprise-beans>
    <relationships>
                   <ejb-relation>
                   <ejb-relation-name>Category-Product</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>
                             Category-has-many-Product-numbers
                        </ejb-relationship-role-name>
                        <multiplicity>one</multiplicity>
                        <relationship-role-source>
                             <ejb-name>CategoryEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>productNumbers</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>
                             Product-belongs-to-Category
                        </ejb-relationship-role-name>
                        <multiplicity>many</multiplicity>
                        <cascade-delete/>
                        <relationship-role-source>
                             <ejb-name>ProductEJB</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>category</cmr-field-name>
                        </cmr-field>
                   </ejb-relationship-role>
              </ejb-relation>
    </relationships>
    <assembly-descriptor>
    <security-role>
    <role-name>Employees</role-name>
    </security-role>
    <method-permission>
    <role-name>Employees</role-name>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    <container-transaction>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>ProductEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>     
    Here is my weblogic-cmp-rdbms-jar.xml:
    <!DOCTYPE weblogic-rdbms-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
         <ejb-name>CategoryEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
         <table-map>
              <table-name>category</table-name>
              <field-map>
              <cmp-field>categoryId</cmp-field>
              <dbms-column>categoryID</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>categoryName</cmp-field>
              <dbms-column>categoryName</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>picture</cmp-field>
              <dbms-column>Picture</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>pictureWidth</cmp-field>
              <dbms-column>PictureWidth</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>pictureHeight</cmp-field>
              <dbms-column>PictureHeight</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>labelOn</cmp-field>
              <dbms-column>LabelOn</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>labelOff</cmp-field>
              <dbms-column>LabelOff</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>button</cmp-field>
              <dbms-column>Button</dbms-column>
              </field-map>
    </table-map>
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>
    </automatic-key-generation>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-bean>
         <ejb-name>ProductEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
         <table-map>
              <table-name>PRODUCT</table-name>
              <field-map>
              <cmp-field>productId</cmp-field>
              <dbms-column>productId</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>brandName</cmp-field>
              <dbms-column>brandName</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>productDescription</cmp-field>
              <dbms-column>productDescription</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>purchasePrice</cmp-field>
              <dbms-column>purchasePrice</dbms-column>
              </field-map>
              <field-map>
              <cmp-field>category</cmp-field>
              <dbms-column>categoryId</dbms-column>
              </field-map>
    </table-map>
         <!-- Automatically generate the value of ID in the database on inserts using sequence table -->
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>
    </automatic-key-generation>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-relation>
         <relation-name>Category-Product</relation-name>
    <weblogic-relationship-role>
    <relationship-role-name>Product-belongs-to-Category</relationship-role-name>
              <relationship-role-map>
    <column-map>
    <foreign-key-column>categoryId</foreign-key-column>
    <key-column>categoryID</key-column>
    </column-map>
              </relationship-role-map>
    </weblogic-relationship-role>
    </weblogic-rdbms-relation>
    </weblogic-rdbms-jar>
    Here is my productLocal.java:
    package com;
    import javax.ejb.CreateException;
    import javax.naming.NamingException;
    import java.util.Date;
    import java.util.Vector;
    import java.util.Collection;
    public interface ProductLocal extends javax.ejb.EJBLocalObject
         public Integer getProductId();
         public void setProductId(Integer productId);
         public String getBrandName();
         public void setBrandName(String brandName);
         public String getProductDescription();
         public void setProductDescription(String productDescription);
         public Double getPurchasePrice();
         public void setPurchasePrice(Double purchasePrice);
    public CategoryLocal getCategory();
         public void setCategory(CategoryLocal category);
    Here is my ProductBean.java:
    package com;
    import javax.naming.InitialContext;
    import javax.ejb.EntityContext;
    import javax.ejb.CreateException;
    import javax.naming.NamingException;
    import java.util.Date;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.Vector;
    import java.lang.Integer;
    public abstract class ProductBean implements javax.ejb.EntityBean
         public Integer ejbCreate(Integer id)
              this.setProductId(id);
              return null;
         public void ejbPostCreate(Integer id)
         //public abstract Integer getCategoryId();
    //     public abstract void setCategoryId(Integer categoryId);
         public abstract CategoryLocal getCategory();
         public abstract void setCategory(CategoryLocal category);
         public abstract Integer getProductId();
         public abstract void setProductId(Integer productId);
         public abstract String getBrandName();
         public abstract void setBrandName(String brandName);
         public abstract String getProductDescription();
         public abstract void setProductDescription(String productDescription);
         public abstract Double getPurchasePrice();
         public abstract void setPurchasePrice(Double purchasePrice);
         public void setEntityContext(EntityContext ec)
              System.out.println("ProductBean setEntityContext");
         public void unsetEntityContext()
              System.out.println("ProductBean unsetEntityContext");
         public void ejbLoad()
              System.out.println("ProductBean ejbLoad");
         public void ejbStore()
              System.out.println("ProductBean ejbStore");
         public void ejbActivate()
              System.out.println("ProductBean ejbActivate");
         public void ejbPassivate()
              System.out.println("ProductBean ejbPassivate");
         public void ejbRemove()
              System.out.println("ProductBean ejbRemove");
    What do I needed to do to fix this problem.
    Any hint or help would be greatly appreciated!!!
    Yours,
    Frustrated

    cmr field which is "category" in ur mapping , u can't use as cmp field in abstract schema mapping. just remove category from cmp field . and every thing is fine

  • Automation plugin: how to select a spot channel when 2 channels have the same name?

    I have a CMYK document opened in photoshop. In "CHANNELS" panel, I just added 2 spot colors with the same name "Sport Color 1".
    As I click any of the spot channel to select it, the "Listener" plugin will output some c++ code like below:
    SPErr PlayeventSelect(/*your parameters go here*/void)
         PIActionDescriptor result = NULL;
         DescriptorTypeID runtimeKeyID;
         DescriptorTypeID runtimeTypeID;
         DescriptorTypeID runtimeObjID;
         DescriptorTypeID runtimeEnumID;
         DescriptorTypeID runtimeClassID;
         DescriptorTypeID runtimePropID;
         DescriptorTypeID runtimeUnitID;
         SPErr error = kSPNoError;
         // Move this to the top of the routine!
         PIActionDescriptor desc0000000000003980 = NULL;
         error = sPSActionDescriptor->Make(&desc0000000000003980);
         if (error) goto returnError;
              // Move this to the top of the routine!
              PIActionReference ref0000000000001A48 = NULL;
              error = sPSActionReference->Make(&ref0000000000001A48);
              if (error) goto returnError;
              error = sPSActionReference->PutName(ref0000000000001A48, classChannel, "Spot Color 1");
              if (error) goto returnError;
         error = sPSActionDescriptor->PutReference(desc0000000000003980, keyNull, ref0000000000001A48);
         if (error) goto returnError;
         error = sPSActionControl->Play(&result, eventSelect, desc0000000000003980, plugInDialogSilent);
         if (error) goto returnError;
    returnError:
         if (result != NULL) sPSActionDescriptor->Free(result);
         if (desc0000000000003980 != NULL) sPSActionDescriptor->Free(desc0000000000003980);
         if (ref0000000000001A48 != NULL) sPSActionReference->Free(ref0000000000001A48);
         return error;
    You can see "PutName" add the channel name "Spot Color 1" to reference, and I think it will not work correctly if I add such code to my project since PS cannot differentiate the 2 channels only by name. Can anyone tell me if there's any other method for selecting spot channel? Thanks in advance.

    Hi
    Here is the something from docs tht you may find usefull.
    Tryusing index instead of name:
    SPAPI OSErr(*
    PutIndex )(PIActionReference ref, DescriptorClassIDdesiredClass, uint32 value)
    Puts an index into a reference (formIndex) along with the desired class for the reference.
    Unfortunately I dont have C++ here to try i just used definition from docs.
    Hope that this help.
    Regards,
    Momir Zecevic
    Ars Media
    www.arsmedia.tv

  • Custom fields with the same name in Project Online

    Today I discovered something interesting when creating custom fields in Project Online.
    I usually create a certain set of custom fields that are useful to have on both the project and the task level. An example of these is Reportable, which I use to determine which tasks to roll up into reports and also which projects overall to report on.
    So I created a project level custom field called Reportable. No problem.
    I then created a custom field on the task level called Reportable. And the computer said no!
    I then learned that although you could do this in Project Server 2013, you can't in Project Online. You can't have duplicate custom field names, even if they are of different types.
    This has led me to use a naming standard, such as Reportable Task and Reportable Project. But I really don't like that as codes are for computers, not us humans. So I hope this changes in the future, but for now you just need to think about how you approach
    the fields.
    Good luck!
    Ryan Darby
    National Manager PMO
    www.ipmo.com.au
    www.projectonline.com.au

    Hi Ryan,
    I would follow Ben on this..
    Just made a test on a Project 2013 instance on-premise and I cannot create a task ECF and a project ECF with the same name. The same test on a Online instance returns the same result: the ECF names must be unique whatever the entity is.
    Waiting for Ben's confirmation.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Two Domain Controllers with the Same Name

    So I was working on setting up our new branch office DC. Anyway, the server failed to join the domain the first time because it upgraded the AD schema (This was our first 2012 R2 server) and the schema wasn't synced to all the other remote offices. So I
    forced a sync, joined the server as a workstation, then made it a domain controller.
    Anyway, after that the server would show itself as a DC in Active Directory, but all the other servers believed it was just a workstation. So, I removed Active Directory from the server (I had to force the removal). I reset the computer account on the local
    DCs, then rejoined it to the domain and made it a domain controller again. This time, it appeared as a Domain Controller on the other DCs in the domain.
    Now for the issue --- I've now got two objects for the server under AD Sites and Services. One of them doesn't appear to have any AD DS connections. The other has connections, but not all of them work correctly (I get errors when I tell certain connections
    to sync).
    What should I do to fix this?
    I'm still in the setup phase of this, so I can do anything I want with this particular server. I was thinking I would demote from a Domain Controller, remove it from the domain. Then use ntdsutil to cleanup any other metadata that is hanging around in AD (Something
    like: https://support.microsoft.com/KB/216498?wa=wsignin1.0 )
    Does anyone else have suggestions on what I should do to fix this? --- I'm being overly cautious here as I do not want to mess anything up in Active Directory.
    Thanks!
     

    I have not done a metadata cleanup.... I was asking if I should.
    The connections on the valid server appeared to be working before I deleted them (Maybe it took a while to replicate ? )
    So I went through and deleted all the AD Sites and Services connections from both servers (The broken server had 5 connections to the same DC in another site). Anyway, I ran repadmin /kcc and it regenerated a connection to a server in the remote site, but
    it also generated a connection between the two servers with the same name. I ran dcdiag after I did the repadmin /kcc. Anyway it shows:
    Directory Server Diagnosis
    Performing initial setup:
    Trying to find home server...
    Home Server = DC-01-CLE
    * Identified AD Forest.
    Done gathering initial info.
    Doing initial required tests
    Testing server: Cleveland\DC-01-CLE
    Starting test: Connectivity
    ......................... DC-01-CLE passed test Connectivity
    Testing server:
    Cleveland\DC-01-CLE\0ACNF:203cf49f-8cb3-4915-b122-be31ddd6e10e
    Starting test: Connectivity
    [DC-01-CLE\0ACNF:203cf49f-8cb3-4915-b122-be31ddd6e10e]
    DsBindWithSpnEx() failed with error 5,
    Access is denied..
    Got error while checking LDAP and RPC connectivity. Please check your
    firewall settings.
    DC-01-CLE\0ACNF:203cf49f-8cb3-4915-b122-be31ddd6e10e failed test
    Connectivity
    Doing primary tests
    Testing server: Cleveland\DC-01-CLE
    Starting test: Advertising
    ......................... DC-01-CLE passed test Advertising
    Starting test: FrsEvent
    ......................... DC-01-CLE passed test FrsEvent
    Starting test: DFSREvent
    ......................... DC-01-CLE passed test DFSREvent
    Starting test: SysVolCheck
    ......................... DC-01-CLE passed test SysVolCheck
    Starting test: KccEvent
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:02
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:02
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:02
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:11
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:11
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 09:58:11
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 10:03:37
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 10:03:37
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    A warning event occurred. EventID: 0x80000785
    Time Generated: 12/15/2014 10:03:37
    Event String:
    The attempt to establish a replication link for the following writable directory partition failed.
    ......................... DC-01-CLE passed test KccEvent
    Starting test: KnowsOfRoleHolders
    ......................... DC-01-CLE passed test KnowsOfRoleHolders
    Starting test: MachineAccount
    ......................... DC-01-CLE passed test MachineAccount
    Starting test: NCSecDesc
    ......................... DC-01-CLE passed test NCSecDesc
    Starting test: NetLogons
    ......................... DC-01-CLE passed test NetLogons
    Starting test: ObjectsReplicated
    ......................... DC-01-CLE passed test ObjectsReplicated
    Starting test: Replications
    ......................... DC-01-CLE passed test Replications
    Starting test: RidManager
    ......................... DC-01-CLE passed test RidManager
    Starting test: Services
    ......................... DC-01-CLE passed test Services
    Starting test: SystemLog
    A warning event occurred. EventID: 0x00001795
    Time Generated: 12/15/2014 10:03:37
    Event String:
    The program lsass.exe, with the assigned process ID 600, could not authenticate locally by using the target name LDAP/a23a13d0-8434-4344-bd6b-24fdf5576329._msdcs.mydomain.local. The target name used is not valid. A target name should refer to one of the local computer names, for example, the DNS host name.
    ......................... DC-01-CLE passed test SystemLog
    Starting test: VerifyReferences
    ......................... DC-01-CLE passed test VerifyReferences
    Testing server:
    Cleveland\DC-01-CLE\0ACNF:203cf49f-8cb3-4915-b122-be31ddd6e10e
    Skipping all tests, because server
    DC-01-CLE\0ACNF:203cf49f-8cb3-4915-b122-be31ddd6e10e is not responding to
    directory service requests.
    Running partition tests on : DomainDnsZones
    Starting test: CheckSDRefDom
    ......................... DomainDnsZones passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ......................... DomainDnsZones passed test
    CrossRefValidation
    Running partition tests on : ForestDnsZones
    Starting test: CheckSDRefDom
    ......................... ForestDnsZones passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ......................... ForestDnsZones passed test
    CrossRefValidation
    Running partition tests on : Schema
    Starting test: CheckSDRefDom
    ......................... Schema passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ......................... Schema passed test CrossRefValidation
    Running partition tests on : Configuration
    Starting test: CheckSDRefDom
    ......................... Configuration passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ......................... Configuration passed test CrossRefValidation
    Running partition tests on : mydomain
    Starting test: CheckSDRefDom
    ......................... mydomain passed test CheckSDRefDom
    Starting test: CrossRefValidation
    ......................... mydomain passed test CrossRefValidation
    Running enterprise tests on : mydomain.local
    Starting test: LocatorCheck
    ......................... mydomain.local passed test LocatorCheck
    Starting test: Intersite
    Doing intersite inbound replication test on site Cleveland:
    ......................... mydomain.local passed test Intersite
    I've attached a screenshot of AD Sites and Services. Please note I've erased some info for privacy reasons (The site the other DC is in has been erase as well as part of its name).
    Picture of AD Sites and Services

  • Two Cube dimensions with the same name.

    Hi
    If I have a cube dimension that has the same name as another cube dimension, will this be an issue when quering the cube through 1) Excel 2) SSRS or Cognos Reports?
    For instance: The Database dimension DimOrganization exists in cube A as well as
    DimOrganization_Dep. Both dimension has the same attribute names and the same hierarchy names.
    Their database names are different. (object_ID and Object_name differs) 
    In the cube I change the name of DimOrganization_Dep to DimOrganization.
    This seem to work when I query the cube in Excel, the mdx looks like this;
    SELECT NON EMPTY { [Measures].[AntalNotNull] } ON COLUMNS, NON EMPTY { ([Dim Organization].[Yes- No].[ Yes- No].ALLMEMBERS * [Dim Organization].[Yes- No].[Yes- No].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME
    ON ROWS FROM [TEST] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
    Anyone knows if this kind of setup will result in problems when quering from SSRS reports or Cognos?
    And/or if even though I get it right in the cube (quering from Excel) it might as well give me the wrong result the next time?
    Cheers
    /Martin

    Hi
    Thanks for the reply.
    I have tried and yes I can change then cube dimension namn to that of another cube dimension.
    For instance if i have Cube Dimension "DimA" and "DimB" to begin with , then  I change the name of the cube dimension "DimB" to "DimA". So now I have two Cube dimensions with the same name.
    It works to deploy and process and Excel somehow understands which one is which.
    Both is present in the same cube as you can see from the MDX above.
    The tricky part is how does the mdx return the correct result when the mdx looks like this (and it dpoes return the correct result).?
    Cheers
    /Martin

  • [CS3 JS] Working with two documents of the same name

    I work with sets of documents that use standardized names. I'm trying to write a script that compares two documents from different sets. Because the source and the target documents both have the same name, I've encountered some disturbing behavior that reminds me of the app.activeWindow bug that Dave has written about. (
    Dave Saunders, "Scripting FAQ as Wiki" #14, 15 Oct 2007 12:19 pm)
    To perform the comparison, I have to grab a reference to the same region of text in both documents, as offset from regular landmarks. I was just patting myself on the back for figuring out the "story.characters.itemByRange(begin, end).texts[0]" acrobatics required, when I discovered that my text objects were magically "dissolving" into invalid objects.
    After a lot of debugging and attempts to hack around the problem (i.e. storing the text begin/end indices and not grabbing the text object until the last possible moment), I've narrowed it down to the references to the source and target documents. I've watched the reference variable to the source document *change* to instead reference the target document when I start accessing the target document object. Once this happens, any text objects belonging to the source document become invalid, as if the source document had been closed.
    Is there any way around this? I've thought about temporarily saving the files to different names, but I haven't tried it yet.
    Here's a script that demonstrates the problem (you'll have to find your own same-named documents if you want to run it):
    var source = "/Users/deyk/Desktop/test/source";
    var target = "/Users/deyk/Desktop/test/target";
    function findChapters(in_doc) {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.appliedCharacterStyle = "chapter-num";
    app.findGrepPreferences.findWhat = "\\d+";
    return in_doc.findGrep();
    var sdoc = app.open(File(source+"/01.Genesis.indd"));
    var s_file_start = sdoc.fullName;
    var s_chs = findChapters(sdoc);
    var s_story = s_chs[0].parentStory;
    var s_txt = s_story.characters.itemByRange(s_chs[0].index,
    s_chs[1].index-1).texts[0];
    var tdoc = app.open(File(target+"/01.Genesis.indd"));
    // At this point, sdoc now references tdoc instead.
    // s_txt, s_story, and s_chs become invalid objects.
    var t_file_start = tdoc.fullName;
    var t_chs = findChapters(tdoc);
    var t_story = t_chs[0].parentStory;
    var t_txt = t_story.characters.itemByRange(t_chs[0].index,
    t_chs[1].index-1).texts[0];
    var s_file_end = sdoc.fullName;
    if (s_file_end.name != s_file_start.name) {
    var result = "What a nasty bug!";
    "Finished";

    I've tried saving the document to a temporary name, and it works satisfactorily:
    function openFileAsTemp(a_file) {
    var tmp_folder = Folder.temp.fullName;
    var date = new Date();
    var temp_file = File(tmp_folder+'/'+date.valueOf()+'_'+a_file.name);
    var doc = app.open(a_file);
    doc = doc.save(temp_file);
    return doc;

  • Multiple documents with the same Name

    We had a problem reported where an xquery to the xml db returned multiple records. Upon reading the full db (getAllDocuments) and printing each document's name we found out that all the documents had the same the same Name!!!
    We are using 2.3.10
    This is very disturbing as we depend on the uniqueness of the Name heavily.
    Any ideas on how this could happen?
    What information would you need?
    Code used to dump data
    Message was edited by:
    user626230

    Hi,
    Are you using all of the patches to 2.3.10? You should be, or better yet, use 2.3.11. There was a bug that could be involved that is fixed in 2.3.11. Others have seen duplicate documents but the root cause has never been 100% identified.
    Be sure that you are aborting your deadlocked transactions properly.
    Is this issue reliably reproducible in any way? If so, I'd be very interested in a test case or working with you to figure out what sequence of events causes it.
    Regards,
    George

Maybe you are looking for

  • Problem in Microsoft Excel 2007 when opening XLS from content library

    Hi gurus, I'm facing the following problem. When we try to open an Excel template that we have in our content library a message appears. The message is: The file you are trying to open " showfile.aspx" is in a different format than specified by the f

  • How to Export Snapshots and Materlized View in Oracle 9i

    Hi, How to Export Snapshots and Materlized View in Oracle 9i . I require to Migrate from 9i to 10g with either Export or Script. Please help

  • Not able to navigate Catalogs in BCC

    Step1: Login to bcc Step2: Clicked on Catalogs tab in left navigation. Seen the below on popup. java.sql.SQLSyntaxErrorException: ORA-00904: "T1"."VERSION_DELETED": invalid identifier [++SQLQuery++] SELECT COUNT(DISTINCT t1.folder_id)   FROM dcs_gen_

  • Help:how to use addAttachment method in NormalizedMessage

    i have a problem about the NormalizedMessage's addAttachment method ,it is below: public void addAttachment(java.lang.String id, javax.activation.DataHandler content) throws MessagingException i have a string .i want to transfer it to a certain SE as

  • P875-S7200 Hourglass icon flashes on and off

    Satellite P875-S7200, just purchased at Best Buy. The hourglass icon next to the pointer flashes off & on continuosly. Any suggestions to fix this? Thanks