Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8284941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:17:37+00:00 2026-06-08T11:17:37+00:00

I have setup a MongoDB instance on AWS and am trying to connect to

  • 0

I have setup a MongoDB instance on AWS and am trying to connect to it from another AWS instance where my web app is installed.

The following is the contents of my jdoconfig.xml file:

<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">

    <persistence-manager-factory name="MY-PMF">
        <property name="javax.jdo.PersistenceManagerFactoryClass"
            value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory" />
        <property name="javax.jdo.option.ConnectionURL" value="mongodb://ec2-[...].eu-west-1.compute.amazonaws.com:27017/mydb" />
        <property name="javax.jdo.option.Mapping" value="mongodb" />
        <property name="javax.jdo.option.ConnectionUserName" value="myuser" />
        <property name="javax.jdo.option.ConnectionPassword" value="mypassword" />
        <property name="javax.jdo.option.Optimistic" value="false" />
        <property name="datanucleus.autoCreateSchema" value="true" />
    </persistence-manager-factory>
</jdoconfig>

However, the web app cannot connect to the MongoDB instance. The following are error messages from the logs:

com.mongodb.MongoException$Network: can't call something : localhost/127.0.0.1:27017//ec2-[...].eu-west-1.compute.amazonaws.com:27017/mydb
    at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:226)
    at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:313)
    at com.mongodb.DB.command(DB.java:174)
    at com.mongodb.DB.command(DB.java:158)
    at com.mongodb.DB.command(DB.java:198)
    at com.mongodb.DB.command(DB.java:144)
    at com.mongodb.DB._doauth(DB.java:555)
    at com.mongodb.DB.authenticate(DB.java:492)
    at org.datanucleus.store.mongodb.ConnectionFactoryImpl$ManagedConnectionImpl.getConnection(ConnectionFactoryImpl.java:200)
    at org.datanucleus.store.mongodb.MongoDBStoreManager.addClasses(MongoDBStoreManager.java:127)
    at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:1137)
    at org.datanucleus.ObjectManagerImpl.newObjectId(ObjectManagerImpl.java:3310)
    at org.datanucleus.api.jdo.JDOPersistenceManager.newObjectIdInstance(JDOPersistenceManager.java:1627)
    at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1749)
    at com.myapp.server.auth.MyActionHandler.execute(MyActionHandler.java:67)
    at com.myapp.server.auth.MyActionHandler.execute(MyActionHandler.java:1)
    at com.gwtplatform.dispatch.server.AbstractDispatchImpl.doExecute(AbstractDispatchImpl.java:153)
    at com.gwtplatform.dispatch.server.AbstractDispatchImpl.execute(AbstractDispatchImpl.java:111)
    at com.gwtplatform.dispatch.server.AbstractDispatchServiceImpl.execute(AbstractDispatchServiceImpl.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
    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:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
    at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
    at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
    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:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: couldn't connect to [localhost/127.0.0.1:27017] bc:java.net.ConnectException: Connection refused
    at com.mongodb.DBPort._open(DBPort.java:222)
    at com.mongodb.DBPort.go(DBPort.java:111)
    at com.mongodb.DBPort.call(DBPort.java:78)
    at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:217)
    ... 55 more

It looks like the ConnectionURL is not correct; DataNucleus JDO implementation is trying to connect to localhost instead of the instance where my DB is located.

Can anyone show me what the correct ConnectionURL should look like or if you think the problem is elsewhere point me to it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:17:38+00:00Added an answer on June 8, 2026 at 11:17 am

    You mean you haven’t specified the connectionURL correctly, as per
    http://www.datanucleus.org/products/accessplatform_3_1/mongodb/support.html

    I’d expect something more like “mongodb:servername:/mydb” … as per the doc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup hadoop on top of mongodb using hadoop-mongodb driver. Currently I can
I have setup airbrake in my app but it doesn't seem to log any
I have setup an app project and a static project in a workspace in
I have setup some simple associations in my rails app: resources :properties do resources
I have setup Codeigniter on my server and I installed Grocery crud on it.
Switching over from sqlite to MongoDB and I followed all of the setup/configuration settings
Rails 3.2.1 app name: demo database: mongoDB with mongoid I have this scaffolding set
I have setup for Django non-rel with Mongodb as backend. In models, I used
I have a logging setup in python application that logs into file and MongoDB.
I currently have a mongoDB setup with a mongos server, a config server, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.