aspose file tools*
The moose likes Java in General and the fly likes Lookup Singelton to client problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Lookup Singelton to client problem" Watch "Lookup Singelton to client problem" New topic
Author

Lookup Singelton to client problem

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

I have a class




And the Lookup Class is



Here is one class that Implements the AbstractFactory



So in the server side I create one of these and put it into a Map that I return to the client. The Map key is the DiscountTypeLookup.class and the value is the lookup object within the AbstractLoopkup.

When I get it on the client it is seeing that the DiscountTypeLookup class has the loadData method with code, which include Hibernate classes.

Even though I can never call the loadData method on the client, since we use the Class jsut to get the value out, in which the value class is of Type Lookup, which implements the ILookup interface. So the client gets the value out and assigns it to a reference of type ILookup, and that is all it can call methods on, is methods defined in that interface.

OK here is my problem, it is giving me a ClassDefNotFound exception on the Hibernate classes on the client. These classes are not on the client and should not be.

How can I get around this problem.

I hope I was clear enough in my explanation.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17260
    
    6

OK, here is the solution.

Instead of using the DiscountTypeLookup.class as the key I am using the RetailDiscount.class.getName() instead. So I use the String value of the DTOs class name.

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lookup Singelton to client problem