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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:53:15+00:00 2026-05-15T20:53:15+00:00

I have a JavaEE6-application running on Glassfish v3.0.1 with EJB 3.1 (app is packaged

  • 0

I have a JavaEE6-application running on Glassfish v3.0.1 with EJB 3.1 (app is packaged as WAR), and all my EJBs are @LocalBeans.
Currently, i’m writing a FacesConverter for use in JSF2, in which i need the EntityManager to get an Entity back from an id.

Now i wonder, which is the best and cleanest way to get the Entitymanager inside the FacesConverter, now that we are on JEE6? Or can i even access an EJB through the Expression Language? And Weld/CDI doesn’t work inside a FacesConverter, or does it?

@FacesConverter(value="subscriptionListConverter")
class SubscriptionListConverter extends Converter {
  public Object getAsObject(FacesContext ctx, UIComponent comp, String value) {
    var id:Long = Long.parseLong(value);
    // How to get the entitymanager?
    return em.find(User.getClass, id);
  }

  public String getAsString(ctx:FacesContext, comp:UIComponent, value:Object) {...}
}

Sorry i hope this is no duplicate, but most cases i saw where slightly different and didn’t help me much.

  • 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-15T20:53:16+00:00Added an answer on May 15, 2026 at 8:53 pm

    Ok after some trying around i successfully got an EJB with a manual lookup:

    Context ctx = new InitialContext();
    UserEJB userEJB = (UserEJB) ctx.lookup("java:global/teachernews/" + UserEJB.class.getName())
    

    Looks okay, but anyway, if there are some other interesting approaches, feel free to post them.

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

Sidebar

Related Questions

I have a JavaEE6 application, consisting of Web stuff and EJBs and which is
I currently have a web application that is utilizing Spring Security hosted on a
I have a hello-world style java ee application using maven3 glassfish3 and javaee6. I
I'm using EclipseLink in Glassfish with my JavaEE application and have some java.util.Locale-columns in
I have an EAR application which contains an MDB and a WAR. In this
I have a JavaEE 1.4 web application running on WebSphere Application Server 6.0. In
I'm writing some application for GlassFish 2.1.1 (JavaEE 5, JPA 1.0, as far as
I have a problem with glassfish to serve swf files. In my application there
i'm deploying an application making use of EJB. I'have wrote an EJB and a
Previously, I have a Google App Engine application ( jstock-static ), which is only

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.