How can I store in cache an special object

Hi,
     I am trying to store in coherence an OMElement object (axis2)
     the object is something like this:
     <tns:record mlns:tns="urn:mycompany.com:eng/myproj/myver">
     <tns:logRecord>
     <tns:event>
     <tns:id>1111111</tns:id>
     <tns:eid>5003</tns:eid>
     </tns:event>
     </tns:logRecord>
     </tns:record>
     but I get this error when I try to store it in the cache
     Exception
     java.lang.IllegalArgumentException: Resource is not serializable: Key=1111111, Value=<tns:record mlns:tns="urn:mycompany.com:eng/myproj/myver"><tns:logRecord><tns:event><tns:id>1111111</tns:id><tns:eid>5003</tns:eid></tns:event></tns:logRecord></tns:record>
          at com.tangosol.coherence.component.util.daemon.queueProcessor.service.ReplicatedCache.updateResource(ReplicatedCache.CDB:7)
          at com.tangosol.coherence.component.util.CacheHandler.put(CacheHandler.CDB:11)
          at com.tangosol.coherence.component.util.CacheHandler.put(CacheHandler.CDB:1)
          at com.tangosol.coherence.component.util.SafeNamedCache.put(SafeNamedCache.CDB:1)
          at com.adteractive.idservice.caching.TimeExpirableCoherenceCache.put(TimeExpirableCoherenceCache.java:46)
          at com.adteractive.idservice.service.SetGetSessionData_Cache.testSetGetSessionData(SetGetSessionData_Cache.java:65)
          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:164)
          at junit.framework.TestCase.runBare(TestCase.java:130)
          at junit.framework.TestResult$1.protect(TestResult.java:110)
          at junit.framework.TestResult.runProtected(TestResult.java:128)
          at junit.framework.TestResult.run(TestResult.java:113)
          at junit.framework.TestCase.run(TestCase.java:120)
          at junit.framework.TestSuite.runTest(TestSuite.java:228)
          at junit.framework.TestSuite.run(TestSuite.java:223)
          at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
     public class CoherenceCache {
          private NamedCache cache = CacheFactory.getCache("VirtualCache");
          public void put(IdKey element, Object sessionObject) {
          this.cache.put(element.getId(), sessionObject, this.expirationTimePeriodInMillis);
     Is there any way I can trick him to store this object in the cache?

Hi Momo,
     I don't exactly understand. Do you want to store the data represented by the OMElement into the cache or not?
     If you do, then the next question is can you from your code iterate over all its fields, and most importantly, are you able to recreate an identical object from those data manuallly, or not?
     If you are not able to do that, then you will not be able to put that object in the cache, or most particularly you will not be able recreate it upon getting it from the cache.
     As the OMElement and its family is an interface representing Axis2-specific stuff, you should try to find a way in Axis2 documentation to serialize data to a stream AND deserialize it back from the stream to a new object. If you cannot find such a way, there is probably a reason to that.
     If you can find a way, then you just serialize to a byte[] with the help of a ByteArrayOutputStream and in the writeExternal method you simply write that byte[] to the DataOutput via the ExternalizableHelper.writeByteArray() method. Similarly, you can read back the byte[] from the DataInput via the ExternalizableHelper.readByteArray() method, and then deserialize from a ByteArrayInputStream constructed with that byte[].
     Of course I may be wrong.
     Best regards,
     Robert

Similar Messages

  • How can I store ALL cache files in ONE place? i.e. in one folder

    Firefox 28.0
    WIN xp
    I would like all the cache files to be maintained in one single folder and not spread over multiple folders in a directory structure (as it currently operates).
    (current cache location)
    C:\Documents and Settings\xxx\Local Settings\Application Data\Mozilla\Firefox\Profiles\xxxx.default
    (multiple folders and sub-folders)
    Is there some way for Firefox to do this?

    AFAIK that is not possible.
    It is possible to choose an alternative location but the structure will remain the same.
    * see http://kb.mozillazine.org/Browser.cache.disk.parent_directory
    I do not know whether you have discovered it but you cache details may be accessed from Firefox by navigating to ''about:cache'' . About:cache details the three caches.

  • I bought new apple tv but it only shows Computers and Settings. how can I bring up other options, specially Youtube?

    I bought new apple tv but it only shows Computers and Settings. how can I bring up other options, specially Youtube?

    Alright, I found the issue. This is how I have resolved my issue. I hope it will help you.
    1. This issue could happen, if your apple TV doesnt have internet, connectivity to iTunes servers, or you haven't logged in to iTunes account in your apple TV
    2. Test the network on apple tv - General - settings - network - test network, Try to aviod using wifi use LAN cable, since we are trying to fix the issue.
    3. Set your exact location manually - Which city you are in from settings-General - Time Zone- choose your City currently you are in.
    4. Login to iTunes account - settings- iTunes Store- set your default store - for example I am in Mongolia but using my New Zealand account on Apple TV, in our case my Apple TV iTunes account location is New Zeland.
    5. If you are facing any issues to login to your iTunes account, That explains you have an issue with connectivity back to iTune servers, or sometimes it could be apple iTune servers may have problems. To verify which is one is the problem login to your itunes on your laptop or desktop for testing purposes, make sure you are using the same internet connection as your home apple TV is using.
    6. if you are able to login you should able to see all the available channels and full list on Apple TV.
    All the best..I just saved USD 29.00 but spend 5 hours...LOL..Its ok..its my Holiday spend with Apple TV.

  • How can i store data in term of a tree structure

    how can i store data in term of a tree structure

    What a tree is the question. If you just want a fast access, ehats about Hashtable or dictionary classes ? The data there is structured in a tree. For a simple binary tree, you can use something like
    class Node {
    Node(Object data){
       Node left;
       Node right;
       Object data = data;
    void insert(Object data, Node parent){
      int test = data.compareTo(parent.data);
      if(test < 0 ){
        if(parent.left == null){
          parent.left = new Node(data);
        else{
          insert(data, parent.left);
      else{
        if(parent.right == null){
          parent.right = new Node(data);
        else{
          insert(data,parent.right);
    }And so build up a binary tree. The traversing methods can be found in almost any good book (pre-order, post-order, in-order), for search you have just to look at greater/smaller and descend in the tree.
    The Object data can be changed to what you want for storage, String, or primitive Numbers, Vectors ...
    Is that what you search for?

  • How can I store my iTunes library on an NAS (Fritz Box)?

    How can I store my iTunes library on an NAS (Fritz Box)?

    1. Drag the library to the external drive, launch iTunes with the Option key held down, click on Choose Library, and point it there.
    2. Get a second. Having the backups on the same drive as the original data won't help when that drive fails.
    (66929)

  • How can I store received email in a folder on my iPad *

    How can I store received email in a folder on my iPad *
    I am trying to save certain messages on my iPad but don't know how to make a folder with email!

    You can only add folders to the email account if it is an IMAP account. If you see an EDIT button at the top of the window when you are in the email account - where you can see your inbox, sent and trash folders - if there is an edit button at the top of that window - you can tap that and then an Add Mailbox option appears at the bottom of the window.
    If you do not see that edit button, you do not have an IMAP account and you cannot add folders.

  • How can i store the data from the list to MS-Access?

    Hi all,
    We all know that from alv it is possible to export data to Ms-excel or word or text file. Can anyone tell me how can i store the data from alv or reports to Ms-Access?
    Thanks in Advance,
    Abhijit

    Hi,
    If you want that without code, i suppose there is a option in MS-Access to import data from Excel, so you have to first export to excel and then import to Access.
    If you want to code it yourself then have a look at FM TABLE_EXPORT_TO_MSACCESS, as said in Exporting Data from R/3 to MS ACCESS
    You can also see the search results in SCN for [export data to MS-Access (45 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=exportdatato+MS-Access&cat=sdn_all].
    Regards
    Karthik D

  • How can I store my music files on an external hard drive and listen to them through iTunes that way?

    How can I store my music files on an external hard drive and listen to them through iTunes that way? At the moment they're both on the external hard drive and also stored on the computer but I'm quickly running out of memory on my iBook G4 so I'd like to only keep them on the external hard drive and, if possible, delete them from my computer's hard drive. At the moment, when the hard drive isn't plugged in a lot of the files won't play and I get the exclamation mark next to the particular song in iTunes, but everything plays fine when the hard drive is plugged in.
    Thank you.

    Sounds like your files are playing from the external drive already.  To check go to iTunes - Preferences - Advanced and check the Media Folder Location.  Change it to the external drive if you need to.

  • How can I store iPhoto files on an external hard drive rather than on the iMac drive

    How can I store my iPhoto library on an external hard drive rather than the iMac drive to make my computer faster?

    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • How can i Store web links in my iPad for easy access?

    How can i store web links in iPad for easy access?

    Add them as a bookmark in the Safari web browser. You can sync bookmarks between your computer and iPad too using iTunes or iCloud.

  • How can I store an output, i.e C from the attatchmen​t in an array?

    How can I store an output, i.e C from the attatchment in an array?
    Attachments:
    Testing.vi ‏18 KB

    Hi, Se
    Take a look my example.
    Attachments:
    Testing.vi ‏23 KB

  • How can I store a 20 minute video to iCloud from iMovie?  I have room on iCloud.

    How can I store a 20 minute video to iCloud from iMovie?  I have room on iCloud.

    iMovie (2013): Set up “iMovie” Theater and iCloud
    You'll need to upgrade your OS and iMovie version first.

  • How can i store latitude and longitude (of registered user locations) in sql server and how can i query it for finding locations inside X radius from point y (or any user)?

    Hello
    In my app (WP 8.1) i have to store user location (lat,lon) in sql db so how can i store that location detail? And i also have to find all the location which are inside certain radius X from another user location, How can i do this?
    Any Sample project or code or any blog post?
    P.S. I use sql server 2012.

    If you need to do spatial queries like the one you mentioned you'd need to store it as a spatial geography type. For points, a simple SQL INSERT statement using the Point() method would do it. Example here:
    http://msdn.microsoft.com/en-us/library/bb933811.aspx For locations inside a radius, you'd use STDistance() method. All of the methods for the geography data type are documented here:
    http://msdn.microsoft.com/en-us/library/bb933802.aspx and can be used in ordinary T-SQL statements.
    If you need to use the SQL Server spatial library in your .NET application direct, Alastair has some nice blog posts, like this one:
    https://alastaira.wordpress.com/2011/08/19/spatial-applications-in-windows-azure-redux-including-denali/ , he even wrote a book. Or search the answers in this forum.
    Hope this helps, Bob

  • HT4847 How can I store files on iCloud?

    How can I store files on iCloud?

    Actually, I have found that this is very possible, combining several other tips from around the web, though perhaps not easy.  I am using Moutain Lion.  I am assuming that you have already activated and signed into iCloud previously.  Here are the steps for creating a cloud storage location that you can drage any file into, and access from any of your Macs:
    1) Create a new folder in the directory that is synced with iCloud.  Start by opening a Finder window, and going to the ~/Library/ directory.  Do this by typing Shift-Command-G while the Finder is open, and typing ~/Library in the goto window.  Next, open the directory "Mobile Documents".  Finally, Control-Click inside the Finder and select the "New Folder" option, naming it whatever you like -- I chose "iCloud".
    2) Step two is about creating a shortcut to this iCloud folder in the Finder.  You cannot directly drag the iCloud folder into the Favorites section of the Finder, but you can do this:  Control-Click on your new folder, and select "Make Alias".  Now, drag this alias over to your Favories panel in the finder.  You will be prompted whether you really want to move the Alias out of iCloud: Say "Yes".  Now, delete the Alias -- you don't need the original instance of it any more. (Alternatively, you can skip to the end of step 3 and drag the symbolic link into the Finder Favorites)
    3) Step three is about being able to access this iCloud folder from the Unix command line, and from the Desktop GUI.  Open a Terminal window (Launchpad => Other => Terminal).  By the way, I recommend putting the Terminal into your Taskbar, if it isn't already.  You should be in your home directory ... to verify, type "cd" and press Enter.  Now, create a Unix symbolic link (an Alias won't work for this) to the actual location of the iCloud folder:
    Type "ln -s ~/Library/Mobile\ Documents/iCloud/ iCloud" and press enter.  The command should be entered precisely, I recommend cut and paste.  The first character is a lower case "L" and there is a space after the backslash between "Mobile" and "Documents".  You should now have a symbolic link to the iCloud folder created.  To view it in the Finder, go to your home directory: Shift-Command-G, and then enter "~/" into the window.  You should see a folder called "iCloud" there, with a little arrow animation in the corner.  You can drag this into the Taskbar to have a permanent clickable shortcut.  You can also access the contents of this folder through the terminal.  From your home directory, just type "cd iCloud" and press Enter.  You are now in the iCloud folder (or more properly, your local version of it), and can use the usual Unix tricks ... "ls" to list contents, "mkdir ABCD" to make a new directory called "ABCD", "mv a.txt b.txt" to rename a file "a.txt" into "b.txt", etc.
    4) Step four is about accessing this folder on other machines.  On a second Mac, repeat all of the steps above *EXCEPT* for creating the New Folder in step 1 ... it already exists, but you can get it into your finder bar, and create sym-links in the same way from there.
    The great thing about this is that when you work, you are editing a *local* copy of the file, so you can work offline if you like.  Then, whenever you have internet access, the *actual remote* cloud copy of any new or modified files is uploaded.  Likewise, updated files are downloaded from the cloud to get your local files into sync.  You have the benefit/safety of a local hard copy, AND the portability (and extra safety) of cloud storage.  It's exactly what I wanted, and it works like a dream.  Plus, time machine can back up your *local* copies, to maintain version history.  I'm not quite sure what happens if you try to simultaneously edit a file from two places, but don't do that.
    Hope that helps you!
    JWSpaceman

  • How can I store all my notebook documents from iPad?

    How can I store all my notebook done documents updated from iPad or iPhone ?

    A simple and popular way to copy files.  Also, has shared folders.
    http://wiki.dropbox.com
    More ways to transfer files and access Word documents:
    https://discussions.apple.com/thread/4044866?tstart=0
    Other more complicated ideas
    Look in the app store for accessing Windows File servers.
    for example:
    http://itunes.apple.com/us/app/filebrowser-access-files-on/id364738545?mt=8
    Configure WebDave on your server.
    This thread has good info.
    https://discussions.apple.com/thread/3708341?tstart=0
    How to transfer files from your iPad to your PC with iPad to Computer Transfer
    http://www.iphone-mac.com/how-to-transfer-and-sync-contents-from-ipad-to-pc.html

Maybe you are looking for

  • Effects and presets

    Animation presets in After Effects using the Effects & Presets panel. I use After Effects CS6 and try to make a animation preset and get this message: After Effects warning: Adobe Bridge is not installed. Please download and install it to use this fe

  • Photoshop elements 9 constantly crashes?

    Alright, so. When I first installed Elements about 2 years ago, it was fine, didnt really have any problems. But recently, it's been doing things it hasn't really done before? It always crashes right when the editor opens, asks for my country/region

  • Why can't i access some of the tabs in my PSE13?

    I am new to PSE so I went out and bought the "pse13 for dummies" book and was going through trying stuff from in there. I wanted to try a layered photo and was trying what they said to do but I can't do anything because not all of my tabs in PSE are

  • Power Mac G5 - Cd tray opens at startup

    Not a major problem I know, but whenever I restart the mac, the CD tray automatically ejects and stays open. Anyone know how to fix this problme????

  • IPad 1 screen and pets

    I have an app for my cats and I'm wondering if it is safe to let them on the screen, the kittens are fine they don't have very sharp claws and have no interest in it I would love to try the app out on an adult cat. Do I need to buy a screen protector