You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@joshua.apache.org by Hoàng Đình Long <lo...@gmail.com> on 2017/05/24 02:54:48 UTC

java.lang.UnsatisfiedLinkError: no ken in java.library.path

Hello,

I have followed the Fisher call home tutorial and I built 3 models based on
that document.

Then I use this script to build a language pack based on the model number 3:

$JOSHUA/scripts/language-pack/build_lp.sh es-en 3/tune/joshua.config.final
4g

The scripts ended well and I created a folder named releases.

In "releases" folder, there is a folder named
"apache-joshua-es-en-2017-05-24". I cd into that folder.

I created a file named "example.es" with this sentence inside "común y
corriente" and ran this command:

cat example.es | ./prepare.sh | ./joshua > output.en

It reported the following error:

Exception in thread "main" java.lang.RuntimeException: Unable to
instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
-lm_file model/lm.kenlm'!
at
org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:642)
at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:638)
... 3 more
Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
java.lang.UnsatisfiedLinkError: no ken in java.library.path
at
org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:107)
at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
at
org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.initializeLM(StateMinimizingLanguageModel.java:63)
at
org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(LanguageModelFF.java:132)
at
org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(StateMinimizingLanguageModel.java:47)
... 8 more
Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at
org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:103)


I think I have installed KenLM properly. If I hadn't installed it, I
wouldn't have been able to follow the tutorial and build the language pack,
would I? Did I miss something here?

-- 
_Long HĐi_

Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Matt Post <po...@cs.jhu.edu>.
Yes, LD_LIBRARY_PATH should also include your system library paths. It looks like things are good for you!

matt


