Error Connecting To Remote Host In Mirth - mirth

I need to create a connection between a lab machine and a server.
The lab machine can send HL7 messages for test results.
I decided to use mirthconnect to process the message and so i created a channel.
The channel source connector was configured as a "TCP LISTENER"
The Listener settings use a "specific interface" with ip address of the machine entered.
Response settings are configured to "auto-generate after source transformer"
Transmission mode is "MLLP" using "Server" mode.
Receive timeout is 0 ms, and "keep Connection Open" radio button is checked.
I also specified a port number "2468" to listen on and it showed as enabled when i did a
"netstat -at" command.
On the sending computer on the network, i created a channel again and i put in the IP address of the first machine with the receiving channel on the destination. I also put in the port number that was used when creating the channel on the "receiving" computer.
However when i clicked on the "Test Connection" button i got an
unable to connect to host error
I also tried to send a message after deploying the channel and the message was not sent.
The error generated is shown below:
TCP Sender error
ERROR MESSAGE: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.mirth.connect.connectors.tcp.SocketUtil.connectSocket(SocketUtil.java:62)
at com.mirth.connect.connectors.tcp.TcpDispatcher.send(TcpDispatcher.java:213)
at com.mirth.connect.donkey.server.channel.DestinationConnector.handleSend(DestinationConnector.java:599)
at com.mirth.connect.donkey.server.channel.DestinationConnector.process(DestinationConnector.java:336)
at com.mirth.connect.donkey.server.channel.DestinationChain.call(DestinationChain.java:224)
at com.mirth.connect.donkey.server.channel.Channel.process(Channel.java:1428)
at com.mirth.connect.donkey.server.channel.Channel.dispatchRawMessage(Channel.java:956)
at com.mirth.connect.donkey.server.channel.SourceConnector.dispatchRawMessage(SourceConnector.java:175)
at com.mirth.connect.server.controllers.DonkeyEngineController.dispatchRawMessage(DonkeyEngineController.java:520)
at com.mirth.connect.server.servlets.MessageObjectServlet$2.run(MessageObjectServlet.java:193)
at java.lang.Thread.run(Unknown Source)
I can successfully ping both systems and can connect to a MySQL server on the host by using
mysql -utest -ptest -hipaddressofhost
I am using Mirthconnect 3.0.
Please where am i missing it?...thanks
(I also have not encrypted the message nor am i using SSL To test the transmission...i believe this is not an issue??)

There is several things that could possibly go wrong with something that seems as simple as this is:
Did you verify that you have no firewall installed or active. The commands you use seem to indicate that you may be using Linux. As such, you could become quite frustrated by something like iptables (/etc/init.d/iptables status) or another firewall like that.
Are you sure you do not have any kind of firewall in the way that would prevent network communications between the sender and the box that is listening on port 2468? Are they on the same subnets? If they are not on the same subnet it is possible that some kind of network device/firewall is blocking the traffic.
Can you telnet to the listener's ip address and port (telnet )?
Another simple way to test if you are on the right path is to import the channel (or just the destination that is sending to the listener) into the listener machine's Mirth instance. If you are able to establish a connection while not making any changes to the port and ip address in this destination you probably have some kind of network/firewall issue that is preventing traffic on that specific port from getting through.
Not sure if this will help you much, but good luck either way.
Frans

Related

Access static file cause "Connection reset by peer" exception

I use StaticHandler in vertx-web to serve all static resource(css js mp4 files),
rootRouter.get("/static/*").handler(StaticHandler.create());
I use <video> tag to access the mp4 file in my page:
<video muted="muted" autoplay="autoplay" loop="loop" src="/static/img/factory.mp4"></video>
When I access the page which contained the mp4 file from Chrome, the server side will report a exception:
03:04:17.893 [vert.x-eventloop-thread-3] ERROR i.vertx.core.net.impl.ConnectionBase - Connection reset by peer
java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileChannelImpl.transferTo0(Native Method)
at java.base/sun.nio.ch.FileChannelImpl.transferToDirectlyInternal(FileChannelImpl.java:501)
at java.base/sun.nio.ch.FileChannelImpl.transferToDirectly(FileChannelImpl.java:566)
at java.base/sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:678)
at io.netty.channel.DefaultFileRegion.transferTo(DefaultFileRegion.java:130)
at io.netty.channel.socket.nio.NioSocketChannel.doWriteFileRegion(NioSocketChannel.java:362)
at io.netty.channel.nio.AbstractNioByteChannel.doWriteInternal(AbstractNioByteChannel.java:238)
at io.netty.channel.nio.AbstractNioByteChannel.doWrite0(AbstractNioByteChannel.java:212)
at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:400)
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:934)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.forceFlush(AbstractNioChannel.java:361)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:708)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
But when I use Firefox, there will be no problem.
And other static resources work normal, only the mp4 file will cause this exception.
Does anyone know what's going on? What should I do?
Connection reset by peer
is a response by the remote server (or firewall between them) stating that it will not proceed with completing this request.
So the other side has abruptly aborted the connection in midst of a transaction.
There are many possible reasons for this. It may well be a firewall denial, an SSL handshake failure, a VPN issue, slow internet, a proxy problem or even an HTTP failed request.
PS: this and this were helpful.
Updating the vert.x version in use could also print less of such messages as stated here.

Not able to create new oracle jdbc-source confluent kafka connector. It is giving error Caused by: java.net.BindException: Address already in use

I have tested default existing jdbc source connector. It is working fine for DB. I want to create another oracle jdbc source connector for different DB. For that I have created new properties file with different DB details. Then, I ran the below command.
bin/connect-standalone etc/schema-registry/connect-avro-standalone.properties source-quickstart-sqlite1.properties
The Error:
[2020-06-20 09:43:46,751] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectStandalone:130)
org.apache.kafka.connect.errors.ConnectException: Unable to initialize REST server
at org.apache.kafka.connect.runtime.rest.RestServer.initializeServer(RestServer.java:217)
at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:87)
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8083
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.server.Server.doStart(Server.java:385)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.apache.kafka.connect.runtime.rest.RestServer.initializeServer(RestServer.java:215)
... 1 more
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)
... 8 more
I have tried usuing rest.port:8089. It is also not working.
There is already an application running on you computer, who is attached (binded) to the port 8083. Probably, it's another Kafka Connect instance. Stop it before executing you command.
To find the app listening the port, execute lsof -i :8083 and you'll get the PID. You can then simply kill it, assuming it's all about local development of Konnect applications.

Connect from uMongo to EC2

