Topic
  • 18 replies
  • Latest Post - ‏2011-12-30T21:27:29Z by Ed_Hansen
Ed_Hansen
Ed_Hansen
28 Posts

Pinned topic Response connection factory required for one-way JMS service?

‏2011-12-27T18:30:11Z |
I have a JMS binding defined for a one-way service as follows:

<service name="TriggerInterface">
<binding.jms>
<destination create="never" name="jms/TriggerQueue" type="queue"/>
<activationSpec create="never" name="jms/TriggerAS"/>
<tuscany:wireFormat.jmsText/>
<tuscany_1:operationSelector.jmsCustom class="com.TriggerOperationSelector"/>
</binding.jms>
</service>

The TriggerQueue and TriggerAS are defined as WebSphere MQ resources.

When I try to add the asset to a BLA in WAS 8.0.0.1 via RAD 8.0.4, I get the following error:

The following Service Component Architecture (SCA) Validation errors caused the CheckOsoaValidationResult step to fail: 1 CWSOA1801E: A response connection factory jms/DefaultSCAConnectionFactory cannot be created for the JMS binding used by service TriggerInterface in component TriggerComponent. The binding uses JMS resources that are not for the default messaging provider.

But I neither want nor need a response connection factory. Am I missing something in binding.jms to designate a one-way connection? Or possibly something else I'm missing?
Updated on 2011-12-30T21:27:29Z at 2011-12-30T21:27:29Z by Ed_Hansen
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-27T21:25:40Z  
    Ed,

    Are your Java interface method(s) annotated with a "1-way" annotation?

    If any method on the interface does not contain either:

    @javax.jws.Oneway
    OR
    @org.osoa.sca.annotations.OneWay

    then the runtime will assume a response CF is needed.

    In WSDL terms, the operations should be in-only.

    I'm guessing that's likely what you're missing.

    Regards,
    Scott
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-28T00:02:05Z  
    Ed,

    Are your Java interface method(s) annotated with a "1-way" annotation?

    If any method on the interface does not contain either:

    @javax.jws.Oneway
    OR
    @org.osoa.sca.annotations.OneWay

    then the runtime will assume a response CF is needed.

    In WSDL terms, the operations should be in-only.

    I'm guessing that's likely what you're missing.

    Regards,
    Scott
    Hi Scott,

    As shown below - all methods on the interface for the service have the Oneway annotation. Anything else I might have missed?

    import javax.jws.Oneway;

    public interface TriggerInterface {

    @Oneway
    public void badMessageType(String xml);

    @Oneway
    public void badTriggerType(String xml);

    @Oneway
    public void jmsException(String exceptionString);

    @Oneway
    public void emptyMessage(String xml);

    @Oneway
    public void malformedMessage(String xml);

    @Oneway
    public void start(String xml);

    @Oneway
    public void installDates(String xml);

    @Oneway
    public void manualStart(String xml);

    @Oneway
    public void opportunityDataChange(String xml);

    }
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-28T15:22:07Z  
    • Ed_Hansen
    • ‏2011-12-28T00:02:05Z
    Hi Scott,

    As shown below - all methods on the interface for the service have the Oneway annotation. Anything else I might have missed?

    import javax.jws.Oneway;

    public interface TriggerInterface {

    @Oneway
    public void badMessageType(String xml);

    @Oneway
    public void badTriggerType(String xml);

    @Oneway
    public void jmsException(String exceptionString);

    @Oneway
    public void emptyMessage(String xml);

    @Oneway
    public void malformedMessage(String xml);

    @Oneway
    public void start(String xml);

    @Oneway
    public void installDates(String xml);

    @Oneway
    public void manualStart(String xml);

    @Oneway
    public void opportunityDataChange(String xml);

    }
    Ed,

    Hmm...I'm not sure then what the problem could be.

    If you want to attach your contribution JAR including the composite file(s) and WSDL/XSDs I could give it a try myself and maybe learn something.

    It would take me longer if the problem requires MQ to recreate but I'm guessing that MQ vs. default messaging isn't a key aspect to the problem here.

    Scott
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-28T17:07:17Z  
    Ed,

    Hmm...I'm not sure then what the problem could be.

    If you want to attach your contribution JAR including the composite file(s) and WSDL/XSDs I could give it a try myself and maybe learn something.

    It would take me longer if the problem requires MQ to recreate but I'm guessing that MQ vs. default messaging isn't a key aspect to the problem here.

    Scott
    Interesting - it deployed fine to a real WAS - just not to RAD's WAS.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-28T19:08:46Z  
    • Ed_Hansen
    • ‏2011-12-28T17:07:17Z
    Interesting - it deployed fine to a real WAS - just not to RAD's WAS.
    Hello Ed.

    It could be really good if you can upload an snippet of your project here. I would like to take a look at what RAD is doing regarding that connection factory.

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T00:17:30Z  
    Hello Ed.

    It could be really good if you can upload an snippet of your project here. I would like to take a look at what RAD is doing regarding that connection factory.

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
    Hi Victor - I'll try to recreate the problem in a simpler project and post it.
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T00:48:19Z  
    • Ed_Hansen
    • ‏2011-12-29T00:17:30Z
    Hi Victor - I'll try to recreate the problem in a simpler project and post it.
    I've attatched a simple project which results in the same problem when deploying to WAS 8 via RAD.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T15:48:17Z  
    • Ed_Hansen
    • ‏2011-12-29T00:48:19Z
    I've attatched a simple project which results in the same problem when deploying to WAS 8 via RAD.
    Hi Ed.

    I tried your SCA application by deploying directly in WAS and through RAD and both ways worked. I can't figure it out what's going on wrong here, but I can assure you that RAD is not adding/needing extra resources (like the factories) for deployment.

    Have you tried this same JAR in your RAD/WAS? If not, give it a try and let me know the results.

    Thanks for your feedback!

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T17:13:36Z  
    Hi Ed.

    I tried your SCA application by deploying directly in WAS and through RAD and both ways worked. I can't figure it out what's going on wrong here, but I can assure you that RAD is not adding/needing extra resources (like the factories) for deployment.

    Have you tried this same JAR in your RAD/WAS? If not, give it a try and let me know the results.

    Thanks for your feedback!

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
    I have the following RAD version: 8.0.4, build id: RADO804-I20111108_1151
    And WAS version: 8.0.0.1 http://BASE 8.0.0.1 cf011135.03

    This is the error I get when deploying to WAS through my RAD:

    12/28/11 16:44:15:428 PST 00000024 WASLoggingMon E CWSOA1801E: A response connection factory jms/DefaultSCAConnectionFactory cannot be created for the JMS binding used by service TriggerInterface in component TestTriggerComponent. The binding uses JMS resources that are not for the default messaging provider.

    My co-worker successfully deployed using the same version of RAD and WAS.

    Is it possible that my RAD or WAS are corrupted somehow?
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T17:55:15Z  
    • Ed_Hansen
    • ‏2011-12-29T17:13:36Z
    I have the following RAD version: 8.0.4, build id: RADO804-I20111108_1151
    And WAS version: 8.0.0.1 http://BASE 8.0.0.1 cf011135.03

    This is the error I get when deploying to WAS through my RAD:

    12/28/11 16:44:15:428 PST 00000024 WASLoggingMon E CWSOA1801E: A response connection factory jms/DefaultSCAConnectionFactory cannot be created for the JMS binding used by service TriggerInterface in component TestTriggerComponent. The binding uses JMS resources that are not for the default messaging provider.

    My co-worker successfully deployed using the same version of RAD and WAS.

    Is it possible that my RAD or WAS are corrupted somehow?
    Indeed it's odd your coworker could deploy it successfully. My advice is to check the configuration of both WAS servers, specially the JMS resources, I think there should be something missing in your configuration that you coworker has and it's working.

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T18:18:34Z  
    Indeed it's odd your coworker could deploy it successfully. My advice is to check the configuration of both WAS servers, specially the JMS resources, I think there should be something missing in your configuration that you coworker has and it's working.

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
    While a difference in JMS resource configuration could account for why the response CF can be created in one environment but not another, there is still the fact that the response CF shouldn't be needed at all for a 1-way-only service.

    WAS will look at the JMS resources referenced by JNDI name in the JMS binding, and if WAS needs to create a response CF it will fail in doing so if the original resources are determined to be MQ resources (i.e. we won't create a default messaging response CF to respond to messages coming in over MQ destinations).

    But it still seems like there is something strange going on ... could you happen to have another copy of TestInterface (e.g. without annotations) lingering around in RAD that you accidentally packaged?

    Scott
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T19:59:13Z  
    Indeed it's odd your coworker could deploy it successfully. My advice is to check the configuration of both WAS servers, specially the JMS resources, I think there should be something missing in your configuration that you coworker has and it's working.

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
    Turns out my co-worker had the following Connection Factory defined:

    Name: jms_DefaultSCAConnectionFactory
    JNDI name: jms/DefaultSCAConnectionFactory

    Once the Connection Factory was removed - the SCA composite would no longer successfully install.

    Could you check to see if you have this Connection Factory defined?
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T21:49:56Z  
    • Ed_Hansen
    • ‏2011-12-29T19:59:13Z
    Turns out my co-worker had the following Connection Factory defined:

    Name: jms_DefaultSCAConnectionFactory
    JNDI name: jms/DefaultSCAConnectionFactory

    Once the Connection Factory was removed - the SCA composite would no longer successfully install.

    Could you check to see if you have this Connection Factory defined?
    Hi Ed.

    That's right. I've got the same factory without having me to configure it. Somehow WAS is doing it for me :S

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-29T21:57:27Z  
    Hi Ed.

    That's right. I've got the same factory without having me to configure it. Somehow WAS is doing it for me :S

    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
    But you shouldn't need it. There is no need for a connection factory for a response - there is no need for a response - it's a oneway operation.
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-30T16:13:24Z  
    • Ed_Hansen
    • ‏2011-12-29T21:57:27Z
    But you shouldn't need it. There is no need for a connection factory for a response - there is no need for a response - it's a oneway operation.
    Ed,

    That's correct... you shouldn't need the response CF. WAS will create it for you if you're using default messaging but not if you're using MQ.

    I don't really have any further suggestions here, though, sorry to say.

    Scott
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-30T19:02:50Z  
    Ed,

    That's correct... you shouldn't need the response CF. WAS will create it for you if you're using default messaging but not if you're using MQ.

    I don't really have any further suggestions here, though, sorry to say.

    Scott
    Hi Scott,

    >>WAS will create it for you if you're using default messaging but not if you're using MQ.

    So if using default messaging, WAS would create the response CF even if the service interface contains only Oneway operations? But if you're using MQ, WAS complains that you don't have the response CF and queue specified and defined.

    Seems like WAS is not figuring out that the service interface contains only Oneway operations.

    Do you think this is a bug?

    Ed
  • SystemAdmin
    SystemAdmin
    126 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-30T20:44:37Z  
    • Ed_Hansen
    • ‏2011-12-30T19:02:50Z
    Hi Scott,

    >>WAS will create it for you if you're using default messaging but not if you're using MQ.

    So if using default messaging, WAS would create the response CF even if the service interface contains only Oneway operations? But if you're using MQ, WAS complains that you don't have the response CF and queue specified and defined.

    Seems like WAS is not figuring out that the service interface contains only Oneway operations.

    Do you think this is a bug?

    Ed
    Ed,

    I see the problem now (after remembering you did share the app).

    Your interface isn't marked as remotable. As it turns out, then, we never bother looking for the JAX-WS @Oneway annotation, and so our logic to see if we need the response CF tells us that we do need it.

    This would be done either via the SCA OSOA @Remotable annotation or the JAXWS @WebService annotation. (The @WebService is automatically generated into the class generated by the wsimport and the RAD SCA tooling which generates Java from WSDL.)

    If you're annotating the class by hand, you'd need to add this as well.

    My first reaction is that I'd have expected we'd have flagged a non-remotable interface and not allowed that to deploy... as I'd think you'd have other problems down the road with a non-remotable interface used with a non-default (e.g. JMS) binding.

    But maybe not.. in any case, it is your interface that should be fixed.

    Hope that helps,
    Scott
  • Ed_Hansen
    Ed_Hansen
    28 Posts

    Re: Response connection factory required for one-way JMS service?

    ‏2011-12-30T21:27:29Z  
    Ed,

    I see the problem now (after remembering you did share the app).

    Your interface isn't marked as remotable. As it turns out, then, we never bother looking for the JAX-WS @Oneway annotation, and so our logic to see if we need the response CF tells us that we do need it.

    This would be done either via the SCA OSOA @Remotable annotation or the JAXWS @WebService annotation. (The @WebService is automatically generated into the class generated by the wsimport and the RAD SCA tooling which generates Java from WSDL.)

    If you're annotating the class by hand, you'd need to add this as well.

    My first reaction is that I'd have expected we'd have flagged a non-remotable interface and not allowed that to deploy... as I'd think you'd have other problems down the road with a non-remotable interface used with a non-default (e.g. JMS) binding.

    But maybe not.. in any case, it is your interface that should be fixed.

    Hope that helps,
    Scott
    Hi Scott,

    My first assumption was that I missed something - thanks for finding it! I'll add the annotation and fire it up.

    Thanks again for your help.

    Ed