GWTP & Singleton

144 views
Skip to first unread message

Лешик Иванов

unread,
Apr 21, 2015, 6:23:54 PM4/21/15
to gwt-pl...@googlegroups.com

I have simple presenter. Announce the call to the class of singleton

private RandomString randomString = RandomString.getInstance();

When assembling maven I have error

[INFO]             [ERROR] Error injecting by.gwttest.client.client.application.packet.PacketPagePresenter$MyProxy: Unable to create or inherit binding: No @Inject or default constructor found for by.gwttest.client.client.application.packet.PacketPagePresenter$MyProxy
[INFO]   Path to required node:
[INFO] 
[INFO] by.gwttest.client.client.application.packet.PacketPagePresenter$MyProxy [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:121)]
[INFO] 
[INFO]             [ERROR] Error injecting by.gwttest.client.client.application.packet.PacketPageView$Binder: Unable to create or inherit binding: No @Inject or default constructor found for by.gwttest.client.client.application.packet.PacketPageView$Binder
[INFO]   Path to required node:
[INFO] 
[INFO] by.gwttest.client.client.application.packet.PacketPageView [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:120)]
[INFO]  -> by.gwttest.client.client.application.packet.PacketPageView$Binder [@Inject constructor of by.gwttest.client.client.application.packet.PacketPageView]
[INFO] 
[INFO]    [ERROR] Errors in 'gen/com/gwtplatform/mvp/client/DesktopGinjectorProvider.java'
[INFO]       [ERROR] Line 8: Failed to resolve 'com.gwtplatform.mvp.client.DesktopGinjector' via deferred binding

RandomString ...

    private RandomString() {

    }

    private static class RandomStringHolder {
        private final static RandomString instance = new RandomString();
    }

    public static RandomString getInstance() {
        return RandomStringHolder.instance;
    }
...

With what it can be connected? Without declaring RandomString project going

Tushar Bhasme

unread,
Apr 25, 2015, 1:15:26 AM4/25/15
to gwt-pl...@googlegroups.com
Can you provide more info? Can you share the presenter how you coded it and where in it are you creating the randomString. The error can come due to many reasons- primarily if the binding fails. Are you sure you have binded the presenter correctly in presenter module? If yes, there will be some other error causing the binding the fail. Is this the full error stack or was there more to it?

Christian Goudreau

unread,
Apr 27, 2015, 9:46:39 AM4/27/15
to gwt-pl...@googlegroups.com
That kind of stack trace happens most of the time when the present isn't correctly bound or written, could you provide the presenter, the view and the gin module binding?

Christian Goudreau | CEO - Président

--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Лешик Иванов

unread,
Apr 27, 2015, 5:12:57 PM4/27/15
to gwt-pl...@googlegroups.com
Error was in this code

	private String convertMStoTime(long millis) {
		//return null;
		 return String.format(
		 "%02d:%02d:%02d",
		 TimeUnit.MILLISECONDS.toHours(millis),
		 TimeUnit.MILLISECONDS.toMinutes(millis)
		 - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
		 .toHours(millis)),
		 TimeUnit.MILLISECONDS.toSeconds(millis)
		 - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
		 .toMinutes(millis)));
	}

TimeUnit.MILLISECONDS.toHours
dont't realese in GWT
понедельник, 27 апреля 2015 г., 15:46:39 UTC+2 пользователь Christian Goudreau написал:

Christian Goudreau

unread,
Apr 28, 2015, 7:27:00 AM4/28/15
to gwt-pl...@googlegroups.com
Damn, must have been hard to debug! Your IDE didn't warned you about the class being not compatible with GWT?

Christian Goudreau | CEO - Président

Лешик Иванов

unread,
Apr 29, 2015, 5:11:38 AM4/29/15
to gwt-pl...@googlegroups.com
And where I can enable this warnings? My IDE - Eclipse
Reply all
Reply to author
Forward
0 new messages