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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:26:39+00:00 2026-05-14T01:26:39+00:00

I am using spring to initialise my beans. I have configured a bean which

  • 0

I am using spring to initialise my beans. I have configured a bean which I intend to use as a factory bean.

<bean id="jsServicesFactory" class="x.y.z.JSServicesFactory" />

It is a very basic class – which has 4 getter methods. One example is

 public final PortletRegistry getPortletRegistry() {
    PortletRegistry registry = (PortletRegistry) JetspeedPortletServices
        .getSingleton().getService("PortletRegistryComponent");
    return registry;
}

I have a 2nd bean which uses this factory beans to set one of its properties

<bean id="batchManagerService" class="x.y.z.BatchManagerService">
...
<property name="portletRegistry">
   <bean factory-bean="jsServicesFactory" factory-method="getPortletRegistry" />
</property>
     ...

When I start my server in RAD, this all works perfectly. However when I deploy to Linux I sometimes get the following error

ERROR org.springframework.web.context.ContextLoader – Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘batchManagerService’ defined in ServletContext resource [/WEB-INF/context/root/batchManagerContext.xml]: Cannot create inner bean ‘jsServicesFactory$created#70be70be’ while setting bean property ‘portletRegistry’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jsServicesFactory$created#70be70be’ defined in ServletContext resource [/WEB-INF/context/root/batchManagerContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public final org.apache.jetspeed.components.portletregistry.PortletRegistry x.y.z.JSServicesFactory.getPortletRegistry()] threw exception; nested exception is java.lang.NullPointerException

I have tried adding depends-on=”jsServicesFactory” to my bean batchManagerService but it didn’t work.

Any ideas?

Thanks

  • 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-14T01:26:39+00:00Added an answer on May 14, 2026 at 1:26 am

    The clue is in the stack trace, albeit buried deep in it:

    nested exception is
    java.lang.NullPointerException

    Something in your code is throwing a NPE during initialization of the beans, and this is propagating up the stack, being re-wrapped in other exceptions as it goes.

    Find the root cause of that NPE, and that should fix the problem.

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

Sidebar

Related Questions

I'm using Spring.net with NHiberante (HibernateTemplate) to implement my DAO's. I also have some
I'm using Spring's support for JDBC. I'd like to use JdbcTemplate (or SimpleJdbcTemplate) to
We have started using Spring framework in my project. After becoming acquainted with the
I am using Spring MVC to build my web application, and I have a
I'm using Spring's ContextLoaderListener to initialise a web services client, but if the wsdl
I am using Spring Forms for my web application. For nested properties, the form
I've been using spring for some time, but I always wondered how does it
We're using Spring 2.5.4/Hibernate 3.2/Websphere Application Server 6.1.0.17. We've deployed the application on an
We're using Spring/Hibernate on a Websphere Application Server for AIX. On my Windows machine,
I`m developing an application using Spring WebFlow 2, Facelets and JSF. One of my

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.