Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autovalidation for GoogleImageSitemapGenerator throws RuntimeException #47

Open
skubski opened this issue Jun 27, 2019 · 0 comments
Open

Comments

@skubski
Copy link

skubski commented Jun 27, 2019

Using auto validation in combination with a GoogleImageSitemapGenerator fails.

Code extract:

GoogleImageSitemapGenerator generator = GoogleImageSitemapGenerator.builder("https://www.google.com", new File(System.getProperty("java.io.tmpdir")))
                                                                           .gzip(false)
                                                                           .autoValidate(true)
                                                                           .allowEmptySitemap(false)
                                                                           .allowMultipleSitemaps(true)
                                                                           .build();

Image image = new Image.ImageBuilder("https://www.google.com/bug.jpg").build();

generator.addUrl(new GoogleImageSitemapUrl.Options("https://www.google.com/any").images(image)
                                                                                .changeFreq(ChangeFreq.DAILY)
                                                                                .priority(Priority.DEFAULT.getValue())
                                                                                .lastMod(new Date())
                                                                                .build());

generator.write();

Exception:

Exception in thread "main" java.lang.RuntimeException: Sitemap file failed to validate (bug?)
	at com.redfin.sitemapgenerator.SitemapGenerator.writeSiteMap(SitemapGenerator.java:280)
	at com.redfin.sitemapgenerator.SitemapGenerator.write(SitemapGenerator.java:173)
	at com.redfin.sitemapgenerator.GoogleImageSitemapGenerator.write(GoogleImageSitemapGenerator.java:11)
	at be.netmediaeurope.promoplatform.promobutler.controllers.sitemap.service.v2.delegate.ProducerDetailSitemapGeneratorDelegate.main(ProducerDetailSitemapGeneratorDelegate.java:108)
Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 18; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'image:image'.

Missing .xsd
sitemap-image.xsd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant