First look at errai - some issues
by Matt (Errai)
Hello,
I've been checking out Errai and trying out the Store sample
application, and built a simple app myself. This has been to evaluate
the use of Errai in an inhous app. Since that app would mostly be used
by users that have IE7 installed, i did try it in IE7. I encountered
two problems, the first one both in my own app & the sample, and the
second one only in the sample:
1.) The module's icons display correctly in FF, but IE7 instead
displays the whole underlying image generated by GWT from the
ClientBundle that contains all the icons, crammed into the small space
where a single icon should be.
2.) When starting up the sample application in IE7, i get the
following exception:
com.google.gwt.user.client.ui.AttachDetachException: One or more
exceptions caught, see full set in AttachDetachException#getCauses
com.google.gwt.user.client.ui.AttachDetachException.tryCommand(AttachDetachException.java:85)
org.gwtmosaic.ui.client.layout.LayoutPanel.doAttachChildren(LayoutPanel.java:366)
com.google.gwt.user.client.ui.Widget.onAttach(Widget.java:289)
com.google.gwt.user.client.ui.Widget.setParent(Widget.java:417)
com.google.gwt.user.client.ui.Panel.adopt(Panel.java:119)
com.google.gwt.user.client.ui.ComplexPanel.insert(ComplexPanel.java:205)
org.gwtmosaic.ui.client.layout.LayoutPanel.insert(LayoutPanel.java:308)
org.gwtmosaic.ui.client.layout.LayoutPanel.insert(LayoutPanel.java:327)
org.gwtmosaic.ui.client.DeckLayoutPanel.insert(DeckLayoutPanel.java:127)
org.gwtmosaic.ui.client.TabLayoutPanel.insert(TabLayoutPanel.java:357)
org.gwtmosaic.ui.client.TabLayoutPanel.add(TabLayoutPanel.java:211)
org.jboss.errai.workspaces.client.Workspace.showToolSet(Workspace.java:208)
org.jboss.errai.workspaces.client.Workspace$1.callback(Workspace.java:80)
org.jboss.errai.bus.client.framework.ClientMessageBusImpl$1.callback(ClientMessageBusImpl.java:134)
sun.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:284)
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
org.jboss.errai.bus.client.framework.ClientMessageBusImpl._store(ClientMessageBusImpl.java)
org.jboss.errai.bus.client.framework.ClientMessageBusImpl.send(ClientMessageBusImpl.java:256)
org.jboss.errai.bus.client.api.base.JSONMessage.sendNowWith(JSONMessage.java:443)
org.jboss.errai.bus.client.api.builder.AbstractMessageBuilder$1.sendNowWith(AbstractMessageBuilder.java:41)
org.jboss.errai.workspaces.client.Application$2.execute(Application.java:210)
com.google.gwt.user.client.CommandExecutor.doExecuteCommands(CommandExecutor.java:310)
com.google.gwt.user.client.CommandExecutor$2.run(CommandExecutor.java:205)
com.google.gwt.user.client.Timer.fire(Timer.java:141)
sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
com.google.gwt.core.client.impl.Impl.apply(Impl.java)
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
java.lang.Thread.run(Thread.java:619)
Am I missing something, or are these some rough edges in the first version?
Thanks,
Matt
14 years, 3 months
error handling with errai-1.0.0
by Christopher Gokey
Is there a recommend approach for dealing with errors on the server side?
This way of doing it seems quite verbose:
if (method.equals("getUsers")) {
try {
List<UserInfoDTO> users = getUsers(null);
MessageBuilder.createConversation(message)
.toSubject("Users").signalling()
.with("action", "initUsers")
.with("users", users)
.errorsHandledBy(new ErrorCallback() {
public boolean error(Message message, Throwable throwable) {
System.err.println("Error responding with retrieving users.");
return false;
}
})
.sendNowWith(bus);
} catch (DatabaseException e) {
MessageBuilder.createConversation(message)
.toSubject("UsersView").signalling()
.with("action", "error")
.with("error", e)
.errorsHandledBy(new ErrorCallback() {
public boolean error(Message message, Throwable throwable) {
System.err.println("Error responding with retrieving users.");
return false;
}
})
.sendNowWith(bus);
}
}
I was looking in the example code for the preferred way of handling errors but none of the examples have much. At first I thought maybe it was the errorsHandledBy(...) but that seems like more about communications errors than responding to a specific request that resulted in an error.
Thanks,
Chris
14 years, 3 months
errai
by Christopher Gokey
I'm trying to get errai-1.0.0 to work in my tomcat servlet container and having trouble... It works fine in jetty. I'm getting
a java.lang.ClassNotFoundException: org.mortbay.jetty.RetryRequest and need a jetty class but I tried adding the jetty-6.1.22.jar but that didn't work either... See stack traces below. The jars in my WEB-INF/lib include:
errai-bus-1.0.0.jar gwt-mosaic-dnd-0.2.0.jar log4j-1.2.14.jar
errai-common-1.0.0.jar gwt-servlet-2.0.3.jar mvel2-2.0.16.jar
guice-2.0-aopalliance.jar gwt-servlet.jar slf4j-api-1.5.10.jar
guice-2.0.jar gwt-user-2.0.3.jar slf4j-log4j12-1.5.10.jar
guice-servlet-2.0.jar gxt-2.1.1.jar
gwt-dev-2.0.3.jar
What am I missing? :)
Any help would be really appreciated.
Chris
NOT including the jetty-6.1.22.jar in my WEB-INF/lib, I get this stack trace:
SEVERE: Servlet /AccessManager threw load() exception
java.lang.ClassNotFoundException: org.mortbay.jetty.RetryRequest
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
INCLUDING the jetty-6.1.22.jar in my WEB-INF/lib, I get the is stack trace:
SEVERE: Servlet /AccessManager threw load() exception
java.util.MissingResourceException: Can't find bundle for base name ErraiService, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:715)
at org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl.configure(ErraiServiceConfiguratorImpl.java:91)
at org.jboss.errai.bus.server.service.ErraiServiceImpl.init(ErraiServiceImpl.java:152)
at org.jboss.errai.bus.server.service.ErraiServiceImpl.<init>(ErraiServiceImpl.java:61)
at org.jboss.errai.bus.server.service.ErraiServiceImpl$$FastClassByGuice$$7879947c.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.<init>(AbstractErraiServlet.java:28)
at org.jboss.errai.bus.server.servlet.JettyContinuationsServlet.<init>(JettyContinuationsServlet.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
14 years, 3 months
security policies
by Christopher D. Gokey
I'm wondering if someone could provide a few more details regarding this statement here:
"This approach may be extremely disruptive to some appserver deployments and depending on some security policies may
not work at all. "
(from http://www.jboss.org/errai/ErraiBus.html)
Is this statement more from a load point of view? I assume the server could potentially have _many_ open connections. But, I'm wondering from a security point of view if it puts the client in a more susceptible position to things like cross scripting, or other security exploitations.
Our intended purposes would be do have the server behind https with jaas. But we have security scans and wonder if having persistent connections might cause us to be flagged...
But, I've got a very nice example working... and appreciate all the help earlier. Just now trying to make a case regarding the security implications of this framework.
Any thoughts would be appreciated.
Chris
14 years, 3 months
Serialization issue, cannot serialize type:
by Alejandro Montenegro
Hi guys,
I'm trying to send an array of objects from server to client:
StockPrice[] prices = getPrices(symbols);
MessageBuilder.createMessage()
.toSubject("BroadcastReceiver")
.signalling().with("data", prices)
.noErrorHandling()
.sendNowWith(bus); (1)
where StockPrice is:
public class StockPrice implements Serializable{
private String symbol;
private double price;
private double change;
...
but when executing (1) I get the following error:
[ERROR]Exception in thread "Timer-2" java.lang.RuntimeException: cannot serialize type: com.ifitec.gwt.client.StockPrice
[ERROR] at org.jboss.errai.bus.server.io.JSONEncoder._encode(JSONEncoder.java:59)
[ERROR] at org.jboss.errai.bus.server.io.JSONEncoder.encodeArray(JSONEncoder.java:147)
[ERROR] at org.jboss.errai.bus.server.io.JSONEncoder._encode(JSONEncoder.java:55)
[ERROR] at org.jboss.errai.bus.server.io.JSONEncoder.encode(JSONEncoder.java:38)
[ERROR] at org.jboss.errai.bus.server.io.JSONMessageServer._addObjectPart(JSONMessageServer.java:13)
[ERROR] at org.jboss.errai.bus.client.api.base.JSONMessage.set(JSONMessage.java:191)
[ERROR] at org.jboss.errai.bus.client.api.builder.AbstractMessageBuilder$2.with(AbstractMessageBuilder.java:60)
So looking at JSONEncoder I discovered the serializableTypes variable which is used to check if objects are serializable:
else if (serializableTypes.contains(v.getClass()) || tHandlers.containsKey(v.getClass())) {
return encodeObject(v);
So now Im looking for how to put in serializableTypes the StockPrice class that I have created.
Please let me know if Im correct that I have to fill serializableTypes or maybe Im totally wrong. And if any can let me know how to fill it would be great.
thanks
Alejandro
(amontenegro)
14 years, 4 months
Errai 1.0 Released
by Heiko Braun
I am pleased to announce our 1.0 Release of the Errai Framework. It rounds out the first stepping stone in our journey towards building a truly innovative way to build next-generation web applications.
I would like to thank the entire team for their hard work on this: Heiko Braun, Lillian Angel, Rodney Russ, and myself for contributing to getting us to this goal.
We'd especially like to thank our early adopters who helped us work out the kinks, report bugs, and make us aware of what the community needs.
Some of the important highlights and milestone of this release include:
- Async IO support in ErraiBus for Apache Tomcat, JBoss AS, and Jetty. As well as standard synchronous IO support for all servlet containers.
- Easy to use homogeneous programming model that permeates both the server and client.
- Initial public release of our Workspaces RAD console/app framework.
Version 1.1, which will be released in the coming weeks will add support for Glassfish, WebLogic and WebSphere.
We encourage anybody interested in contributing to contact us on our mailing lists. For more information on Errai, check our main project website here: http://www.jboss.org/errai
14 years, 4 months