2 Replies Latest reply: May 23, 2013 4:26 AM by user243865 RSS

    WavesetException:  Couldn't find method toHashMap() ...

    user243865
      I got that message when trying to call toHashMap on a WSUser object
      The docs clearly states that there is a public toHashMap in a WSUser object

      Why wont it find it?

      com.waveset.util.WavesetException: Couldn't find method toHashMap() in class com.waveset.object.WSUser ==> java.lang.NoSuchMethodException: com.waveset.object.WSUser.toHashMap()
                                    <set name='myGenericUserObj'>
                                      <invoke name='toHashMap'>
                                        <invoke name='getObject'>
                                          <select>
                                            <ref>context</ref>
                                            <ref>:display.session</ref>
                                            <invoke name='getLighthouseContext'>
                                              <ref>WF_CONTEXT</ref>
                                            </invoke>
                                          </select>
                                          <s>User</s>
                                          <ref>id_to_look_for</ref>
                                        </invoke>
                                      </invoke>
                                    </set>
      with only the getObject it picks the WSUser object out and displays it correctly in the debugger
        • 1. Re: WavesetException:  Couldn't find method toHashMap() ...
          user9326077
          Hi,

          there is a "toHashMap" Method. But that takes an "boolean" argument and you did not provide that argument. For this reason the Exception you receive is totally correct.

          Regards
          Felix
          • 2. Re: WavesetException:  Couldn't find method toHashMap() ...
            user243865
            Ok,

            I hadn't checked that in the docs... I will...

            The example in the manuals doesn't use one though...

            http://docs.oracle.com/cd/E19225-01/821-0378/bvamx/index.html

            this is the example from the manual :D
            <set name=’wsUserObj’>
               <invoke name=’getObject’>
            <!-- typically, a value such as :display.session would go here;
            instead, call the handy rule -->
                   <rule name=’Get Context’/>
                   <s>User</s.
                   <s>SamUser</s>
               </invoke>
            </set>
            <set name=’wsGenericObj’>
               <invoke name=’toHashMap’>
               <ref>wsUserObj</ref>
               </invoke>
            </set>