views:

445

answers:

2

I have attached a service-adapter to a spring message-destination as follows:

<flex:message-destination 
    id="secured-chat" 
    send-security-constraint="trusted" 
    subtopic-separator="." 
    service-adapter="secured-chatAdapter" 
    allow-subtopics="true" />

The init methods are called during the bean's initialization, and I get "invoke" messages when new messages are sent.

However, allowSubcribe and other methods are never called. Are there any common causes of this problem?

+1  A: 

I've found these kinds of BlazeDS problems to be tricky to diagnose. My recommendation is to configure very verbose logging. There is more details on the Flex 2 Developer's Guide: Configuring server-side service logging

Edit ./WEB-INF/flex/services-congif.xml and add/modify the logging node to something like this:

<logging>
    <target class="flex.messaging.log.ServletLogTarget" level="debug">
        <properties>
            <prefix>[BlazeDS] </prefix>
            <includeDate>true</includeDate>
            <includeTime>true</includeTime>
            <includeLevel>true</includeLevel>
            <includeCategory>true</includeCategory>
        </properties>
        <filters>
            <pattern>Endpoint.*</pattern>
            <pattern>Service.*</pattern>
            <pattern>Message.*</pattern>
            <pattern>Message.Command.*</pattern>
            <pattern>MessageSelector</pattern>
            <pattern>Service.Message</pattern>
        </filters>
    </target>
</logging>

There are other filter patters you could add from the link above which might be important for you. If you don't see the culprit then post more of your services-config.xml and log files here and we'll see what we can do.

Quick warning: It can get very verbose. Don't do this on your production server!

Stu Thompson
A: 

The problem was that the Consumers had not defined subtopics. Because there were no subtopics being subscribed to, the subtopic specific permissions methods were not being called.

jsight
Doh! I've never worked with sub-topics before. How did you work it out?
Stu Thompson
I think it was from reading through the sourcecode. :) Either that or finally reading the javadocs the right way.
jsight