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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:24:48+00:00 2026-06-09T17:24:48+00:00

I try to use TJWS Embeddable Servlet Container to start RestEasy application using this

  • 0

I try to use TJWS Embeddable Servlet Container to start RestEasy application using this userguide http://docs.jboss.org/resteasy/docs/2.3.3.Final/userguide/html/RESTEasy_Embedded_Container.html#d0e2640

Application work correct in JBOSS7-AS. I want to use TJWS for debuging and unit testing, but have problem with dependency injection.

I create resource class UserResource, which using CDI to inject utility class UserManager:

@Path("users")
@SessionScoped
class UserResource {

  @Inject
  UserManager userManager; // simple interface and imlementation

  public UserResource() {} // constructor with no parameters for bean

    @Path("list")
    @GET
    public List<User> list() {
       List<User> userList = userManager.getList(); // NullPointerException
       return userList;
    }
}

Start TJWS in main:

public static void main(String[] args) throws IOException {
    TJWSEmbeddedJaxrsServer tjws = new TJWSEmbeddedJaxrsServer();
    tjws.setPort(9997);
    tjws.start();

    tjws.getDeployment().getRegistry().addPerRequestResource(User.class);
}

When i try to get http://localhost/users/list via browser, i get NullPointerException in UserResource.list() method, because userManager not injected and is null.

Is there any way to inject userManager?

  • 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-09T17:24:49+00:00Added an answer on June 9, 2026 at 5:24 pm

    TJWS is a standalone servlet container and web server that does not support EE annotations like @Inject. For the code to work you have to use EE container such as JBoss AS.

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

Sidebar

Related Questions

I try use gssapi32.dll in my application but I receive exception when app start
i try to use TBXML and getting this error TBXML class method +tbXMLWithURL not
I try to use this: xml2struct when I use this xml: <XMLname attrib1=Some value>
I have gotten some reports from users of crashes when try use my application
I'm writing a Java EE application using JBoss AS 6 and I have a
Hi i try use Nlog in with caliburn micro, I have use this tutorial
how to generate random number in this code? I try use $RANDOM, but the
When I'm taking my query using Ajax on jQuery, o try use the method
I try use this: $image = new JImage(); $image->loadFile($item->logo); $image->resize('208', '125'); $properties = JImage::getImageFileProperties($item->logo);
I have problems with PHP in Ubuntu 10.04. When I try use mysqli_result::fetch_all this

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.