Search Results

Search found 121 results on 5 pages for 'xmlparser'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Problem with parsing XML with iPhone app

    - by zp26
    Hi, I have a problem with a xml parsing. I have create a class for parsing. The xmlURL is correct (testing it from debug) but when i call the method parse the variable success become FALSE and a errorParsing is "NSXMLParserErrorDomain". Can you help me? My code is below. #import "xmlParser.h" #import"Posizione.h" @implementation xmlParser @synthesize arrayPosizioniXML; NSString *tempString; Posizione *posizioneRilevata; - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if([tempString isEqualToString:@"name"]) posizioneRilevata.nome = string; else if([tempString isEqualToString:@"x"]) posizioneRilevata.valueX = [string floatValue]; else if([tempString isEqualToString:@"y"]) posizioneRilevata.valueY = [string floatValue]; else if([tempString isEqualToString:@"z"]) posizioneRilevata.valueZ = [string floatValue]; else if([tempString isEqualToString:@"/posizione"]) [arrayPosizioniXML addObject:posizioneRilevata]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { //[textArea setText:[[NSString alloc] initWithFormat:@"%@\nFine elemento: %@",textArea.text,elementName]]; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if ([elementName isEqualToString:@"name"]){ tempString = @"name"; NSLog(@"ok"); } else if([elementName isEqualToString:@"x"]){ tempString = @"x"; } else if([elementName isEqualToString:@"y"]) { tempString = @"y"; } else if([elementName isEqualToString:@"z"]) { tempString = @"z"; } else if([elementName isEqualToString:@"/posizione"]) { tempString = @"/posizione"; } } -(BOOL)avviaParsing{ //Bisogna convertire il file in una NSURL altrimenti non funziona NSLog(@"zp26 %@",path); NSURL *xmlURL = [NSURL fileURLWithPath:path]; // Creiamo il parser NSXMLParser *parser = [[ NSXMLParser alloc] initWithContentsOfURL:xmlURL]; // Il delegato del parser e' la classe stessa (self) [parser setDelegate:self]; //Effettuiamo il parser BOOL success = [parser parse]; //controlliamo come è andata l'operazione if(success == YES){ //parsing corretto return TRUE; } else { NSError *errorParsing = [[NSError alloc]init]; errorParsing = [parser parserError]; //c'è stato qualche errore... return FALSE; } // Rilasciamo l'oggetto NSXMLParser [parser release]; } -(id)init { self = [super init]; if (self != nil) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [paths objectAtIndex:0]; path = [documentsDirectoryPath stringByAppendingPathComponent:@"filePosizioni.xml"]; posizioneRilevata = [[Posizione alloc]init]; tempString = [[NSString alloc]init]; } return self; } @end @implementation AccelerometroViewController -(BOOL)caricamentoXML{ xmlParser *parser; parser = [[xmlParser alloc]init]; if([parser avviaParsing]){ [arrayPosizioni addObjectsFromArray:parser.arrayPosizioniXML]; return TRUE; } else return FALSE; } - (void)viewDidLoad { [super viewDidLoad]; if([self caricamentoXML]){ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Caricamento Posizioni da Xml" message:@"Posizione caricata con successo" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert show]; [alert release]; } else{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Caricamento Posizioni da Xml" message:@"Posizione non caricate" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; [alert show]; [alert release]; } } @end

    Read the article

  • how to pass one variable value frm one class to the oder

    - by Arunabha
    i hav two packages one is com.firstBooks.series.db.parser which hav a java file XMLParser.java,i hav another package com.firstBooks.series79 which hav a class called AppMain.NW i want to send the value of a variable called _xmlFileName frm AppMain class to the xmlFile variable in XMLParser class,i am posting the codes for both the class,kindly help me. package com.firstBooks.series.db.parser; import java.io.IOException; import java.io.InputStream; import java.util.Vector; import net.rim.device.api.xml.parsers.DocumentBuilder; import net.rim.device.api.xml.parsers.DocumentBuilderFactory; import net.rim.device.api.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.firstBooks.series.db.Question; public class XMLParser { private Document document; public static Vector questionList; public static String xmlFile; public XMLParser() { questionList = new Vector(); } public void parseXMl() throws SAXException, IOException, ParserConfigurationException { // Build a document based on the XML file. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); InputStream inputStream = getClass().getResourceAsStream(xmlFile); document = builder.parse(inputStream); } public void parseDocument() { Element element = document.getDocumentElement(); NodeList nl = element.getElementsByTagName("question"); if (nl != null && nl.getLength() > 0) { for (int i = 0; i < nl.getLength(); i++) { Element ele = (Element) nl.item(i); Question question = getQuestions(ele); questionList.addElement(question); } } } private Question getQuestions(Element element) { String title = getTextValue(element, "title"); String choice1 = getTextValue(element, "choice1"); String choice2 = getTextValue(element, "choice2"); String choice3 = getTextValue(element, "choice3"); String choice4 = getTextValue(element, "choice4"); String answer = getTextValue(element, "answer"); String rationale = getTextValue(element, "rationale"); Question Questions = new Question(title, choice1, choice2, choice3, choice4, answer, rationale); return Questions; } private String getTextValue(Element ele, String tagName) { String textVal = null; NodeList nl = ele.getElementsByTagName(tagName); if (nl != null && nl.getLength() > 0) { Element el = (Element) nl.item(0); textVal = el.getFirstChild().getNodeValue(); } return textVal; } } Nw the code for AppMain class //#preprocess package com.firstBooks.series79; import net.rim.device.api.ui.UiApplication; import com.firstBooks.series.ui.screens.HomeScreen; public class AppMain extends UiApplication { public static String _xmlFileName; public static boolean _Lite; public static int _totalNumofQuestions; public static void initialize(){ //#ifndef FULL /* //#endif _xmlFileName = "/res/Series79_FULL.xml"; _totalNumofQuestions = 50; _Lite = false; //#ifndef FULL */ //#endif //#ifndef LITE /* //#endif _xmlFileName = "/res/Series79_LITE.xml"; _totalNumofQuestions = 10; _Lite = true; //#ifndef LITE */ //#endif } private AppMain() { initialize(); pushScreen(new HomeScreen()); } public static void main(String args[]) { new AppMain().enterEventDispatcher(); } }

    Read the article

  • How to include an external jar in gwt client side?

    - by Sergio del Amo
    I would like to use the org.apache.commons.validator.GenericValidator class in a view class of my GWT web app. I have read that I have to implicitely tell that I intend to use this external library. I thought adding the next line into my App.gwt.xml would work. <inherits name='org.apache.commons.validator.GenericValidator'/> I get the next error: Loading inherited module 'org.apache.commons.validator.GenericValidator' [ERROR] Unable to find 'org/apache/commons/validator/GenericValidator.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? [ERROR] Line 13: Unexpected exception while processing element 'inherits' com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:239) at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:354) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:223) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:270) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:327) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) [ERROR] Failure while parsing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.DefaultSchema.onHandlerException(DefaultSchema.java:56) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:233) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:270) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:327) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) [ERROR] Unexpected error while processing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:351) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) Anyone knows how it works?

    Read the article

  • How to include an external jar in a GWT module?

    - by Sergio del Amo
    I would like to use the org.apache.commons.validator.GenericValidator class in a view class of my GWT web app. I have read that I have to implicitely tell that I intend to use this external library. I thought adding the next line into my App.gwt.xml would work. <inherits name='org.apache.commons.validator.GenericValidator'/> I get the next error: Loading inherited module 'org.apache.commons.validator.GenericValidator' [ERROR] Unable to find 'org/apache/commons/validator/GenericValidator.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? [ERROR] Line 13: Unexpected exception while processing element 'inherits' com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:239) at com.google.gwt.dev.cfg.ModuleDefSchema$BodySchema.__inherits_begin(ModuleDefSchema.java:354) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:223) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:270) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:327) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) [ERROR] Failure while parsing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.DefaultSchema.onHandlerException(DefaultSchema.java:56) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.Schema.onHandlerException(Schema.java:66) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:233) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:270) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:327) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) [ERROR] Unexpected error while processing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.parse(ReflectiveParser.java:351) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.access$100(ReflectiveParser.java:48) at com.google.gwt.dev.util.xml.ReflectiveParser.parse(ReflectiveParser.java:398) at com.google.gwt.dev.cfg.ModuleDefLoader.nestedLoad(ModuleDefLoader.java:257) at com.google.gwt.dev.cfg.ModuleDefLoader$1.load(ModuleDefLoader.java:169) at com.google.gwt.dev.cfg.ModuleDefLoader.doLoadModule(ModuleDefLoader.java:283) at com.google.gwt.dev.cfg.ModuleDefLoader.loadFromClassPath(ModuleDefLoader.java:141) at com.google.gwt.dev.Compiler.run(Compiler.java:184) at com.google.gwt.dev.Compiler$1.run(Compiler.java:152) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81) at com.google.gwt.dev.Compiler.main(Compiler.java:159) I have commons.validator-1.3.1.jar in war/WEB-INF/lib I am using eclipse with Google Plugin. Anyone knows how it works?

    Read the article

  • XMI format error loading project on argouml

    - by Tom Brito
    Have anyone experienced this (org.argouml.model.)XmiException opening a project lastest version of argouml? XMI format error : org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace If this file was produced by a tool other than ArgoUML, please check to make sure that the file is in a supported format, including both UML and XMI versions. If you believe that the file is legal UML/XMI and should have loaded or if it was produced by any version of ArgoUML, please report the problem as a bug by going to http://argouml.tigris.org/project_bugs.html. System Info: ArgoUML version : 0.30 Java Version : 1.6.0_15 Java Vendor : Sun Microsystems Inc. Java Vendor URL : http://java.sun.com/ Java Home Directory : /usr/lib/jvm/java-6-sun-1.6.0.15/jre Java Classpath : /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/deploy.jar Operation System : Linux, Version 2.6.31-20-generic Architecture : i386 User Name : wellington User Home Directory : /home/wellington Current Directory : /home/wellington JVM Total Memory : 34271232 JVM Free Memory : 10512336 Error occurred at : Thu Apr 01 11:21:10 BRT 2010 Cause : org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:307) at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:273) at org.argouml.persistence.XmiFilePersister.doLoad(XmiFilePersister.java:261) at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1597) at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:89) at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:153) at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:281) at java.lang.Thread.run(Thread.java:619) Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:232) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136) at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98) at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:56) at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:233) ... 7 more Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace at org.netbeans.lib.jmi.xmi.XmiElement$Instance.setReferenceValues(XmiElement.java:699) at org.netbeans.lib.jmi.xmi.XmiElement$Instance.resolveAttributeValue(XmiElement.java:772) at org.netbeans.lib.jmi.xmi.XmiElement$Instance. (XmiElement.java:496) at org.netbeans.lib.jmi.xmi.XmiContext.resolveInstanceOrReference(XmiContext.java:688) at org.netbeans.lib.jmi.xmi.XmiElement$ObjectValues.startSubElement(XmiElement.java:1460) at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:219) ... 22 more ------- Full exception : org.argouml.persistence.XmiFormatException: org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:298) at org.argouml.persistence.XmiFilePersister.doLoad(XmiFilePersister.java:261) at org.argouml.ui.ProjectBrowser.loadProject(ProjectBrowser.java:1597) at org.argouml.ui.LoadSwingWorker.construct(LoadSwingWorker.java:89) at org.argouml.ui.SwingWorker.doConstruct(SwingWorker.java:153) at org.argouml.ui.SwingWorker$2.run(SwingWorker.java:281) at java.lang.Thread.run(Thread.java:619) Caused by: org.argouml.model.XmiException: XMI parsing error at line: 18: Cannot set a multi-value to a non-multivalued reference:namespace at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:307) at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:273) ... 6 more Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:232) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1359) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136) at org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98) at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:56) at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:233) ... 7 more Caused by: org.netbeans.lib.jmi.util.DebugException: Cannot set a multi-value to a non-multivalued reference:namespace at org.netbeans.lib.jmi.xmi.XmiElement$Instance.setReferenceValues(XmiElement.java:699) at org.netbeans.lib.jmi.xmi.XmiElement$Instance.resolveAttributeValue(XmiElement.java:772) at org.netbeans.lib.jmi.xmi.XmiElement$Instance. (XmiElement.java:496) at org.netbeans.lib.jmi.xmi.XmiContext.resolveInstanceOrReference(XmiContext.java:688) at org.netbeans.lib.jmi.xmi.XmiElement$ObjectValues.startSubElement(XmiElement.java:1460) at org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:219) ... 22 more the original project was created on argo v0.28.1, and (as I remember) have only use case diagrams. and yes, I'll report at the specified argo website either.. :) But anyone know anything about this exception?

    Read the article

  • Adding objects to an NSMutableArray, order seems odd when parsing from an XML file

    - by diatrevolo
    Hello: I am parsing an XML file for two elements: "title" and "noType". Once these are parsed, I am adding them to an object called aMaster, an instance of my own Master class that contains NSString variables. I am then adding these instances to an NSMutableArray on a singleton, in order to call them elsewhere in the program. The problem is that when I call them, they don't seem to be on the same NSMutableArray index... each index contains either the title OR the noType element, when it should be both... can anyone see what I may be doing wrong? Below is the code for the parser. Thanks so much!! #import "XMLParser.h" #import "Values.h" #import "Listing.h" #import "Master.h" @implementation XMLParser @synthesize sharedSingleton, aMaster; - (XMLParser *) initXMLParser { [super init]; sharedSingleton = [Values sharedValues]; aMaster = [[Master init] alloc]; return self; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { aMaster = [[Master alloc] init]; //Extract the attribute here. if ([elementName isEqualToString:@"intro"]) { aMaster.intro = [attributeDict objectForKey:@"enabled"]; } else if ([elementName isEqualToString:@"item"]) { aMaster.item_type = [attributeDict objectForKey:@"type"]; //NSLog(@"Did find item with type %@", [attributeDict objectForKey:@"type"]); //NSLog(@"Reading id value :%@", aMaster.item_type); } else { //NSLog(@"No known elements"); } //NSLog(@"Processing Element: %@", elementName); //HERE } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if(!currentElementValue) currentElementValue = [[NSMutableString alloc] initWithString:string]; else { [currentElementValue appendString:string];//[tempString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]; CFStringTrimWhitespace((CFMutableStringRef)currentElementValue); } } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if ([elementName isEqualToString:@"item"]) { [sharedSingleton.master addObject:aMaster]; NSLog(@"Added %@ and %@ to the shared singleton", aMaster.title, aMaster.noType); //Only having one at a time added... don't know why [aMaster release]; aMaster = nil; } else if ([elementName isEqualToString:@"title"]) { [aMaster setValue:currentElementValue forKey:@"title"]; } else if ([elementName isEqualToString:@"noType"]) { [aMaster setValue:currentElementValue forKey:@"noType"]; //NSLog(@"%@ should load into the singleton", aMaster.noType); } NSLog(@"delimiter"); NSLog(@"%@ should load into the singleton", aMaster.title); NSLog(@"%@ should load into the singleton", aMaster.noType); [currentElementValue release]; currentElementValue = nil; } - (void) dealloc { [aMaster release]; [currentElementValue release]; [super dealloc]; } @end

    Read the article

  • XML Parsing in Groovy strips attribute new lines

    - by Bill James
    I'm writing code where I retrieve XML from a web api, then parse that XML using Groovy. Unfortunately, it seems that both XmlParser and XmlSlurper for Groovy strip newline characters from the attributes of nodes when .text() is called. How can I get at the text of the attribute including the newlines? Sample code: def xmltest = ''' <snippet> <preSnippet att1="testatt1" code="This is line 1 This is line 2 This is line 3" > <lines count="10" /> </preSnippet> </snippet>''' def parsed = new XmlParser().parseText( xmltest ) println "Parsed" parsed.preSnippet.each { pre -> println pre.attribute('code'); } def slurped = new XmlSlurper().parseText( xmltest ) println "Slurped" slurped.children().each { preSnip -> println [email protected]() } the output of which is: Parsed This is line 1 This is line 2 This is line 3 Slurped This is line 1 This is line 2 This is line 3

    Read the article

  • Parsing XML with jQuery

    - by Jamie
    I've used this: $(document).ready(function () { $.ajax({ type: "GET", url: "http://domain.com/languages.php", dataType: "xml", success: xmlParser }); }); function xmlParser(xml) { $('#load').fadeOut(); $(xml).find("result").each(function () { $(".main").append('' + $(this).find("language").text() + ''); $(".lang").fadeIn(1000); }); } I used a local XML file on my computer, it works fine, but when I change the URL to an website, it just keeps loading all the time... How do I get this to work?

    Read the article

  • how can i update view when fragment change?

    - by user1524393
    i have a activity that have 2 sherlockfragment in this The first two pages display fragments with custom list views which are built from xml from server using AsyncTask. However, when the app runs, only one list view is displayed, the other page is just blank public class VpiAbsTestActivity extends SherlockFragmentActivity { private static final String[] CONTENT = new String[] { "1","2"}; TestFragmentAdapter mAdapter; ViewPager mPager; PageIndicator mIndicator; protected void onCreate(Bundle savedInstanceState) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); super.onCreate(savedInstanceState); setContentView(R.layout.simple_tabs); mAdapter = new TestFragmentAdapter(getSupportFragmentManager()); mPager = (ViewPager)findViewById(R.id.pager); mPager.setAdapter(mAdapter); mIndicator = (TabPageIndicator)findViewById(R.id.indicator); mIndicator.setViewPager(mPager); mIndicator.notifyDataSetChanged(); } class TestFragmentAdapter extends FragmentPagerAdapter { private int mCount = CONTENT.length; public TestFragmentAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch(position) { case 0: return new customlist(); case 1: return new customlistnotuser(); default: return null; } } @Override public int getCount() { return mCount; } public CharSequence getPageTitle(int position) { return VpiAbsTestActivity.CONTENT[position % VpiAbsTestActivity.CONTENT.length].toUpperCase(); } @Override public void destroyItem(View collection, int position, Object view) { ((ViewPager) collection).removeView((View) view); } } } what can i update viewpager when change pages ? the customlistnotuser page likes customlist page but not show public class customlistnotuser extends SherlockFragment { // All static variables static final String URL = "url"; // XML node keys static final String KEY_TEST = "test"; // parent node static final String KEY_ID = "id"; static final String KEY_TITLE = "title"; static final String KEY_Description = "description"; static final String KEY_DURATION = "duration"; static final String KEY_THUMB_URL = "thumb_url"; static final String KEY_PRICE = "price"; static final String KEY_URL = "url"; private ProgressDialog pDialog; ListView list; LazyAdapterbeth adapter; XMLParser parser = new XMLParser(); public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); new getFeed().execute(); } public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View thisfragment = inflater.inflate(R.layout.dovomi, container, false); return thisfragment; } private class getFeed extends AsyncTask<Void, Void, Document> { } protected Document doInBackground(Void... params) { XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(URL); // getting XML from URL Document doc = parser.getDomElement(xml); // getting DOM element return doc; } protected void onPostExecute(Document doc) { ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>(); NodeList nl = doc.getElementsByTagName(KEY_TEST); // looping through all song nodes <song> for (int i = 0; i < nl.getLength(); i++) { // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); Element e = (Element) nl.item(i); // adding each child node to HashMap key => value map.put(KEY_ID, parser.getValue(e, KEY_ID)); map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE)); map.put(KEY_Description, parser.getValue(e, KEY_Description)); map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION)); map.put(KEY_THUMB_URL, parser.getValue(e, KEY_THUMB_URL)); map.put(KEY_PRICE, parser.getValue(e, KEY_PRICE)); map.put(KEY_URL, parser.getValue(e, KEY_URL)); // adding HashList to ArrayList songsList.add(map); pDialog.dismiss(); } list=(ListView)getActivity().findViewById(R.id.list); // Getting adapter by passing xml data ArrayList adapter=new LazyAdapterbeth(getActivity(), songsList); list.setAdapter(adapter); // Click event for single list row list.setOnItemClickListener(new OnItemClickListener() {

    Read the article

  • android listview loadmore button with xml parsing

    - by user1780331
    Hi i have to developed listview with load more button using xml parsing in android application. Here i have faced some problem. my xml feed is empty means how can hide the load more button on last page. i have used below code here. public class CustomizedListView extends Activity { // All static variables private String URL = "http://dev.mmm.com/xctesting/xcart444pro/retrieve.php?page=1"; // XML node keys static final String KEY_SONG = "Order"; static final String KEY_TITLE = "orderid"; static final String KEY_DATE = "date"; static final String KEY_ARTIST = "payment_method"; int current_page = 1; ListView lv; LazyAdapter adapter; ProgressDialog pDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lv = (ListView) findViewById(R.id.list); ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>(); XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(URL); // getting XML from URL Document doc = parser.getDomElement(xml); // getting DOM element NodeList nl = doc.getElementsByTagName(KEY_SONG); // looping through all song nodes <song> for (int i = 0; i < nl.getLength(); i++) { // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); Element e = (Element) nl.item(i); // adding each child node to HashMap key => value map.put(KEY_ID, parser.getValue(e, KEY_ID)); map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE)); map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST)); songsList.add(map); } Button btnLoadMore = new Button(this); btnLoadMore.setText("Load More"); btnLoadMore.setBackgroundResource(R.drawable.lgnbttn); // Adding Load More button to lisview at bottom lv.addFooterView(btnLoadMore); // Getting adapter adapter = new LazyAdapter(this, songsList); lv.setAdapter(adapter); btnLoadMore.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // Starting a new async task new loadMoreListView().execute(); } }); } private class loadMoreListView extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() { // Showing progress dialog before sending http request pDialog = new ProgressDialog( CustomizedListView.this); pDialog.setMessage("Please wait.."); //pDialog.setIndeterminateDrawable(getResources().getDrawable(R.drawable.my_progress_indeterminate)); pDialog.setIndeterminate(true); pDialog.setCancelable(false); pDialog.show(); pDialog.setContentView(R.layout.custom_dialog); } protected Void doInBackground(Void... unused) { current_page += 1; // Next page request URL = "http://dev.mmm.com/xctesting/xcart444pro/retrieve.php?page=" + current_page; ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>(); XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(URL); // getting XML from URL Document doc = parser.getDomElement(xml); // getting DOM element NodeList nl = doc.getElementsByTagName(KEY_SONG); NodeList nl = doc.getElementsByTagName(KEY_SONG); if (nl.getLength() == 0) { btnLoadMore.setVisibility(View.GONE); pDialog.dismiss(); } else // looping through all item nodes <item> for (int i = 0; i < nl.getLength(); i++) { // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); Element e = (Element) nl.item(i); // adding each child node to HashMap key => value map.put(KEY_ID, parser.getValue(e, KEY_ID)); map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE)); map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST)); songsList.add(map); } // get listview current position - used to maintain scroll position int currentPosition = lv.getFirstVisiblePosition(); // Appending new data to menuItems ArrayList adapter = new LazyAdapter( CustomizedListView.this, songsList); lv.setAdapter(adapter); lv.setSelectionFromTop(currentPosition + 1, 0); } }); return (null); } protected void onPostExecute(Void unused) { // closing progress dialog pDialog.dismiss(); } } } EDIT: Here i have to run the app means the listview is displayed on perpage 4 items.my last page having 1 item.please refer this screenshot:http://screencast.com/t/fTl4FETd In last page i have to click the load more button means have to go next activity and successfully hide the button on empty page..please refer this screenshot:http://screencast.com/t/wyG5zdp3r i have to check the condition for empty page: if (nl.getLength() == 0) { btnLoadMore.setVisibility(View.GONE); pDialog.dismiss(); } How can i write the conditon fot last page?????pleas ehelp me Here i wish to need the o/p is hide the button on last page. Please help me.how can i check the condition.give me some code programmatically.

    Read the article

  • (jquery): After Ajax: success, how to limit parsing in pieces and insert piece by piece into the DOM

    - by Johua
    Let's say on ajax success the function: xmlParser(xml) is called and the XML response contains about 1500 xml elements (for example: ...) Inside it looks like: function xmlParser(xml){ var xmlDOM = $(xml); // dom object containing xml response xdom.find("book").each(function(){ var $node = $(this); // parsing all the <book> nodes }); } How can you say: parse only first 20 nodes from the xml response, do something with them. And you have a button,..when clicked parses the next 20 nodes...and so on. So bassically, is there something like: children(20)....and a function wich will parse the next 20 nodes onClick. thx

    Read the article

  • How to set message when I get Exception

    - by user1748932
    public class XMLParser { // constructor public XMLParser() { } public String getXmlFromUrl(String url) { String responseBody = null; getset d1 = new getset(); String d = d1.getData(); // text String y = d1.getYear(); // year String c = d1.getCircular(); String p = d1.getPage(); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("YearID", y)); nameValuePairs.add(new BasicNameValuePair("CircularNo", c)); nameValuePairs.add(new BasicNameValuePair("SearchText", d)); nameValuePairs.add(new BasicNameValuePair("pagenumber", p)); try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); responseBody = EntityUtils.toString(entity); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // return XML return responseBody; } public Document getDomElement(String xml) { Document doc = null; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(xml)); doc = db.parse(is); } catch (ParserConfigurationException e) { Log.e("Error: ", e.getMessage()); return null; } catch (SAXException e) { Log.e("Error: ", e.getMessage()); // i m getting Exception here return null; } catch (IOException e) { Log.e("Error: ", e.getMessage()); return null; } return doc; } /** * Getting node value * * @param elem * element */ public final String getElementValue(Node elem) { Node child; if (elem != null) { if (elem.hasChildNodes()) { for (child = elem.getFirstChild(); child != null; child = child .getNextSibling()) { if (child.getNodeType() == Node.TEXT_NODE) { return child.getNodeValue(); } } } } return ""; } /** * Getting node value * * @param Element * node * @param key * string * */ public String getValue(Element item, String str) { NodeList n = item.getElementsByTagName(str); return this.getElementValue(n.item(0)); } } I am getting Exception in this class for parsing data. I want print this message in another class which extends from Activity. Can you please tell me how? I tried much but not able to do.. public class AndroidXMLParsingActivity extends Activity { public int currentPage = 1; public ListView lisView1; static final String KEY_ITEM = "docdetails"; static final String KEY_NAME = "heading"; public Button btnNext; public Button btnPre; public static String url = "http://dev.taxmann.com/TaxmannService/TaxmannService.asmx/GetNotificationList"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // listView1 lisView1 = (ListView) findViewById(R.id.listView1); // Next btnNext = (Button) findViewById(R.id.btnNext); // Perform action on click btnNext.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { currentPage = currentPage + 1; ShowData(); } }); // Previous btnPre = (Button) findViewById(R.id.btnPre); // Perform action on click btnPre.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { currentPage = currentPage - 1; ShowData(); } }); ShowData(); } public void ShowData() { XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(url); // getting XML Document doc = parser.getDomElement(xml); // getting DOM element NodeList nl = doc.getElementsByTagName(KEY_ITEM); int displayPerPage = 5; // Per Page int TotalRows = nl.getLength(); int indexRowStart = ((displayPerPage * currentPage) - displayPerPage); int TotalPage = 0; if (TotalRows <= displayPerPage) { TotalPage = 1; } else if ((TotalRows % displayPerPage) == 0) { TotalPage = (TotalRows / displayPerPage); } else { TotalPage = (TotalRows / displayPerPage) + 1; // 7 TotalPage = (int) TotalPage; // 7 } int indexRowEnd = displayPerPage * currentPage; // 5 if (indexRowEnd > TotalRows) { indexRowEnd = TotalRows; } // Disabled Button Next if (currentPage >= TotalPage) { btnNext.setEnabled(false); } else { btnNext.setEnabled(true); } // Disabled Button Previos if (currentPage <= 1) { btnPre.setEnabled(false); } else { btnPre.setEnabled(true); } // Load Data from Index int RowID = 1; ArrayList<HashMap<String, String>> menuItems = new ArrayList<HashMap<String, String>>(); HashMap<String, String> map; // RowID if (currentPage > 1) { RowID = (displayPerPage * (currentPage - 1)) + 1; } for (int i = indexRowStart; i < indexRowEnd; i++) { Element e = (Element) nl.item(i); // adding each child node to HashMap key => value map = new HashMap<String, String>(); map.put("RowID", String.valueOf(RowID)); map.put(KEY_NAME, parser.getValue(e, KEY_NAME)); // adding HashList to ArrayList menuItems.add(map); RowID = RowID + 1; } SimpleAdapter sAdap; sAdap = new SimpleAdapter(AndroidXMLParsingActivity.this, menuItems, R.layout.list_item, new String[] { "RowID", KEY_NAME }, new int[] { R.id.ColRowID, R.id.ColName }); lisView1.setAdapter(sAdap); } } This my class where I want to Print that message

    Read the article

  • cryptic error message: Length of Bind host variable exceeds MaxLength

    - by janetsmith
    Hi, I've encountered a cryptic error message thrown by Sybase IQ server. com.sybase.jdbc2.jdbc.SybSQLException: ASA Error -1001019: Function not supported on varchars longer than 255 Length of Bind host variable exceeds MaxLength , -- (df_Heap.cxx 2145) at com.sybase.jdbc2.tds.Tds.processEed(Tds.java:2636) at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1996) at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69) at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204) at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187) at com.sybase.jdbc2.jdbc.SybStatement.updateLoop(SybStatement.java:1642) at com.sybase.jdbc2.jdbc.SybStatement.executeUpdate(SybStatement.java:1625) at com.sybase.jdbc2.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java:91) at ibs.dao.CM3RM1DAO.updateToTable(CM3RM1DAO.java:197) at ibs.dao.CM3RM1DAO.isXMLProcessed(CM3RM1DAO.java:88) at ibs.xml.parser.XMLParser.parsingXMLIntoBO(XMLParser.java:2125) at ibs.common.util.MainClass.main(MainClass.java:74) We have several columns (DESCRIPTION etc.) which are of type varchar(4000). However I can update them directly without having any error. And, I don't see any code specifying any bind variables, so I have no idea where the message comes from. This is the code (I've modified it a bit): String sql = "UPDATE TABLEX SET " + "COMPANY = ?, CUSTOMER_REFERENCE= ?, " + "STATUS = ?, CONTACT_FIRST_NAME = ?, CONTACT_LAST_NAME = ?, " + "SEVERITY = ?, PRIORITY_CODE = ?, REQUESTEDDATE = ?, " + "CLOSE_TIME = ?, LEAD_TIME = ?, CHANGE_REASON = ?, MODTIME = ? WHERE NUMBER = ?"; stmt = conn.prepareStatement(sql); for loop here { stmt.setString(...); . . stmt.executeUpdate(); } Any help is appreciated

    Read the article

  • How to debug jQuery ajax POST to .NET webservice

    - by Nick
    Hey all. I have a web service that I have published locally. I wrote an HTML page to test the web service. The webservice is expecting a string that will be XML. When I debug the web service from within VS everything works great. I can use FireBug and see that my web service is indeed being hit by they AJAX call. After deploying the web service locally to IIS it does not appear to be working. I need to know the best way to trouble shoot this problem. My AJAX js looks like this: function postSummaryXml(data) { $.ajax({ type: 'POST', url: 'http://localhost/collection/services/datacollector.asmx/SaveSummaryDisplayData', data: { xml: data }, error: function(result) { alert(result); }, success: function(result) { alert(result); } }); The web method looks like so: [WebMethod] public string SaveSummaryDisplayData(string xml) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(xml); XmlParser parser = new XmlParser(xmlDocument); IModel repository = new Repository(); if(repository.AddRecord("TestData",parser.TestValues)) { return "true"; } return "false"; } } I added the return string to the web method in an attempt to ensure that the web-service is really hit from the ajax. The problem is this: In FF the 'Success' function is always called yet the result is always 'NULL'. And the web method does not appear to have worked (no data saved). In IE the 'Error' function is called and the response is server error: 500. I think (believe it or not) IE is giving me a more accurate indication that something is wrong but I cannnot determine what the issue is. Can someone please suggest how I should expose the specific server error message? Thanks for the help!

    Read the article

  • Java - SAX parser on a XHTML document

    - by Peter
    Hey, I'm trying to write a SAX parser for an XHTML document that I download from the web. At first I was having a problem with the doctype declaration (I found out from here that it was because W3C have intentionally blocked access to the DTD), but I fixed that with: XMLReader reader = parser.getXMLReader(); reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl",true); However, now I'm experiencing a second problem. The SAX parser throws an exception when it reaches some Javascript embedded in the XHTML document: <script type="text/javascript" language="JavaScript"> function checkForm() { answer = true; if (siw && siw.selectingSomething) answer = false; return answer; }// </script> Specifically the parser throws an error once it reaches the &&'s, as it's expecting an entity reference. The exact exception is: `org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:391) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1390) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1814) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3000) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:624) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:486) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:810) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:740) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:110) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525) at MLIAParser.readPage(MLIAParser.java:55) at MLIAParser.main(MLIAParser.java:75)` I suspect (but I don't know) that if I hadn't disabled the DTD then I wouldn't get this error. So, how can I avoid the DTD error and avoid the entity reference error? Cheers, Pete

    Read the article

  • How to resolve a java.security.AccessControlException?

    - by thisisananth
    I have written an SAX parser in my Google App Engine Web application. in that I try to validate my xml file with an xsd. But I am getting an access control exception when my code is tyring to access that xsd. java.security.AccessControlException: access denied (java.io.FilePermission \WEB-INF\ApplicationResponse.xsd read) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166) at java.lang.SecurityManager.checkRead(SecurityManager.java:871) at java.io.FileInputStream.(FileInputStream.java:100) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.xsdToXMLInputSource(XMLSchemaLoader.java:830) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:708) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:554) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2459) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1807) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at sax.SAXLocalNameCount.parse(SAXLocalNameCount.java:220) at com.sms2mint.InterfaceServlet.doGet(InterfaceServlet.java:54) Please let me know how to debug this? I have tried to place the xsd in classes, webcontent, /WEB-INF but didn't help. Also declared this as a resource file in appengine-web.xml also but no avail.

    Read the article

  • NSXMLParser & memory leaks

    - by HBR
    Hi, I am parsing an XML file using a custom class that instanciates & uses NSXMLParser. On the first call everything is fine but on the second, third and later calls Instruments show tens of memory leaks on certain lines inside didEndElement, didEndElement and foundCharacters functions. I googled it and found some people having this issue, but I didn't find anything that could really help me. My Parser class looks like this : Parser.h @interface XMLParser : NSObject { NSMutableArray *data; NSMutableString *currentValue; NSArray *xml; NSMutableArray *videos; NSMutableArray *photos; NSXMLParser *parser; NSURLConnection *feedConnection; NSMutableData *downloadedData; Content *content; Video *video; BOOL nowPhoto; BOOL nowVideo; BOOL finished; BOOL webTV; } -(void)parseXML:(NSURL*)xmlURL; -(int)getCount; -(NSArray*)getData; //- (void)handleError:(NSError *)error; //@property(nonatomic, retain) NSMutableString *currentValue; @property(nonatomic, retain) NSURLConnection *feedConnection; @property(nonatomic, retain) NSMutableData *downloadedData; @property(nonatomic, retain) NSArray *xml; @property(nonatomic, retain) NSXMLParser *parser; @property(nonatomic, retain) NSMutableArray *data; @property(nonatomic, retain) NSMutableArray *photos; @property(nonatomic, retain) NSMutableArray *videos; @property(nonatomic, retain) Content *content; @property(nonatomic, retain) Video *video; @property(nonatomic) BOOL finished; @property(nonatomic) BOOL nowPhoto; @property(nonatomic) BOOL nowVideo; @property(nonatomic) BOOL webTV; @end Parser.m #import "Content.h" #import "Video.h" #import "Parser.h" #import <CFNetwork/CFNetwork.h> @implementation XMLParser @synthesize xml, parser, finished, nowPhoto, nowVideo, webTV; @synthesize feedConnection, downloadedData, data, content, photos, videos, video; -(void)parseXML:(NSURL*)xmlURL { /* NSURLRequest *req = [NSURLRequest requestWithURL:xmlURL]; self.feedConnection = [[[NSURLConnection alloc] initWithRequest:req delegate:self] autorelease]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; */ [[NSURLCache sharedURLCache] setMemoryCapacity:0]; [[NSURLCache sharedURLCache] setDiskCapacity:0]; NSXMLParser *feedParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL]; //NSXMLParser *feedParser = [[NSXMLParser alloc] initWithData:theXML]; [self setParser:feedParser]; [feedParser release]; [[self parser] setDelegate:self]; [[self parser] setShouldResolveExternalEntities:YES]; [[self parser] parse]; } - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if ([elementName isEqualToString:@"articles"]) { self.finished = NO; self.nowPhoto = NO; self.nowVideo = NO; self.webTV = NO; if (!data) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setData:tmp]; [tmp release]; return ; } } if ([elementName isEqualToString:@"WebTV"]) { self.finished = NO; self.nowPhoto = NO; self.nowVideo = NO; self.webTV = YES; if (!data) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setData:tmp]; [tmp release]; return ; } } if ([elementName isEqualToString:@"photos"]) { if (!photos) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setPhotos:tmp]; [tmp release]; return; } } if ([elementName isEqualToString:@"videos"]) { if (!videos) { NSMutableArray *tmp = [[NSMutableArray alloc] init]; [self setVideos:tmp]; [tmp release]; return; } } if ([elementName isEqualToString:@"photo"]) { self.nowPhoto = YES; self.nowVideo = NO; } if ([elementName isEqualToString:@"video"]) { self.nowPhoto = NO; self.nowVideo = YES; } if ([elementName isEqualToString:@"WebTVItem"]) { if (!video) { Video *tmp = [[Video alloc] init]; [self setVideo:tmp]; [tmp release]; } NSString *videoId = [attributeDict objectForKey:@"id"]; [[self video] setVideoId:[videoId intValue]]; } if ([elementName isEqualToString:@"article"]) { if (!content) { Content *tmp = [[Content alloc] init]; [self setContent:tmp]; [tmp release]; } NSString *contentId = [attributeDict objectForKey:@"id"]; [[self content] setContentId:[contentId intValue]]; return; } if ([elementName isEqualToString:@"category"]) { NSString *categoryId = [attributeDict objectForKey:@"id"]; NSString *parentId = [attributeDict objectForKey:@"parent"]; [[self content] setCategoryId:[categoryId intValue]]; [[self content] setParentId:[parentId intValue]]; categoryId = nil; parentId = nil; return; } if ([elementName isEqualToString:@"vCategory"]) { NSString *categoryId = [attributeDict objectForKey:@"id"]; NSString *parentId = [attributeDict objectForKey:@"parent"]; [[self video] setCategoryId:[categoryId intValue]]; [[self video] setParentId:[parentId intValue]]; categoryId = nil; parentId = nil; return; } } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { if (!currentValue) { currentValue = [[NSMutableString alloc] initWithCapacity:1000]; } if (currentValue != @"\n") [currentValue appendString:string]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { NSString *cleanValue = [currentValue stringByReplacingOccurrencesOfString:@"\n" withString:@""] ; if ([elementName isEqualToString:@"articles"]) { self.finished = YES; //[content release]; } if ([elementName isEqualToString:@"article"]) { [[self data] addObject:[self content]]; [self setContent:nil]; [self setPhotos:nil]; [self setVideos:nil]; /* [content release]; content = nil; [videos release]; videos = nil; [photos release]; photos = nil; */ } if ([elementName isEqualToString:@"WebTVItem"]) { [[self data] addObject:[self video]]; [self setVideo:nil]; //[video release]; //video = nil; } if ([elementName isEqualToString:@"title"]) { //NSLog(@"Tit: %@",cleanValue); [[self content] setTitle:cleanValue]; } if ([elementName isEqualToString:@"vTitle"]) { [[self video] setTitle:cleanValue]; } if ([elementName isEqualToString:@"link"]) { //NSURL *url = [[NSURL alloc] initWithString:cleanValue] ; [[self content] setUrl:[NSURL URLWithString:cleanValue]]; [[self content] setLink: cleanValue]; //[url release]; //url = nil; } if ([elementName isEqualToString:@"vLink"]) { [[self video] setLink:cleanValue]; [[self video] setUrl:[NSURL URLWithString:cleanValue]]; } if ([elementName isEqualToString:@"teaser"]) { NSString *tmp = [cleanValue stringByReplacingOccurrencesOfString:@"##BREAK##" withString:@"\n"]; [[self content] setTeaser:tmp]; tmp = nil; } if ([elementName isEqualToString:@"content"]) { NSString *tmp = [cleanValue stringByReplacingOccurrencesOfString:@"##BREAK##" withString:@"\n"]; [[self content] setContent:tmp]; tmp = nil; } if ([elementName isEqualToString:@"category"]) { [[self content] setCategory:cleanValue]; } if ([elementName isEqualToString:@"vCategory"]) { [[self video] setCategory:cleanValue]; } if ([elementName isEqualToString:@"date"]) { [[self content] setDate:cleanValue]; } if ([elementName isEqualToString:@"vDate"]) { [[self video] setDate:cleanValue]; } if ([elementName isEqualToString:@"thumbnail"]) { [[self content] setThumbnail:[NSURL URLWithString:cleanValue]]; [[self content] setThumbnailURL:cleanValue]; } if ([elementName isEqualToString:@"vThumbnail"]) { [[self video] setThumbnailURL:cleanValue]; [[self video] setThumbnail:[NSURL URLWithString:cleanValue]]; } if ([elementName isEqualToString:@"vDirectLink"]){ [[self video] setDirectLink: cleanValue]; } if ([elementName isEqualToString:@"preview"]){ [[self video] setPreview: cleanValue]; } if ([elementName isEqualToString:@"thumbnail_position"]){ [[self content] setThumbnailPosition: cleanValue]; } if ([elementName isEqualToString:@"url"]) { if (self.nowPhoto == YES) { [[self photos] addObject:cleanValue]; } else if (self.nowVideo == YES) { [[self videos] addObject:cleanValue]; } } if ([elementName isEqualToString:@"photos"]) { [[self content] setPhotos:[self photos]]; //[photos release]; //photos = nil; self.nowPhoto = NO; } if ([elementName isEqualToString:@"videos"]) { [[self content] setVideos:[self videos]]; //[videos release]; //videos = nil; self.nowVideo = NO; } //[cleanValue release]; //cleanValue = nil; [currentValue release]; currentValue = nil; } - (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Error" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; } -(NSArray*)getData { return data; } -(int)getCount { return [data count]; } - (void)dealloc { [parser release]; //[data release]; //[photos release]; //[videos release]; //[video release]; //[content release]; [currentValue release]; [super dealloc]; } @end Somewhere in my code, I create an instance of this class : XMLParser* feed = [[XMLParser alloc] init]; [self setRssParser:feed]; [feed release]; // Parse feed NSString *url = [NSString stringWithFormat:@"MyXMLURL"]; [[self rssParser] parseXML:[NSURL URLWithString:url]]; Now the problem is that after the first (which has zero leaks), instruments shows leaks in too many parts like this one (they are too much to enumerate them all, but all the calls look the same, I made the leaking line bold) : in didEndElement : if ([elementName isEqualToString:@"link"]) { // THIS LINE IS LEAKING => INSTRUMENTS SAYS IT IS A NSCFString LEAK [self content] setUrl:[NSURL URLWithString:cleanValue]]; [[self content] setLink: cleanValue]; } Any idea how to fix this pealse ? Could this be the same problem as the one mentioned (as an apple bug) by Lee Amtrong here :http://stackoverflow.com/questions/1598928/nsxmlparser-leaking

    Read the article

  • NullPointerException in NetBeans 6.5 IDE itself

    - by titaniumdecoy
    When I use NetBeans for almost any task (in particular, attempting to open a project), a red minus sign in the bottom right corner of the IDE starts blinking and I get the following NullPointerException error when I click it. Unfortunately I cannot reinstall NetBeans since I am using a shared computer lab account. java.lang.NullPointerException at org.openide.util.Exceptions.attachMessage(Unknown Source) at org.netbeans.modules.project.ant.Util$ErrHandler.annotate(Unknown Source) at org.netbeans.modules.project.ant.Util$ErrHandler.fatalError(Unknown Source) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:925) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at org.openide.xml.XMLUtil.parse(Unknown Source) at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProjectXml(Unknown Source) at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(Unknown Source) at org.netbeans.api.project.ProjectManager.createProject(Unknown Source) at org.netbeans.api.project.ProjectManager.access$300(Unknown Source) at org.netbeans.api.project.ProjectManager$2.run(Unknown Source) at org.netbeans.api.project.ProjectManager$2.run(Unknown Source) at org.openide.util.Mutex.readAccess(Unknown Source) at org.netbeans.api.project.ProjectManager.findProject(Unknown Source) at org.netbeans.modules.project.ui.OpenProjectList.fileToProject(Unknown Source) at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileView.run(Unknown Source) at org.openide.util.RequestProcessor$Task.run(Unknown Source) [catch] at org.openide.util.RequestProcessor$Processor.run(Unknown Source) I have recently had problems with going over my disk space quota on this computer lab account. I cleaned up my files and I now have about 10MB free. I'm not sure whether or not this is related to the problem with NetBeans.

    Read the article

  • How to process events chain.

    - by theblackcascade
    I need to process this chain using one LoadXML method and one urlLoader object: ResourceLoader.Instance.LoadXML("Config.xml"); ResourceLoader.Instance.LoadXML("GraphicsSet.xml"); Loader starts loading after first frameFunc iteration (why?) I want it to start immediatly.(optional) And it starts loading only "GraphicsSet.xml" Loader class LoadXml method: public function LoadXML(URL:String):XML { urlLoader.addEventListener(Event.COMPLETE,XmlLoadCompleteListener); urlLoader.load(new URLRequest(URL)); return xml; } private function XmlLoadCompleteListener(e:Event):void { var xml:XML = new XML(e.target.data); trace(xml); trace(xml.name()); if(xml.name() == "Config") XMLParser.Instance.GameSetup(xml); else if(xml.name() == "GraphicsSet") XMLParser.Instance.GraphicsPoolSetup(xml); } Here is main: public function Main() { Mouse.hide(); this.addChild(Game.Instance); this.addEventListener(Event.ENTER_FRAME,Game.Instance.Loop); } And on adding a Game.Instance to the rendering queue in game constuctor i start initialize method: public function Game():void { trace("Constructor"); if(_instance) throw new Error("Use Instance Field"); Initialize(); } its code is: private function Initialize():void { trace("initialization"); ResourceLoader.Instance.LoadXML("Config.xml"); ResourceLoader.Instance.LoadXML("GraphicsSet.xml"); } Thanks.

    Read the article

  • XML in Authorware 7.01

    - by Mikael
    Let me explain the setup that is being used. Right now I have an authorware program which loads an ocx control. This control receives data in the form on an XML string. This part is working properly. However I need parse this XML string in authorware and have not been successful. I have been trying to use the XMLParser Xtra. The documentation listed here shows how to create a new XMLParser object and then shows how to call the object but never explains how to link the Parser to a XML file or XML string. The information I have been using can be found here https://www.adobe.com/livedocs/authorware/7/using_aw_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Using_Authorware_7&file=09_va110.htm#224295 I need more information on how to Parse XML with this function or if there is another way to do this in Authorware. As a side note the documentation says it cannot create or append to XML, I will need to do this also inside of Authorware. Is this possible and if so, how?

    Read the article

  • BlackBerry/J2ME - SAX parse collection of objects with attributes

    - by Changqi Guo
    I have a problem with using the SAX parser to parse a XML file. It is a complex XML file, it is like the following. <Objects> <Object no="1"> <field name="PID">ilives:87877</field> <field name="dc.coverage">Charlottetown</field> <field name="fgs.ownerId">fedoraAdmin</field> </Object> <Object no="2">...... I am confused how to get the names in each field, and how to store the information of each object. import java.util.Enumeration; import java.util.Hashtable; public class XMLObject { private Hashtable mFields = new Hashtable(); private int mN = -1; public int getN() { return mN; } public void setN(int n) { mN = n; } public String getStringField(String key) { return (String) mFields.get(key); } public void setStringField(String key, String value) { mFields.put(key, value); } public String getPID() { return getStringField("PID"); } public void setPID(String pid) { setStringField("PID", pid); } public String getDcCoverage() { return getStringField("dc.coverage"); } public void setDcCoverage(String dcCoverage) { setStringField("dc.coverage", dcCoverage); } public String getFgsOwnerId() { return getStringField("fgs.ownerId"); } public void setFgsOwnerId(String fgsOwnerId) { setStringField("fgs.ownerId", fgsOwnerId); } public String dccreator() { return getStringField("dc.creator"); } public void dccreator(String dccreator) { setStringField("dc.creator", dccreator); } public String getdcformat() { return getStringField("dc.format"); } public void setdcformat(String dcformat) { setStringField("dc.format", dcformat); } public String getdcidentifier() { return getStringField("dc.identifier"); } public void setdcidentifier(String dcidentifier) { setStringField("dc.identifier", dcidentifier); } public String getdclanguage() { return getStringField("dc.language"); } public void setdclanguage(String dclanguage) { setStringField("dc.language", dclanguage); } public String getdcpublisher() { return getStringField("dc.publisher"); } public void setdcpublisher(String dcpublisher) { setStringField("dc.publisher",dcpublisher); } public String getdcsubject() { return getStringField("dc.subject"); } public void setdcsubject(String dcsubject) { setStringField("dc.subject",dcsubject); } public String getdctitle() { return getStringField("dc.title"); } public void setdctitle(String dctitle) { setStringField("dc.title",dctitle); } public String getdctype() { return getStringField("dc.type"); } public void setdctype(String dctype) { setStringField("dc.type",dctype); } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("N:"+mN+";"); Enumeration keys = mFields.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); sb.append(key+":"+mFields.get(key)+";"); } return sb.toString(); } } i used the same handler class you provided import java.io.*; import net.rim.device.api.system.Bitmap; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.InputStream; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; import org.xml.sax.helpers.DefaultHandler; public class xmlparsermainscreen extends MainScreen{ private static String xmlres = "/xml/xml1.xml"; private RichTextField textOutputField; public xmlparsermainscreen() throws ParserConfigurationException, net.rim.device.api.xml.parsers.ParserConfigurationException, IOException { InputStream inputStream = getClass().getResourceAsStream(xmlres); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buffer = new byte[10000]; int bytesRead = inputStream.read(buffer); while (bytesRead > 0) { baos.write(buffer, 0, bytesRead); bytesRead = inputStream.read(buffer); } baos.close(); String result=baos.toString(); ByteArrayInputStream bais = new ByteArrayInputStream(result.getBytes()); XMLObject[] xmlObjects = getXMLObjects(bais); for (int i = 0; i < xmlObjects.length; i++) { XMLObject o = xmlObjects[i]; textOutputField = new RichTextField(); add(textOutputField); textOutputField.setText(o.toString()); // add(new LabelField(o.toString())); } LabelField resultdis=new LabelField("resultdisplay"); add(resultdis); //textOutputField = new RichTextField(); //add(textOutputField); //textOutputField.setText(result); } static XMLObject[] getXMLObjects(InputStream is) throws ParserConfigurationException { XMLObjectHandler xmlObjectHandler = new XMLObjectHandler(); try { SAXParser parser = SAXParserFactory.newInstance() .newSAXParser(); parser.parse(is, xmlObjectHandler); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return xmlObjectHandler.getXMLObjects(); } } import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import net.rim.device.api.ui.UiApplication; public class xmlparser extends UiApplication { private xmlparser() throws ParserConfigurationException, net.rim.device.api.xml.parsers.ParserConfigurationException, IOException { pushScreen( new xmlparsermainscreen() ); } public static void main( String[] args ) throws ParserConfigurationException, net.rim.device.api.xml.parsers.ParserConfigurationException, IOException { new xmlparser().enterEventDispatcher(); } }

    Read the article

  • Spring Security beginner's question. Build failed

    - by Nitesh Panchal
    Hello, I downloaded all jar files for Spring Security 3.0 and added them to my lib folder in Netbeans 6.8. Then i added Spring framework to my web application and tried to modify applicationContext.xml as given in the pdf that shipped with Spring Security. This is it's code :- <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <http auto-config='true'> <intercept-url pattern="/**" access="ROLE_USER" /> </http> <authentication-manager> <authentication-provider> <user-service> <user name="jimi" password="jimispassword" authorities="ROLE_USER, ROLE_ADMIN" /> <user name="bob" password="bobspassword" authorities="ROLE_USER" /> </user-service> </authentication-provider> </authentication-manager> <!--bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="/WEB-INF/jdbc.properties" /> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /--> <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) --> </beans> This is my web.xml :- <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <listener> <listener-class> org.springframework.web.context.request.RequestContextListener </listener-class> </listener> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>redirect.jsp</welcome-file> </welcome-file-list> </web-app> My web application doesn't compile. I simply keep getting build failed. This is the stacktrace :- INFO: PWC1412: WebModule[/SpringSecurityDemo] ServletContext.log():Initializing Spring root WebApplicationContext INFO: Root WebApplicationContext: initialization started INFO: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@108026d: display name [Root WebApplicationContext]; startup date [Mon Mar 22 18:23:37 PDT 2010]; root of context hierarchy INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] SEVERE: Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:369) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:158) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4591) at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:535) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5193) at com.sun.enterprise.web.WebModule.start(WebModule.java:499) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1933) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605) at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90) at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126) at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241) at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1777) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:78) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:361) ... 53 more SEVERE: PWC1306: Startup of context /SpringSecurityDemo failed due to previous errors SEVERE: PWC1305: Exception during cleanup after start failed org.apache.catalina.LifecycleException: PWC2769: Manager has not yet been started at org.apache.catalina.session.StandardManager.stop(StandardManager.java:892) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5383) at com.sun.enterprise.web.WebModule.stop(WebModule.java:530) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5211) at com.sun.enterprise.web.WebModule.start(WebModule.java:499) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1933) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605) at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90) at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126) at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241) at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. at org.apache.catalina.core.StandardContext.start(StandardContext.java:5216) at com.sun.enterprise.web.WebModule.start(WebModule.java:499) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1933) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1605) at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90) at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126) at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241) at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57) at com.sun.grizzly.ContextTask.run(ContextTask.java:69) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 11 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:369) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:158) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4591) at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:535) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5193) ... 38 more Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http'. One of '{"http://www.springframework.org/schema/beans":description, "http://www.springframework.org/schema/beans":import, "http://www.springframework.org/schema/beans":alias, "http://www.springframework.org/schema/beans":bean, WC[##other:"http://www.springframework.org/schema/beans"]}' is expected. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1777) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:685) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:78) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:361) ... 53 more

    Read the article

  • Convert XML to Java DTO and back in GWT

    - by RB
    Looking for best approach to convert Java DTO to XML and back while using GWT. I saw GWT has XMLParser in its client package which is a DOM Parser. I'm looking for more like a JAXB kind of plugin feature that I can use with GWT.

    Read the article

  • Strange iPhone memory leak in xml parser

    - by Chris
    Update: I edited the code, but the problem persists... Hi everyone, this is my first post here - I found this place a great ressource for solving many of my questions. Normally I try my best to fix anything on my own but this time I really have no idea what goes wrong, so I hope someone can help me out. I am building an iPhone app that parses a couple of xml files using TouchXML. I have a class XMLParser, which takes care of downloading and parsing the results. I am getting memory leaks when I parse an xml file more than once with the same instance of XMLParser. Here is one of the parsing snippets (just the relevant part): for(int counter = 0; counter < [item childCount]; counter++) { CXMLNode *child = [item childAtIndex:counter]; if([[child name] isEqualToString:@"PRODUCT"]) { NSMutableDictionary *product = [[NSMutableDictionary alloc] init]; for(int j = 0; j < [child childCount]; j++) { CXMLNode *grandchild = [child childAtIndex:j]; if([[grandchild stringValue] length] > 1) { NSString *trimmedString = [[grandchild stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; [product setObject:trimmedString forKey:[grandchild name]]; } } // Add product to current category array switch (categoryId) { case 0: [self.mobil addObject: product]; break; case 1: [self.allgemein addObject: product]; break; case 2: [self.besitzeIch addObject: product]; break; case 3: [self.willIch addObject: product]; break; default: break; } [product release]; } } The first time, I parse the xml no leak shows up in instruments, the next time I do so, I got a lot of leaks (NSCFString / NSCFDictionary). Instruments points me to this part inside CXMLNode.m, when I dig into a leaked object: theStringValue = [NSString stringWithUTF8String:(const char *)theXMLString]; if ( _node->type != CXMLTextKind ) xmlFree(theXMLString); } return(theStringValue); I really spent a long time and tried multiple approaches to fix this, but to no avail so far, maybe I am missing something essential? Any help is highly appreciated, thank you!

    Read the article

  • Is garbage collection supported for iPhone applications?

    - by Mustafa
    Does the iPhone support garbage collection? If it does, then what are the alternate ways to perform the operations that are performaed using +alloc and -init combination: NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:xmlData]; UIImage *originalImage = [[UIImage alloc] initWithData:data]; detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailView bundle:[NSBundle mainBundle]] autorelease]; ... and other commands. Thank you in advance for any help or direction that you can provide.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >