Connect from uMongo to EC2 - mongodb

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

Related

hbase rest api start error

I am trying to start the rest API on our hbase installation but keep getting the following error, even when specifying the port.
# hbase rest start --p 8087
java.net.BindException: Port in use: 0.0.0.0:8085
at
org.apache.hadoop.hbase.http.HttpServer.openListeners(HttpServer.java:1014)
at org.apache.hadoop.hbase.http.HttpServer.start(HttpServer.java:950)
at org.apache.hadoop.hbase.http.InfoServer.start(InfoServer.java:90)
at org.apache.hadoop.hbase.rest.RESTServer.main(RESTServer.java:248)
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:437)
at sun.nio.ch.Net.bind(Net.java:429)
at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannel
Connector.java:216)
at
org.apache.hadoop.hbase.http.HttpServer.openListeners(HttpServer.java:1009)
... 3 more
REST port (--p option) is 8080. 8085 - is port linked as hbase.rest.info.port (from config).
Use --infoport 8087 argument to modify it.

Error Connecting To Remote Host In 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

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.

eclipse + tomcat error

I get the following error when trying to launch tomcat (6.0.20) from within eclipse (galileo)
SEVERE: Error initializing endpoint java.lang.Exception: Socket bind
failed: [730014] The system detected an invalid pointer address in
attempting to use a pointer argument in a call. at
org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:623) at
org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:107)
at
org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
at org.apache.catalina.startup.Catalina.load(Catalina.java:535) at
org.apache.catalina.startup.Catalina.load(Catalina.java:555) 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.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
What on earth does this mean, and how can I fix it? I have searched for ages but with no success.
netstat reveals nothing running on any ports in the 8000 range, (all tomcat ports are there), and right-clicking the shortcut and selecting 'run as administrator' doesn't help :(
Tomcat is trying to use port 8080, so it can't be a permissions error with that port, and the
'The system detected an invalid pointer address in attempting to use a
pointer argument in a call. '
indicates that it is not a problem with duplicate things trying to access the same ports, but something much stranger.
Odds are:
1) You are already running another web sever on that port (8080?) in which case you should shut it down and then try restarting tomcat in Eclipse.
or
2) Eclipse is running as a non-root user and trying to bind to port 80. In that case, edit tomcat's conf/server.xml and change "80" to "8080" wherever you see it (2 or 3 places I think)