No proxy provider found for type only in dev mode
schrek1 Apr 13, 2016 8:21 AMHello everyone,
I'm writing an application in Erra and I got into trouble. RPC calls using the application. When I start in normal mode, Vee running well, but when it will bring the best in dev mode throws Well proxy provider for the type found.
I append some screen and source code...
App.gwt.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.0/distro-source/core/src/gwt-module.dtd"> <module rename-to="app"> <inherits name="org.jboss.errai.enterprise.All" /> <inherits name="org.jboss.errai.ui.nav.Navigation"/> <inherits name="org.jboss.errai.bus.ErraiBus"/> <inherits name="org.jboss.errai.ioc.Container"/> <set-property name="gwt.logging.enabled" value="TRUE"/> <!-- Uncomment the line below to enable all logging statements (default level is "INFO"). --> <!-- <set-property name="gwt.logging.logLevel" value="ALL"/> --> </module>
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet-mapping> <servlet-name>javax.ws.rs.core.Application</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <servlet> <servlet-name>ErraiServlet</servlet-name> <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class> <init-param> <param-name>auto-discover-services</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ErraiServlet</servlet-name> <url-pattern>*.erraiBus</url-pattern> </servlet-mapping> <servlet> <servlet-name>ErraiServlet</servlet-name> <servlet-class>org.jboss.errai.bus.server.servlet.StandardAsyncServlet</servlet-class> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet> </web-app>
LoginForm.java -> client side
package org.jboss.errai.demo.client.local; import com.google.gwt.dom.client.FormElement; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.TextBox; import javax.inject.Inject; import org.jboss.errai.common.client.api.Caller; import org.jboss.errai.common.client.api.RemoteCallback; import org.jboss.errai.demo.client.local.share.UserAccount; import org.jboss.errai.demo.client.local.share.LoginResponse; import org.jboss.errai.ioc.client.api.EntryPoint; import org.jboss.errai.ui.nav.client.local.DefaultPage; import org.jboss.errai.ui.nav.client.local.Page; import org.jboss.errai.ui.shared.api.annotations.Bound; import org.jboss.errai.ui.shared.api.annotations.DataField; import org.jboss.errai.ui.shared.api.annotations.EventHandler; import org.jboss.errai.ui.shared.api.annotations.Model; import org.jboss.errai.ui.shared.api.annotations.Templated; import org.jboss.errai.demo.client.local.share.LoginVerifyService; /** * * @author ondra */ @EntryPoint @Page(role = DefaultPage.class) @Templated("LoginForm.html#container") public class LoginForm extends Composite{ @Inject @Model private UserAccount loginRequest; @Inject @Bound @DataField private TextBox password; @Inject @Bound @DataField private TextBox username; @Inject @DataField private Button login; @Inject private Caller<LoginVerifyService> loginVerify; @EventHandler("login") private void onLoginClick(ClickEvent ce){ this.login.setFocus(false); this.loginVerify.call(new RemoteCallback<LoginResponse>() { @Override public void callback(LoginResponse response){ Window.alert(response.toString()); } }).authentication(loginRequest); } }
LoginVerifyService -> rpc interface
package org.jboss.errai.demo.client.local.share; import org.jboss.errai.bus.server.annotations.Remote; /** * * @author ondra */ @Remote public interface LoginVerifyService{ public LoginResponse authentication(UserAccount recieveUserAccount); }
LoginVerifyImpl -> rpc service
package org.jboss.errai.demo.server; import javax.enterprise.context.ApplicationScoped; import org.jboss.errai.bus.server.annotations.Service; import org.jboss.errai.demo.client.local.share.UserAccount; import org.jboss.errai.demo.client.local.share.LoginResponse; import org.jboss.errai.demo.client.local.share.LoginVerifyService; /** * * @author ondra */ @ApplicationScoped @Service public class LoginVerifyImpl implements LoginVerifyService{ private DataSource dataSource = new DataSource(); @Override public LoginResponse authentication(UserAccount recieveUserAccount){ System.err.println("JSEM V METODE"); VerifyResponse response = this.dataSource.getUserByName(recieveUserAccount.getUsername()); UserAccount foundAccount = response.getUserAccount(); if(response.getQueryStatus() == VerifyResponse.Status.ACCOUNT_FOUND){ if(recieveUserAccount.getPassword().equals(foundAccount.getPassword())){ return new LoginResponse(LoginResponse.Response.ALL_OK, "vitejte na webu"); }else{ return new LoginResponse(LoginResponse.Response.PASS_BAD, "spatne heslo"); } }else{ return new LoginResponse(LoginResponse.Response.USER_BAD, "spatny uzivtelsky ucet"); } } }
And there is bug screen: