Exception occurred while generating glue code

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception occurred while generating glue code

abassili
I have started using gluegen and I'm trying to generate the JNI interface for a very simple C header that has one simpe function.

java -jar gluegen.jar -C<config file> <my header file>

But I'm getting the following exception:

Exception in thread "main" java.lang.RuntimeException: Exception occurred while generating glue code.
        at com.jogamp.gluegen.GlueGen.run(GlueGen.java:307)
        at com.jogamp.gluegen.GlueGen.main(GlueGen.java:367)
Caused by: java.lang.RuntimeException: Error while emitting binding for "foo"
        at com.jogamp.gluegen.JavaEmitter.emitFunctions(JavaEmitter.java:437)
        at com.jogamp.gluegen.GlueGen.run(GlueGen.java:300)
        ... 1 more
Caused by: java.lang.NullPointerException
        at com.jogamp.gluegen.FunctionEmitter.emitDocComment(FunctionEmitter.java:140)
        at com.jogamp.gluegen.FunctionEmitter.emit(FunctionEmitter.java:100)
        at com.jogamp.gluegen.FunctionEmitter.emit(FunctionEmitter.java:111)
        at com.jogamp.gluegen.JavaEmitter.emitFunctions(JavaEmitter.java:433)
        ... 2 more

It seems that it can't write the output file even though there is write permission to that folder. Any idea why?

Thanks ..

Amgad
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred while generating glue code

gouessej
Administrator
Hi

What is the path of the output file? Maybe GlueGen wrongly treats it.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred while generating glue code

Sven Gothel
Administrator
In reply to this post by abassili
On 01/20/2014 10:21 PM, abassili [via jogamp] wrote:
> I have started using gluegen and I'm trying to generate the JNI interface for
> a very simple C header that has one simpe function.
>
> java -jar gluegen.jar -C<config file> <my header file>
>
> But I'm getting the following exception:
>

I glanced at the GlueGen source code .. and it seems that thw 'writer'
instance as set and passed-through via the ctor is 'null'.

Please create a bug report with:
  - detailed description how to reproduce it

  - a little project w/ all data required to reproduce it,
    _please_ make this as small and tiny as possible!

seems like a setup issue, however, we shall not do a NPE.

Thank you!

~Sven

> Exception in thread "main" java.lang.RuntimeException: Exception occurred
> while generating glue code.
>         at com.jogamp.gluegen.GlueGen.run(GlueGen.java:307)
>         at com.jogamp.gluegen.GlueGen.main(GlueGen.java:367)
> Caused by: java.lang.RuntimeException: Error while emitting binding for "foo"
>         at com.jogamp.gluegen.JavaEmitter.emitFunctions(JavaEmitter.java:437)
>         at com.jogamp.gluegen.GlueGen.run(GlueGen.java:300)
>         ... 1 more
> Caused by: java.lang.NullPointerException
>         at
> com.jogamp.gluegen.FunctionEmitter.emitDocComment(FunctionEmitter.java:140)
>         at com.jogamp.gluegen.FunctionEmitter.emit(FunctionEmitter.java:100)
>         at com.jogamp.gluegen.FunctionEmitter.emit(FunctionEmitter.java:111)
>         at com.jogamp.gluegen.JavaEmitter.emitFunctions(JavaEmitter.java:433)
>         ... 2 more
>
> It seems that it can't write the output file even though there is write
> permission to that folder. Any idea why?
>
> Thanks ..
>
> Amgad


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred while generating glue code

abassili
In reply to this post by gouessej
Here is what I have in the configuration file:

Package testfunction Style AllStatic JavaClass TestFunction JavaOutputDir c:\java NativeOutputDir c:\java
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred while generating glue code

abassili
In reply to this post by Sven Gothel
Yes I looked at the source code as well, and you are right it seems that the writer is null but I'm not sure why. Should not there be a default output directory at least? How do I pass the path & name for the output file?
Reply | Threaded
Open this post in threaded view
|

Re: Exception occurred while generating glue code

abassili
In reply to this post by Sven Gothel
Any ideas? I am just working with a very simple header of one function only.

Thanks.