> On May 31, 2017, at 12:32 AM, Hoàng Đình Long <lo...@gmail.com> wrote:
> 
> Hi Matt,
> 
> Thank you very much. That's exactly the reason.
> In the tutorial, there is only a step to setup boost. And I made an
> environment variable called LD_LIBRARY_PATH="/usr/include/boost". In
> /usr/include/boost, libken.so file doesn't exist. So I appended the path
> like this:
> 
> LD_LIBRARY_PATH="/usr/include/boost:/home/long/Working/joshua-tutorial/runs/releases/apache-joshua-es-en-2017-05-30/lib"
> 
> Now it works great.
> 
> Is it the way it is supposed to happen?
> 
> Anyway, thank you!
> I will review the overall picture and see what to do next.
> 
> On Tue, May 30, 2017 at 10:44 PM, Matt Post <po...@cs.jhu.edu> wrote:
> 
>> It looks like it can't find libken.so, so that is probably not in your
>> $LD_LIBRARY_PATH. This is supposed to be set by the "joshua" script, so
>> something must be wrong. I'm not sure what but it shouldn't be too
>> difficult to track down at the terminal.
>> 
>> matt
>> 
>> 
>>> On May 25, 2017, at 10:43 PM, Hoàng Đình Long <lo...@gmail.com>
>> wrote:
>>> 
>>> Yes, in the language pack/model folder, there are lm.kenlm, grammar.glue
>>> files and a sub folder named grammar.packed
>>> 
>>> On Thu, May 25, 2017 at 5:56 PM, Matt Post <po...@cs.jhu.edu> wrote:
>>> 
>>>> Is the file model/lm.kenlm in place?
>>>> 
>>>> 
>>>>> On May 24, 2017, at 10:15 PM, Hoàng Đình Long <lo...@gmail.com>
>>>> wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> In the $JOSHUA home directory (which I built from source code cloned
>> from
>>>>> Github), I found a lib directory which contains only 1 file
>>>>> named libken.so. Then I copy the lib folder into the language pack
>>>> release
>>>>> folder (because the language pack folder doesn't have this sub folder).
>>>>> 
>>>>> The error remains the same when I try to use the language pack:
>>>>> 
>>>>> Exception in thread "main" java.lang.RuntimeException: Unable to
>>>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
>>>>> -lm_file model/lm.kenlm'!
>>>>> at
>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>> Decoder.java:642)
>>>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
>>>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
>>>>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
>>>>> Caused by: java.lang.reflect.InvocationTargetException
>>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>>>> at
>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
>>>> NativeConstructorAccessorImpl.java:62)
>>>>> at
>>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>>>> DelegatingConstructorAccessorImpl.java:45)
>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>>>> at
>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>> Decoder.java:638)
>>>>> ... 3 more
>>>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
>>>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>> java:107)
>>>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
>>>> initializeLM(StateMinimizingLanguageModel.java:63)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
>>>> LanguageModelFF.java:132)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
>>>> StateMinimizingLanguageModel.java:47)
>>>>> ... 8 more
>>>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
>>>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
>>>>> at java.lang.System.loadLibrary(System.java:1122)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>> java:103)
>>>>> ... 12 more
>>>>> 
>>>>> 
>>>>> On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> If you are using a language pack, you must have KenLM installed into
>> the
>>>>>> language pack directory under lib/ since that is where it looks. Can
>> you
>>>>>> copy libken.so to that directory and see if it works?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
>>>>>> wrote:
>>>>>>> 
>>>>>>> Hello,
>>>>>>> 
>>>>>>> I have followed the Fisher call home tutorial and I built 3 models
>>>> based
>>>>>> on
>>>>>>> that document.
>>>>>>> 
>>>>>>> Then I use this script to build a language pack based on the model
>>>>>> number 3:
>>>>>>> 
>>>>>>> $JOSHUA/scripts/language-pack/build_lp.sh es-en
>>>>>> 3/tune/joshua.config.final
>>>>>>> 4g
>>>>>>> 
>>>>>>> The scripts ended well and I created a folder named releases.
>>>>>>> 
>>>>>>> In "releases" folder, there is a folder named
>>>>>>> "apache-joshua-es-en-2017-05-24". I cd into that folder.
>>>>>>> 
>>>>>>> I created a file named "example.es" with this sentence inside
>> "común y
>>>>>>> corriente" and ran this command:
>>>>>>> 
>>>>>>> cat example.es | ./prepare.sh | ./joshua > output.en
>>>>>>> 
>>>>>>> It reported the following error:
>>>>>>> 
>>>>>>> Exception in thread "main" java.lang.RuntimeException: Unable to
>>>>>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order
>> 3
>>>>>>> -lm_file model/lm.kenlm'!
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>>>> Decoder.java:642)
>>>>>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
>>>>>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
>>>>>>> at org.apache.joshua.decoder.JoshuaDecoder.main(
>> JoshuaDecoder.java:69)
>>>>>>> Caused by: java.lang.reflect.InvocationTargetException
>>>>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>>> Method)
>>>>>>> at
>>>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
>>>>>> NativeConstructorAccessorImpl.java:62)
>>>>>>> at
>>>>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>>>>>> DelegatingConstructorAccessorImpl.java:45)
>>>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>>>> Decoder.java:638)
>>>>>>> ... 3 more
>>>>>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
>>>>>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>>>> java:107)
>>>>>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
>>>>>> initializeLM(StateMinimizingLanguageModel.java:63)
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
>>>>>> LanguageModelFF.java:132)
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
>>>>>> StateMinimizingLanguageModel.java:47)
>>>>>>> ... 8 more
>>>>>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in
>> java.library.path
>>>>>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
>>>>>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
>>>>>>> at java.lang.System.loadLibrary(System.java:1122)
>>>>>>> at
>>>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>>>> java:103)
>>>>>>> 
>>>>>>> 
>>>>>>> I think I have installed KenLM properly. If I hadn't installed it, I
>>>>>>> wouldn't have been able to follow the tutorial and build the language
>>>>>> pack,
>>>>>>> would I? Did I miss something here?
>>>>>>> 
>>>>>>> --
>>>>>>> _Long HĐi_
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> _Long HĐi_
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> _Long HĐi_
>> 
>> 
> 
> 
> -- 
> _Long HĐi_


Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Hoàng Đình Long <lo...@gmail.com>.
Hi Matt,

Thank you very much. That's exactly the reason.
In the tutorial, there is only a step to setup boost. And I made an
environment variable called LD_LIBRARY_PATH="/usr/include/boost". In
/usr/include/boost, libken.so file doesn't exist. So I appended the path
like this:

