Fork me on GitHub

Known Issues

Element type "devices" must be declared

Issue Description The log contains a message that reading of UAS data failed, because Element type "devices" must be declared.
22:35:02 [update-operation] WARN  n.s.u.internal.data.XmlDataHandler - Error while reading UAS data: Element type "devices" must be declared. (line: 20917)
22:35:02 [update-operation] WARN  n.s.u.datareader.XmlDataReader - Element type "devices" must be declared.
Exception in thread "update-operation" net.sf.qualitycheck.exception.IllegalStateOfArgumentException: The passed arguments have caused an invalid state: Argument 'data' must not be empty.
    at net.sf.uadetector.datastore.AbstractRefreshableDataStore.checkData(AbstractRefreshableDataStore.java:61)
    at net.sf.uadetector.datastore.AbstractRefreshableDataStore.setData(AbstractRefreshableDataStore.java:229)
    at net.sf.uadetector.datastore.UpdateOperationTask.call(UpdateOperationTask.java:36)
    at net.sf.uadetector.datastore.AbstractUpdateOperation$1.run(AbstractUpdateOperation.java:197)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
Explanation Since device categorization is available within the UAS data beginning October 2013 all previously published versions print the described log message. It means that UADetector cannot work with the most recent version of the database from http://user-agent-string.info , because the XML schema changed. In this case the library falls back to the previously cached file or the delivered database within uadetector-resources .
Stay cool, the library continues to work normally but without updates. End of October 2013 an update of UADetector support device categorization, but you can create an snapshot from the sources today if you need it earlier.
Corresponding Issue https://github.com/before/uadetector/issues/44
Affected Versions <= uadetector-core-0.9.9 ,
<= uadetector-resources-2013.09

Error while reading UAS data

Issue Description The log contains a message that reading of UAS data failed.
[2013-06-20 20:17:13] WARN  [ernal.data.XmlDataHandler] :265 - Error while reading UAS data: Document root element "h1", must match DOCTYPE root "null". (line: 1)
[2013-06-20 20:17:13] WARN  [.datareader.XmlDataReader] :112 - Document root element "h1", must match DOCTYPE root "null".
[2013-06-20 20:17:13] WARN  [perationWithCacheFileTask] :203 - The read content is faulty and can not be processed correctly.
java.lang.IllegalStateException: The read in content can not be transformed to an instance of 'Data'.
    at net.sf.uadetector.datastore.UpdateOperationWithCacheFileTask.readAndSave(UpdateOperationWithCacheFileTask.java:115)
    at net.sf.uadetector.datastore.UpdateOperationWithCacheFileTask.readDataIfNewerAvailable(UpdateOperationWithCacheFileTask.java:193)
    at net.sf.uadetector.datastore.UpdateOperationWithCacheFileTask.call(UpdateOperationWithCacheFileTask.java:183)
    at net.sf.uadetector.datastore.AbstractUpdateOperation$1.run(AbstractUpdateOperation.java:161)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
[2013-06-20 20:17:13] INFO  [perationWithCacheFileTask] :212 - Reading fallback data...
Explanation UADetector pulls updates to its user agent database from http://user-agent-string.info . Sometimes the website gets overloaded or has other issues.
We put a lot of work into ensuring that UADetector will continue to work with a recent version of the database even if downloading or parsing of the latest version fails. (i.e. Don't worry about those errors if they are occasional and intermittent.)
Corresponding Issue https://github.com/before/uadetector/issues/31
Affected Versions <= uadetector-core-0.9.9 ,
<= uadetector-resources-2013.09

Cleanup Threads

Issue Description If an application uses an implementation of UserAgentStringParser with updating functionality like UADetectorServiceFactory.getCachingAndUpdatingParser() or UADetectorServiceFactory.getOnlineUpdatingParser() its possible to get the following warnings in Apache Tomcat during shutdown:
Jun 18, 2013 10:18:57 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/gwx-tocs-rest] appears to have started a thread named [Thread-6] but has failed to stop it. This is very likely to create a memory leak.
Jun 18, 2013 10:18:57 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/gwx-tocs-rest] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak.
Jun 18, 2013 10:18:57 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
When using a profiler you can see that Thread-6 and Thread-7 continue to run even though the application has been undeployed. It also causes the Classloader that no longer required objects of an uninstalled UADetector (within a webapp for example) will never be cleaned up during Garbage Collection.
Explanation In environments where the JVM will never shut down while reinstalling UADetector, it is necessary to manually shutdown running threads. Therefore we provide since uadetector-core-0.9.6 UserAgentStringParser#shutdown() and ExecutorServices#shutdownAll() to stop running executors and schedulers if necessary.
A number of Dependency Injection containers support the annotation @PreDestroy which is useful to indicate methods that should be called when the container is shutting down. We annotated the method UpdatingUserAgentStringParserImpl#shutdown() since uadetector-core-0.9.10 with it. If your container support these annotation and you registered an UserAgentStringParser with updating functionality as bean everything is done by convention.
Corresponding Issues https://github.com/before/uadetector/issues/4
https://github.com/before/uadetector/issues/46
Affected Versions >= uadetector-core-0.5.0 and <= uadetector-core-0.9.5 ,
>= uadetector-resources-2012.08 and <= uadetector-resources-2013.05