Hi:
You cannot access server classes from your client. You can access client
classes from your server.

What you have to do is start using transfer objects. Here's an article:
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html

Let me know if you need more help.
Albert Attard

Joan Crawford<http://www.brainyquote.com/quotes/authors/j/joan_crawford.html>
- "I, Joan Crawford, I believe in the dollar. Everything I earn, I
spend."

2009/8/4 thepopeofantelope <[email protected]>

>
> I created the following class and want to use it between the client
> and server. I get this GWT compile error on the Service class:
>
> Compiling module com.test.GWTTEst
>   Refreshing module from source
>      Validating newly compiled units
>         Removing units with errors
>            [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/
> RecipeServiceAsync.java'
>               [ERROR] Line 7: No source code is available for type
> com.test.server.Recipe; did you forget to inherit a required module?
>            [ERROR] Errors in 'file:/C:/GWTTEst/src/com/test/client/
> RecipeService.java'
>               [ERROR] Line 9: No source code is available for type
> com.test.server.Recipe; did you forget to inherit a required module?
>
> ===========
>
> package com.test.client;
>
> import com.google.gwt.user.client.rpc.RemoteService;
> import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
> import com.test.server.Recipe;
>
> @RemoteServiceRelativePath("recipe")
> public interface RecipeService extends RemoteService {
>  public void addStock(Recipe symbol) throws NotLoggedInException;
>  public void removeStock(String symbol) throws NotLoggedInException;
>  public String[] getStocks() throws NotLoggedInException;
> }
>
>
> ==============
>
> package com.test.server;
>
> import java.io.Serializable;
> import java.util.Date;
>
> import javax.jdo.annotations.IdGeneratorStrategy;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.Persistent;
> import javax.jdo.annotations.PrimaryKey;
>
> import com.google.appengine.api.users.User;
> import com.google.gwt.user.client.rpc.IsSerializable;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> public class Recipe implements IsSerializable {
>
>        @PrimaryKey
>        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>        private Long id;
>        @Persistent
>        private User user;
>        @Persistent
>        private String name;
>        @Persistent
>        private String category;
>        @Persistent
>        private String cuisine;
>        @Persistent
>        private String occasion;
>        @Persistent
>        private String ingredients;
>        @Persistent
>        private String directions;
>        @Persistent
>        private Date created;
>
>        public Recipe() {
>
>        }
>
>        public Recipe(User user, String symbol) {
>                this();
>                this.user = user;
>        }
>
>        public User getUser() {
>                return user;
>        }
>
>        public void setUser(User user) {
>                this.user = user;
>        }
>
>        public String getName() {
>                return name;
>        }
>
>        public void setName(String name) {
>                this.name = name;
>        }
>
>        public String getCuisine() {
>                return cuisine;
>        }
>
>        public void setCuisine(String cuisine) {
>                this.cuisine = cuisine;
>        }
>
>        public String getIngredients() {
>                return ingredients;
>        }
>
>        public void setIngredients(String ingredients) {
>                this.ingredients = ingredients;
>        }
>
>        public String getDirections() {
>                return directions;
>        }
>
>        public void setDirections(String directions) {
>                this.directions = directions;
>        }
>
>        public String getOccasion() {
>                return occasion;
>        }
>
>        public void setOccasion(String occasion) {
>                this.occasion = occasion;
>        }
>
>        public String getCategory() {
>                return category;
>        }
>
>        public void setCategory(String category) {
>                this.category = category;
>        }
>
>        public Date getCreated() {
>                return created;
>        }
>
>
>
> }
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to