こんにちはすべてにJavaからデータをプッシュproblems-。しかし、それからメソッドを呼び出しているようMessageBrokerServletが初期化取得されていないか、一部が、思わ:MessageBrokerServletの初期化は、Flexアプリケーション
flex.messaging.config.LoginCommandSettings.setMatch()
結局私はこの方法が実際にそのクラス(LoginCommandSettings)に存在していないことが分かりました。私はそこに何か間違っていますか?
これは、Tomcatのログはこう言われる、
2012-01-24 14:04:57 StandardContext[/mywebapp]StandardWrapper.Throwable
java.lang.NoSuchMethodError: flex.messaging.config.LoginCommandSettings.setMatch(Ljava/lang/String;)V
at flex.messaging.config.ServerConfigurationParser.securitySection(ServerConfigurationParser.java:172)
at flex.messaging.config.ServerConfigurationParser.parseTopLevelConfig(ServerConfigurationParser.java:53)
at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:77)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:101)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
2012-01-24 14:04:57 StandardWrapperValve[MessageBrokerServlet]: Allocate exception for servlet MessageBrokerServlet
javax.servlet.ServletException: Servlet.init() for servlet MessageBrokerServlet threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1071)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
—– Root Cause —–
java.lang.NoSuchMethodError: flex.messaging.config.LoginCommandSettings.setMatch(Ljava/lang/String;)V
at flex.messaging.config.ServerConfigurationParser.securitySection(ServerConfigurationParser.java:172)
at flex.messaging.config.ServerConfigurationParser.parseTopLevelConfig(ServerConfigurationParser.java:53)
at flex.messaging.config.AbstractConfigurationParser.parse(AbstractConfigurationParser.java:68)
at flex.messaging.config.FlexConfigurationManager.getMessagingConfiguration(FlexConfigurationManager.java:77)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:101)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:619)
私はプログラミングやWebアプリケーションを展開するためののtomcatサーバ - ジャカルタ - tomcatに-5.0.28を使って曲げるために新しいです。 messaging-config.xml、services-config.xmlにすべての変更を加え、データをプッシュし続けるスレッドを備えたJavaクラスを作成しました。
は、私は私のJavaコードで2つのライブラリを使用しています
BlazeDSの共通-3.0
フレックスメッセージング
私は最後の2日間以来、これで立ち往生しています... この文脈ではどんな助けも大いに評価されるでしょう...
事前に感謝!
-Adwait
これは私のメッセージング-config.xmlにある:
<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service"
class="flex.messaging.services.MessageService">
<adapters>
<adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
<adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
<adapter-definition id="feed" class="packagename.className"/>
</adapters>
<destination id="feed">
<properties>
<network>
<session-timeout>0</session-timeout>
</network>
<server>
<max-cache-size>1000</max-cache-size>
<message-time-to-live>0</message-time-to-live>
<durable>false</durable>
</server>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
</destination>
</service>
そしてこれはある私のファイルAS:
import mx.messaging.Consumer;
import mx.messaging.events.MessageEvent;
import mx.messaging.events.MessageFaultEvent;
import mx.messaging.messages.IMessage;
private var listner: Consumer;
// functio to handle the creationComplete event:
public function ccHandler(): void {
listner = new Consumer();
listner.addEventListener(MessageEvent.MESSAGE, onReceiveMessageFromServer);
listner.addEventListener(MessageFaultEvent.FAULT, onFailedReceiveMessageFromServer);
}
// receive message handler:
private function onReceiveMessageFromServer(message: IMessage): void {
lblMessageReceivedFromServer.text = message.body.toString();
}
// fault message handler:
private function onFailedReceiveMessageFromServer(message: IMessage): void {
lblMessageReceivedFromServer.text = "Error when receiving message from 'feed'";
}
Javaクラス(宛先)定期的にデータを送信するためにインターバル:
import flex.messaging.MessageBroker;
import flex.messaging.messages.AsyncMessage;
import flex.messaging.messages.Message;
import flex.messaging.services.ServiceAdapter;
import flex.messaging.util.UUIDUtils;
/**
*
* @author adeshpande
*/
public class ServerPushManager extends ServiceAdapter {
private volatile boolean running;
public static void sendMessageToClients() {
// random no. to send to client:
double dNumber = 0;
// set the message broker
final MessageBroker msgBroker = MessageBroker.getMessageBroker(null);
// set the UUID:
final String clientId = UUIDUtils.createUUID(false);
// create the message to send and set parameters
final AsyncMessage msg = new AsyncMessage();
msg.setDestination("feed");
msg.setClientId(clientId);
msg.setMessageId((UUIDUtils.createUUID(false)));
msg.setTimestamp(System.currentTimeMillis());
dNumber = Math.random()*100;
msg.setBody(dNumber);
System.out.println("\n---- Message to send: " +dNumber +" ----\n");
// send the message into the message routing system:
msgBroker.routeMessageToService(msg, null);
}
/*
private void sendMessageToClients(Message msg) {
((MessageService) getDestination().getService()).pushMessageToClients(msg, false);
}
*/
@Override // flex.messaging.services.ServiceAdapter ---> start()
public void start(){
super.start();
Thread messageSender = new Thread(){
@Override
public void run(){
running = true;
while(running){
sendMessageToClients();
secondsToSleep(3);
}
}
};
messageSender.start();
}
@Override // flex.messaging.services.ServiceAdapter ---> stop()
public void stop(){
super.stop();
running = false;
}
@Override
public Object invoke(Message message) {
if (message.getBody().equals("stop")) {
running = false;
}
return null;
}
private void secondsToSleep(int seconds) {
try{
Thread.sleep(seconds * 1000);
}
catch(InterruptedException e){
System.out.println("TestServiceAdapter Interrupted while sending messages");
e.printStackTrace();
}
}
}
こんにちは、あなたはLoginCommandSettings.setMatchメソッドの解決策を見つけましたか? –
まだ、何かをしようとしていますが、他のいくつかの作業を始めました...もしあなたが共有することがあれば、どうかしてください... –