Norman, app-schema-resolver is meant to be used with AppSchemaConfiguration for schemas that are not known at compile time. Most XML Configuration instances (those with compiled Java bindings) are meant to use internal means to resolve dependencies from jar files. I do not know why this is not happening in your case.
Justin is our resident XML guru (and module maintainer); Justin, can you suggest why Norman is seeing network requests for schemas? I do not think he has any app-schema dependencies. Could a missing schema cause the EMF to seek it on the network? Kind regards, Ben. On 07/02/12 17:26, NORMAN MANN wrote: > Hi Ben, > I really appreciate your repsonse. > > I have been looking into app-schema-resolver quite a bit yesterday. > However , I couldn't understand what I need to do with the Configuration > object? Do I need to set it somewhere, for it to be picked up? > > I kind of came to the conclusion yesterday, that it's only designed to be > used "internally" when you have access to the Parser? > > For my usage, I am using a WebMapServer object which makes the getCaps > request etc. However, this depends on other scheams (inspire, XML) and will > download those. > This isn't a huge problem per say, but the W3.org schema sometimes takes a > very long time to download and causes the contention issue I demonstrated > below. > I would much prefer to load them locally from the disk. To the W3 end, I did > notice that you may have packaged up that schema already ? > > <dependency> > <groupId>org.geotools.schemas</groupId> > <artifactId>xml-1.0</artifactId> > <version>1.0.0-3</version> > </dependency> > > I did add that to my Pom, but I don't think it made any difference. But, I > guess that's back to my Configuration object question, what do I need to do > with it for it to be picked up? > I did also take a look at the AppSchemaResolver tests, but that uses > Schemas.findSchemas(configuration) to check the configuration works, as > opposed to setting it in a context or whatever, Unless that's enough? I was > looking in the Schema/DocumentFactory source code and couldn't see where they > would pick up a Configuration object. > > Anymore help very much appreciated. > > Thanks > > Norman > > From: Ben Caradoc-Davies<[email protected]> > To: NORMAN MANN<[email protected]> > Cc: Jody Garnett<[email protected]>; > "[email protected]"<[email protected]> > Sent: Tuesday, 7 February 2012, 4:51 > Subject: Re: [Geotools-gt2-users] Dead lock? Or caching XMLs chemas? > > Norman, > > app-schema-resolver is designed to download and cache external published > application schemas and their dependencies. It will only download the > schemas that the XML infrastructure needs (on demand). See the javadocs > and also: > http://docs.geotools.org/latest/userguide/extension/app-schema.html#application-schema-resolver > > The app-schema-packages module shows how to bundle published schemas > into maven artifacts (jar files) suitable for use with app-schema-resolver. > > Kind regards, > Ben. > > > On 06/02/12 16:57, NORMAN MANN wrote: >> Thanks Jody, appreciate your help. >> Could you point me in the direction of which part of the source code? >> I have been looking at SchemaFactory.loadSchemas which I don't think is what >> I need. >> I have also been looking at app-schema-resolver which looks like more what I >> need, however, I am not sure how to set this globally (if possible?). >> >> Thanks in advance, >> >> Norman >> >> >> From: Jody Garnett<[email protected]<mailto:[email protected]>> >> To: NORMAN MANN<[email protected]<mailto:[email protected]>> >> Cc: >> "[email protected]<mailto:[email protected]>"<[email protected]<mailto:[email protected]>> >> Sent: Sunday, 5 February 2012, 10:23 >> Subject: Re: [Geotools-gt2-users] Dead lock? Or caching XMLs chemas? >> >> You should package well known schemas as jars and contribute them into >> the mix. This is used when the source of the Schema is unavailable; or >> if your app is behind a fire wall. See the source code for examples of >> the OGC schemas handled this way. >> >> -- >> Jody Garnett >> >> On 05/02/2012, at 5:52 PM, NORMAN >> MANN<[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> >> wrote: >> >>> >>> >>> Anyone? >>> Any advice would really be appreciated. >>> >>> Especially on storing schemas locally as this may well avoid the contention >>> . >>> >>> Thanks >>> >>> Norman >>> >>> ------------------------------ >>> On Fri, Feb 3, 2012 3:26 PM GMT NORMAN MANN wrote: >>> >>>> Hi All, >>>> >>>> I am using geotools to generate images based on a remote WMS, and a local >>>> WFS. >>>> To increase throughput, I am attempted to make the software multithreaded >>>> (in a non application server environment). >>>> However I think I am getting deadlock (well maybe not deadlock, but the >>>> threads seem to be stuck waiting for one of the threads waiting to >>>> download XML schemas over the internet). >>>> >>>> On initial startup of WebMapServer object (each thread keeps it's own >>>> instance of a WebMapServer for performance - downloading XML schemas in >>>> particularly time consuming) it seems to download lots of XML schemas from >>>> the getCapabilities document for the WMS. >>>> >>>> Ideally I would like to cache these on the file system, is this possible, >>>> if so how? This may alleviate the problem in terms of time (it seems to >>>> take a long time) taken to download the various XML schemas. But would be >>>> preferential anyway to reduce startup time. >>>> >>>> Secondly each WebMapServer object seems to be waiting on a lock on >>>> org.geotools.xml.SchemaFactory.getInstance which is locked by one of the >>>> WebMapServer objects. >>>> Does this have to be the case, or can I remove this area as a bottle neck? >>>> Is this is a bug? I can see that SchemaFactory.getInstance seems to be >>>> intended to be thread safe. >>>> >>>> I have pasted the stack of some of the example threads below, and any >>>> help/advice would be very much appreciated!! >>>> >>>> Thanks >>>> >>>> Norman >>>> >>>> >>>> THREAD with LOCK >>>> >>>> "Piper Processor 3" prio=1 tid=0x0966e9d0 nid=0x3b4f runnable >>>> [0xe7c8f000..0xe7c90130] >>>> at java.net.SocketInputStream.socketRead0(Native Method) >>>> at java.net.SocketInputStream.read(SocketInputStream.java:129) >>>> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) >>>> at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) >>>> at java.io.BufferedInputStream.read(BufferedInputStream.java:313) >>>> - locked<0xeabe3e70> (a java.io.BufferedInputStream) >>>> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:606) >>>> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554) >>>> at >>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936) >>>> - locked<0xeabe2480> (a >>>> sun.net.www.protocol.http.HttpURLConnection) >>>> at >>>> org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) >>>> at >>>> org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:255) >>>> at >>>> org.geotools.xml.SchemaFactory.getRealInstance(SchemaFactory.java:305) >>>> - locked<0xeb52acf0> (a org.geotools.xml.SchemaFactory) >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:265) >>>> - locked<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.xsi.SchemaHandler.compress(SchemaHandler.java:430) >>>> at >>>> org.geotools.xml.handlers.xsi.RootHandler.getSchema(RootHandler.java:117) >>>> at org.geotools.xml.XSISAXHandler.getSchema(XSISAXHandler.java:257) >>>> at >>>> org.geotools.xml.SchemaFactory.getRealInstance(SchemaFactory.java:310) >>>> - locked<0xeb52acf0> (a org.geotools.xml.SchemaFactory) >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:265) >>>> - locked<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.xsi.SchemaHandler.compress(SchemaHandler.java:385) >>>> at >>>> org.geotools.xml.handlers.xsi.RootHandler.getSchema(RootHandler.java:117) >>>> at org.geotools.xml.XSISAXHandler.getSchema(XSISAXHandler.java:257) >>>> at >>>> org.geotools.xml.SchemaFactory.getRealInstance(SchemaFactory.java:310) >>>> - locked<0xeb52acf0> (a org.geotools.xml.SchemaFactory) >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:265) >>>> - locked<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.xsi.SchemaHandler.compress(SchemaHandler.java:430) >>>> at >>>> org.geotools.xml.handlers.xsi.RootHandler.getSchema(RootHandler.java:117) >>>> at org.geotools.xml.XSISAXHandler.getSchema(XSISAXHandler.java:257) >>>> at >>>> org.geotools.xml.SchemaFactory.getRealInstance(SchemaFactory.java:310) >>>> - locked<0xeb52acf0> (a org.geotools.xml.SchemaFactory) >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:265) >>>> - locked<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.ElementHandlerFactory.startPrefixMapping(ElementHandlerFactory.java:87) >>>> at >>>> org.geotools.xml.XMLSAXHandler.startElement(XMLSAXHandler.java:370) >>>> at >>>> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) >>>> at >>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:176) >>>> at >>>> org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:133) >>>> at >>>> org.geotools.data.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:54) >>>> at >>>> org.geotools.data.wms.WMS1_0_0$GetCapsRequest.createResponse(WMS1_0_0.java:231) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:440) >>>> at >>>> org.geotools.data.wms.WebMapServer.issueRequest(WebMapServer.java:405) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.negotiateVersion(AbstractOpenWebService.java:240) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:95) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:81) >>>> at org.geotools.data.wms.WebMapServer.<init>(WebMapServer.java:368) >>>> >>>> >>>> THREADS without lock.... >>>> "Piper Processor 2" prio=1 tid=0x0964bf50 nid=0x3b4e waiting for monitor >>>> entry [0xe7d10000..0xe7d10fb0] >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:265) >>>> - waiting to lock<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.ElementHandlerFactory.startPrefixMapping(ElementHandlerFactory.java:87) >>>> at >>>> org.geotools.xml.XMLSAXHandler.startElement(XMLSAXHandler.java:370) >>>> at >>>> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) >>>> at >>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:176) >>>> at >>>> org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:133) >>>> at >>>> org.geotools.data.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:54) >>>> at >>>> org.geotools.data.wms.WMS1_0_0$GetCapsRequest.createResponse(WMS1_0_0.java:231) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:440) >>>> at >>>> org.geotools.data.wms.WebMapServer.issueRequest(WebMapServer.java:405) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.negotiateVersion(AbstractOpenWebService.java:240) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:95) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:81) >>>> at org.geotools.data.wms.WebMapServer.<init>(WebMapServer.java:368) >>>> >>>> "Piper Processor 1" prio=1 tid=0x0964bdc8 nid=0x3b4d waiting for monitor >>>> entry [0xe7d91000..0xe7d92030] >>>> at >>>> org.geotools.xml.SchemaFactory.getInstance(SchemaFactory.java:208) >>>> - waiting to lock<0xef884168> (a java.lang.Class) >>>> at >>>> org.geotools.xml.handlers.ElementHandlerFactory.startPrefixMapping(ElementHandlerFactory.java:115) >>>> at >>>> org.geotools.xml.XMLSAXHandler.startElement(XMLSAXHandler.java:383) >>>> at >>>> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) >>>> at >>>> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >>>> Source) >>>> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >>>> Source) >>>> at >>>> org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) >>>> at javax.xml.parsers.SAXParser.parse(SAXParser.java:176) >>>> at >>>> org.geotools.xml.DocumentFactory.getInstance(DocumentFactory.java:133) >>>> at >>>> org.geotools.data.wms.response.WMSGetCapabilitiesResponse.<init>(WMSGetCapabilitiesResponse.java:54) >>>> at >>>> org.geotools.data.wms.WMS1_0_0$GetCapsRequest.createResponse(WMS1_0_0.java:231) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOpenWebService.java:440) >>>> at >>>> org.geotools.data.wms.WebMapServer.issueRequest(WebMapServer.java:405) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.negotiateVersion(AbstractOpenWebService.java:240) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:95) >>>> at >>>> org.geotools.data.ows.AbstractOpenWebService.<init>(AbstractOpenWebService.java:81) >>>> at org.geotools.data.wms.WebMapServer.<init>(WebMapServer.java:368) >>>> at >>>> com.bt.mbe.processing.PIPERProcessor.getWMSLayer(PIPERProcessor.java:369) >>>> at >>>> com.bt.mbe.processing.PIPERProcessor.processItem(PIPERProcessor.java:269) >>>> at >>>> com.bt.mbe.processing.PIPERProcessor.run(PIPERProcessor.java:211) >>>> at java.lang.Thread.run(Thread.java:595) >>> >>> ------------------------------------------------------------------------------ >>> Try before you buy = See our experts in action! >>> The most comprehensive online learning library for Microsoft developers >>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >>> Metro Style Apps, more. Free future releases when you subscribe now! >>> http://p.sf.net/sfu/learndevnow-dev2 >>> _______________________________________________ >>> GeoTools-GT2-Users mailing list >>> [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>> >>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> >> >> > > -- > Ben > Caradoc-Davies<[email protected]<mailto:[email protected]>> > Software Engineer > CSIRO Earth Science and Resource Engineering > Australian Resources Research Centre > > > -- Ben Caradoc-Davies <[email protected]> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ GeoTools-GT2-Users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
