无法调用注释处理器 - 在 Weblogic 12.2.1.2.0 中部署时

Boo*_*thi 5 java ejb weblogic weblogic8.x weblogic12c

我正在将一个 java 项目从 weblogic 8.1 迁移到 weblogic 12c。

根据oracle文档,我已经转换了以下内容。

 1. Servicegen converted to jwsc task
 2. deployment descriptor has been modified
 3. Below annotations added in service implementation file

  @WebService
  @SoapBinding
  @SoapMessageHandler
Run Code Online (Sandbox Code Playgroud)

在所有上述更改确实生成了war文件并部署在weblogic 12c服务器中之后,它会抛出如下错误

Unable to invoke annotation processor

<BEA-160228> App merge failed your application
weblogic.utils.compiler.ToolFailureException: unable to invoke annotation processor
Run Code Online (Sandbox Code Playgroud)

代码 :

package com.tutorialspoint.stateless;

import com.tutorialspoint.entity.Book;
import java.util.List;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
@WebService(serviceName="LibraryService")
public class LibraryPersistentBean implements LibraryPersistentBeanRemote {
    
   public LibraryPersistentBean() {
   }

   @PersistenceContext(unitName="EjbComponentPU")
   private EntityManager entityManager;         

   public void addBook(Book book) {
      entityManager.persist(book);
   }    
   
   @WebMethod(operationName="getBooks")
   public List <Book> getBooks() {
      return entityManager.createQuery("From Book").getResultList();
   }
}
Run Code Online (Sandbox Code Playgroud)

Boo*_*thi 1

解决方案: Servlet 映射导致迁移时 webservice.xml

中出现问题。

<servlet-link></servlet-link>
Run Code Online (Sandbox Code Playgroud)