You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2010/01/03 15:29:57 UTC

Pb when running tests on sshd (trunk)

Hi,

I get this error on Mac OSX, Java 1.6.0_17 :

Tests in error:
  testAgent(org.apache.sshd.AgentTest)

-------------------------------------------------------------------------------
Test set: org.apache.sshd.AgentTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.009 
sec <<< FAILURE!
testAgent(org.apache.sshd.AgentTest)  Time elapsed: 0.006 sec  <<< ERROR!
java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path, no 
libtcnative-1 in 
java.library.path(.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java)
        at org.apache.tomcat.jni.Library.<init>(Library.java:56)
        at org.apache.tomcat.jni.Library.initialize(Library.java:157)
        at org.apache.sshd.agent.AprLibrary.<init>(AprLibrary.java:83)
        at org.apache.sshd.agent.AprLibrary.initialize(AprLibrary.java:62)
        at 
org.apache.sshd.agent.AprLibrary.createLocalSocketAddress(AprLibrary.java:109)
        at org.apache.sshd.agent.AgentServer.start(AgentServer.java:56)
        at org.apache.sshd.AgentTest.testAgent(AgentTest.java:38)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
...

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: Pb when running tests on sshd (trunk)

Posted by Emmanuel Lecharny <el...@gmail.com>.
Shawn Pearce a écrit :
> Emmanuel L?charny <el...@gmail.com> wrote:
>   
>> Shawn Pearce a écrit :
>>     
>>> You have to download and install the Tomcat native library [1].
>>> On my Linux desktop I had to inject the library into my JVM via a
>>> wrapper script for Maven:
>>>
>>>   #!/bin/sh
>>>   export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
>>>   export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
>>>   exec mvn "$@"
>>>
>>> [1] http://tomcat.apache.org/native-doc/
>>>       
>>   
>> Can't we define a profile to handle such a situation ? Most of the  
>> people won't need this native lib, aren't they ?
>>     
>
> That's true, we should actually be able to define a profile for
> the native tests.
>
> This native library is only used to enable agent forwarding on the
> server side, and if the library loading fails, I think we simply
> disable agent forwarding.
>
> Please file a JIRA issue for it, and feel free to assign it to me.
>
>   
https://issues.apache.org/jira/browse/SSHD-71

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: Pb when running tests on sshd (trunk)

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
On Jan 4, 2010, at 5:47 AM, Shawn Pearce wrote:

> "Alan D. Cabrera" <li...@toolazydogs.com> wrote:
>>>> Shawn Pearce a écrit :
>>>>> You have to download and install the Tomcat native library [1].
>>>>> On my Linux desktop I had to inject the library into my JVM via a
>>>>> wrapper script for Maven:
>>
>> I wonder how, or if, we could automatically d/l the native artifact  
>> from
>> maven and put it into somewhere like target/native and spawn the  
>> tests.
>> Just thinking out loud.
>
> This would be the preferred approach, but it might be harder than
> it sounds.  For starters, the tcnative library doesn't have a
> Maven pom.  :-)
>
> We can use platform selected profiles in Maven to drive what the
> actual artifact file name is, but there might not be enough control.
>
> For Mac OS X and Win32 targets, this should be pretty simple
> to configure.  But my Linux desktop is an amd64 user space, but
> I have both x86-32 and x86-64 format JVMs installed.  I was only
> able to successfully build tcnative for the x86-64 format, which
> limits the set of VMs I can load it under.  :-)

Yeah, it gets even more complicated when you figure in the classifiers  
that need to be used but I think that it can be done.  Some purists  
note the myriad of different Linux setups and claim that it cannot be  
done.  I think that all we have to do is be practical and come up w/  
our own nomenclature for classifiers.

> I can try to look into downloading the right native library when
> I setup the pom to also support skipping the tcnative based tests.
> The only major downside is it might mean I have to start supporting
> the builds, and I really don't want to do that...

Yeah, no worries.  I was just thinking out loud.  I was thinking that  
it would be a cool way to build APR w/ MINA if we wanted to go that  
route.  I'm really interested in a raw sockets feature.

Again, just thinking out loud.


Regards,
Alan


Re: Pb when running tests on sshd (trunk)

Posted by Shawn Pearce <so...@google.com>.
"Alan D. Cabrera" <li...@toolazydogs.com> wrote:
>>> Shawn Pearce a écrit :
>>>> You have to download and install the Tomcat native library [1].
>>>> On my Linux desktop I had to inject the library into my JVM via a
>>>> wrapper script for Maven:
>
> I wonder how, or if, we could automatically d/l the native artifact from 
> maven and put it into somewhere like target/native and spawn the tests.  
> Just thinking out loud.

This would be the preferred approach, but it might be harder than
it sounds.  For starters, the tcnative library doesn't have a
Maven pom.  :-)

We can use platform selected profiles in Maven to drive what the
actual artifact file name is, but there might not be enough control.

For Mac OS X and Win32 targets, this should be pretty simple
to configure.  But my Linux desktop is an amd64 user space, but
I have both x86-32 and x86-64 format JVMs installed.  I was only
able to successfully build tcnative for the x86-64 format, which
limits the set of VMs I can load it under.  :-)

I can try to look into downloading the right native library when
I setup the pom to also support skipping the tcnative based tests.
The only major downside is it might mean I have to start supporting
the builds, and I really don't want to do that...

Re: Pb when running tests on sshd (trunk)

