itm / wsn-device-drivers

Drivers for Wireless Sensor Network Devices
Other
6 stars 4 forks source link

Loading RXTX library doesn't work on ARM architecture when packed in OneJar #57

Closed kinanhakim closed 13 years ago

mlegenhausen commented 13 years ago

What is the os.arch of the arm system?

danbim commented 13 years ago

Actually it works fine for the driver itself but makes problems in combination with OneJar which is used in Testbed Runtime. We'll have to elaborate a little further to pinpoint the actual error source.

danbim commented 13 years ago

In TR we used the following OneJar configuration for packing:

    <build>
        <plugins>
            <plugin>
                <groupId>org.dstovall</groupId>
                <artifactId>onejar-maven-plugin-rc8fix</artifactId>
                <version>1.4.10</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <mainClass>de.uniluebeck.itm.tr.iwsn.cmdline.Main</mainClass>
                            <onejarVersion>0.98-RC2</onejarVersion>
                            <attachToBuild>true</attachToBuild>
                            <classifier>onejar</classifier>
                            <urlFactory>com.simontuffs.onejar.JarClassLoader$OneJarURLFactory</urlFactory>
                            <binlibs>
                                <!-- mac os x -->
                                <!--
                                <binlib>
                                    <os>mac os x</os>
                                    <arch>x86</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/macosx</directory>
                                        <includes>
                                            <include>librxtxSerial.jnilib</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                                -->
                                <binlib>
                                    <os>mac os x</os>
                                    <arch>x86_64</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/macosx
                                        </directory>
                                        <includes>
                                            <include>librxtxSerial.jnilib</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                                <!-- windows -->
                                <binlib>
                                    <os>windows</os>
                                    <arch>x86</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/windows32
                                        </directory>
                                        <includes>
                                            <include>rxtxParallel.dll</include>
                                            <include>rxtxSerial.dll</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                                <binlib>
                                    <os>windows</os>
                                    <arch>x86_64</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/windows64
                                        </directory>
                                        <includes>
                                            <include>rxtxSerial.dll</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                                <!-- linux -->
                                <binlib>
                                    <os>linux</os>
                                    <arch>x86</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/linux32
                                        </directory>
                                        <includes>
                                            <include>librxtxParallel.so</include>
                                            <include>librxtxSerial.so</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                                <binlib>
                                    <os>linux</os>
                                    <arch>x86_64</arch>
                                    <fileSet>
                                        <directory>${project.basedir}/../wsn-device-drivers/src/main/resources/linux64
                                        </directory>
                                        <includes>
                                            <include>librxtxSerial.so</include>
                                        </includes>
                                    </fileSet>
                                </binlib>
                            </binlibs>
                        </configuration>
                        <goals>
                            <goal>one-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

which does NOT work. However, in wsn-device-utils the "same" configuration WITHOUT <binlibs> seems to work.

danbim commented 13 years ago

We can close this ticket as we now stopped using OneJar in TR now. Instead of OneJar we use the maven-assembly-plugin (single-goal) which unpacks all dependencies and packs them into one jar. By this, the issue "does not occur anymore".