Expand my Community achievements bar.

Java Adapter Compile Error - Missing Libraries

Avatar

Former Community Member
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.



Thanks!
5 Replies

Avatar

Former Community Member
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



to



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.

Avatar

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.



Pete

Avatar

Former Community Member
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?

Avatar

Former Community Member
Hey Frenchie, haven't talked to you in forever guy. Send me an email and we will catch up: gdority@gmail.com