”错误“无法调用注释处理器” wben 在 Weblogic 12c 中部署 Web 服务
我有一个使用 jwsc 为 Weblogic 12c 实现的 Web 服务。这是一个 WAR 文件。用于参数和返回的各种 bean 的类是使用标准 Maven 插件添加的,一切看起来都正常。
编译并打包就OK了。但任何部署它的尝试都会从管理控制台得到“无法调用注释处理器”(是的,拼写错误)。
堆栈跟踪如下,但实际上没有提供太多提示。我搜索过其他问题/答案,但一无所获。
支持类最初是用 xjc 生成的,因此有很多注释。我删除了这些以防万一这是问题,但没有改变。因此,唯一的注释位于 WS 实现类中:
@WebService(name = "MyServicePortType", serviceName = "MyService", targetNamespace = "http://test/wsdl/getInfo/v1")
@WLHttpTransport(contextPath = "my-nbi", serviceUri = "/MyService")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
public class MyServiceImpl implements OPLService {
POM 中只有一个依赖项:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>wls-api</artifactId>
<version>12.2.1</version>
<type>jar</type>
</dependency>
可能的连接是,如果我尝试生成为 JAXWS Web 服务(type="JAXWS"
而不是 < code>type="JAXRPC" 在 jwsc 的参数中)失败并显示:
错误:注释处理器'com.sun.tools.ws.processor.modeler.annotation.WebServiceAp' 未找到
我尝试将带有该类的 jar 文件(weblogic 提供了几个)添加到 JWSC 类路径中,但没有成功(没有任何结果)似乎完全改变了)。
关于下一步要尝试什么有什么想法吗?
编辑:我错过的一件事是,WL 似乎喜欢将其 SOAP Web 服务作为 EAR(包含 WAR)。我尝试过,但仍然收到错误。
然后,我做了之前应该做的事情,并从文档中的示例开始(它使用 ANT 而不是 Maven,但构建了 EAR)。这很有效,我慢慢地将其修改为我实际需要的网络服务。完成后,我将尝试找出差异所在。
<Mar 20, 2022 11:55:57,636 AM UTC> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: Unable to invoke Annotation processoror
at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:168)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:198)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:781)
at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:541)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5787)
[Lots of console related entries removed]
Caused by: java.lang.AssertionError: Unable to invoke Annotation processoror
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:287)
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotationsWithServiceLinks(WSEEModuleHelper.java:245)
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:178)
at weblogic.wsee.tools.WSEEWebAppToolsModuleExtension.processAnnotations(WSEEWebAppToolsModuleExtension.java:216)
at weblogic.wsee.tools.WSEEWebAppToolsModuleExtension.merge(WSEEWebAppToolsModuleExtension.java:109)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:33)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
... 116 more
I have a Webservice implemented with jwsc for Weblogic 12c. It's a WAR file. The classes for the various beans used for the parameters and returns are added with the standard maven plugin, and everything looks OK.
It compiles and packages OK. But any attempt to deploy it gets "Unable to invoke Annotation processoror" (yes, spelt wrong) from the Admin console.
The stacktrace is below, but really doesn't provide much of a hint. I've searched for other questions/answers but have come up blank.
The supporting classes were originally generated with xjc and so had many annotations. I removed those in case that was the issue, but no change. So the only annotations are in the WS implementation class:
@WebService(name = "MyServicePortType", serviceName = "MyService", targetNamespace = "http://test/wsdl/getInfo/v1")
@WLHttpTransport(contextPath = "my-nbi", serviceUri = "/MyService")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
public class MyServiceImpl implements OPLService {
There's just a single dependency in the POM:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>wls-api</artifactId>
<version>12.2.1</version>
<type>jar</type>
</dependency>
Possibly connected is that if I try to generate as a JAXWS web service (type="JAXWS"
rather than type="JAXRPC"
in the args to jwsc) that fails with:
error: Annotation processor 'com.sun.tools.ws.processor.modeler.annotation.WebServiceAp' not found
I've tried adding jars with that class (there are several supplied with weblogic) to the JWSC classpath but with no success (nothing seemed to change at all).
Any ideas on what to try next?
EDIT: One thing I missed was that WL seems to like its SOAP web services as an EAR (containing the WAR). I tried that but still got the error.
I then did what should have done earlier and started with the sample from the documentation (which uses ANT rather than maven, but builds an EAR). That worked, and I've slowly modified that towards the web service I actually need. When I've done, I'll try to work out what the differences are.
<Mar 20, 2022 11:55:57,636 AM UTC> <Error> <J2EE> <BEA-160228> <AppMerge failed to merge your application. If you are running AppMerge on the command-line, merge again with the -verbose option for more details. See the error message(s) below.>
weblogic.utils.compiler.ToolFailureException: Unable to invoke Annotation processoror
at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:55)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:38)
at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:168)
at weblogic.utils.compiler.Tool.run(Tool.java:159)
at weblogic.utils.compiler.Tool.run(Tool.java:116)
at weblogic.application.compiler.AppMerge.merge(AppMerge.java:198)
at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:94)
at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:58)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:186)
at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:160)
at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:781)
at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:541)
at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5787)
[Lots of console related entries removed]
Caused by: java.lang.AssertionError: Unable to invoke Annotation processoror
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:287)
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotationsWithServiceLinks(WSEEModuleHelper.java:245)
at weblogic.j2ee.wsee.compiler.WSEEModuleHelper.processAnnotations(WSEEModuleHelper.java:178)
at weblogic.wsee.tools.WSEEWebAppToolsModuleExtension.processAnnotations(WSEEWebAppToolsModuleExtension.java:216)
at weblogic.wsee.tools.WSEEWebAppToolsModuleExtension.merge(WSEEWebAppToolsModuleExtension.java:109)
at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:33)
at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:64)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
at weblogic.application.compiler.BaseMerger.merge(BaseMerger.java:20)
at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:75)
at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:40)
at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
... 116 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论