Skip to content

Instantly share code, notes, and snippets.

View csadilek's full-sized avatar

Christian Sadilek csadilek

  • Mozilla
  • Toronto
View GitHub Profile
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
[INFO] Received HelloMessage from Client: fdsgsdfg
[ERROR] java.lang.RuntimeException: Failed to dispatch CDI Event
[ERROR] at org.jboss.errai.cdi.server.events.EventDispatcher.callback(EventDispatcher.java:124)
[ERROR] at org.jboss.errai.bus.client.framework.DeliveryPlan.deliver(DeliveryPlan.java:35)
[ERROR] at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:614)
[ERROR] at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46)
[ERROR] at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:93)
[ERROR] at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:107)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
@csadilek
csadilek / errai-ticketmonster.md
Created May 15, 2012 14:10
Adding Errai to the TicketMonster

Errai, GWT and the TicketMonster

A booking monitor, developed using Errai and GWT, has been added to the TicketMonster application. It shows the live updating booking status of all performances and shows. These live updates are powered by CDI events crossing the client-server boundary, a feature provided by the Errai Framework. The following steps have been carried out to add Errai and GWT to the TicketMonster Java EE6 application:

  1. The first step is to add a GWT module descriptor (a .gwt.xml file) which defines the GWT module, its dependencies and configures the client source paths. Only classes in these source paths will be compiled to JavaScript by the GWT compiler. Here's the BookingMonitor.gwt.xml file:
<module rename-to="BookingMonitor">
    <inherits name="org.jboss.errai.common.ErraiCommon"/>
    <inherits name="org.jboss.errai.bus.ErraiBus"/>
    <inherits name="org.jboss.errai.ioc.Container"/>
package com.google.gwt.sample.contacts.shared;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class Contact_Array_Rank_1_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public static void deserialize(SerializationStreamReader streamReader, com.google.gwt.sample.contacts.shared.Contact[] instance) throws SerializationException {
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building baz 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ baz ---
[INFO] Deleting /Users/csadilek/Projects/misc/baz (includes = [www-test/**, .gwt/**, .errai/**, src/main/webapp/app/**, src/main/webapp/WEB-INF/deploy/**, src/main/webapp/WEB-INF/lib/**, src/main/webapp/WEB-INF/classes/**, **/gwt-unitCache/**, **/*.JUnit/**], excludes = [])
[INFO]
[INFO] --- gwt-maven-plugin:2.4.0:clean (gwt-clean) @ baz ---
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
@Dependent
public class MyBean {
@Inject
private BatchCaller batchCaller;
private void someMethod() {
// ...
batchCaller.call(remoteCallback1, RemoteService1.class).method1();
batchCaller.call(remoteCallback2, RemoteService2.class).method2();
public class EnumConverter implements Converter<Enum<?>, String>{
Class enumType;
public EnumConverter(Class enumType) {
this.enumType = enumType;
}
@Override
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2012 JBoss Inc
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
errai_list_services()
Service and Routing Table 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
------------------------------------------------------------------- 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
[REMOTES] 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
ServerEchoService 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
ServerBus 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
AuthenticationService 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
AuthorizationService 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
cdi.event:Dispatcher 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852
org.jboss.errai.jpa.sync.client.shared.DataSyncService:RPC 24309CB6AB225F4BB0895AEF88D8DB50.cache.html:852