XDSRegistryError : cannot serialize packet

171 views
Skip to first unread message

Swati Gour

unread,
Dec 16, 2013, 8:04:17 AM12/16/13
to ipf-...@googlegroups.com
Hi, 

I am trying to integrate IPF flow manager into Camel routes of XDS Registry. But I am getting an error while doing transaction to registry. Can you please look into 
this and let me know what could be wrong?

Below is the code snippet : 

Camel Route:

        from('xds-iti42:xds-iti42' + xuaOptions)
                .routeId('xds-iti42:xds-iti42')
                .initFlow( APP_NAME + '::xds:iti42' )
                    .expectedAckCount( 2 )
                    .renderer( 'messageRenderer' )
                    .application( APP_NAME )
                .choice()
                .when().constant(ITI42RequestValidatorEnabled).process(iti42RequestValidator())
                .end()
                .to('direct:registerDocumentSet')
                .process(iti42ResponseValidator())\

Error while doing transaction iti-42:

Exception thrown: gov.nist.toolkit.xdsexception.XdsInternalException
XDSRegistryError : cannot serialize packet : 
gov.nist.toolkit.xdsexception.XdsInternalException: XDSRegistryError : cannot serialize packet : 
at gov.nist.toolkit.testengine.BasicContext.error(BasicContext.java:120) 
at gov.nist.toolkit.testengine.StepContext.set_error(StepContext.java:126) 
at gov.nist.toolkit.testengine.transactions.BasicTransaction.fail(BasicTransaction.java:721) 
at gov.nist.toolkit.testengine.transactions.RegisterTransaction.run(RegisterTransaction.java:66) 
at gov.nist.toolkit.testengine.transactions.BasicTransaction.doRun(BasicTransaction.java:207) 
at gov.nist.toolkit.testengine.StepContext.run(StepContext.java:347) 
at gov.nist.toolkit.testengine.PlanContext.run(PlanContext.java:227) 
at gov.nist.toolkit.testengine.XdsTest.runAndReturnLogs(XdsTest.java:701) 
at gov.nist.toolkit.testengine.Xdstest2.run(Xdstest2.java:309) 
at gov.nist.toolkit.session.server.serviceManager.XdsTestServiceManager.runUtilityTest(XdsTestServiceManager.java:235) 
at gov.nist.toolkit.session.server.serviceManager.XdsTestServiceManager.xdstest(XdsTestServiceManager.java:92) 
at gov.nist.toolkit.session.server.services.SubmitRegistryTestdata.run(SubmitRegistryTestdata.java:32) 
at gov.nist.toolkit.session.server.serviceManager.QueryServiceManager.submitRegistryTestdata(QueryServiceManager.java:96) 
at gov.nist.toolkit.xdstools2.server.ToolkitServiceImpl.submitRegistryTestdata(ToolkitServiceImpl.java:179) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) 
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) 
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) 
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) 
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) 
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) 
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) 
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) 
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
at java.lang.Thread.run(Thread.java:662) 


Boris Stanojević

unread,
Dec 16, 2013, 9:04:25 AM12/16/13
to ipf-...@googlegroups.com
Hi Swati,

the Exception states that it fails while trying to serialize some Object which in its graph contains some non-serializable content (what happens in RegisterTransaction:66 ??). 

