问题描述
我已按照此网页上的教程进行操作:
I have followed the tutorial on this webpage: https://netbeans.org/kb/docs/javaee/entappclient.html
我想在Netbeans之外运行企业应用程序客户端。请注意,企业应用程序客户端与Web客户端不同,即它是应用程序客户端。
I want to run the enterprise application client outside of Netbeans. Note that an Enterprise application client is different to a web client i.e. it is an application client.
我尝试执行以下命令:
set classpath = C:\ GenenDevelopment\NetBeansProjects \\ \\ RemoteInterface\EJBRemote\dist\EJBRmote.jar
cd C:\Program Files\glassfish-4.0 \ glassfish \ bin
Appclient -client C:\ NetBeansProjects \RemoteInterface \ ClientTest \dist\ClientTest.jar
set classpath=C:\GenieDevelopment\NetBeansProjects\RemoteInterface\EJBRemote\dist\EJBRmote.jarcd C:\Program Files\glassfish-4.0\glassfish\binAppclient -client C:\NetBeansProjects\RemoteInterface\ClientTest\dist\ClientTest.jar
我得到的错误是:
Oct 04, 2016 7:59:32 PM org.glassfish.apf.impl.DefaultErrorHandler error
SEVERE: Class [ Ltest/TestEJBRemote; ] not found. Error while loading [ class cl
ienttest.Main ]
Exception in thread "main" java.lang.NoClassDefFoundError: test/TestEJBRemote
at clienttest.Main.main(Main.java:24)
Caused by: java.lang.ClassNotFoundException: test.TestEJBRemote
at java.net.URLClassLoader.findClass(Unknown Source)
at org.glassfish.appclient.client.acc.ACCClassLoader.findClass(ACCClassL
oader.java:237)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
有什么问题?远程接口位于类路径中。
What is the problem? The remote interface is in the classpath.
推荐答案
您需要在网络服务器(如tomcat或glassfish)甚至Google中运行J2EE应用程序AppEngine上。通常,您生成上载到Web服务器的.WAR文件。在tomcat的情况下,你打开,然后上传。 war文件,然后将显示您的webapp。
You need to run J2EE apps inside a webserver such as tomcat or glassfish or even Google AppEngine. Usually you generate .WAR file that you upload to the web server. In the case of tomcat you open http://localhost:8080/manager/html and then upload the .war file and then http://localhost:8080/myapp will show you your webapp.
这篇关于在Netbeans之外运行企业应用程序客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!