1

我正在构建一个 Java EE Web 应用程序。有时我会收到这样的错误

JBAS011006:由于异常,未安装可选组件 com.example.MyServlet:[..]DeploymentUnitProcessingException:JBAS011054:找不到类的默认构造函数

但是,com.example.MyServlet 对我的应用程序非常重要。我如何将其标记为强制性?

编辑: com.example.MyServlet ;我之前没有包括它,因为我想要一个一般性的答案。

/**
 * Class to use JSR299 in ServiceLocators
 */
@WebServlet(value = "/gwtRequest", name = "InjectingRequestFactoryServlet")
//<!-- You'll need to compile with -extras and move the symbolMaps directory
//        to this location if you want stack trace deobfuscation to work -->
@WebInitParam(name = "symbolMapsDirectory", value = "WEB-INF/classes/symbolMaps/")
public class InjectingRequestFactoryServlet extends RequestFactoryServlet {
    @Inject
    public InjectingRequestFactoryServlet(InjectingServiceDecorator serviceDecorator) {
        super(new DefaultExceptionHandler(), serviceDecorator);
    }
}
4

0 回答 0