PDA

View Full Version : No source code is available for type com.entities.EvlangDAO; did you forget t



efsiken
27 Apr 2010, 10:15 AM
Hi, I'm working on MyEclipse Enterprise workbench 6.5 and java5. I added hibernate capabilities to my gwt project and generated some classes through reverse engineering from the database. Then I created a class in which I used the generated classes. Here is the code of the class:


package com.extjs.gxt.samples.desktop.client.widget;


import com.entities.Evuti;

import com.entities.Evlang;

import com.entities.*;


import java.util.ArrayList;


public class Connection {

protected String login;

protected String password;

ArrayList<String> loginList = new ArrayList<String>();

ArrayList<String> passwordList =new ArrayList<String>();

ArrayList<String> nameList =new ArrayList<String>();

ArrayList<String> langList = new ArrayList<String>();

ArrayList<Evuti> list = new ArrayList<Evuti>();

ArrayList<Evlang> list1 = new ArrayList<Evlang>();

EvlangDAO langDAO = new EvlangDAO();

Evlang lang = new Evlang();

EvutiDAO usersDAO = new EvutiDAO();

Evuti users = new Evuti();

@SuppressWarnings({ "unchecked", "unchecked" })
public ArrayList<String> getLogin(){
list = (ArrayList<Evuti>) usersDAO.findAll();
for(int i=0; i<list.size();i++){
loginList.add(list.get(i).getCuti());
}
return loginList;
}

@SuppressWarnings("unchecked")
public ArrayList<String> getPassword(){
list = (ArrayList<Evuti>) usersDAO.findAll();
for(int i=0; i<list.size();i++){
passwordList.add(list.get(i).getMotp());
}
return passwordList;
}

@SuppressWarnings("unchecked")
public ArrayList<String> getNames(){
list = (ArrayList<Evuti>) usersDAO.findAll();
for(int i=0; i<list.size();i++){
nameList.add(list.get(i).getNomu());
}
return nameList;
}

public boolean connect(String login, String password){
boolean correct = false;
ArrayList<String> logins = this.getLogin();
ArrayList<String> passwords = this.getPassword();
if((logins.contains(login)&&(passwords.contains(password))&&(logins.indexOf(login)==passwords.indexOf(password)))){
correct = true;
}
return correct;
}

@SuppressWarnings("unchecked")
public ArrayList<String> getLanguage() {
list = (ArrayList<Evuti>) usersDAO.findAll();
for(int i=0; i<list.size();i++){
nameList.add(list.get(i).getNomu());
}

return langList;
}
}

here is the error:


[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/Connection.java'
[ERROR] Line 24: No source code is available for type com.entities.Evuti; did you forget to inherit a required module?
[ERROR] Line 26: No source code is available for type com.entities.Evlang; did you forget to inherit a required module?
[ERROR] Line 28: No source code is available for type com.entities.EvlangDAO; did you forget to inherit a required module?
[ERROR] Line 32: No source code is available for type com.entities.EvutiDAO; did you forget to inherit a required module?

tnx

micgala
27 Apr 2010, 11:45 PM
Maybe this thread can help you:
http://www.extjs.com/forum/showthread.php?97547-How-to-interage-Hibernate3.x-and-spring3.x-into-GWT2.0-with-Ext-GWT-2.0&highlight=hibernate+spring

efsiken
28 Apr 2010, 10:25 AM
Thanks for the link. I went throught the article and decided to use Gilead. But the error still persists. I don't know if it can be the importation of com.entities that can be the problem. com.entities is a package inside thesame project. If so, then what can i do to use classes of a different packege?

micgala
28 Apr 2010, 11:52 PM
Look, the project that contains com.entities.Evuti must have a gwt.xml descriptor.
And then this xml must be inherited in your project.

If this does not happen, then you have that kind of error.

efsiken
29 Apr 2010, 12:16 AM
I discovered that the problem was because the package was out of the client package. I migrated the classes from the com.entities package to the client package and that particular problem was solved.
But now a new similar error, GWT is not seeing the sources of classes I inherited from the jar files I inserted into the libraries. So how am I to migrate these classes into the client package (funny:D). Here are the errors on the console:


Compiling module com.extjs.gxt.samples.desktop.Webtop
Validating newly compiled units
[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/HibernateSessionFactory.java'
[ERROR] Line 23: No source code is available for type java.lang.ThreadLocal<T>; did you forget to inherit a required module?
[ERROR] Line 23: No source code is available for type org.hibernate.Session; did you forget to inherit a required module?
[ERROR] Line 24: No source code is available for type org.hibernate.cfg.Configuration; did you forget to inherit a required module?
[ERROR] Line 25: No source code is available for type org.hibernate.SessionFactory; did you forget to inherit a required module?
[ERROR] Line 48: No source code is available for type org.hibernate.HibernateException; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/BaseHibernateDAO.java'
[ERROR] Line 16: No source code is available for type net.sf.gilead.gwt.PersistentRemoteService; did you forget to inherit a required module?
[ERROR] Line 31: No source code is available for type org.hibernate.Session; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/IBaseHibernateDAO.java'
[ERROR] Line 11: No source code is available for type org.hibernate.Session; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/EvlangDAO.java'
[ERROR] Line 26: No source code is available for type org.apache.commons.logging.Log; did you forget to inherit a required module?
[ERROR] Line 26: No source code is available for type org.apache.commons.logging.LogFactory; did you forget to inherit a required module?
[ERROR] Line 41: No source code is available for type javax.persistence.EntityManager; did you forget to inherit a required module?
[ERROR] Line 74: No source code is available for type org.hibernate.criterion.Example; did you forget to inherit a required module?
[ERROR] Line 90: No source code is available for type org.hibernate.Query; did you forget to inherit a required module?
[ERROR] Line 141: No source code is available for type org.hibernate.LockMode; did you forget to inherit a required module?
[ERROR] Errors in 'file:/C:/Projets/java/webtop/src/com/extjs/gxt/samples/desktop/client/widget/EvutiDAO.java'
[ERROR] Line 23: No source code is available for type org.apache.commons.logging.Log; did you forget to inherit a required module?
[ERROR] Line 23: No source code is available for type org.apache.commons.logging.LogFactory; did you forget to inherit a required module?
[ERROR] Line 65: No source code is available for type org.hibernate.criterion.Example; did you forget to inherit a required module?
[ERROR] Line 81: No source code is available for type org.hibernate.Query; did you forget to inherit a required module?
[ERROR] Line 136: No source code is available for type org.hibernate.LockMode; did you forget to inherit a required module?
Finding entry point classes
[ERROR] Unable to find type 'com.extjs.gxt.samples.desktop.client.Webtop'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

I'm really new to GWT and that's why I'm facing alot of problems.
Help?

micgala
29 Apr 2010, 12:21 AM
Well, you cannot use those stuff in the client side.
GWT simply do not support it.

I suggest you reading some more gwt documentation.