Re: [errai-users] Trouble sending messages
by Kevin Jordan
Yes, I am using trunk. Is there a more stable branch/version I should be
using? I had updated again hoping it was just something with the time I
checked out and then ran into the problems Heiko Braun ran into compiling
it.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Friday, January 08, 2010 8:52 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
What version of ErraiBus are you using? Are you getting it from trunk?
On 2010-01-08, at 5:37 PM, Kevin Jordan wrote:
DefaultBlockingServlet seems to have the same effect.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Friday, January 08, 2010 2:56 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
I will check into this. We're still working on getting the AIO stuff
sorted, and I wouldn't consider the Tomcat or JBoss adapters to be
production ready. You're best to use the DefaultBlockingServlet -- which
will provide adequate performance for development while we get the AIO
adapters squared away over the next few days.
On 2010-01-08, at 2:34 PM, Kevin Jordan wrote:
I'm having trouble getting a message to go through using ErraiBus. I'm
using this on the client side:
CommandMessage msg = (CommandMessage)
CommandMessage.create().toSubject("Items").set("SerialNumber",
serialInput.getValue());
bus.conversationWith(msg, new MessageCallback() {
@Override
public void callback(Message message) {
//throw new
UnsupportedOperationException("Not supported yet.");
Item item = message.get(Item.class, "Item");
MessageBox.alert("Errai",
item.getSerialNumber().toString(), null);
}
});
With this on the server side:
@Service("Items")
public class Items implements MessageCallback {
private MessageBus bus;
@Inject
public Items(MessageBus bus) {
this.bus = bus;
System.out.println("Got a bus...");
}
@Override
public void callback(Message message) {
//throw new UnsupportedOperationException("Not supported yet.");
System.out.println("Incoming message...");
Long serialNum = message.get(Long.class, "SerialNumber");
System.out.println(serialNum);
Item item = new Item();
item.setSerialNumber(serialNum);
ConversationMessage.create(message).set("Item",item).sendNowWith(bus);
}
}
However, all it seems to send is:
{"CommandType":"RemoteSubscribe","ToSubject":"ServerBus","Subject":"temp:Con
versation:2","PriorityProcessing":"1"}
I don't see where it actually sends my body or the subject that I fill out
in my message. Nothing also gets to the Service class. Am I doing
something wrong? I have Tomcat running NIO and everything else seems set up
correctly. It will keep a GET connection open and do the POST of the JSON
above, but nowhere does it seem to send what I want it to. I also seem to
be getting these occasionally, usually on some of the first requests to
in.erraiBus:
java.lang.NullPointerException
at
org.jboss.errai.bus.server.servlet.TomcatCometServlet.event(TomcatCometServl
et.java:105)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(Unknow
n Source)
at
org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(Unknown
Source)
at org.apache.catalina.core.StandardWrapperValve.event(Unknown
Source)
at org.apache.catalina.core.StandardContextValve.event(Unknown
Source)
at org.apache.catalina.core.StandardHostValve.event(Unknown Source)
at org.apache.catalina.valves.ValveBase.event(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.event(Unknown
Source)
at org.apache.catalina.connector.CoyoteAdapter.event(Unknown Source)
at org.apache.coyote.http11.Http11NioProcessor.event(Unknown Source)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.event(Unk
nown Source)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(Unknown Source)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
at java.lang.Thread.run(Thread.java:619)
Can anyone point me at what I'm missing?
_______________________________________________
errai-users mailing list
errai-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-users
14 years, 3 months
ErraiBus newbie problem: $wnd.PageBus is undefined
by Sean Flanigan
Hi,
I'm trying to run in GWT 2.0's DevMode, but I'm hitting this error when
I load the page in Firefox:
Failed to create an instance of 'org.jboss.errai.bus.client.MessageBus'
via deferred binding
com.google.gwt.core.client.JavaScriptException: (TypeError):
$wnd.PageBus is undefined
fileName: http://localhost:8080
lineNumber: 2
stack: ("ClientBus",[object GWTJavaObject],null)@http://localhost:8080:2
Full stack trace is further down.
I'm using the latest maven snapshot for errai-bus, 1.0-20100114.200325-3.
Is this some really basic deployment problem, or do I have to gather
more info before this will make sense to anyone?
Thanks
Sean.
PS Tomorrow is a public holiday here in Aus, so it might take me a while
to respond.
17:16:11.250 [ERROR] [org.fedorahosted.flies.webtrans.Application]
Failed to create an instance of 'org.jboss.errai.bus.client.MessageBus'
via deferred binding
com.google.gwt.core.client.JavaScriptException: (TypeError):
$wnd.PageBus is undefined
fileName: http://localhost:8080
lineNumber: 2
stack: ("ClientBus",[object GWTJavaObject],null)@http://localhost:8080:2
connect("http://localhost:8080/flies/org.fedorahosted.flies.webtrans.Application/A...","Rt#42IF1WbS}Y%VD","10.64.0.141:9997","org.fedorahosted.flies.webtrans.Application","2.0")@:0
((void
0),"org.fedorahosted.flies.webtrans.Application","http://localhost:8080/flies/org.fedorahosted.flies.webtrans.Application/")@http://localhost:8080/flies/org.fedorahosted.flies.webtrans.Application/hosted.html?org_fedorahosted_flies_webtrans_Application:264
z()@http://localhost:8080/flies/org.fedorahosted.flies.webtrans.Application/org.fedorahosted.flies.webtrans.Application.nocache.js:2
(51)@http://localhost:8080/flies/org.fedorahosted.flies.webtrans.Application/org.fedorahosted.flies.webtrans.Application.nocache.js:8
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at
org.jboss.errai.bus.client.ClientMessageBusImpl._subscribe(ClientMessageBusImpl.java)
at
org.jboss.errai.bus.client.ClientMessageBusImpl.subscribe(ClientMessageBusImpl.java:103)
at
org.jboss.errai.bus.client.ClientMessageBusImpl.init(ClientMessageBusImpl.java:331)
at
org.jboss.errai.bus.client.ClientMessageBusImpl.init(ClientMessageBusImpl.java:325)
at
org.jboss.errai.bus.client.ClientMessageBusImpl.<init>(ClientMessageBusImpl.java:76)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:422)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at org.jboss.errai.bus.client.ErraiBus.<clinit>(ErraiBus.java:27)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at
com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:580)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:348)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:636)
--
Sean Flanigan
Senior Software Engineer
Engineering - Internationalisation
Red Hat
14 years, 3 months
Target JDK?
by Heiko Braun
I see some JDK 6 language constructs in the codebase.
Do we drop support for JDK 1.5?
/Heiko
14 years, 3 months
TRunk doesn't build
by Heiko Braun
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/Users/hbraun/dev/prj/errai/trunk/errai-bus/src/main/java/org/jboss/errai/bus/client/api/builder/MessageBuildSubject.java:[3,45] cannot find symbol
symbol: class MessageBuild
public interface MessageBuildSubject extends MessageBuild {
Seems like MessageBuild is missing.
14 years, 3 months
Trouble sending messages
by Kevin Jordan
I'm having trouble getting a message to go through using ErraiBus. I'm
using this on the client side:
CommandMessage msg = (CommandMessage)
CommandMessage.create().toSubject("Items").set("SerialNumber",
serialInput.getValue());
bus.conversationWith(msg, new MessageCallback() {
@Override
public void callback(Message message) {
//throw new
UnsupportedOperationException("Not supported yet.");
Item item = message.get(Item.class, "Item");
MessageBox.alert("Errai",
item.getSerialNumber().toString(), null);
}
});
With this on the server side:
@Service("Items")
public class Items implements MessageCallback {
private MessageBus bus;
@Inject
public Items(MessageBus bus) {
this.bus = bus;
System.out.println("Got a bus...");
}
@Override
public void callback(Message message) {
//throw new UnsupportedOperationException("Not supported yet.");
System.out.println("Incoming message...");
Long serialNum = message.get(Long.class, "SerialNumber");
System.out.println(serialNum);
Item item = new Item();
item.setSerialNumber(serialNum);
ConversationMessage.create(message).set("Item",item).sendNowWith(bus);
}
}
However, all it seems to send is:
{"CommandType":"RemoteSubscribe","ToSubject":"ServerBus","Subject":"temp:Con
versation:2","PriorityProcessing":"1"}
I don't see where it actually sends my body or the subject that I fill out
in my message. Nothing also gets to the Service class. Am I doing
something wrong? I have Tomcat running NIO and everything else seems set up
correctly. It will keep a GET connection open and do the POST of the JSON
above, but nowhere does it seem to send what I want it to. I also seem to
be getting these occasionally, usually on some of the first requests to
in.erraiBus:
java.lang.NullPointerException
at
org.jboss.errai.bus.server.servlet.TomcatCometServlet.event(TomcatCometServl
et.java:105)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(Unknow
n Source)
at
org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(Unknown
Source)
at org.apache.catalina.core.StandardWrapperValve.event(Unknown
Source)
at org.apache.catalina.core.StandardContextValve.event(Unknown
Source)
at org.apache.catalina.core.StandardHostValve.event(Unknown Source)
at org.apache.catalina.valves.ValveBase.event(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.event(Unknown
Source)
at org.apache.catalina.connector.CoyoteAdapter.event(Unknown Source)
at org.apache.coyote.http11.Http11NioProcessor.event(Unknown Source)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.event(Unk
nown Source)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(Unknown Source)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
08)
at java.lang.Thread.run(Thread.java:619)
Can anyone point me at what I'm missing?
14 years, 4 months
ErraiBus trunk *will* break stuff.
by Mike Brock
I have implemented some long overdue refactorings that were getting in the way of API cleanliness. For instance, CommandMessage and ConversationMessage are now constituents of the Message interface.
As such, all of the other interfaces such as MessageCallback, now depend on the Message interface as opposed to CommandMessage. This is really no more than a search & replace type fix. But I think it was ultimately necessary for some of things I'm trying to do with the bus. As the API is growing, it was becoming eminently clear to me that the class structure I had was very limited. :)
14 years, 4 months