You mean that without IPF-Flow-Manager this route is working fine (don't see any relevant IPF code in the Stack trace)?? Which IPF and Camel version are you using? 

Best Regards,
Boris


2013/12/16 Swati Gour <swati...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "ipf-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ipf-user+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Swati Gour

unread,
Dec 16, 2013, 9:42:56 AM12/16/13
to ipf-...@googlegroups.com
Hi Boris,

I am using IPF 2.5.1 and Camel 2.11.1. And also without including IPF flow manager in the route, its working fine .
I have used following spring configuration for IPF FM:

<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/tx
                           http://www.springframework.org/schema/tx/spring-tx.xsd
                           http://www.springframework.org/schema/context
                           http://www.springframework.org/schema/context/spring-context.xsd">

    <context:annotation-config />

<!-- ================================================================= -->
<!--  Declarative Transaction Management                               -->
<!-- ================================================================= -->

<tx:annotation-driven transaction-manager="hibernateTransactionManager"/>
<!-- ================================================================== -->
<!--  Flow Manager                                                      -->
<!-- ================================================================== -->

<bean id="flowManager"
      class="org.openehealth.ipf.platform.camel.flow.PlatformFlowManager">
</bean>

<!-- ================================================================== -->
<!--  Flow Processors (bean definition optional since IPF 1.6.0)        -->
<!-- ================================================================== -->

<bean scope="prototype" class="org.openehealth.ipf.platform.camel.flow.process.FlowBeginProcessor">
<property name="messageRenderer" ref="messageRenderer" />
</bean>

<bean scope="prototype" class="org.openehealth.ipf.platform.camel.flow.process.FlowEndProcessor">
<property name="messageRenderer" ref="messageRenderer" />
</bean>

<bean scope="prototype" class="org.openehealth.ipf.platform.camel.flow.process.FlowErrorProcessor">
<property name="messageRenderer" ref="messageRenderer" />
</bean>

<!-- ================================================================== -->
<!--  Dedupe (bean definition optional since IPF 1.6.0)                 -->
<!-- ================================================================== -->

<bean scope="prototype" class="org.openehealth.ipf.platform.camel.flow.dedupe.Dedupe" />

<!-- ================================================================= -->
<!--  Repositories                                                     -->
<!-- ================================================================= -->

<bean id="sequenceRepository"
      class="org.openehealth.ipf.commons.flow.repository.SequenceRepositoryImpl">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>

<bean id="flowRepository"
      class="org.openehealth.ipf.commons.flow.repository.FlowRepositoryImpl">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>

<bean id="configRepository"
      class="org.openehealth.ipf.commons.flow.repository.ConfigRepositoryImpl">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>

<!-- ================================================================= -->
<!--  Hibernate Setup                                                  -->
<!-- ================================================================= -->

<bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="flowDataSource"/>
<property name="configLocation" value="classpath:hibernate-flow.xml"/>
<property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
<property name="hibernateProperties">
    <props>
        <!-- For Hibernate version < 3.5.x use org.openehealth.ipf.commons.flow.derby.DerbyDialect -->
        <prop key="hibernate.dialect">org.hibernate.dialect.DerbyDialect</prop>
        <prop key="hibernate.hbm2ddl.auto">update</prop>
        <prop key="hibernate.show_sql">false</prop>
        <prop key="hibernate.format_sql">false</prop>
        <prop key="hibernate.search.autoregister_listeners">false</prop>
        <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
        <prop key="hibernate.search.default.indexBase">./lucene</prop>
    </props>
</property>
<!--
     Enables rendered message encryption and full text indexing:
     * To use rendering without both encryption and full text indexing,
       delete the 'eventListeners' property.
     * To use rendering with encryption only, delete the
       post-insert, post-update and post-delete entries.
     * To use rendering with full text indexing only, delete the bean
       references to textDecryptorEventListener in the post-insert and
       post-update event listeners. Delete the pre-update, pre-insert
       and post-load entries as well.
 -->
<property name="eventListeners">
    <map>
        <entry key="pre-update" value-ref="textEncryptorEventListener"/>
        <entry key="post-update">
            <list>
                <ref bean="textDecryptorEventListener"/>
                <ref bean="textIndexEventListener"/>
            </list>
        </entry>
        <entry key="pre-insert" value-ref="textEncryptorEventListener"/>
        <entry key="post-insert">
            <list>
                <ref bean="textDecryptorEventListener"/>
                <ref bean="textIndexEventListener"/>
            </list>
        </entry>
        <entry key="post-delete" value-ref="textIndexEventListener"/>
        <entry key="post-load" value-ref="textDecryptorEventListener"/>
    </map>
</property>
</bean>

<bean id="hibernateTemplate"
      class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="hibernateSessionFactory" />
</bean>

<bean id="hibernateTransactionManager"
      class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="hibernateSessionFactory"/>
</bean>

<!-- ================================================================= -->
<!--  Datasource Setup                                                 -->
<!-- ================================================================= -->

<bean id="flowDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver" />
<property name="url" value="jdbc:derby://localhost:1527/flowmgr;create=true" />
<property name="defaultAutoCommit" value="false" />
<property name="initialSize" value="10" />
<property name="maxActive" value="50" />
</bean>

<!-- ================================================================== -->
<!--  JMX Setup                                                         -->
<!-- ================================================================== -->

    <bean class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
       <!-- <property name="autodetect" value="false"/>   -->
        <property name="assembler" ref="assembler"/>
        <property name="namingStrategy" ref="namingStrategy"/>
        <property name="beans">
            <map>
                <entry
                        key="org.openehealth.ipf.platform:type=service,name=FlowManager"
                        value-ref="flowManagerMBean" />
            </map>
        </property>
    </bean>

<bean id="flowManagerMBean" class="org.openehealth.ipf.commons.flow.jmx.FlowManagerMBean">
<property name="application" value="registry"/>
</bean>

<!-- ================================================================= -->
<!--  JMX Annotation Support                                           -->
<!-- ================================================================= -->

<bean id="jmxAttributeSource"
      class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource"/>

<bean id="assembler"
      class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">
<property name="attributeSource" ref="jmxAttributeSource"/>
</bean>

    <bean id="namingStrategy"
          class="org.springframework.jmx.export.naming.MetadataNamingStrategy">
        <property name="attributeSource" ref="jmxAttributeSource"/>
    </bean>


        <!-- ================================================================= -->
        <!--  Encryption setup                                                 -->
        <!-- ================================================================= -->

<bean id="stringEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="password">
    <value>test_password</value>
</property>
</bean>

<bean id="textEncryptorEventListener"
      class="org.openehealth.ipf.commons.flow.hibernate.RenderedMessageEncryptEventListener">
<property name="stringEncryptor" ref="stringEncryptor" />
</bean>

<bean id="textDecryptorEventListener"
      class="org.openehealth.ipf.commons.flow.hibernate.RenderedMessageDecryptEventListener">
<property name="stringEncryptor" ref="stringEncryptor"/>
</bean>

        <!-- ================================================================= -->
        <!--  Fulltext indexing/search setup                                   -->
        <!-- ================================================================= -->

<bean id="textIndexEventListener" class="org.hibernate.search.event.FullTextIndexEventListener"/>
<bean id="flowSearchCallback" class="org.openehealth.ipf.commons.flow.repository.search.DefaultSearchCallback" />

        <!-- ================================================================== -->
        <!--  Message renderer                                                  -->
        <!-- ================================================================== -->

<bean id="messageRenderer"
      class="org.openehealth.ipf.platform.camel.flow.render.SimpleMessageRenderer">
</bean>


</beans>

 

--

Regards,
Swati Gour 

Boris Stanojević

unread,
Dec 16, 2013, 10:04:11 AM12/16/13
to ipf-...@googlegroups.com
Hi Swati,

there were some minor changes in Flow Manager in 2.6.0 release. Can you please try with this IPF version?

Best Regards,
Boris

Swati Gour

unread,
Dec 16, 2013, 11:24:22 AM12/16/13
to ipf-...@googlegroups.com
Hi Boris,

Do you mean this error is due to IPF 2.5.1? I will use IPF 2.6.0 release and try the same.

Swati Gour

unread,
Dec 17, 2013, 3:44:19 AM12/17/13
to ipf-...@googlegroups.com
Hi Boris,

I tried doing remote debug to IPF source code and I am getting an exception in class "org.openehealth.ipf.platform.camel.flow.PlatformPacket" at line number 149.
Exception: 
java.io.NotSerializableException: org.apache.cxf.binding.soap.SoapHeader

Its throwing exception while serializing soap message header. Can you please help me with this issue?

I am using IPF version 2.5.1 and CXF version is 2.7.5.

--

Regards,
Swati Gour 

Boris Stanojević

unread,
Dec 17, 2013, 7:11:41 AM12/17/13
to ipf-...@googlegroups.com
Have you tried with ipf-2.6.0?

Best Regards,
Boris


2013/12/17 Swati Gour <swati...@gmail.com>

Swati Gour

unread,
Dec 17, 2013, 7:19:59 AM12/17/13
to ipf-...@googlegroups.com
No I haven't tried IPF 2.6.0, I am using IPF 2.5.1.

Thanks,
Swati

Boris Stanojević

unread,
Dec 17, 2013, 9:18:31 AM12/17/13
to ipf-...@googlegroups.com
As said, there is a patch for this in FlowManager IPF version 2.6.0, not planing to maintain this in the 2.5 branch. In 2.5 you may hack this by filtering all non-serializable content contained from your Exchange Headers/Properties before saving it into FM-DB (see below), but I would strongly encourage you to move onto 2.6.0:

        from('xds-iti42:xds-iti42' + xuaOptions)
                .routeId('xds-iti42:xds-iti42')
                .removeHeader(AbstractWsEndpoint.INCOMING_SOAP_HEADERS)
                .initFlow( APP_NAME + '::xds:iti42' )
                    .expectedAckCount(2)
                    .renderer( 'messageRenderer' )
                    .application( APP_NAME )
                .choice()
                .when().constant(ITI42RequestValidatorEnabled).process(iti42RequestValidator())
                .end()
                .to('direct:registerDocumentSet')
                .process(iti42ResponseValidator())\



2013/12/17 Swati Gour <swati...@gmail.com>

Dmytro Rud

unread,
Dec 17, 2013, 10:04:12 AM12/17/13
to ipf-...@googlegroups.com
Hello Swati,

Just a side remark: IPF does already provide means for switching off message validation -- see http://openehealth.org/display/ipf2/Core+features#Corefeatures-validatordisable
So your route can be somewhat simplified:

from('xds-iti42:xds-iti42' + xuaOptions)
       .routeId('xds-iti42:xds-iti42')
       .initFlow( APP_NAME + '::xds:iti42' )
           .expectedAckCount( 2 )
           .renderer( 'messageRenderer' )
           .application( APP_NAME )
       .setHeader(ValidatorAdapter.NEED_VALIDATION_HEADER_NAME) { ITI42RequestValidatorEnabled }
       .process(iti42RequestValidator())
       .to('direct:registerDocumentSet')
       .setHeader(ValidatorAdapter.NEED_VALIDATION_HEADER_NAME) { true }
       .process(iti42ResponseValidator())

Best regards
Dmytro


2013/12/16 Swati Gour <swati...@gmail.com>

Swati Gour

unread,
Dec 18, 2013, 6:50:18 AM12/18/13
to ipf-...@googlegroups.com
Thanks Boris and Dmytro for the help.

I upgraded IPF to version 2.6.0 and tried doing the same, but I am getting an error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet.

Camel Route:
 from('xds-iti42:xds-iti42' + xuaOptions)
            .initFlow("test")
            .routeId('xds-iti42:xds-iti42')
            .choice()
                .when().constant(ITI42RequestValidatorEnabled).process(iti42RequestValidator())
            .end()
            .to('direct:registerDocumentSet')
            .process(iti42ResponseValidator())

I have also tried using marshal in camel route but still I am getting same error:

 JaxbDataFormat jax = new JaxbDataFormat("com.emc.healthcare.xds.registry.commons.config");
 jax.setIgnoreJAXBElement(false);

 from('xds-iti42:xds-iti42' + xuaOptions)
             .transacted()
             .marshal(jax)
             .initFlow("test-2")
                .application("test")
            .routeId('xds-iti42:xds-iti42')
            .choice()
                .when().constant(ITI42RequestValidatorEnabled).process(iti42RequestValidator())
            .end()
            .to('direct:registerDocumentSet')
            .process(iti42ResponseValidator())

Error:
XDSRegistryError : org.apache.camel.InvalidPayloadException: No body available of type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet but has value: java.io.ByteArrayInputStream@5564618f of type: java.io.ByteArrayInputStream on: Message: [Body is instance of java.io.InputStream]. Caused by: Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@5564618f due null. Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by: [org.apache.camel.TypeConversionException - Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@5564618f due null] : 
gov.nist.toolkit.xdsexception.XdsInternalException: XDSRegistryError : org.apache.camel.InvalidPayloadException: No body available of type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet but has value: java.io.ByteArrayInputStream@5564618f of type: java.io.ByteArrayInputStream on: Message: [Body is instance of java.io.InputStream]. Caused by: Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@5564618f due null. Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by: [org.apache.camel.TypeConversionException - Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@5564618f due null] : 

Could you please help me with this issue?
--

Regards,
Swati Gour 

Boris Stanojević

unread,
Dec 18, 2013, 11:01:50 AM12/18/13
to ipf-...@googlegroups.com
Hi,

you need to convert the incoming "org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest" in a format acceptable for the FlowManager (it tries again to convert the content into byte array - see http://www.openehealth.org/display/ipf2/Flow+management#Flowmanagement-Parameterizationof{{initFlow}}).

private DataFormat df = initDataFormat();

private DataFormat initDataFormat(){
        JaxbDataFormat jaxb = new JaxbDataFormat()
        jaxb.setContextPath(SubmitObjectsRequest.class.package.name)
        this.df = jaxb.getDataFormat()
}


 from('xds-iti42:xds-iti42' + xuaOptions)
            .routeId('xds-iti42:xds-iti42')
            .initFlow("test")
                .inFormat(df)
                .outConversion(false)
            .choice()
                .when().constant(ITI42RequestValidatorEnabled).process(iti42RequestValidator())
            .end()
            .to('direct:registerDocumentSet')
            .process(iti42ResponseValidator())


2013/12/18 Swati Gour <swati...@gmail.com>

Swati Gour

unread,
Dec 20, 2013, 6:52:59 AM12/20/13
to ipf-...@googlegroups.com
Thanks Boris, it worked. Now I am getting data in IPF flow manager. But I am getting an issue while doing replay of message. I have also set outFormat to convert ByteArrayInputStream to relevant type "RegisterDocumentSet".

Please find the camel route below:
private DataFormat of = outDataFormat();

private DataFormat outDataFormat(){
        JaxbDataFormat jaxb = new JaxbDataFormat()
        jaxb.setContextPath(RegisterDocumentSet.class.package.name)
        this.of = jaxb.getDataFormat()
}

 from('xds-iti42:xds-iti42' + xuaOptions)
            .routeId('xds-iti42:xds-iti42')
            .initFlow("test")
                .inFormat(df)
                .outFormat(of)

Thanks,
Swati

Boris Stanojević

unread,
Dec 20, 2013, 7:49:12 AM12/20/13
to ipf-...@googlegroups.com
>> I have also set outFormat to convert ByteArrayInputStream to relevant type "RegisterDocumentSet"

actually your relevant type should be "SubmitObjectsRequest". You shold be able to use the same JaxbDataFormat for "inFormat" (marshal) and "outFormat" (unmarshal). On "initFlow" you serialized the "SubmitObjectsRequest" didn't you? On "replayFlow" you would fetch this byte[] from the underlying DB and deserialize it back into the original "SubmitObjectsRequest".

Cheers,
Boris


2013/12/20 Swati Gour <swati...@gmail.com>

Swati Gour

unread,
Dec 20, 2013, 8:02:25 AM12/20/13
to ipf-...@googlegroups.com
Hi Boris,

When I am using "SubmitObjectsRequest" for outFormat, I am getting following error:

XDSRegistryError : No body available of type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet but has value: java.io.ByteArrayInputStream@4b13237e of type: java.io.ByteArrayInputStream on: Message: [Body is instance of java.io.InputStream]. Caused by: Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@4b13237e due null. Exchange[Message: [Body is instance of java.io.InputStream]]. Caused by: [org.apache.camel.TypeConversionException - Error during type conversion from type: java.io.ByteArrayInputStream to the required type: org.openehealth.ipf.commons.ihe.xds.core.requests.RegisterDocumentSet with value java.io.ByteArrayInputStream@4b13237e due null] :

Swati Gour

unread,
Dec 20, 2013, 8:24:25 AM12/20/13
to ipf-...@googlegroups.com
Camel route is:
 from('xds-iti42:xds-iti42')
             .routeId('iti42')
             .initFlow("registry")
                .application("registry::iti-42")
                .inFormat(df)
                .outFormat(df)

Could you please help me with this issue?
--

Regards,
Swati Gour 

Swati Gour

unread,
Dec 20, 2013, 10:06:25 AM12/20/13
to ipf-...@googlegroups.com
Hi Boris,

I have defined "outFormat" in my camel route with same JaxbDataFormat which I am using for "inFormat". But it gives me error when I do RegisterDocumentSet transaction. Now, after adding outFormat, the transaction doesn't even complete.

Could you please help me with this issue?

Thanks,
Swati
--

Regards,
Swati Gour 

Boris Stanojević

unread,
Dec 20, 2013, 10:54:08 AM12/20/13
to ipf-...@googlegroups.com
Hi,

not sure, maybe the DataFormat is not properly initialized; please try with this DataFormat instead:


import org.apache.camel.Exchange
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.*
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.*
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.query.*
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rs.*

import javax.xml.bind.*

class XdsDataFormat implements org.apache.camel.spi.DataFormat {
    private static final JAXBContext JAXB_CONTEXT;
    private static final Unmarshaller UNMARSHALLER;
    private static final Marshaller MARSHALLER;

    static {
        try {
            JAXB_CONTEXT = JAXBContext.newInstance(
                    AdhocQueryRequest.class,
                    ProvideAndRegisterDocumentSetRequestType.class,
                    SubmitObjectsRequest.class,
                    RetrieveDocumentSetRequestType.class,
                    RemoveObjectsRequest.class,
                    RetrieveImagingDocumentSetRequestType.class,
                    AdhocQueryResponse.class,
                    RegistryResponseType.class,
                    RetrieveDocumentSetResponseType.class
            );
            UNMARSHALLER = JAXB_CONTEXT.createUnmarshaller()
            MARSHALLER = JAXB_CONTEXT.createMarshaller()
        } catch (JAXBException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
        MARSHALLER.marshal(graph, stream)
    }

    @Override
    Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return UNMARSHALLER.unmarshal(stream)
    }
}

and then in you RouteBuilder:

...
    XdsDataFormat dataFormat = new XdsDataFormat ()

    @Override
    public void configure() throws Exception {

            from('xds-iti42:xds-iti42')
                .routeId('iti42')
                .initFlow('registry') 
                .inFormat(dataFormat)
                .outFormat(dataFormat)
......

hope that helps,

best,
Boris

Swati Gour

unread,
Dec 20, 2013, 1:37:23 PM12/20/13
to ipf-...@googlegroups.com
Thanks alot Boris, it worked for me. Really grateful to you.

Thanks,
Swati

Boris Stanojević

unread,
Dec 20, 2013, 5:32:51 PM12/20/13
to ipf-...@googlegroups.com
Hi Swati,

just one side note, since the Unmarshaller and Marshaller are not thread safe you need always to create a new Unmarshaller/Marshaller from the given JAXB_CONTEXT like this:

    @Override
    void marshal(Exchange exchange, Object graph, OutputStream stream) throws Exception {
        JAXB_CONTEXT.createMarshaller().marshal(graph, stream)
    }

    @Override
    Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return JAXB_CONTEXT.createUnmarshaller().unmarshal(stream)
    }

OR consider pooling Unmarshaller/Marshaller objects. Different threads may reuse one Unmarshaller instance, as long as you don't use one instance from two threads at the same time.

Best Regards,
Boris

Swati Gour

unread,
Dec 24, 2013, 2:03:46 PM12/24/13
to ipf-...@googlegroups.com
Thanks Boris, its working now. I have few doubts on IPF Manager (I am using standalone application): 

1. Can we order the search result columns.

2. Can we show Soap endpoint name in flow search results, like:

 - iti18 StoredQuery

 - iti18as StoredQuery Asynchronous 

3. Can we name the outbound Paths by their endpoint instead of ‘Path 0’?  

Show flow content-> Outbound->QueryRegistry

                                                                                -> xx-iti18

4. Can we list input and output at the same time.


Could you please help me with this?


Thanks,

Swati



Swati Gour

unread,
Jan 8, 2014, 6:40:59 AM1/8/14
to ipf-...@googlegroups.com
Hi Boris,

I am getting an issue while replaying message flow. When I do replay of a message, it doesn't gives any error but the message is not replayed. I have also specified outFormat as you have explained in the mails above.

Thanks,
Swati

Boris Stanojević

unread,
Jan 8, 2014, 12:28:45 PM1/8/14
to ipf-...@googlegroups.com
Hi Swati,

are you able to find the particular flow over the JMX (eg. JConsole)? It is probably the "application" attribute which you are missing in your route:

        from('xds-iti42:xds-iti42-service')
            .initFlow('xds-iti42').application('iti42-tutorial')
                .inFormat(dataFormat)
                .outFormat(dataFormat)
            .process(iti42RequestValidator())
            //..DO-SOMETHING
            .process { createResult(it) }
            .process(iti42ResponseValidator())
            .ackFlow()

and afterwards refer to this application-attribute when you do the search, replay ... etc (hope that screenshots attached below are not lost).

Inline-Bild 1

And then you can do the SEARCH:

Inline-Bild 3

Or REPLAY:

Inline-Bild 4


Hope that helps, best Regards,
Boris



2014/1/8 Swati Gour <swati...@gmail.com>
image.png
image.png
image.png

Swati Gour

unread,
Jan 8, 2014, 12:51:39 PM1/8/14
to ipf-...@googlegroups.com
Hi Boris,

I have already defined application attribute and is able to search flow objects based on the application name. But still I am unable to replay the messages. I can see the inbound and also outbound message.

When I am doing replay through JMX, I am getting following error:
2014.01.08 09:53:29 void replayFlow( 38 );
 javax.management.MBeanException: RuntimeException thrown in RequiredModelMBean while trying to invoke operation replayFlow
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1091)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(Unknown Source)
at org.openehealth.ipf.tools.manager.jmxexplorer.impl.MBeanServerConnectionFacadeImpl.invokeOperation(MBeanServerConnectionFacadeImpl.java:169)
at org.openehealth.ipf.tools.manager.jmxexplorer.ui.editor.MBeanOperationEditor.widgetSelected(MBeanOperationEditor.java:243)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.openehealth.ipf.tools.manager.application.Application.start(Application.java:38)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: org.openehealth.ipf.commons.flow.FlowReplayException: flow replay failed
at org.openehealth.ipf.commons.flow.FlowManagerBase.replayFlow(FlowManagerBase.java:195)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy80.replayFlow(Unknown Source)
at org.openehealth.ipf.commons.flow.jmx.FlowManagerMBean.replayFlow(FlowManagerMBean.java:284)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1074)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
at org.springframework.jmx.export.SpringModelMBean.invoke(SpringModelMBean.java:90)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.openehealth.ipf.commons.flow.FlowReplayException: replay strategy XDS Registry not found
at org.openehealth.ipf.platform.camel.flow.PlatformFlowManager.replayFlow(PlatformFlowManager.java:95)
at org.openehealth.ipf.platform.camel.flow.PlatformFlowManager.replayFlow(PlatformFlowManager.java:75)
at org.openehealth.ipf.commons.flow.FlowManagerBase.replayFlow(FlowManagerBase.java:191)
... 46 more

