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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:44:56+00:00 2026-06-15T05:44:56+00:00

I am having a problem while persisting a class. I have a class called

  • 0

I am having a problem while persisting a class. I have a class called Scraper which uses an interface called Paginator. There are several implementations of the Paginator interface which will be instantiated at runtime. So the structure looks like this:

class Scraper {

    //some code

    Paginator paginator

    //more code

    def Scraper(Paginator paginator){
        this.paginator = paginator
    }
}

and then there are the concrete implementations of the paginator interface lets say paginatorA and paginatorB. So now I am trying to do the following:

PaginatorA p = new PaginatorA()
Scraper s = new Scaper(p)

s.save(flush:true)

…and what it get is:

Error Error executing script TestApp:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name     'mongoDatastore': Cannot resolve reference to bean 'mongoMappingContext' while setting bean property 'mappingContext';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoMappingContext': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException (Use --stacktrace to see the full trace)

Can anybody tell me what to make of this? I guess it has something to do with the Mapper because it doesn’t know which concrete Paginator to use or how to persist it? If that is the case then how can I tell the framework what to do? I tried to come up with a solution for hours now and am really frustrated so any help would be really really appreciated.

Oh btw I also tried implementing against the concrete implementation (PaginatorA) … this works perfectly fine since my assumption that it has something to do with the paginator interface.

Thanks for any response…

  • 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-15T05:44:57+00:00Added an answer on June 15, 2026 at 5:44 am

    The error is bad, you should probably raise a JIRA issue for that, but fundamentally there are 2 problems I can see with the code:

    1. Your persistent classes must have a public no-args constructor as per any JavaBean, by adding a constructor that takes your interface, you are no longer providing one

    2. Your Scraper class needs to mark the ‘Paginator’ as transient to tell the persistence engine not to attempt to persist the ‘paginator’ property. Since this a custom interface it will not know how to persist it.

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

Sidebar

Related Questions

I'm having a problem while using constructors with a Groovy class. I have a
I have a flash file menu i am having problem while link it to
Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby
Me and my friend having a problem while doing a homework assignment. We have
I'm having a problem while trying to dynamically change a table cell's styling class
I am having a problem while deserializing an XML: System.InvalidOperationException was unhandled Message=There is
While dock and undock ..I am having problem in TabText I have 5 panels
Having a problem while deserializing a number of objects stored as BLOBs in a
I'm having an odd problem while deploying a Django site using Fabric. I've configured
I've been having this problem for a while and it's driving me nuts. I'm

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.