java.lang.IllegalArgumentException:类型为 [ejb] 和类型 [appclient] 的嗅探器不应同时声明存档

发布于 2024-09-30 15:14:34 字数 4126 浏览 3 评论 0原文

环境:GlassFish 3.0.1、NetBeans 6.9、JDK 6u21

还使用 GlassFish 3.0.1、NetBeans 6.9.1、JDK 6u22 进行测试,但结果相同。

问题:无法在企业应用程序(应用程序客户端、ejb、war)中运行应用程序客户端。

EJB jar 仅具有 Local 接口,不包含主要方法。

GlassFish 消息

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

这仅包含填充的 标记,但也可以使用 接口指定 。没有 标签,所以我猜 app-client 只能使用远程接口。这是真的吗?

这里可能有什么问题?

任何帮助或想法将不胜感激! 提前致谢, 前轮离地

Environment: GlassFish 3.0.1, NetBeans 6.9, JDK 6u21

Also tested with GlassFish 3.0.1, NetBeans 6.9.1, JDK 6u22, but results are the same.

Problem: Unable to run app-client in an enterprise application (app-client, ejb, war).

The EJB jar has only Local interfaces and contains no main methods.

GlassFish Message

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 run message

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

This contains only the <display-name> tag filled, but <ejb-ref> can also be specified with a <remote> interface. There is no <local> tag, so I guess app-client is only able to work with Remote interfaces. Is this true?

What could be the problem here?

Any help or ideas would be appreciated!
Thanks in advance,
wheelie

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

零時差 2024-10-07 15:14:34

不是 Glassfish 专家,但听起来该 jar 既被视为 ejb jar 又被视为应用程序客户端 jar。如果是这种情况,则它不是有效的应用程序。我要检查的第一件事是确保您的应用程序客户端 jar 没有:

  1. META-INF/ejb-jar.xml
  2. 任何用 @Stateless、@Singleton、@Stateful 或 @MessageDriven 注释的类

在另一个问题上,应用程序客户端是远程客户端,根据定义不能使用 @Local 接口与 Bean 进行通信。

Not a Glassfish expert, but it sounds like the jar is being seen as both an ejb jar and an app client jar. If that's the case, it is not a valid app. First thing I'd check is to ensure your app client jar does not have either:

  1. A META-INF/ejb-jar.xml
  2. Any classes annotated with @Stateless, @Singleton, @Stateful or @MessageDriven

On the other question, right, application clients are remote clients and by definition cannot talk to beans using their @Local interface.

早乙女 2024-10-07 15:14:34
  • 应用程序客户端通过远程接口访问 EJB
  • 从 GlassFish v3 开始,远程接口必须打包在 Java 类库中,因此接口是可分发的。
  • 应用程序客户端必须位于企业应用程序 EAR 内部(但与 EJB 和 WAR 并不严格属于同一 EAR)。

http://netbeans.org/kb/docs/javaee/entappclient.html 下的教程 解释了如何创建 app-client,但它对我不起作用;还有一个与此相关的问题: 无法运行正在访问 GlassFish v3 上的 EJB 的应用程序客户端

  • App-client accesses EJBs via Remote interfaces
  • Since GlassFish v3, Remote interfaces has to be packed inside a Java Class Library, so interfaces are distributable.
  • App-client has to be inside an enterprise application EAR (but not strictly the same EAR with EJB and WAR).

The tutorial under http://netbeans.org/kb/docs/javaee/entappclient.html explains how to create an app-client, however it doesn't work for me; there is also a question for that matter: Unable to run app-client that is accessing an EJB on GlassFish v3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文