Problem in returning the object + reflection + hashMap + list

Hi All,
i am very new to java forums...
i'm sorry to disturb you all.. i don't exaclty know how to raise a question in forums..
Here my query is ::::
i have xlsReader file,which will read the data from the xls file.
after reading it,i am adding the contents of the xls sheet in to a Arraylist.
then i've put the list contents in to an object array,
then i'm invoking the getter and setter method of the javabean class.
and i'm returning object,but object contains only the last data of the list,instead of whole contents in that object.
the code is here,where am returnung the object.
kindly do reply...
Thanks in advance...:)
public static Object setDynamicValue ( Method setter2, List columnData, Object obj2 , Method getter2 )
Object val2=null;
try {
for ( int i = 0 ; i < columnData.size() ; i++ ) {
Object obj[] =( Object [] )columnData.get(i);
for ( int j = 0; j < obj.length; j++) {
// System.out.println("column Data:pppp: :"+obj[j].toString());
setter2.invoke(obj2, new Object[] {obj[j].toString() });
val2 = getter2.invoke(obj2, new Object[0]);
//System.out.println("output:::"+val2.toString());
// return val2;
System.out.println("#########################");
}catch (IllegalAccessException e) {
System.out.println("IllegalAccessException came :::"+e);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
System.out.println("IllegalArgumentException came :::"+e);
e.printStackTrace();
} catch (InvocationTargetException e) {
System.out.println("InvocationTargetException came :::"+e);
// TODO Auto-generated catch block
e.printStackTrace();
return val2;
here,we are returning the object val2 , but its printing only the last data of the list
Object o1 = setDynamicValue ( setter2, columnName ,columnData, obj2,getter2 );
System.out.println("lastvalue of the list :"+o1);
thanks...
plz reply..

You are getting only the last data of the list because you does not have any mechanism to hold other values.
Check inf your code your the following code in the inner for loop (loop with index j)
val2 = getter2.invoke(obj2, new Object[0]);
Even if you are capturing some value into val2, it gets replaced next time the body of for loop runs. This way you are getting only the last data.
If you want to capture all values use arraylist. Keep adding all values to arraylist and return it. While printing iterate over arraylist and print values.
This is not a problem related to reflection or hashMap. Just the logic you have written is incorrect.

Similar Messages

  • Problem in Configuring the Object Editor User Interface

    Hi,
         I m using NetWeaver 7.0.11 & facing the problem in Configuring the Object Editor User Interface.In the Configuration Browser ,when i click on Object Editor & choose New Configuration & try to select service,it shows the flollowing error:
    com.sap.caf.rt.exception.CAFBaseRuntimeException: Service manager initialization failed Illegal argument exception: Unable to create javax.ejb.EJBObject.
         at com.sap.caf.rt.ui.cool.generic.ServiceFacade.init(ServiceFacade.java:121)
         at com.sap.caf.rt.ui.cool.generic.ServiceFacade.<init>(ServiceFacade.java:50)
         at com.sap.caf.rt.ui.cool.generic.ServiceFacadeFactory.getFacadeInstance(ServiceFacadeFactory.java:51)
         at com.sap.caf.ui.utils.cool.CoolUtils.getServiceFacade(CoolUtils.java:123)
         at com.sap.caf.ui.ptn.objecteditor.ObjectEditorCC.getServiceFacade(ObjectEditorCC.java:505)
         at com.sap.caf.ui.ptn.objecteditor.wdp.InternalObjectEditorCC.getServiceFacade(InternalObjectEditorCC.java:245)
         at com.sap.caf.ui.ptn.objecteditor.config.OEconfiguratorLayout.onActionSelectModule(OEconfiguratorLayout.java:322)
         at com.sap.caf.ui.ptn.objecteditor.config.wdp.InternalOEconfiguratorLayout.wdInvokeEventHandler(InternalOEconfiguratorLayout.java:300)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Can anybody please tell,what can be the problem?
    regards
    Sumit

    Hello Sumit
    This is most probably the result of metadata corruption on runtime.
    A possible workaround for this situation is:
    Undeploy all the metadata DCs of all the CAF applications you have
    deployed (these are the components which names end on "/metadata", excl.
    caf/core/metadata and caf/tc/metadata (which are part of CAF itself)).
    And then deploy the CAF applications again.
    Regards,
    Désiré

  • Toplink does not return the object sometimes - VeryHigh Volume application

    Hi All,
    Toplink version: 10.1.3.4, OAS 10.1.3.4, Oracle 10g, RedHat linux 4.0
    We have a high volume application where toplink issues one of our queries like 25K times/hour.Query is a simple one querying the table based on the primary key(Id) that should return 1 object.
    This query is not returning the object sometimes I should say like 200 times/hour. What bothers me is that the same query on the same Id(primary-key) returns the object another time.
    I did enable the toplink logging level to FINE where I could see the SQL query getting issued to the DB, I was unsuccessful in changing the logging level to ALL to check if the object is getting returned by the toplink layer and being registered in the cache kind of details.
    This is not easily re-producable as this only occurs in our Pre-Prod environment where we can simulate high volume. This completely baffles me and I am running out of ideas.
    Thanks in advance.
    -Ram
    Edited by: Raam on Jun 4, 2009 7:41 PM

    If you are configured for an isolated cache then there should be no concurrency issues. Each thread will query the database directly and load the object into the UnitOfWork. Is there an Exception handler configured on TopLink? Are you getting a timeout exception or some other exception that is being ignored?
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem in transporting the objects from Q to P

    Hi,
    I am trying to transport ds, is, DSO from Q to P. But it ended with errors. Below are the error messages.
    Extract structure ZOXDS20119 is not active
    The extract structure ZOXDS20119 of the DataSource ZDS_BILLCHANGE is invalid
    ZDS_BILLCHANGE is created in BW itself using View with Generic extraction. So please update me how I can solve this problem.

    hi,
    Send you DS in a separate TR to P and then replicate you datasource in P.
    Then send the objects in other request so that i will not fail again.

  • Transport landscape problem (cannot change the object)

    Hi All,
    I have problem to change my object in the integration repository.
    Initially, i only have 1 XI server (dev and prod), until certain level that i have to add additional server for development. So i just install new xi in new box (fresh). and export the repository object form production and import into this new box.
    But the problem is i can't change all the object. is that any workaround to change the configuration so i can use my nex box become development and later on transport back all the changes to original production box.
    Appreciate if you can give me some advise.
    Thank you and Best Regards
    Fernand

    Hi,
    If you need to change anything in repository
    you need to click on the software component in IR
    and at the bottom of the screen you will find two checks
    that will allow (or not) you to change objects
    if you want to change anything in communication channel
    you just need to go to change mode
    you can change anything in ID
    Thanks
    Swarup

  • Problem while returning the subcontracting materials.

    Dear All,
    i have received finished material A (10 pcs) from subcontractor (BOM maintained B- 200 pcs and c- 300pcs to manufacture A).
    Due to quality rejection i am returning 1 pc of finished material "A" to the subcontractor. When i return through MIGO with 122 mvmt type system will display entire quantity ,ie 10 pcs, against the material document number.  Now i reduce the returned quantity of finished material as 1 pc, but subsequently BOM materials (components) are not getting reduced.
    please advise how to reduce the components propotionate with finished product while returning the subcontracting items.
    Eg : A received 10 pcs ( BOM- B=200& C= 300)
          returned 1 pc of A,  then system should show the components B =20 & C=30. but system shows B=200& C=300.

    Hi,
    As per your suggestions, system does not allow to do Component reversal 542 movement. How ever system will check the special stock provided to vendor 0. All the component from vendor side consumed and recived GR already for the components B and C.
    The following Error message occurs while doing 542 MVMT:
    Deficit of Stock w. vendor unr. 20,000 PC : B1 TEST O
    Message no. M7021
    Diagnosis
    Shortfall below the specified stock level or quantity amounting to 20,000 PC.
    System Response
    If the message is an error message (E), the above is not allowed.
    If the message is a warning message (W), the system will allow your input, but the warning is intended to prevent you entering a wrong quantity.
    Procedure
    In the case of a warning message, check the quantity entered.
    In the case of an error message, change the quantity or terminate processing.
    Other Possible solution,  I  have simulated
    Return delivery and refer material document number
    Manually change the Material A ( With 122 mvmt - qty as 1 ) With Reason for movement
    And Sub component as B ( 544 O + GI receipt subc.stck ) with qty 20, similarly Sub component C ( 544 O + GI receipt subc.stck ) with qty 30) 
    Finally you can check with MMBE ( Finished product A- 9 qty) MBLB - Stock provided to vendor Component B -20  and C-30 qty
    I hope this with return the Finished product and consumed subcomponents respectively.
    While doing Return delivery for against Material document system always with full qty and BOM qty only, We will manually change returnable qty to the vendor and Reason for the return in any business process flow.
    I hope this solution resolved your issues on Return process subcontracting
    Even after the Returned the goods  to the Vendor ( due to damaged - reason ) ( with 122 and 544 O+) . Later supplier finished his re -work for the returned goods / services , you can do it regular GR against PO number with as usual subcontracting receiving process ( 101 and 543 O-)
    Regards,
    Thiru
    Edited by: thiru on May 5, 2010 11:48 AM
    Edited by: thiru on May 5, 2010 11:49 AM
    Edited by: thiru on May 5, 2010 11:53 AM
    Edited by: thiru on May 5, 2010 11:55 AM
    Edited by: thiru on May 5, 2010 12:02 PM

  • Problem in tagging the object to Transport Request

    Hello Experts,
    I have installed 0FISCVARNT using BI Content, but when i try to change the package of the standard object and save it under TR, it is not allowing me to change the package from local class.
    Please provide me any suggestions, if you have any.
    Thanks
    PT

    Hi PT,
    What are all the steps you have tried I am not aware of, but you can try following options.
    1) Goto SE03 transaction, on the left hand side tree you have the option "Change object directory entry". Select that option put eh object type as R3TR IOBJ and your info object name. Just execute and you should be able to change the package from local to any other transportable package.
    2) Go to RSD1 and give info object name, goto change option and I am not remembering in the EDIT or menu beside EDIT you will have the option to change the  "Object Directory Entry", there also you can change package from local to transportable package.
    Regards,
    Durgesh.

  • Error while activating the object from change list in IR

    Hi Friends,
    I am trying to activate a mapping object taken from History.But I am getting error "version management was unable to execute the last action because temporary internal lock has been set" while activating from change list.
    Regards,
    Suresh.

    Hi Suresh,
    have a look at the integration builder start jsp. There is a Link "Administration". On this page, on the left side, you can click on "lock overview" and check if your object is locked. Then you can remove this lock.
    Best Regards
    Sven

  • Form.GetAsXML does not return the object data

    I have created a form that have text boxes  and drop down list objects
    I have entered some data in the text boxes and made selection from the drop down list
    I used the form.GetAsXML to save the form as xml
    I loaded the form from the xml , the form loaded fine , however the data did not
    Is there a way to save the form data entered in the form objects (such text box, drop down list) as xml
    if not, is there way to alter the xml to display the data
    I altered the xml file and changed the following for one the item (text box)
    <specific TabOrder="5" >
    to
    <specific TabOrder="5" value ="My Data">
    also
    from
    <specific TabOrder="5" >
    to
    <specific TabOrder="5" string="My Data">
    also
    from
    <specific TabOrder="5" >
    to
    <specific TabOrder="5" caption="My Data">
    No Luck
    Any hint
    Sincrely yours
    Riade Asleh

    Hi Riade,
    To handle data using XML, refer to SDK Help -> Developer's Guide -> DI API -> How To -> Exchanging Data Through XML. There are methods available on Company object as well as all Business Objects.
    <ValidValues> element can be used to populate the ComboBox list. Refer to SDK Help -> Developer's Guide -> UI API -> How To -> Adding Forms with XML -> click on <ValidValues> link
    Regards
    Aravind

  • Problem to access the object attribute in a code

    Hi guys,
    I need to pass the attribute of a business object to class.Below is the code but its throwing an error 'There is no component ZYBTT in l_bus2000116'.Since the business object conatins the attribute but its throwing an error.Could any one throw some light on the below code -
    data: l_BUS2000116 type swc_object,
          Z_BRF_Function_name TYPE FDT_UUID.
    swc_get_element ac_container 'Z_Quotation' l_BUS2000116.
    swc_get_element ac_container 'Z_BRF_Function_name' Z_BRF_Function_name.
    CALL METHOD ZYCLOTO_AGENTDTMT_BRF=>ZYOTOM_GET_AGENT_IDS_SING_LEV
      EXPORTING
        IM_FUNCTION_ID  = Z_BRF_Function_name
        IM_BTT          = l_BUS2000116-ZYBTT
       IM_COMPL_CAT    =
       IM_COUNTRY_CODE = ZYCOUNTRY
        IM_LEAD_BRAND   = l_BUS2000116-leadbrand
        IM_RISK_LEVEL   = l_BUS2000116-ZYRISKLEVEL
        IM_SALES_ORG    = l_BUS2000116-ZYsalesorg
        IM_TCV          = l_BUS2000116-ZYTCV.
    IMPORTING
       EX_FULL_NAME    =
       EX_RETURN       =

    Hi,
    Is ZYBTT a new attribute? Have you changed the status of the attribute to implemented or released (in SWO1: Edit -> Change release status)?
    And actually I think that your syntax is wrong too (BOR world is different compared to classes). If you want to use an attribute, I think that the syntax should be something like this:
    SWC_GET_PROPERTY <Object> <Attribute> <AttributeValue>.
    Read more here:
    http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4acef453d11d189430000e829fbbd/content.htm
    Regards,
    Karri

  • Problem in transporting the objects(very urgent)

    hello Experts,
    I have saved my tables , domains,data elements and programs in local object.Now i want to tranport into production server,For that i have to save this objects in some request.How to do that.Please give me the solution .
    Thanks in advance
    regards,
    Ashok.

    hi,
    Please follow below steps to handle the same:
      1. Go to Transaction: SE10.
      2. Create a new workbench request by using key F6.
      3. Double on the newly created request
      4. Add a new entry: R3TR,TABU,<table> for Program Id, Object Type and Object Name Respectively.
      <table> being the table name for which the contents are to be transported.
      5. Click on Function icon next to table name.
      6. Click the contents from the icons in next screen.
      7. Select entire table.
      8. In next screen we can select required entries to be transported.
      9. Come back and save.
    10. Now release the request and transport to the required server.
    Rgds
    Anver

  • Problem in Hiding the objects in Forms

    Hi
    I have a requirement to use a standard Adobe form & Interface. In which i need some fields should be binded with custom objects and some should objects needs to be hidden form the form based upon the condition. I did the logic for the Hidden part through the condition tab in the form. When i execute the form, some objects are not hidden. can i know how can we do it.
    Moderator message: wrong forum, please have a look in the forum for "Adobe Interactive Forms".
    Edited by: Thomas Zloch on Apr 8, 2011 10:54 AM

    Hi there,
    Please check whether the correct data is mentioned in the Properties, also check whether the operator is assigned to it. Check whether there is proper data is passed into the global data at its Interface.
    I don't thing so, you are directly using the Standard form. for satisfying this requirement you might have created custom one.

  • Problems with returning the license

    I bought a a VLM agreement with licenses, and 2 of the computers crashed how can I return these 2 licenses back to the available pool being as the computers are un-available?

    For the initial version of ALM Adobe has established a process to recover lost e-licenses via customer service. In the event of lost licenses (hard drive crashes, lost or stolen laptop, etc.), customers can call customer service and e-licenses will be added to the pool indicated by the customer (corresponding to the number lost).
    Future versions of ALM will enable for self-service and auto-detection/recovery of lost e-licenses.

  • Problem in saving the objects(urgent)

    hi experts,
      I have saved my objects in one request number.Now i want to save the same object in some other request number how to do that.Please provide the solution.
    thanks n regards,
    Ashok.

    Hello Ashok
    If your objects are workbench objects then they can be locked only in a single transport request.
    However, if you want to shuffle objects from one request to another (perhaps they belong together but have been separated into different request by accident) then you can merge the two requests into a single request (transaction SE10): use menu <b>Utilities -> Reorganize -> Merge Request</b>
    Regards
       Uwe

  • Facing problem while using the objects

    hi im new user here . and i have download the so many objects. but i dont know how to use them in dreamweaver and where i shud paste them to use in my website kindly someone help me in this regard i will be really thankfull to you. i will wait for your kind replies

    Please post in the Dreamweaver forum.

Maybe you are looking for

  • Updating to ios 8.1.3 causes error 3212

    Hi all I run on Windows 7 and an iPhone 5, which has all worked OK on previous versions of ios 8- so when prompted via iTunes to update to ios 8.1.3-  I downloaded and installed successfully, but after that I tunes came up with 'istore couldn't be re

  • Credit card

    last night i  put my credit card and i was want to buy weapons bundle in the last of us remastered so i put in my funds 10 dollar but my wallet is 0 and i don't want to buy the weapons anymore so my question is if there is in my funds 10 dollar and i

  • Content Player / Policy Configuration component login modules

    Problem using Content Player u2013 HTTP 401 errors, not authorized Because of security concerns, we have modified our login Policy Configuration component, u201Cticketu201D to no longer use the login module u201CBasicPasswordLoginModuleu201D. We use

  • Integration with JAZN

    Hi! I have implemented a contract-first web service using Spring-WS, and would like to authenticate towards the OC4J JAZN Jaas security provider. Is it possible to integrate with JAZN by accessing the JAAS api directly? I have set up my own realm in

  • Cloud access for second line

    When I access Verizon cloud, it only reports information for one of my phone lines; I have two in my name.  It is especially important today because my phone has died. How does one access a line on an account with multiple lines--it always reports on