You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by speed <su...@gmail.com> on 2006/07/10 08:14:19 UTC

servicemix-eip error: Use an InOnly or RobustInOnly MEP

I have been trying to use servicemix to do the following:
Poll for a PGP encrypted file using FilePoller on local system directory. 
Once the file arrives read it as binary and do the following processing:
- Decrypt the file
- Use the resulted cleartext file and transform into an XML file.
- Send the XML file to external WEB Service.
- Archive the original file on local system.

Here is the approach I have taken:
- FilePoller is used to poll for the file along with BinaryFileMarshaler to
read the file.
- The FilePoller sends NMR message to pipline which in trurn forwards that
to static-recipient-list (fileWriter for archiving and static-routing-slip
for various processing).

I am getting followig error message, if some one can help, that would be
great.

21:34:09,725 | DEBUG | Thread-16  | SedaFlow                 |
emix.jbi.nmr.flow.AbstractFlow  115 | Called Flow send
21:34:09,725 | DEBUG | Thread-17  | SedaQueue                |
.jbi.nmr.flow.seda.SedaQueue$1  224 |
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1f21c50 dequeued
exchange: MessageExchange[
  id: ID:skadakia-3509-1152506049304-5:0
  status: Error
  role: consumer
  service: {http://servicemix.org/demo/}pipeline
  endpoint: endpoint
  in: 
  error: java.lang.UnsupportedOperationException: Use an InOnly or
RobustInOnly MEP
]

Here is the servicemix.xml:
<?xml version="1.0" encoding="UTF-8"?> 
<beans   
  xmlns="http://xbean.org/schemas/spring/1.0" 
        xmlns:spring="http://xbean.org/schemas/spring/1.0" 
        xmlns:sm="http://servicemix.apache.org/config/1.0" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://xbean.org/schemas/spring/1.0
../../conf/spring-beans.xsd http://servicemix.org/config/1.0
../../conf/servicemix.xsd" 
        xmlns:foo="http://servicemix.org/demo/"
       xmlns:eip="http://servicemix.apache.org/eip/1.0">

<sm:container id="jbi" flowName="seda" useMBeanServer="true"
createMBeanServer="true" dumpStats="true"  statsInterval="10"> 
  <sm:activationSpecs>
    <sm:activationSpec> 
      <sm:component> 
        <eip:component> 
           <eip:endpoints> 
              <eip:pipeline service="foo:pipeline" endpoint="endpoint"> 
                <eip:transformer> 
                  <eip:exchange-target service="foo:recipients" /> 
                </eip:transformer> 
                <eip:target> 
                  <eip:exchange-target service="foo:trace" /> 
                </eip:target> 
              </eip:pipeline> 
            </eip:endpoints> 
          </eip:component> 
        </sm:component> 
      </sm:activationSpec> 

      <sm:activationSpec> 
        <sm:component> 
          <eip:component> 
            <eip:endpoints> 
             <eip:static-recipient-list service="foo:recipients"
endpoint="endpoint"> 
              <eip:recipients>
	<eip:exchange-target service="foo:fileWriter" /> // archive
	<eip:exchange-target service="foo:routingSlip" /> // series of targets
              </eip:recipients> 
             </eip:static-recipient-list> 
           </eip:endpoints> 
         </eip:component> 
        </sm:component> 
       </sm:activationSpec>

       <sm:activationSpec> 
        <sm:component> 
          <eip:component> 
            <eip:endpoints> 
              <eip:static-routing-slip service="foo:routingSlip"
endpoint="endpoint"> 
	 <eip:targets> 
	   <eip:exchange-target service="foo:xmltransformer" /> // transformer
	   <!-- <eip:exchange-target service="foo:httpsender" /> --> // SOAP RPC
	  </eip:targets> 
               </eip:static-routing-slip> 
             </eip:endpoints> 
           </eip:component> 
         </sm:component> 
       </sm:activationSpec> 

       <sm:activationSpec componentName="fileWriter"
service="foo:fileWriter">
        <sm:component> 
         <bean class="org.apache.servicemix.components.file.FileWriter">
          <property name="directory" value="c:/projects/archive/vendor"/>
          <property name="autoCreateDirectory" value="true"/>
          <property name="marshaler" ref="marshaler"/> 
         </bean>
        </sm:component> 
       </sm:activationSpec>

       <sm:activationSpec componentName="filePoller"
service="foo:filePoller" destinationService="foo:pipeline">
        <sm:component>
         <bean class="org.apache.servicemix.components.file.FilePoller"> 
          <property name="workManager" ref="workManager"/> 
          <property name="deleteFile" value="false"/>
          <property name="file" value="c:/projects/incoming/vendor"/>
          <property name="period" value="6000000"/>
          <property name="marshaler" ref="marshaler"/> 
         </bean>
        </sm:component> 
       </sm:activationSpec>

  <!-- Route the event to a trace component that just outputs the event to
the console --> 
        <sm:activationSpec componentName="trace" service="foo:trace"> 
          <sm:component> 
            <bean
class="org.apache.servicemix.components.util.TraceComponent" /> 
           </sm:component> 
         </sm:activationSpec>
                        
         <sm:activationSpec componentName="xmltransformer"
service="foo:xmltransformer" destinationService="foo:trace"> 
           <sm:component>
            <bean class="com.test.servicemix.VendorDataTransformer">
              <property name="configFileName"
value="C:/settings.properties"/>
              <property name="disableOutput" value="true"/>
             </bean>
            </sm:component> 
          </sm:activationSpec>

		</sm:activationSpecs> 
      </sm:container> 
              
	    <!-- the work manager (thread pool) for this container --> 
	    <bean id="workManager"
class="org.jencks.factory.WorkManagerFactoryBean"> 
	    <property name="threadPoolSize" value="30"/> 
	    </bean> 
	    <bean id="marshaler"
class="org.apache.servicemix.components.util.BinaryFileMarshaler"
singleton="true"/> 
</beans>

Thank You.
Sundeep
-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5246743
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-eip error: Use an InOnly or RobustInOnly MEP

Posted by speed <su...@gmail.com>.
Continuing the error saga:

The thing is that, file is written in the archive directory very well and
also transformed to XML as required.  But when I look at the log file (have
utrned on the DEBUG) I see bunch of "null" errors.

Would you please shed some light on it:  FYI, when I use
FilePoller->FileWriter wihtout any static-recipient-list I don't see any
errors.  But as soon as I introduce the static-recipient-list, I see these
errors.
Is it because enddoint="endpoint" and "endpoint" not defined anywhere.  
Also, another thing to note is that, I am transferring a binary file as an
attachment and I believe the message contents could be null, if that's the
case than how do we specify a fake XML message.

Here is the servicemix.xml snippet:

<sm:activationSpec componentName="filePoller" service="foo:filePoller"
destinationService="foo:recipients">
  <sm:component>
    <bean class="org.apache.servicemix.components.file.FilePoller"> 
			        <property name="workManager" ref="workManager"/> 
			        <property name="deleteFile" value="false"/>
			        <property name="file"
value="c:/projects/acgTest/incoming/vendor"/>
			        <property name="period" value="6000000"/>
			        <property name="marshaler" ref="marshaler"/> 
			        </bean>
		        </sm:component> 
	      	</sm:activationSpec>
	      	
      		<sm:activationSpec> 
        		<sm:component> 
          			<eip:component> 
            			<eip:endpoints> 
	                        <eip:static-recipient-list service="foo:recipients"
endpoint="endpoint"> 
	                          <eip:recipients>
	                          	<eip:exchange-target service="foo:fileWriter" />
// archive
	                          </eip:recipients> 
	                        </eip:static-recipient-list> 
			        	</eip:endpoints> 
			    	</eip:component> 
				</sm:component> 
			</sm:activationSpec> 

		    <!-- Archive the file -->
	        <sm:activationSpec componentName="fileWriter"
service="foo:fileWriter" endpoint="endpoint"> 
	        	<sm:component> 
	        		<bean class="org.apache.servicemix.components.file.FileWriter">
	        			<property name="directory"
value="c:/projects/acgTest/archive/vendor"/>
	        			<property name="autoCreateDirectory" value="true"/>
	        			<property name="marshaler" ref="marshaler"/> 
	        		</bean>
	        	</sm:component> 
	        </sm:activationSpec>

16:39:47,346 | DEBUG | Thread-11  | SedaQueue                |
.jbi.nmr.flow.seda.SedaQueue$1  224 |
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@7124af dequeued
exchange: MessageExchange[
  id: ID:skadakia-2616-1152661186826-1:0
  status: Active
  role: provider
  service: {http://servicemix.org/demo/}recipients
  endpoint: endpoint
  in: 
]
16:39:47,346 | DEBUG | Thread-11  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  577 | Processing inbound exchange:
MessageExchange[
  id: ID:skadakia-2616-1152661186826-1:0
  status: Active
  role: provider
  service: {http://servicemix.org/demo/}recipients
  endpoint: endpoint
  in: 
]
16:39:47,346 | DEBUG | Thread-11  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  613 | Received: MessageExchange[
  id: ID:skadakia-2616-1152661186826-1:0
  status: Active
  role: provider
  service: {http://servicemix.org/demo/}recipients
  endpoint: endpoint
  in: 
]
16:39:47,346 | DEBUG | Thread-11  | EIPSpringComponent       |
emix.common.AsyncBaseLifeCycle  376 | Received exchange: status: Active,
role: Provider
16:39:47,356 | DEBUG | Thread-11  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  404 | Send
ID:skadakia-2616-1152661186826-2:0 in
DeliveryChannel{ID:skadakia-2611-1152661184913-0:0}
16:39:47,356 | DEBUG | Thread-11  | MessageExchangeImpl      |
.messaging.MessageExchangeImpl  742 | Error caught in toString
java.lang.NullPointerException
	at
org.apache.servicemix.jbi.jaxp.StringSource.getInputStream(StringSource.java:56)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:221)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:138)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:280)
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.toString(MessageExchangeImpl.java:695)
	at java.lang.String.valueOf(String.java:2131)
	at java.lang.StringBuffer.append(StringBuffer.java:370)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:343)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:410)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.sendConsumerExchange(AsyncBaseLifeCycle.java:447)
	at org.apache.servicemix.eip.EIPEndpoint.send(EIPEndpoint.java:202)
	at
org.apache.servicemix.eip.patterns.StaticRecipientList.processAsync(StaticRecipientList.java:155)
	at org.apache.servicemix.eip.EIPEndpoint.process(EIPEndpoint.java:238)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:397)
	at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:42)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:622)
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:168)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:226)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Thread.java:534)
16:39:47,366 | DEBUG | Thread-11  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  343 | Sent: null
16:39:47,366 | DEBUG | Thread-11  | MessageExchangeImpl      |
.messaging.MessageExchangeImpl  742 | Error caught in toString
java.lang.NullPointerException
	at
org.apache.servicemix.jbi.jaxp.StringSource.getInputStream(StringSource.java:56)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:221)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:138)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:280)
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.toString(MessageExchangeImpl.java:695)
	at java.lang.String.valueOf(String.java:2131)
	at java.lang.StringBuffer.append(StringBuffer.java:370)
	at
org.apache.servicemix.jbi.nmr.DefaultBroker.resolveAddress(DefaultBroker.java:390)
	at
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:286)
	at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:713)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:374)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:410)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.sendConsumerExchange(AsyncBaseLifeCycle.java:447)
	at org.apache.servicemix.eip.EIPEndpoint.send(EIPEndpoint.java:202)
	at
org.apache.servicemix.eip.patterns.StaticRecipientList.processAsync(StaticRecipientList.java:155)
	at org.apache.servicemix.eip.EIPEndpoint.process(EIPEndpoint.java:238)
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:397)
	at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:42)
	at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:622)
	at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:168)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:226)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Thread.java:534)
