latest snapshot is at

http://snapshots.repository.codehaus.org/

-D


On 6/21/06, dan tran <[EMAIL PROTECTED]> wrote:

 also you dont need linkerSecondaryOutputExtensions tag  ( windows only )

-D


 On 6/21/06, dan tran <[EMAIL PROTECTED]> wrote:
>
>  Your stacktrace is not long enough to find out the exact cause.
>
> Also, your <javahOS>Solaris</javahOS> is wrong, it should be
>
> <javahOS>solaris</javahOS>
>
>
> -Dan
>
>
>  On 6/21/06, TimHedger <[EMAIL PROTECTED] > wrote:
> >
> >
> > I'm trying to build using the mojo native plugin and to build a jni
> > file from
> > a compiled class.
> >
> > In my existing build process this is the command I use:
> > /usr/java1.4.1_02_32/bin/javah -jni -classpath
> > /home/hedgert/work/javautil/classes -o
> > /home/hedgert/work/javautil/gen/rbos/fm/mktrisk/sql/BcpBase.h
> > rbos.fm.mktrisk.sql.BcpBase
> >
> > I've configured maven and the plugin and this is the command it shows
> > it
> > executes in the debug output:
> > [INFO] /usr/java1.4.1_02_32/jre/../bin/javah -d
> > /home/hedgert/maven/javabcp/target/native/javah -classpath
> >
> > 
/home/hedgert/.m2/repository/rbos/fm/mktrisk/javabcpbase/1.0-SNAPSHOT/javabcpbase-
> > 1.0-SNAPSHOT.jar
> > rbos.fm.mktrisk.sql.BcpBase
> >
> > It's almost the same; the -jni option is missing and instead of
> > specifying
> > an output file with -o, this specifies an output directory (-d) which
> > means
> > that the filename is different (in my build I get BcpBase.h, from the
> > maven
> > build command I get rbos_fm_mktrisk_sql_BcpBase.h.
> >
> > The main point is when I run the maven produced command by hand (even
> > though
> > the options are slightly different) I do get a .h file produced as an
> > output
> > (and the command exits with a zero return code).
> >
> > But maven isn't happy - this is (an extract from) the maven output:
> > ...
> > [INFO] snapshot
> > org.codehaus.mojo.natives:maven-native-manager:1.0-alpha-1-SNAPSHOT:
> > checking for updates from Maven Snapshots
> > [INFO] snapshot
> > org.codehaus.mojo.natives:maven-native-manager:1.0-alpha-1-SNAPSHOT:
> > checking for updates from snapshots
> > [INFO] [native:javah {execution: javah}]
> > [INFO] /usr/java1.4.1_02_32/jre/../bin/javah -d
> > /home/hedgert/maven/javabcp/target/native/javah -classpath
> > 
/home/hedgert/.m2/repository/rbos/fm/mktrisk/javabcpbase/1.0-SNAPSHOT/javabcpbase-
> > 1.0-SNAPSHOT.jar
> > rbos.fm.mktrisk.sql.BcpBase
> > [INFO] [native:compile]
> > [INFO]
> >
> > ------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO]
> > ------------------------------------------------------------------------
> >
> > [INFO] null
> > [INFO]
> >
> > ------------------------------------------------------------------------
> > [INFO] Trace
> > java.lang.NullPointerException
> > at
> > org.codehaus.mojo.natives.NativeSources.appendSourceList(
> > NativeSources.java :106)
> > at
> > org.codehaus.mojo.natives.NativeSources.getAllSourceFiles(
> > NativeSources.java:155)
> > ...
> >
> > I'm not sure why the plugin isn't happy and blows up - can you help?
> >
> > This is the pom file I'm using (which was derived from the example
> > file on
> > the plugin web site):
> > <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/maven-v4_0_0.xsd";>
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>rbos.fm.mktrisk</groupId>
> > <artifactId>javabcp</artifactId>
> > <packaging>so</packaging>
> > <version>1.0-SNAPSHOT</version>
> > <name>Maven Quick Start Archetype</name>
> > <url>http://maven.apache.org</url>
> >    <dependencies>
> >      <dependency>
> >         <groupId> rbos.fm.mktrisk</groupId>
> >         <artifactId>javabcpbase</artifactId>
> >         <version>1.0-SNAPSHOT</version>
> >         <scope>compile</scope>
> >      </dependency>
> >      <!--add other native libs to be linked in-->
> >   </dependencies>
> >   <build>
> >     <plugins>
> >       <plugin>
> >         <groupId>org.codehaus.mojo </groupId>
> >         <artifactId>native-maven-plugin</artifactId>
> >         <extensions>true</extensions>
> >         <configuration>
> >           <compilerProvider>generic</compilerProvider>
> >           <compilerStartOptions>
> >             <compilerStartOption>-Dsun_svr4=1
> > -DSOLARIS</compilerStartOption>
> >           </compilerStartOptions>
> >           <javahOS>Solaris</javahOS>
> >           <sources>
> >             <source>
> >               <directory></directory>
> >               <fileNames>
> >                 <fileName>exutils.c</fileName>
> >                 <fileName> Blk.c</fileName>
> >               </fileNames>
> >             </source>
> >             <!-- additional include path
> > (source)(directory)xx(/directory)</source)-->
> >             <!-- additional system include path -->
> >             <source>
> >               <directory> /home/hedgert/work/javautil/include
> > </directory>
> >               <directory>
> > /opt/sybaseSW/sybase12.5/OCS-12_0/sample/dblibrary </directory>
> >
> >
> > <dependencyAnalysisParticipation>false</dependencyAnalysisParticipation>
> >             </source>
> >           </sources>
> >
> >           <!-- deploy the accompany .lib file as well -->
> >
> > <linkerSecondaryOuputExtensions>so</linkerSecondaryOuputExtensions >
> >
> >           <linkerStartOptions>
> >             <linkerStartOption> -G -lblk -lct -lcs -ltcl -lcomn -lintl
> > -Bdynamic -lnsl -ldl -lm </linkerStartOption>
> >           </linkerStartOptions>
> >         </configuration>
> >
> >         <!-- Generate JNI header files based on a list of class name
> > on the
> > classpath -->
> >         <!-- The generated include directory is automatically added to
> >
> > include path at compile phase -->
> >         <!-- Ensure to have appropriate denpendency jar file(s) in
> > your pom
> > -->
> >
> >         <executions>
> >           <execution>
> >             <id>javah</id>
> >             <phase>generate-sources</phase>
> >             <configuration>
> >               <classNames>
> >                 <className>rbos.fm.mktrisk.sql.BcpBase</className>
> >               </classNames>
> >               <!--
> >                |   Note:
> >                |    1. Without classNames, javah mojo will search for
> > all
> > JNI classes
> >                |       in your dependency list.
> >               -->
> >             </configuration>
> >             <goals>
> >               <goal>javah</goal>
> >             </goals>
> >           </execution>
> >        </executions>
> >      </plugin>
> >    </plugins>
> > </build>
> > </project>
> >
> > NB I'm aware I'm using the mojo native plugin, I'd be very happy to
> > use the
> > standard one, but I can't find similar configuration/documentation
> > information that I'd need to get my example up and running.  Any
> > suggestions
> > much appreciated.
> > --
> > View this message in context:
> > 
http://www.nabble.com/Can%27t-get-jni-working-based-on-example-configuration-t1825144.html#a4978401
> > Sent from the Maven - Users forum at Nabble.com <http://nabble.com/>.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to