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

[#351] Disable nu.validator language detection to fix random NPE #359

Merged
merged 2 commits into from
Sep 19, 2018

Conversation

tkaik
Copy link
Contributor

@tkaik tkaik commented Sep 18, 2018

Description

enableLanguageDetection flag set to false for SimpleDocumentValidator object (NuValidator).

Motivation and Context

Related issue: #351

Following error is sometimes thrown in worker logs:

2018-09-17T12:31:59,018 | ERROR | com.cognifide.aet.worker | ComparatorDispatcherImpl           68 | Comparator{type=source, filters=[], parameters={comparator=w3c-html5}} throw error:
com.cognifide.aet.job.api.exceptions.ProcessingException: null
        at com.cognifide.aet.job.common.comparators.w3chtml5.W3cHtml5Comparator.compare(W3cHtml5Comparator.java:75) ~[?:?]
        at com.cognifide.aet.worker.impl.ComparatorDispatcherImpl.run(ComparatorDispatcherImpl.java:66) [52:com.cognifide.aet.worker:3.0.0]
        at com.cognifide.aet.worker.listeners.ComparatorMessageListenerImpl.onMessage(ComparatorMessageListenerImpl.java:95) [52:com.cognifide.aet.worker:3.0.0]
        at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1404) [127:org.apache.activemq.activemq-osgi:5.15.2]
        at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [127:org.apache.activemq.activemq-osgi:5.15.2]
        at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [127:org.apache.activemq.activemq-osgi:5.15.2]
        at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133) [127:org.apache.activemq.activemq-osgi:5.15.2]
        at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48) [127:org.apache.activemq.activemq-osgi:5.15.2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.NullPointerException
        at com.cybozu.labs.langdetect.DetectorFactory.addProfile(DetectorFactory.java:135) ~[?:?]
        at com.cybozu.labs.langdetect.DetectorFactory.loadProfile(DetectorFactory.java:108) ~[?:?]
        at nu.validator.xml.LanguageDetectingXMLReaderWrapper.initialize(LanguageDetectingXMLReaderWrapper.java:188) ~[?:?]
        at nu.validator.validation.SimpleDocumentValidator.<init>(SimpleDocumentValidator.java:218) ~[?:?]
        at nu.validator.validation.SimpleDocumentValidator.<init>(SimpleDocumentValidator.java:154) ~[?:?]
        at com.cognifide.aet.job.common.comparators.w3chtml5.wrapper.NuValidatorWrapper.setupAndValidate(NuValidatorWrapper.java:58) ~[?:?]
        at com.cognifide.aet.job.common.comparators.w3chtml5.wrapper.NuValidatorWrapper.validate(NuValidatorWrapper.java:48) ~[?:?]
        at com.cognifide.aet.job.common.comparators.w3chtml5.W3cHtml5Comparator.compare(W3cHtml5Comparator.java:70) ~[?:?]

We don't know the root cause of this error and it's hard to provide any reproduction steps - it seems like it's randomly thrown for few different URLs for some test suites. The error is thrown in the language detection library (dependency of nu validator) - disabling this feature seems to be fixing the issue.

Screenshots (if appropriate):

aet w3c nullpointerexception

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

Copy link
Contributor

@malaskowski malaskowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update changelog before merging this issue.

@tkaik tkaik merged commit f72ec55 into master Sep 19, 2018
@tkaik tkaik deleted the bugfix/w3c-npe branch September 19, 2018 08:19
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

Successfully merging this pull request may close these issues.

2 participants