A collection problem with TreeMap

Could somebody please help me with this kind of problem
I couldn't get the correct object from the get(key) method and all the objects in the map become the last object put in, when I use the followings:
Collection keys=this.keySet();
Iterator iter=keys.iterator();
while(iter.hasNext())
XX xx=(XX)this.get(iter.next());
But when I try to iterate the values instead of the keys, the objects are correct.
Collection values=this.values();
Iterator iter=values.iterator();
while(iter.hasNext())
XX xx=(XX)iter.next();
But I do need the get(key) method sometimes.
Anybody got some suggestions please.
Thanks.

Thanks.
I am using TreeMap. I actually don't want the keys to get overwritten, so the keys in the Map is comparable according to the counter.
There is a class extends TreeMap. I need to use another getElement method sometimes.
public class MyTree extends TreeMap{
public MyTree () {
public Element getElement(int id, double rate)
Collection values=this.values();
Iterator iter=values.iterator();
while(iter.hasNext())
Element ele=( Element)iter.next();
if(ele.isMe(id, rate))
return ele;
return null;
public String toString()
String eleString="";
Collection values=this.values();
Iterator iter=values.iterator();
while(iter.hasNext())
Element ele=( Element)iter.next();
eleString += ele.toString()+ "\n";
return eleString;
}

Similar Messages

  • Problem with TreeMap

    I had a problem that I believe was similar to this posting:
    http://forum.java.sun.com/thread.jsp?forum=24&thread=200558
    although mine involves a TreeMap. I am adding approximately 250 mappings to a TreeMap, where the key is a String. Each key is unique, and, just to be sure, I analyzed the hashCode of each key, and they were also unique.
    After adding all of the mappings, however, the total size of the TreeMap is only 40! Somewhere, app. 210 mappings were overwritten. I added some debug code and found that after I added the 10th element, the size of the TreeMap did grow. Then the TreeMap would grow only on every 3rd mapping that I would add.
    The above-referenced posting mentioned that the rehashing of the map might cause it to overwrite existing values, so it made sense to set the initial capacity high enough to ensure that no rehashing occurred. Unfortunately, that posting dealt with a HashMap, which allows you to set the initial capacity. TreeMaps do not. In order to mimic this behavior, I added all of the mappings into a HashMap with an initial capacity of 250. When the HashMap was loaded, I created the TreeMap (with a unique Comparator), and then used the putAll() method of TreeMap to put the entire HashMap into the TreeMap. Voila! All 250 mappings were there.
    Nonetheless, this seems to be a very strange bug with TreeMap. Does anyone know why this happened?

