Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Remote Service to Deployed Jar

Avatar

Former Community Member

Is there a way to connect LCDS to a jar being hosted inside a war file? My service class is in the lib/jar file rather than exposed in the classes directory on the server. I'm attempting to setup the remoting-config.xml, but not sure what to put in the source (see below)

<destination id="AlertService">
        <properties>
            <source>???</source>
            <scope>application</scope>
        </properties>
    </destination>

14 Replies

Avatar

Former Community Member

I'm surprised that no one is using services from within a packaged project...

Avatar

Former Community Member

Could you be more specific?

You want to connect (what protocol) to a service, installed a different web application from LCDS ?

Thanks,

Anil

Avatar

Former Community Member

rtmp is the protocol.

I deployed a war file (with a jar in the library that holds my service class) in my tomcat and embedded LCDS into it.

Avatar

Level 3

There shouldn't be an issue with accessing a class packaged in a JAR in WEB-INF/lib. You should be able to use any class that's in the web app's classpath as long as you specify the full-qualified classname in the source element of the destination. Is that what you are doing?

Avatar

Former Community Member

Here's my setup:

Jar located at:

C:\lcds\tomcat\webapps\Alerts\WEB-INF\lib\CliqAlert.jar

Remote-Config file here:

C:\lcds\tomcat\webapps\Alerts\WEB-INF\flex\remoting-config.xml

Service definition:

<destination id="AlertService">
       
<properties>
           
<source>com.company.cliq.alert.service.AlertServiceImpl</source>
           
<scope>application</scope>
        </properties>
   
</destination>            

Navigating to class from Jar file:

C:\lcds\tomcat\webapps\Alerts\WEB-INF\lib\CliqAlert.jar\com\company\cliq\alert\service\AlertServiceImpl.class

Avatar

Level 3

Do you have an explicit constructor(s) in your class but do not have a no-args constructor? If so, that could be the issue. You must have a no-args constructor to work with the Remoting Service. If you don't specify any constructor, there is a default no-args constructor. Otherwise, you must include one explicitly.

If you have that taken care of:

Based on that, it seems like it should work as long as the package declaration in your class is:

package com.company.cliq.alert.service;

  It isn't working? What does your client code where you are calling it look like?

Are you able to run other things such as the samples in the lcds-samples web app?

Avatar

Former Community Member

Ok, I think I figured it out. I went through the logs and it looks like some dependencies were missing.

Yes the samples work, and I also have a seperate simple prototype working. This one is part of a bigger project.

After fixing dependencies, it now says the class has an overloaded method and does not support introspection.

Avatar

Level 3

There's a Flex thread that might help you come up with something that works with instrospection in the mix:

http://forums.adobe.com/message/2949949

Avatar

Former Community Member

flex-servlet.xml does not exist...where does this come from?

Avatar

Employee

flex-servet.xml is used when you are using Spring BlazeDS Integration project to create destinations from Spring. As such it is not part of LCDS.

Avatar

Former Community Member

Alex, you should download the Spring - Flex project and install it manually to LCDS. Once you do that, you will have access to flex-servlet.xml. The Spring-Flex project is not bundled with LCDS.

Hope this makes sense.

Anil

Avatar

Former Community Member

Anil,


Not seeing what you are talking about, I am here:

http://www.springsource.org/spring-flex

are you referring to the test-drive samples?

Avatar

Employee

Hi Alex,

Yes, you can find a sample flex-servlet.xml in the Spring Flex test-drive samples (e.g. under

spring-flex-testdrive/testdrive/target/testdrive/WEB-INF).

By convention, you declare the remoting/messaging destinations within this file (see above file for examples). The Spring-Flex documentation explains more about the syntax. Hope that helps.

Rohit