0

私のプロジェクトはこのエラーを起こします、そして私は何が間違っているのかわかりません、これはブラウザからのエラーログです。 log.txt


何が互換性があるのか​​わかりません。これらのライブラリはインポートされます

 .:
activation-1.1.jar
antlr-2.7.6.jar
antlr-runtime-3.1.1.jar
c3p0-0.9.1.jar
chenillekit-core-1.3.2.jar
chenillekit-google-1.3.2.jar
chenillekit-hibernate-1.3.2.jar
chenillekit-image-1.3.2.jar
chenillekit-tapestry-1.3.2.jar
commons-beanutils-1.7.0.jar
commons-beanutils-core-1.8.0.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-configuration-1.6.jar
commons-digester-1.8.jar
commons-fileupload-1.2.jar
commons-io-1.3.jar
commons-lang-2.4.jar
CopyLibs
dom4j-1.6.1.jar
eclipselink
eclipselinkmodelgen
ejb3-persistence
geronimo-spec-jta-1.0-M1.jar
hibernate-c3p0-3.6.0.Final.jar
hibernate-commons-annotations-3.2.0.Final.jar
hibernate-core-3.6.0.Final.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
hibernate-support
javaee-endorsed-api-6.0
javaee-endorsed-api-6.0-2
javassist-3.12.1.GA.jar
jsontools-core-1.5.jar
junit
junit-3.8.2.jar
junit_4
junit-4.5.jar
junit-4.5-src.jar
kaptcha-2.3.2.jar
libs
log4j-1.2.14.jar
mail-1.4.jar
mysql-connector-java-5.1.13-bin.jar
mysql-connector-java-5.1.6.jar
nblibraries-private.properties
nblibraries.properties
ognl-2.7.3.jar
org-netbeans-modules-java-j2seproject-copylibstask.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
Tap5
tapestry5-annotations-5.2.4.jar
tapestry-core-5.2.6.jar
tapestry-func-5.2.4.jar
tapestry-hibernate-5.2.6.jar
tapestry-hibernate-core-5.2.6.jar
tapestry-ioc-5.2.4.jar
tapestry-json-5.2.6.jar
tapestry-upload-5.2.4.jar
tapx-core-1.1-20110620.210912-27.jar
tapx-core-1.2-20110705.222421-4.jar
tapx-datefield-1.1-20110617.214353-17.jar
tapx-datefield-1.2-20110705.222544-4.jar

./CopyLibs:
org-netbeans-modules-java-j2seproject-copylibstask.jar

./eclipselink:
eclipselink-2.2.0.jar
eclipselink-javax.persistence-2.0.jar

./eclipselinkmodelgen:
eclipselink-jpa-modelgen-2.2.0.jar

./ejb3-persistence:
ejb3-persistence.jar

./hibernate-support:
antlr-2.7.6.jar
asm-attrs.jar
asm.jar
cglib-2.1.3.jar
commons-collections-2.1.1.jar
commons-logging-1.1.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
hibernate3.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
hibernate-tools.jar
javassist.jar
jdbc2_0-stdext.jar
jta.jar

./javaee-endorsed-api-6.0:
javaee6-doc-api.zip
javax.annotation.jar
jaxb-api-osgi.jar
webservices-api-osgi.jar

./javaee-endorsed-api-6.0-2:
javaee6-doc-api.zip
javax.annotation.jar
jaxb-api-osgi.jar
webservices-api-osgi.jar

./junit:
junit-3.8.2-api.zip
junit-3.8.2.jar

./junit_4:
junit-4.5-api.zip
junit-4.5.jar
junit-4.5-src.jar

./Tap5:
antlr-2.7.6.jar
antlr-runtime-3.1.1.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
cglib-2.1_3.jar
commons-codec-1.3.jar
commons-collections-2.1.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
ehcache-1.2.3.jar
javassist-3.12.1.GA.jar
javassist-3.4.GA.jar
jta-1.0.1B.jar
log4j-1.2.14.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
tapestry5-annotations-5.2.6.jar
tapestry-core-5.2.6.jar
tapestry-func-5.2.6.jar
tapestry-ioc-5.2.6.jar
tapestry-json-5.2.6.jar
tapx-core-1.1-20110620.210912-27.jar
tapx-core-1.2-20110705.222421-4.jar
tapx-datefield-1.1-20110617.214353-17.jar
tapx-datefield-1.2-20110705.222544-4.jar