LD_LIBRARY_PATH="/usr/include/boost:/home/long/Working/joshua-tutorial/runs/releases/apache-joshua-es-en-2017-05-30/lib"

Now it works great.

Is it the way it is supposed to happen?

Anyway, thank you!
I will review the overall picture and see what to do next.

On Tue, May 30, 2017 at 10:44 PM, Matt Post <po...@cs.jhu.edu> wrote:

> It looks like it can't find libken.so, so that is probably not in your
> $LD_LIBRARY_PATH. This is supposed to be set by the "joshua" script, so
> something must be wrong. I'm not sure what but it shouldn't be too
> difficult to track down at the terminal.
>
> matt
>
>
> > On May 25, 2017, at 10:43 PM, Hoàng Đình Long <lo...@gmail.com>
> wrote:
> >
> > Yes, in the language pack/model folder, there are lm.kenlm, grammar.glue
> > files and a sub folder named grammar.packed
> >
> > On Thu, May 25, 2017 at 5:56 PM, Matt Post <po...@cs.jhu.edu> wrote:
> >
> >> Is the file model/lm.kenlm in place?
> >>
> >>
> >>> On May 24, 2017, at 10:15 PM, Hoàng Đình Long <lo...@gmail.com>
> >> wrote:
> >>>
> >>> Hello,
> >>>
> >>> In the $JOSHUA home directory (which I built from source code cloned
> from
> >>> Github), I found a lib directory which contains only 1 file
> >>> named libken.so. Then I copy the lib folder into the language pack
> >> release
> >>> folder (because the language pack folder doesn't have this sub folder).
> >>>
> >>> The error remains the same when I try to use the language pack:
> >>>
> >>> Exception in thread "main" java.lang.RuntimeException: Unable to
> >>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> >>> -lm_file model/lm.kenlm'!
> >>> at
> >>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >> Decoder.java:642)
> >>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> >>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> >>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> >>> Caused by: java.lang.reflect.InvocationTargetException
> >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> >>> at
> >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
> >> NativeConstructorAccessorImpl.java:62)
> >>> at
> >>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> >> DelegatingConstructorAccessorImpl.java:45)
> >>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> >>> at
> >>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >> Decoder.java:638)
> >>> ... 3 more
> >>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> >>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >> java:107)
> >>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
> >> initializeLM(StateMinimizingLanguageModel.java:63)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
> >> LanguageModelFF.java:132)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
> >> StateMinimizingLanguageModel.java:47)
> >>> ... 8 more
> >>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> >>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> >>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> >>> at java.lang.System.loadLibrary(System.java:1122)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >> java:103)
> >>> ... 12 more
> >>>
> >>>
> >>> On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> If you are using a language pack, you must have KenLM installed into
> the
> >>>> language pack directory under lib/ since that is where it looks. Can
> you
> >>>> copy libken.so to that directory and see if it works?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>> Hello,
> >>>>>
> >>>>> I have followed the Fisher call home tutorial and I built 3 models
> >> based
> >>>> on
> >>>>> that document.
> >>>>>
> >>>>> Then I use this script to build a language pack based on the model
> >>>> number 3:
> >>>>>
> >>>>> $JOSHUA/scripts/language-pack/build_lp.sh es-en
> >>>> 3/tune/joshua.config.final
> >>>>> 4g
> >>>>>
> >>>>> The scripts ended well and I created a folder named releases.
> >>>>>
> >>>>> In "releases" folder, there is a folder named
> >>>>> "apache-joshua-es-en-2017-05-24". I cd into that folder.
> >>>>>
> >>>>> I created a file named "example.es" with this sentence inside
> "común y
> >>>>> corriente" and ran this command:
> >>>>>
> >>>>> cat example.es | ./prepare.sh | ./joshua > output.en
> >>>>>
> >>>>> It reported the following error:
> >>>>>
> >>>>> Exception in thread "main" java.lang.RuntimeException: Unable to
> >>>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order
> 3
> >>>>> -lm_file model/lm.kenlm'!
> >>>>> at
> >>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >>>> Decoder.java:642)
> >>>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> >>>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> >>>>> at org.apache.joshua.decoder.JoshuaDecoder.main(
> JoshuaDecoder.java:69)
> >>>>> Caused by: java.lang.reflect.InvocationTargetException
> >>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> >> Method)
> >>>>> at
> >>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
> >>>> NativeConstructorAccessorImpl.java:62)
> >>>>> at
> >>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> >>>> DelegatingConstructorAccessorImpl.java:45)
> >>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> >>>>> at
> >>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >>>> Decoder.java:638)
> >>>>> ... 3 more
> >>>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> >>>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
> >>>>> at
> >>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >>>> java:107)
> >>>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> >>>>> at
> >>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
> >>>> initializeLM(StateMinimizingLanguageModel.java:63)
> >>>>> at
> >>>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
> >>>> LanguageModelFF.java:132)
> >>>>> at
> >>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
> >>>> StateMinimizingLanguageModel.java:47)
> >>>>> ... 8 more
> >>>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in
> java.library.path
> >>>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> >>>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> >>>>> at java.lang.System.loadLibrary(System.java:1122)
> >>>>> at
> >>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >>>> java:103)
> >>>>>
> >>>>>
> >>>>> I think I have installed KenLM properly. If I hadn't installed it, I
> >>>>> wouldn't have been able to follow the tutorial and build the language
> >>>> pack,
> >>>>> would I? Did I miss something here?
> >>>>>
> >>>>> --
> >>>>> _Long HĐi_
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> _Long HĐi_
> >>
> >>
> >
> >
> > --
> > _Long HĐi_
>
>


