gpt4 book ai didi

java - 将dll添加到spring mvc项目中

转载 作者:行者123 更新时间:2023-12-01 13:01:29 26 4
gpt4 key购买 nike

我有一个使用 Eclipse Kepler 的 spring mvc 项目,并且想在该项目中使用 .net dll。

我按照 this info 完成了为 java 准备 dll 的过程

在我的

spring project -> Properties -> Java Class Path -> libraries -> External Jar -> Located my jar used to call the c# methods.

接下来添加 native 库

spring project -> Properties -> Java Class Path -> libraries -> Located external jar added -> expand -> highlight Native Library Locaton -> path to where my dll's are located

在我的 spring mvc 项目代码中,我可以在外部 jar 文件中创建该对象的实例。

MyJavaCallingComObject testObj = new MyJavaCallingComObject ();
testObj.GetDetails("John Doe");

GetDetails = supposed to return user information given the user name

但是,当我去调用一个方法时,我遇到了这个

#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (os_windows_x86.cpp:143), pid=8644, tid=10476
# guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result from topLevelExceptionFilter
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

我的 Eclipse 位于 c:\eclipse

我的所有工作空间都位于d:\workspaces

最佳答案

我想这篇文章准确地描述了您正在寻找的内容:

http://java.dzone.com/articles/building-java-applications-use

它显示了构建 Sprint MVC 应用程序的分步指南,该应用程序利用直接从 JAVA 使用的 .NET DLL。

关于java - 将dll添加到spring mvc项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23483390/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com