タペストリーで休止状態の継承を使用しようとしていることを除いて、すべてが正常に見えます。

親クラスのコード

    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pz850.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 *
 * @author nikola
 */
@Entity
@Table(name = "GRUPA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Grupa.findAll", query = "SELECT g FROM Grupa g"),
    @NamedQuery(name = "Grupa.findByGrupaId", query = "SELECT g FROM Grupa g WHERE g.grupaId = :grupaId"),
    @NamedQuery(name = "Grupa.findByGrupaNaziv", query = "SELECT g FROM Grupa g WHERE g.grupaNaziv = :grupaNaziv"),
    @NamedQuery(name = "Grupa.findByGrupaBroj", query = "SELECT g FROM Grupa g WHERE g.grupaBroj = :grupaBroj")})
@Inheritance(strategy= InheritanceType.TABLE_PER_CLASS)
public class Grupa implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    @Basic(optional = false)
    @Column(name = "GRUPA ID")
    private Integer grupaId;
    @Column(name = "GRUPA NAZIV")
    private String grupaNaziv;
    @Column(name = "GRUPA BROJ")
    private Integer grupaBroj;
    @ManyToOne(cascade = CascadeType.PERSIST)
    @NotFound(action = NotFoundAction.IGNORE)
    private Predmet predmet;
    @OneToMany(cascade = CascadeType.PERSIST)
    @NotFound(action = NotFoundAction.IGNORE)
    private Collection<Student> student = new ArrayList<Student>();

    public Grupa() {
    }

    public Grupa(Integer grupaId) {
        this.grupaId = grupaId;
    }

    public Integer getGrupaId() {
        return grupaId;
    }

    public void setGrupaId(Integer grupaId) {
        this.grupaId = grupaId;
    }

    public String getGrupaNaziv() {
        return grupaNaziv;
    }

    public void setGrupaNaziv(String grupaNaziv) {
        this.grupaNaziv = grupaNaziv;
    }

    public Integer getGrupaBroj() {
        return grupaBroj;
    }

    public void setGrupaBroj(Integer grupaBroj) {
        this.grupaBroj = grupaBroj;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (grupaId != null ? grupaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grupa)) {
            return false;
        }
        Grupa other = (Grupa) object;
        if ((this.grupaId == null && other.grupaId != null) || (this.grupaId != null && !this.grupaId.equals(other.grupaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pz850.entities.Grupa[ grupaId=" + grupaId + " ]";
    }
}

子クラスのコード

   /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pz850.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import org.apache.tapestry5.annotations.Property;

/**
 *
 * @author nikola
 */
@Entity
public class InternetGrupa extends Grupa implements Serializable{
 @Basic(optional = false)
 @Column(name="VRSTA_STUDIRANJA")
    @Property
 private String vrstaStudija = "Internet";



    public InternetGrupa() {
    } public String getVrstaStudija() {
        return vrstaStudija;
    }

    public void setVrstaStudija(String vrstaStudija) {
        this.vrstaStudija = vrstaStudija;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final InternetGrupa other = (InternetGrupa) obj;
        if ((this.vrstaStudija == null) ? (other.vrstaStudija != null) : !this.vrstaStudija.equals(other.vrstaStudija)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + (this.vrstaStudija != null ? this.vrstaStudija.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Internet{" + "vrstaStudija=" + vrstaStudija + '}';
    }
}

ライブラリの場合、どちらを削除する必要がありますか?これは親子の継承が休止状態の問題になると思いますか?チュートリアルが言うように私はそれを正しくやったと思います

4

2 に答える 2

1

Hibernate は、3.5 として、および hibernate-support を介して説明のつかない 3.x (hibernate3.jar) として、クラスパスに 2 回あります (これは何ですか?)。クラスパスを修正すると役立ちます。

于 2012-09-10T22:09:05.400 に答える
1

@Henning が暗示したように、ライブラリ間に競合があります。この特定のケースでは、休止状態ライブラリ (現在のタペストリー休止状態ライブラリでサポートされていないバージョン) で真のサポートを持たないタペストリー休止状態ライブラリであるため、DOCJARに移動して、真の休止状態ライブラリ(または、ライブラリでさえ、特定のタペストリー-休止状態ライブラリに必要なタップ-休止状態ライブラリの数がわからない場合があります。

于 2012-09-09T23:48:35.240 に答える