I'm trying to remotely connect to MongoDB on an Amazon EC2 server using uMongo.
I've opened a port on my Amazon server:
Type: Custom TCP Rule
Protocol: TCP
Port Range: 27017
Source: 0.0.0.0/0.
I've added a connection in uMongo with the following settings:
Name: Porject Name
Servers: https://12.34.56.789:27017
Connection Mode: Automatic
Socket Type: Plain
Connect Timeout: 2,000
Socket Timeout: 0
Safe Writes: [checked]
Proxy Type: None
Proxy Host: localhost
Proxy Port: 9,000
All the other fields are empty. Basically, I only changed the "Servers" field and left all the others untouched.
Then, when I try to connect via this connection, I get the following exception:
java.lang.NumberFormatException: For input string: "//12.34.56.789"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569) at
java.lang.Integer.valueOf(Integer.java:766) at
com.edgytech.umongo.MainMenu.connect(MainMenu.java:177) at
com.edgytech.umongo.MainMenu.connect(MainMenu.java:118) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
com.edgytech.swingfast.ButtonBase.actionPerformed(ButtonBase.java:297)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6533) at
javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at
java.awt.Component.processEvent(Component.java:6298) at
java.awt.Container.processEvent(Container.java:2236) at
java.awt.Component.dispatchEventImpl(Component.java:4889) at
java.awt.Container.dispatchEventImpl(Container.java:2294) at
java.awt.Component.dispatchEvent(Component.java:4711) at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280) at
java.awt.Window.dispatchEventImpl(Window.java:2746) at
java.awt.Component.dispatchEvent(Component.java:4711) at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at
java.awt.EventQueue.access$500(EventQueue.java:97) at
java.awt.EventQueue$3.run(EventQueue.java:709) at
java.awt.EventQueue$3.run(EventQueue.java:703) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731) at
java.awt.EventQueue$4.run(EventQueue.java:729) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
What am I doing wrong?
When you encounter java.lang.NumberFormatException, it means it doesn't recognize the number format. i.e.
`java.lang.NumberFormatException: For input string: "//12.34.56.789"
In such case, the server name parser try its best effort to deal with both FQDN and IP address. In such case, the parser strip the url scheme (http/https/ftp,etc) and assume you enter IP address. It invoke try to parse number, but failed, because the prefix"//".
To fix this, please enter either IP address or fully qualified domain name (FQDN) without url scheme
based on the error message, it looks like you've configured the 'connection' wrong by including 'https' in the host string. try just '12.34.56.789:27017' instead and like another poster above mentioned, first check that you can even connect to the mongo host using something like:
telnet 12.34.56.789 27017
if your EC2 security group is set up wrong, the telnet command will just hang indefinitely, saying 'Trying 12.34.56.78...'
HTH

NoRouteToHostException / NoSuchHostException on remote JMX call

I'm having trouble making a remote JMX call to JBoss 6 on a Centos 5.6 server. I've previously been able to do this when running the same app on a Debian server.
./twiddle.sh --server=service:jmx:rmi:///jndi/rmi://SERVER:1090/jmxconnector invoke foo:service=bar baz
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
The same call succeeds if I run it locally on SERVER. I've opened port 1090 with iptables, and I can connect via telnet to SERVER:1090. hostname -i returns the correct IP address.
I've also tried starting JBoss with -Djava.rmi.server.hostname=localhost. If I do this, then I get a different exception:
Caused by: java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:279)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at org.jboss.console.twiddle.Twiddle.createMBeanServerConnection(Twiddle.java:322)
at org.jboss.console.twiddle.Twiddle.connect(Twiddle.java:331)
at org.jboss.console.twiddle.Twiddle.access$400(Twiddle.java:60)
at org.jboss.console.twiddle.Twiddle$1.getServer(Twiddle.java:217)
It turns out that in addition to port 1090, JMX/RMI also uses a dynamically allocated port, which gets blocked by the firewall. So, if it's appropriate, disable the firewall altogether, or else this seems to be an alternative (which I've not tried yet):
http://olegz.wordpress.com/2009/03/23/jmx-connectivity-through-the-firewall/
What I did was this:
Update the file activemq.xml and specify rmiServerPort.
<managementContext createConnector="true" connectorPort="SOME_PORT" rmiServerPort="SOME_OTHER" jmxDomainName="org.apache.activemq"/>
Allow both ports by updating your iptables entry, restart activemq and it should work.

How do I connect the NetBeans profiler to a specic remote instance

I have a remote GlassFish server that has a node agent configured. The instance I want to start in profiling mode is controlled by the node agent.
I've installed and calibrated the remote pack and I've modified my domain.xml for the specific instance as follows:
<profiler enabled="true" name="NetBeansProfiler">
<jvm-options>-agentpath:/home/glassfish/glassfish/profiler-server-6.0rc1-linux/lib/deployed/jdk16/linux/libprofilerinterface.so=/home/glassfish/glassfish/profiler-server-6.0rc1-linux/lib,5140</jvm-options>
</profiler>
Now at this point NetBeans tells you to start the domain with the --verbose command but in my case I'm trying to start an instance and "asadmin start-instance" doesn't support --verbose. I've checked the server.log but I'm not seeing any error nor any language that says it's waiting when I try to start the instances.
However, I think GlassFish is properly configured and my NetBeans setup is the issue. Where I think the issue might be is trying to specify the port. If I leave the port off, it just tries to connect forever. If I put the port on it just closes the dialog and the status shows "Inactive".
UPDATE:
It seems there might be a bug with GF2. After verifying everything and getting the server so that it was listening, the following exception is thrown
Could not load Logmanager "com.sun.enterprise.server.logging.ServerLogManager"
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.util.logging.LogManager$1.run(LogManager.java:166)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.(LogManager.java:156)
According to this URL, http://java.net/jira/browse/GLASSFISH-3256 it's a known issue and won't be fixed until GF3.
Anyway, my question was about how to connect to a specific instance and I think that was answered.
Do not include the port number in the hostname field. The port number is taken from the global profiler settings.