just put MyService.jar into server directory not client
exp:
MyService
[code]package mypackage.server;
import java.util.ArrayList;
import java.util.List;
import net.sf.hibernate4gwt.core.HibernateBeanManager;
import net.sf.hibernate4gwt.gwt.HibernateRemoteService;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import com.google.gwt.user.client.rpc.RemoteService;
import mypackage.domain.Giocatore;
public class MyService extends HibernateRemoteService{
.....
[code]
On Dec 2, 5:43 pm, Dessorry <[EMAIL PROTECTED]> wrote:
> Hi, i'm creating my first gwt application.
> I would display in my page an interrogation to my database.
> I've download hibernate4gwt library and i've included it in my
> project.
> I created HelloGWT.gwt.xml in mypackage folder with this code:
> [code]<?xml version="1.0" encoding="UTF-8" standalone="no"?><module>
>
> <!-- Inherit the core Web Toolkit stuff. -->
> <inherits name="com.google.gwt.user.User"/>
> <inherits name='net.sf.hibernate4gwt.Hibernate4Gwt15'/>
>
> <!-- Specify the app entry point class. -->
> <entry-point class="mypackage.client.HelloGWT"/>
>
> <inherits name="com.google.gwt.user.theme.standard.Standard"/>
> <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
> <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
>
> <stylesheet src="css/format.css"/>
> <source path="domain"/>
> <source path="client"/>
>
> </module>[/code]
> I created the subfolder domain and client in mypackage and i wrote
> helloGWT:
> [code]package mypackage.client;
>
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.user.client.Window;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.ClickListener;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.Widget;
>
> import java.util.List;
>
> public class HelloGWT implements EntryPoint {
>
> public void onModuleLoad() {
> // TODO Auto-generated method stub
> Label label = new Label("Hello GWT !!!");
> label.setStyleName("label");
>
> Button button = new Button("Say something");
> button.addClickListener(new ClickListener() {
> public void onClick(Widget sender) {
> Window.alert("Hello, again");
> }
> });
>
> RootPanel.get().add(label);
> RootPanel.get().add(button);
>
> MyServiceAsync ws = (MyServiceAsync)
> GWT.create(MyService.class);
> List a=ws.getStudents(null);
>
> }
>
> }[/code]
>
> MyService
> [code]package mypackage.client;
>
> import java.util.ArrayList;
> import java.util.List;
> import net.sf.hibernate4gwt.core.HibernateBeanManager;
> import net.sf.hibernate4gwt.gwt.HibernateRemoteService;
>
> import org.hibernate.Session;
> import org.hibernate.SessionFactory;
> import org.hibernate.cfg.Configuration;
>
> import com.google.gwt.user.client.rpc.RemoteService;
>
> import mypackage.domain.Giocatore;
>
> public class MyService extends HibernateRemoteService{
> public List getStudents() {
> Session session=null;
> SessionFactory sessionFactory = new Configuration().configure
> ().buildSessionFactory();
> HibernateBeanManager.getInstance().setSessionFactory
> (sessionFactory);
> session = sessionFactory.openSession();
> List gwtStudents = new ArrayList();
> List<Giocatore> players = session.createCriteria
> (Giocatore.class).list();
> return players;
> }}[/code]
>
> and Eclipse automatic generates MyServiceAsync
> i put Giocatore.class Giocatore.hbm.xml and hibernate.cfg.xml in
> domain folder
> server folder is empty.
> When i try ti run my application i read a lot of error all about
> inherit method, like this:
> [ERROR] Line 16: No source code is available for type
> net.sf.hibernate4gwt.gwt.HibernateRemoteService; did you forget to
> inherit a required module?
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---