启动JNLP java应用程序时出现ejbAccessException

时间:2014-01-07 13:57:06

标签: java java-ee jboss ejb jnlp

我正在尝试运行一个将一些jar文件下载到jvm缓存的jnlp文件,我开始在开始时遇到以下错误:

java.lang.NoClassDefFoundError: javax/ejb/EJBAccessException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBAccessException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 9 more

我的原因是什么这个javax.ejb.EJBAccessException?这是我的jnlp文件:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://10.100.10.9/ikarusdelhitest/" href="ikarus.jnlp">
<information>
    <title>ikarus</title>
    <vendor>my company name here</vendor>
    <homepage href="http://www.mycompanynamehere.com" />
    <description>description here</description>
    <icon href="ikarus.ico" />
    <offline-allowed />
</information>
<security>
    <all-permissions />
</security> 
<resources> 
    <jar href="jars/ikarus/ikarusClient.jar" />
    <jar href="jars/ikarus/ikarusDelegators.jar" />
    <jar href="jars/ikarus/clientRules.jar" />
    <jar href="jars/ikarus/ruleImps.jar" />
    <jar href="jars/ikarus/ikarusUtil.jar" />
    <jar href="jars/ikarus/ikarusResources.jar" />
    <jar href="jars/ikarus/domain.jar" />
    <jar href="jars/ikarus/domain_repository.jar" />
    <jar href="jars/ikarus/domain_service.jar" />
    <jar href="jars/ikarus/app_repository.jar" />
    <jar href="jars/ikarus/app_service.jar" />
    <jar href="jars/ikarus/infrastructure.jar" />
    <jar href="jars/ikarus/integration_domain.jar" />
    <jar href="jars/jboss_ejb_auth/ejb3-persistence.jar" />
    <jar href="jars/jboss_ejb_auth/jboss-ejb3x.jar" />
    <jar href="jars/jboss_ejb_auth/jbossall-client.jar" />
    <jar href="jars/jasper/commons-beanutils-1.8.0.jar" />
    <jar href="jars/jasper/commons-collections-3.2.1.jar" />
    <jar href="jars/jasper/commons-digester-1.7.jar" />
    <jar href="jars/jasper/commons-logging-1.1.jar" />
    <jar href="jars/jasper/iText-2.1.0.jar" />
    <jar href="jars/jasper/jasperreports-3.6.0.jar" />
    <jar href="jars/jasper/poi-3.2-FINAL-20081019.jar" />
    <property name="jnlp.localization" value="Delhi"/>
</resources>
<application-desc main-class="com.celebi.ikarus.main.Ikarus" />

2 个答案:

答案 0 :(得分:1)

您需要在资源中添加JRE,以便从标准库中受益。

尝试在第一个<j2se version="1.6+"/>代码之前添加<jar>

答案 1 :(得分:0)

我已经在我的应用程序的jar海洋深处找到了解决方案。基本上,jar资源文件都需要通过密钥库进行签名,它们应该包含一个META-INF / MANIFEST.MF文件,其中必须包含这些行:

Codebase: *
Permissions: all-permissions
Application-Name: <your application name here>
Caller-Allowable-Codebase: *
Trusted-Library: true
Application-Library-Allowable-Codebase: *

(不要忘记在清单文件末尾添加一条emtpy行,否则无法正确解析。)

此外,您需要在包含JNLP-INF文件夹的所有jar中包含.jnlp文件。(即,必须有一个JNLP-INF文件夹,其中包含.JNLP文件,用于应用程序中的所有jar存档即使是在第三方罐子里。还要注意用大写字母命名你的jnlp文件,如MYAPPLICATION.JNLP而不是myapplication.jnlp)

总而言之,在对Java应用程序进行故障排除时,应始终保持java控制台处于打开状态。您甚至不应该在java控制台上看到任何警告,因为对于Java虚拟机而言,由于未解决的警告,它实际上不会运行您的应用程序,因此Java控制台警告要严重得多。