-- 
_Long HĐi_

Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Matt Post <po...@cs.jhu.edu>.
It looks like it can't find libken.so, so that is probably not in your $LD_LIBRARY_PATH. This is supposed to be set by the "joshua" script, so something must be wrong. I'm not sure what but it shouldn't be too difficult to track down at the terminal.

matt


> On May 25, 2017, at 10:43 PM, Hoàng Đình Long <lo...@gmail.com> wrote:
> 
> Yes, in the language pack/model folder, there are lm.kenlm, grammar.glue
> files and a sub folder named grammar.packed
> 
> On Thu, May 25, 2017 at 5:56 PM, Matt Post <po...@cs.jhu.edu> wrote:
> 
>> Is the file model/lm.kenlm in place?
>> 
>> 
>>> On May 24, 2017, at 10:15 PM, Hoàng Đình Long <lo...@gmail.com>
>> wrote:
>>> 
>>> Hello,
>>> 
>>> In the $JOSHUA home directory (which I built from source code cloned from
>>> Github), I found a lib directory which contains only 1 file
>>> named libken.so. Then I copy the lib folder into the language pack
>> release
>>> folder (because the language pack folder doesn't have this sub folder).
>>> 
>>> The error remains the same when I try to use the language pack:
>>> 
>>> Exception in thread "main" java.lang.RuntimeException: Unable to
>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
>>> -lm_file model/lm.kenlm'!
>>> at
>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>> Decoder.java:642)
>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
>>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
>>> Caused by: java.lang.reflect.InvocationTargetException
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>> at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
>> NativeConstructorAccessorImpl.java:62)
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>> DelegatingConstructorAccessorImpl.java:45)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>> at
>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>> Decoder.java:638)
>>> ... 3 more
>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>> at
>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>> java:107)
>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
>>> at
>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
>> initializeLM(StateMinimizingLanguageModel.java:63)
>>> at
>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
>> LanguageModelFF.java:132)
>>> at
>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
>> StateMinimizingLanguageModel.java:47)
>>> ... 8 more
>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
>>> at java.lang.System.loadLibrary(System.java:1122)
>>> at
>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>> java:103)
>>> ... 12 more
>>> 
>>> 
>>> On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> If you are using a language pack, you must have KenLM installed into the
>>>> language pack directory under lib/ since that is where it looks. Can you
>>>> copy libken.so to that directory and see if it works?
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
>>>> wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> I have followed the Fisher call home tutorial and I built 3 models
>> based
>>>> on
>>>>> that document.
>>>>> 
>>>>> Then I use this script to build a language pack based on the model
>>>> number 3:
>>>>> 
>>>>> $JOSHUA/scripts/language-pack/build_lp.sh es-en
>>>> 3/tune/joshua.config.final
>>>>> 4g
>>>>> 
>>>>> The scripts ended well and I created a folder named releases.
>>>>> 
>>>>> In "releases" folder, there is a folder named
>>>>> "apache-joshua-es-en-2017-05-24". I cd into that folder.
>>>>> 
>>>>> I created a file named "example.es" with this sentence inside "común y
>>>>> corriente" and ran this command:
>>>>> 
>>>>> cat example.es | ./prepare.sh | ./joshua > output.en
>>>>> 
>>>>> It reported the following error:
>>>>> 
>>>>> Exception in thread "main" java.lang.RuntimeException: Unable to
>>>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
>>>>> -lm_file model/lm.kenlm'!
>>>>> at
>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>> Decoder.java:642)
>>>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
>>>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
>>>>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
>>>>> Caused by: java.lang.reflect.InvocationTargetException
>>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>>>> at
>>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
>>>> NativeConstructorAccessorImpl.java:62)
>>>>> at
>>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>>>> DelegatingConstructorAccessorImpl.java:45)
>>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>>>> at
>>>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>>>> Decoder.java:638)
>>>>> ... 3 more
>>>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
>>>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>> java:107)
>>>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
>>>> initializeLM(StateMinimizingLanguageModel.java:63)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
>>>> LanguageModelFF.java:132)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
>>>> StateMinimizingLanguageModel.java:47)
>>>>> ... 8 more
>>>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
>>>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
>>>>> at java.lang.System.loadLibrary(System.java:1122)
>>>>> at
>>>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>>>> java:103)
>>>>> 
>>>>> 
>>>>> I think I have installed KenLM properly. If I hadn't installed it, I
>>>>> wouldn't have been able to follow the tutorial and build the language
>>>> pack,
>>>>> would I? Did I miss something here?
>>>>> 
>>>>> --
>>>>> _Long HĐi_
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> _Long HĐi_
>> 
>> 
> 
> 
> -- 
> _Long HĐi_


Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Hoàng Đình Long <lo...@gmail.com>.
Yes, in the language pack/model folder, there are lm.kenlm, grammar.glue
files and a sub folder named grammar.packed

On Thu, May 25, 2017 at 5:56 PM, Matt Post <po...@cs.jhu.edu> wrote:

> Is the file model/lm.kenlm in place?
>
>
> > On May 24, 2017, at 10:15 PM, Hoàng Đình Long <lo...@gmail.com>
> wrote:
> >
> > Hello,
> >
> > In the $JOSHUA home directory (which I built from source code cloned from
> > Github), I found a lib directory which contains only 1 file
> > named libken.so. Then I copy the lib folder into the language pack
> release
> > folder (because the language pack folder doesn't have this sub folder).
> >
> > The error remains the same when I try to use the language pack:
> >
> > Exception in thread "main" java.lang.RuntimeException: Unable to
> > instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> > -lm_file model/lm.kenlm'!
> > at
> > org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> Decoder.java:642)
> > at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> > at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> > at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> > Caused by: java.lang.reflect.InvocationTargetException
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:62)
> > at
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> > at
> > org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> Decoder.java:638)
> > ... 3 more
> > Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> > java.lang.UnsatisfiedLinkError: no ken in java.library.path
> > at
> > org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> java:107)
> > at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> > at
> > org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
> initializeLM(StateMinimizingLanguageModel.java:63)
> > at
> > org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
> LanguageModelFF.java:132)
> > at
> > org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
> StateMinimizingLanguageModel.java:47)
> > ... 8 more
> > Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> > at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> > at java.lang.System.loadLibrary(System.java:1122)
> > at
> > org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> java:103)
> > ... 12 more
> >
> >
> > On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:
> >
> >> Hi,
> >>
> >> If you are using a language pack, you must have KenLM installed into the
> >> language pack directory under lib/ since that is where it looks. Can you
> >> copy libken.so to that directory and see if it works?
> >>
> >>
> >>
> >>
> >>> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
> >> wrote:
> >>>
> >>> Hello,
> >>>
> >>> I have followed the Fisher call home tutorial and I built 3 models
> based
> >> on
> >>> that document.
> >>>
> >>> Then I use this script to build a language pack based on the model
> >> number 3:
> >>>
> >>> $JOSHUA/scripts/language-pack/build_lp.sh es-en
> >> 3/tune/joshua.config.final
> >>> 4g
> >>>
> >>> The scripts ended well and I created a folder named releases.
> >>>
> >>> In "releases" folder, there is a folder named
> >>> "apache-joshua-es-en-2017-05-24". I cd into that folder.
> >>>
> >>> I created a file named "example.es" with this sentence inside "común y
> >>> corriente" and ran this command:
> >>>
> >>> cat example.es | ./prepare.sh | ./joshua > output.en
> >>>
> >>> It reported the following error:
> >>>
> >>> Exception in thread "main" java.lang.RuntimeException: Unable to
> >>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> >>> -lm_file model/lm.kenlm'!
> >>> at
> >>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >> Decoder.java:642)
> >>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> >>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> >>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> >>> Caused by: java.lang.reflect.InvocationTargetException
> >>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> >>> at
> >>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
> >> NativeConstructorAccessorImpl.java:62)
> >>> at
> >>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> >> DelegatingConstructorAccessorImpl.java:45)
> >>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> >>> at
> >>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> >> Decoder.java:638)
> >>> ... 3 more
> >>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> >>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >> java:107)
> >>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
> >> initializeLM(StateMinimizingLanguageModel.java:63)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
> >> LanguageModelFF.java:132)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
> >> StateMinimizingLanguageModel.java:47)
> >>> ... 8 more
> >>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> >>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> >>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> >>> at java.lang.System.loadLibrary(System.java:1122)
> >>> at
> >>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> >> java:103)
> >>>
> >>>
> >>> I think I have installed KenLM properly. If I hadn't installed it, I
> >>> wouldn't have been able to follow the tutorial and build the language
> >> pack,
> >>> would I? Did I miss something here?
> >>>
> >>> --
> >>> _Long HĐi_
> >>
> >>
> >
> >
> > --
> > _Long HĐi_
>
>


