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

The Archive Base Latest Questions

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

I have two web jsf projects which potentially could share some classes and beans,

  • 0

I have two web jsf projects which potentially could share some classes and beans, to reduce code duplicates.

One is a potential JNDI-ServiceLocator application scoped Bean. (Both web projects access RemoteBeans from same Host)

JNDI – ServiceLocator Bean:

@ManagedBean(name = "jndiServiceLocatorBean")
@ApplicationScoped
public class JndiServiceLocatorBean implements Serializable
{
    // code to cache jndi references
}

Abstract class with Bean as ManagedProperty:

public abstract class AJndiServiceLocator
{
    @ManagedProperty(value = "#{jndiServiceLocatorBean}")
    protected JndiServiceLocatorBean jndiServiceLocatorBean = null;

    public void setJndiServiceLocatorBean(final JndiServiceLocatorBean jndiServiceLocatorBean)
    {
        this.jndiServiceLocatorBean = jndiServiceLocatorBean;
    }
}

Example Bean from one of the projects:

@ManagedBean(name = "testBean")
@ApplicationScoped
public class TestBean extends AJndiServiceLocator implements Serializable
{
    // bean code - can now retrieve remote bean interfaces 
    // from super class
}

This code works as expected if the first classes JndiServiceLocatorBean and AJndiServiceLocator are in the source folder of the project.

But it does not works if I outsource those two classes into a subproject that is shared between both web projects. (Included on build path and marked as deployment entry.)

Injection Exception that occurs:

Schwerwiegend: Error Rendering View[/index.xhtml]
com.sun.faces.mgbean.ManagedBeanCreationException: Bei der Ressourcen-Einspeisung auf dem verwalteten Bean appBean ist ein Fehler aufgetreten.
    at com.sun.faces.mgbean.BeanBuilder.invokePostConstruct(BeanBuilder.java:229)
    at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:105)
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
  • 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-12T05:56:52+00:00Added an answer on June 12, 2026 at 5:56 am

    JSF won’t scan every single JAR in the entire classpath for JSF artifacts, that would have been a very expensive job in a large webapp with tens of JARs. JSF will only scan JARs in /WEB-INF/lib folder containing a JSF 2.0 compatible /META-INF/faces-config.xml file.

    Ensure that your JAR conforms this.

    • It must be in /WEB-INF/lib.
    • It must have a /META-INF/faces-config.xml with a JSF 2.0 compatible root declaration.

    See also:

    • Structure for multiple JSF projects with shared code
    • JSF facelets template packaging
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My web application has two search pages - search1.jsf and search2.jsf - which share
I have two web pages which work basically the same, code-wise, but one of
I have two web application projects which are related. One is the website itself
I have two web application projects (project A and project B) in the same
OK I have two web projects WebProject1 & WebProject2. Both require database connectivity so
I have two web applications in ASP.NET which are quite the same (same business
I have two web forms which are filled in by the user. They contain
My question is pretty simple: If you have two web-application components: Server-side (secret-capable) code
I have got a web application which is speparated in a GUI (JSF 2.0,
I have two web applications, which I want to be running under the one

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.