简体   繁体   English

嵌入式Java Applet在JSPX页面中返回NullPointerException

[英]Embedded Java Applet Returns NullPointerException in JSPX pages

We have a ADF web application programmed in JDeveloper 11g (11.1.2.4.0), which was migrated over from a 10g (10.1.3.5.0) project 我们有一个用JDeveloper 11g(11.1.2.4.0)编程的ADF Web应用程序,该应用程序是从10g(10.1.3.5.0)项目迁移而来的。

Within the application, occasionally, we need to call a Java Applet which is placed in a public_html/applet folder. 在应用程序中,有时,我们需要调用放置在public_html / applet文件夹中的Java Applet。 The jars show up in the Web-Content tab of the ViewController in the Application Navigator, just like it did in 10g. 罐子显示在Application Navigator的ViewController的“ Web-Content”选项卡中,就像在10g中一样。

The applet tag looks like this: applet标签如下所示:

<applet height="100" width="100" 
    code="applet.SetupApplet" archive="applet/SSetupApplet.jar">
            <param name="debug" value="true"/>   

I've also tried calling the applet with the Java deploy applet script 我也尝试过使用Java部署小程序脚本调用小程序

<trh:script source="http://java.com/js/deployJava.js"></trh:script>
    <trh:script>
        var attributes = {code:'applet.SetupApplet',
        archive:'applet/SSetupApplet.jar'};
        var parameters = {} ;
        var version = '1.6' ;
        deployJava.runApplet(attributes, parameters, version);
   </trh:script>

When I navigate to the login.jspx page that has this tag, it pops the Java Console open, but doesn't actually run the applet (or show the prompts to allow using the Applet). 当我导航到具有此标记的login.jspx页面时,它将弹出Java控制台,但实际上并没有运行该applet(或显示允许使用Applet的提示)。 Instead, the applet is shown with an error and the Application error says NullPointerException ; 相反,小程序显示有错误,并且Application错误显示NullPointerException there's no error shown in the Java Console. Java控制台中没有显示任何错误。 I've double-checked the path and it's correct (with incorrect paths, I get a ClassNotFoundException ). 我已经仔细检查了路径,它是正确的(路径不正确,我得到ClassNotFoundException )。 In the application server logs, I see the following error: 在应用程序服务器日志中,我看到以下错误:

<Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on IPADDRESS during the configured idle timeout of 5 secs>

I created a normal .jsp file that's outside the ADF Faces Context in the applet folder. 我在applet文件夹中的ADF Faces上下文外部创建了一个普通的.jsp文件。 Navigating to it with the same applet tags does have the Java applet run without the socket error. 使用相同的applet标记导航到它确实可以运行Java applet而不会出现套接字错误。 The same code in 10g works fine. 10g中的相同代码可以正常工作。

Is there anything I'm missing? 有什么我想念的吗?

Check out Frank's article http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf . 查看Frank的文章http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf He explains how to embed the applet and at the end of the article how to configure the browser. 他解释了如何嵌入小程序,并在文章的末尾介绍了如何配置浏览器。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM