Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Member
    Join Date
    Jul 2007
    Location
    Hanoi
    Posts
    4

    How to debug codes with Lightstreamer

    Hi all,
    I am trying to modify the StockListDemo Data Adapter to pull data from a sql database. Anyone can tell me how i can debug with LightStreamer codes? Thanks

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    With eclipse 3.3 (but it should be similar with any IDE)

    Install Lightstreamer and remove from LS_HOME/Adapters/StockList the lib folder.

    Obviously create a project with the sources.

    Add lightstreamer.jar and ls-adapter-interface.jar to the build path of the project: right click on the project -> properties -> Java Build Path -> Librearies folder -> Add External JARs. You can find those jars on the LS_HOME/lib folder. Now the project should not show any compile error.

    Create a launch configuration: Run -> Open Debug Dialog -> Double click on Java application. A new launch configuration is created. Now we should configure it:
    • "Main" folder -> As main class set "com.lightstreamer.LS"
    • "Arguments" folder -> as Program arguments set "conf/lightstreamer_conf.xml"
    • "Arguments" folder -> as VM Arguments add "-Dlightstreamer.native.path=lib/native"
      [Just in case you use a JVM 1.5 or older]
    • "Arguments" folder -> as VM Arguments add "-Xms64M -Xmx512M" (you can configure those values as you like or omit them completely)
    • "Arguments" folder -> as Working directory set the LS_HOME path (in my case "C:\Programs\Lightstreamer")
    • "Classpath" folder -> click on user entries and then click on Add External JARs. Select all the jars located under LS_HOME/lib (but not lightstreamer.jar and ls-adapter-interface.jar that are already on the classpath)
    Click debug and you're ready to debug your adpater running inside Lightstreamer.

    Hope that helps.
    Let me know if I forgot something or some clarification is needed.

  3. #3
    Member
    Join Date
    Jul 2007
    Location
    Geneve
    Posts
    1
    Hello Mone or others
    I am trying to modify the Stocklist _DemoData Adapter to pull data from our mySQL database. I am not very familiar to Java but my experience with other languages, java is quite friendly. I am developing with the version on Linux. Could you please give me detailed instructions to build the project and compile, debug on linux? I think I need to modify the ExternalFeedSimulator, then how to compile and make the modification available to LightStreamer.
    Sorry that if you may find the questions novice since I am starting to understand how Lightstreamer work.
    Thanks a lot

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    para,
    please take a look here: http://www.lightstreamer.com/vb/showthread.php?t=23

    detailed instructions to build the project and compile
    Install the eclipse IDE and follow the instructions from my previous post and let me know if at any point you get lost.

  5. #5
    Member
    Join Date
    Oct 2007
    Location
    Hochiminh
    Posts
    9
    I managed to run LightStreamer server in Eclipse 3.3 but it runs in unregistered mode How can I make it run in registered mode ? By the way, could you please give me some more details about debuging a source code (line to line) after I make the LightStreamer run? Thanks so much

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    To run Lightstreamer Moderato in registered mode, you need to get a Free License. Pelase follow this link to get the license.

  7. #7
    Member
    Join Date
    Oct 2007
    Location
    Hochiminh
    Posts
    9
    Quote Originally Posted by Alessandro
    To run Lightstreamer Moderato in registered mode, you need to get a Free License. Pelase follow this link to get the license.
    I already got a Free License with my MAC address, there's no problem if I run the file 'Start_LS_as_Application.bat' in command, but in Eclipse it gives the following messages :
    07.Nov.07 09:16:06,578 < INFO> Starting MAC address check
    07.Nov.07 09:16:07,796 <FATAL> Could not check license.
    07.Nov.07 09:16:07,796 < WARN> A proper Free License was not configured.....

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi

    Make sure that all settings in the launch script are replicated in your launch configuration for Eclipse.
    The reported problem may occur if the lightstreamer.native.path initialization is missing or the supplied path is not correct.
    Assuming the "Lightstreamer" directory is used as the working directory, the JVM arguments should include:
    -Dlightstreamer.native.path=lib/native
    May you please check this first?

    Dario

  9. #9
    Member
    Join Date
    Oct 2007
    Location
    Hochiminh
    Posts
    9
    Thank DarioCrivelli verry much, it works in registered mode now. Now I'll try to debug my Adapter like debuging a tomcat web application

  10. #10
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    I've modified the original post accordingly to Dario's post.

 

 

Similar Threads

  1. Internal cause codes & Session callbacks
    By jonasby1 in forum General
    Replies: 4
    Last Post: February 16th, 2012, 09:47 AM
  2. Internal cause codes
    By BKnight in forum General
    Replies: 3
    Last Post: February 10th, 2012, 10:33 AM
  3. How to debug .NET DataAdapter
    By msgiribabu in forum Adapter SDKs
    Replies: 1
    Last Post: January 21st, 2011, 02:38 PM
  4. How to config eclipse to debug lightstreamer.
    By gengliangyu2008 in forum General
    Replies: 2
    Last Post: November 10th, 2010, 11:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 08:42 AM.