• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Lookup Singelton to client problem

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Acetylsalicylic acid is aspirin. This could be handy too:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic