problem about cometd-Collection of common programming errors


  • brevleq
    jsf-2 comet cometd
    I’m trying to configure CometD in my web application. This web application is the client of CometD, it uses JSF 2.0, primefaces 3.3.1 and run on glassfish. In this application this global var is undefined:var cometd = $.cometd;Probably the source of my pr

  • Shikatsu
    java-ee glassfish jetty httpclient cometd
    I would like to know why am i getting an ExceptionInInitializerError?Platform:Windows; Glassfish 3.1.2.2; Notepade++; Cometd java libraries; Jetty libraries; Javac command line;I’m walking my way to set up a cometd web application. After some debugging i realized that jetty: HttpClient class is causing ExceptionInInitializerError, can someone tell me why is that?What i did is that i went commenting code lines till i found where the problem occurs.here is my CometD_Client class where the error occurs:import java.util.*; import java.net.URL; import org.cometd.bayeux.*; import org.cometd.bayeux.client.*; import org.cometd.server.*; import org.cometd.client.*; import org.cometd.common.*; import org.cometd.client.transport.*; import org.eclipse.jetty.client.*;import javax.swing.*;public class CometD_Client {private String CurrentDate;private String BayeuxServerURL$;private HttpClient JettyHttpClient;private Map TransportOptions;private ClientTransport C_Transport;private BayeuxClient C_Session;private boolean HandIsShaken£ = false;DayTimePanel Panel;public CometD_Client(String BayeuxServerURL$, DayTimePanel Panel){this.BayeuxServerURL$ = BayeuxServerURL$;this.Panel = Panel;// Create (and eventually set up) Jetty’s HttpClient;JettyHttpClient = new HttpClient();/*try{JettyHttpClient.start();}catch(Exception E) {}/**/// Prepare the transport;//TransportOptions = new HashMap();//ClientTransport C_Transport = // LongPollingTransport.create(TransportOptions, // JettyHttpClient );//C_Session = new BayeuxClient(BayeuxServerURL$, C_Transport);//C_Session.handshake();//HandIsShaken£ = // C_Session.waitFor(1000, BayeuxClient.State.CONNECTED);if(HandIsShaken£){// TO DO: Output that the handshake had succeed;}else{// TO DO: Output that the handshake had failed;}/*C_Session.getChannel(Channel.META_HANDSHAKE).addListener(new ClientSessionChannel.MessageListener(){@Overridepublic void onMessage(ClientSessionChannel ThisMetaChanel,Message msg){// TO DO: Output msg to check it out;C_Session.getChannel(“/my/channel”).subscribe(new ClientSessionChannel.MessageListener(){@Overridepublic void onMessage(ClientSessionChannel ThisChanel,Message msg){CurrentDate = msg.getJSON();OutputCurrentDate();}});}});/**/}public boolean GetIfHandIsShaken£(){return HandIsShaken£;}public String GetCurrentDate(){return CurrentDate;}/*private void OutputCurrentDate(){Panel.GetJTF().setText(CurrentDate);}/**/ }EDIT: Applying asadmin generate-jvm-report –type=thread this is the log i get: Java HotSpot(TM) Client VM 23.1-b03 Java HotSpot(TM) Client VM (23.1-b03) for windows-x86 JRE (1.7.0_05-b06), built on Jun 27 2012 00:51:27 by “java_re” with unknown MS VC++:1600 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009 -XX:+UnlockDiagnosticVMOptions -XX:PermSize=64m -XX:MaxPermSize=192m -XX:NewRatio=2 -XX:+LogVMOutput -XX:LogFile=C:\glassfish3\glassfish\domains\domain1/logs/jvm.log -Xmx512m -javaagent:C:/glassfish3/glassfish/lib/monitor/flashlight-agent.jar -Dosgi.shell.telnet.maxconn=1 -Dfelix.fileinstall.disableConfigSave=false -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Dfelix.fileinstall.dir=C:\glassfish3\glassfish/modules/autostart/ -Djavax.net.ssl.keyStore=C:\glassfish3\glassfish\domains\domain1/config/keystore.jks -Dosgi.shell.telnet.port=6666 -Djava.security.policy=C:\glassfish3\glassfish\domains\domain1/config/server.policy -Djava.awt.headless=true -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.poll=5000 -Dcom.sun.aas.instanceRoot=C:\glassfish3\glassfish\domains\domain1 -Dosgi.shell.telnet.ip=127.0.0.1 -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Djava.endorsed.dirs=C:\glassfish3\glassfish/modules/endorsed;C:\glassfish3\glassfish/lib/endorsed -Dcom.sun.aas.installRoot=C:\glassfish3\glassfish -Dfelix.fileinstall.bundles.startTransient=true -Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_05/lib/ext;C:\Program Files\Java\jdk1.7.0_05/jre/lib/ext;C:\glassfish3\glassfish\domains\domain1/lib/ext -Dfelix.fileinstall.bundles.new.start=true -Djavax.net.ssl.trustStore=C:\glassfish3\glassfish\domains\domain1/config/cacerts.jks -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djava.security.auth.login.config=C:\glassfish3\glassfish\domains\domain1/config/login.conf -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dgosh.args=–nointeractive -Djava.library.path=C:/glassfish3/glassfish/lib;C:/Program Files/Java/jdk1.7.0_05/bin;C:/WINDOWS/Sun/Java/bin;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/system32/wbem;C:/Sun/AppServer/bin;C:/glassfish3/bin;C:/glassfish3;C:/glassfish3/ant/bin;C:/glassfish3/glassfish/bin;C:/Sun/AppServer/jdk/bin;C:/Program Files/Ant/bin;C:/Sun/AppServer/lib;C:/Prog

  • user676567
    cometd bayeux
    We had an issue with our CometD/Gigaspaces application creating a duplicate instances of the Bayeux Server. See my previous question posted here. After investigating this issue with Gigaspaces, it turns out each bean defined in our Application Context File was getting created twice as GigaSpaces has special treatment for Application Context Files called PU.XML. We’ve resolved this issue by renaming the PU.XML File but the problem we have now is that we’re not receiving any data on the client side and receive the following error “NetworkError: 400 Unknown Bayeux Transport – http://localhost:9292/cometd”. Previously, when the application created a duplicate instance of the Bayeux Server, we put a workaround in place to terminate the first instance of the thread that the Bayeux Server was running on and as a result we were able to publish data on our channels using Web Sockets which

  • Boris Horvat
    tomcat maven jetty tapestry cometd
    I have got a following problem that I am not sure how to solve. I believe that there is some dependency incompatiblity problem, but I dont know how to check.Does anyone have any idea where to start?I am using maven to manage my dependencies. The dependancy that I think is the root of the problem is org.lazantapestry-cometd0.9.14 However I am not sure how to check underline problem. The logs can be seen bellow. SEVERE: Exception starting filter app java.lang.RuntimeException: Exception constructing service ‘PushManager’: Error invoking constructor public org.lazan.t5.cometd.services.internal.PushManagerImpl(org.cometd.bayeux.server.BayeuxServer,org.slf4j.Logger,org.lazan.t5.cometd.services.ComponentJSONRenderer,org.apache.tapestry5.ioc.services.TypeCoercer,javax.servlet.http.HttpServletRequest,org.lazan.t5.cometd.services.CometdGlobals): Exception constructing service ‘BayeuxServer’: Error invoking method public static org.cometd.bayeux.server.BayeuxServer org.lazan.t5.cometd.services.CometdModule.buildBayeuxServer(org.lazan.t5.cometd.web.BayeuxServerHttpServletRequestFilter,org.lazan.t5.cometd.services.Authorizers,org.lazan.t5.cometd.services.SubscriptionListeners,org.lazan.t5.cometd.services.CometdGlobals): Exception constructing service ‘BayeuxServerHttpServletRequestFilter’: Error invoking constructor public org.lazan.t5.cometd.web.CometdHttpServletRequestFilter(org.apache.tapestry5.services.ApplicationGlobals,java.util.Map,org.apache.tapestry5.ioc.services.RegistryShutdownHub,java.lang.String): javax.servlet.ServletException: java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyAsyncSupportWithWebSocket has bad signature.at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:530)at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1467)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:601)at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.RuntimeException: Error invoking constructor public org.lazan.t5.cometd.services.internal.PushManagerImpl(org.cometd.bayeux.server.BayeuxServer,org.slf4j.Logger,org.lazan.t5.cometd.services.ComponentJSONRenderer,org.apache.tapestry5.ioc.services.TypeCoercer,javax.servlet.http.HttpServletRequest,org.lazan.t5.cometd.services.CometdGlobals): Exception constructing service ‘BayeuxServer’: Error invoking method public static org.cometd.bayeux.server.BayeuxServer org.lazan.t5.cometd.services.CometdModule.buildBayeuxServer(org.lazan.t5.cometd.web.BayeuxServerHttpServletRequestFilter,org.lazan.t5.cometd.services.Authorizers,org.lazan.t5.cometd.services.SubscriptionListeners,org.lazan.t5.cometd.services.CometdGlobals): Exception constructing service ‘BayeuxServerHttpServletRequestFilter’: Error invoking constructor public org.lazan.t5.cometd.web.CometdHttpServletRequestFilter(org.apache.tapestry5.services.ApplicationGlobals,java.util.Map,org.apache.tapestry5.ioc.services.RegistryShutdownHub,java.lang.String): javax.servlet.ServletException: java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyAsyncSupportWithWebSocket has bad signature.at org.apache.tapestry5.ioc.internal.util.ConstructorInvoker.invoke(ConstructorInvoker.java:57)org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:66)… 52 more Caused by: java.lang.RuntimeException: Exception constructing service ‘BayeuxServer’: Error invoking method public static org.cometd.bayeux.server.BayeuxServer org.lazan.t5.cometd.services.CometdModule.buildBayeuxServer(org.lazan.t5.cometd.web.BayeuxServerHttpServletRequestFilter,org.lazan.t5.cometd.services.Authorizers,org.lazan.t5.cometd.services.SubscriptionListeners,org.lazan.t5.cometd.services.CometdGlobals): Exception constructing service ‘BayeuxServerHttpServletRequestFilter’: Error invoking constructor public org.lazan.t5.cometd.web.CometdHttpServletRequestFilter(org.apache.tapestry5.services.ApplicationGlobals,java.util.Map,org.apache.tapestry5.ioc.services.RegistryShutdownHub,java.lang.String): javax.servlet.ServletException: java.lang.IllegalArgumentException: Comet support class org.atmosphere.container.JettyAsyncSupportWithWebSocket has bad signature.at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:75)at org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)at $BayeuxServer_20153764561c.delegate(Unknown Source)at $BayeuxServer_20153764561c.addListener(Unknown Source)at org.lazan.t5.cometd.services.internal.PushManagerImpl.(PushManagerImpl.java:39)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:525)at org.apache.tapestry5.ioc.internal.util.ConstructorInvoker.invoke(ConstructorInvoker.java:48)… 74 more Caused by: java

  • user676567
    cometd bayeux
    I’m new to CometD and having problems publishing data on a channel. I’m getting the following error for not invoking a handshake() on my channel:Sender : null Sender : L:/abc/1? Exception in thread “Thread-9” java.lang.IllegalStateException: Method handshake() not invoked for local session L:/abc/1?at org.cometd.server.LocalSessionImpl.getId(LocalSessionImpl.java:161)at org.cometd.server.ServerChannelImpl.publish(ServerChannelImpl.java:309)at packagename.CometDSender.sendData(CometDSender.java:64)at packagename.ProcessorImp.processData(ProcessorImp.java:18)at packagename.TestSource.processNewData(TestSource.java:50)at packagename.TestSource.run(TestSource.java:36)at java.lang.Thread.run(Unknown Source) but when

  • user503413
    java spring websocket cometd
    I am using Spring annotations to initialize my BayeuxServer. I enabled websocket by setting the transport in my Spring bean – BayeuxServerImpl bean = new BayeuxServerImpl();bean.setTransports(new WebSocketTra

  • Manuel
    java comet cometd
    I’m trying to get started with CometD as I need some empirical background for a technical comparision between various push technologies.I finally managed to get an example code running in my Tomcat (v7.0). Now I’m having strange behavior and I’m desperately trying to find out what I did wrong. Here are my observations:Connection Loops:I’m running in an endless connection loop with the client.Request:[{“channel”:”/meta/connect”,”connectionType”:”long-polling”,”id”:”19″,”clientId”:”f1le33y91f6pa71f39z52km87yp”}]Response:[{“id”:”19″,”successful”:true,”advice”:{“interval”:2000,”reconnect”:”retry”,”multiple-clients”:true,”timeout”:60000},”channel”:”/meta/connect”}]The interesting thing about this is, that the Listener-callback event actually occurescometd.addListener(‘/meta/handshake’, _metaHandshake);Client connection request stucksThis mostly occurs after a fresh restart of my Tomcat server. I can see a successful subscription to 2 channels:Request[{“version”:”1.0″,”minimumVersion”:”0.9″,”channel”:”/meta/handshake”,”supportedConnectionTypes”:[“long-polling”,”callback-polling”],”advice”:{“timeout”:60000,”interval”:0},”id”:”1″}]Response[{“id”:”1″,”minimumVersion”:”1.

Originally posted 2013-11-09 19:44:06.