PIM.fromSerialFormat "Format not recognized"

Hi, I'm trying to use PIM.fromSerialFormat in order to read back a contact that was written out using PIM.toSerialFormat. The problem is that fromSerialFormat has a PIMException with the message "Format not recognized".
The original contact details from the sample.vcf file are as follows:
BEGIN:VCARD
VERSION:2.1
N:Mahmoud;Qusay;H.
FN:Qusay H. Mahmoud
ORG:JavaCourses
TITLE:Developer
NOTE:Helping You With Java!
TEL;WORK;VOICE:(416) 999-1111 ext 1000
TEL;WORK;FAX:(416) 333-9999
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;1500 Java Ave.=0D=0ASuite 101;Toronto;ON;M9V1L1;Canada
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:1500 Java Ave.=0D=0ASuite 101=0D=0AToronto, ON M9V1L1=0D=0ACanada
URL;WORK:http://www.javacourses.com
EMAIL;PREF;INTERNET:[email protected]
REV:20043335T124220Z
END:VCARD
When I call fromSerialFormat the buffer contains:
BEGIN:VCARD
VERSION:2.1
ADR;WORK:;;1500 Java Ave.
Suite 101;Toronto;ON;M9V1L1;Canada
EMAIL;PREF:[email protected]
LABEL;WORK:1500 Java Ave.
Suite 101
Toronto, ON M9V1L1
Canada
FN:Qusay H. Mahmoud
N:Mahmoud;Qusay;H.;;
NOTE:Helping You With Java!
ORG:JavaCourses
REV:2006-10-05
TEL;WORK:(416) 999-1111 ext 1000
TEL;FAX;WORK:(416) 333-9999
TITLE:Developer
UID:sample.vcf
URL:http://www.javacourses.com
END:VCARD
This is not recognized! The test code is as follows (removed error checking for clarity).
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// Get the PIM data.
ContactList contactList = contactList = (ContactList) mPim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE,"Contacts");
// Get an Enumeration of the contacts and loop until they are all backed up.
Enumeration enumContacts = null;
enumContacts = contactList.items();
while(enumContacts.hasMoreElements()) {
// Get the contact
Contact contact = (Contact)enumContacts.nextElement();
String[] data_formats = PIM.getInstance().supportedSerialFormats(PIM.CONTACT_LIST);
// Use 2.1 format for time being.
mPim.getInstance().toSerialFormat(contact, baos, "UTF-8", data_formats[1]);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
// This is where we get the "Format not recognized" message.
PIMItem[] items = PIM.getInstance().fromSerialFormat(bais, "UTF-8");
This is as basic as it gets and is driving me nuts. Why am I getting this error?
Any help is very much appreciated.

have u tried using data_formats[0] instead of data_formats[1] in toSerialFormat method? and if that doesn't work try using "VCARD/2.1" directly as the format

Similar Messages

  • Is there a way to restore photos from Drop box to my desktop iPhoto in a large batch instead of one at a time? I tried and a zip file was downloaded but won't open. Says file format not recognized.

    Is there a way to restore photos from Drop box to my desktop iPhoto in a large batch instead of one at a time? I tried and a zip file was downloaded but won't open. Says file format not recognized. I see how to do it one at a time with the "download" button in Dropbox but that's so cumbersome for lots of photos.

    Have you tried these avenues?
    Contact us - Dropbox
    Dropbox Help Center
    Dropbox Forums
    Submit a help request - Dropbox
    OT

  • HT3775 Hi, my mac which is on 10.7.5 osx. but when ever i insert any mpeg/avi video cd it shows the file format not recognized. i am fed up of this. plz somebody help me. what should i do now.

    hi,
              i am using 10.7.5 lion there are a lot of problems in this OS.
    like most of the programs quit's unexpectedly. some programs does not work on it. like adobe cs5 is not working. everytime time when i do click on adobe cs 5 icon it shows a message "To open “Adobe Photoshop CS5,” you need to install a Java SE 6 runtime, but you are not connected to the Internet.To install a Java SE 6 runtime later, open “Adobe Photoshop CS5” again" while i always remain connected on the net.
    2. when ever i insert an avi or mpeg video disk it shows the file format not recognized. to **** with this macbook pro n its 10.7.5 lion. the same disk works/runs on windows on windows systems.
    plz somebody help me what should i do now.
    [email protected]

    it sounds like a fualty installation of Lion, this may happen from time to time.
    The best thing to do in this situation is to reinstall Lion. You will not loose anything doing this, but you should always keep back ups of your information.
    http://www.apple.com/osx/recovery/
    basically hold Cmd+R on boot..
    first go to disk utility, verify and repair your disks and permissions. Exit out of Disk utility and then go directly to "reinstall Lion"
    choose that and let it reinstall.
    Adobe CS6 does need Java to run.
    To play your movies you might need to get an application called VLC. VLC is a free app and will play most videos and music files you throw into it.
    http://www.videolan.org/vlc/download-macosx.html
    you have a 64bit intel mac, so get the one for that.

  • I have iphoto 6 and my pictures are no longer showing.  I have tried importing them but it just give me an error msg. (file format not recognized) I have tried rebuilding the iphoto library but that doesn't work either. Any suggestions?

    I have iphoto 6 and my pictures are no longer showing.  I have tried importing them but it just give me an error msg. (file format not recognized) I have tried rebuilding the iphoto library but that doesn't work either. Any suggestions?

    How did you rebuild?
    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library allowing it to overwrite the damaged file.
    2. Download <a href="http://www.fatcatsoftware.com/iplm/"><b><u>iPhoto Library Manager</b></u></a> and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new *iPhoto 6* library:
    Note this will give you a working library with the same Rolls and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library on your desktop and find the Originals folder. From the Originals folder drag the individual Roll Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.

  • Date format not recognized -- urgent help needed

    Hi,
    I'm having a problem when start sqlplus in dos command window. If I start it from C:\oracle\ora81\bin, it won't started and error message showing like 'Date format not recognized' and then come back to DOS.
    I do have OWB installed which also has SQLPLUS installed so that there is no problem if I start it from C:\ORACLE\owb92\bin.
    For some reason, the path is setting as C:\oracle\ora81\bin before C:\ORACLE\owb92\bin so the default always goes to 81 folder.
    If restart the DB instance, and this problem is gone. But it comes back after some application running (our own application and Oracle provided OMBPlus ). We double check our own application, and there is no where to "alter session ...".
    Any help will be very appreciatged,
    Thanks,
    Daming

    I'm having a problem when start sqlplus in dos command window. If I start it from C:\oracle\ora81\bin, it won't started and error message showing like 'Date format not recognized' and then come back to DOS.
    Do you have a file called 'login.sql' in the folder 'C:\oracle\ora81\bin'? If there is one, is there an 'alter session' command in this file?

  • Libc.so: file not recognized: File format not recognized

    Hi,
    While running the "cd $ORACLE_HOME/procbuilder60/lib; make -f ins_procbuilder.mk install"
    i am getting the error.
    [appldev@datadev lib]$ cd $ORACLE_HOME/procbuilder60/lib; make -f ins_procbuilder.mk install
    rm -f de60desm /appldev/devora/iAS/6iserver/bin/de60desm
    - Linking de60desm executable...
    gcc -o de60desm -L/appldev/devora/iAS/6iserver/lib/ -L/appldev/devora/iAS/6iserver/lib/ -L/appldev/devora/iAS/6iserver/lib//stubs/ \
    /appldev/devora/iAS/6iserver/procbuilder60/lib/detk2.o /appldev/devora/iAS/6iserver/procbuilder60/lib/demsr.o /appldev/devora/iAS/6iserver/procbuilder60/lib/demcl.o \
    /appldev/devora/iAS/6iserver/procbuilder60/lib/ui10.o /appldev/devora/iAS/6iserver/procbuilder60/lib/uiicxd.o \
    /appldev/devora/iAS/6iserver/rdbms/lib/defopt.o -lde60 \
    -lca60 -lucol60 \
    -lnvu60 -lnvc60 -lnvs60 -luicc60 -lmmiw60 -lmmov60 -lmma60 -lmmos60 -lmmoi60 -lmmia60 -lmmft60 -lmmcm60 -luihx60 -luihx60 -luc60 -luipr60 -luimotif60 -lot60 -lrem60 -lree60 -lrec60 -luiimg60 -luimotif60 -luipr60 -luiimg60 -luc60 -lrem60 -luimotif60 -luia60 -ltknqap60 -luipr60 -luimotif60 -lutt60 -lix60 -lixd60 -lrod60 -lror60 -lros60 -lrod60 -lror60 -lros60 -lrod60 \
    -luat60 -lutc60 -lutl60 -lutsl60 -lplsf -lplsb -lextp /appldev/devora/iAS/6iserver/lib/libpsd.a -lplsf -lplsb -lextp \
    -lslax /appldev/devora/iAS/6iserver/lib/nautab.o /appldev/devora/iAS/6iserver/lib/naeet.o /appldev/devora/iAS/6iserver/lib/naect.o /appldev/devora/iAS/6iserver/lib/naedhs.o `cat /appldev/devora/iAS/6iserver/lib/naldflgs` -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lncr -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lncr -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lclient -lvsn -lcommon -lgeneric -lepc -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 `cat /appldev/devora/iAS/6iserver/lib/sysliblist` -ldl -lpthread -lm -L/usr/lib -lm -L/usr/X11R6/lib -lXm -L/usr/X11R6/lib/ -L/usr/X11R6/lib/ -lXt -lX11 -lm -lix60 -lixd60 -lX11 -lnlsrtl3 -lXp -lXext
    /appldev/devora/iAS/6iserver/lib//stubs//libc.so: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    make: *** [de60desm] Error 1
    My OS version is RHEL 5.
    Please suggest.
    Thanks in advance.

    But We are facing another issue while running "cd $ORACLE_HOME/reports60/lib; make -f ins_reports60w.mk install"
    [appldev@datadev lib]$ export LD_LIBRARY_PATH=/appldev/devora/8.0.6/network/jre11/lib/i686/native_threads/
    [appldev@datadev lib]$ cd $ORACLE_HOME/reports60/lib; make -f ins_reports60w.mk install
    Last few lines Error:
    ld -shared -o rwows60.so -z text -G -export-dynamic -L/appldev/devora/8.0.6/lib/ -L/appldev/devora/8.0.6/network/jre11/lib/linux/native_threads -L/appldev/devora/8.0.6/network/jre11/lib/i686/native_threads /appldev/devora/8.0.6/reports60/lib/rxmawt.o /appldev/devora/8.0.6/reports60/lib/rwsows3.o /appldev/devora/8.0.6/reports60/lib/rwswif.o /appldev/devora/8.0.6/reports60/lib/rwswcj.o /appldev/devora/8.0.6/reports60/lib/rwswcs.o /appldev/devora/8.0.6/reports60/lib/rwswm.o /appldev/devora/8.0.6/reports60/lib/rwsws.o /appldev/devora/8.0.6/reports60/lib/rwswcm.o /appldev/devora/8.0.6/reports60/lib/rwswk.o /appldev/devora/8.0.6/reports60/lib/rwswu.o /appldev/devora/8.0.6/reports60/lib/rwswur.o /appldev/devora/8.0.6/reports60/lib/rwswx.o -lzrc60 -lca60 /appldev/devora/8.0.6/lib/nautab.o /appldev/devora/8.0.6/lib/naeet.o /appldev/devora/8.0.6/lib/naect.o /appldev/devora/8.0.6/lib/naedhs.o -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lncr -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lncr -lnetv2 -lnttcp -lnetwork_d -lnz -lnzr -lnsslb8 -lbcert -lclient -lvsn -lcommon -lgeneric -lepc -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -ldl -lm -lpthread -ldl -lpthread -lm -L/usr/lib -lm -lc
    /usr/lib/libc.so: file not recognized: File format not recognized
    make: *** [rwows60.so] Error 1
    Kindly suggest..What is the document/step you are following?
    Thanks,
    Hussein

  • "/usr/bin/strip: File format not recognized" while packing

    Hi.
    I would build a package for wingide but after the build process came a strange error:
    $ makepkg
    ==> Erstelle Paket: wingide 3.0.4-1 (Do 13. Mär 17:10:33 CET 2008)
    ==> Prüfe Laufzeit-Abhängigkeiten...
    ==> Prüfe Buildtime-Abhängigkeiten...
    ==> Empfange Quellen...
    -> wingide-3.0.4-1-i386-linux.tar.gz im Build-Verzeichnis gefunden
    ==> Überprüfe Gültigkeit der Quell-Dateien mit md5sums...
    wingide-3.0.4-1-i386-linux.tar.gz ... Durchgelaufen
    ==> Entpacke Quellen...
    -> bsdtar -x -f wingide-3.0.4-1-i386-linux.tar.gz
    ==> Entferne existierendes pkg/ Verzeichnis ...
    ==> Betrete fakeroot-Umgebung ...
    ==> Beginne build()...
    ==> Säubere Installation...
    -> Entferne info/doc-Dateien...
    -> Komprimiere Man-Pages...
    -> Entferne Debugging-Symbole aus Binär-Dateien und Bibliotheken...
    /usr/bin/strip: opt/wingide/bin/2.4/src/debug/tserver/64bit/tdbgtracer24.so: File format not recognized
    the PKGBUILD file:
    # Contributor: Andreas Schönfelder <[email protected]>
    pkgname=wingide
    pkgver=3.0.4
    pkgrel=1
    pkgdesc="The intelligent development environment for python programmers"
    url="http://www.wingware.com"
    license=
    arch=('i686')
    source=(http://wingware.com/pub/$pkgname/$pkgver/$pkgname-$pkgver-$pkgrel-i386-linux.tar.gz)
    md5sums=('0fd31ac2e7851d1b777f8c100f480e40')
    build()
    cd $startdir/src/$pkgname-$pkgver-$pkgrel-i386-linux
    mkdir -p $startdir/pkg/{opt/wingide,usr/bin}
    tar -xC $startdir/pkg/opt/wingide -f binary-package-$pkgver-$pkgrel.tar
    sed -e "s/^DIR=.*$/DIR=\/opt\/wingide/" -i $startdir/pkg/opt/wingide/wing
    mv $startdir/pkg/opt/wingide/wing $startdir/pkg/usr/bin
    # vim:syntax=sh
    Greets, Andreas
    Last edited by echasslau (2008-03-13 16:14:05)

    Adding options=(!strip) to the PKGBUILD will skip that step, but make other binaries significantly larger. If you just get the output but that package is built successfully, I would ignore it.

  • Why do I keep getting "format not recognized" error?

    Hello,
    I was trying to play any of the video podcasts from Nick Jr (e.g iCarly, Drake and Josh) for my kids and I kept getting a "format not recognized" error on my APple TV and when trying to play on my PC with iTunes, the video doesn;t play at all. This seems strange to me as these podcasts are rated in the Top 10 under "kids and family" genre so they must be working for others. I was able to play other podcasts in this genre such as the Sesame Street podcast. Any ideas why these Nick Jr. ones aren't working for me?
    Thanks!

    I have been having the same problem - with podcasts AND with Movies and TV Shows bought through iTunes. I was hoping the recent 3.0 upgrade would fix it, but no such luck. While this was an occasional problem with iTunes 8, it seems to have turned chronic with iTunes 9.
    The annoying "solution" that seems to work is to unplug and replug the Apple TV and quit and restart iTunes. Even then, while watching TV Shows or Movies continuously it seems to work, but after any interruption, either due to shutting off the Apple TV or letting it go to screen saver for an hour or so between shows or movies, iTunes loses it from the device list, and the "format not recognized" message returns.

  • Movie format not recognized

    I have a first generation Apple TV. I have used a software to convert DVD's to MP4 and it used to work great, but now a message comes up saying "format not recognized"
    Any ideas why? Any ideas on how to fix it?

    I have a first generation Apple TV. I have used a software to convert DVD's to MP4 and it used to work great, but now a message comes up saying "format not recognized"
    Any ideas why? Any ideas on how to fix it?

  • Format Not Recognized

    Occassionally, and now 100% consistently, Apple TV will not play an mp4 that PREVIOUSLY would work just fine. In fact, some times, I will just click to watch that same file again and it would work.
    Now, since a week ago, the Apple TV will not play any file, even downloaded files from iTunes. All mp4's state Format Not Recognized.
    This is all via streaming. Some files are very small, and some are very large. They all show fine in the lists, and play fine in iTunes. The files are stored on an external hard drive. I am running the most current version of Apple Tv software (man, I wish I had the software build right before this new idiot v3.0; I have had nothing but problems since my Apple TV automatically installed the update. Big time dissappointment).
    Any help would be great, or any way to load the lastest 2.x version would be great!
    Thanks!

    Crabitus wrote:
    Apple TV will not play an mp4 that PREVIOUSLY would work just fine.
    As a first baby step to explore the reasons and fix them, delete the above file then load it back into iTunes from your back-up or original source. If it works now, the cause was probably as indicated by capaho (or something similar). You can try his suggested solution or just delete and replace all the affected songs/video.

  • ITunes update will not open -- file format not recognized

    My computer cannot open the iTunes update. The error message says that the archive format is not recognized.
    As far as I can tell the file format, or extension is rpm. My research reveals that this stands for Red Hat Package Manager. I downloaded a trial version of Salamander which claims to handle rpm file archives, but it STILL won't open.
    Does anyone know what type of file extractor I need to open these files? Any help would be appreciated.
    Dave in DC

    Same problem on my intel MacBookPro. Happened to me after doing the ilife08 upgrade a few minutes ago. Downloaded from apple again and did the upgrade option. That seems to have done the trick.

  • AppleTV - Video Format Not Recognized

    I know this question is out there, but I can't find the answer that helps.   I have one of the Apple TVs that you sync to, not stream, and I've downloaded a bunch of digital workouts that I purchased online.  I've never had a problem playing them before and now I'm getting the message that the format is not recognized on some of them.   They're all the very same format (Mpeg-4).    I've tried rebooting, resyncing, deleting them and adding them again.... I just don't get it!   All of my software is up-to-date too.  
    It's REALLY ticking me off!   These workouts weren't cheap, so I'm quite displeased that I can't use them.

    Welcome to the Apple Community.
    What resolution and frame rate are these videos, where did you purchase them from.

  • Wav format not recognized

    I have a Creative Zen that I use for recording my stand-up gigs. I used to use my phone which records in MP3 format from which I imported into Cubase and cleaned up the sound and tightened the envelope.
    The wav created by Zen is not recognized by Cubase nor by Windows Media Player. Only Zen plays it. I want to import to Cubae, work on it and save as mp3.
    How can I get other programs to recognize this Zen wav format?
    Kev

    I have a Creative Zen that I use for recording my stand-up gigs. I used to use my phone which records in MP3 format from which I imported into Cubase and cleaned up the sound and tightened the envelope.
    The wav created by Zen is not recognized by Cubase nor by Windows Media Player. Only Zen plays it. I want to import to Cubae, work on it and save as mp3.
    How can I get other programs to recognize this Zen wav format?
    Kev

  • ORA-01821: date format not recognized Error in PL/SQL report-4.0

    Hi,
    I am using Apex 4.0 and i have a Classic report(function returning query) which selects a date column.
    The query runs at the backend and gives the output.
    But when i run the report on the page, i get the error
    report error:
    ORA-20001: Error fetching column value: ORA-01821: date format not recognizedThe values for the date column are like this 14-MAR-13,01-FEB-13 etc... Everything seems to be right.
    But I have no idea why this error occurs.
    Thanks
    Divya

    Aren't these errors annoying! But there's a data / format mismatch for sure. What I need to see -- and what will tell you what is wrong -- is
    1) exactly what the data is and
    2) exactly what the format string is that is being used to convert it.
    The values for the date column are like this 14-MAR-13,01-FEB-13 etc... Question: Is this the source data or the target data ( what it's supposed to look like after being converted)?
    Let's start there:
    What is the source? Is it a DB column? Is it type date or VARCHAR2 or what?
    If VARCHAR2, then give us an example of the data that is failing.
    What is the format -- I assume there is one -- being used to convert the data?
    Are you doing a TO_CHAR or a TO_DATE?
    Give us lots of detail, please. Then it should be easy to solve.
    Regards,
    Howard

  • HT3775 .MOV format not recognized?

    I recovered a video from my sd card, it is a .MOV video, but quicktime will not recognize the format? any suggestions?
    The error message is
    "The document 'File123.MOV' could not be opened. The movie's file format isn't recognized"

    I attempted to play the videos but they are coming up as 00:00 in length
    A better description of what I had done. I had purchased a recovery program for my SD card. The program worked and recovered everything, photos are find, mp3s are playing, but the videos are the only thing that do not work.

Maybe you are looking for