sjohn
To my custom Dataadapter, I need to pass in some parameters.
So I use Server.AdapterConfig
What is the format for the AdapterConfig file?
Can I use the pass the below XML file to Server.AdapterConfig?
<?xml version="1.0"?>
<adapters_conf id="DWJMS">
<metadata_provider>
<adapter_class>com.lightstreamer.adapters.metadata.LiteralBasedProvider</adapter_class>
</metadata_provider>
<data_provider>
<adapter_class> LSAdapters.Test.Lightstreamer.Adapters.DatawareAdapter</adapter_class>
<param name="loggerName">c:\temp\StatusLog.txt</param>
<param name="msgPoolSize">15</param>
<param name="recoveryPauseMillis">2000</param>
<!--EMS example configuration -->
<param name="jmsUrl">tcp://dev:7222</param>
<param name="initialContextFactory">com.tibco.tibjms.naming.TibjmsInitialContextFactory</param>
<param name="topicConnectionFactory">TopicConnectionFactory</param>
<param name="queueConnectionFactory">QueueConnectionFactory</param>
<param name="topicName">topic.sample</param>
<param name="queueName">tro.tibco.usage</param>
<!-- JBoss Messaging example configuration -->
<!--
<param name="jmsUrl">jnp://localhost:1099</param>
<param name="initialContextFactory">org.jnp.interfaces.NamingContextFactory</param>
<param name="topicConnectionFactory">ConnectionFactory</param>
<param name="queueConnectionFactory">ConnectionFactory</param>
<param name="topicName">topic/stocksTopic</param>
<param name="queueName">queue/stocksQueue</param>
-->
</data_provider>
</adapters_conf>
Mone
Hello,
the AdapterConfig property of the MetadataProviderServer (in your example Server.AdapterConfig) is used to pass a configuration file to the init of the MetadataProviderAdapter instance but no operations are performed on that file.
The AdapterConfig is expected to be a file path (but it could be any string) and it is passed as is to the MetadataProviderAdapter.
So the MetadataProviderAdapter will receive a string containing the path passed as AdapterConfig. This means that the file should be parsed by custom code.
An idea could be to parse the file early (eg in the StandaloneLauncher.cs) and pass it to the MetadataProviderServer instance (Server) as a list of properties in the AdapterParams property.
Obviously this means that you can use any kind of file as the reading of it is up to your code.
HTH.
patilgkk
Hi Mone,
We are using ibatis to persist data in database before pushing it to lightstreaner,
but when i deploy adapter, i am getting following error, I think lightstreamer is not reading any config xmls, Please suggest how to go for this.
Exception in thread "Thread-13" java.lang.NoClassDefFoundError: org/apache/ibatis/io/Resources
at com.marketnews.mni.common.db.MyBatisInitializer.<clinit>(Unknown Source)
at com.marketnews.mni.common.db.NewsItemDao.createNewsItem(Unknown Source)
Even i tried to read Properties from .properties file, lightstreamer did not recognise the .properties file eventhogh the file was mentioned in classpath.
Dario Crivelli
As you are writing on the .NET Adapter API forum,
it is unclear whether your are working with normal in-process java Adapters or with Remote Adapters.
Assuming that you are using java adapters and that they access external libraries through some jar files,
I confirm that any jar that is put in the adapter's libfolder or in the shared/lib folder is added to the classpath available to Adapter code;
similarly, any class or other resource file that is put in the adapter's classesfolder or in the shared/classes folder is available to Adapter code.
You can ensure that the classes and resources that you placed in these folders are available by trying to load them (just for testing purpose) from inside your Adapter init method.
If they still can't be seen by your external library, then try adding them to the global classpath, by modifying the JVM command line in the launch script (namely, LS.bator LS.sh ).