WELD-001408: What to do when Unsatisfied dependencies for type Bean with qualifiers @Default

--Environment --Windows10 64bit version 1909 - openjdk 11 2018-09-25 - Eclipse IDE for Enterprise Java Developers Version: 2020-03 (4.15.0) - JSF 2.3.9

Event: An error message was displayed when starting Payara

Dialog error


cannot Deploy app-name
deploy is failing=Error occurred during deployment:
 Exception while loading the app :
 CDI deployment failure:WELD-001408:
 Unsatisfied dependencies for type HogeBean with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private jp.co.ç.bean
  at jp.co.ponsuke.HogeController.bean(HogeController.java:0)
 -- WELD-001408: Unsatisfied dependencies for type HogeBean with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private jp.co.ponsuke.HogeController.bean
  at jp.co.ponsuke.HogeController.bean(HogeController.java:0).
 Please see server.log for more details.

Cause: Because the object that CDI does not recognize as a bean is attached with @Inject.

Classes injected with CDI must have some scope annotation. Introduction to Easy-to-understand Java EE Web System-Shuwa System

HogeController.java


    /**Display bean. */
    @Getter
    @Inject
    private HogeBean bean;

There is no scope annotation ... It doesn't even implement the Serializable interface ...

HogeBean.java


import lombok.Builder;
import lombok.Value;

@Value
@Builder
public class HogeBean {
    @NonNull
    Integer fileSize;

    @NonNull
    String extensions;
}

Action: Delete @Inject

I didn't have to add it in the first place, so I'll delete it.

HogeController.java


    /**Display bean. */
    @Getter
    private HogeBean bean;

Other measures

For some time ... It seems that it can be handled by adding @Model or writing it in beans.xml. jsf - WELD-001408: Unsatisfied dependencies for type Customer with qualifiers @Default - Stack Overflow

Recommended Posts

WELD-001408: What to do when Unsatisfied dependencies for type Bean with qualifiers @Default
What to do when you launch an application with rails
java.security.InvalidKeyException: What to do when Illegal key size or default parameters
What to do when Gradle says "For more information, please recompile with the -Xlint: unchecked option"
What to do when Maven says "For more information, please recompile with the -Xlint: unchecked option"
[IOS] What to do when the image is filled with one color
What to do when CentOS cannot be started with VirtualBox on Catalina
What to do when a javax.el.PropertyNotWritableException occurs
Notes on what to do when EC2 is set up with t2.micro
What to do when undefined method ʻuser_signed_in?'
What to do when is invalid because it does not start with a'-'
What to do when debugging "Source not found"
What do you use when converting to String?
What to do when IllegalStateException occurs in PlayFramework
What to do when booting Ubuntu on WSL2 and getting "Process terminated with code 1"
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
A memo to do for the time being when building CentOS 6 series with VirtualBox
What to do when routing settings do not work after building Docker environment with Laravel
Think about what to do with education for young development engineers of SIer (Part 2)
What to do when The SSL certificate has expired
What to do when JSF tags do not become HTML
What to do if ClassNotFoundException occurs when starting Tomcat
What to do when a null byte error occurs
What to do when rails creates a 〇〇 2.rb file
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
[Java] [Spring] What to do if you cannot Autowire with Type Mismatch after annotating Spring Security
What to do when Git Repository cannot be displayed in Team Explorer for Eclipse in Azure
[Rails] What to do when the view collapses when a message is displayed with the errors method
What to do when it becomes Unable to find CDI BeanManager.
What happens to instance variables when copying an instance with ruby
What to do when Cannot apply expression operators to method binding
What to do if the app is not created with the latest Rails version installed when rails new
What to do if you get "Changes not staged for commit:" when you git status after git add.