Re: java.lang.ClassNotFoundException: com.mysema.query.types.EntityPath

2,931 views
Skip to first unread message

Timo Westkämper

unread,
May 25, 2013, 11:54:36 AM5/25/13
to Querydsl on behalf of Ali Benjeloun
Hi.

What is your build system, Maven or Ant?

Do you use Querydsl with Spring Data JPA?

Br,
Timo

On Sat, May 25, 2013 at 6:39 PM, Ali Benjeloun via Querydsl <querydsl+noreply-APn2wQd4_7DlqBP...@googlegroups.com> wrote:
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.
 
 



--
Timo Westkämper
Mysema Oy
+358 (0)40 591 2172
www.mysema.com


Ali Benjeloun

unread,
May 26, 2013, 12:52:56 PM5/26/13
to quer...@googlegroups.com
Hi.

I didn't use Maven or Ant I generated the the Query entities using the annotation processing, And i am using QueryDSL without Spring  Data JPA
Thanks for your help timo


Le samedi 25 mai 2013 16:54:36 UTC+1, Timo Westkämper a écrit :
Hi.

What is your build system, Maven or Ant?

Do you use Querydsl with Spring Data JPA?

Br,
Timo

Timo Westkämper

unread,
May 26, 2013, 1:44:06 PM5/26/13
to Querydsl on behalf of Ali Benjeloun
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

Ali Benjeloun

unread,
May 26, 2013, 1:57:45 PM5/26/13
to quer...@googlegroups.com
Yeah that is the problem i don't have the queryDSL jars in the lib folder even though i selected the user library to be exported and published... I will try copying them in the WebContent/lib folder  and answer back.. But that is surly the problem

Thanks Timo..


Le dimanche 26 mai 2013 18:44:06 UTC+1, Timo Westkämper a écrit :
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

Reply all
Reply to author
Forward
0 new messages