Can you try to add the following code to your implementation class?

static {
        System.loadLibrary(<your dll>);
}

Thanks,
Raymond
________________________________________________________________ 
Raymond Feng
[email protected]
Apache Tuscany PMC member and committer: tuscany.apache.org
Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com
Personal Web Site: www.enjoyjava.com
________________________________________________________________

On Jun 29, 2010, at 8:11 PM, Tyrone wrote:

> Hi,
> 
> I have a JNI method and should call this in my Tuscany Service.
> It is like this..
> 
> @Service(MyService.class)
> public class MyServiceImpl{
>     ...
>     public String myMethod(String text){
>         ...
>         JNIClass.myJNIMethod(text);  // call JNI static method (in windows 
> platform, call funciton in native dll)
>         ...
>     }
> }
> 
> I wrote a java program to start the service, and call it, like this
> 
> public class ServiceClient{
>     public static void main(String[] args){
>           Node node = 
> NodeFactory.newInstance().createNode("MyService.composite");
>           node.start();
>           MyService myService = ((Client)node).getService(MyService.class, 
> "MyServiceComponent");
>           myService.myMethod("text");
>     }
> }
> 
> In this way, the service  works and client can get result of myMethod.
> But when I use binding.ws in composite file and call the service via a web 
> service client, 
> It just stops at calling JNI method, and no error or exception message.
> I have searched messages in mailing list, but no relevent ones.
> I really need some help. Any one can tell me why and how to solve this?
> 
> Thanks very much,
> Tyrone

Reply via email to