Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Eclipse上运行Java卡连接版Web示例?_Java_Eclipse_Netbeans_Eclipse Plugin_Javacard - Fatal编程技术网

如何在Eclipse上运行Java卡连接版Web示例?

如何在Eclipse上运行Java卡连接版Web示例?,java,eclipse,netbeans,eclipse-plugin,javacard,Java,Eclipse,Netbeans,Eclipse Plugin,Javacard,我从Oracle官方网站下载并安装了它。JCDK中有一些。在书面文件中: 所有示例都必须在NetBeans IDE中运行。他们无法逃避 此版本的开发工具包中的命令行 示例可以正确使用NetBeans IDE。我可以导入它们并在Java卡平台上运行 但是我想在EclipseIDE上使用这些示例。在Eclipse中,作为Java卡SDK路径,我显示了Java卡连接的主路径。然后创建新设备并尝试启动它[例如]。但Eclipse提供了: ApduTool thread exited User input

我从Oracle官方网站下载并安装了它。JCDK中有一些。在书面文件中:

所有示例都必须在NetBeans IDE中运行。他们无法逃避 此版本的开发工具包中的命令行

示例可以正确使用NetBeans IDE。我可以导入它们并在Java卡平台上运行

但是我想在EclipseIDE上使用这些示例。在Eclipse中,作为Java卡SDK路径,我显示了Java卡连接的主路径。然后创建新设备并尝试启动它[例如]。但Eclipse提供了:

ApduTool thread exited
User input thread exited
APDU|ApduTool [v3.0.2]
APDU|    Copyright (c) 2009 Sun Microsystems, Inc.
APDU|    All rights reserved.
APDU|    Use is subject to license terms.
APDU|Opening connection to localhost on port 9025.
APDU|Connected.
APDU|java.net.ConnectException: Connection refused: connect
ApduTool process finished with code: 1
.log文件:

!ENTRY org.eclipse.core.jobs 4 2 2015-09-08 01:39:17.142
!MESSAGE An internal error occurred during: "Launching CardHolderApp".
!STACK 0
java.lang.RuntimeException: Cannot start device. Please see the log.
    at com.oracle.javacard.jcdk.launch.runconfiguration.AppletRunConfigurationDelegate.launch(AppletRunConfigurationDelegate.java:79)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
是否可以在Eclipse IDE中运行Java卡连接的Web项目

更新:

设备已成功启动。但项目尚未部署。它为每个字符串使用提供“不支持的字符串类型常量”。 代码示例:

public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    response.setContentType("text/html"); // unsupported String type constant
    PrintWriter out = response.getWriter();
    RequestDispatcher dispatcher = null;
    dispatcher = request.getRequestDispatcher("/WEB-INF/header.i");//unsupported String type constant
    response.sendRedirect(response.encodeRedirectURL("http://www.sun.com"));//unsupported String type constant
    dispatcher.include(request, response);
    dispatcher.include(request, response);
}

经典版不支持字符串。但它必须在互联版本上工作。

忘记了其间所有复杂的软件。仅查看错误消息,您的本地主机上的端口9025似乎未打开或不可用:

APDU|Opening connection to localhost on port 9025.
APDU|Connected.
APDU|java.net.ConnectException: Connection refused: connect
ApduTool process finished with code: 1
文本[java.net.ConnectException:Connection-rejected:connect],每次我看到“Connection-rejected”都意味着java试图在端口上创建一个套接字(本例中为9025),但由于阻塞(如防火墙)或不可用(其他东西正在使用端口9025),它无法获取端口号

在windows或*nix上,通常可以使用netstat命令查看正在使用的端口


嗯,阿德姆

你看过《日食》杂志吗?据我所知,这是经典版。不适用于servlet。您检查过了吗?它也写着“经典版”,但我想试试。是的,我也查过了。我无法让它与连接版一起工作。我尝试使用哪个端口无关紧要。同样的错误。据我所知,Connected Edition开发工具包仅适用于Windows。同样的代码在NetBeans上运行得很清楚,即使防火墙关闭,也会在Eclipse上出现错误?可能有助于在NetBeans启动并运行时重复,然后比较两个netstat-a输出…当然,在启动NetBeans之前关闭Eclipse。我在堆栈跟踪中注意到了其他一些东西…您是否在调试模式下运行它…我看到了DebugUIPlugin?因为调试器将打开一个端口以允许您单步执行代码。您是否尝试使用运行配置(无调试器)?这不是调试模式。设备启动了。但它在我使用的每个字符串(例如
response.setContentType(“text/html”);
)上都为我提供了“不支持的字符串类型常量”。所以,Eclipse上的这个设备似乎只适用于经典版。也许还有其他方法可以设置默认设备以使用Connected Edition。或者,这在Eclipse上是不可能运行的。可能我需要联系Oracle了解更多信息。端口已打开。但项目尚未部署。浏览器无法加载该页。