gpt4 book ai didi

java - 运行简单 EJB 应用程序时出现问题

转载 作者:太空宇宙 更新时间:2023-11-04 08:55:18 25 4
gpt4 key购买 nike

我当前正在使用无状态 session Bean 运行一个简单的 EJB 应用程序。我正在使用 Personal Glassfish 3.0 开发 NetBeans 6.8,并且在我的系统上安装了 Java EE 和 Java SE。我不知道这是否相关,但我运行的是 Windows7 64 位版本。我实现的 session Bean 只有一个方法 sayHello();它只是在屏幕上打印 hello。当我尝试运行该应用程序时,出现以下错误:

pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Starting Personal GlassFish v3 Domain
Personal GlassFish v3 Domain is running.
Undeploying ...
Initializing...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
run-display-browser:
run-ac:
pre-init:
init-private:
init-userdir:
init-user:
init-project:
do-init:
post-init:
init-check:
init:
deps-jar:
deps-j2ee-archive:
MyEnterprise-app-client.init:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
MyEnterprise-app-client.deps-jar:
MyEnterprise-app-client.compile:
MyEnterprise-app-client.library-inclusion-in-manifest:
MyEnterprise-app-client.dist-ear:
MyEnterprise-ejb.init:
MyEnterprise-ejb.deps-jar:
MyEnterprise-ejb.compile:
MyEnterprise-ejb.library-inclusion-in-manifest:
MyEnterprise-ejb.dist-ear:
pre-pre-compile:
pre-compile:
do-compile:
post-compile:
compile:
pre-dist:
post-dist:
dist-directory-deploy:
pre-run-deploy:
Undeploying ...
Initial deploying MyEnterprise to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\gfdeploy\MyEnterprise
Completed initial distribution of MyEnterprise
post-run-deploy:
run-deploy:
Warning: Could not find file C:\Users\Naqsam\.netbeans\6.8\GlassFish_v3\generated\xml\MyEnterprise\MyEnterpriseClient.jar to copy.
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist
Copying 4 files to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
Copying 1 file to C:\Users\Naqsam\Documents\NetBeansProjects\MyEnterprise\dist\MyEnterpriseClient
java.lang.NullPointerException
at org.glassfish.appclient.client.acc.ACCLogger$1.run(ACCLogger.java:149)
at java.security.AccessController.doPrivileged(Native Method)
at org.glassfish.appclient.client.acc.ACCLogger.reviseLogger(ACCLogger.java:146)
at org.glassfish.appclient.client.acc.ACCLogger.init(ACCLogger.java:93)
at org.glassfish.appclient.client.acc.ACCLogger.<init>(ACCLogger.java:80)
at org.glassfish.appclient.client.AppClientFacade.createBuilder(AppClientFacade.java:360)
at org.glassfish.appclient.client.AppClientFacade.prepareACC(AppClientFacade.java:247)
at org.glassfish.appclient.client.acc.agent.AppClientContainerAgent.premain(AppClientContainerAgent.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
Java Result: 1
run-MyEnterprise-app-client:
run:
BUILD SUCCESSFUL (total time: 1 minute 59 seconds)

服务器还显示此错误消息:

http://pastebin.com/NNu1eGA1

您认为问题出在哪里?这仍然是我的第一个 EJB 应用程序,因此我对这个 API 还很陌生。

最佳答案

删除所有 EJB 并重新启动 Glassfish 服务器。看看是否有任何错误。如果在没有 EJB 的情况下出现错误,则表明 Glassfish 安装有问题。

如果 Glassfish 在没有 EJB 的情况下正常启动,请发布您的 EJB 代码。 EJB 代码可能存在一些问题。

关于java - 运行简单 EJB 应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2417797/

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