Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2011
    Location
    Beaverton
    Posts
    2

    adapting the stock demo adapter

    I made a minor change to the stock demo to see it at a faster speed:

    public long computeNextWaitTime() {
    long millis;
    /**do {
    millis = (long) gaussian(mean, stddev);
    } while (millis <= 0);
    **/
    millis = 100;
    return millis;
    }

    I copied the resulting classes to Lightstreamer/adapters/Demo/stocklist/classes
    I removed the demos jar files from Lightstreamer/adapters/Demo/stocklist/lib
    When I start lightstreamer it produces an error message :
    Error while loading the Adapters: stocklist_demoadpaters.SockQuotesDataAdapter

    I didn't think I needed to produce jar files since 'hello world' tutorial used only the class files and no jar files.

    What steps do I need to take to use my modified files as the data adapter?

    thanks

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    970
    Your steps seem correct:
    you can remove the existing jar, then produce ".class" files for your own version of the Adapter and put them in the "class" directory;
    obviously, the whole directory tree where each class is in a directory representing its package should be copied.

    There may be a typo in the names. For instance, the package and class names reported in your error message contain a couple of typos.

    By the way, we expected more log related with an Adapter loading issue, with more insights on the error;
    may you please show us the whole log?

  3. #3
    Member
    Join Date
    Dec 2011
    Location
    Beaverton
    Posts
    2
    00:24:50,268|INFO |LightstreamerLogger.init |Init for DEMO.QUOTE_ADAPTER|Loading Data Adapter DEMO.QUOTE_ADAPTER
    17-Jan-12 00:24:50,278|ERROR|LightstreamerLogger.init |Init for DEMO.QUOTE_ADAPTER|Data Adapter DEMO.QUOTE_ADAPTER init error: java.lang.ClassNotFoundException: stocklist_demo.adapters.StockQuotesDataAdapter
    17-Jan-12 00:24:50,281|ERROR|LightstreamerLogger.init |main |Error while loading the Adapters: java.lang.ClassNotFoundException: stocklist_demo.adapters.StockQuotesDataAdapter
    17-Jan-12 00:24:50,282|ERROR|LightstreamerLogger.init |main |Error while loading the Adapters: stocklist_demo.adapters.StockQuotesDataAdapter
    17-Jan-12 00:24:50,282|FATAL|LightstreamerLogger.init |main |Adapters initialization failed

    I did not change anything besides what is shown in my first post. So I'm still using the original class name copied here:
    public class StockQuotesDataAdapter implements DataProvider {

    And here are the contents of the class directory noted above{
    Volume in drive K is New Volume
    Volume Serial Number is 665E-6611

    Directory of K:\work\Lightstreamer_Allegro\adapters\Demo\stockl ist\classes

    01/18/2012 08:18 PM <DIR> .
    01/18/2012 08:18 PM <DIR> ..
    01/18/2012 08:18 PM 0 dir.txt
    01/16/2012 10:58 PM 213 ExternalFeedListener.class
    01/16/2012 11:41 PM 3,913 ExternalFeedSimulator$MyProducer.class
    01/16/2012 11:41 PM 8,154 ExternalFeedSimulator.class
    12/06/2011 04:45 PM 129 README.TXT
    01/16/2012 10:58 PM 2,067 StockQuotesDataAdapter$MyFeedListener.class
    01/16/2012 10:58 PM 4,596 StockQuotesDataAdapter.class
    7 File(s) 19,072 bytes
    2 Dir(s) 1,679,099,641,856 bytes free
    Thanks.



    17-Jan-12 0

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    970
    What's missing seems to be the directory tree which should reflect the package names.
    In short: look at the contents of the original LS_StockListDemo_DataAdapter.jar in the "lib" folder (you can open it as a zip file): it contains a directory tree and the .class files are under internal directories;
    you should recreate the same directory tree under the "classes" folder.

    We haven't pointed out this requirement in our documentation because this is a java convention; the provided source files also follow this convention.
    You don't need to create the directory tree from scratch, as it should have already been created by your compiler upon compilation of your modified sources.

 

 

Similar Threads

  1. How to write my own stock list data adapter with java
    By pradeepgamage in forum General
    Replies: 1
    Last Post: January 9th, 2012, 11:39 AM
  2. This is different...problem with stock name
    By lethanhclub in forum Adapter Protocol
    Replies: 1
    Last Post: September 11th, 2009, 09:39 AM
  3. This is different...problem with stock name
    By lethanhclub in forum Client APIs
    Replies: 0
    Last Post: September 11th, 2009, 03:49 AM
  4. Stock List Adapter
    By minhphan200677 in forum Adapter APIs
    Replies: 1
    Last Post: April 14th, 2008, 09:26 AM
  5. DISTINCT not supported in Stock Demo
    By gmccone in forum Client APIs
    Replies: 1
    Last Post: March 30th, 2007, 10:41 AM

Tags for this Thread

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 05:24 AM.