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

  • Home
  • SEARCH
  • 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 4548148
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:11:07+00:00 2026-05-21T16:11:07+00:00

I just deployed a Spring web application onto Glassfish. This app contains an injected

  • 0

I just deployed a Spring web application onto Glassfish.
This app contains an injected Spring bean for the Mongo object, which is pretty basic, it just looks like this:

<bean id="mongo" class="com.mongodb.Mongo">
    <constructor-arg value="127.0.0.1" />
    <constructor-arg value="27017" />
</bean>

I fire up my web app, then use this Mongo object to query the db and insert records and whatnot.. and everything works fine.

But in my server.log file I get and endless stream of SEVERE error messages. They are NullPointerExceptions and IOExceptions. They appear to have something to do with ReplicaSetStatus, but I don’t know why it keeps trying to connect, is it turn on be default?

Does anyone know what causes these?
How can I fix the problem, or stop whatever is causing them?

// EDIT:
The exceptions start immediately after I deploy my application. But they do not stop when I disable my application, or even undeploy it.

These messages just get written constantly, but from what I can see theres only 4 types of errors:

[#|2011-04-22T17:49:40.818+0900|SEVERE|glassfish3.1|com.mongodb.ReplicaSetStatus|_ThreadID=37;_ThreadName=Thread-1;|can't update node: 27017:27017
java.lang.NullPointerException
    at com.mongodb.OutMessage.reset(OutMessage.java:73)
    at com.mongodb.OutMessage.<init>(OutMessage.java:51)
    at com.mongodb.OutMessage.query(OutMessage.java:38)
    at com.mongodb.DBPort.findOne(DBPort.java:127)
    at com.mongodb.DBPort.runCommand(DBPort.java:138)
    at com.mongodb.ReplicaSetStatus$Node.update(ReplicaSetStatus.java:149)
    at com.mongodb..updateAll(ReplicaSetStatus.java:314)
    at com.mongodb.ReplicaSetStatus$Updater.run(ReplicaSetStatus.java:263)
|#]

[#|2011-04-22T17:49:40.818+0900|SEVERE|glassfish3.1|com.mongodb.ReplicaSetStatus|_ThreadID=37;_ThreadName=Thread-1;|can't update node: localhost:27017
java.lang.NullPointerException
    at com.mongodb.OutMessage.reset(OutMessage.java:73)
    at com.mongodb.OutMessage.<init>(OutMessage.java:51)
    at com.mongodb.OutMessage.query(OutMessage.java:38)
    at com.mongodb.DBPort.findOne(DBPort.java:127)
    at com.mongodb.DBPort.runCommand(DBPort.java:138)
    at com.mongodb.ReplicaSetStatus$Node.update(ReplicaSetStatus.java:149)
    at com.mongodb.ReplicaSetStatus.updateAll(ReplicaSetStatus.java:314)
    at com.mongodb.ReplicaSetStatus.ensureMaster(ReplicaSetStatus.java:306)
    at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:383)
    at com.mongodb.ReplicaSetStatus$Updater.run(ReplicaSetStatus.java:275)
|#]

[#|2011-04-22T17:49:41.676+0900|SEVERE|glassfish3.1|com.mongodb.ReplicaSetStatus|_ThreadID=48;_ThreadName=Thread-1;|can't update node: 127.0.0.1:27017
java.io.IOException: couldn't connect to [/127.0.0.1:27017] bc:java.net.ConnectException: Connection refused: connect
    at com.mongodb.DBPort._open(DBPort.java:206)
    at com.mongodb.DBPort.go(DBPort.java:94)
    at com.mongodb.DBPort.go(DBPort.java:75)
    at com.mongodb.DBPort.findOne(DBPort.java:129)
    at com.mongodb.DBPort.runCommand(DBPort.java:138)
    at com.mongodb.ReplicaSetStatus$Node.update(ReplicaSetStatus.java:149)
    at com.mongodb.ReplicaSetStatus.updateAll(ReplicaSetStatus.java:314)
    at com.mongodb.ReplicaSetStatus.ensureMaster(ReplicaSetStatus.java:306)
    at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:383)
    at com.mongodb.ReplicaSetStatus$Updater.run(ReplicaSetStatus.java:275)
|#]

[#|2011-04-22T17:49:41.676+0900|SEVERE|glassfish3.1|com.mongodb.ReplicaSetStatus|_ThreadID=48;_ThreadName=Thread-1;|can't update node: 27017:27017
java.io.IOException: couldn't connect to [/0.0.105.137:27017] bc:java.net.SocketException: Network is unreachable: connect
    at com.mongodb.DBPort._open(DBPort.java:206)
    at com.mongodb.DBPort.go(DBPort.java:94)
    at com.mongodb.DBPort.go(DBPort.java:75)
    at com.mongodb.DBPort.findOne(DBPort.java:129)
    at com.mongodb.DBPort.runCommand(DBPort.java:138)
    at com.mongodb.ReplicaSetStatus$Node.update(ReplicaSetStatus.java:149)
    at com.mongodb.ReplicaSetStatus.updateAll(ReplicaSetStatus.java:314)
    at com.mongodb.ReplicaSetStatus.ensureMaster(ReplicaSetStatus.java:306)
    at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:383)
    at com.mongodb.ReplicaSetStatus$Updater.run(ReplicaSetStatus.java:275)
|#]
  • 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-05-21T16:11:08+00:00Added an answer on May 21, 2026 at 4:11 pm

    Change your Mongo bean definition in Spring context file as here:

        <constructor-arg value="${db.host}" type="java.lang.String" />
        <constructor-arg value="${db.port}" type="int" />
    

    If you omit type attributes, another Mongo class constructor is invoked, where arguments are instances of com.mongodb.ServerAddress type, and 27017 is treated as a hostname and InetAddress.getAllByName( host ) resolves to this IP 0.0.105.137.

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

Sidebar

Related Questions

I just deployed some changes to my web app, restarted IIS, and suddenly I'm
I have what seems like a simple problem. I have a Spring web app,
Currently all web apps are deployed using seperate config files: <!-- <import bean.... production/>
Recently deployed my web app on Windows Server2008, IIS7 (with Office installed). After chasing
Just found this out, so i am answering my own question :) Use a
I have a very large problem. I've written a large app using Flex3/Tomcat/BlazeDS/Spring that
I have developed an application using .net 3.5 and have deployed it as an
I'm currently working on implementing the public API of our web application. The application
The Spring configuration I am using contains the definition of a persistenceUnitPostProcessor within my
Just what the title says, I need to change the password for an existing

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.