I am using the JAVA OnSite API 1.7.1.0 WURFL from your company via Maven.
For some Reason the Dependencies are not correct working in my Project.
I have two Moduls:
1. AA - Device Detector
2. BB - Module using the Device Detector
Pom xml from AA:
Code: Select all
<repositories>
<repository>
<id>net.sourceforge.wurfl</id>
<name>net.sourceforge.wurfl</name>
<url>https://xxxxxxxxxx/scientiamobile</url>
</repository>
</repositories>
[…]
<dependency>
<groupId>net.sourceforge.wurfl</groupId>
<artifactId>wurfl</artifactId>
<version>1.7.1.0</version>
</dependency>
The Engine is initialised like this:
Code: Select all
private DetectorEngine() {
logger.info("Initialising DetectorEngine...");
WURFLResource res = new XMLResource(getClass().getClassLoader().getResourceAsStream("wurfl.xml"), "__notNull");
this.engine = new GeneralWURFLEngine(res);
this.engine.setEngineTarget(EngineTarget.accuracy);
this.engine.setCapabilityFilter(CAPABILITIES);
logger.info("DetectorEngine initialised.");
}
BUT:
If i use the module AA in BB i get this Exception:
Code: Select all
java.lang.ClassNotFoundException: org.apache.commons.collections.iterators.ReverseListIterator
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at net.sourceforge.wurfl.core.resource.DefaultWURFLModel.getDeviceAncestor(DefaultWURFLModel.java:348)
at net.sourceforge.wurfl.core.resource.DefaultWURFLModel.applyPatches(DefaultWURFLModel.java:184)
at net.sourceforge.wurfl.core.resource.DefaultWURFLModel.init(DefaultWURFLModel.java:130)
at net.sourceforge.wurfl.core.resource.DefaultWURFLModel.<init>(DefaultWURFLModel.java:107)
at net.sourceforge.wurfl.core.GeneralWURFLEngine.init(GeneralWURFLEngine.java:340)
at net.sourceforge.wurfl.core.GeneralWURFLEngine.initIfNeeded(GeneralWURFLEngine.java:319)
at net.sourceforge.wurfl.core.GeneralWURFLEngine.getDeviceForRequest(GeneralWURFLEngine.java:459)
In the pom.xml of Module BB i need following:
Code: Select all
<!-- Device Detector -->
<dependency>
<groupId>AA</groupId>
<artifactId>AA</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
I would like to know if i implemented WURFL correctly or a change on my code/dependency handling is needed.
(In the .m2 local folder it downloads the wurfl jar and my own device-detector jar. But it does not work withouth commons-collections and commons-lang)
With greetings