Posted by Emmanuel LŽcharny <el...@gmail.com>.
Alan D. Cabrera a écrit :
>
> On Jan 4, 2010, at 5:29 AM, Shawn Pearce wrote:
>
>> Emmanuel L?charny <el...@gmail.com> wrote:
>>> Shawn Pearce a écrit :
>>>> You have to download and install the Tomcat native library [1].
>>>> On my Linux desktop I had to inject the library into my JVM via a
>>>> wrapper script for Maven:
>>>>
>>>>  #!/bin/sh
>>>>  export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
>>>>  export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
>>>>  exec mvn "$@"
>>>>
>>>> [1] http://tomcat.apache.org/native-doc/
>>>
>>> Can't we define a profile to handle such a situation ? Most of the
>>> people won't need this native lib, aren't they ?
>>
>> That's true, we should actually be able to define a profile for
>> the native tests.
>>
>> This native library is only used to enable agent forwarding on the
>> server side, and if the library loading fails, I think we simply
>> disable agent forwarding.
>>
>> Please file a JIRA issue for it, and feel free to assign it to me.
>
> I wonder how, or if, we could automatically d/l the native artifact 
> from maven and put it into somewhere like target/native and spawn the 
> tests.  Just thinking out loud.
>
>
> Regards,
> Alan
>
>
Will investigate with some Maven gurus...

Re: Pb when running tests on sshd (trunk)

Posted by "Alan D. Cabrera" <li...@toolazydogs.com>.
On Jan 4, 2010, at 5:29 AM, Shawn Pearce wrote:

> Emmanuel L?charny <el...@gmail.com> wrote:
>> Shawn Pearce a écrit :
>>> You have to download and install the Tomcat native library [1].
>>> On my Linux desktop I had to inject the library into my JVM via a
>>> wrapper script for Maven:
>>>
>>>  #!/bin/sh
>>>  export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
>>>  export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
>>>  exec mvn "$@"
>>>
>>> [1] http://tomcat.apache.org/native-doc/
>>
>> Can't we define a profile to handle such a situation ? Most of the
>> people won't need this native lib, aren't they ?
>
> That's true, we should actually be able to define a profile for
> the native tests.
>
> This native library is only used to enable agent forwarding on the
> server side, and if the library loading fails, I think we simply
> disable agent forwarding.
>
> Please file a JIRA issue for it, and feel free to assign it to me.

I wonder how, or if, we could automatically d/l the native artifact  
from maven and put it into somewhere like target/native and spawn the  
tests.  Just thinking out loud.


Regards,
Alan


Re: Pb when running tests on sshd (trunk)

Posted by Shawn Pearce <so...@google.com>.
Emmanuel L?charny <el...@gmail.com> wrote:
> Shawn Pearce a écrit :
>> You have to download and install the Tomcat native library [1].
>> On my Linux desktop I had to inject the library into my JVM via a
>> wrapper script for Maven:
>>
>>   #!/bin/sh
>>   export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
>>   export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
>>   exec mvn "$@"
>>
>> [1] http://tomcat.apache.org/native-doc/
>   
> Can't we define a profile to handle such a situation ? Most of the  
> people won't need this native lib, aren't they ?

That's true, we should actually be able to define a profile for
the native tests.

This native library is only used to enable agent forwarding on the
server side, and if the library loading fails, I think we simply
disable agent forwarding.

Please file a JIRA issue for it, and feel free to assign it to me.

Re: Pb when running tests on sshd (trunk)

Posted by Emmanuel LŽcharny <el...@gmail.com>.
Shawn Pearce a écrit :
> Emmanuel Lecharny <el...@gmail.com> wrote:
>   
>> I get this error on Mac OSX, Java 1.6.0_17 :
>>
>> Tests in error:
>>  testAgent(org.apache.sshd.AgentTest)
>>
>> -------------------------------------------------------------------------------
>> Test set: org.apache.sshd.AgentTest
>> -------------------------------------------------------------------------------
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.009  
>> sec <<< FAILURE!
>> testAgent(org.apache.sshd.AgentTest)  Time elapsed: 0.006 sec  <<< ERROR!
>> java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path, no  
>> libtcnative-1 in  
>>     
>
> You have to download and install the Tomcat native library [1].
> On my Linux desktop I had to inject the library into my JVM via a
> wrapper script for Maven:
>
>   #!/bin/sh
>   export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
>   export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
>   exec mvn "$@"
>
> [1] http://tomcat.apache.org/native-doc/
>   
Can't we define a profile to handle such a situation ? Most of the 
people won't need this native lib, aren't they ?


Re: Pb when running tests on sshd (trunk)

Posted by Shawn Pearce <so...@google.com>.
Emmanuel Lecharny <el...@gmail.com> wrote:
> I get this error on Mac OSX, Java 1.6.0_17 :
>
> Tests in error:
>  testAgent(org.apache.sshd.AgentTest)
>
> -------------------------------------------------------------------------------
> Test set: org.apache.sshd.AgentTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.009  
> sec <<< FAILURE!
> testAgent(org.apache.sshd.AgentTest)  Time elapsed: 0.006 sec  <<< ERROR!
> java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path, no  
> libtcnative-1 in  

You have to download and install the Tomcat native library [1].
On my Linux desktop I had to inject the library into my JVM via a
wrapper script for Maven:

  #!/bin/sh
  export JAVA_HOME=/usr/lib/jvm/java-6-openjdk &&
  export LD_LIBRARY_PATH=/home/sop/sw-tcnative1.1.18/lib &&
  exec mvn "$@"

[1] http://tomcat.apache.org/native-doc/