将消息推送到tapestry中的客户

时间:2016-04-01 17:29:05

标签: jquery tapestry atmosphere cometd

有没有办法将消息推送到tapestry中的客户端?我尝试过来而不是大气(就像2周一样)他们都没有为我工作。我有一些exanpe jquery冲突。 我的挂毯版本是5.3.6。

对于CometD ,这些是我正在使用的依赖项:

<dependency>
        <groupId>org.cometd.java</groupId>
        <artifactId>cometd-java-server</artifactId>
        <version>3.0.9</version>
</dependency>
<dependency>
            <groupId>org.lazan</groupId>
            <artifactId>tapestry-cometd</artifactId>
            <version>0.9.18</version> 
 </dependency>
<dependency>
            <groupId>org.cometd.java</groupId>
            <artifactId>cometd-websocket-jetty</artifactId>
            <version>2.4.3</version>
</dependency>
<dependency>
            <groupId>org.got5</groupId>
             <artifactId>tapestry5-jquery</artifactId>
            <version>3.4.2</version>
 </dependency>

这是我正在使用的存储库:

<repository>
        <id>tapestry-cometd</id>
        <url>https://raw.github.com/uklance/releases/master</url>
    </repository>

我的java页面:

Object onChat(String message) {
        this.message = message;
        return myZone.getBody();
    }

        Object onSuccess() {
            pushManager.broadcast("/chatTopic", message);
            return request.isXHR() ? formZone.getBody() : null;
        }

我的tml页面:

<t:zone t:id="formZone" id="formZone">
    <form t:id="ajaxForm" t:type="form" t:zone="formZone">
     Message: <input t:type="TextField" t:id="message" />  <input type="submit" value="Send"/>
    </form>
</t:zone>

<t:cometd.PushTarget topic="/chatTopic" event="chat" update="replace" />
<t:zone t:id="myZone" id="myZone" t:zone="myZone">
 <h2 t:zone="myZone"> ${message}</h2>
 </t:zone> 

这是我得到的错误:

2016-04-07 13:58:10.377:WARN :: failed app:java.lang.RuntimeException:Service id&#39; AjaxUploadDecoder&#39;已经由org.got5.tapestry5.jquery.services.AjaxUploadDecoderImpl(FileItemFactory)(在AjaxUploadDecoderImpl.java:23)通过org.got5.tapestry5.jquery.services.JQueryModule.bind(ServiceBinder)定义(在JQueryModule.java:并且可能不会通过org.cyberplix.internal.services.AjaxUploadDecoderImpl(FileItemFactory)(在AjaxUploadDecoderImpl.java:25)通过org.cyberplix.services.AppModule.bind(ServiceBinder)(在AppModule.java:81)重新定义。您应该重命名其中一个服务构建器方法。 2016-04-07 13:58:10.377:WARN ::上下文启动失败org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@3abbbb74 {/ homewarranty,C:\ HomeOneSource40 \ homewarranty \ src \ main \ webapp} java.lang.RuntimeException:服务ID&#39; AjaxUploadDecoder&#39;已经由org.got5.tapestry5.jquery.services.AjaxUploadDecoderImpl(FileItemFactory)(在AjaxUploadDecoderImpl.java:23)通过org.got5.tapestry5.jquery.services.JQueryModule.bind(ServiceBinder)定义(在JQueryModule.java:并且可能不会通过org.cyberplix.internal.services.AjaxUploadDecoderImpl(FileItemFactory)(在AjaxUploadDecoderImpl.java:25)通过org.cyberplix.services.AppModule.bind(ServiceBinder)(在AppModule.java:81)重新定义。您应该重命名其中一个服务构建器方法。     在org.apache.tapestry5.ioc.internal.RegistryImpl。(RegistryImpl.java:183)     在org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:177)     在org.apache.tapestry5.internal.TapestryAppInitializer.createRegistry(TapestryAppInitializer.java:200)     在org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:109)     在org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)     在org.mortbay.jetty.servlet.Context.startContext(Context.java:140)     at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)     在org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)     在org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)     在org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)     at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)     在org.mortbay.jetty.Server.doStart(Server.java:224)     在org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)     在org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)     在org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:454)     在org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:396)     在org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:210)     在org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:184)     在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)     在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)     在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)     在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)     在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)     在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)     在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)     在org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)     在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)     在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)     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:606)     在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)     在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)     在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)     在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 2016-04-07 13:58:10.391:INFO ::已启动SelectChannelConnector@0.0.0.0:8081 [INFO]启动了Jetty Server

0 个答案:

没有答案