Hi. First, I am not sure if 100 times have some threashhold. In my experience, it happens just around 100times. But sometimes, it happens less than 100.
I believe the title and department is not blank/space characters, but I will try the trim. And now I have new situation. 1. Delete all contact records for a user A. 2.Create some groups and upload 1000over contacts via online csv import. 3.getfeed call from API ends with parse exception. Thanks. On 1月13日, 午前1:16, "Julian (Google)" <[email protected]> wrote: > Hi, > > Also, please double check that userMaster.getTitle() and > userMaster.getDepartment() are not just blank/space characters or > other special characters (\n \t \r \b) that could cause problems, for > example, the Java Client trims white spaces and that will cause the > same error that you are getting. > > You can add a trim to your check, but you should also check for other > chars if necesary: > > if(userMaster.getTitle() != null && userMaster.getTitle().trim().length > ()>0) > { > orgName = new OrgName(userMaster.getTitle());} > > if(userMaster.getDepartment() != null && userMaster.getDepartment > ().trim().length()>0){ > orgTitle = new OrgTitle(userMaster.getDepartment()); > > } > > Cheers, > Julian > > On Jan 12, 3:10 pm, "Julian (Google)" <[email protected]> wrote: > > > Hi, > > > Thank you for sharing the code, this will help to find the problem. > > > Do you get the error only when you call the method more than 100 > > times? Does it work for the first 100 calls? > > > Cheers, > > Julian > > > On Jan 10, 1:02 pm, Dummy <[email protected]> wrote: > > > > Hi. I did run with V2.0 API but the result was the same. > > > I got parse exception like this. Thanks. > > > > 警告: [Line 5, Column 1885, element gd:orgTitle] > > > com.google.gdata.util.ParseException: Missing required text content > > > Message: Missing required text content > > > > at > > > com.google.gdata.data.AttributeHelper.consume(AttributeHelper.java: > > > 101) > > > at com.google.gdata.data.AttributeHelper.consumeContent > > > (AttributeHelper.java:86) > > > at com.google.gdata.data.ValueConstruct.consumeAttributes > > > (ValueConstruct.java:184) > > > at com.google.gdata.data.AbstractExtension > > > $AttributesHandler.processEndElement(AbstractExtension.java:243) > > > at com.google.gdata.util.XmlParser.endElement(XmlParser.java:985) > > > at org.xml.sax.helpers.ParserAdapter.endElement(Unknown Source) > > > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > > > Source) > > > at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement > > > (Unknown Source) > > > at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl > > > $FragmentContentDispatcher.dispatch(Unknown Source) > > > at > > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument > > > (Unknown Source) > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > > Source) > > > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown > > > Source) > > > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > > > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > > > Source) > > > at > > > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown > > > Source) > > > at org.xml.sax.helpers.ParserAdapter.parse(Unknown Source) > > > at com.google.gdata.util.XmlParser.parse(XmlParser.java:675) > > > at com.google.gdata.util.XmlParser.parse(XmlParser.java:606) > > > at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:759) > > > at com.google.gdata.util.ParseUtil.parseFeed(ParseUtil.java:200) > > > at com.google.gdata.util.ParseUtil.readFeed(ParseUtil.java:168) > > > at com.google.gdata.data.BaseFeed.readFeed(BaseFeed.java:741) > > > at com.google.gdata.client.Service.getFeed(Service.java:965) > > > at com.google.gdata.client.Service.getFeed(Service.java:819) > > > at > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java: > > > 592) > > > at com.google.gdata.client.Service.getFeed(Service.java:838) > > > at jp.co.tokyu.hands.google.sso.gao.ContactListGao.init > > > (ContactListGao.java:86) > > > at > > > jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask.updateUser > > > (GoogleAppsContactTask.java:93) > > > at > > > jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask.execute > > > (GoogleAppsContactTask.java:71) > > > at > > > com.yoshidumi.product.google.sso.batch.task.BatchTask.executeTask > > > (BatchTask.java:58) > > > at jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask$ > > > $EnhancedByS2AOP$$1098594.$$executeTask$$invokeSuperMethod$$ > > > (GoogleAppsContactTask$$EnhancedByS2AOP$$1098594.java) > > > at jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask$ > > > $EnhancedByS2AOP$$1098594$$MethodInvocation$$executeTask0.proceed > > > (MethodInvocationClassGenerator.java) > > > at org.seasar.extension.tx.RequiredInterceptor.invoke > > > (RequiredInterceptor.java:48) > > > at jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask$ > > > $EnhancedByS2AOP$$1098594$$MethodInvocation$$executeTask0.proceed > > > (MethodInvocationClassGenerator.java) > > > at jp.co.tokyu.hands.google.sso.batch.task.GoogleAppsContactTask$ > > > $EnhancedByS2AOP$$1098594.executeTask(GoogleAppsContactTask$ > > > $EnhancedByS2AOP$$1098594.java) > > > at com.yoshidumi.product.google.sso.batch.task.BatchTask.call > > > (BatchTask.java:72) > > > at com.yoshidumi.product.google.sso.batch.task.BatchTask.call > > > (BatchTask.java:1) > > > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) > > > at java.util.concurrent.FutureTask.run(Unknown Source) > > > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown > > > Source) > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown > > > Source) > > > at java.lang.Thread.run(Unknown Source) > > > > On Jan 10, 7:30 pm, Dummy <[email protected]> wrote: > > > > > Hi, Julian. > > > > > I would paste my source code although it may contain no concern with > > > > this issue.. > > > > Now,I figure out this parse exception may happen just adding contact > > > > records. > > > > The steps is just calling this method 100 over times. > > > > It happend just adding the contacts records with no groups. > > > > > I would also try with API V2, and let you know the results later. > > > > > Thanks. > > > > > Source code. > > > > ##### > > > > public ContactEntry createContact(String createUserAddress, > > > > UserMaster userMaster) > > > > throws ServiceException, IOException { > > > > > //既存のエントリの場合は再利用するために取得する。 > > > > ContactEntry contact = > > > > getContactEntryByMail(createUserAddress, > > > > userMaster.getMail()); > > > > > Boolean isNew = false; > > > > > //contactがnullの場合は新規作成となる。 > > > > if(contact == null) { > > > > contact = new ContactEntry(); > > > > isNew = true; > > > > }else{ > > > > //更新の場合は一旦初期化する。 > > > > contact.getPhoneNumbers().clear(); > > > > contact.getPostalAddresses().clear(); > > > > contact.getEmailAddresses().clear(); > > > > } > > > > > String value = userMaster.getDisplayname(); > > > > contact.setTitle(new PlainTextConstruct(value)); > > > > > Email primaryMail = new Email(); > > > > primaryMail.setAddress(userMaster.getMail()); > > > > > > > > primaryMail.setRel("http://schemas.google.com/g/2005#work"); > > > > primaryMail.setPrimary(true); > > > > contact.addEmailAddress(primaryMail); > > > > > // 会社電話番号の登録部分*********** > > > > if(userMaster.getTelephonenumber() != null && > > > > userMaster.getTelephonenumber().length() > 0 ) { > > > > PhoneNumber workPn = new PhoneNumber(); > > > > > > > > workPn.setPhoneNumber(userMaster.getTelephonenumber()); > > > > > > > > workPn.setRel("http://schemas.google.com/g/2005#work"); > > > > contact.addPhoneNumber(workPn); > > > > } > > > > // ポケットベルの登録部分(ハンズ用件では内線番号)*********** > > > > if(userMaster.getPager() != null && > > > > userMaster.getPager().length() > > > > > 0 ) { > > > > PhoneNumber pocketBeeper = new PhoneNumber(); > > > > > > > > pocketBeeper.setPhoneNumber(userMaster.getPager()); > > > > > > > > pocketBeeper.setRel("http://schemas.google.com/g/2005#other"); > > > > contact.addPhoneNumber(pocketBeeper); > > > > } > > > > // Fax電話番号の登録部分*********** > > > > if(userMaster.getFacsimiletelephonenumber() != null && > > > > userMaster.getFacsimiletelephonenumber().length() > 0) { > > > > PhoneNumber faxPn = new PhoneNumber(); > > > > > > > > faxPn.setPhoneNumber(userMaster.getFacsimiletelephonenumber()); > > > > > > > > faxPn.setRel("http://schemas.google.com/g/2005#fax"); > > > > contact.addPhoneNumber(faxPn); > > > > } > > > > // 携帯電話の登録部分*********** > > > > if(userMaster.getMobile() != null && > > > > userMaster.getMobile().length()> 0) { > > > > > PhoneNumber mobilePn = new PhoneNumber(); > > > > mobilePn.setPhoneNumber(userMaster.getMobile()); > > > > > > > > mobilePn.setRel("http://schemas.google.com/g/2005#mobile"); > > > > contact.addPhoneNumber(mobilePn); > > > > } > > > > > // 住所情報の登録部分 > > > > PostalAddress pa = new PostalAddress(); > > > > String tempAddress = "-"; > > > > // 都道府県の取得 > > > > if(userMaster.getSt() != null && > > > > userMaster.getSt().length() > 0 ){ > > > > tempAddress = > > ... > > もっと読む >> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en -~----------~----~----~----~------~----~------~--~---
