Problem in creating portfolio using google finance API

Put your problem here if it does not fit any of the other categories.

Problem in creating portfolio using google finance API

Postby roopalinasa » Thu May 27, 2010 11:53 am

Hi
I am developing an android application, in which I have to create a portfolio at Google Finance(using libraries). For this I am using API from link below:

http://code.google.com/apis/finance/doc ... Portfolios

And

I am getting the error as follows:

Could not find method javax.xml.parsers.SAXParserFactory.getSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory.getSchema


Plz see the below code :

private static PortfolioEntry makePortfolioEntry(String portfolioName, String currencyCode) {
PortfolioEntry entry = new PortfolioEntry();
entry.setTitle(new PlainTextConstruct(portfolioName));
PortfolioData data = new PortfolioData();
data.setCurrencyCode(currencyCode);
entry.setPortfolioData(data);
return entry;
}

private static void insertPortfolioEntry(FinanceService service, String feedUrl, PortfolioEntry entry)
throws IOException, MalformedURLException, ServiceException {
System.out.println("Inserting Entry at location: " + feedUrl);
service.insert(new URL(feedUrl), entry);
}


Can smbody help me out ??? :?:
roopalinasa
Freshman
Freshman
 
Posts: 2
Joined: Thu May 20, 2010 6:33 am

Top

Re: Problem in creating portfolio using google finance API

Postby achie1266 » Tue Jun 15, 2010 5:41 pm

Hello,

Did you manage to solve this issue?
I am working on Google Health on Android and I am facing the same issue while trying client login. Iam getting that error from this piece of code.
Code: Select all
         URL metafeedUrl = new URL("https://www.google.com/health/feeds/profile/list");
         System.out.println("Getting Health profile entries...\n");
         Feed resultFeed = myService.getFeed(metafeedUrl, Feed.class);


