小编Jac*_*ada的帖子

ld:(.eh_frame)中的错误; 不会创建.eh_frame_hdr表

我在C中编写一个非常简单的程序hello.当在exe文件中使用ld时返回此项

ld: error in hello(.eh_frame); no .eh_frame_hdr table will be created.
Run Code Online (Sandbox Code Playgroud)

我没有定义任何LD_LIBRAY_PATH或路径/etc/ld.so.conf我尝试过与ls相同并返回:

ld: error in /bin/ls(.eh_frame); no .eh_frame_hdr table will be created.
ld: warning: cannot find entry symbol _start; defaulting to 0000000000402920
Run Code Online (Sandbox Code Playgroud)

发生了什么?我使用的是Debian,而我的GCC版本是(Debian 4.7.2-5).

linux linker debian

3
推荐指数
2
解决办法
7980
查看次数

使用 javax.validation 进行自定义验证

我正在尝试制作自定义 java 验证注释并返回给我

请求处理失败;嵌套异常是 javax.validation.ConstraintDeclarationException:HV000144:交叉参数约束 com.my.company.CustomConstraint 非法放置在字段“private java.util.List com.my.company.ElementOfTheList”上。

代码真的很幼稚

@Documented
@Retention(RUNTIME)
@Target({ FIELD, METHOD})
@Constraint(validatedBy = ConstraintValidation.class)
public @interface CustomConstraint {

    String message() default "this is the default message";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
Run Code Online (Sandbox Code Playgroud)
@SupportedValidationTarget(ValidationTarget.PARAMETERS)
public class ConstraintValidationimplements ConstraintValidator<CustomConstraint , List<ElementOfTheList>> {

    public boolean isValid(List<ElementOfTheList> value, ConstraintValidatorContext context) {
        System.out.println("only a sysout to test");
        return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

在其余的对象模型中

  @JsonProperty("ElementOfTheList")
  @Valid
  @NotNull(message ="not null message")
  @NotEmpty(message = "not empty message")
  @CustomConstraint 
  private List<ElementOfTheList> …
Run Code Online (Sandbox Code Playgroud)

java validation spring

2
推荐指数
1
解决办法
1963
查看次数

标签 统计

debian ×1

java ×1

linker ×1

linux ×1

spring ×1

validation ×1