Thanks,
Swati
image.png
image.png
image.png

Boris Stanojević

unread,
Jan 8, 2014, 2:04:40 PM1/8/14
to ipf-...@googlegroups.com
Hi Swati,

>> replay strategy XDS Registry not found

my guess is you have changed the "identifier" (initFlow('THE-IDENTIFIER')) attribute of the FlowBeginProcessor, started the Application again, and now trying to replay some old Flows commited before this change. The replay strategy ("XDS Registry" in your case) does not exist any more.

I would suggest to clean up the Flow-DB and try the whole test again.

Best Regards,
Boris
image.png
image.png
image.png

Swati Gour

unread,
Jan 9, 2014, 12:56:13 AM1/9/14
to ipf-...@googlegroups.com
Hi Boris,

I have cleared the Flow-DB and tried doing replay of flow again, but still I am getting same error.

Thanks,
Swati


image.png
image.png
image.png

Boris Stanojević

unread,
Jan 9, 2014, 8:20:36 AM1/9/14
to ipf-...@googlegroups.com
Hi Swati,

check out the small tutorial project I created on a new remote "iti42-fm-tutorial" branch (see https://github.com/oehf/ipf/tree/iti42-fm-tutorial/tutorials/iti42-fm). It contains the whole Iti42Interface+FlowManager funcionality!! Please follow these steps in order to download and run the project:

1a. run "git checkout iti42-fm-tutorial"
2. switch to tutorials\iti42-fm folder and run "mvn clean install assembly:assembly"
3. extract the "ipf-tutorials-iti42-2.6.0-bin.zip" from the "target" folder
4. switch to extracted "ipf-tutorials-iti42-2.6.0" folder
5. run "start-flowdb.bat" -> starts DerbyDB Server
6. run "start-node.bat" -> starts the Tutorial App (ITI42 interface available on "http://localhost:9091/xds-iti42-service")
7. run "start-console.bat" -> starts the JConsole with "ipf-commons-flow.jar" in the classpath

I used the Soap-UI to send the test messages against the iti42 endpoint. Check the RouteBuilder (Iti42RouteBuilder) and flow-manager spring configuration (context-flowmgr.xml) and compare it with your setup!! 

Hope you can build upon...

Regards,
Boris


2014/1/9 Swati Gour <swati...@gmail.com>
image.png
image.png
image.png

Swati Gour

unread,
Jan 10, 2014, 8:11:26 AM1/10/14
to ipf-...@googlegroups.com
Hi Boris,

Thanks for the tutorial. But I have already integrated IPF flow manager in the same way as you explained in the tutorial. Still I am getting error while doing replay. Only thing which I have not included is load time weaving rest all is the same. 

Thanks,
Swati
image.png
image.png
image.png

Boris Stanojević

unread,
Jan 10, 2014, 8:29:05 AM1/10/14
to ipf-...@googlegroups.com
Hi Swati,

do you have splitter or multicast in your Route?? If you do, it is required to use the "load time weaving", see this section!!

Regards,
Boris


2014/1/10 Swati Gour <swati...@gmail.com>
image.png
image.png
image.png

Swati Gour

unread,
Jan 10, 2014, 10:22:58 AM1/10/14
to ipf-...@googlegroups.com
Hi Boris,

I don't have splitter or multicast in my route. 

Regards,
Swati 
image.png
image.png
image.png

Boris Stanojevic

unread,
Jan 10, 2014, 1:08:30 PM1/10/14
to ipf-...@googlegroups.com
Hi Swati,

then please try to send a part of your application/unit test or just simply describe the steps where this issue can be reproduced,

Regards,
Boris

Von meinem iPad gesendet


2014/1/10 Swati Gour <swati...@gmail.com>


2014/1/9 Swati Gour <swati...@gmail.com>


2014/1/8 Swati Gour <swati...@gmail.com>
<image.png>

And then you can do the SEARCH:

<image.png>

Or REPLAY:

<image.png>



--

Regards,
Swati Gour 



--

Regards,
Swati Gour 



--

Regards,
Swati Gour 



--

Regards,
Swati Gour 
Reply all
Reply to author
Forward
0 new messages