Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Oct 2007

    Standalone launcher

    I have written an adapter that talks to JMS in .NET. As mentioned in the DotNetAdapter.pdf, I created a new project, added the references and wrote an adapater class that implements IdataProvider.

    Now in order to invoke this adapter, I wrote a standalone launcher. I opened a console application target project and then added the required references. I am attaching the standalone console app code as an attachment.

    Both the adapter class and the standalone projects compile fine. Now I create a folder under <lightstreamerroot>\adapters\. I added a lib folder and a classes folder. Into the lib folder, I copied ls-proxy-adapters.jar . I have attached my adapter.xml as my attachment. Please note I am using ports 7661,7662,7663

    Now I start my lightsreamer windows service. It starts fine. Shows no errors.
    below is what I see in the log.
    12-Feb-08 13:17:07,126 |INFO |LightstreamerLogger.init |WrapperSimpleAppMain |Lightstreamer Server starting in Enterprise edition
    12-Feb-08 13:17:07,186 |INFO |LightstreamerLogger.init |WrapperSimpleAppMain |Started HTML Adaptor for JMX on port 6666
    12-Feb-08 13:17:07,246 |INFO |LightstreamerLogger.init |WrapperSimpleAppMain |Started JMXMP Connector for JMX on port 9999
    12-Feb-08 13:17:07,356 |INFO |LightstreamerLogger.init |WrapperSimpleAppMain |Loading Metadata Provider JMS
    12-Feb-08 13:17:07,496 |INFO |.remote.transport.SocketTransport|WrapperSimpleAp pMain |Connecting...

    Now under DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment

    I create a folder called JMSLauncher and create a folder called dotnet_2.0. In this folder I drop in the dlls for the standalone launcher I wrote. I added a config file for the pp, that is as follows

    <?xml version="1.0" encoding="utf-8" ?>

    <section name="log4net" type="System.Configuration.IgnoreSectionHandler" />



    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="DotNetServer.log" />
    <appendToFile value="true" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="100MB" />
    <rollingStyle value="Size" />
    <staticLogFileName value="true" />
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" />

    <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger [%ndc] &lt;%property{auth}&gt; - %message%newline" />

    Loggers for Lightstreamer .NET Remote Server and Remote Adapter Library.
    <logger name="Lightstreamer.DotNet.Server">
    <level value="INFO" />
    <appender-ref ref="RollingLogFileAppender" />

    At INFO level, Connection status is logged.
    <logger name="Lightstreamer.DotNet.Server.NetworkedServerS tarter">
    <level value="INFO" />

    At INFO level, Connection details are logged.
    At DEBUG level, request, reply and notify lines are logged.
    <logger name="Lightstreamer.DotNet.Server.RequestReply">
    <level value="WARN" />

    Logs the activity of the custom server.
    At INFO level, Remote Server startup is logged.
    At DEBUG level, command line argument recognition is logged.
    <logger name="Test.LS.Adapters">
    <level value="DEBUG" />
    <appender-ref ref="RollingLogFileAppender" />



    I created a bat file

    @echo off

    rem ---------------------------------------------------------------------------
    rem Set the DotNet installation path as the current directory. Change the
    rem directory accordingly to your installation path of DotNet Adapter.

    pushd .\dotnet_2.0

    rem Lightstreamer StockListDemo .NET Adapter Standalone Server Usage:
    rem DotNetStockListDemoLauncher
    rem [/name <name>] /host <address>
    rem /data_rrport <port> /data_notifport <port> /metadata_rrport <port>
    rem ["<param1>=<value1>" ... "<paramN>=<valueN>"]
    rem Where:
    rem <name> is the symbolic name for both the adapters (1)
    rem <address> is the host name or ip address of LS server (2)
    rem <port> is the tcp port number where LS proxy is listening on (3)
    rem <paramN> is the Nth Metadata Adapter parameter name (4)
    rem <valueN> is the value of the Nth Metadata Adapter parameter (4)
    rem Notes:
    rem (1) The adapter name is optional, if it is not given the adapter will be
    rem assigned a progressive number name like "#1", "#2" and so on
    rem (2) The communication will be from here to LS, not viceversa
    rem (3) The notification port is necessary for a Data Adapter, while it is
    rem not needed for a Metadata Adapter
    rem (4) The parameters name/value pairs will be passed to the LiteralBasedProvider
    rem Metadata Adapter as an hashtable in the "parameters" Init() argument
    rem The StockListDemo Data Adapter requires no parameters

    rem ---------------------------------------------------------------------------
    rem Start the Literal Based Provider Remote Metadata Adapter and the StockList
    rem Demo Remote Data Adapter in networked mode, specifying to connect to the
    rem local host. Change the "/host" parameter according to your configuration.

    start "JMSRemoteAdapters" /MIN JMSLauncher.exe /host localhost /data_rrport 7661 /data_notifport 7662 /metadata_rrport 7663 max_bandwidth=40 max_frequency=3 buffer_size=30

    rem ---------------------------------------------------------------------------
    rem All done. Goes back to the original current directory and pauses, in case
    rem of any error.

    echo Processes started. All done.
    Now when I click on the bat file, it is erroring out saying Invalid cast exception. my log file is not getting created . I am thinking that it is erroring out when it is trying to create my log file. Can you look at my config file and my serverMain class and my config file and tell me what I am doing wrong.
    Attached Files Attached Files



Similar Threads

  1. Gracefully disconnect standalone .NET adapters
    By riaanj in forum Adapter SDKs
    Replies: 15
    Last Post: September 26th, 2007, 09:30 AM
  2. .NET Standalone Adapter with Client
    By wattsw in forum Adapter SDKs
    Replies: 2
    Last Post: November 13th, 2006, 05:12 PM
  3. Standalone application
    By cvs_fif in forum Adapter SDKs
    Replies: 8
    Last Post: September 25th, 2006, 02:36 PM


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 07:39 AM.