-- 
_Long HĐi_

Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Matt Post <po...@cs.jhu.edu>.
Is the file model/lm.kenlm in place?


> On May 24, 2017, at 10:15 PM, Hoàng Đình Long <lo...@gmail.com> wrote:
> 
> Hello,
> 
> In the $JOSHUA home directory (which I built from source code cloned from
> Github), I found a lib directory which contains only 1 file
> named libken.so. Then I copy the lib folder into the language pack release
> folder (because the language pack folder doesn't have this sub folder).
> 
> The error remains the same when I try to use the language pack:
> 
> Exception in thread "main" java.lang.RuntimeException: Unable to
> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> -lm_file model/lm.kenlm'!
> at
> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:642)
> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at
> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:638)
> ... 3 more
> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> java.lang.UnsatisfiedLinkError: no ken in java.library.path
> at
> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:107)
> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> at
> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.initializeLM(StateMinimizingLanguageModel.java:63)
> at
> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(LanguageModelFF.java:132)
> at
> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(StateMinimizingLanguageModel.java:47)
> ... 8 more
> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> at java.lang.System.loadLibrary(System.java:1122)
> at
> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:103)
> ... 12 more
> 
> 
> On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:
> 
>> Hi,
>> 
>> If you are using a language pack, you must have KenLM installed into the
>> language pack directory under lib/ since that is where it looks. Can you
>> copy libken.so to that directory and see if it works?
>> 
>> 
>> 
>> 
>>> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
>> wrote:
>>> 
>>> Hello,
>>> 
>>> I have followed the Fisher call home tutorial and I built 3 models based
>> on
>>> that document.
>>> 
>>> Then I use this script to build a language pack based on the model
>> number 3:
>>> 
>>> $JOSHUA/scripts/language-pack/build_lp.sh es-en
>> 3/tune/joshua.config.final
>>> 4g
>>> 
>>> The scripts ended well and I created a folder named releases.
>>> 
>>> In "releases" folder, there is a folder named
>>> "apache-joshua-es-en-2017-05-24". I cd into that folder.
>>> 
>>> I created a file named "example.es" with this sentence inside "común y
>>> corriente" and ran this command:
>>> 
>>> cat example.es | ./prepare.sh | ./joshua > output.en
>>> 
>>> It reported the following error:
>>> 
>>> Exception in thread "main" java.lang.RuntimeException: Unable to
>>> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
>>> -lm_file model/lm.kenlm'!
>>> at
>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>> Decoder.java:642)
>>> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
>>> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
>>> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
>>> Caused by: java.lang.reflect.InvocationTargetException
>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>> at
>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(
>> NativeConstructorAccessorImpl.java:62)
>>> at
>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>> DelegatingConstructorAccessorImpl.java:45)
>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>>> at
>>> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
>> Decoder.java:638)
>>> ... 3 more
>>> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
>>> java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>> at
>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>> java:107)
>>> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
>>> at
>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
>> initializeLM(StateMinimizingLanguageModel.java:63)
>>> at
>>> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
>> LanguageModelFF.java:132)
>>> at
>>> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
>> StateMinimizingLanguageModel.java:47)
>>> ... 8 more
>>> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
>>> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
>>> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
>>> at java.lang.System.loadLibrary(System.java:1122)
>>> at
>>> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
>> java:103)
>>> 
>>> 
>>> I think I have installed KenLM properly. If I hadn't installed it, I
>>> wouldn't have been able to follow the tutorial and build the language
>> pack,
>>> would I? Did I miss something here?
>>> 
>>> --
>>> _Long HĐi_
>> 
>> 
> 
> 
> -- 
> _Long HĐi_


Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Hoàng Đình Long <lo...@gmail.com>.
Hello,

