0

안녕하세요. mvn wildfly : deploy 할 때 오류가 있습니다. 나는 wildfly 10.1.0.Final, Hibernate ogm 5.0.10.Final과 Cassandra 3.0.9를 사용하고 있습니다. 여기에 전체 오류 마사지입니다 : 제이보스 - 받는다는 - 플러그인 :mvn wildfly를 할 때 오류가 발생했습니다. deploy : 콜렉션 com.sensorhound.aigateway.domain.IOConfiguration.nodeData의 주된 역할을 결정할 수 없습니다.

[ERROR] 목표 org.wildfly.plugins을 실행하지 못했습니다 1.1.0.Final : 배포 (기본-CLI) 프로젝트 aigateway에 : { "WFLYCTL0062 : 복합 작업이 실패하여 롤백되었습니다. 단계가 실패했습니다 :"=> { "작업 1 단계"=> { "WFLYCTL0080 : 실패했습니다 서비스"=> { "jboss. \ "aigateway.war # JPAService \" "=> "서비스에서 org.jboss.msc.service.StartException jboss.persistenceunit. \ "aigateway.war # JPAService \": javax.persistence.PersistenceException : [ PersistenceUnit : JPAService] 012 javax.persistence.PersistenceException :에 의한 최대 절전 모드의 SessionFactory [ERROR]을 구축 할 수 없습니다 3,516,[PersistenceUnit : JPAService] : org.hibernate.HibernateException : 최대 절전 모드의 SessionFactory [ERROR]을 구축 할 수 없음으로 인한 주요 측면의 역할을 결정할 수 없음 수집 com.sensorhound.aigateway.domain.IOConfiguration.nodeData에 대한 "},"WFLYCTL0412 : 설치되지 않은 필수 서비스 : "=> [". jboss.persistenceunit \ ""aigateway.war # JPAService \ "] , "WFLYCTL0180 : 누락 된/사용할 수없는 종속성이있는 서비스"=> undefined}}} [오류] -> [도움말 1] [오류] [오류] 의 전체 스택 추적을 보려면 다음과 같이 Maven을 -e 스위치. [오류] 전체 디버그 로깅을 사용하려면 -X 스위치를 사용하여 Maven 을 다시 실행하십시오. 오류 및 가능한 해결 방법에 대한 자세한 내용은 [ERROR] [ERROR], 다음 문서를 참조하십시오 : [ERROR]는 [도움말 1] 다음 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

"IO_CONFIGURATION"테이블에 대한 코드입니다

를 여기
@Entity 
@Indexed 
@IdClass(NodeDataPK.class) 
@Table(name = "NODE_DATA") 
public class NodeData implements Serializable { 

    private static final long serialVersionUID = -3411753713406246973L; 

    @Id 
    @FieldBridge(impl = ByteBridge.class) 
    @JoinColumn(name = "IO_CONFIGURATION_ID", referencedColumnName = "IO_CONFIGURATION_ID") 
    @ManyToOne 
    protected IOConfiguration ioConfiguration; 

    @Id 
    @Column(name = "TIME") 
    protected Long time; 

    @Column(name = "VALUE") 
    protected Double value; 

    public NodeData() {} 

    public NodeDataPK getNodeDataId() { 
    NodeDataPK nodeDataPK = new NodeDataPK(); 
    nodeDataPK.setTime(this.time); 
    nodeDataPK.setIoConfigurationId(this.ioConfiguration.getIoConfigurationId()); 
    return nodeDataPK; 
    } 

    public void setNodeDataId(NodeDataPK nodeDataPK) { 
    this.time = nodeDataPK.getTime(); 
    IOConfigurationDAO ioConfigurationDAO = new IOConfigurationDAO(); 
    ioConfigurationDAO.init(); 
    IOConfiguration ioConfiguration = 
     ioConfigurationDAO.findIOConfiguration(nodeDataPK.getIoConfigurationId()); 
    this.ioConfiguration = ioConfiguration; 
    } 



    /** 
    * @return the ioConfiguration 
    */ 
    public IOConfiguration getIoConfiguration() { 
    return ioConfiguration; 
    } 

    /** 
    * @param ioConfiguration the ioConfiguration to set 
    */ 
    public void setIoConfiguration(IOConfiguration ioConfiguration) { 
    this.ioConfiguration = ioConfiguration; 
    } 

    /** 
    * @return the time 
    */ 
    public Long getTime() { 
    return time; 
    } 

    /** 
    * @param time the time to set 
    */ 
    public void setTime(Long time) { 
    this.time = time; 
    } 

    /** 
    * @return the value 
    */ 
    public double getValue() { 
    return value; 
    } 

    /** 
    * @param value the value to set 
    */ 
    public void setValue(double value) { 
    this.value = value; 
    } 

    /** 
    * @return the serialversionuid 
    */ 
    public static long getSerialversionuid() { 
    return serialVersionUID; 
    } 
} 

가 NODEDATA 전자 용 복합 기본 키 : 여기
@Entity 
@Indexed 
@Table(name = "IO_CONFIGURATION") 
public class IOConfiguration implements Serializable { 

    private static final long serialVersionUID = 7542743172221933818L; 

    @Id 
    @Column(name = "IO_CONFIGURATION_ID") 
    protected String ioConfigurationId; 

    @Column(name = "ACTIVE") 
    protected Boolean active; 

    @Column(name = "NAME") 
    protected String name; 

    @Column(name = "CONVERSION_TYPE") 
    protected String conversionType; 

    @Column(name = "M_INFO") 
    protected Double mInfo; 

    @Column(name = "B_INFO") 
    protected Double bInfo; 

    @Column(name = "VOLTAGE_DIVIDE") 
    protected String voltageDivide; 

    @Column(name = "SAMPLE_RANGE") 
    protected String sampleRange; 

    @Column(name = "SAMPLE_PERIOD") 
    protected Integer samplePeriod; 

    @Column(name = "STORE_ROW") 
    protected Boolean storeRow; 

    @Column(name = "STORE_CONVERTED") 
    protected Boolean storeConverted; 

    @Column(name = "DEFAULT_GRAPH") 
    protected String defaultGraph; 

    @Column(name = "TITLE") 
    protected String title; 

    @Column(name = "UNIT") 
    protected String unit; 

    @Column(name = "RANGE_LOWERBOUND") 
    protected Integer rangeLowerbound; 

    @Column(name = "RANGE_UPPERBOUND") 
    protected Integer rangeUpperbound; 

    @JsonBackReference 
    @OneToMany(mappedBy = "ioConfiguration") 
    protected List<Alert> alerts; 

    @JsonBackReference 
    @OneToMany(mappedBy = "ioConfiguration") 
    protected List<DataSeriesMeta> dataSeriesMeta; 

    @JsonBackReference 
    @OneToMany(mappedBy = "ioConfiguration") 
    protected List<NodeData> nodeData; 

    @Column(name = "CODE") 
    protected String code; 

    public IOConfiguration() {} 
    //...getters and setter 
} 

는 "NODE_DATA"테이블에 대한 코드 ntity : 여기

public class NodeDataPK implements Serializable { 

    /** 
    * 
    */ 
    private static final long serialVersionUID = -3239860594324151192L; 

    // @Column(name = "IO_CONFIGURATION") 
    protected String ioConfiguration; 

    // @Column(name = "TIME") 
    protected Long time; 

    public NodeDataPK() {} 

    public NodeDataPK(String ioConfigId, Long time) { 
    this.ioConfiguration = ioConfigId; 
    this.time = time; 
    } 

    /** 
    * @return the channelName 
    */ 
    public String getIoConfigurationId() { 
    return ioConfiguration; 
    } 

    /** 
    * @param channelName the channelName to set 
    */ 
    public void setIoConfigurationId(String ioConfigurationId) { 
    this.ioConfiguration = ioConfigurationId; 
    } 

    /** 
    * @return the time 
    */ 
    public Long getTime() { 
    return time; 
    } 

    /** 
    * @param time the time to set 
    */ 
    public void setTime(Long time) { 
    this.time = time; 
    } 

    @Override 
    public int hashCode() { 
    return ioConfiguration.hashCode() + time.hashCode(); 
    } 

    @Override 
    public boolean equals(Object o) { 
    if (o == null) { 
     return false; 
    } 
    if (!(o instanceof NodeDataPK)) { 
     return false; 
    } 
    NodeDataPK nodeDataPK = (NodeDataPK) o; 
    if (((NodeDataPK) o).getIoConfigurationId() != nodeDataPK.getIoConfigurationId() 
     && ((NodeDataPK) o).getTime() != nodeDataPK.getTime()) { 
     return false; 
    } 

    return true; 
    } 
} 

그리고 내가 복사 한 ByteBridge입니다 :

public class ByteBridge extends NumberBridge implements Serializable { 
    @Override 
    public Object stringToObject(String stringValue) { 
    if (StringHelper.isEmpty(stringValue)) 
     return null; 
    return Byte.valueOf(stringValue); 
    } 
} 

내가 무슨 일이 일어나고 있는지 모르고, 나는 그것을 구글이 오류에 대한 약간의 메시지가있다. 정보가 필요한 경우 공유하고 싶습니다. 누군가 제발 도와주세요.

감사합니다.

답변

0

사람들, 나는 EmbeddedId를 사용하여이 문제를 해결했습니다. JPA 문서에 따르면 IdClass와 EmbeddedId는 동일한 목표를 달성해야합니다. 그러나 IdClass 버전의 문제점을 발견 할 수는 없습니다. 따라서 EmbeddedId로 전환하면 작동합니다. 수정 된 코드는 다음과 같습니다.

@Embeddable 
public class NodeDataPK implements Serializable { 

    /** 
    * 
    */ 
    private static final long serialVersionUID = -3239860594324151192L; 


    protected String ioConfiguration; 

    @Column(name = "TIME") 
    protected Long time; 

    public NodeDataPK() {} 

    public NodeDataPK(String ioConfigId, Long time) { 
    this.ioConfiguration = ioConfigId; 
    this.time = time; 
    } 

    /** 
    * @return the channelName 
    */ 
    public String getIoConfiguration() { 
    return ioConfiguration; 
    } 

    /** 
    * @param channelName the channelName to set 
    */ 
    public void setIoConfiguration(String ioConfigurationId) { 
    this.ioConfiguration = ioConfigurationId; 
    } 

    /** 
    * @return the time 
    */ 
    public Long getTime() { 
    return time; 
    } 

    /** 
    * @param time the time to set 
    */ 
    public void setTime(Long time) { 
    this.time = time; 
    } 

    @Override 
    public int hashCode() { 
    return ioConfiguration.hashCode() + time.hashCode(); 
    } 

    @Override 
    public boolean equals(Object o) { 
    if (o == null) { 
     return false; 
    } 
    if (!(o instanceof NodeDataPK)) { 
     return false; 
    } 
    NodeDataPK nodeDataPK = (NodeDataPK) o; 
    if (((NodeDataPK) o).getIoConfiguration() != nodeDataPK.getIoConfiguration() 
     && ((NodeDataPK) o).getTime() != nodeDataPK.getTime()) { 
     return false; 
    } 

    return true; 
    } 
} 

@Entity 
@Indexed 
// @IdClass(NodeDataPK.class) 
@Table(name = "NODE_DATA") 
public class NodeData implements Serializable { 

    private static final long serialVersionUID = -3411753713406246973L; 

    // @Id 
    // @FieldBridge(impl = ByteBridge.class) 
    // @JoinColumn(name = "IO_CONFIGURATION_ID", referencedColumnName = "IO_CONFIGURATION_ID") 
    // @ManyToOne 
    // @JsonManagedReference 
    // protected IOConfiguration ioConfiguration; 
    // 
    // @Id 
    // @Column(name = "TIME") 
    // protected Long time; 

    @DocumentId 
    @EmbeddedId 
    @FieldBridge(impl = ByteBridge.class) 
    protected NodeDataPK nodeDataPK; 

    @JoinColumn(name = "IO_CONFIGURATION") 
    @MapsId("ioConfiguration") 
    @ManyToOne 
    protected IOConfiguration ioConfiguration; 

    @Column(name = "VALUE") 
    protected Double value; 

    public NodeData() {} 

    // public NodeDataPK getNodeDataId() { 
    // NodeDataPK nodeDataPK = new NodeDataPK(); 
    // nodeDataPK.setTime(this.time); 
    // nodeDataPK.setIoConfiguration(this.ioConfiguration.getIoConfigurationId()); 
    // return nodeDataPK; 
    // } 
    // 
    // public void setNodeDataId(NodeDataPK nodeDataPK) { 
    // this.time = nodeDataPK.getTime(); 
    // IOConfigurationDAO ioConfigurationDAO = new IOConfigurationDAO(); 
    // ioConfigurationDAO.init(); 
    // IOConfiguration ioConfiguration = 
    // ioConfigurationDAO.findIOConfiguration(nodeDataPK.getIoConfiguration()); 
    // this.ioConfiguration = ioConfiguration; 
    // } 

    public NodeDataPK getNodeDataId() { 
    return this.nodeDataPK; 
    } 

    public void setNodeDataId(NodeDataPK nodeDataPK) { 
    this.nodeDataPK = nodeDataPK; 
    } 



    /** 
    * @return the ioConfiguration 
    */ 
    public IOConfiguration getIoConfiguration() { 
    return ioConfiguration; 
    } 

    /** 
    * @param ioConfiguration the ioConfiguration to set 
    */ 
    public void setIoConfiguration(IOConfiguration ioConfiguration) { 
    this.ioConfiguration = ioConfiguration; 
    } 

    // /** 
    // * @return the time 
    // */ 
    // public Long getTime() { 
    // return time; 
    // } 
    // 
    // /** 
    // * @param time the time to set 
    // */ 
    // public void setTime(Long time) { 
    // this.time = time; 
    // } 

    public Long getTime() { 
    return this.getNodeDataId().getTime(); 
    } 

    public void setTime(Long time) { 
    this.getNodeDataId().setTime(time); 
    } 

    /** 
    * @return the value 
    */ 
    public double getValue() { 
    return value; 
    } 

    /** 
    * @param value the value to set 
    */ 
    public void setValue(double value) { 
    this.value = value; 
    } 

    /** 
    * @return the serialversionuid 
    */ 
    public static long getSerialversionuid() { 
    return serialVersionUID; 
    } 



} 
관련 문제