16:39:47,366 | DEBUG | Thread-11  | DefaultBroker            |
rvicemix.jbi.nmr.DefaultBroker  390 | Routing exchange null to:
ServiceEndpoint[service={http://servicemix.org/demo/}xmltransformer,endpoint=endpoint]
16:39:47,366 | DEBUG | Thread-11  | SedaFlow                 |
emix.jbi.nmr.flow.AbstractFlow  115 | Called Flow send
16:39:47,366 | DEBUG | Thread-11  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  404 | Send
ID:skadakia-2616-1152661186826-2:1 in
DeliveryChannel{ID:skadakia-2611-1152661184913-0:0}
16:39:47,376 | DEBUG | Thread-11  | MessageExchangeImpl      |
.messaging.MessageExchangeImpl  742 | Error caught in toString

Thank You.

Sundeep

-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5280568
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-eip error: Use an InOnly or RobustInOnly MEP

Posted by speed <su...@gmail.com>.
That's excatly right, the problem was with passing message from
static-recipient-list to static-routing-slip and your explanation makes
perfect sense why I was getting null exchange.

I was able to read and archive the file fine but it was failing at
static-routing-slip.

Thank you so much for your great help.

Sundeep
-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5273769
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-eip error: Use an InOnly or RobustInOnly MEP

Posted by dkd <dk...@gmail.com>.
My guess would be that here is a problem reading input file, for eaxmple an
XSL?

I just noticed that you will have another error passing a message from
static-recipient-list to static-routing-slip as the former uses a InOnly MEP
and the later requires a InOut MEP.

Use the pipe component between them and it should work:

FilePoller -----> static-recipient-list --> PipeLine  <---> routingSlip <-->
1. XMLTransformer 2. HttpSender
                            |_>FileWriter           |_>Trace
-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5267355
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-eip error: Use an InOnly or RobustInOnly MEP

Posted by speed <su...@gmail.com>.
Thank you so much for your suggestion.

I applied your suggestion of removing pipeline and go directly to
StaticRecipientList and now have different error message:

09:40:16,390 | DEBUG | Thread-15  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  719 | Notifying exchange
ID:skadakia-4239-1152549615547-4:0(7124af) in DeliveryChannel{filePoller}
from processInboundSynchronousExchange
09:40:16,390 | DEBUG | Thread-10  | DeliveryChannelImpl      |
.messaging.DeliveryChannelImpl  713 | Notified:
ID:skadakia-4239-1152549615547-4:0(7124af) in DeliveryChannel{filePoller}
from sendSync
09:40:16,400 | DEBUG | Thread-16  | MessageExchangeImpl      |
.messaging.MessageExchangeImpl  742 | Error caught in toString
java.lang.NullPointerException
	at
org.apache.servicemix.jbi.jaxp.StringSource.getInputStream(StringSource.java:56)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:221)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:138)
	at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:280)
	at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.toString(MessageExchangeImpl.java:695)
	at java.lang.String.valueOf(String.java:2131)
	at java.lang.StringBuffer.append(StringBuffer.java:370)
	at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:224)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
