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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:12:21+00:00 2026-06-05T19:12:21+00:00

We are using GUICE framework as part of service layer. Now there is a

  • 0

We are using GUICE framework as part of service layer. Now there is a requirement on to build JAX-WS Web services. We have built the web services using JDK 1.6 JAX-WS API. But now, we are not able to use any of the GUICE resources as we Web Service is not guice managed.

We are using Guice 3.0. How do we achieve this?

Tried the following link
http://jax-ws-commons.java.net/guice/, but did not work out and finally got to know that this is compatible only with Guice 2.0 in some forum.

One more approach tried was
http://developian.blogspot.in/2008/11/google-guice-and-jax-ws.html,
But this internally will start using some of the sun API which are access restricted and hence I dont want to use…

Now what is the best approach or alternative any any other solution.

Please advice.

Thanks

  • 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-05T19:12:23+00:00Added an answer on June 5, 2026 at 7:12 pm

    Well, you could inject an EJB that holds the guice injector. This means, you may use an EJB in case you use Java EE. That EJB should be a Singleton an handles only the holding the injector. In case you want to inject something this is the bean you get the injector from. Of course you must create the injector when calling it the first time via Guice.createInjector(). When having the injector it is no problem injecting other classes with the method getInstance(Class clazz) of the injector. You must access the injector only in your webservice the first time you call a class that uses injection.

    Otherwise you could use a static injector within the webservice. Maybe that would be not as clean but it would work. This requires you to create the injector within the constructor. E.g. in an abstract service class all webservices depend on. Then you are able to access the injector in the service an do the same as described above.

    @Singleton
    public class InjectorHolder
    {
    private Injector injector;
    
       public GuiceInjectorHolder()
       {
            injector = Guice.createInjector(new Module())
       }
    }
    
        public Injector getInjector()
        {
        return injector;
        }
    
    }
    
    public abstract class AbstractService
    {
    @EJB
    InjectorHolder holder;
    
    public void method()
    {
    holder.getInjector().getInstance(clazz).doSomething();
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using guice with java play framework. i have a simple command interface,
So, I have an web-based application that is using the Wicket 1.4 framework, and
I am using Struts 1 framework and i have a query regarding the logic:iterate
I've been working on a web app using the CodeIgniter framework and I am
I am going to try to build a PHP website using a framework for
I have developed numerous websites using Codeigniter, but now have the need to migrate
i am developing a Rest Controller using Zend Framework and i have to use
I have started using Guice to do some dependency injection on a project, primarily
I have a web application in which we use JSF framework. I have been
I am trying to build a sample app using Monotouch. I have this configuration/setup

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.