Problems overcome in implementation

Hi Viewers,
Im new to SAP BW. I want what type of issues had overcome at the time of implementation projects.especially in BW. I worked as a ABAP consultant .currently im looking for BW.kindly do needful.
Thanks & Best regards,
kalyan

Hi Kalyan,
This is a purely general question which cannot be answered.
First of all search the forum for your information.
For your information;
The issues that can be faced are the Design problems, BI content installation Problems, Data integrity, integration with different servers, Connections of the servers, Data source creation, report management, and more & more...
the above points are in general ...
With Regards,
Ravi Kanth

Similar Messages

  • Problem instatiating factory implementation when invoking a service in java

    Hello,
    I' have the following problem: When I invoke a service from java code (it is a customized policy step implementation of a server agent), I get the following exception (some part of the error message description is german because it's a german versin of the SOA Suite, my translations are in []):
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration [Configuration]: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet [This load was introduced/caused with/by method Class.forName() on...].
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar [The missing class is available in the following location]:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar [This source code is available in loader oracle.jwsdl:10.1.3].
    : oracle.classloader.util.AnnotatedClassNotFoundException:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet.
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at java.lang.Class.forName0 (Native method) [unknown, by unknown]
         at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at javax.wsdl.factory.WSDLFactory.newInstance (WSDLFactory.java:75) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.jwsdl:10.1.3]
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel (WSDLModeler.java:137) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel (ModelInfo.java:167) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel (ServiceInfoBuilder.java:196)
    at ... ...
    at ... ...
    Here is the relevant part of my source code:
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    // create service
    Service service = null;
    try{
         service = factory.createService(wsdlLocation, serviceName);
    // HERE (the line above) the exception is thrown!!!!
    catch (Exception e) {
    Does anybody have an idea what the reason for this problem is and how I can fix it?
    Thank you very much,
    Stefan

    Hello,
    I had to add the information, which jar-file has to be used, into the build.xml that is used by the ant script.
    Now the missing class problem is solved, but now there is another (similar) problem:
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.: oracle.webservices.wsdl.WSDLFactoryImpl: java.lang.ClassCastException: oracle.webservices.wsdl.WSDLFactoryImpl
    at javax.wsdl.factory.WSDLFactory.newInstance(WSDLFactory.java:77)
    at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137)
    at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:167)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:196)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:199)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:181)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:114)
    at oracle.j2ee.ws.client.dii.ConfiguredService.<init>(ConfiguredService.java:54)
    at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:43)
    at customsteps.StefansAspektStep.invokeService(Unknown Source)
    Any ideas? Do I have to set some System properties? What is the reason for this class cast error?

  • Problem with Queue Implementation

    Hi there !
    I can't solve the implementation of an exercize about Queue.My teacher wrote down just the interface Queue and the first part of the class ArrayQueue implementation.They are the following :
    public interface Queue<E>
       public int size();
       public boolean isEmpty();
       public E front() throws EmptyQueueException;
       public void enqueue (E element);
       public E dequeue() throws EmptyQueueException;
    public class ArrayQueue<E> implements Queue<E>
       public ArrayQueue(int cap)
          capacity = cap;
          Q = (E[]) new Object[capacity];
       public ArrayQueue()
          this(CAPACITY);
    }So the teacher asked to complete the code. I have tried and retried so many times for 3 days.I know it's so easy and I understood how it should work but when I try to write down the code I can't get the final solutions but only mistakes.
    During my attempts my better code was this :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
            int count = 0;
            for(E element : Q)
                 return count +")"+(String)element;
            count++;
            return null;
         public void enqueue(E element)
              try
                   if(element == null)
                        throw new IllegalArgumentException();
                   if (size() == capacity)
                     throw new FullQueueException();
                   if(Q[rear] == null)
                      Q[rear] = element;
                      rear++;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
                 E temp;
                 if (isEmpty())
                      Q = (E[]) new Object[capacity];
                      front = 0;
                      rear = 0;
                     throw new EmptyQueueException();
                temp = Q[front];
                 Q[front] = null;
                 front++;
                 return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
                 if(Q[front] == null)
                           front++;
                 if (isEmpty())
                     throw new EmptyQueueException();
                 return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Full !");
              return null;
         public int size()
              return (front + rear);
         public boolean isEmpty()
            return (front == rear);
        public Object[] getQueue()
            return Q;
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front = 0;
         protected int rear = 0;
    }But the problems are that I can add the element through the method enqueue() and delete it through dequeue() then,but after deleting it the array size is the same and when I print the array elements I see some null,so if I add a new element I get the message of the class FullQueueException because of the size which it's the same.
    Moreover if I delete all the elements and then I print the value returned by the method front() I get the NullPointerExceptionError because the returned value is null,but I think it should print it ! But he doesn't!
    How should I fix these problems ?
    I also wondered during all my attempts how to repeat this procedure after the array size limit is reached.What I really mean is if I delete the element Q[0] and the index front = 1 and rear = n - 1 for example,how can I add with the method enqueue() a new element in Q[0] again ?
    Can you help me courteously ?
    I hope my explanation was clear because of my English !
    Thanks in Advance !

    Thanks for all your suggestions men ^^ !
    I changed some things in the code :
    package queue;
    public class ArrayQueue<E> implements Queue<E>
         @SuppressWarnings("unchecked")
         public ArrayQueue(int cap)
            capacity = cap;
            Q = (E[]) new Object[capacity];
         public ArrayQueue()
            this(CAPACITY);
         public String toString()
              String s = "[";
              int count = 0;
              for (int i = front; i < rear; i++) {
                   count++;
                   s += Q.toString() + (i < rear - 1 ? "," : "");
              s += "] (" + count + " elements)";
              return s;
         public void enqueue(E element)
              try
                   if (size() == capacity - 1)
              throw new FullQueueException();
                   Q[rear] = element;
                   rear = (rear + 1) % capacity;
              catch (FullQueueException e)
                   System.out.println("The Queue is Full !");
         public E dequeue() throws EmptyQueueException
              try
              E temp;
              if(isEmpty())
              throw new EmptyQueueException();
         temp = Q[front];
              Q[front] = null;
              front = (front + 1) % capacity;
              return temp;
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public E front() throws EmptyQueueException
              try
              if (isEmpty())
              throw new EmptyQueueException();
              return Q[front];
              catch(EmptyQueueException e)
                   System.out.println("The Queue is Empty !");
              return null;
         public int size()
              return (capacity - front + rear) % capacity;
         public boolean isEmpty()
    return (front == rear);
         protected int capacity;
         public static final int CAPACITY = 1000;
         protected E Q[];
         protected int front;
         protected int rear;
    }Now after I delete an element and I use the method enqueue() to add a new one the algorithm does,but
    after I delete all the elements I get an element null when I add the element in the array position n - 1.
    I have fixed the method toString() as pgt told me to do and it's really great,but dunno why sometimes when I delete an element it says the array has 0 elements also if the array is almost full !
    About my code changements,according to my university friend I should reduce front and rear mod the capacity and that's what marlin314 suggested me to do too and I had to change the expression if(size() == capacity) to if(size() == capacity - 1).But the algorithm doesn't work as it should do !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • New functionality in ECC 6.0 and problems during sap implementation

    Dear Gurus,
    may i know the details of the New functionality in ECC 6.0 on (MM,SD,PP,QM,PS,HR,PM,FI/CO,BI,XI,DMS ) or what is the problems coming at the time of implementation of ECC 6.0.
    THANKS AND REGARDS
    RS

    Ritesh,
    Question is bit confusing
    may i know the details of the New functionality in ECC 6.0 on (MM,SD,PP,QM,PS,HR,PM,FI/CO,BI,XI,DMS )
    That means you are going to upgarde from some earlier version .what is that version ?
    Then you might find some specific information at
    https://websmp102.sap-ag.de/uda -
    >Upgrade Dependency Analyzer
    what is the problems coming at the time of *implementation* of ECC 6.0.
    If its a new implemenation you will  not face problem , but you need to configure everything accordingly.
    Problem depends upon what all you are using from standard and customizing.
    Above provided link will help you.
    Just add up
    http://wiki.sdn.sap.com/wiki/display/ERPLO/NewfunctionalityinECC6.0%28+MM%29
    Regards,

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

  • Problem in ECO implementation : Revised Item already implemented

    Hi,
    I have created a custom package to Implement the ECO changes in all the organizations where the target BOM exists. Previously I had only one inventory organization and this package was implementing the changes correctly.
    But currently, we have created another Inventory organization, the problem is the ECO implementation is occurring for any one of the either organizations.
    In this course, it is failing with the above given errors for the 2nd organization.
    Entity Id: XX
    Index: 1
    Mesg: The revised item YYYY has already been implemented.
    Entity Id: XX
    Index: 1
    Mesg: This record received a fatal error since a fatal error occured in revised item YYYY while checking if the user has access to it.
    Entity Id: XX
    Index: 1
    Mesg: This record received a fatal error since a fatal error occured in revised item YYYY while checking if the user has access to it.
    Entity Id: XX
    Index: 1
    Mesg: An error occured while processing business object ABC in organization XY. Please check the data in this business object and re-run the import process.
    Please suggest if there is any thing missing in the set up or whether this is any technical pl/sql related issue.
    Thanks,
    Anwesha

    Try and logout and login and run again.
    Or try and see in debug mode why its not reading the BREAK;

  • Problem with WM_ENHANCMENT implementation

    Hi all,
    I deeply need to use  throughout transaction LT04 (Create Transfer Order from TR) the BADI
    WM_ENHANCMENT wich would allow me to export and record some essential data along with the saving and creation of the order,
    I don't expressly use the existing user exit EXIT_SAPLL03T_001 as it doesn't work within that transaction.
    Problem is I can't find a proper way to implement WM_ENHANCMENT Badi,
    Sure thing it doesn't provide the classic implementation mode in SE18 (Implement.->Create) stopping message is:
    "BAdI definition WM_ENHANCMENT is only provided for SAP internal use",
    Beside: no way to Implementation by using enhancement spot, and/or copying interfaces, classes so on, may be I'm not taking properly the required steps, (I'm still not used to build Badi's implamentation by new way),
    Please; Does anybody would provide me the true goods step by step moves to implement this perculiar Badi from SE18 or SE19, (I repeat the classic Badi impl. can't be done),
    Many thanks in advance,
    Sergio,

    Hi Chauxu, actually I didnu2019t try to use that BADI yet, as we ran for a temporary different solution, at present we schedule a custom program wich goes alone for all new created orders and fill in
    additional data we need, anyway I think I'll give some afford to modify that badi when lu2019ll gett some moment,
    Goodbye,
    Sergio,

  • Facing problem inside the implementation of ActionListener

    Hi, I don't understand what the problem is. Please go through the following code. The explanation of the problem is documented.
    Any kind of help is appreciated.
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JOptionPane;
    * Class Test is intended for receiving a String input from the user and
    * manipulating the input string later in some other methods. So the input
    * string has to be stored for later use.
    * Whenever an action takes place in JTextField or JButton (OK button) component,
    * the corresponding ActionListener's actionPerformed() method assigns the
    * user input to 'userInput' referene variable. This was assured when I placed
    *              JOptionPane.showMessageDialog(frame, userInput);
    * right after the assignment statement. But when I cut and pasted the above
    * statement right after the getUserInput() method call (in constructor's body)
    * it showed null string.
    * WHY & HOW this happens?
    * I could have implemented this application with the help of JOptionPane's
    * showInputDialog() method. But I just want to know what the problem is if
    * I have tried in this way.
    public class Test {
         * String that the user types
        private String userInput;
         * Text field that contains the user input.
        private JTextField inputTextField;
         * Frame that contains all other components
        private JFrame frame;
        public Test() {
            prepareFrame();
            getUserInput();
            // shows null, why?????
            JOptionPane.showMessageDialog(frame, userInput);
            // some other methods goes here that uses the input string....
            // methodA();
            // methodB();
         * Creates the frame and sets some of its properties.
        private void prepareFrame() {
            frame = new JFrame("Experiment with ActionListener");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(500, 300);
            frame.setVisible(false);
         * Receives user input and stores the reference to user input in userInput.
        private void getUserInput() {
            // Create sub-components
            JLabel promptLabel = new JLabel("Enter a string: ");
            inputTextField = new JTextField(20);
            JButton okButton = new JButton("OK");
            JButton cancelButton = new JButton("Cancel");
            // Add listeners
            inputTextField.addActionListener(new TextFieldHandler());
            okButton.addActionListener(new OkButtonHandler());
            cancelButton.addActionListener(new CancelButtonHandler());
            // Create a panel to contain the sub-components
            JPanel panel = new JPanel();
            // Add the sub-components to the panel
            panel.add(promptLabel);
            panel.add(inputTextField);
            panel.add(okButton);
            panel.add(cancelButton);
            frame.add(panel, BorderLayout.NORTH);
            frame.validate();
            frame.setVisible(true);
         * Event handler for text field that contains user input.
        private class TextFieldHandler
                implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                userInput = event.getActionCommand();
                // works fine if the user input is shown here.
                // JOptionPane.showMessageDialog(frame, userInput);
         * Event handler for OK button
        private class OkButtonHandler
                implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                userInput = inputTextField.getText();
                // works fine if the user input is shown here.
                // JOptionPane.showMessageDialog(frame, userInput);
         * Event handler for Cancel button
        private class CancelButtonHandler
                implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                System.exit(0);
        public static void main(String[] args) {
            new Test();
    }

    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JOptionPane;
    public class T {
        private String userInput;
        private JTextField inputTextField;
        private JFrame frame;
        public T() {
            prepareFrame();
            getUserInput();
            // shows null, why?????
            // userInput is null because it has not been given a value
            // you can give it a value in the declaration as a member
            // variable above or here in your class constructor
            System.out.println("userInput = " + userInput);
            JOptionPane.showMessageDialog(frame, userInput);
            // some other methods goes here that uses the input string....
            // methodA();
            // methodB();
        private void prepareFrame() {
            frame = new JFrame("Experiment with ActionListener");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(500, 300);
            frame.setVisible(false);
        private void getUserInput() {
            // Create sub-components
            JLabel promptLabel = new JLabel("Enter a string: ");
            inputTextField = new JTextField(20);
            JButton okButton = new JButton("OK");
            JButton cancelButton = new JButton("Cancel");
            // Add listeners
            inputTextField.addActionListener(new TextFieldHandler());
            okButton.addActionListener(new OkButtonHandler());
            cancelButton.addActionListener(new CancelButtonHandler());
            // Create a panel to contain the sub-components
            JPanel panel = new JPanel();
            // Add the sub-components to the panel
            panel.add(promptLabel);
            panel.add(inputTextField);
            panel.add(okButton);
            panel.add(cancelButton);
            frame.add(panel, BorderLayout.NORTH);
            frame.validate();
            frame.setVisible(true);
        private class TextFieldHandler implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                // userInput is given a value here so it is no longer null
                userInput = event.getActionCommand();
                // works fine if the user input is shown here.
                System.out.println("userInput = " + userInput);
                JOptionPane.showMessageDialog(frame, userInput);
        private class OkButtonHandler implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                // userInput is given a value here so it is no longer null
                userInput = inputTextField.getText();
                // works fine if the user input is shown here.
                System.out.println("userInput = " + userInput);
                JOptionPane.showMessageDialog(frame, userInput);
        private class CancelButtonHandler implements ActionListener {
            public void actionPerformed(ActionEvent event) {
                System.exit(0);
        public static void main(String[] args) {
            new T();
    }

  • Problem with SQLData implementation

    Hi,
    I am facing a problem while retrieving an ARRAY.
    I am using jdbc thin driver 8.1.7.1 (patched version) to connect to the 9i Database(9.0.1.2.0).
    Code:
    public class Employee implements SQLData
         public int iEmpNumber;
         public String strName;
         Address[] objEmpAddress;
         String sql_type="APPS.EMPLOYEE";
         public Employee()
         public String getName()
              return strName;
         public Employee(int iEmpNumber,String strName,Address[] objEmpAddress)
              try
                   this.iEmpNumber=iEmpNumber;
                   this.strName=strName;
                   this.objEmpAddress=objEmpAddress;
              }catch(Exception e){}
         public String getSQLTypeName() throws SQLException
         return sql_type;
         public void readSQL(SQLInput stream, String typeName)
         throws SQLException
              sql_type =typeName ;
              iEmpNumber = stream.readInt();
              strName = stream.readString();
              Array b=stream.readArray();
    ****Here I am getting b as null**********************************
    Object[] d=(Object[])b.getArray();
              Address[] e=new Address[d.length];
              for(int i=0;i<d.length;i++)
                   e=(Address)d[i];
              objEmpAddress=e;
         public void writeSQL(SQLOutput stream)
         throws SQLException
              try{
              OracleConnection conn=(OracleConnection)DriverManager.getConnection ("jdbc:oracle:thin:@nandini:1510:crp","sadas", "asd");
              stream.writeInt(iEmpNumber);
              stream.writeString(strName);
              ArrayDescriptor desc = ArrayDescriptor.createDescriptor("APPS.ADDTABLE",conn);
              ARRAY a=new ARRAY(desc,conn,objEmpAddress);
              stream.writeArray(a);
              }catch(Exception e){ System.out.println("Exception Occured in writeSQL of Employee"+e);}
    Any suggestion would be greatly helpful.
    Thanks and Regards,
    Ramesh Jetty.

    Hi Curt,
    I could do that also but this would sort of defeat the purpose of taking advantage
    of using the DB Control in Workshop. The DB Control is supposed to take care
    all of the DB connection logic for us.
    Bao.
    "Curt Smith" <[email protected]> wrote:
    >
    That tact I would have take wuold have packaged the std logic to get
    initialcontext
    and lookup on my other conn pool JNDI name. I can't imagine why this
    tact would
    fail.
    What's your thoughts?
    curt

  • How to solve a problem related with implementing Inheritance?

    Hello,
    So i come on this way to ask for help about implementing Inheritance on my application. So the problem is:
    I am making a Application which i need to capture audio and that analyze that capture by Spectrum Analyzer, Volumes etc.
    And I will use several microphones in this application so i will use same code in capturing audio.
    I have a class called Application which has the GUI and the events, like button events and update the values in the GUI. In my first version of the Application i had everything here but i don´t like that and is not good for the performance so i want to divide the code by other classes. Thats why i am trying the Inheritance.
    So i created a class called Equipment which is the superclass and in this class will have the method captureAudio(), calculateRMSLevel(), sendOutPresenceUpdates() etc.. And i have 3 variables:
    public abstract class Equipment {
        public AudioFormat format;
        public TargetDataLine line;
        public Mixer mixer;
        public EventListenerList listenerList = new EventListenerList();
        public Equipment(AudioFormat format, TargetDataLine line, Mixer mixer){
            this.format = format;
            this.line = line;
            this.mixer = mixer;
        public AudioFormat getFormat() {
            return format;
        public void setFormat(AudioFormat format) {
            this.format = format;
        public TargetDataLine getLine() {
            return line;
        public void setLine(TargetDataLine line) {
            this.line = line;
        public Mixer getMixer() {
            return mixer;
        public void setMixer(Mixer mixer) {
            this.mixer = mixer;
         public int calculateRMSLevel(byte[] audioData){
         // audioData might be buffered data read from a data line
            long lSum = 0;
            for(int i=0; i<audioData.length; i++)
                lSum = lSum + audioData;
    double dAvg = lSum / audioData.length;
    double sumMeanSquare = 0d;
    for(int j=0; j<audioData.length; j++)
    sumMeanSquare = sumMeanSquare + Math.pow(audioData[j] - dAvg, 2d);
    double averageMeanSquare = sumMeanSquare / audioData.length;
    return (int)(Math.pow(averageMeanSquare,0.5d) + 0.5);
    public void sendOutPresenceUpdates(int FullJIDAndResource, String NewPresence) {
         Object[] listeners = listenerList.getListenerList();
         Integer inputValue = _FullJIDAndResource;
         String convertedValue = inputValue.toString();
    // Empty out the listener list
         // Each listener occupies two elements - the first is the listener class and the second is the listener instance
    for (int i=0; i < listeners.length; i+=2) {
              if (listeners[i]==CustomPresenceListener.class) {
                   ((CustomPresenceListener)listeners[i+1]).presenceEventOccurred(new CustomPresenceEvent(this, convertedValue, _NewPresence));
    public void listenForPresenceEvents(CustomPresenceListener _listener) {
              listenerList.add(CustomPresenceListener.class, _listener);
    public void removeEventListener(CustomPresenceListener _listener) {
              listenerList.remove(CustomPresenceListener.class, _listener);
    public void captureAudio(){
    And i have questions about the constructor, is right the constructor that i created in the superclass?
    So i create a subclass called Microphone1 and in this class i make override from the method captureAudio() from the superclass and here i create the thread for the capture.class Microphone1 extends Equipment{
    public Microphone1(AudioFormat format, TargetDataLine line, Mixer mixer){
    super(format,line,mixer);
    public void captureAudio(){
    try{
    format = getFormat();
    Mixer.Info[] mixerInfo =AudioSystem.getMixerInfo();
    //DataLine.info get the information about the line.
    DataLine.Info info = new DataLine.Info(TargetDataLine.class,format);
    Mixer mixer = AudioSystem.getMixer(mixerInfo[3]);
    // get the info from the desired line.
    line = (TargetDataLine)AudioSystem.getLine(info);
    //Get a TargetDataLine on the selected mixer.
    line = (TargetDataLine) mixer.getLine(info);
    line.open(format);
    line.start();
    CaptureThread captureThread = new CaptureThread();
    captureThread.start();
    } catch (Exception e) {
    System.out.println(e);
    System.exit(0);
    }//end catch
    But now i have a problem in the class Application, because i want to start the capture when i click in the button so i created the actionPerfomed and inside of this event i create this:Microphone1 m1 = new Microphone1(format,line,mixer);
    m1.captureAudio();
    But when i execute the application and click in the button appears this: java.lang.NullPointerException :/ and i don't know how to solve this.
    Any help? Where i am wrong?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hello Kayaman,
    Well thinking in that way is not good creating the Microphone1 object every time i click in the button.
    So i put e.printStackTrace in the catch block the show me this error:
    java.lang.NullPointerException
    at com.sun.media.sound.Toolkit.isFullySpecifiedAudioFormat(Toolkit.java:137)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:98)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:139)
    at App.Microphone1.captureAudio(Microphone1.java:42)
    at App.Application.startBtnActionPerformed(Application.java:529)
    at App.Application.access$000(Application.java:29)
    at App.Application$1.actionPerformed(Application.java:152)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6267)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6032)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    at App.Microphone1.captureAudio(Microphone1.java:42):
    This error is about this line: line.open(format);at App.Application.startBtnActionPerformed(Application.java:529): m1.captureAudio();:/

  • Problems with List Implementation

    I have a list implementation that is like a linked list but contains 'n' elements in each node, set to 8 by default.
    The list has a head node, and a tail node.
    This is a revisit on an assignment, I'm trying to fix it.
    The problem is when a number of elements have been added and then deleted from the end of the list. Then more elements are added.
    I'm using a JUnit test case to test this, and what happens is about 25 elements are added and removed, but when it gets to adding a new elements after recently deleting some items towards the end of the list. My list fails because, I am unable to assign value to my tail from within my iterator.
    The compiletime error I get is:
    Type mismatch: cannot convert from chunklist.ChunkList<T>.Chunk<T> to chunklist.ChunkList<T>.Chunk<T>
    I need to assign my tail to the previous Chunk (node), because in my iterator when I delete a Chunk the tail doesn't get automatically assigned to the previous.
    Anyone know how I can get around this retarded error? or what I can do to solve my problem?
    Edit: casting to Chunk<T> doesn't work either it's the same compiletime error
    I have deleted all irrelevant methods and comments from this: The error is in the deleteChunk() method. I need to point tail back to the previous node there.
    package chunklist;
    import java.util.AbstractCollection;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.NoSuchElementException;
    public class ChunkList<T> extends AbstractCollection<T>
        @SuppressWarnings({ "unchecked", "hiding" })
        private class Chunk<T>
            private T[] data;
            private Chunk<T> next;
            private int chunkSize;
            public Chunk()
                this.data = (T[])new Object[ARRAY_SIZE];
                this.next = null;
                this.chunkSize = 0;
            public boolean equalsChunk(Chunk<T> c)
                if (c == null)
                    return false;
                else if (this.chunkSize != c.chunkSize)
                    return false;
                else if (this.next != c.next)
                    return false;
                else
                    for(int i=0; i<this.chunkSize; ++i)
                        if (!(this.data.equals(c.data[i])))
    return false;
    return true;
    }// end of Chunk<T>
    @SuppressWarnings({ "hiding", "unchecked" })
    private class ChunkItr<T> implements Iterator<T>
    private Chunk<T> currentChunk;
    private Chunk<T> previousChunk;
    private Chunk<T> nextChunk;
    private int currentElement;
    public ChunkItr()
    currentChunk = (Chunk<T>) head;
    previousChunk = null;
    nextChunk = (Chunk<T>) head.next;
    currentElement = 0;
    @Override
    public boolean hasNext()
    if (currentChunk == null)
    return false;
    else
    if (currentElement < currentChunk.chunkSize)
    return true;
    return (currentChunk.next != null);
    @Override
    public T next()
    if (!hasNext())
    throw new NoSuchElementException();
    T elementToReturn = null;
    while (elementToReturn == null)
    if ((currentElement == ARRAY_SIZE) ||
    (currentElement == currentChunk.chunkSize))
    previousChunk = currentChunk;
    currentChunk = currentChunk.next;
    currentElement = 0;
    if (nextChunk != null)
    nextChunk = currentChunk.next;
    if (currentChunk.data[currentElement] != null)
    elementToReturn = (T) currentChunk.data[currentElement];
    ++currentElement;
    return elementToReturn;
    @Override
    public void remove()
    if (currentChunk == null)
    throw new IllegalStateException();
    else
    for (int i=currentElement-1;i<currentChunk.chunkSize;++i)
    { // shift everything down
    if ( (i != 7) && (i >= 0) )
    currentChunk.data[i] = currentChunk.data[i+1];
    else if (i==7)
    break;
    currentChunk.data[currentChunk.chunkSize-1] = null;
    --currentChunk.chunkSize;
    --numOfElements;
    --currentElement;
    if (currentElement < 0)
    currentElement = 0;
    if (currentChunk.chunkSize <= 0)
    deleteChunk();
    public void deleteChunk()
    if (previousChunk == null) //* @head *//
    if (head.next != null)
    head = head.next;
    currentChunk = (Chunk<T>) head;
    nextChunk = currentChunk.next;
    currentElement = 0;
    else currentElement=0;
    else if (nextChunk == null) //* @tail *//
    currentChunk = previousChunk;
    currentChunk.next = null;
    nextChunk = currentChunk.next;
    currentElement = currentChunk.chunkSize;
    tail = currentChunk; // THIS DOESN'T WORK, << ERROR HERE
    else //* @middle *//
    currentChunk = currentChunk.next;
    previousChunk.next = currentChunk;
    nextChunk = currentChunk.next;
    currentElement = 0;
    // back @ head? (just deleted Chunk before head)
    if (currentChunk.equalsChunk((Chunk<T>) head))
    previousChunk = null;
    } // end ChunkItr
    private static final int ARRAY_SIZE = 8;
    private Chunk<T> head;
    private Chunk<T> tail;
    private int numOfElements;
    public ChunkList()
    head = null;
    tail = null;
    numOfElements = 0;
    public void addNewChunk()
    if (head == null)
    head = new Chunk<T>();
    tail = head;
    else
    tail.next = new Chunk<T>();
    tail = tail.next;
    @Override
    public boolean add(T t)
    if (t == null)
    throw new IllegalArgumentException();
    if (head == null)
    addNewChunk();
    if (tail.chunkSize == ARRAY_SIZE)
    addNewChunk();
    tail.data[tail.chunkSize] = t;
    numOfElements++;
    tail.chunkSize++;
    return true;
    @Override
    public Iterator<T> iterator()
    return new ChunkItr<T>();
    @Override
    public boolean remove(Object o)
    // creates iterator and calls iterators remove method when it finds o.
    Edited by: G-Unit on Nov 14, 2010 5:07 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    YoungWinston wrote:
    Possibly, but I suspect you'll need to be prepared to defend your design choice with more than just test results. Why did you choose this pattern? Because it's an assignment. I will do some reading when I get around it to it. But for now I don't have time, and don't care to make time. This assignment was annoying as... So many fiddly little errors that took me too long to figure out. For now I hate Lists, I'm happy using the default ones.
    1. Introduction
    This document is the Project Specification for a ChunkList class to be developed by DBSD202 students this semester.
    2. What you must do
    The requirements specifications are detailed below:
    ChunkList
    In this first part of the assignment we will create a data structure called a ChunkList. The ChunkList class implements the Collection interface and >>serves a replacement for ArrayList or LinkedList. A ChunkList is like a regular linked list, except each node contains a little fixed size array of elements >>instead of just a single element. Each node also contains its own "size" int to know how full it is.
    The ChunkList will have the following features...
    The ChunkList object contains a head pointer to the first chunk, a tail pointer to the last chunk, and an int to track the logical size of the whole >>collection. When the size of the list is 0, the head and tail pointers are null.
    Each chunk contains a fixed size T[] array, an int to track how full the chunk is, and a next pointer. The constant ARRAY_SIZE = 8; in the chunk >>class defines the fixed size of the array. Elements should be added to the array starting at its 0 index. The elements in each little array should be >>kept in a contiguous block starting at 0 (this will require shifting elements around in the little array at times). (You may want to do some testing >>with ARRAY_SIZE set to smaller values, but turn it in set to 8.)
    ChunkList should be a subclass of AbstractCollection which provides some basic facilities built on top of your add(), iterator(), size() etc. primitives. >>Chunk should be an inner class defined inside of ChunkList. Only ChunkList will see or use the Chunk class directly. It's stylistically ok if ChunkList >>accesses the state (.next, .data, ...) of the Chunk objects, since Chunk essentially is just an integrated part of ChunkList. Add utility methods to >>Chunk where it helps to keep things receiver-
    relative (remove for example). ChunkIterator should be a private inner class as in the lecture example.
    ChunkList must support the messages: constructor, add(), size(), and iterator(). The iterator must support hasNext(), next(), and remove(). It's >>valid for the client to add "null" as an element, so you cannot use null as some sort of special marker in the array -- use your size int in each chuck. >>Make sure that size() and hasNext() are consistent about the size of the collection.
    The empty collection should be implemented as null head and tail pointers. Only allocate chunks when actually needed.
    The add() operation should add new elements at the end of the overall collection -- i.e. new elements should always go into the tail chunk. If the >>tail chunk is full, a new chunk should be added and become the new tail. We are not going to trouble ourselves shifting things around to use >>empty space in chunks in the middle of the list. We'll only look at the tail chunk.
    Do not use a dummy node because (a) it does not help the code much, and (b) dummy nodes are lame.
    Keep a single "size" variable for the whole list that stores the total number of client data elements stored in the list, so you can respond to size() in >>constant time. Similarly, keep a separate size in each chunk to know how full it is. Likewise, add(), hasNext(), next(), and remove() should all run in >>O(1) constant time (they may do computations proportional to ARRAY_SIZE, but not proportional to the overall collection length).
    When using iterator.remove() to remove an element from a Chunk, overwrite the pointer to that element with a null to help the garbage >>collector. This is not a requirement, but it's a nice touch.
    When an iterator.remove() operation causes a chunk to contain zero elements, that chunk should be removed from the list immediately. The code >>for deletion is quite tricky. You may store a "previous" pointer in each chunk if you wish. It is possible to code it without previous pointers by >>keeping extra pointers in the iterator to remember the two previously seen chunks during iteration. Chunk deletion will need to work for many >>boundary cases -- the first chunk, the last chunk, and so on. This is probably the trickiest part of the whole thing.
    When called with correct inputs, ChunkList should return the correct result. However, when called with incorrect inputs -- e.g. iterator.remove() >>without first calling next() -- ChunkList does not need to do anything in particular. It's fine if
    your code just gives the wrong output or throws a null pointer or other exception. This is a slight relaxation of the formal Collection interface which >>guarantees to throw particular exceptions for particular errors.
    ChunkList Advice — Tight Code
    The ChunkIterator is a tricky bit of code. There are about 4 different cases to get right, depending on if the removed chunk was first or last in the >>list. Don't have a separate copy of the remove code for each special case. If you find yourself copying and pasting code, you're doing it wrong. >>Clean up the solution so there is one copy of the remove code and then a few lines to deal with the special cases. This is just general coding style >>advice – avoid proliferating copies of the code for slightly different cases. Try to factor the code down so one copy of the code deals with many >>cases. The remove() method should be about 15 lines long.
    Testing
    The ChunkList is extremely well suited to unit-testing. This is good, since the ChunkList has such a large number of tricky little boundary cases >>where it can go awry. We will unit-test the ChunkList aggressively, since it's the best way to get the code right.
    1. ChunkList Basic Testing
    To get started, write some basic unit tests that build up a ChunkList of Strings with add(), and then iterate over it and remove a few elements, >>checking that the list look right before and after the removes. These tests will get the most basic add()/iterator()/remove() code working.
    2. ChunkList Super Test
    I will provide code for an extremely aggressive test on the ChunkList. Only try this after your basic tests are working. Because the ArrayList (known >>to be correct) and the ChunkList both implement the Collection interface, we can use a unit-test strategy where we do the same operation on >>both an ArrayList and ChunkList, and then verify that they get the same output after each operation.
    The SuperTest creates both an ArrayList and a ChunkList. We'll call an "operation" either a single addition or an iteration down the collection doing >>a few random removes. Do the same random operation to both the ArrayList and ChunkList, and then check that the two look the same, element >>by element. Then loop around and do that 4999 more times, checking the two again after each random operation. We want to push on the >>ChunkList
    to get every weird combination of list length and this or that chunk being full or empty at the time of add or series of removes in some position.
    When you get it take a look at the SuperTest code. It creates a Random(1) for its random number generation, object passing 1 as the seed. In >>this way, the series of "random" operations is the same every time the test is run.
    3. ChunkList SpeedTest
    The unit-tests should work on the correctness of the ChunkList, and that's the most important thing. Look at the source of the provided >>ChunkSpeed class and try running it. It runs a timing test on the ArrayList, LinkedList, and ChunkList classes. The test is a crude simulation of >>collection add/remove/iterate use. ChunkSpeed prints the milliseconds required to do the following representative mix of operations...
    - Use add() to build a 50,000 element collection
    - Create an iterator to iterate halfway through the collection
    - Use the iterator to remove 10,000 elements at that point
    - Creates and runs iterators to run over the whole collection 5 times
    The speeds seen depend on many factors, including the ARRAY_SIZE, the specific hardware, the system load, JVM version, etc., and some runs >>will be way off because the GC thread runs during part of the test. Broadly speaking, on average the ChunkList should be roughly as fast or faster >>than the LinkedList, and a lot faster (a factor of 10 or so) than the ArrayList. The speed numbers have a lot of noise in them, so don't worry about >>a single run. The ChunkList might be slower than the LinkedList on occasion. However, if your ChunkList is consistently slower than the Linked List >>or ArrayList, there is probably something wrong with your ChunkList algorithm -- some operation that is supposed to be O(1) is O(n). The most >>important methods to be fast are hasNext() and next(), since they are the most commonly called by the client.Edited by: G-Unit on Nov 15, 2010 7:31 AM
    Edited by: G-Unit on Nov 15, 2010 7:44 AM

  • What problems faced during implementation BW projects few eg:  Please

    Hi BWers,
    Please, can you give me some examples regarding
    " what problems you faced during implementation of BW projects.
    Thanks
    points will be given with big heart.
    Again Thanks
    Regards
    Mubeen.

    Hi,
    Implementation issues
    Lifecycle Implementation
    http://help.sap.com/bp_biv170/documentation/SolutionScope_EN.doc
    http://help.sap.com/bp_biv235/BI_EN/documentation/BWProjectPlan_EN.mpp
    Details on the Implementation Phase
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/36177e645911d395fe00a0c94260a5/frameset.htm
    Hope this helps.
    Thanks,
    JituK

  • Problem in BPM implementation

    i have a scenario where BPM receives from ODS and sends a call to IDoc and then depending on the IDoc ack it is forwarded to RFC.
    according to this scenario my BPM looks like this:
    receivetransform1sendtoIdocswitchtransform2--sendRFC call
    in case of transform1 i have to give the source and destination message interface.But The destination message interface is of IDoc which is not to be created.
    so can any one help me implement this scenario.

    Hi Mudit,
    <i>in case of transform1 i have to give the source and destination message interface.But The destination message interface is of IDoc which is not to be created.</i>
    2 ways,
    1)For this you need to create an Abstract Interface of Idoc Type - create a External Definition for the Idoc type and then create an Absract Interface based on the External Definition
    2) Create a Message Mapping between Source and Idoc before it reach to BPM. So in the BPM you will get only Mapped Idoc Structure.
    Hope this helps,
    Regards,
    Moorthy
    Message was edited by: Krishna Moorthy P

  • Problem facing while implementing FSCM-Collections Management

    Hi,
    I am doing the FSCM-Collections Management implementation in my current project.I have implemented everything but i got struck up while bringing the"Customers in to Business Partners" (In collections management Business partners are nothing but Customers).
    Note: The requirement is -Once you bring the customers as business partners in Collections management module,What ever the changes you made to Customers in FI module,the same changes will be done in Collections management Business Partners also.
    So,now i am not able to Bring the Customers to Business Partners in Collections management.Kindly help me how can i bring the customers of FI into Collections Management.
    Thanks
    Supriya

    Have you tried FLBPD1 - transaction - creating business partner from customer?
    This transaction lives only udner Treasury and Risk Management > BP > Special Functions
    BTW, have you connected in config business partner with customers? Check the settings under cross application components and in Collection Mgt.
    Cheers
    Hein

  • Problem of customer_add_data implementation

    Hi Experts,
    I am quite new to BADI. I am trying to implement the Customer_Add_Data to add custom fields to Customer Master (XD01). I have done below steps following a struction from SDN:
    1. Create a customer screen group Z1 with one new tab label (1, Z1_TAB).
    2. Create an implementation of Customer_Add_Data and activated it. Put below codes on the method "Check_ADD_ON_Active"
    if i_screen_group = 'Z1'.
      e_add_on_active = 'X'.
    endif.
    3. Create an implementation of Customer_add_data_cs. etc.
    But I am not so lucky to see a new button appeared on the top of XD01 screen. How can I let this button visible? Any more steps I need to do for that?
    Thanks in advance.
    Yu

    solved.

Maybe you are looking for

  • Report Query with Bind variables working very slowly

    Hi everyone, I'm having a hard time with one of my Reports. Basically the query looks like this: Select * from x,y,z where x.lang_id = :P1_LANG and y.name = :P1_LANG; I have a textfield and a Select List on my Page which have to have a value before t

  • Restoring Backed Up files in the program from the Restore Disk 1

    My computer was having some serious issues so i decided to restore it but before that I chose to backup some of the files.  It (the program that came with my HP) gave me several options of things I could choose to back up like emails, documents, phot

  • Liquify Filter causing semi-transparent layers to become brightened

    Hi, I'm having an issue with the Liquify Filter's final results. When using the filter it works fine, and if I use the filter on a solid layer its results given back to the original image are perfect also. However, using the filter on a layer that ha

  • TCP/IP Library and Windows 7

    Hi together, I have the following problem: I am trying to build up TCP/IP connections as client. On my notebook (WindowsXP) everything works like a charm. But when I install the application on a Windows 7 PC, no connection is possible. ConnectToTCPSe

  • MacBook stuck at grey apple screen with spinning logo

    I have a 2010 White MacBook that is stuck at the grey apple screen with a spinning logo. This seems to have happened after I installed the newest version of iTunes. The system slowed down a lot and when I ran the system monitor It said all of the mem