Source)
	at java.lang.Thread.run(Thread.java:534)

Truly appreciate your help.

Sundeep
Here is error message information on console:

INFO  - JBIContainer                   - Activating component for:
[container=Se
rviceMix,name=xmltransformer] with service:
{http://servicemix.org/demo/}xmltran
sformer component: com.test.VendorDataTransformer@497904
INFO  - ComponentMBeanImpl             - Initializing component:
xmltransformer
ERROR - EIPSpringComponent             - Error processing exchange null
java.lang.IllegalStateException: Use an InOut MEP
        at
org.apache.servicemix.eip.patterns.StaticRoutingSlip.processAsync(Sta
ticRoutingSlip.java:156)
        at
org.apache.servicemix.eip.EIPEndpoint.process(EIPEndpoint.java:238)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:397)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:42)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:622)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:168)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:226)
        at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
va:291)
        at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown So
urce)
        at java.lang.Thread.run(Thread.java:534)
-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5257379
Sent from the ServiceMix - User forum at Nabble.com.


Re: servicemix-eip error: Use an InOnly or RobustInOnly MEP

Posted by dkd <dk...@gmail.com>.
http://servicemix.org/site/servicemix-eip.html

1. "The Pipeline component is a bridge between an In-Only (or
Robust-In-Only) MEP and an In-Out MEP."

2. "The StaticRecipientList component will forward an input In-Only or
Robust-In-Only exchange to a list of known recipients."

Try removing the pipeline.

(If you need tracing/logging in the first step use WireTap)




-- 
View this message in context: http://www.nabble.com/servicemix-eip-error%3A-Use-an-InOnly-or-RobustInOnly-MEP-tf1916514.html#a5248738
Sent from the ServiceMix - User forum at Nabble.com.