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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:49:28+00:00 2026-05-21T12:49:28+00:00

I have a standalone application with embedded Jetty and Wicket. I’d like to use

  • 0

I have a standalone application with embedded Jetty and Wicket.
I’d like to use CDI for injection.

So I’ve found http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#d0e5286
and now I’m trying to add this programatically, but it’s quite complex.

How do I code that?

Other sources I’ve found are:

  • http://osdir.com/ml/java.jetty.support/2007-02/msg00198.html
  • http://docs.codehaus.org/display/JETTY/JNDI

So far I have:

  Server server = new Server( 8080 );
  Context ctx = new Context( server, "/", Context.NO_SECURITY | Context.SESSIONS );


  try {
     //BeanManager
     new org.mortbay.jetty.plus.naming.Resource( ctx, "BeanManager", 
        new javax.naming.Reference(
           "javax.enterprise.inject.spi.BeanManager",
           "org.jboss.weld.resources.ManagerObjectFactory", null )
     );
  } catch ( NamingException ex ) {
     log.error(...);
  }


  // Wicket.
  final ServletHolder wicketSH = new ServletHolder( new MyReloadingWicketServlet() );
  wicketSH.setInitParameter( "applicationClassName", WicketApplication.class.getName() );
  ctx.addServlet( wicketSH, "/*" );
  • 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-21T12:49:28+00:00Added an answer on May 21, 2026 at 12:49 pm

    Adding a resource-env-ref programmatically doesn’t make sense. The point of JavaEE refs is to separate the developer from the deployer: the developer declares a reference, and the deployer binds the reference to a managed resource in the environment. If you don’t have or need a deployer role, then you don’t need a resource-env-ref either: simply look up the target object yourself (for CDI integration, I think that would be an @Produces method).

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

Sidebar

Related Questions

I need to write a standalone Java application which will have a embedded HTTP
Does MSTest have standalone GUI similar to nUnit that lets me use it and
I have a standalone enum type defined, something like this: package my.pkg.types; public enum
I have a simple standalone application written in Visual Basic that I'm porting to
I have an application where the html/javascript code executes fine in a standalone browser
I have created an standalone application in which i want that when the user
I have developed a standalone application using java, in which I am executing an
Iam coding a dating application for facebook. The application has to have a standalone
I have a standalone Java application written with Apache Camel which I want to
I have implemented a standalone java application which uses the swing framework for GUI.As

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.