I am using Querydsl 3.1.1 for the first time in a stuts2,JPA+hibernate, mysql on tomcat6. I created a query that works when i execute as a java application but not form Struts2 Actionit raise a ClassNotFoundException on com.mysema.query.types.EntityPath ....
I checked the classpath everything seems fine
i have been stuck for days...Thanks for your help
____________________________________________________________________________
public class CategorieDaoImplementation implements CategorieDao {
private EntityManagerFactory emf = Persistence
.createEntityManagerFactory("VotreRepas");
@Override
public List<Categorie> search(String searchtext, String operator,
String idx, String order) {
List<Categorie> l=null;// = getAllCategories();
try {
EntityManager em = emf.createEntityManager();
JPAQuery query = new JPAQuery(em);
l = query.from(categorie).where(categorie.titreCategorie.like(searchtext)).list(categorie);
return l;
} catch (QueryException ex) {
ex.printStackTrace();
System.out.println(ex);
System.out
.println("***************************************** query error");
}
return l;
}
}
Main for test executed as java application__________________________________________________________________________________
public class Test {
public static void main(String[] args) {
CategorieDao dao = new CategorieDaoImplementation();
List<Categorie> l = dao.search("tutu", "", "", "");
System.out.println(l.get(0).getTitreCategorie());
}
}
Struts2 action executed on server With Json conversion...____________________________________________________________________________________
@Actions({ @Action(value = "/jsontable", results = { @Result(name = "success", type = "json") }) })
public String doList() {
//int to = (rows * page);
//int from = to - rows;
dao = new CategorieDaoImplementation();
//dao.search(searchString, searchOper, sidx, sord);
categories = dao.search(searchString, searchOper, sidx, sord);THE DEBUG MODE STOPS HERE ON THE CONSTRUCTION OF THE INTERFACE By THE CLASS IMPLEMENTATION
// Count Rows (select count(*) from custumer)
records = categories.size();
// calculate the total pages for the query
total = (int) Math.ceil((double) records / (double) rows);
return SUCCESS;
}
--
You received this message because you are subscribed to the Google Groups "Querydsl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to querydsl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi.
What is your build system, Maven or Ant?
Do you use Querydsl with Spring Data JPA?
Br,
Timo
Hi.
I am not familiar with Struts 2, but it looks like a classpath issue.
Maybe try building a war and look into the WEB-INF/lib folder and verify that Querydsl and transitive dependencies are available.
Br,
Timo