Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDI deployment failure at Payara Micro #3281

Closed
I2Qi opened this issue Oct 17, 2018 · 5 comments
Closed

CDI deployment failure at Payara Micro #3281

I2Qi opened this issue Oct 17, 2018 · 5 comments
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev

Comments

@I2Qi
Copy link

I2Qi commented Oct 17, 2018

Description

Unable to deploy application on Payara Micro because of CDI deplyment failure.

Excepted Outcome

It seems that fish.payara.microprofile.metrics.cdi.producer.MetricProducer should not be final class.

I saw that final class is unproxyable bean type in CDI specification.

Current Outcome

In deployment of my application, below error occurs.

[2018-10-17T17:17:43.524+0900] [] [重大] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1539764263524] [levelValue: 1000] [[
  Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001503: Bean class which has interceptors cannot be declared final:  class fish.payara.microprofile.metrics.cdi.producer.MetricProducer -- WELD-001503: Bean class which has interceptors cannot be declared final:  class fish.payara.microprofile.metrics.cdi.producer.MetricProducer
	at org.jboss.weld.injection.producer.InterceptionModelInitializer.init(InterceptionModelInitializer.java:114)
	at org.jboss.weld.injection.producer.BeanInjectionTarget.buildInterceptionModel(BeanInjectionTarget.java:94)
	at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeInterceptionModel(BeanInjectionTarget.java:89)
	at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeAfterBeanDiscovery(BeanInjectionTarget.java:99)
	at org.jboss.weld.injection.producer.InjectionTargetInitializationContext.initialize(InjectionTargetInitializationContext.java:42)
	at org.jboss.weld.injection.producer.InjectionTargetService.initialize(InjectionTargetService.java:63)
	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:475)
	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:86)
	at org.glassfish.weld.WeldDeployer.processApplicationLoaded(WeldDeployer.java:510)
	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:422)
	at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:333)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:496)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:540)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:549)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:545)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:360)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:544)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:575)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:567)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:360)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:566)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1475)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:111)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1857)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1733)
	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
	at fish.payara.micro.impl.PayaraMicroImpl.deployAll(PayaraMicroImpl.java:1559)
	at fish.payara.micro.impl.PayaraMicroImpl.bootStrap(PayaraMicroImpl.java:1037)
	at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:200)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at fish.payara.micro.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
	at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:107)
	at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:70)
	at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:79)
	at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:397)
]]

[2018-10-17T17:17:43.525+0900] [] [重大] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1539764263525] [levelValue: 1000] Exception while loading the app

Steps to reproduce (Only for bug reports)

Use @interceptors annotation, and start payara micro.

Environment

  • Payara Version: 5.183
  • Edition: Micro
  • JDK Version: 8 OpenJDK
  • Operating System: Linux
  • Database: MySQL
@rdebusscher rdebusscher added PR: TESTS REQUIRED PR Requires Tests to be merged payara-micro labels Oct 25, 2018
@rdebusscher
Copy link

Hi,

I tried to reproduce your issue with Payara Micro 5.183 but without success.

I have created a project containing an endpoint, a CDI application scoped bean and an interceptor (activated within beans.xml).
As indicated, I used the @interceptors annotation on the CDI bean.

@ApplicationScoped
@Interceptors(HelloInterceptor.class)
public class SomeService {

The application deploys fine and interceptor is called.

Can you create a small reproducer for use to investigate this further.

Thank you very much
Rudy

@I2Qi
Copy link
Author

I2Qi commented Oct 29, 2018

Hi,

Sorry, my investigation was not enough. @interceptor with @priority annotation makes this failure.

Interceptor

@Interceptor
@Dependent
@Priority(2)
public class Interceptor {

Resource

@ApplicationScoped
@Interceptors(Interceptor.class)
public class SampleResource {

@rdebusscher
Copy link

Thanks for the clarification and I can confirm I can reproduce the issue.

The development engineers will have a look why it fails when using the @priority.

Thanks for reporting this issue.

Best regards
Rudy

@rdebusscher rdebusscher added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed PR: TESTS REQUIRED PR Requires Tests to be merged labels Oct 31, 2018
@MattGill98
Copy link
Contributor

Hi @I2Qi,

A PR is present to fix the issue here: #3375. Just to clarify the issue however, the interceptor you have declared above is not only an interceptor, but an interceptor binding. What this means is that every single class annotated with @Priority will be intercepted, which is causing the issue. Removing the @Interceptor annotation should make the app work as you expect before the applied fix.

As the PR has been made, I'll close this issue. Feel free to reopen it if you have any queries.

Hope this helps,

Matt

@I2Qi
Copy link
Author

I2Qi commented Nov 6, 2018

Hi,
Thanks for your explanation. No queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Projects
None yet
Development

No branches or pull requests

3 participants