My favorites | Sign in
Google
                
Details: Show all Hide all

Yesterday

  • 34 hours ago
    issue 392 (PrivateModule + @Inject(optional=true)) commented on by tnks.pub...@gmail.com   -   This caught me off-guard too. Could you reply to this thread with a short justification of the current implementation in light of missing documentation?
    This caught me off-guard too. Could you reply to this thread with a short justification of the current implementation in light of missing documentation?

Last 7 days

  • Dec 23, 2009
    InjectingProviders Wiki page commented on by ljh552   -   When the privider injection happens? I didnot see any binding for the user-defined privider. It seems that the GUICE create a provider on the run-time. How can we use our own defined privider under this circumstance?
    When the privider injection happens? I didnot see any binding for the user-defined privider. It seems that the GUICE create a provider on the run-time. How can we use our own defined privider under this circumstance?
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   `I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?` Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    `I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?` Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   'I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?' Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    'I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?' Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   {{{ I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? }}} Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    {{{ I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? }}} Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   {{{I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?}}} Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    {{{I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??????, CreditCardProcessor?????? interfaces and their implementations in the same package and JAR as the RealBillingService?????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?}}} Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService?????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog?????, CreditCardProcessor????? interfaces and their implementations in the same package and JAR as the RealBillingService????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---------------- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService?????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog?????, CreditCardProcessor????? interfaces and their implementations in the same package and JAR as the RealBillingService????? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---------------- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   adfasd adfasdf
    adfasd adfasdf
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog????, CreditCardProcessor???? interfaces and their implementations in the same package and JAR as the RealBillingService???? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService????, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog????, CreditCardProcessor???? interfaces and their implementations in the same package and JAR as the RealBillingService???? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService???, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog???, CreditCardProcessor??? interfaces and their implementations in the same package and JAR as the RealBillingService??? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??, CreditCardProcessor?? interfaces and their implementations in the same package and JAR as the RealBillingService?? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService??, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog??, CreditCardProcessor?? interfaces and their implementations in the same package and JAR as the RealBillingService?? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ---- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 22, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by ljh552   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService?, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog?, CreditCardProcessor? interfaces and their implementations in the same package and JAR as the RealBillingService? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ============================================-- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService?, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog?, CreditCardProcessor? interfaces and their implementations in the same package and JAR as the RealBillingService? client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ? ============================================-- Why I cannot, If I don't have the @Inject The system will throw exception and tell me cannot find the proper constructor. PS: I tested that only the constructor without the parameters and you declared obviously in the class will not need the annotation @Inject. This is the default constructor that GUICE invoke. PS2: my all the class is in the same package too!
  • Dec 21, 2009
    issue 372 (GuiceFilter breaks dispatching to jsp if jasper is being use...) commented on by burke.eric   -   I'm attaching a web app that demonstrates a problem dispatching to a static HTML file under the WEB-INF directory. I tried to make it easy to compile and run, see the README.txt in the ZIP file. The embedded JARs are from trunk in Guice Subversion on 12/21/2009, revision 1134
    I'm attaching a web app that demonstrates a problem dispatching to a static HTML file under the WEB-INF directory. I tried to make it easy to compile and run, see the README.txt in the ZIP file. The embedded JARs are from trunk in Guice Subversion on 12/21/2009, revision 1134
  • Dec 21, 2009
    issue 372 (GuiceFilter breaks dispatching to jsp if jasper is being use...) commented on by burke.eric   -   This fails if MyServlet is managed by Guice. If this is just a normal unmanaged servlet configured in web.xml, it works fine: @Singleton public class MyServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { req.getRequestDispatcher("/WEB-INF/protected_page.html").forward(req, res); } } In Tomcat I receive "HTTP Status 404 - /WEB-INF/protected_page.html" with description "The requested resource (/WEB-INF/protected_page.html) is not available."
    This fails if MyServlet is managed by Guice. If this is just a normal unmanaged servlet configured in web.xml, it works fine: @Singleton public class MyServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { req.getRequestDispatcher("/WEB-INF/protected_page.html").forward(req, res); } } In Tomcat I receive "HTTP Status 404 - /WEB-INF/protected_page.html" with description "The requested resource (/WEB-INF/protected_page.html) is not available."
  • Dec 21, 2009
    issue 382 (No source jars in maven repository) commented on by james.ravn   -   Sources please. :-)
    Sources please. :-)
  • Dec 21, 2009
    AOP (Intercepting methods with Guice) Wiki page commented on by vinay1069   -   {{{ ll }}}
    {{{ ll }}}

