5 Replies Latest reply on Dec 18, 2007 5:29 PM by (Gavin_Dority)

    Java Adapter Compile Error - Missing Libraries

      I am trying to convert my project from being deployed on Flex Data Services 2 To LiveCycle Data Services. I dont know very much about java and have hit a snag when trying to recompile my custom java adaptor.

      It compiles fine under a FDS2 project, but when compiled under a LCDS deployment on JRun, Eclipse gives me the following error when trying to compile:

      Project PTSChat_Java is missing required library: lib/commons-codec.jar
      Project PTSChat_Java is missing required library: lib/commons-httpclient.jar
      The project cannot be built until build path errors are resolved

      It appears that the libraries have been renamed to commons-codec-1.3.jar & commons-httpclient-3.0.1.jar in LCDS, but I am not sure where to update these references? They are not direct library imports in my java code.

      As a shot in the dark, I tried just copying the old FDS2 libraries back over to the WEB-INF\lib\ DIR since there are named differently. It resolved the missing library error, but then I got a compile error with service cannot be resolved in references to my MessageService msgService = (MessageService) service; java code. I quickly realized this is not the correct path to head down.

      Does anyone have any clues what I may be doing wrong? Any help is much appreciated.

        • 1. Re: Java Adapter Compile Error - Missing Libraries
          Level 1
          I resovled the problems I was having.

          I was able to figure out how to change the library linking in eclipse and switched the commons-codec-1.3.jar & commons-httpclient-3.0.1.jar in the place of commons-codec.jar & commons-httpclient.jar libraries previously used with the project (properties:libraries).

          I was not able to correct the service cannot be resolved. Everything I did kept crashing and dropping my connection tot he channel. I ended up just switching the code in my java adapter from:

          MessageService msgService = (MessageService) service


          MessageBroker broker = MessageBroker.getMessageBroker(null);
          MessageService msgService = (MessageService) broker.getService("message-service");

          This appears to be working as desired for my use of the java adapter for the session management & logging. I am not really certain why the "service" became undefined between FDS2 & LCDS, something must have been depreciated or changed around.
          • 2. Re: Java Adapter Compile Error - Missing Libraries
            Peter Farland Level 3
            In LCDS 2.5 we had a major clean-up of the messaging component APIs to prepare
            for publishing how to programmatically configure the message broker. One
            change was to correct the APIs to reflect the in-memory state of the components,
            such as how services, destinations and adapters are actually managed. Services
            have a list of destinations, and each destination creates its own instance
            of an adapter.

            If you want to get to a service from a custom adapter, you can either do
            what you mention below and start at the top to get the message broker and
            then ask it for a service, or alternatively you can call getDestination()
            from your adapter and then call getService() from that destination.

            • 3. Re: Java Adapter Compile Error - Missing Libraries
              Level 1
              Thanks Pete, good info to know.
              • 4. Re: Java Adapter Compile Error - Missing Libraries
                Hey Gavin

                Looks like the u maine education paid off. Crosby would be so proud of his star pupil. So if you haven't guess it, another u maine alum.

                How do I get ahold of you?
                • 5. Re: Java Adapter Compile Error - Missing Libraries
                  Level 1
                  Hey Frenchie, haven't talked to you in forever guy. Send me an email and we will catch up: gdority@gmail.com