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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:02:40+00:00 2026-06-05T09:02:40+00:00

I am making a web-based application using SEAM and JBOSS. I am trying to

  • 0

I am making a web-based application using SEAM and JBOSS. I am trying to make a converter for a drop-down box, but whenever I use entityManager within the converter class I get a NullPointerException. I have spent a couple days trying to figure this help and any help would be appreciated

Here is some of my code. If anymore is needed, just let me know:

Converter Class:

package edu.uwrf.iss.flowershop.entity;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.servlet.ServletContext;
import javax.swing.JOptionPane;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Scope;

public class EmpConverter implements Converter {

@In
private EntityManager entityManager;

public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {
    int num = Integer.parseInt(arg2);
    entityManager.refresh(getClass());
    Query query = entityManager.createQuery("SELECT e FROM FlowerStoreDelivery WHERE e.deliveryId LIKE :num")
                    .setParameter("num", num);
    JOptionPane.showMessageDialog(null, query.getResultList());
    FlowerStoreEmployee emp = entityManager.find(FlowerStoreEmployee.class, arg2);
    return emp;
}

public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) throws ConverterException {

return Integer.toString(((FlowerStoreEmployee)arg2).getEmployeeId());
}
}

And this is where the converter is used:

    <my:dropdown label="Employee ID" id="emp" value="#{deliveryPort.emp}"required="false">
                    <f:converter converterId="EmpConverter" />
                    <s:selectItems value="#{deliveryPort.empList}" var="emp" label="#{emp.employeeId} #{ emp.nameFirst}"/> 
                </my:dropdown>
  • 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-05T09:02:42+00:00Added an answer on June 5, 2026 at 9:02 am

    I have figured the problem out. There was a missing line of code in my components.xml file. Thank you all for your responses.

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

Sidebar

Related Questions

I'm making a web based project management application using MySQL and PHP that uses
We're about to deploy a Java web application built using JBoss Seam as the
I'm making an application (web based) using flex and i have a requirment to
http://pastebin.com/FPkZhxAQ Hi, I am making a WCF service/client application. WCF Service is web based.
I am making a web based code editor and am using a textarea for
I'm making a web based game to teach users some basic Welsh using the
I am making a web-based logviewer using extjs. I would like new log-lines to
I am making an web application using silverlight 3.0 . In that application i
As many developers will be I'm producing web based application that are using AJAX
I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I

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.