Last 30 days

  • Dec 18, 2009
    issue 421 (invalid sha digest on pom file in maven repo) commented on by bs1984   -   Thanks James, that did the trick. Looks like the issue will be cleared up in January (http://code.google.com/p/protobuf/issues/detail?id=126).
    Thanks James, that did the trick. Looks like the issue will be cleared up in January (http://code.google.com/p/protobuf/issues/detail?id=126).
  • Dec 18, 2009
    issue 421 (invalid sha digest on pom file in maven repo) commented on by james.s.cox   -   Looking at my ivysettings file, I see that I added <property name="ivy.checksums" value=""/> If I remember correctly, that caused ivy to skip the digest verification. This is acceptable for my purposes, but it probably won't be for a lot of enterprise folks.
    Looking at my ivysettings file, I see that I added <property name="ivy.checksums" value=""/> If I remember correctly, that caused ivy to skip the digest verification. This is acceptable for my purposes, but it probably won't be for a lot of enterprise folks.
  • Dec 18, 2009
    issue 421 (invalid sha digest on pom file in maven repo) commented on by bs1984   -   Is there a known Ivy workaround with respect to this issue?
    Is there a known Ivy workaround with respect to this issue?
  • Dec 17, 2009
    issue 421 (invalid sha digest on pom file in maven repo) commented on by rwallace1979   -   This issue is caused when using Maven 2.2 to deploy. It doesn't occur with Maven 2.1.
    This issue is caused when using Maven 2.2 to deploy. It doesn't occur with Maven 2.1.
  • Dec 17, 2009
    issue 421 (invalid sha digest on pom file in maven repo) commented on by rwallace1979   -   This seems to be an issue with all the guice artifacts in the maven repositories, not just the guice-2.0.pom. The jars have wrong checksums (both sha1 and md5) for guice and all the extensions. Google Collections 1.0-rc4 seems to suffer the same issue.
    This seems to be an issue with all the guice artifacts in the maven repositories, not just the guice-2.0.pom. The jars have wrong checksums (both sha1 and md5) for guice and all the extensions. Google Collections 1.0-rc4 seems to suffer the same issue.
  • Dec 15, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) Status changed by dhanji   -  
    Status: Invalid
    Status: Invalid
  • Dec 15, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) commented on by pjulien   -   This is invalid. While fiddling with Java EE 6 annotation, I deleted my web.xml file and the reference to guice servlet filter.
    This is invalid. While fiddling with Java EE 6 annotation, I deleted my web.xml file and the reference to guice servlet filter.
  • Dec 14, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) commented on by pjulien   -   I can confirm the guice filter does get executed. I will report a bug in glassfish and post the link here.
    I can confirm the guice filter does get executed. I will report a bug in glassfish and post the link here.
  • Dec 14, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) commented on by dhanji   -   Sounds like a problem with glassfish v3 then. Can you post it on their bug tracker and copy our mailing list please? GS2 is compliant with the servlet spec. Also please make sure to check your config and that GlassFish v3 allows you to map a filter to the default servlet.
    Sounds like a problem with glassfish v3 then. Can you post it on their bug tracker and copy our mailing list please? GS2 is compliant with the servlet spec. Also please make sure to check your config and that GlassFish v3 allows you to map a filter to the default servlet.
  • Dec 14, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) commented on by pjulien   -   Get 404, no other errors. The url I see from the http monitor is correct. If I switch out the use of guice for a web.xml entry, it works. If I switch out glassfish v3 for v2, instead of an entry in web.xml, it also works. I can also use a Java EE 6 annotation to make the servlet reachable
    Get 404, no other errors. The url I see from the http monitor is correct. If I switch out the use of guice for a web.xml entry, it works. If I switch out glassfish v3 for v2, instead of an entry in web.xml, it also works. I can also use a Java EE 6 annotation to make the servlet reachable
  • Dec 14, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) commented on by dhanji   -   Can you describe what exactly is failing? Any error messages would help too.
    Can you describe what exactly is failing? Any error messages would help too.
  • Dec 14, 2009
    issue 454 (ServletModule doesn't work with Glassfish v3) reported by pjulien   -   Take same project that works with Glassfish v2 and run under v3. None of the servlets setup from guice can be used.
    Take same project that works with Glassfish v2 and run under v3. None of the servlets setup from guice can be used.
  • Dec 11, 2009
    issue 453 (javadoc ServletModule unclear) reported by guido.helmers   -   Question about the javadoc (and internal workgs) for com.google.inject.servlet.ServletModule.configureServlets(). It says: "Dispatch Order - You are free to register as many servlets and filters as you like this way. They will be compared and dispatched in the order in which the filter methods are called. (... piece of code ...) This will traverse down the list of rules in lexical order." I find this a bit confusing. Are the rules traversed in the order in which they are defined by the programmer (top-down the mapping code in .configureServlets()), or in some kind of alphabetical ordering (my understanding of lexical was that it has something to do with a dictionary or an alphabet; but I may be wrong...). An experiment shows the mapping rules are applied in the order in which they are defined. In our case we had this: Map<String, String> params = new HashMap<String, String>(); params.put("applicationFactoryClassName", "org.apache.wicket.guice.GuiceWebApplicationFactory"); params.put("injectorContextAttribute", "com.google.inject.Injector"); bind(WicketServlet.class).in(Singleton.class); serve("/*").with(WicketServlet.class, params); serve("/monitor/statusPing").with(MonitorServlet.class); that is, one specific mapping followed by a /* mapping to the WicketServlet. With the above code, the /monitor/statusPing is never applied. When I put the /monitor/statusPing above the /* mapping it does work. So there's nothing lexical about it? I think it's also worth stating clearly in the Javadoc that the mapping rules are different from what the Servlet specs say (I think the Servlet specs say the container will first look for an exact match; followed by some more complex rules that aren't mentioned in guice-servlet.)
    Question about the javadoc (and internal workgs) for com.google.inject.servlet.ServletModule.configureServlets(). It says: "Dispatch Order - You are free to register as many servlets and filters as you like this way. They will be compared and dispatched in the order in which the filter methods are called. (... piece of code ...) This will traverse down the list of rules in lexical order." I find this a bit confusing. Are the rules traversed in the order in which they are defined by the programmer (top-down the mapping code in .configureServlets()), or in some kind of alphabetical ordering (my understanding of lexical was that it has something to do with a dictionary or an alphabet; but I may be wrong...). An experiment shows the mapping rules are applied in the order in which they are defined. In our case we had this: Map<String, String> params = new HashMap<String, String>(); params.put("applicationFactoryClassName", "org.apache.wicket.guice.GuiceWebApplicationFactory"); params.put("injectorContextAttribute", "com.google.inject.Injector"); bind(WicketServlet.class).in(Singleton.class); serve("/*").with(WicketServlet.class, params); serve("/monitor/statusPing").with(MonitorServlet.class); that is, one specific mapping followed by a /* mapping to the WicketServlet. With the above code, the /monitor/statusPing is never applied. When I put the /monitor/statusPing above the /* mapping it does work. So there's nothing lexical about it? I think it's also worth stating clearly in the Javadoc that the mapping rules are different from what the Servlet specs say (I think the Servlet specs say the container will first look for an exact match; followed by some more complex rules that aren't mentioned in guice-servlet.)
  • Dec 10, 2009
    GettingStarted (How to start doing dependency injection with Guice.) Wiki page commented on by adnem2000   -   I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog, CreditCardProcessor interfaces and their implementations in the same package and JAR as the RealBillingService client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?
    I am not sure I understand the need for this code: @Inject Injector injector; It seems to me that this is field injection to inject the Injector's dependencies ? I would think the injector would be bootstrapped and provided as a static reference for the entire application. So only one instance containing all the configuration is initialized once and broadcasted by one single static helper. I was also doing some testing and noticed that when I omitted the @Inject on the RealBillingService, my client code worked just fine when I ran the Junit. I thought that it wouldn't be able to find the dependencies of the constructor's args but it looks like that it did. That confuses me. Note that however, I put the TransactionLog, CreditCardProcessor interfaces and their implementations in the same package and JAR as the RealBillingService client. Could this be why Guice is able to find the proper constructor's args dependencies without the @Inject ?
  • Dec 08, 2009
    issue 452 (Make requestStaticInjection work for TypeListeners) reported by mburton   -   In some situations it's necessary to create custom injection annotations by using TypeListeners. Standard (non-static) injection works fine for members annotated with these custom annotations. However, requestStaticInjection() does not appear to work with TypeListeners. This leads to confusing and unexpected behavior for users of these annotations. It would be nice to if TypeListeners could work as well with static injection as they do with non-static injection. http://groups.google.com/group/google- guice/browse_thread/thread/710b7ecc3ef7e1dd/d032391809fb123a
    In some situations it's necessary to create custom injection annotations by using TypeListeners. Standard (non-static) injection works fine for members annotated with these custom annotations. However, requestStaticInjection() does not appear to work with TypeListeners. This leads to confusing and unexpected behavior for users of these annotations. It would be nice to if TypeListeners could work as well with static injection as they do with non-static injection. http://groups.google.com/group/google- guice/browse_thread/thread/710b7ecc3ef7e1dd/d032391809fb123a
  • Dec 08, 2009
    issue 372 (GuiceFilter breaks dispatching to jsp if jasper is being use...) commented on by tobiasapt   -   I've come up with a work around that works for Jasper. Jasper looks for a request attribute "org.apache.catalina.jsp_file" and uses that before it checks request.getServletPath(). I tried simply setting the attribute but it gets blown away at some point during during the request. public class JSPFixGuiceFilter extends GuiceFilter{ @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { request = new HttpServletRequestWrapper((HttpServletRequest)request){ @Override public Object getAttribute(String name) { if("org.apache.catalina.jsp_file".equals(name)){ return super.getServletPath(); } return super.getAttribute(name); } }; super.doFilter(request, response, filterChain); } }
    I've come up with a work around that works for Jasper. Jasper looks for a request attribute "org.apache.catalina.jsp_file" and uses that before it checks request.getServletPath(). I tried simply setting the attribute but it gets blown away at some point during during the request. public class JSPFixGuiceFilter extends GuiceFilter{ @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { request = new HttpServletRequestWrapper((HttpServletRequest)request){ @Override public Object getAttribute(String name) { if("org.apache.catalina.jsp_file".equals(name)){ return super.getServletPath(); } return super.getAttribute(name); } }; super.doFilter(request, response, filterChain); } }
  • Dec 03, 2009
    ExternalDocumentation (Blogs, articles, books on Guice.) Wiki page edited by limpbizkit   -   Revision r1134 Edited wiki page through web user interface.
    Revision r1134 Edited wiki page through web user interface.
  • Dec 03, 2009
    ExternalDocumentation (Blogs, articles, books on Guice.) Wiki page edited by limpbizkit   -   Revision r1133 Edited wiki page through web user interface.
    Revision r1133 Edited wiki page through web user interface.
  • Dec 02, 2009
    AppsThatUseGuice (a list of applications that use Guice) Wiki page commented on by eelco.hillenius   -   We're using it at http://www.teachscape.com/
    We're using it at http://www.teachscape.com/
  • Dec 01, 2009
    ServletModule (Using Guice Servlet and Binding Language) Wiki page commented on by marcmill   -   Huh?
    Huh?
  • Nov 29, 2009
    issue 450 (Binding an interface before binding the concrete class fails...) commented on by ron.gross   -   Odd, it doesn't reproduce.
    Odd, it doesn't reproduce.
  • Nov 28, 2009
    Motivation Wiki page commented on by technical0   -   *phasmal:* I completely agree with you. I have never understood why anyone would want to replace something a simple as the new operator with some kind of library and annotations. I would personally maintain that everything that you can do with Guice, you can also do in standard Java and in a much more concise way, as per your example. *limpbizkit:* I am at a loss to see how you can consider that elementary object construction can somehow become "out of control" or not "scale". Guice is a "solution" for something that was quite simply never a problem in the first place.
    *phasmal:* I completely agree with you. I have never understood why anyone would want to replace something a simple as the new operator with some kind of library and annotations. I would personally maintain that everything that you can do with Guice, you can also do in standard Java and in a much more concise way, as per your example. *limpbizkit:* I am at a loss to see how you can consider that elementary object construction can somehow become "out of control" or not "scale". Guice is a "solution" for something that was quite simply never a problem in the first place.
  • Nov 27, 2009
    issue 451 (Enhance intercepting of methods to allow modification of par...) Status changed by limpbizkit   -   Guice AOP supports changing the method parameters without modification. The array returned by methodInvocation.getArguments() is fully mutable: public class Scratch { public static void main(String[] args) throws InterruptedException, IOException { Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { bindInterceptor(Matchers.any(), Matchers.any(), new MethodInterceptor() { public Object invoke(MethodInvocation methodInvocation) throws Throwable { methodInvocation.getArguments()[0] = "bar"; return methodInvocation.proceed(); } }); } }); injector.getInstance(Scratch.class).print("foo"); } public void print(String p) { System.out.println(p); } }
    Status: Invalid
    Guice AOP supports changing the method parameters without modification. The array returned by methodInvocation.getArguments() is fully mutable: public class Scratch { public static void main(String[] args) throws InterruptedException, IOException { Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { bindInterceptor(Matchers.any(), Matchers.any(), new MethodInterceptor() { public Object invoke(MethodInvocation methodInvocation) throws Throwable { methodInvocation.getArguments()[0] = "bar"; return methodInvocation.proceed(); } }); } }); injector.getInstance(Scratch.class).print("foo"); } public void print(String p) { System.out.println(p); } }
    Status: Invalid
  • Nov 27, 2009
    issue 450 (Binding an interface before binding the concrete class fails...) commented on by limpbizkit   -   Could you attach a small testcase?
    Could you attach a small testcase?
  • Nov 27, 2009
    issue 451 (Enhance intercepting of methods to allow modification of par...) reported by chlupacek   -   Current Guice 2.0 implementation is fully AOP compliant, but there is significant leak in AOP MethodInterceptor interface I guess. If you want to pass to super method different parameters than the ones method has been originally called with, there is no chance to do that with AOP API. Therefore I would suggest to add conditional interface which will essentially encapsulate full CGI Interceptor interface, if possible. Please see suggested modifications as attached. Not sure if that is most optimal way to do it, but hopefully will give some inspiration to add this funtionality to framework... Thank you
    Current Guice 2.0 implementation is fully AOP compliant, but there is significant leak in AOP MethodInterceptor interface I guess. If you want to pass to super method different parameters than the ones method has been originally called with, there is no chance to do that with AOP API. Therefore I would suggest to add conditional interface which will essentially encapsulate full CGI Interceptor interface, if possible. Please see suggested modifications as attached. Not sure if that is most optimal way to do it, but hopefully will give some inspiration to add this funtionality to framework... Thank you
  • Nov 27, 2009
    3rdPartyModules (3rd party Guice addons) Wiki page edited by limpbizkit   -   Revision r1132 Edited wiki page through web user interface.
    Revision r1132 Edited wiki page through web user interface.
  • Nov 27, 2009
    issue 450 (Binding an interface before binding the concrete class fails...) commented on by ron.gross   -   This is not invalid, there is a real issue it's just not the one I originally reported - reread my previous comment. You can rename this issue to "A concrete class's provider is not lazy after binding the interface".
    This is not invalid, there is a real issue it's just not the one I originally reported - reread my previous comment. You can rename this issue to "A concrete class's provider is not lazy after binding the interface".
  • Nov 27, 2009
    issue 450 (Binding an interface before binding the concrete class fails...) Status changed by limpbizkit   -  
    Status: Invalid
    Status: Invalid
  • Nov 27, 2009
    issue 357 (Lazy singleton scope) commented on by py.ricau   -   It would be really nice to be able to define lazy singletons in PRODUCTION stage. You might find it not that useful in server apps, but I think it is quite needed for Guice on Android. And of course, the solution shouldn't involve any dynamic proxy (No AOP on Android ;-) ).
    It would be really nice to be able to define lazy singletons in PRODUCTION stage. You might find it not that useful in server apps, but I think it is quite needed for Guice on Android. And of course, the solution shouldn't involve any dynamic proxy (No AOP on Android ;-) ).
  • Nov 27, 2009
    issue 450 (Binding an interface before binding the concrete class fails...) commented on by ron.gross   -   Sorry, I was mistaken - the real problem is that in the first code sample, Foo's provider is called eagerly and not lazily. My test case involved binding IFoo to a mock and Foo to an 'error' provider that always throws an exception - I wanted to make sure nobody is using Foo instead of IFoo. In the first version, the binding itself invoked the provider.
    Sorry, I was mistaken - the real problem is that in the first code sample, Foo's provider is called eagerly and not lazily. My test case involved binding IFoo to a mock and Foo to an 'error' provider that always throws an exception - I wanted to make sure nobody is using Foo instead of IFoo. In the first version, the binding itself invoked the provider.