java.lang.NoClassDefFoundError: org/jadira/usertype/spi/shar



我正在使用UserType库中的一些类,但我得到了一些错误。似乎有一些类丢失了,就像这个错误。

org.apache.jasper。JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/jadira/usertype/spi/shared/AbstractSingleColumnUserType

请指导我该怎么做。首先在开始我下载了3.2.0版本,但我降级到3.0.0 CR1,但我仍然得到一些类没有发现异常。

请帮助。这件事本身就很费时间。

我正在使用这样的Usertype…

package classes.mastertables;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.hibernate.annotations.Type;
import org.jadira.usertype.dateandtime.joda.PersistentLocalDate;

@Entity
public class BranchMaster {
private String companyId;
@Id
private String branchId;
@Column(unique=true)
private String branchNm;
private String branchOfficeAddress;
@Column(unique=true)
private long branchOfficeTel;
@Column(unique=true)
private long branchOfficeFax;
private String branchOfficeCity;
private String branchOfficeStateCode;
private String branchOfficeCountryCode;
private String branchTypeId;
private String parentBranchId;
private Boolean activeFlg;
private Boolean isBranchOnline;
private String createdBy;
@Column 
@Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
private PersistentLocalDate createdDt;//modified to String
private String modifiedBy;
@Column 
@Type(type="org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
private PersistentLocalDate modifiedDt;//modified to String
private String dateFormat;
//Getters and settters follow 

在Hibernate.cfg.xml中,我添加了这两行

<mapping class="org.jadira.usertype.dateandtime.joda.PersistentLocalDate" />
    <mapping class="org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime" />

请指导…

谢谢,Abhijeet .

您缺少包含在hibernate.cfg.xml中引用的类:org.apache.jasper.JasperException: javax.servlet.ServletException的jar。

通常java.lang.NoClassDefFoundError发生在你的代码引用了一个jar ->而内部引用了另一个jar ->并且在你的情况下另一个jar ->缺失时。

最新更新