小编mik*_*128的帖子

WELD-001408:具有限定符@Default的Customer类型的不满意依赖项

我是Java EE新手.我想测试JSF,因此制作了一个简单的程序,但无法部署它.我收到以下错误消息:

cannot Deploy onlineshop-war
deploy is failing=Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Customer with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private de.java2enterprise.onlineshop.RegisterController.customer
at de.java2enterprise.onlineshop.RegisterController.customer(RegisterController.java:0)
. Please see server.log for more details.
Run Code Online (Sandbox Code Playgroud)

我的代码如下:Customer.java:

package de.java2enterprise.onlineshop.model;

public class Customer {
    private String email;
    private String password;
}
Run Code Online (Sandbox Code Playgroud)

registerController.java:

package de.java2enterprise.onlineshop;

import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import javax.inject.Inject;
import de.java2enterprise.onlineshop.model.*;

@Named
@RequestScoped
public class RegisterController {

    private static final …
Run Code Online (Sandbox Code Playgroud)

jsf dependency-injection java-ee cdi managed-bean

36
推荐指数
2
解决办法
9万
查看次数

标签 统计

cdi ×1

dependency-injection ×1

java-ee ×1

jsf ×1

managed-bean ×1