beepcore-java-users Mailing List for Java BEEP Core
Status: Beta
Brought to you by:
huston
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(24) |
Feb
(3) |
Mar
(18) |
Apr
(2) |
May
(11) |
Jun
(6) |
Jul
(11) |
Aug
(37) |
Sep
(22) |
Oct
(11) |
Nov
(11) |
Dec
(29) |
2003 |
Jan
(8) |
Feb
(4) |
Mar
(19) |
Apr
(13) |
May
(16) |
Jun
(15) |
Jul
(2) |
Aug
(1) |
Sep
(1) |
Oct
(7) |
Nov
(13) |
Dec
|
2004 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
|
May
(3) |
Jun
(2) |
Jul
(8) |
Aug
|
Sep
(7) |
Oct
(15) |
Nov
(8) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
(6) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(5) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ben A. <ben...@st...> - 2007-06-25 09:05:19
|
Hello there I would greatly appreciate a small amount of your time to assist with my doctoral research at The University of Newcastle. The research concerns open source licensing and we're seeking developers working on Java projects. The research is supervised, ethics-approved, anonymous and results will be freely available. Participation will also provide a custom licensing report for your project. To learn more, please visit: http://licensing-research.newcastle.edu.au Thanks for reading this email, and I hope you'll consider participating. Best regards Ben Alex (My apologies for being off-topic; this list will not be emailed again) |
From: <eri...@be...> - 2006-10-11 17:06:35
|
Any help would be appreciated. Anyone could answer that? =20 -----Original Message----- From: Bussieres, Eric (EX11572)=20 Sent: October 6, 2006 2:50 PM To: 'bee...@li...' Subject: Thread waiting indefinitely =20 Hi, =20 I have one problem while waiting for a Reply after having sent a MSG. I send a message and wait for a reply. So the thread hangs on method lReply.hasNext(). If a disconnection occurs, the thread will still be waiting on the reply since nobody notify it. How could I fix this problem? =20 mChannel.sendMSG(new StringOutputDataStream("application/xml", lBuffer.toString()), lReply); =20 while (lReply.hasNext()) { do something ... } =20 Thanks ! |
From: <eri...@be...> - 2006-10-06 18:50:24
|
Hi, =20 I have one problem while waiting for a Reply after having sent a MSG. I send a message and wait for a reply. So the thread hangs on method lReply.hasNext(). If a disconnection occurs, the thread will still be waiting on the reply since nobody notify it. How could I fix this problem? =20 mChannel.sendMSG(new StringOutputDataStream("application/xml", lBuffer.toString()), lReply); =20 while (lReply.hasNext()) { do something ... } =20 Thanks ! |
From: William J. M. <wm...@es...> - 2006-10-03 18:11:25
|
That channel you opened is peer to peer, you should be able to send a MSG from A to B in there just fine. Either side can send messages in a channel as long as the profile supports it. -bill On Tue, Oct 03, 2006 at 01:39:58PM -0400, eri...@be... wrote: > Hi > > > > I have the following scenario: > > > > Server A listening on port 1234 > > Server B initiating a session on server A using BEEP > > Server B start a channel > > Server B sends a MSG and got a reply from server A. > > > > I want at this point that the server A sends a MSG to server B. But > server A can't send messages since it doesn't know which channel to use. > Also, Server B is not listening at all. How could I tell the Server B to > listen for MSG and tell server A which channel to use? Do I need to > create a new TCPSession.listen(port+1, profileRegistry) on server B and > on server A initiates a connection to the server B ??? > > > > Here's the source code for server A: > > > > ProfileRegistry = new ProfileRegistry(); > > mFlapProfile = new FlapProfile(); > > > > // Initialize the profile and add it to the advertised profiles > > ProfileRegistry.addStartChannelListener("http://sitacs.uow.edu.au/ns/loc > ation/flap/beep", > > > mFlapProfile.init("http://sitacs.uow.edu.au/ns/location/flap/beep", > null), > > null); > > > > public void run() { > > try { > > // Loop listening for new Sessions > > while (true) { > > TCPSessionCreator.listen(port, ProfileRegistry); > > } catch (Exception e) { > > log.error("Listener exiting", e); > > } > > } > > > > Here's the source code for server B > > public synchronized void run() { > > //Initiate a session with the server > > try { > > > > mSession = TCPSessionCreator.initiate(host, port); > > mChannel = mSession.startChannel(FlapProfile.URI); > > //send first MSG and got reply in this method > > initiateSync (); > > mChannel.setRequestHandler(this); > > > > while (mSession.getSocket().isConnected()) { > > //wait for incoming data what to do here ???? > > } > > > > } catch (BEEPError e) { > > if (e.getCode() == 550) { > > System.err.println("bing: Error host does not support " + > > "echo profile"); > > } else { > > System.err.println("bing: Error starting channel (" + > > e.getCode() + ": " + > > e.getMessage() + ")"); > > } > > return; > > } catch (BEEPException e) { > > System.err.println("bing: Error starting channel (" + > > e.getMessage() + ")"); > > return; > > } catch (InterruptedException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > } > > } > > > > private void initiateSync() { > > > > Reply reply = new Reply(); > > InputStream is = null; > > > > String lSync = "<?xml version='1.0' encoding='UTF-8'?>" + > > "<sync xsi:type='sync' xmlns='urn:flap'/>"; > > > > try { > > // Send the synchronization request > > mChannel.sendMSG(new StringOutputDataStream("application/xml", > lSync), > > reply); > > > > while (reply.hasNext()) { > > //Get the reply to the request > > is = reply.getNextReply().getDataStream().getInputStream(); > > > > Document lDoc = mDomBuilder.parse(is); > > //Convert the XML request to a Java object > > Unmarshaller lUnmarshaller = > mJaxBContext.createUnmarshaller(); > > JAXBElement instance = > (JAXBElement)lUnmarshaller.unmarshal(lDoc); > > SyncrType lSyncResponse = (SyncrType)instance.getValue(); > > > > //TODO Save information > > System.out.println("Save information"); > > } > > } catch (SAXException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > } catch (JAXBException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > } catch (BEEPInterruptedException e) { > > System.err.println("bing: Error receiving reply (" + > > e.getMessage() + ")"); > > e.printStackTrace(); > > } catch (BEEPException e) { > > System.err.println("bing: Error sending request (" + > > e.getMessage() + ")"); > > e.printStackTrace(); > > } catch (IOException e) { > > System.err.println("bing: Error receiving reply (" + > > e.getMessage() + ")"); > > e.printStackTrace(); > > } > > } > > > > Regards, > > Eric > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Beepcore-java-users mailing list > Bee...@li... > https://lists.sourceforge.net/lists/listinfo/beepcore-java-users |
From: <eri...@be...> - 2006-10-03 17:40:10
|
Hi =20 I have the following scenario: =20 Server A listening on port 1234 Server B initiating a session on server A using BEEP Server B start a channel Server B sends a MSG and got a reply from server A. =20 I want at this point that the server A sends a MSG to server B. But server A can't send messages since it doesn't know which channel to use. Also, Server B is not listening at all. How could I tell the Server B to listen for MSG and tell server A which channel to use? Do I need to create a new TCPSession.listen(port+1, profileRegistry) on server B and on server A initiates a connection to the server B ??? =20 Here's the source code for server A: =20 ProfileRegistry =3D new ProfileRegistry(); mFlapProfile =3D new FlapProfile(); =20 // Initialize the profile and add it to the advertised profiles ProfileRegistry.addStartChannelListener("http://sitacs.uow.edu.au/ns/loc ation/flap/beep", =20 mFlapProfile.init("http://sitacs.uow.edu.au/ns/location/flap/beep", null), null); =20 public void run() { try { // Loop listening for new Sessions while (true) { TCPSessionCreator.listen(port, ProfileRegistry); } catch (Exception e) { log.error("Listener exiting", e); } } =20 Here's the source code for server B public synchronized void run() { //Initiate a session with the server try { =20 mSession =3D TCPSessionCreator.initiate(host, port); mChannel =3D mSession.startChannel(FlapProfile.URI); //send first MSG and got reply in this method initiateSync (); mChannel.setRequestHandler(this); =20 while (mSession.getSocket().isConnected()) { //wait for incoming data what to do here ???? } =20 } catch (BEEPError e) { if (e.getCode() =3D=3D 550) { System.err.println("bing: Error host does not support " + "echo profile"); } else { System.err.println("bing: Error starting channel (" + e.getCode() + ": " + e.getMessage() + ")"); } return; } catch (BEEPException e) { System.err.println("bing: Error starting channel (" + e.getMessage() + ")"); return; } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); }=20 } =20 private void initiateSync() { =20 Reply reply =3D new Reply(); InputStream is =3D null; =20 String lSync =3D "<?xml version=3D'1.0' encoding=3D'UTF-8'?>" + "<sync xsi:type=3D'sync' xmlns=3D'urn:flap'/>"; =20 try { // Send the synchronization request mChannel.sendMSG(new StringOutputDataStream("application/xml", lSync), reply); =20 while (reply.hasNext()) { //Get the reply to the request is =3D reply.getNextReply().getDataStream().getInputStream(); =20 Document lDoc =3D mDomBuilder.parse(is); //Convert the XML request to a Java object Unmarshaller lUnmarshaller =3D mJaxBContext.createUnmarshaller(); JAXBElement instance =3D (JAXBElement)lUnmarshaller.unmarshal(lDoc); SyncrType lSyncResponse =3D (SyncrType)instance.getValue(); =20 //TODO Save information System.out.println("Save information"); } } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (JAXBException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (BEEPInterruptedException e) { System.err.println("bing: Error receiving reply (" + e.getMessage() + ")"); e.printStackTrace(); } catch (BEEPException e) { System.err.println("bing: Error sending request (" + e.getMessage() + ")"); e.printStackTrace(); } catch (IOException e) { System.err.println("bing: Error receiving reply (" + e.getMessage() + ")"); e.printStackTrace(); } } =20 =20 Regards, Eric =20 =20 |
From: Kin Ng <ki...@us...> - 2006-07-22 21:22:43
|
I will be out of the office starting 07/21/2006 and will not return until 07/24/2006. I may have limited access to email at night and will respond as soon as possible. |
From: Sanjeev S. <an...@ho...> - 2006-07-21 05:02:56
|
I figured out the classpath issues, In the debug view/tab Eclipse lets you click on the process and shows the exact Java command line it used. Thanks for this tip about excluding pureTLS and converting to jsse. I'll try it tomorrow, On Thu, Jul 20, 2006 at 09:08:53PM -0400, Andrew Newton wrote: >Perhaps there is some conflict with the JSSE that is now built-in to >Java. I'd not use PureTLS and just stick with the JSSE. > >-andy > >On Jul 20, 2006, at 5:40 PM, Sanjeev Sharma wrote: > > >I must be doing everything wrong that it's possible to do wrong. > > > >right now the build is stalling at tls, with > >\tls\org\beepcore\beep\profile\tls\ptls\TLSProfilePureTLS.java:35: > >package > >COM.claymoresystems.sslg does not exist > >import COM.claymoresystems.sslg.*; > > > > > >and this in another file > > > >Compiling 4 source files to > >C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\build\tls-ptls > >C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\tls\COM\claymoresystems > >\ptls\PureTLSPackageBridge.java:30: > >cannot find symbol > >symbol : class SSLContext > >location: class COM.claymoresystems.ptls.PureTLSPackageBridge > > public static void setPrivateKey( SSLContext ctx, > >PrivateKey key ) { > > > >javax.net.ssl has SSLContext but then that seems to have no Privatekey > >member. > > |
From: Andrew N. <an...@hx...> - 2006-07-21 01:09:04
|
Perhaps there is some conflict with the JSSE that is now built-in to Java. I'd not use PureTLS and just stick with the JSSE. -andy On Jul 20, 2006, at 5:40 PM, Sanjeev Sharma wrote: > I must be doing everything wrong that it's possible to do wrong. > > right now the build is stalling at tls, with > \tls\org\beepcore\beep\profile\tls\ptls\TLSProfilePureTLS.java:35: > package > COM.claymoresystems.sslg does not exist > import COM.claymoresystems.sslg.*; > > > and this in another file > > Compiling 4 source files to > C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\build\tls-ptls > C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\tls\COM\claymoresystems > \ptls\PureTLSPackageBridge.java:30: > cannot find symbol > symbol : class SSLContext > location: class COM.claymoresystems.ptls.PureTLSPackageBridge > public static void setPrivateKey( SSLContext ctx, > PrivateKey key ) { > > javax.net.ssl has SSLContext but then that seems to have no Privatekey > member. > > > ____________________ > I tried compiling and running the Bing and Beepd examples outside the > beepcore directory tree, just to get something working. Ive > tried java > 1.4 and 1.5. > > They run insinde Eclipse and NetBeans but refuse to run outside, > most end > with the error > > Exception in thread "main" java.lang.NoSuchMethodError: main > > I've looked up what this error means and nothing that I found seems > to fix > this. > > A few of the commands I tried > > java bing -port 1021 -count 1000 -size 100 vulcan > > java -classpath f:\work\TEST_BINARIES\example Bing -port 1021 - > count 1000 > -size 100 vulcan > > java -cp . Bing -port 1021 -count 1000 -size 100 vulcan > > > ___ > I also couldn't get the pre-compiled examples running because of the > main-class manifest requirements, so this command > > java -jar f:\work\TEST_BINARIES/example.jar > org.beepcore.beep.example.Bing > -port 1021 -count 1000 -size 100 vulcan > > gives me > > Failed to load Main-Class manifest attribute from > f:\work\TEST_BINARIES\example.jar > > > This will be part of my first big Java project, so my lack of Java > experience is probably making an already finicky thing harder > > Thanks in advance if you can help. > > > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys -- and earn > cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Beepcore-java-users mailing list > Bee...@li... > https://lists.sourceforge.net/lists/listinfo/beepcore-java-users |
From: Sanjeev S. <an...@ho...> - 2006-07-20 21:40:26
|
I must be doing everything wrong that it's possible to do wrong. right now the build is stalling at tls, with \tls\org\beepcore\beep\profile\tls\ptls\TLSProfilePureTLS.java:35: package COM.claymoresystems.sslg does not exist import COM.claymoresystems.sslg.*; and this in another file Compiling 4 source files to C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\build\tls-ptls C:\wrk_DA\beepcore-0.9.08\beepcore-0.9.08\tls\COM\claymoresystems\ptls\PureTLSPackageBridge.java:30: cannot find symbol symbol : class SSLContext location: class COM.claymoresystems.ptls.PureTLSPackageBridge public static void setPrivateKey( SSLContext ctx, PrivateKey key ) { javax.net.ssl has SSLContext but then that seems to have no Privatekey member. ____________________ I tried compiling and running the Bing and Beepd examples outside the beepcore directory tree, just to get something working. Ive tried java 1.4 and 1.5. They run insinde Eclipse and NetBeans but refuse to run outside, most end with the error Exception in thread "main" java.lang.NoSuchMethodError: main I've looked up what this error means and nothing that I found seems to fix this. A few of the commands I tried java bing -port 1021 -count 1000 -size 100 vulcan java -classpath f:\work\TEST_BINARIES\example Bing -port 1021 -count 1000 -size 100 vulcan java -cp . Bing -port 1021 -count 1000 -size 100 vulcan ___ I also couldn't get the pre-compiled examples running because of the main-class manifest requirements, so this command java -jar f:\work\TEST_BINARIES/example.jar org.beepcore.beep.example.Bing -port 1021 -count 1000 -size 100 vulcan gives me Failed to load Main-Class manifest attribute from f:\work\TEST_BINARIES\example.jar This will be part of my first big Java project, so my lack of Java experience is probably making an already finicky thing harder Thanks in advance if you can help. |
From: Lukas E. <eic...@do...> - 2006-06-02 15:07:45
|
Hello, I hope I can reanimate a bit this Mailing List. I am a newbie with BEEP and beepcore-java and have following Problem: I implement a connection to the Denic for the new Realtime Registry Interface which can be established over BEEP. It works fine, but now I want to check the remote certificate to ensure that I really speak with the denic server. (It is optional) I try it really simple like the following code show: --------------------------- // Create the BeepSession Instance beepSession = TCPSessionCreator.initiate (HOST, PORT); // Create the TLSProfile TLSProfile tls_profile = TLSProfileJSSE.getDefaultInstance (); // Some Tests, unfortunately without success /* ProfileConfiguration prConfig = new ProfileConfiguration(); prConfig.setProperty("Listener Anonymous", "true|false"); ... tls_profile.init(TLSProfile.URI, prConfig); */ // Adds the TLS support beepSession = tls_profile.startTLS ((TCPSession) beepSession); // Try to get the remote certificate SessionCredential sessCre = beepSession.getPeerCredential(); Object remoteCert = sessCre.getRemoteCertificate(); validateRemoteCert(remoteCert); --------------------------- Unfortunately the remote certificate is an empty Object (not null). Have anybody some ideas for me, what was going wrong here? Really Thanks for some comments and sorry for my English. Kind Regards, Lukas Eichhorn |
From: Wladimir A. <wa...@ju...> - 2005-12-07 14:45:31
|
I don't think using sendNul is the right thing to do. If your msg is complete, you should send a RPY. I send an empty RPY if the message I received is complete. I do this: ..... OutputDataStream os =3D new OutputDataStream(); os.setComplete(); message.sendRPY(os); ..... It doesn't matter when you send it. InputDataStream has a "copy" of the contents and they remain there until your handler returns. I don't think the RPY or NUL go out until the handler returns, so... I hope this helps.=20 Cheers, Wladimir=20 -----Original Message----- From: bee...@li... [mailto:bee...@li...] On Behalf Of Lukas Zbinden Sent: Wednesday, December 07, 2005 4:31 AM To: bee...@li... Subject: [Beepcore-java-users] reading from InputDataStream ends prematurely Hi I was wondering if someone knows the following problem and if a=20 workaround was found for it. At the recipient site of a channel connection, I read the=20 InputDataStream as follows (containing XML): public class MyRequestHandler implements RequestHandler { =09 public void receiveMSG(MessageMSG message) { InputDataStream input =3D message.getDataStream(); byte[] rawData =3D read(input); message.sendNul(); //parse XML... } public static byte[] read(InputDataStream stream) throws Exception { ByteArrayOutputStream out =3D new ByteArrayOutputStream(); do { BufferSegment b =3D stream.waitForNextSegment(); if (b =3D=3D null) { continue; } out.write(b.getData()); } while (!stream.isComplete()); out.flush(); return out.toByteArray(); } } When the sender site sends many messages in a short time=20 (channel.sendMSG(..) called at a high rate), it results in an=20 incomplete reading at the recipient site from the InputDataStream=20 delivered by the MessageMSG instance. I.e. it prematurely ends in=20 method read() and finally results in an XML parsing exception (since=20 not all data and XML, respectively, are read). Does anyone know that problem? Is it a bug in Java beepcore or am I=20 reading the InputDataStream the wrong way? I do have ensured that only one thread executes receiveMSG() at a time. Another interesting issue: Does it matter if sendNul() is called before=20 or after reading the InputDataStream? Thanks for any thoughts... -- Lukas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick _______________________________________________ Beepcore-java-users mailing list Bee...@li... https://lists.sourceforge.net/lists/listinfo/beepcore-java-users |
From: Lukas Z. <zb...@ht...> - 2005-12-07 09:31:28
|
Hi I was wondering if someone knows the following problem and if a workaround was found for it. At the recipient site of a channel connection, I read the InputDataStream as follows (containing XML): public class MyRequestHandler implements RequestHandler { public void receiveMSG(MessageMSG message) { InputDataStream input = message.getDataStream(); byte[] rawData = read(input); message.sendNul(); //parse XML... } public static byte[] read(InputDataStream stream) throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); do { BufferSegment b = stream.waitForNextSegment(); if (b == null) { continue; } out.write(b.getData()); } while (!stream.isComplete()); out.flush(); return out.toByteArray(); } } When the sender site sends many messages in a short time (channel.sendMSG(..) called at a high rate), it results in an incomplete reading at the recipient site from the InputDataStream delivered by the MessageMSG instance. I.e. it prematurely ends in method read() and finally results in an XML parsing exception (since not all data and XML, respectively, are read). Does anyone know that problem? Is it a bug in Java beepcore or am I reading the InputDataStream the wrong way? I do have ensured that only one thread executes receiveMSG() at a time. Another interesting issue: Does it matter if sendNul() is called before or after reading the InputDataStream? Thanks for any thoughts... -- Lukas |
From: Pete S. <si...@uc...> - 2005-12-05 17:43:21
|
I haven't seen much traffic on this list since I joined. It's good to see some. I found a bug in Java BEEP and reported it to the buglist at the BEEP SourceForge site. I just wonder - is that the right thing to do, or are other users using this list to talk about bugs? -- Pete Wladimir Araujo wrote: > I've run into this a couple of times. TCPSession has some race > conditions re the socket manipulation. What I do to avoid these problems > (all but one) is to guarantee that the channel and session cannot be > closed while sending messages (through external locks). Of course, if > the session is closed from the other side there is nothing we can do. In > this case, the NullPointerException kills the TCPSEssion thread (created > inside enableIO()). > > Fixing these problems is not trivial (chance of distributed deadlock), > so I decided it was easier to live with them ;-) > > Wladimir > -----Original Message----- > From: bee...@li... > [mailto:bee...@li...] On Behalf Of > Lukas Zbinden > Sent: Monday, December 05, 2005 6:21 AM > To: bee...@li... > Subject: [Beepcore-java-users] TCPSession.sendFrame: > NullPointerException > > Hi > > We use the beepcore java library in our diploma project 'a > collaborative editor'. > When two users collaboratively edit a document, each character is sent > over a channel by a call to > myChannelImplInstance.sendMSG(outputData, myReplylistener). > Both sides use the same channel. After a while (both users type very > fast, i.e. > channel.sendMSG(..) is called at a high rate), the following exception > occurs: > > Caused by: java.lang.NullPointerException > at > org.beepcore.beep.transport.tcp.TCPSession.sendFrame(TCPSession.java: > 291) > at > org.beepcore.beep.core.ChannelImpl.sendFrames(ChannelImpl.java:837) > at > org.beepcore.beep.core.ChannelImpl.sendQueuedMessages(ChannelImpl.java: > 773) > at > org.beepcore.beep.core.ChannelImpl.sendToPeer(ChannelImpl.java:754) > at > org.beepcore.beep.core.ChannelImpl.sendMSG(ChannelImpl.java:414) > at > ch.iserver.ace.net.impl.protocol.AbstractConnection.send(AbstractConnect > > ion.java:77) > at > ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendToPeer(Pa > > rticipantConnectionImpl.java:261) > at > ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendRequest(P > > articipantConnectionImpl.java:157) > at > ch.iserver.ace.collaboration.jupiter.server.ParticipantConnectionWrapper > > .sendRequest(ParticipantConnectionWrapper.java:177) > at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor > > Impl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection( > > AopUtils.java:335) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinp > > oint(ReflectiveMethodInvocation.java:181) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref > > lectiveMethodInvocation.java:148) > at > ch.iserver.ace.util.AsyncMethodInvocation.proceed(AsyncMethodInvocation. > > java:100) > at ch.iserver.ace.util.AsyncWorker.doWork(AsyncWorker.java:102) > at ch.iserver.ace.util.Worker.run(Worker.java:49) > > > Does anyone know this problem? Is it a bug or do I use the channel the > wrong way? > > Any help highly appreciated. > > Lukas > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Beepcore-java-users mailing list > Bee...@li... > https://lists.sourceforge.net/lists/listinfo/beepcore-java-users > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Beepcore-java-users mailing list > Bee...@li... > https://lists.sourceforge.net/lists/listinfo/beepcore-java-users > |
From: Wladimir A. <wa...@ju...> - 2005-12-05 15:13:22
|
I've run into this a couple of times. TCPSession has some race conditions re the socket manipulation. What I do to avoid these problems (all but one) is to guarantee that the channel and session cannot be closed while sending messages (through external locks). Of course, if the session is closed from the other side there is nothing we can do. In this case, the NullPointerException kills the TCPSEssion thread (created inside enableIO()). Fixing these problems is not trivial (chance of distributed deadlock), so I decided it was easier to live with them ;-) Wladimir=20 -----Original Message----- From: bee...@li... [mailto:bee...@li...] On Behalf Of Lukas Zbinden Sent: Monday, December 05, 2005 6:21 AM To: bee...@li... Subject: [Beepcore-java-users] TCPSession.sendFrame: NullPointerException Hi We use the beepcore java library in our diploma project 'a =20 collaborative editor'. When two users collaboratively edit a document, each character is sent =20 over a channel by a call to myChannelImplInstance.sendMSG(outputData, myReplylistener). Both sides use the same channel. After a while (both users type very =20 fast, i.e. channel.sendMSG(..) is called at a high rate), the following exception =20 occurs: Caused by: java.lang.NullPointerException at =20 org.beepcore.beep.transport.tcp.TCPSession.sendFrame(TCPSession.java:=20 291) at =20 org.beepcore.beep.core.ChannelImpl.sendFrames(ChannelImpl.java:837) at =20 org.beepcore.beep.core.ChannelImpl.sendQueuedMessages(ChannelImpl.java:=20 773) at =20 org.beepcore.beep.core.ChannelImpl.sendToPeer(ChannelImpl.java:754) at =20 org.beepcore.beep.core.ChannelImpl.sendMSG(ChannelImpl.java:414) at =20 ch.iserver.ace.net.impl.protocol.AbstractConnection.send(AbstractConnect ion.java:77) at =20 ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendToPeer(Pa rticipantConnectionImpl.java:261) at =20 ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendRequest(P articipantConnectionImpl.java:157) at =20 ch.iserver.ace.collaboration.jupiter.server.ParticipantConnectionWrapper .sendRequest(ParticipantConnectionWrapper.java:177) at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) at =20 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at =20 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection( AopUtils.java:335) at =20 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinp oint(ReflectiveMethodInvocation.java:181) at =20 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref lectiveMethodInvocation.java:148) at =20 ch.iserver.ace.util.AsyncMethodInvocation.proceed(AsyncMethodInvocation. java:100) at ch.iserver.ace.util.AsyncWorker.doWork(AsyncWorker.java:102) at ch.iserver.ace.util.Worker.run(Worker.java:49) Does anyone know this problem? Is it a bug or do I use the channel the =20 wrong way? Any help highly appreciated. Lukas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick _______________________________________________ Beepcore-java-users mailing list Bee...@li... https://lists.sourceforge.net/lists/listinfo/beepcore-java-users |
From: Lukas Z. <zb...@ht...> - 2005-12-05 11:20:53
|
Hi We use the beepcore java library in our diploma project 'a collaborative editor'. When two users collaboratively edit a document, each character is sent over a channel by a call to myChannelImplInstance.sendMSG(outputData, myReplylistener). Both sides use the same channel. After a while (both users type very fast, i.e. channel.sendMSG(..) is called at a high rate), the following exception occurs: Caused by: java.lang.NullPointerException at org.beepcore.beep.transport.tcp.TCPSession.sendFrame(TCPSession.java: 291) at org.beepcore.beep.core.ChannelImpl.sendFrames(ChannelImpl.java:837) at org.beepcore.beep.core.ChannelImpl.sendQueuedMessages(ChannelImpl.java: 773) at org.beepcore.beep.core.ChannelImpl.sendToPeer(ChannelImpl.java:754) at org.beepcore.beep.core.ChannelImpl.sendMSG(ChannelImpl.java:414) at ch.iserver.ace.net.impl.protocol.AbstractConnection.send(AbstractConnect ion.java:77) at ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendToPeer(Pa rticipantConnectionImpl.java:261) at ch.iserver.ace.net.impl.protocol.ParticipantConnectionImpl.sendRequest(P articipantConnectionImpl.java:157) at ch.iserver.ace.collaboration.jupiter.server.ParticipantConnectionWrapper .sendRequest(ParticipantConnectionWrapper.java:177) at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection( AopUtils.java:335) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinp oint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref lectiveMethodInvocation.java:148) at ch.iserver.ace.util.AsyncMethodInvocation.proceed(AsyncMethodInvocation. java:100) at ch.iserver.ace.util.AsyncWorker.doWork(AsyncWorker.java:102) at ch.iserver.ace.util.Worker.run(Worker.java:49) Does anyone know this problem? Is it a bug or do I use the channel the wrong way? Any help highly appreciated. Lukas |
From: Gilberto M. <gil...@fu...> - 2005-09-16 10:06:10
|
Hi Could anyone help me about TLS profile? I'm a newbie in Beep protocol When I send a message over a channel I have this error: 16-set-2005 11.50.50 org.beepcore.beep.transport.tcp.TCPSession processNextFrame GRAVE: javax.net.ssl.SSLException: Unsupported record version Unknown 83.71 16-set-2005 11.50.50 org.beepcore.beep.core.SessionImpl terminate GRAVE: Unsupported record version Unknown 83.71 This is my code The initiator: ... ProfileRegistry reg = Utility.setProfileRegistry(); // Initiate a session with the sync4j side server Session session; try { //start session session = TCPSessionCreator.initiate(host, port, reg); // set TLS mode for session session = TLSProfile.getDefaultInstance().startTLS((TCPSession) session); } catch (BEEPException e) { e.printStackTrace(); } ... the listener ... ProfileRegistry reg = Utility.setProfileRegistry(); try { // Loop listening for new Sessions while (true) { TCPSession tcpSession = TCPSessionCreator.listen(port, reg); } } catch (Exception e) { System.out.println("Listener exiting"); } ... In the "Utility.setProfileRegistry()" method I set two profile: TLS and a proprietary protocol |
From: Gilberto M. <gil...@fu...> - 2005-09-09 09:03:46
|
I'm newbie about beep and beep based application. Can anyone help me with some documentation? In brief this is my project: I have to connect two peers. Only one can open the connection, then both peers can send message and response. I saw the echo example but I need more information. Thanks everybody. Cheers gilberto |
From: Daan H. <daa...@lu...> - 2005-09-08 12:59:34
|
Gentlepeople, I am using beep with tls to communicate between an OSGi gateway and a J2EE server. Both can initiate communication. I have a problem in the gateway. My code tries to instantiate a TLSProfile with TLSProfile.getDefaultInstance() which uses the current threads classloader. I have no control on what thread calls my code however. I could change the (beepcore)code to set the classloader to use or I could instantiate TLSProfileJSSE directly from my code. I tend to the first option. Does somebody have some arguments for me, please? One way or the other. thanks, |
From: Daan H. <daa...@lu...> - 2005-07-26 08:51:54
|
LS, In the class SessionImpl, sessionListeners and channelListeners are registered in a LinkedList and in an array. The LinkedList is synchronised, but the code synchronising the array with the state of the linked list isn't. Does anyone know a good reason for this double registration? Or does anybody know how the library will break if the array (and the access to it) is removed? -- <insert value="your favorite astute quote" id="sigquote" /> ----------------------------- Daan Hoogland software architect ----------------------------- daa...@lu... 0620442544 www.luminis.nl ----------------------------- <or ref="sigquote" /> |
From: Daan H. <daa...@lu...> - 2005-07-26 08:45:02
|
LS, It has come to our attention that in the beepcore-java code the client starting a channel can send a close but not receive one. This can lead to null pointer exceptions when the server closes the channel The way around this is to register a channel listener and look in events whether this event concerns its own channel. Wouldn't it be more efficient to make clients register a listener as they request a channel? This listener would only gets events for its own channel. And shouldn't a client be encouraged to register such a listener by the api? -- <insert value="your favorite astute quote" id="sigquote" /> ----------------------------- Daan Hoogland software architect ----------------------------- daa...@lu... 0620442544 www.luminis.nl ----------------------------- <or ref="sigquote" /> |
From: William J. M. <wm...@es...> - 2005-07-06 08:25:54
|
It should be valid to have multiple MSG frames pening waiting for RPY, and they can be delivered to the peer. It's not defined whether an implementation must send all frames pending outbound if the window is not full, but it is the preferred behavior :) I don't know the java implementation, if thats the bug you are fixing, I'd say it is valid. -bill > Yes, I found this in the rfc. But, does this mean that it can be send > but will remain in queue untill the previous message is sent or does > this mean that it is illegal to send a message untill the previous has > had a valid reply? > > And should a BEEP implemetation prevent the second massage being sent? > |
From: Daan H. <daa...@lu...> - 2005-07-06 08:21:40
|
William J. Mills wrote: >You must send a RPY or an ANS/NUL sequence. It is the correct behavior >not to process the next MSG before the previous message is completed. > > Yes, I found this in the rfc. But, does this mean that it can be send but will remain in queue untill the previous message is sent or does this mean that it is illegal to send a message untill the previous has had a valid reply? And should a BEEP implemetation prevent the second massage being sent? >-bill > >On Tue, Jul 05, 2005 at 05:17:49PM +0200, Daan Hoogland wrote: > > >>LS, >> >>A collegue of mine wrote a patch to beepcore-java's ChannelImpl. The >>issue we had was that it was not possible to not reply to a message and >>then send a second message from the same peer. The specifications say >>that it should be possible to send zero (or more) replies, so we felt >>this patch was legal. Any ideas anybody? >> >> -- <insert value="your favorite astute quote" id="sigquote" /> ----------------------------- Daan Hoogland software architect ----------------------------- daa...@lu... 0620442544 www.luminis.nl ----------------------------- <or ref="sigquote" /> |
From: William J. M. <wm...@es...> - 2005-07-05 18:17:42
|
You must send a RPY or an ANS/NUL sequence. It is the correct behavior not to process the next MSG before the previous message is completed. -bill On Tue, Jul 05, 2005 at 05:17:49PM +0200, Daan Hoogland wrote: > LS, > > A collegue of mine wrote a patch to beepcore-java's ChannelImpl. The > issue we had was that it was not possible to not reply to a message and > then send a second message from the same peer. The specifications say > that it should be possible to send zero (or more) replies, so we felt > this patch was legal. Any ideas anybody? > > -- > <insert value="your favorite astute quote" id="sigquote" /> > ----------------------------- > Daan Hoogland > software architect > ----------------------------- > daa...@lu... > 0620442544 > www.luminis.nl > ----------------------------- > <or ref="sigquote" /> > > diff -ur beepcore-0.9.08/src/org/beepcore/beep/core/ChannelImpl.java beepcore/src/org/beepcore/beep/core/ChannelImpl.java > --- beepcore-0.9.08/src/org/beepcore/beep/core/ChannelImpl.java 2003-11-18 08:28:46.000000000 +0100 > +++ beepcore/src/org/beepcore/beep/core/ChannelImpl.java 2005-07-05 14:58:31.000000000 +0200 > @@ -351,17 +351,36 @@ > return this.session; > } > > - public void run() { > - MessageMSGImpl m; > - synchronized (recvMSGQueue) { > - m = (MessageMSGImpl) recvMSGQueue.getFirst(); > - synchronized (m) { > - m.setNotified(); > - } > - } > - > - handler.receiveMSG(m); > - } > + /** > + * Handles first unnotified message in received-message-queue by delivering it to the current > + * request handler. The message is set notified. If the queue is empty, or all messages are > + * already notified, nothing is done. > + */ > + public void run() { > + boolean messageFound = false; > + MessageMSGImpl message = null; > + // find unnotified message > + synchronized (recvMSGQueue) { > + for (Iterator messageIter = recvMSGQueue.iterator(); messageIter.hasNext();) { > + MessageMSGImpl currentMessage = (MessageMSGImpl) messageIter.next(); > + // if message has not been handled yet > + if (!currentMessage.isNotified()) { > + currentMessage.setNotified(); > + message = currentMessage; > + messageFound = true; > + break; > + } > + } > + } > + // deliver message to request handler if unnotified message has been found > + if (messageFound) > + handler.receiveMSG(message); > + else > + log.warn("All messages in queue has already been delivered to the request handler"); > + } > + > + > + > > /** > * Sends a message of type MSG. > @@ -485,10 +504,12 @@ > m = (MessageMSGImpl) recvMSGQueue.getLast(); > > if (m.getMsgno() != frame.getMsgno()) { > + // frame does not belong to previous message > m = null; > } > } > > + // if frame belongs to previous message > if (m != null) { > /// Move this code to DataStream... > Iterator i = frame.getPayload(); > @@ -504,24 +525,42 @@ > > return; > } > - > + // else if frame does not belong to previous message > m = new MessageMSGImpl(this, frame.getMsgno(), > new InputDataStream(this)); > > - m.setNotified(); > + // assumption: > + // notified message means message has been delivered to request handler > + // change: > + // disabled statement below and notify message only after it has been > + // retreived from the queue for delivery to the request handler, see run() > + // method > + > + // m.setNotified(); > > Iterator i = frame.getPayload(); > while (i.hasNext()) { > m.getDataStream().add((BufferSegment)i.next()); > } > > + // if frame is last (and here also first!): frame contains complete message > if (frame.isLast()) { > m.getDataStream().setComplete(); > } > - > + > recvMSGQueue.addLast(m); > > - if (recvMSGQueue.size() == 1) { > + // assumption: > + // received-message-queue can contain several messages since a message > + // is only removed if it is of type MESSAGE_TYPE_RPY, MESSAGE_TYPE_ERR or > + // MESSAGE_TYPE_NUL. Messages of type MESSAGE_TYPE_MSG will never be removed > + // from the queue. > + // change: > + // changed statement 'if (recvMSGQueue.size() == 1) {' into > + // 'if (recvMSGQueue.size() > 0) {' > + > + // if message queue contains at least 1 message > + if (recvMSGQueue.size() > 0) { > try { > callbackQueue.execute(this); > } catch (InterruptedException e) { |
From: Daan H. <daa...@lu...> - 2005-07-05 15:14:09
|
LS, A collegue of mine wrote a patch to beepcore-java's ChannelImpl. The issue we had was that it was not possible to not reply to a message and then send a second message from the same peer. The specifications say that it should be possible to send zero (or more) replies, so we felt this patch was legal. Any ideas anybody? -- <insert value="your favorite astute quote" id="sigquote" /> ----------------------------- Daan Hoogland software architect ----------------------------- daa...@lu... 0620442544 www.luminis.nl ----------------------------- <or ref="sigquote" /> |
From: Kan D. <kan...@ho...> - 2005-05-27 10:29:35
|
Hi, there, Is it possible to send a serializable java object in message? On the client side, I tried, channel.sendMSG(new ByteOutputDataStream(objectToBytes(reqObj)), reply); in which objectToBytes() is my own implementation to convert a serializable object into a byte array. On the server side, InputDataStream ds = message.getDataStream(); BufferSegment b = ds.waitForNextSegment(); byte[] reqBytes = b.getData(); ByteArrayInputStream bain = new ByteArrayInputStream(reqBytes); ObjectInputStream ois = new ObjectInputStream(bain); Unfortunately, this approach doesn't work. I compared the objectToBytes(reqObj) on the client side with the reqBytes on the server side, they are different. The server side's reqBytes has following bytes at the beginning, before the bytes sent by the client appears. aced 0005 7572 0002 5b42 acf3 17f8 0608 54e0 0200 0078 7000 0000 7b0d 0a Also, as a test, I send an object with 150k bytes. The server cannot receive all the bytes. Can you please tell me how to work around? For example, is it possible to use OutputDataStreamAdapter, and how to use it? many thanks, Kan _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 |