mrwonderfulone@gmail.com
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
Dario Crivelli
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?
mrwonderfulone@gmail.com
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\stocklist\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
Dario Crivelli
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.