[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem in code



Manpreet Singh wrote:
> 
> Hi Marcel,
> 
> We tried writing a client to send the message to the server but in vain.
> 
> The follwing is the code for ur refrence. We get a NullPointer when we run the code. Basically the instantiation of TestBlaster fails.

1. You forgot to login, then it runs fine (see attachment).

2. As you only publish (and don't want to receive)
  i removed the update() method in your example.
  (and  implements org.xmlBlaster.client.I_Callback is removed)

3. I have added args/help processing in main()
  Try 
     java TestBlaster -?


Don't forget to start the server as well:

  jaco org.xmlBlaster.Main


See 
  xmlBlaster/demo/javaclients/corba/ClientSub.java
how to subscribe or receive the message.




> Also in ur previous mail u mentioned the following line:
> 
>          ProductDB --Msg--> xmlBlaster -Msg-> WebDB
> 
> Now we have a fundamental doubt here. Where exactly is the Blaster server running?? Is it running on the ProductDB or the WebDB or both.

Start it where you wish and try

  java TestBlaster  -iorHost ahost.acompany.com

to locate it from your client if you
started xmlBlaster on the server "ahost.acompany.com"

You need only ONE xmlBlaster server of course.


Or for example use 

  java TestBlaster  -iorHost ahost.company.com  -iorPort 7609

if you wish another port. In this case xmlBlaster needs to
be startet on the other port as well:

  jaco org.xmlBlaster.Main  -iorPort 7609


You can even start xmlBlaster server in a thread of your
client using

  xmlBlaster/src/java/org/xmlBlaster/util/ServerThread.java

You find an example in the testsuite  TestFailSave.java.



> 
> Lastly, we went thro the testsuite code but what we are trying to develop would be a set of console based java classes which would be sending and receiving messages.
> Just to throw an example, probably we would like to have a couple of classes for handling the messages. These would have message sender and receiver methods. All the testsuite classes derive from TestCase and that should not be the case here right?

Yes, you don't need TestCase
See 
  xmlBlaster/demo/javaclients/corba/
examples.

> 
> In anticipation of ur help!
> Manpreet Singh
> --------------
> rediff.com
> 
enjoy

Marcel
-- 
Marcel Ruff
mailto:ruff at swand.lake.de
http://www.lake.de/home/lake/swand/
http://www.xmlBlaster.org

Attachment: TestBlaster.java
Description: Binary data