Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    using custom classes on the client from a jar

    I have a working SmartGWT module that I'm trying to add custom exceptions to. The exception classes are implemented in a separate POJO project (to be used by future GWT modules) that I jar (including the source) and place into /war/WEB-INF/lib. I'm using an Ant build script which tells me that the custom exception classes can't be resolved in the EntryPoint class. The problem started when I pushed the exceptions to the client side. Is this not feasible, or am I just missing a step to link in the jar'd classes?

    Developing through a VNC connection complicates copy/pasting code snippets.

    Thanks for any help-
    Susan

    #2
    The Exceptions will only be sharable if all imports of other Java libraries are convertible by GWT, so no JPA etc.

    Then, you need to tell GWT that the Exceptions should be translated to client code - you do this by setting your "gwt source path" - you can Google this term, or look at this discussion.

    Comment


      #3
      Yes, I realized that was the problem - I do have a JPA entity class in that package and that won't compile to javascript. I am reorganizing the project so I can isolate the client-side classes and set that GWT source path in the gwt.xml

      Thanks!

      Comment


        #4
        Reading more carefully it seems that the jar I want to inherit must not include any classes that are not convertible to Javascript. This would mean creating a new jar just for the Exception classes. The Exception jar I will inherit into my GWT module and include in my JPA jar, and then the JPA jar only needs to be referenced as a library.

        Do I have that right?

        Comment


          #5
          Yes, so far as we know, this kind of re-packaging is required to share code.

          Comment

          Working...
          X