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

开启@EruptFlowForm注解,程序报错 #179

Open
NokingInHand opened this issue Jul 13, 2023 · 0 comments
Open

开启@EruptFlowForm注解,程序报错 #179

NokingInHand opened this issue Jul 13, 2023 · 0 comments

Comments

@NokingInHand
Copy link

版本情况

JDK版本:1.8.0_371
erupt版本: 1.12.0

问题描述

未开启@EruptFlowForm注解,也就是作为普通的页面可以正常启动服务;
开启@EruptFlowForm,作为流程页面时,程序报异常了

  1. 复现代码
import lombok.Data;
import javax.persistence.*;

import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.AttachmentType;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.CodeEditorType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.flow.core.annotation.EruptFlowForm;
import xyz.erupt.jpa.model.BaseModel;
import xyz.erupt.toolkit.handler.SqlChoiceFetchHandler;

//必须有@Erupt注解,才可以使用这个注解
@EruptFlowForm
@Erupt(name = "代码审核")
@Table(name = "data_audit_service")
@Entity
@Data
public class DataAuditService extends BaseModel {

    @EruptField(
            views = @View(title = "工单编号"),
            edit = @Edit(title = "工单编号",search = @Search)
    )
    private String orderno;

    //TODO
    @EruptField(
            views = @View(title = "选择类型"),
            edit = @Edit(
                    search = @Search,
                    title = "选择类型", type = EditType.CHOICE,
                    choiceType = @ChoiceType(
                            fetchHandler = SqlChoiceFetchHandler.class,
                            fetchHandlerParams = {"select id, name from demo_ops_server", "5000"}
                    )
            )

    )
    private String choice;


    @Lob  //富文本编辑器所产生的文本量较大,所以设置为长字符串类型在数据库中存储
    @EruptField(
            edit = @Edit(title = "代码",
                    type = EditType.CODE_EDITOR,
                    codeEditType = @CodeEditorType(language = "sql",height=400))
    )
    private String content;

}
  1. 堆栈信息

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-07-13 09:01:59.677 ERROR 8472 --- [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: Failed to execute ApplicationRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:762) [spring-boot-2.7.10.jar:2.7.10]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:749) [spring-boot-2.7.10.jar:2.7.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.7.10.jar:2.7.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) [spring-boot-2.7.10.jar:2.7.10]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) [spring-boot-2.7.10.jar:2.7.10]
at com.zjs.EruptDemoApplication.main(EruptDemoApplication.java:25) [classes/:na]
Caused by: java.lang.RuntimeException: Load Erupt Form failed: DataAuditService
at xyz.erupt.flow.core.service.EruptFlowCoreService.parseFormItems(EruptFlowCoreService.java:76) ~[erupt-flow-1.12.0.jar:na]
at xyz.erupt.flow.core.service.EruptFlowCoreService.lambda$run$0(EruptFlowCoreService.java:51) ~[erupt-flow-1.12.0.jar:na]
at java.util.Optional.ifPresent(Optional.java:159) ~[na:1.8.0_341]
at xyz.erupt.flow.core.service.EruptFlowCoreService.lambda$run$1(EruptFlowCoreService.java:49) ~[erupt-flow-1.12.0.jar:na]
at xyz.erupt.core.util.EruptSpringUtil.scannerPackage(EruptSpringUtil.java:83) ~[erupt-core-1.12.0.jar:na]
at xyz.erupt.flow.core.service.EruptFlowCoreService.run(EruptFlowCoreService.java:46) ~[erupt-flow-1.12.0.jar:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:759) [spring-boot-2.7.10.jar:2.7.10]
... 5 common frames omitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant