java.lang.illegalargumentException:使用[EJB]和类型[AppClient]类型的嗅探器不应同时要求档案
-
29-09-2019 - |
题
环境: :Glassfish 3.0.1,Netbeans 6.9,JDK 6U21
还用Glassfish 3.0.1,Netbeans 6.9.1,JDK 6U22进行了测试,但结果是相同的。
问题: :无法在企业应用程序(App-Client,EJB,WAR)中运行App-Client。
EJB罐有 只有本地 接口和不包含主要方法。
玻璃鱼的消息
SEVERE: Exception while deploying the app
java.lang.IllegalArgumentException: Sniffers with type [ejb] and type [appclient] should not claim the archive at the same time. Please check the packaging of your archive [C:\Users\myUser\.netbeans\6.9\config\GF3\domain1\applications\fabench-app-client]
at com.sun.enterprise.v3.server.SnifferManagerImpl.validateSniffers(SnifferManagerImpl.java:221)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:426)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Netbeans运行消息
Building jar: F:\NetBeansProjects\fabench\fabench-app-client\dist\fabench-app-client.jar
dist:
pre-run-deploy:
Distributing F:\NetBeansProjects\fabench\fabench-app-client\dist\fabench-app-client.jar to [GlassFish Server 3]
deploy?path=F:\NetBeansProjects\fabench\fabench-app-client\dist\fabench-app-client.jar&name=fabench-app-client&force=true failed on GlassFish Server 3
F:\NetBeansProjects\fabench\fabench-app-client\nbproject\build-impl.xml:716: The module has not been deployed.
BUILD FAILED (total time: 0 seconds)
application-client.xml
这仅包含 <display-name>
填充标签,但是 <ejb-ref>
也可以用 <remote>
界面。没有 <local>
标签,所以我想 app-client
只能使用远程接口。这是真的?
这里有什么问题?
任何帮助或想法都将不胜感激!预先感谢Wheelie
解决方案 2
- App-Lient通过远程接口访问EJB
- 由于Glassfish V3,必须在Java类库中包装远程接口,因此可以分发接口。
- App-Client必须在企业应用程序中(但与EJB和WAR之间的耳朵相同)。
教程下 http://netbeans.org/kb/docs/javaee/entappclient.html 说明如何创建 app-client
, ,但是对我不起作用;还有一个问题: 无法运行正在访问glassfish v3上EJB的应用程序客户.
其他提示
不是玻璃鱼专家,但听起来好像罐子被视为EJB罐子和应用客户端罐子。如果是这样,它不是一个有效的应用程序。我要检查的第一件事是确保您的应用客户端罐 不是 有一个:
- meta-inf/ejb-jar.xml
- @stateless,@singleton,@stateful或@messageDriven的任何类
在另一个问题上,正确的是,应用程序客户端是远程客户端,根据定义,无法使用其@local界面与Bean交谈。
不隶属于 StackOverflow