In the $JOSHUA home directory (which I built from source code cloned from
Github), I found a lib directory which contains only 1 file
named libken.so. Then I copy the lib folder into the language pack release
folder (because the language pack folder doesn't have this sub folder).

The error remains the same when I try to use the language pack:

Exception in thread "main" java.lang.RuntimeException: Unable to
instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
-lm_file model/lm.kenlm'!
at
org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:642)
at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:638)
... 3 more
Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
java.lang.UnsatisfiedLinkError: no ken in java.library.path
at
org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:107)
at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
at
org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.initializeLM(StateMinimizingLanguageModel.java:63)
at
org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(LanguageModelFF.java:132)
at
org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(StateMinimizingLanguageModel.java:47)
... 8 more
Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at
org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:103)
... 12 more


On Wed, May 24, 2017 at 9:06 PM, Matt Post <po...@cs.jhu.edu> wrote:

> Hi,
>
> If you are using a language pack, you must have KenLM installed into the
> language pack directory under lib/ since that is where it looks. Can you
> copy libken.so to that directory and see if it works?
>
>
>
>
> > On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com>
> wrote:
> >
> > Hello,
> >
> > I have followed the Fisher call home tutorial and I built 3 models based
> on
> > that document.
> >
> > Then I use this script to build a language pack based on the model
> number 3:
> >
> > $JOSHUA/scripts/language-pack/build_lp.sh es-en
> 3/tune/joshua.config.final
> > 4g
> >
> > The scripts ended well and I created a folder named releases.
> >
> > In "releases" folder, there is a folder named
> > "apache-joshua-es-en-2017-05-24". I cd into that folder.
> >
> > I created a file named "example.es" with this sentence inside "común y
> > corriente" and ran this command:
> >
> > cat example.es | ./prepare.sh | ./joshua > output.en
> >
> > It reported the following error:
> >
> > Exception in thread "main" java.lang.RuntimeException: Unable to
> > instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> > -lm_file model/lm.kenlm'!
> > at
> > org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> Decoder.java:642)
> > at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> > at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> > at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> > Caused by: java.lang.reflect.InvocationTargetException
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at
> > sun.reflect.NativeConstructorAccessorImpl.newInstance(
> NativeConstructorAccessorImpl.java:62)
> > at
> > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:45)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> > at
> > org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(
> Decoder.java:638)
> > ... 3 more
> > Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> > java.lang.UnsatisfiedLinkError: no ken in java.library.path
> > at
> > org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> java:107)
> > at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> > at
> > org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.
> initializeLM(StateMinimizingLanguageModel.java:63)
> > at
> > org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(
> LanguageModelFF.java:132)
> > at
> > org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(
> StateMinimizingLanguageModel.java:47)
> > ... 8 more
> > Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> > at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> > at java.lang.System.loadLibrary(System.java:1122)
> > at
> > org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.
> java:103)
> >
> >
> > I think I have installed KenLM properly. If I hadn't installed it, I
> > wouldn't have been able to follow the tutorial and build the language
> pack,
> > would I? Did I miss something here?
> >
> > --
> > _Long HĐi_
>
>


