简体   繁体   English

在Glassfish Web服务器上部署的Spring Web应用程序中使用共享库(.so)

[英]Use shared library(.so) in spring web application deployed on glassfish web server

I am using System.loadLib() in a spring web application deployed on glassfish to load a .so (jni shared library) in my application...But when System.loadLibrary executes the server stop suddenly without any exception in server log! 我正在在Glassfish上部署的Spring Web应用程序中使用System.loadLib()在应用程序中加载.so(jni共享库)...但是,当System.loadLibrary执行服务器时,服务器日志突然停止,没有任何异常!

what is the problem ? 问题是什么 ? my code: 我的代码:

@Controller
@RequestMapping(value = "/getdata", method = RequestMethod.POST)
public class temperatureController {

    @RequestMapping(value = "/temp" , method = RequestMethod.GET)
    public @ResponseBody
     float getTemperature(){
    System.err.print("beforeeeeeeeeeeeN");
        NativeClass n = new NativeClass();
        System.err.print("beforeeeeeeeeeeeLoadLib");
        try {
            System.loadLibrary("NativeClass");
            System.err.print("LoadedintempClass");
        }
        catch (Throwable e){
            System.err.print("not loaded in temp class");

            e.printStackTrace();
        }
        System.err.print("afteeeeeeeerLoadLib");
            float temp =  n.getTemperature(); // invoke the native method
        System.err.print("tttttttttt");
        System.err.print(temp);
           return temp ;
     }

server log : 服务器日志:

 [2016-05-30T19:40:36.364+0000] [glassfish 4.1] [SEVERE] [] [] [tid: _ThreadID=27 _ThreadName=Thread-9] [timeMillis: 1464637236364] [levelValue: 1000] [[
      beforeeeeeeeeeeeN]]

    [2016-05-30T19:40:36.391+0000] [glassfish 4.1] [SEVERE] [] [] [tid: _ThreadID=27 _ThreadName=Thread-9] [timeMillis: 1464637236391] [levelValue: 1000] [[
      beforeeeeeeeeeeeLoadLib]]

It is most probably a segmentation fault caused by the library and it brings down whole JVM. 这很可能是由库引起的分段错误,它导致整个JVM崩溃。 Try running GlasssFish from command line using bin/asadmin start-domain --verbose to keep running in the same console window. 尝试使用bin/asadmin start-domain --verbose从命令行运行GlasssFish,以保持在同一控制台窗口中运行。 You may be able to see SEGMENTATION FAULT in the console if it's the case. 在这种情况下,您可能会在控制台中看到SEGMENTATION FAULT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 部署的tomacat Web应用程序的共享库文件夹 - Shared library folder for deployed tomacat web application 在Glassfish上部署的Web应用程序上的XML解析错误 - XML parsing on a web application deployed on Glassfish error glassfish应用程序服务器中的Web服务器是什么? - what is the web server in glassfish application server? 没有 Web 服务器的 spring mvc(tomcat 或 glassfish) - spring mvc without web server (tomcat or glassfish) 用于Web应用程序的Spring OAuth库 - Spring OAuth Library for web application Glassfish Web应用程序无响应 - Glassfish web application not responding 如何从部署到JBoss EAP 6的Web应用程序访问部署到GlassFish 2服务器的EJB? - How to access EJB deployed to GlassFish 2 server from web app deployed to JBoss EAP 6? 在Glassfish Java EE应用程序上部署时,何处放置共享库.so用于JNI本机调用 - Where to place a shared library .so for JNI native calls when deploying on Glassfish Java EE application 为什么我的Web应用程序可以在Glassfish上运行,而不能在Tomcat服务器上运行? - Why my web application works on Glassfish, but doesn't on Tomcat server? JBoss Application Server:从另一台机器访问已部署的Web应用程序 - JBoss Application Server: Accessing deployed web application from another machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM