Catched FileNotFoundException (natives)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Catched FileNotFoundException (natives)

alexis
Hello,

I have this error when i run jar with command line (linuw, jdk1.7):

Catched FileNotFoundException: /home/alexis/Documents/geographer/target/geographer-0.9.7-natives-linux-i586.jar (Aucun fichier ou dossier de ce type), while addNativeJarLibsImpl(classFromJavaJar class com.jogamp.common.os.Platform, classJarURI jar:file:/home/alexis/Documents/geographer/target/geographer-0.9.7.jar!/com/jogamp/common/os/Platform.class, nativeJarBaseName geographer-0.9.7-natives-linux-i586.jar): [ file:/home/alexis/Documents/geographer/target/geographer-0.9.7.jar -> file:/home/alexis/Documents/geographer/target/ ] + geographer-0.9.7-natives-linux-i586.jar -> slim: jar:file:/home/alexis/Documents/geographer/target/geographer-0.9.7-natives-linux-i586.jar!/
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Can't load library: /home/alexis/Documents/geographer/target/libgluegen-rt.so
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)
        at java.lang.Runtime.load0(Runtime.java:792)
        at java.lang.System.load(System.java:1059)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:551)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:414)
     ...

I use Netbeans and maven plugin on netbeans.

I don't understand why it search geographer-0.9.7-natives-linux-i586.jar. geographer is just name of my program.

I have adding natives :
My pom is :


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.thema</groupId>
  <artifactId>geographer</artifactId>
  <version>0.9.7</version>
  <packaging>jar</packaging>

  <name>Geographer</name>
  <url>http://maven.apache.org</url>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Title>${project.groupId}.${project.artifactId}</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor>ThéMA</Implementation-Vendor>
                            <Main-Class>org.thema.geographer.MainFrame</Main-Class>
                        </manifestEntries>
                    </archive>

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <createDependencyReducedPom>true</createDependencyReducedPom>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>common</artifactId>
            <version>1.3</version>
    </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>drawshape</artifactId>
            <version>1.2</version>
        </dependency>
    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.postgis</groupId>
      <artifactId>postgis-jdbc</artifactId>
      <version>1.3.3</version>
      <exclusions>
        <exclusion>
          <artifactId>postgresql</artifactId>
          <groupId>postgresql</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>10.10.1.1</version>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>9.2-1004-jdbc4</version>
    </dependency>
    <dependency>
      <groupId>java3d</groupId>
      <artifactId>j3d-core</artifactId>
      <version>1.3.1</version>
    </dependency>
    <dependency>
      <groupId>java3d</groupId>
      <artifactId>j3d-core-utils</artifactId>
      <version>1.3.1</version>
    </dependency>
   
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-linux-i586</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-linux-amd64</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-macosx-universal</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-windows-amd64</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.gluegen</groupId>
      <artifactId>gluegen-rt</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-windows-i586</classifier>
    </dependency>
   
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-linux-i586</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-linux-amd64</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-macosx-universal</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-windows-amd64</classifier>
    </dependency>
    <dependency>
      <groupId>org.jogamp.jogl</groupId>
      <artifactId>jogl-all</artifactId>
      <version>2.1.2</version>
      <type>jar</type>
      <classifier>natives-windows-i586</classifier>
    </dependency>
  </dependencies>
 
  <repositories>
        <repository>
            <id>thema</id>
            <name>Local ThéMA Repository</name>
            <url>http://dev.umrthema.univ-fcomte.fr/repository/</url>
        </repository>
        <repository>
            <id>osgeo</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>http://download.osgeo.org/webdav/geotools/</url>
        </repository>
    </repositories>
    <distributionManagement>
        <site>
            <id>local-thema</id>
            <url>file:///var/www/projects/geographer/</url>
        </site>
    </distributionManagement>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>summary</report>
                           
                            <report>license</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
           
           
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
</project>

I have find lot of similar problem. But i can't solve it.

Have you an idea, please?
Sorry for my english
Thank


Alexis
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Catched FileNotFoundException (natives)

gouessej
Administrator
Hi

Please use a more recent version of JOGL (at least 2.1.5-01). I'm not a Maven expert but maybe your JAR geographer-0.9.7.jar contains a class of GlueGen, then it tries to extract the native libraries from geographer-0.9.7-natives-linux-i586.jar instead of gluegen-rt-natives-linux-i586.jar. Are you trying to make a fat JAR? I can do it with Ant, it's doable with Maven. You should contact Mark on our IRC channel, maybe he could help you.

Edit.: Java3D 1.6 pre is compatible with JOGL 2 which isn't the case of earlier versions including the one you use, please look at my tutorial:
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/
Moreover, Java3D 1.6 pre isn't on Maven Central as far as I know, the version 1.3.1 is completely obsolete. I fear that you won't be able to use Maven to build your project without some hacks like this one:
http://stackoverflow.com/questions/10935135/maven-and-adding-jars-to-system-scope
Julien Gouesse | Personal blog | Website
Loading...