{"action":"closed","issue":{"url":"https://api.github.com/repos/javaee/glassfish/issues/22317","repository_url":"https://api.github.com/repos/javaee/glassfish","labels_url":"https://api.github.com/repos/javaee/glassfish/issues/22317/labels{/name}","comments_url":"https://api.github.com/repos/javaee/glassfish/issues/22317/comments","events_url":"https://api.github.com/repos/javaee/glassfish/issues/22317/events","html_url":"https://github.com/javaee/glassfish/issues/22317","id":269280373,"node_id":"MDU6SXNzdWUyNjkyODAzNzM=","number":22317,"title":"ClassNotFoundException when used a EJB `@Stateless` backend JAXRS Resource with Bean Validation","user":{"login":"hantsy","id":854520,"node_id":"MDQ6VXNlcjg1NDUyMA==","avatar_url":"https://avatars2.githubusercontent.com/u/854520?v=4","gravatar_id":"","url":"https://api.github.com/users/hantsy","html_url":"https://github.com/hantsy","followers_url":"https://api.github.com/users/hantsy/followers","following_url":"https://api.github.com/users/hantsy/following{/other_user}","gists_url":"https://api.github.com/users/hantsy/gists{/gist_id}","starred_url":"https://api.github.com/users/hantsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hantsy/subscriptions","organizations_url":"https://api.github.com/users/hantsy/orgs","repos_url":"https://api.github.com/users/hantsy/repos","events_url":"https://api.github.com/users/hantsy/events{/privacy}","received_events_url":"https://api.github.com/users/hantsy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-28T03:39:55Z","updated_at":"2018-09-17T20:30:08Z","closed_at":"2018-09-17T20:30:08Z","author_association":"NONE","body":"This exception is only occurred when used a  `@Stateless` EJB as JAXRS Resource. \r\n\r\nI have written a sample for reproducing this issue.\r\n\r\n```\r\npublic class Message implements Serializable {\r\n\r\n    @NotBlank\r\n    @NotNull\r\n    private String body;\r\n\r\n    public Message() {\r\n    }\r\n\r\n    public Message(String body) {\r\n        this.body = body;\r\n    }\r\n\r\n    public String getBody() {\r\n        return body;\r\n    }\r\n\r\n    public void setBody(String body) {\r\n        this.body = body;\r\n    }\r\n\r\n}\r\n```\r\n\r\n`Message` is a POJO with Bean validation annotations.\r\n\r\n```java\r\n\r\n@Path(\"messages\")\r\n//@RequestScoped\r\n@Stateless\r\npublic class MessageResource {\r\n    \r\n    @Inject\r\n    Event<Message> messageEvent;\r\n\r\n    @POST\r\n    @Consumes(MediaType.APPLICATION_JSON)\r\n    public Response send(@Valid Message message) {\r\n        messageEvent.fire(message);\r\n        return Response.ok().build();\r\n    }\r\n}\r\n```\r\n\r\nHere if I used a CDI `RequestScoped`, it worked, but when I used a `@Stateless` instead, I will get the following exception when I start up the application .\r\n\r\n\r\n```\r\nSevere:   Exception while invoking class org.glassfish.ejb.startup.EjbApplication start method\r\njava.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\n\tat com.sun.ejb.containers.BaseContainer.setStartedState(BaseContainer.java:962)\r\n\tat org.glassfish.ejb.startup.EjbApplication.markAllContainersAsStarted(EjbApplication.java:140)\r\n\tat org.glassfish.ejb.startup.EjbApplication.start(EjbApplication.java:152)\r\n\tat org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)\r\n\tat org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)\r\n\tat org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)\r\n\tat org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:536)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:535)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:566)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:558)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:557)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1465)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:110)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1847)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1723)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)\r\n\tat org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:190)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)\r\n\tat org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)\r\n\tat org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)\r\n\tat org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)\r\n\tat org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)\r\n\tat org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\nCaused by: java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1621)\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1471)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.buildEjbInterceptorChain(InterceptorManager.java:431)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.<init>(InterceptorManager.java:131)\r\n\tat com.sun.ejb.containers.BaseContainer.initializeInterceptorManager(BaseContainer.java:3432)\r\n\tat com.sun.ejb.containers.BaseContainer.setStartedState(BaseContainer.java:950)\r\n\t... 44 more\r\n\r\nSevere:   Exception during lifecycle processing\r\njava.lang.RuntimeException: java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\n\tat com.sun.ejb.containers.BaseContainer.setStartedState(BaseContainer.java:962)\r\n\tat org.glassfish.ejb.startup.EjbApplication.markAllContainersAsStarted(EjbApplication.java:140)\r\n\tat org.glassfish.ejb.startup.EjbApplication.start(EjbApplication.java:152)\r\n\tat org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)\r\n\tat org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)\r\n\tat org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)\r\n\tat org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:536)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:535)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:566)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:558)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:557)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1465)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:110)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1847)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1723)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)\r\n\tat org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:190)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)\r\n\tat org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)\r\n\tat org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)\r\n\tat org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)\r\n\tat org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)\r\n\tat org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\nCaused by: java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1621)\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1471)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.buildEjbInterceptorChain(InterceptorManager.java:431)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.<init>(InterceptorManager.java:131)\r\n\tat com.sun.ejb.containers.BaseContainer.initializeInterceptorManager(BaseContainer.java:3432)\r\n\tat com.sun.ejb.containers.BaseContainer.setStartedState(BaseContainer.java:950)\r\n\t... 44 more\r\n\r\nSevere:   Exception while loading the app\r\nSevere:   Undeployment failed for context /jaxrs-issue\r\nSevere:   Exception while loading the app : java.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\njava.lang.ClassNotFoundException: org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1621)\r\n\tat org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1471)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.buildEjbInterceptorChain(InterceptorManager.java:431)\r\n\tat com.sun.ejb.containers.interceptors.InterceptorManager.<init>(InterceptorManager.java:131)\r\n\tat com.sun.ejb.containers.BaseContainer.initializeInterceptorManager(BaseContainer.java:3432)\r\n\tat com.sun.ejb.containers.BaseContainer.setStartedState(BaseContainer.java:950)\r\n\tat org.glassfish.ejb.startup.EjbApplication.markAllContainersAsStarted(EjbApplication.java:140)\r\n\tat org.glassfish.ejb.startup.EjbApplication.start(EjbApplication.java:152)\r\n\tat org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)\r\n\tat org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)\r\n\tat org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)\r\n\tat com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)\r\n\tat org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:540)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:536)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:535)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:566)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:558)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat javax.security.auth.Subject.doAs(Subject.java:360)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:557)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1465)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:110)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1847)\r\n\tat com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1723)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)\r\n\tat com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)\r\n\tat org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:190)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)\r\n\tat com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)\r\n\tat org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)\r\n\tat org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)\r\n\tat org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)\r\n\tat org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)\r\n\tat org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)\r\n\tat org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)\r\n\tat org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)\r\n\tat org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:593)\r\n\tat org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n\r\n```\r\n\r\n\r\n## Environment Details\r\n* GlassFish Version (and build number): v 5.0\r\n* JDK version:\r\n\r\n        java version \"1.8.0_152\"\r\n        Java(TM) SE Runtime Environment (build 1.8.0_152-b16)\r\n        Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)\r\n\r\n* OS: Windows 10\r\n* Database: Glassfish built-in Derby "}}
{"actor":{"display_login":"glassfishrobot"}}