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 7179361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:07:29+00:00 2026-05-28T17:07:29+00:00

Basically my log4mongo is logging user activity and i want to select one user

  • 0

Basically my log4mongo is logging user activity and i want to select
one user and view his log entries,

This code is working ok

BasicDBObject blogEntryDbObj = (BasicDBObject) 
mongo.getDB().getCollection("log").findOne(new BasicDBObject("_id", 
new ObjectId(blogEntryId))); 

but here im getting the error “Trying to map to an unmapped class:

log = morphia.fromDBObject(log.class, blogEntryDbObj); 

What should the package name be for the log class or maybe that
is irrelevant. I realize that probably my POJO is not correctly set up
but i cannot figure out what’s wrong.

The log4mongo document look like this.

{ 
  "_id" : ObjectId("4eecf4e4f9cb90f308193614"), 
  "timestamp" : new Date("Sat, 17 Dec 2011 21:00:36 GMT +01:00"), 
  "level" : "INFO", 
  "thread" : "Server.Connection:146.53.243.167:4570", 
  "message" : "setting RegistrationId for: zambe", 
  "loggerName" : { 
    "fullyQualifiedClassName" : "zambe.afa8cc37-4796-49c1- 
a175-05a8daf0a88c", 
    "package" : ["zambe", "afa8cc37-4796-49c1-a175-05a8daf0a88c"], 
    "className" : "afa8cc37-4796-49c1-a175-05a8daf0a88c" 
  }, 
  "fileName" : "PushUpdateRegistrationId.java", 
  "method" : "connect", 
  "lineNumber" : "61", 
  "class" : { 
    "fullyQualifiedClassName" : 
"com.carlsberg.server.PushUpdateRegistrationId", 
    "package" : ["com", "carlsberg", "server", 
"PushUpdateRegistrationId"], 
    "className" : "PushUpdateRegistrationId" 
  }, 
  "host" : { 
    "process" : "5832@ERIKSWEDMINI", 
    "name" : "ERIKSWEDMINI", 
    "ip" : "192.168.1.150" 
  } 
}

Here is my POJO im trying to map to

@Entity(value = "log") 
public class log 
{ 
    @Id private ObjectId id; 
    Date timestamp; 
    Level level; 
    String thread;
    String message; 

    @Embedded  
    LoggerName loggerName; 

    String fileName; 
    String method; 
    String lineNumber; 

    @Embedded("class") 
    LoggerClass loggerClass; 

    @Embedded
    MyHost host; 
} 

@Entity(noClassnameStored=true) 
@Embedded 
class LoggerName 
{ 
    String fullyQualifiedClassName; 
    @Property("package") 
    String[] _package; 
    String className; 

} 

@Entity(noClassnameStored=true) 
@Embedded 
class LoggerClass 
{ 
    String fullyQualifiedClassName; 
    @Property("package") 
    String[] _package; 
    String className; 

} 

@Entity(noClassnameStored=true) 
@Embedded 
class MyHost 
{ 
    String process; 
    String name;
    String ip;
} 
  • 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-28T17:07:29+00:00Added an answer on May 28, 2026 at 5:07 pm

    morphia.map is instance method. You need to morphia.map it on the same instance of Morphia to get morphia.fromDBObject to work

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

Sidebar

Related Questions

Basically I want to create a user control in code behind, DataBind() it and
Basically what I want to do it this: a pdb file contains a location
Basically I have a loop incrementing i, and I want to do this: var
Basically I am writing a simple bit of code to increment every one second
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I have some code to check a specific directory to see if an
Basically I want to know how to set center alignment for a cell using
Basically what I want to do is display an email using javascript to bring
Basically I want to replicate the page changing effect found here, at http://timvandamme.com/ But
basically i want to hold a parameter that retrieve value from $.post() call like

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.