0

I have a working Flex/BlazeDS application (for simple AMF remoting) with the following settings:

server-config.xml:

<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
    <endpoint url="https://www.mydomain.com:443/myapp/messagebroker/amfsecure.amf" 
          class="flex.messaging.endpoints.AMFEndpoint"/>
    <properties>
        <add-no-cache-headers>false</add-no-cache-headers>
        <polling-enabled>false</polling-enabled>
    </properties>
</channel-definition>

and in Flash Builder 4.6 > Properties > Flex Server:

Root URL: http://www.mydomain.com/myapp
Context Root: /myapp/

The problem was I had all of my java files sitting in ONE directory at:

WEB-INF/classes/

and simply used the system default package (e.g. no package specified in the java files). Eventually, the sheer number of files became overwhelming. To improve my organization, I started using packages and in the process I created the following directories:

WEB-INF/classes/com/mydomain/
WEB-INF/classes/com/mydomain/mytools/
WEB-INF/classes/com/mydomain/hr/
WEB-INF/classes/com/mydomain/utilities/
etc...

Now there's no java files sitting in the WEB-INF/classes/ directory (they've been moved to it's various subdirectories).

My question is how to modify the services-config.xml file and/or Flash Builder > Properties > Flex Server settings? I've tried many different settings and I'm always getting the following error:

Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 404: url:...

My thinking is that most people organize their projects using a WEB-INF/classes/com/mydomain/ architecture, so I'm hoping someone can share with me what their settings look like.

Adobe's website gives the following information but I don't see what I'm doing wrong: The root folder specifies the top-level directory of the web application (the directory that contains the WEB-INF directory). The root URL specifies the URL of the web application, and the context root specifies the root of the web application.

Thanks in advance for any comments/hints what to try.

UPDATE1:

Here's my destination (from remoting-config.xml):

<destination id="mySecureDestination">
    <channels>
        <channel ref="my-secure-amf"/>
    </channels>
        <properties>
            <source>myApplicationClass</source> 
            <scope>application</scope>
        </properties>
</destination>
ggkmath
  • 4,188
  • 23
  • 72
  • 129

1 Answers1

1

In the source tag of your destination definition, you must write the full classpath of the class you are targetting. So assuming that you moved myApplicationClass to WEB-INF/classes/com/mydomain/, this should read:

<destination id="mySecureDestination">
    <channels>
        <channel ref="my-secure-amf"/>
    </channels>
        <properties>
            <source>com.mydomain.myApplicationClass</source> 
            <scope>application</scope>
        </properties>
</destination>
RIAstar
  • 11,912
  • 20
  • 37
  • Thanks RIAstar, I'll give it a try. Could you confirm that I don't need to change `services-config.xml` nor any of the Flash Builder settings for the server as shown above? – ggkmath Jun 17 '12 at 19:53
  • 1
    @ggkmath Not from what I can see and if everything worked before you moved the classes. (I'm assuming you use the destination name in your service configuration on the client side) – RIAstar Jun 17 '12 at 19:54