    Sorry. Figured out the problem. It was all my fault (based on the comparator I was using, which caused the keys to be overwritten). how dare I accuse Sun of deploying buggy software. :)

  • Garbage Collection problem with BI 4.0

    Hi experts,
    I've installed BI 4.0, the operating system is SUSE Linux. In the logging directory are several *._gc.log-Files:
    E.g. crproc_bobSIAN.CrystalReportsProcessingServer_child_gc.log:
    34.609: [Full GC [PSYoungGen: 8352K->2707K(86976K)] [ParOldGen: 33449K->33470K(49472K)] 41801K->36177K(136448K) [PSPermGen: 35
    487K->35460K(56640K)], 0.2510370 secs] [Times: user=0.25 sys=0.00, real=0.24 secs]
    39.664: [GC [PSYoungGen: 81283K->4033K(100544K)] 114753K->40232K(150016K), 0.0387570 secs] [Times: user=0.03 sys=0.02, real=0.
    04 secs]
    41.271: [GC [PSYoungGen: 91137K->14332K(101440K)] 127336K->51242K(150912K), 0.0316510 secs] [Times: user=0.02 sys=0.01, real=0
    .03 secs]
    47.628: [GC [PSYoungGen: 101436K->15431K(112320K)] 138346K->66686K(163712K), 0.0623110 secs] [Times: user=0.06 sys=0.01, real=
    0.06 secs]
    47.690: [Full GC [PSYoungGen: 15431K->12343K(112320K)] [ParOldGen: 51255K->51388K(73088K)] 66686K->63731K(185408K) [PSPermGen:
    63948K->63918K(96064K)], 0.5285130 secs] [Times: user=0.49 sys=0.04, real=0.53 secs]
    659.998: [GC [PSYoungGen: 107383K->14966K(114752K)] 158771K->66354K(187840K), 0.1000770 secs]
    or bobSIAN_gc.log:
    3542.210: [GC 3542.233: [DefNew: 20756K->925K(22208K), 0.0036560 secs] 54323K->34493K(71208K), 0.0037360 secs] [Times: user=0.00 sys=0.00, real=0.03 secs]
    3781.915: [GC 3781.942: [DefNew: 20701K->962K(22208K), 0.0031300 secs] 54269K->34530K(71208K), 0.0031840 secs] [Times: user=0.00 sys=0.00, real=0.03 secs]
    4081.483: [GC 4081.499: [DefNew: 20738K->981K(22208K), 0.0030550 secs] 54306K->34549K(71208K), 0.0031110 secs]
    It's also interesting, that I'm missing free space in the installation directory of Business Objects. There are no reports scheduled, but the directory still grows. Maybe it depends on problems with GC.
    Any idea? Is there a best practice, how to configure the jvm?
    Thanks and best regards,
    Max

    Hello Deepu,
    The current plan for BI OnDemand is to support BOE 4.0 in the 2012 timeframe.  We have not yet worked out a specific date for the release, though.  The specific upgrade plan and long term feature roadmap is still under discussion for BI OnDemand.  
    Regards,
    Terry Penner
    BI OnDemand Product Owner

  • A problem with treemap

    In a file, I have 400, 000 lines of data. There are around 16000 keys. Each key can have multiple values.
    eg:
    Key - Var1 - Var2
    5 - 132.1 - 0.678
    5 - 128.5 - 0.523
    2 - 110.0 - 0.253
    6 - 20.0 - 0.245
    I sorted using TreeMap. However, only 12463 keys gets added to TreeMap. I don't know what's wrong . If someone can help me out with this problem, that would be great!!!
    -Karthik

    So if you want to use the standard HashMap you have to deal with multiple keys yourself.
    One way is to first check if the key's already in the map. If it isn't you store the key/item pair as you do now. If the key's already in the map you switch to a collection of items using a collection, for example a LinkedList. The end result is that each key is uniqueande there are two types of items; single items and collections of items.

  • Collection problem with RFC function module WSDL.

    Hi.
    I have developed an RFC function module in a SAP system version 4.7 (WAS 620). This FM has 2 table parameters. I have no problem when I see the WSDL in the SAP Web Service Browser.
    Another team is trying to consume this RFC FM as a web service from a Java application but they say they can't see the table parameters as collections.
    Here is the WSDL of the FM, the table parameters are T_MOVIM and T_ERROR:
    <?xml version="1.0" encoding="UTF-8" ?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="urn:sap-com:document:sap:rfc:functions">
         <types>
              <xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions">
                   <xsd:element name="ZMMFUSAPTK_0001">
                        <xsd:complexType>
                             <xsd:all>
                                  <xsd:element name="GENIDOC" minOccurs="0">
                                       <xsd:simpleType>
                                            <xsd:restriction base="xsd:string">
                                                 <xsd:maxLength value="1" />
                                            </xsd:restriction>
                                       </xsd:simpleType>
                                  </xsd:element>
                                  <xsd:element name="T_ERROR">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0012" />
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                                  <xsd:element name="T_MOVIM">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0011" />
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:all>
                        </xsd:complexType>
                   </xsd:element>
                   <xsd:element name="ZMMFUSAPTK_0001.Response">
                        <xsd:complexType>
                             <xsd:all>
                                  <xsd:element name="CODRET">
                                       <xsd:simpleType>
                                            <xsd:restriction base="xsd:string">
                                                 <xsd:maxLength value="1" />
                                            </xsd:restriction>
                                       </xsd:simpleType>
                                  </xsd:element>
                                  <xsd:element name="T_ERROR">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0012" />
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                                  <xsd:element name="T_MOVIM">
                                       <xsd:complexType>
                                            <xsd:sequence>
                                                 <xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:ZMMTASAPTK_0011" />
                                            </xsd:sequence>
                                       </xsd:complexType>
                                  </xsd:element>
                             </xsd:all>
                        </xsd:complexType>
                   </xsd:element>
                   <xsd:complexType name="ZMMTASAPTK_0011">
                        <xsd:sequence>
                             <xsd:element name="REFERENCIA" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="FECHACONT" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="8" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="FECHADOC" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="8" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CODMOV" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="2" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="NROPLAN" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="12" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="NROCOMP" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CLASEMOV" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="3" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CENTRO" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="ALMACEN" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="MATERIAL" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="5" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="LOTE" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CANTIDAD" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="15" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="MOTIVOMOV" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CENTROREC" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="ALMACENREC" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CENTROCTO" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="ORDEN" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="12" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="TIPOSTK" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="1" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="NROPEDIDO" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CODCISTERNA" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="50" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="ZMMTASAPTK_0012">
                        <xsd:sequence>
                             <xsd:element name="REFERENCIA" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="10" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="CODERR" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="3" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                             <xsd:element name="MSJERR" minOccurs="0">
                                  <xsd:simpleType>
                                       <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="100" />
                                       </xsd:restriction>
                                  </xsd:simpleType>
                             </xsd:element>
                        </xsd:sequence>
                   </xsd:complexType>
              </xsd:schema>
         </types>
         <message name="ZMMFUSAPTK_0001Input">
              <part name="parameters" element="s0:ZMMFUSAPTK_0001" />
         </message>
         <message name="ZMMFUSAPTK_0001Output">
              <part name="parameters" element="s0:ZMMFUSAPTK_0001.Response" />
         </message>
         <portType name="ZMMFUSAPTK_0001PortType">
              <operation name="ZMMFUSAPTK_0001">
                   <input message="s0:ZMMFUSAPTK_0001Input" />
                   <output message="s0:ZMMFUSAPTK_0001Output" />
              </operation>
         </portType>
         <binding name="ZMMFUSAPTK_0001Binding" type="s0:ZMMFUSAPTK_0001PortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
              <operation name="ZMMFUSAPTK_0001">
                   <soap:operation soapAction="http://www.sap.com/ZMMFUSAPTK_0001" />
                   <input>
                        <soap:body use="literal" />
                   </input>
                   <output>
                        <soap:body use="literal" />
                   </output>
              </operation>
         </binding>
         <service name="ZMMFUSAPTK_0001Service">
              <documentation>SAP Service ZMMFUSAPTK_0001 via SOAP</documentation>
              <port name="ZMMFUSAPTK_0001PortType" binding="s0:ZMMFUSAPTK_0001Binding">
                   <soap:address location="http://dbades00.bue.bemberg.com.ar:8002/sap/bc/soap/rfc" />
              </port>
         </service>
    </definitions>
    Should I change something in the definition of the parameters of the FM? or the problem is with the parsing process on the other system?
    Thanks in advance.
    Fabian.

    Welcome to SDN.
    I am not sure about this particular issue, but i have used WSDL from WAS6.20 system in MS Office infopath to consume webservice where we have had table parameters without any issue.
    may be try with office infopath to make sure that the problem is with the WSDL or with the java application.
    Regards
    Raja

  • Problem with TreeMap and Vector

    Hello,
    this is the problem I have:
    I declare a Vector like this:
    Vector<String> theVector = new Vector<String>();
    I put the String needed into the Vector:
    theVector.add("blabla")
    In the other hand I had created a TreeMap like this:
    private TreeMap<Integer, Vector<String>> theTreeMap;
    I now when I try to put the Key and the Element like this my program crash:
    theTreeMap.put(1096,theVector);
    I think I don't put the data on the good way in the TreeMap...
    Any Idea? Thank you very much

    In the other hand I had created a TreeMap like this:
    private TreeMap<Integer, Vector<String>> theTreeMap;
    I now when I try to put the Key and the Element like
    this my program crash:
    theTreeMap.put(1096,theVector);What do you mean?

  • I am having problems with my music collection, after burning all of my music to the computer I organized it into folders and placed it in the iTunes Folder. Starting on a new computer now. I can get my music from old computer?

    I am having problems with my music collection, after burning all of my music to the computer I organized it into folders and placed it in the iTunes Folder. As of now i realize this was a mistake. Starting on a new computer now. I cant get my music to transfer from the itunes folder on the old computer? I keep getting error "Can't Read from the source file or disk." Whenever I got to folder properties its always checked read only. But when i play the song it works just fine. Im sure this is just because I added music into itunes folder but is there anyway to fix it?

    WMA files are 'window media audio' files, which is a Microsoft format. If you want to add them to your iTunes library on your Mac then you will need to convert them into a compatible format first. If you still have your windows machine then iTunes for Windows can convert them from WMA to MP3 format : https://discussions.apple.com/message/24158701#24158701
    Or try a search for, for example, 'convert wma to mp3' to find programs to convert them.

  • Problem with a BAPI collecting dunning levels

    Hello all experts,
    I am having a problem with BAPI “DebtorCreditAccount” (called from a VB program), collecting dunning levels.
    The BAPIs is called like follows (only the essential code is shown):
    The first function (GetCustomerCurrentBalance) works fine but the second (GetCustomerHighestDunningLevel) doesn’t work.
        Public Function GetCustomerCurrentBalance(ByVal strCustomerID As String) As Decimal
            Dim objARAccount, objReturn, objActualBalance As Object
            Try
                objARAccount = Me.p_sapBapi.GetSAPObject("ARAccount", "1000", Me.ConvertCustomerID(strCustomerID))
                objARAccount.GetCurrentBalance(Return:=objReturn, ActualBalance:=objActualBalance)
                Return CType(objActualBalance.Value("TOTAL_BAL"), Decimal)
            Catch ex As Exception
                Return 0
            Finally
                objARAccount = Nothing : objReturn = Nothing : objActualBalance = Nothing
            End Try
        End Function
        Public Function GetCustomerHighestDunningLevel(ByVal strCustomerID As String) As Integer
            Dim objDebtorCreditAccount, objReturn, objHighestDunningLevelD As Object
            Dim objTEST1 As Object
            Try
                objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount", Me.ConvertCustomerID(strCustomerID), "0001")
                objDebtorCreditAccount.GetHighestDunningLevel(Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD)
                Return CType(objHighestDunningLevelD.Value("DUNN_LEVEL"), Integer)
            Catch ex As Exception
                Return 0
            Finally
                objDebtorCreditAccount = Nothing : objReturn = Nothing : objHighestDunningLevelD = Nothing
            End Try
        End Function
    The error message I get is:
    Message: The runtime object of type DebtorCreditAccount with the persistent key 00000480060001 could not be created in the Business Object Repository.
    Message-Nr: 826
    Workarea: OL
    R/3 error message: Object does not exist
    Please give me some input on how to proceed!
    Best Regards,
    Niklas

    Thanks Vijaya for your fast reply. The parameters that I am giving as input are however correct.
    I have investigated the problem a bit further and tried some other calls.
    If I just chose to create an object of the type “DebtorCreditAccount” (without submitting any parameters) and then use the same method call as before (se code in topic above) I get the following error: “Mandatory parameter HIGHESTDUNNINGLEVELA missing.” This must mean that it knows that something is missing.
    objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount")
    objDebtorCreditAccount.GetHighestDunningLevel(Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD) 
    If if add the mandatory parameter “HIGHESTDUNNINGLEVELA” I get the error message "The persistent key for an business object instance of type DebtorCreditAccount has not been set. Cannot invoke method GETHIGHESTDUNNINGLEVEL”. This I interpret as the object has not been right instantiated. This brings me back to square one.
    objDebtorCreditAccount = Me.p_sapBapi.GetSAPObject("DebtorCreditAccount")
    objDebtorCreditAccount.GetHighestDunningLevel(HIGHESTDUNNINGLEVELA:="0", Return:=objReturn, HighestDunningLevelD:=objHighestDunningLevelD)
    Grateful for a response!
    Regards,
    Niklas

  • Problem with users accessing sharepoint 2013 site collection

    I have an unbeliveable problem..
    I have a sp site with several site collections..
    I have around 15 users.. Everybody have access to the root site. Two users do not have access to site collections even though they are in EXACTLY same permission groups like other users who can access those site collections!
    I tried to delete them from all user groups in SP, then delete their user profiles in Central Administration, and delete them from Active Directory. After that I recreated their profiles in Active directory, readded them to Central Administration, and again
    added them to coresponding groups in SharePoint site collections. They again CAN NOT ACCESS site collections.
    What should I do.. This is incredible that 5 users with the same user privileges can access site collections, and 2 can not, even though they are all created in the same way..
    Regards,
    Srdjan

    Hello,
    Have you found a solution for this problem? I have the exact same problem with 2 users accessing a site collection (access denied). I found also this row on uls log:
    Access Denied. Exception: Attempted to perform an unauthorized operation., StackTrace:   at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(Exception ex)     at Microsoft.Office.Project.PWA.PJBaseWebPartPage.OnPreInit(EventArgs
    e)     at System.Web.UI.Page.PerformPreInit()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessRequest()     at System.Web.UI.Page.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
    at System.Web.HttpApplication.ExecuteStep(IExecutionSt... 6955b79c-c42c-50fc-84f8-2b68f97002ea

  • Strange problem with Outlets and Collection View Items

    This is a strange issue. I am using XCode 3.2.2 and I am building a Collection View. To do this I have a non-document based application that uses Core Data.
    *Collection View Item Class*
    I created a new class that inherits NSCollectionViewItem and built it to have an outlet to the Label.
    *Collection View Item NIB*
    I created a Empty NIB for my Collection View Item. To the NIB I added a Custom View object and set the Class Identity to NSBox. I then added a Label to the new NSBox. I changed the File Owner to the new class and connected the "view" outlet to the new NSBox and the Label to the label outlet.
    *Main Menu NIB*
    I added a new NSCollectionViewItem object to the Main Menu NIB and set the Class Identity to the new class mentioned above. I then set the NIB Name to the name of the NIB mentioned above. In the window I added a NSCollectionView then set its Item Prototype to the new NSCollectionViewItem object I just configured. This is the typical way to set up a collection view with its item in a different NIB.
    *Back to the problem*
    Everything seem to work well except that in the setRepresentativeObject in the Collection View Item class when it attempts to set the Label to a value. Nothing happens. When I check closely I find that the Label is coming back nil. It is properly linked. I deleted everything and rebuilt the collection view item and relinked everything without success.
    *How I made it work but not happy with it*
    I have finally made this work by simply putting the line "[self view];" just before I attempt to run "[label setStringValue:name];". If I remark out the "[self view];" the label returns nil. I have a note near the line to make it easier to spot. It seems that I should not need to access the superclass's "view" accessor just to access one of view's subviews. Is this a bug or have I written this wrong?
    The Collection View Item code is below. Any help is appreciated.
    Thanks,
    Rob
    #import <Cocoa/Cocoa.h>
    #import "PersonManagedObject.h"
    @interface PersonSelectionViewItem : NSCollectionViewItem {
    NSTextField *label;
    #pragma mark Finalizers
    - (void)dealloc;
    #pragma mark Outlets
    @property (nonatomic, assign) IBOutlet NSTextField *label;
    #pragma mark Instance Methods
    - (void)configureKeyValueObserving;
    - (void)removeKeyValueObserving;
    #pragma mark Overrides
    - (void)setRepresentedObject:(id)representedObject;
    - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
    @end
    #import "PersonSelectionViewItem.h"
    @implementation PersonSelectionViewItem
    #pragma mark Finalizers
    - (void)dealloc{
    [self removeKeyValueObserving];
    [super dealloc];
    #pragma mark Outlets
    @synthesize name;
    #pragma mark Instance Methods
    - (void)configureKeyValueObserving{
    PersonManagedObject *person = (PersonManagedObject *)[self representedObject];
    [person addObserver:self forKeyPath:@"lastNameFirstName" options:0 context:NULL];
    - (void)removeKeyValueObserving{
    PersonManagedObject *person = (PersonManagedObject *)[self representedObject];
    [person removeObserver:self forKeyPath:@"lastNameFirstName"];
    #pragma mark Overrides
    - (void)setRepresentedObject:(id)representedObject{
    [super setRepresentedObject:representedObject];
    NSString *personName = (NSString *)[representedObject valueForKey:@"lastNameFirstName"];
    [self view]; //<---Without this line the "label" variable 2 lines down will be nil.
    if (personName) {
    [label setStringValue:personName];
    [self configureKeyValueObserving];
    - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
    if ([keyPath isEqualToString:@"lastNameFirstName"]) {
    [[self label]setStringValue:[object valueForKey:@"lastNameFirstName"]];
    } else {
    [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
    @end

    I think you must be correct. I just ran into the problem again in yet another NIB. It was in the setRepresentedObject method. I simply put in the same line "\[self view\]" just before I needed to set the value of the view component and it worked again. If it is the same in other components I guess I just need to pay attention to it. Thanks for the information.
    Message was edited by: Cycles4Fun

  • Apex 4 , problem with collection executions

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

    Hi ,
    I am having the following problem with the execution of one collection :
    Reference thread : Re: APEX 4 , executing a remote procedure and populating data using collection
    DBNAME ---> list item which I build from the DB links which I built ( as dynamic query in the shared components from a local table which holds entries of dblink names )
    USERLIST --> list item of users which should display dynamicaly the users of that db link I choose in DBNAME ( based on a collection )
    buttons CANCEL and SUBMIT
    4- Initial COLLECTION page process which is calculated before Header :
    DECLARE
    q varchar2(4000);
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS(P_COLLECTION_NAME => 'QRY1') THEN
    APEX_COLLECTION.DELETE_COLLECTION(P_COLLECTION_NAME => 'QRY1');
    END IF;
    q := 'SELECT username , username FROM sys.dba_users@'||:P23_DBNAME ;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
    P_COLLECTION_NAME => 'QRY1',
    P_QUERY => Q);
    END;
    For USERLIST list item I am using the following in LIST OF VALUES DEFINITION :
    SELECT C001, C002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME='QRY1'
    5 - to submit the values from the screen to the remote database procedure I am using the following submit process ON SUBMIT AFTER CALCULATIONS:
    DECLARE
    v_statement varchar2(255);
    BEGIN
    v_statement := 'begin
    Lock_User@&P24_DBNAME.(''&P24_USERLIST.'');
    insert into log values (1,''user locked'') ;
    commit ;
    end;';
    EXECUTE IMMEDIATE v_statement;
    END;
    The problem :
    The form runs sucessfully , where I the USERLIST changes dynamicaly when I change the DBNAME values , but as soon as I logout and login with another user1 , the collection does not execute and i get "ORA-01729: database link name expected".
    I login with user1 in edit mode and recreate the collection , run again , the collection executes successfuly .
    If I create a new user2 ( using the sample application pages ) and login with the new user2 , i have the same problem , thus I ho login with user2 in edit mode and try to run the collection .
    How can I control the collection to execute regardless of the application user logged in ??
    thanks in advance
    yousef

  • Problem with Message Collecting in BPM

    Hello,
    I want to develop a Business Process, which collects messages with the same ID. After 5 minutes the process should send all messages in one new message.
    I copieed the XI 3.0 Demo Process "BpmPatternCollectTime".
    My problem is, that only the first message that arrives in the 5 minutes, is passed on. The other messages are not attached.
    The Mapping is exactly the same as in the example of the SAP
    Any idea to solve the problem?
    Thanks
    Robin

    Hi,
    The Target of the container variable in the loop should be a MULTILINE variable to hold more than one message.
    Could you pls check whether you have appending the message to a multiline container variable.
    Regards,
    Sasi

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • Problem with SQL connection and a Collection

    hi all,
    I have two problems with sql...
    1. how can I assign the values of a resultset to a collection?
    2. how can I close the sql connection, because when I close the statement and connection error shows me in the resultset
    thanks!

    Hello Pablo,
    RetrivingResults In Collection:
    1)   use getObject method, and assign it to collection.
              Collection c_obj=new ArrayList();
             while(rs.next())
                    c_obj.add(rs.getInt(Project_ID), rs.getString(Project_Name));
    Closing ResultSet
    2)               The close() methos of ResultSet closes the ResultSet object, like bellow
                    ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
                    rs.close(); //Closes the result set

  • Problem with OData Collection in Template Customization Web IDE

    Hi Experts,
    I created my simple service in SEGW and I try use it in the application created in SAP Web IDE.
    I'm creating new project from menu File, New, Project from Template. I'm choosing SAP Fiori Master Detail Application giving a name of project. 
    I have a problem with step 3rd - Data Connection and 4th - Template Customization. I can easily select the system (which previously plugged) and the service, but in the next step I have problem. In step fourth I can't add OData Collection for Master or Detail Section.
    In my opinion my system is connected properly, because other (any) services allows me to choose a Odate Collection - including those created by me alone in SEGW.
    I'll add that service which allow to choose OData Collection was created using BAPI. Service which are posing the problem was created from DDIC Structure, but I don't know if it's relevant. Furthermore, all services created by me have implemented the methods GET_ENTITYSET and GET_ENTITY.
    Can You help me?
    Thanks in advance
    Marcin

    I make sure and my service returning metadata at
    http://<destination>:<port>/sap/opu/odata/sap/ZXXX/$metadata
    What's more, my service show data stored in collection dirrectly in browser at 
    http://<destination>:<port>/sap/opu/odata/sap/Z_Service_Name_XXX/Collection_Name_XXX
    and in GW Client.

Maybe you are looking for

  • Archive logs to standby showing odd behavior.

    10.2.0.2 HP 11.23 I'm monitoring the archive log transfer of files, and it appeared a little odd...as if the the files are not being applied. So log into the system manually, and ran: recover managed standby database cancel; returned with recovery co

  • Urgent! pass parameters between jsp pages

    Does anyone can give an example about how to pass parameters between jsp pages? This is what I do: pageContext.forward("pag_loginc.jsp?p_idusr=" + strUsr + "&c_password="); But when deployed is not working. Help is needed.

  • Where is all my mail???

    I receive about 25 important e-mails a day for my business. The most important thing I need to do is be able to refer to all of them easily at some point. My Mail takes messages out of my inbox every day--WHERE DO THEY ALL GO? If I can't do a simple

  • Adobe Premiere Pro CS5.5 error

    http://imgur.com/rEFoQin I get this prompt on bootup, everytime I try to open this projects, or within 5 minutes of opening this project. It doesn't seem to happen with other projects, and I'm concerned that I might loose my data. Can anyone help me

  • I can not update my ipad2 and now only have the itunes symbol and connection cable showing?

    I can not update my ipad2 and now only have the itunes symbol and connection cable showing?