Announcement

Collapse

NextGen (Mirth) Connect 3.9.1 Released!

NextGen (Mirth) Connect 3.9.1 is now available as an appliance update and on our GitHub page. This release contains bug fixes and adds support for eHealth Exchange UDDI providers in the Interoperability plugin. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Null Pointer Exception

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Null Pointer Exception

    I have one outbound channel that reads data from database and sends the data to LLP. I have another channel that reads from the LLP sender and writes to a file. I get the following exception with start the channels.

    java.lang.NullPointerException
    at org.mule.providers.tcp.TcpMessageDispatcher.write( TcpMessageDispatcher.java:121)
    at org.mule.providers.tcp.TcpMessageDispatcher.doDisp atch(TcpMessageDispatcher.java:92)
    at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Thread.java:595)

    {}

    Any ideas!

    Priya.

  • #2
    Re: Null Pointer Exception

    Are you starting the LLP listener channel first?
    Chris Lang

    Comment


    • #3
      Re: Null Pointer Exception

      I tried just running one channel that reads from the database and sends to LLP sender. Now I get error below.

      java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
      at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
      at java.net.Socket.connect(Socket.java:516)
      at java.net.Socket.connect(Socket.java:466)
      at java.net.Socket.<init>(Socket.java:366)
      at java.net.Socket.<init>(Socket.java:208)
      at org.mule.providers.tcp.TcpMessageDispatcher.create Socket(TcpMessageDispatcher.java:103)
      at org.mule.providers.tcp.TcpMessageDispatcher.initSo cket(TcpMessageDispatcher.java:76)
      at org.mule.providers.tcp.TcpMessageDispatcher.doDisp atch(TcpMessageDispatcher.java:91)
      at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
      at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
      at java.lang.Thread.run(Thread.java:595)

      {}

      Priya.

      Comment


      • #4
        Re: Null Pointer Exception

        This last exception is launch when no listener is found: what is exactly what you&#039;ve defined

        Comment


        • #5
          Re: Null Pointer Exception

          Yes, if your LLP sender doesn&#039;t have anything to connect to, you will get that exception as Alberto stated.

          Make sure you start your listener first, then the sender.

          -Chris
          Chris Lang

          Comment


          • #6
            Re: Null Pointer Exception

            I tried starting the listener first and then the sender. I still get the Null Pointer Exception.
            java.lang.NullPointerException
            at org.mule.providers.tcp.TcpMessageDispatcher.write( TcpMessageDispatcher.java:121)
            at org.mule.providers.tcp.TcpMessageDispatcher.doDisp atch(TcpMessageDispatcher.java:92)
            at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
            at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
            at java.lang.Thread.run(Thread.java:595)

            {}

            Priya.

            Comment


            • #7
              Re: Null Pointer Exception

              Can you post your channel XML?
              Chris Lang

              Comment


              • #8
                Re: Null Pointer Exception

                Chris,

                Here is the channel.

                <com.webreach.mirth.model.Channel>
                <id>e341baec-801d-493e-a709-9e925c595bea</id>
                <name>INFANT_OUT</name>
                <description></description>
                <enabled>true</enabled>
                <version>1.2.0</version>
                <revision>0</revision>
                <direction>OUTBOUND</direction>
                <protocol>HL7</protocol>
                <mode>ROUTER</mode>
                <sourceConnector>
                <name>sourceConnector</name>
                <properties>
                <property name="pollingFrequency">5000</property>
                <property name="username">root</property>
                <property name="DataType">Database Reader</property>
                <property name="useAck">1</property>
                <property name="URL">jdbcdbc:PDN</property>
                <property name="query">SELECT `INFANT_ID`, `I_F_NAME`, `I_L_NAME`, `ISEX` FROM PDN_PROD_INFANT
                WHERE INFANT_ID = 1;</property>
                <property name="password">vivsar</property>
                <property name="host">query</property>
                <property name="driver">sun.jdbc.odbc.JdbcOdbcDriver</property>
                <property name="ack">UPDATE PDN_PROD_INFANT&#x0D;
                SET UPDATE_FLAG = &apos;Y&apos;&#x0D;
                WHERE ${infant_id} = 1;</property>
                </properties>
                <transformer>
                <steps/>
                </transformer>
                <filter>
                <rules/>
                </filter>
                <transportName>Database Reader</transportName>
                </sourceConnector>
                <destinationConnectors>
                <com.webreach.mirth.model.Connector>
                <name>Destination 1</name>
                <properties>
                <property name="tcpProtocolClassName">org.mule.providers.tcp .protocols.LlpProtocol</property>
                <property name="segmentEnd">0x0D</property>
                <property name="messageEnd">0x1C</property>
                <property name="keepSendSocketOpen">0</property>
                <property name="bufferSize">65536</property>
                <property name="port">6660</property>
                <property name="sendTimeout">5000</property>
                <property name="messageStart">0x0B</property>
                <property name="maxRetryCount">50</property>
                <property name="charEncoding">hex</property>
                <property name="DataType">LLP Sender</property>
                <property name="recordSeparator">0x0D</property>
                <property name="host">127.0.0.1</property>
                </properties>
                <transformer>
                <steps>
                <com.webreach.mirth.model.Step>
                <sequenceNumber>0</sequenceNumber>
                <name>LastName</name>
                <script>LastName = msg[&apos;i_l_name&apos;].toString();</script>
                <type>HL7 Message Builder</type>
                <data class="map">
                <entry>
                <string>Mapping</string>
                <string>msg[&apos;i_l_name&apos;].toString()</string>
                </entry>
                <entry>
                <string>Variable</string>
                <string>LastName</string>
                </entry>
                </data>
                </com.webreach.mirth.model.Step>
                <com.webreach.mirth.model.Step>
                <sequenceNumber>1</sequenceNumber>
                <name>FirstName</name>
                <script>FirstName = msg[&apos;i_f_name&apos;].toString();</script>
                <type>HL7 Message Builder</type>
                <data class="map">
                <entry>
                <string>Mapping</string>
                <string>msg[&apos;i_f_name&apos;].toString()</string>
                </entry>
                <entry>
                <string>Variable</string>
                <string>FirstName</string>
                </entry>
                </data>
                </com.webreach.mirth.model.Step>
                <com.webreach.mirth.model.Step>
                <sequenceNumber>2</sequenceNumber>
                <name>Gender</name>
                <script>Gender = msg[&apos;i_sex&apos;].toString();</script>
                <type>HL7 Message Builder</type>
                <data class="map">
                <entry>
                <string>Mapping</string>
                <string>msg[&apos;i_sex&apos;].toString()</string>
                </entry>
                <entry>
                <string>Variable</string>
                <string>Gender</string>
                </entry>
                </data>
                </com.webreach.mirth.model.Step>
                </steps>
                <template></template>
                </transformer>
                <filter>
                <rules/>
                </filter>
                <transportName>LLP Sender</transportName>
                </com.webreach.mirth.model.Connector>
                </destinationConnectors>
                <properties>
                <property name="initialState">stopped</property>
                <property name="store_messages">true</property>
                <property name="recv_xml_encoded">false</property>
                <property name="encryptData">false</property>
                <property name="transactional">false</property>
                <property name="max_message_age">-1</property>
                <property name="error_messages_only">false</property>
                </properties>
                <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
                return message;</preprocessingScript>
                </com.webreach.mirth.model.Channel>

                Comment


                • #9
                  Re: Null Pointer Exception

                  Chris,

                  I had uploaded the channel where I get Null Pointer Exception. Could you provide me with your feedback as I have a deadline to meet.

                  Thanks!
                  Priya.

                  Comment


                  • #10
                    Re: Null Pointer Exception

                    Can you also post the LLP listener? In the channel you have JDBC to LLP Sender. You must have the LLP Listener started first,or the LLP sender on the destination will have nothing to connect to.

                    -Chris
                    Chris Lang

                    Comment


                    • #11
                      Re: Null Pointer Exception

                      Chris,

                      Below is the LLP Listener to File Writer Channel.

                      <com.webreach.mirth.model.Channel>
                      <id>3190d0ea-de4b-43ab-a567-3caebe2eef54</id>
                      <name>LLP to File Writer</name>
                      <description></description>
                      <enabled>true</enabled>
                      <version>1.2.0</version>
                      <revision>0</revision>
                      <direction>INBOUND</direction>
                      <protocol>HL7</protocol>
                      <mode>ROUTER</mode>
                      <sourceConnector>
                      <name>sourceConnector</name>
                      <properties>
                      <property name="tcpProtocolClassName">org.mule.providers.tcp .protocols.LlpProtocol</property>
                      <property name="segmentEnd">0x0D</property>
                      <property name="messageEnd">0x1C</property>
                      <property name="sendACK">1</property>
                      <property name="keepSendSocketOpen">0</property>
                      <property name="bufferSize">65536</property>
                      <property name="port">6660</property>
                      <property name="messageStart">0x0B</property>
                      <property name="charEncoding">hex</property>
                      <property name="DataType">LLP Listener</property>
                      <property name="recordSeparator">0x0D</property>
                      <property name="receiveTimeout">5000</property>
                      <property name="host">127.0.0.1</property>
                      </properties>
                      <transformer>
                      <steps/>
                      </transformer>
                      <filter>
                      <rules/>
                      </filter>
                      <transportName>LLP Listener</transportName>
                      </sourceConnector>
                      <destinationConnectors>
                      <com.webreach.mirth.model.Connector>
                      <name>Destination 1</name>
                      <properties>
                      <property name="outputAppend">0</property>
                      <property name="DataType">File Writer</property>
                      <property name="outputPattern">results${UUID}.txt</property>
                      <property name="template">${message.rawData}</property>
                      <property name="host">c:/Mirth_Output</property>
                      </properties>
                      <transformer>
                      <steps/>
                      </transformer>
                      <filter>
                      <rules/>
                      </filter>
                      <transportName>File Writer</transportName>
                      </com.webreach.mirth.model.Connector>
                      </destinationConnectors>
                      <properties>
                      <property name="initialState">stopped</property>
                      <property name="store_messages">true</property>
                      <property name="recv_xml_encoded">false</property>
                      <property name="encryptData">false</property>
                      <property name="transactional">false</property>
                      <property name="max_message_age">-1</property>
                      <property name="error_messages_only">false</property>
                      </properties>
                      <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
                      return message;</preprocessingScript>
                      </com.webreach.mirth.model.Channel>

                      Thanks in advance,
                      Priya.

                      Comment


                      • #12
                        Re: Null Pointer Exception


                        Chris,

                        I made sure that I have Listener Started first before the Sender. I still get this error message.

                        Thanks!
                        Priya.

                        Comment


                        • #13
                          Re: Null Pointer Exception

                          Thanks,

                          I&#039;ll look into this today.
                          Chris Lang

                          Comment


                          • #14
                            Re: Null Pointer Exception

                            Chris,

                            Did you get a chance to look into the channels?

                            Thanks!
                            Priya.

                            Comment


                            • #15
                              [QUOTE=chrisl;1311]Can you also post the LLP listener? In the channel you have JDBC to LLP Sender. You must have the LLP Listener started first,or the LLP sender on the destination will have nothing to connect to.

                              Hi Chris

                              I see same error I am using Mirth 3.3 source is db reader I am calling a SP and destination is a filewriter. Please let me know what can be done
                              Attached Files

                              Comment

                              Working...
                              X