And here is the error log in case you want to look at it.
I/dalvikvm(10388): Could not find method javax.xml.parsers.SAXParserFactory.getSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory.getSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12342: Ljavax/xml/parsers/SAXParserFactory;.getSchema ()Ljavax/xml/validation/Schema;
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.getSchema code (32 bytes)
W/dalvikvm(10388): VFY: unable to find class referenced in signature (Ljavax/xml/validation/Schema;)
I/dalvikvm(10388): Could not find method javax.xml.parsers.SAXParserFactory.setSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory$SecureSAXParserFactory.setSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12350: Ljavax/xml/parsers/SAXParserFactory;.setSchema (Ljavax/xml/validation/Schema;)V
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.setSchema code (28 bytes)
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388): at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)
W/XmlParser(10388): at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
W/XmlParser(10388): at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
W/XmlParser(10388): at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
W/XmlParser(10388): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
W/XmlParser(10388): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
W/XmlParser(10388): at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
W/XmlParser(10388): at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
W/XmlParser(10388): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
W/XmlParser(10388): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
W/XmlParser(10388): at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
W/XmlParser(10388): at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
W/XmlParser(10388): at com.google.gdata.client.Service.getFeed(Service.java:1136)
W/XmlParser(10388): at com.google.gdata.client.Service.getFeed(Service.java:998)
W/XmlParser(10388): at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
W/XmlParser(10388): at com.google.gdata.client.Service.getFeed(Service.java:1017)
W/XmlParser(10388): at gh.com.achie.test.Health.getProfilesForUI(Health.java:60)
W/XmlParser(10388): at gh.com.achie.test.Main.onClick(Main.java:33)
W/XmlParser(10388): at android.view.View.performClick(View.java:2364)
W/XmlParser(10388): at android.view.View.onTouchEvent(View.java:4179)
W/XmlParser(10388): at android.widget.TextView.onTouchEvent(TextView.java:6541)
W/XmlParser(10388): at android.view.View.dispatchTouchEvent(View.java:3709)
W/XmlParser(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/XmlParser(10388): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
W/XmlParser(10388): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
W/XmlParser(10388): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
W/XmlParser(10388): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
W/XmlParser(10388): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
W/XmlParser(10388): at android.os.Handler.dispatchMessage(Handler.java:99)
W/XmlParser(10388): at android.os.Looper.loop(Looper.java:123)
W/XmlParser(10388): at android.app.ActivityThread.main(ActivityThread.java:4363)
W/XmlParser(10388): at java.lang.reflect.Method.invokeNative(Native Method)
W/XmlParser(10388): at java.lang.reflect.Method.invoke(Method.java:521)
W/XmlParser(10388): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/XmlParser(10388): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/XmlParser(10388): at dalvik.system.NativeStart.main(Native Method)
W/System.err(10388): com.google.gdata.util.ParseException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
W/System.err(10388): at com.google.gdata.util.XmlParser.parse(XmlParser.java:708)
W/System.err(10388): at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
W/System.err(10388): at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
W/System.err(10388): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
W/System.err(10388): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
W/System.err(10388): at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
W/System.err(10388): at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
W/System.err(10388): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
W/System.err(10388): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
W/System.err(10388): at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
W/System.err(10388): at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
W/System.err(10388): at com.google.gdata.client.Service.getFeed(Service.java:1136)
W/System.err(10388): at com.google.gdata.client.Service.getFeed(Service.java:998)
W/System.err(10388): at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
W/System.err(10388): at com.google.gdata.client.Service.getFeed(Service.java:1017)
W/System.err(10388): at gh.com.achie.test.Health.getProfilesForUI(Health.java:60)
W/System.err(10388): at gh.com.achie.test.Main.onClick(Main.java:33)
W/System.err(10388): at android.view.View.performClick(View.java:2364)
W/System.err(10388): at android.view.View.onTouchEvent(View.java:4179)
W/System.err(10388): at android.widget.TextView.onTouchEvent(TextView.java:6541)
W/System.err(10388): at android.view.View.dispatchTouchEvent(View.java:3709)
W/System.err(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
W/System.err(10388): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
W/System.err(10388): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
W/System.err(10388): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
W/System.err(10388): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
W/System.err(10388): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
W/System.err(10388): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(10388): at android.os.Looper.loop(Looper.java:123)
W/System.err(10388): at android.app.ActivityThread.main(ActivityThread.java:4363)
W/System.err(10388): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(10388): at java.lang.reflect.Method.invoke(Method.java:521)
W/System.err(10388): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
W/System.err(10388): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
W/System.err(10388): at dalvik.system.NativeStart.main(Native Method)
W/System.err(10388): Caused by: javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
W/System.err(10388): at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)
W/System.err(10388): at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
W/System.err(10388): ... 37 more


Can you let me know how to fix this if you have solved this.
Thank you.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Re: Problem in creating portfolio using google finance API

Postby tushar » Wed Jun 30, 2010 3:29 pm

Hi Guys,

Were you able to resolve this issue.
I am developing an Android app which created a new calendar on the google server and on trying to insert a new calendar I am facing a similar issue.

This is how I am trying to insert the calendar.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. CalendarService service = new CalendarService("CalendarFeed`");
  2. CalendarEntry calendar = new CalendarEntry();
  3. //Some code
  4. URL postUrl = new URL(
  5.                                 "http://www.google.com/calendar/feeds/default/owncalendars/full");
  6. service.insert(postUrl, calendar);
  7.  
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


The exception that I get is:

WARN/dalvikvm(922): VFY: unable to resolve virtual method 16724: Ljavax/xml/parsers/SAXParserFactory;.getSchema ()Ljavax/xml/validation/Schema;
WARN/dalvikvm(922): VFY: unable to find class referenced in signature (Ljavax/xml/validation/Schema;)
WARN/dalvikvm(922): VFY: unable to resolve virtual method 16732: Ljavax/xml/parsers/SAXParserFactory;.setSchema (Ljavax/xml/validation/Schema;)V
WARN/XmlParser(922): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
WARN/XmlParser(922): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
WARN/XmlParser(922): at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)
WARN/XmlParser(922): at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
WARN/XmlParser(922): at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
WARN/XmlParser(922): at com.google.gdata.data.BaseEntry.parseAtom(BaseEntry.java:1015)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:59)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
WARN/XmlParser(922): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
WARN/XmlParser(922): at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
WARN/XmlParser(922): at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
WARN/XmlParser(922): at com.google.gdata.client.Service.insert(Service.java:1410)
WARN/XmlParser(922): at com.google.gdata.client.GoogleService.insert(GoogleService.java:606)
WARN/XmlParser(922): at tmo.family.SetupCalendarNameActivity.createCalendar(SetupCalendarNameActivity.java:205)
WARN/XmlParser(922): at tmo.family.SetupCalendarNameActivity.handleCalendar(SetupCalendarNameActivity.java:113)
WARN/XmlParser(922): at tmo.family.SetupCalendarNameActivity.access$2(SetupCalendarNameActivity.java:104)
WARN/XmlParser(922): at tmo.family.SetupCalendarNameActivity$3$1.run(SetupCalendarNameActivity.java:97)
WARN/XmlParser(922): at java.lang.Thread.run(Thread.java:1096)
WARN/System.err(922): com.google.gdata.util.ParseException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
WARN/System.err(922): at com.google.gdata.util.XmlParser.parse(XmlParser.java:708)
WARN/System.err(922): at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
WARN/System.err(922): at com.google.gdata.data.BaseEntry.parseAtom(BaseEntry.java:1015)
WARN/System.err(922): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:59)
WARN/System.err(922): at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
WARN/System.err(922): at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
WARN/System.err(922): at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
WARN/System.err(922): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
WARN/System.err(922): at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
WARN/System.err(922): at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
WARN/System.err(922): at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
WARN/System.err(922): at com.google.gdata.client.Service.insert(Service.java:1410)
WARN/System.err(922): at com.google.gdata.client.GoogleService.insert(GoogleService.java:606)
WARN/System.err(922): at tmo.family.SetupCalendarNameActivity.createCalendar(SetupCalendarNameActivity.java:205)
WARN/System.err(922): at tmo.family.SetupCalendarNameActivity.handleCalendar(SetupCalendarNameActivity.java:113)
WARN/System.err(922): at tmo.family.SetupCalendarNameActivity.access$2(SetupCalendarNameActivity.java:104)
WARN/System.err(922): at tmo.family.SetupCalendarNameActivity$3$1.run(SetupCalendarNameActivity.java:97)
WARN/System.err(922): at java.lang.Thread.run(Thread.java:1096)
WARN/System.err(922): Caused by: javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities
WARN/System.err(922): at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:84)
WARN/System.err(922): at com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
WARN/System.err(922): ... 17 more



Any help would be really helpful?
tushar
Once Poster
Once Poster
 
Posts: 1
Joined: Wed May 06, 2009 2:18 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google Feedfetcher and 18 guests