-- 
_Long HĐi_

Re: java.lang.UnsatisfiedLinkError: no ken in java.library.path

Posted by Matt Post <po...@cs.jhu.edu>.
Hi,

If you are using a language pack, you must have KenLM installed into the language pack directory under lib/ since that is where it looks. Can you copy libken.so to that directory and see if it works?




> On May 23, 2017, at 10:54 PM, Hoàng Đình Long <lo...@gmail.com> wrote:
> 
> Hello,
> 
> I have followed the Fisher call home tutorial and I built 3 models based on
> that document.
> 
> Then I use this script to build a language pack based on the model number 3:
> 
> $JOSHUA/scripts/language-pack/build_lp.sh es-en 3/tune/joshua.config.final
> 4g
> 
> The scripts ended well and I created a folder named releases.
> 
> In "releases" folder, there is a folder named
> "apache-joshua-es-en-2017-05-24". I cd into that folder.
> 
> I created a file named "example.es" with this sentence inside "común y
> corriente" and ran this command:
> 
> cat example.es | ./prepare.sh | ./joshua > output.en
> 
> It reported the following error:
> 
> Exception in thread "main" java.lang.RuntimeException: Unable to
> instantiate feature function 'StateMinimizingLanguageModel -lm_order 3
> -lm_file model/lm.kenlm'!
> at
> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:642)
> at org.apache.joshua.decoder.Decoder.initialize(Decoder.java:394)
> at org.apache.joshua.decoder.Decoder.<init>(Decoder.java:128)
> at org.apache.joshua.decoder.JoshuaDecoder.main(JoshuaDecoder.java:69)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> at
> org.apache.joshua.decoder.Decoder.initializeFeatureFunctions(Decoder.java:638)
> ... 3 more
> Caused by: org.apache.joshua.decoder.ff.lm.KenLM$KenLMLoadException:
> java.lang.UnsatisfiedLinkError: no ken in java.library.path
> at
> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:107)
> at org.apache.joshua.decoder.ff.lm.KenLM.<init>(KenLM.java:58)
> at
> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.initializeLM(StateMinimizingLanguageModel.java:63)
> at
> org.apache.joshua.decoder.ff.lm.LanguageModelFF.<init>(LanguageModelFF.java:132)
> at
> org.apache.joshua.decoder.ff.lm.StateMinimizingLanguageModel.<init>(StateMinimizingLanguageModel.java:47)
> ... 8 more
> Caused by: java.lang.UnsatisfiedLinkError: no ken in java.library.path
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
> at java.lang.Runtime.loadLibrary0(Runtime.java:870)
> at java.lang.System.loadLibrary(System.java:1122)
> at
> org.apache.joshua.decoder.ff.lm.KenLM.initializeSystemLibrary(KenLM.java:103)
> 
> 
> I think I have installed KenLM properly. If I hadn't installed it, I
> wouldn't have been able to follow the tutorial and build the language pack,
> would I? Did I miss something here?
> 
> -- 
> _Long HĐi_