Re: Ignite inside OData WebAPI
Thanks Pavel. I tried to stop the Clinet after every request using Ignition.stop and I am now getting expected results. On Sep 26, 2016 4:09 AM, "Pavel Tupitsyn"wrote: > 1) Have you restarted IIS? > 2) To avoid "already started" errors altogether you can use the following > pattern: > > var ignite = Ignition.TryGetIgnite(null) ?? Ignition.Start(cfg); > > On Sat, Sep 24, 2016 at 10:21 PM, Murthy Kakarlamudi > wrote: > >> Hi Pavel, >>Based on your suggestion, I updated the code to initialize cache in >> the constructor. GetMovies() is getting called for each request now. But >> still I am getting "Default Ignite instance has already been started" >> error. Can you please help. >> >> namespace ODataMovies.Business >> { >> public class IgniteService >> { >> >> private ICache cache; >> >> public IgniteService() >> { >> var cfg = new IgniteConfiguration >> { >> BinaryConfiguration = new >> Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), >> typeof(StarRating), typeof(Person)), >> JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, >> JvmClasspath = Directory.GetFiles(HttpContext >> .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) >> }; >> Ignition.ClientMode = true; >> var ignite = Ignition.Start(cfg); >> cache = ignite.GetOrCreateCache (new >> CacheConfiguration >> { >> Name = "myMusicCache", >> QueryEntities = new[] >> { >> new QueryEntity(typeof(int), typeof(Movie)) >> >> } >> }); >> >> } >> >> public List GetMovies() >> { >> >> List movies = new List(); >> IQueryable > qry = >> cache.AsCacheQueryable().Where(m => m.Key == 1); >> >> foreach (ICacheEntry entry in qry) >> { >> Console.WriteLine("Movie: " + entry.Value); >> movies.Add(entry.Value); >> } >> >> >> return movies; >> } >> } >> } >> >> *Below is my OData method that gets called:* >> [EnableQuery] >> public IList Get() >> { >> return ig_service.GetMovies(); >> } >> >> *Error I am getting is:* >> class org.apache.ignite.IgniteException: Default Ignite instance has >> already been started. >> at org.apache.ignite.internal.util.IgniteUtils.convertException >> (IgniteUtils.java:908) >> at org.apache.ignite.internal.processors.platform.PlatformAbstr >> actBootstrap.start(PlatformAbstractBootstrap.java:48) >> at org.apache.ignite.internal.processors.platform.PlatformIgnit >> ion.start(PlatformIgnition.java:76) >> Caused by: class org.apache.ignite.IgniteCheckedException: Default >> Ignite instance has already been started. >> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1026) >> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:549) >> at org.apache.ignite.internal.processors.platform.PlatformAbstr >> actBootstrap.start(PlatformAbstractBootstrap.java:43) >> ... 1 more >> >> >> On Fri, Sep 23, 2016 at 1:10 PM, Pavel Tupitsyn >> wrote: >> >>> I've tried your code and it works for me. >>> The only issue I see is that you start Ignite client on each web >>> request, so the second request fails with "Default Ignite instance has >>> already been started". >>> >>> Suggestions: >>> * Examine Windows Application Log for some clues >>> * Try IIS instead of IIS Express >>> >>> >>> >>> >>> On Fri, Sep 23, 2016 at 4:44 PM, Murthy Kakarlamudi >>> wrote: >>> I was using the sample Odata project available on internet and updated that to test with Ignite. There are 2 projects. ODataMusicServer - .Net console app that populates cache https://github.com/ksatya77/ODataMusicServer ODataMovies - ASP.NET Odata API that tries to access the cache as a client: https://github.com/ksatya77/ODataMovies Thanks. On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsyn wrote: > Can you attach an entire project so I take a look? > > On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi > wrote: > >> Hi Pavel, >>No it does not give any exception. Just get an error saying that >> the Site can't be reached when I invoke the OData endpoint. Below is the >> console ouput. iisexpress.exe just exits without any error code. >> >> As Server class is not resolved, I had to make a slight modification >> as below: >> var cfg = new IgniteConfiguration >> { >> BinaryConfiguration = new >>
Re: Ignite inside OData WebAPI
1) Have you restarted IIS? 2) To avoid "already started" errors altogether you can use the following pattern: var ignite = Ignition.TryGetIgnite(null) ?? Ignition.Start(cfg); On Sat, Sep 24, 2016 at 10:21 PM, Murthy Kakarlamudiwrote: > Hi Pavel, >Based on your suggestion, I updated the code to initialize cache in the > constructor. GetMovies() is getting called for each request now. But still > I am getting "Default Ignite instance has already been started" error. > Can you please help. > > namespace ODataMovies.Business > { > public class IgniteService > { > > private ICache cache; > > public IgniteService() > { > var cfg = new IgniteConfiguration > { > BinaryConfiguration = new Apache.Ignite.Core.Binary. > BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), > JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, > JvmClasspath = Directory.GetFiles( > HttpContext.Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x > + ";" + y) > }; > Ignition.ClientMode = true; > var ignite = Ignition.Start(cfg); > cache = ignite.GetOrCreateCache (new > CacheConfiguration > { > Name = "myMusicCache", > QueryEntities = new[] > { > new QueryEntity(typeof(int), typeof(Movie)) > > } > }); > > } > > public List GetMovies() > { > > List movies = new List(); > IQueryable > qry = > cache.AsCacheQueryable().Where(m => m.Key == 1); > > foreach (ICacheEntry entry in qry) > { > Console.WriteLine("Movie: " + entry.Value); > movies.Add(entry.Value); > } > > > return movies; > } > } > } > > *Below is my OData method that gets called:* > [EnableQuery] > public IList Get() > { > return ig_service.GetMovies(); > } > > *Error I am getting is:* > class org.apache.ignite.IgniteException: Default Ignite instance has > already been started. > at org.apache.ignite.internal.util.IgniteUtils. > convertException(IgniteUtils.java:908) > at org.apache.ignite.internal.processors.platform. > PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java:48) > at org.apache.ignite.internal.processors.platform.PlatformIgnition.start( > PlatformIgnition.java:76) > Caused by: class org.apache.ignite.IgniteCheckedException: Default Ignite > instance has already been started. > at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1026) > at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:549) > at org.apache.ignite.internal.processors.platform. > PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java:43) > ... 1 more > > > On Fri, Sep 23, 2016 at 1:10 PM, Pavel Tupitsyn > wrote: > >> I've tried your code and it works for me. >> The only issue I see is that you start Ignite client on each web request, >> so the second request fails with "Default Ignite instance has already >> been started". >> >> Suggestions: >> * Examine Windows Application Log for some clues >> * Try IIS instead of IIS Express >> >> >> >> >> On Fri, Sep 23, 2016 at 4:44 PM, Murthy Kakarlamudi >> wrote: >> >>> I was using the sample Odata project available on internet and updated >>> that to test with Ignite. There are 2 projects. >>> >>> ODataMusicServer - .Net console app that populates cache >>> https://github.com/ksatya77/ODataMusicServer >>> >>> ODataMovies - ASP.NET Odata API that tries to access the cache as a >>> client: >>> https://github.com/ksatya77/ODataMovies >>> >>> Thanks. >>> >>> On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsyn >>> wrote: >>> Can you attach an entire project so I take a look? On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi wrote: > Hi Pavel, >No it does not give any exception. Just get an error saying that > the Site can't be reached when I invoke the OData endpoint. Below is the > console ouput. iisexpress.exe just exits without any error code. > > As Server class is not resolved, I had to make a slight modification > as below: > var cfg = new IgniteConfiguration > { > BinaryConfiguration = new > Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), > typeof(StarRating), typeof(Person)), > JvmOptions = new List { "-Xms512m", > "-Xmx1024m" }, > JvmClasspath = Directory.GetFiles(HttpContext > .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + > y) > }; > > > 'iisexpress.exe' (CLR
Re: Ignite inside OData WebAPI
Hi Pavel, Based on your suggestion, I updated the code to initialize cache in the constructor. GetMovies() is getting called for each request now. But still I am getting "Default Ignite instance has already been started" error. Can you please help. namespace ODataMovies.Business { public class IgniteService { private ICachecache; public IgniteService() { var cfg = new IgniteConfiguration { BinaryConfiguration = new Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, JvmClasspath = Directory.GetFiles(HttpContext.Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) }; Ignition.ClientMode = true; var ignite = Ignition.Start(cfg); cache = ignite.GetOrCreateCache (new CacheConfiguration { Name = "myMusicCache", QueryEntities = new[] { new QueryEntity(typeof(int), typeof(Movie)) } }); } public List GetMovies() { List movies = new List(); IQueryable > qry = cache.AsCacheQueryable().Where(m => m.Key == 1); foreach (ICacheEntry entry in qry) { Console.WriteLine("Movie: " + entry.Value); movies.Add(entry.Value); } return movies; } } } *Below is my OData method that gets called:* [EnableQuery] public IList Get() { return ig_service.GetMovies(); } *Error I am getting is:* class org.apache.ignite.IgniteException: Default Ignite instance has already been started. at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:908) at org.apache.ignite.internal.processors.platform.PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java:48) at org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:76) Caused by: class org.apache.ignite.IgniteCheckedException: Default Ignite instance has already been started. at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1026) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:549) at org.apache.ignite.internal.processors.platform.PlatformAbstractBootstrap.start(PlatformAbstractBootstrap.java:43) ... 1 more On Fri, Sep 23, 2016 at 1:10 PM, Pavel Tupitsyn wrote: > I've tried your code and it works for me. > The only issue I see is that you start Ignite client on each web request, > so the second request fails with "Default Ignite instance has already > been started". > > Suggestions: > * Examine Windows Application Log for some clues > * Try IIS instead of IIS Express > > > > > On Fri, Sep 23, 2016 at 4:44 PM, Murthy Kakarlamudi > wrote: > >> I was using the sample Odata project available on internet and updated >> that to test with Ignite. There are 2 projects. >> >> ODataMusicServer - .Net console app that populates cache >> https://github.com/ksatya77/ODataMusicServer >> >> ODataMovies - ASP.NET Odata API that tries to access the cache as a >> client: >> https://github.com/ksatya77/ODataMovies >> >> Thanks. >> >> On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsyn >> wrote: >> >>> Can you attach an entire project so I take a look? >>> >>> On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi >>> wrote: >>> Hi Pavel, No it does not give any exception. Just get an error saying that the Site can't be reached when I invoke the OData endpoint. Below is the console ouput. iisexpress.exe just exits without any error code. As Server class is not resolved, I had to make a slight modification as below: var cfg = new IgniteConfiguration { BinaryConfiguration = new Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, JvmClasspath = Directory.GetFiles(HttpContext .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) }; 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module is optimized and the
Re: Ignite inside OData WebAPI
Oh really...so you were able to get responses back once you hit the odata end point? Did you try this running on IIS or IIS Express? On Fri, Sep 23, 2016 at 1:10 PM, Pavel Tupitsynwrote: > I've tried your code and it works for me. > The only issue I see is that you start Ignite client on each web request, > so the second request fails with "Default Ignite instance has already > been started". > > Suggestions: > * Examine Windows Application Log for some clues > * Try IIS instead of IIS Express > > > > > On Fri, Sep 23, 2016 at 4:44 PM, Murthy Kakarlamudi > wrote: > >> I was using the sample Odata project available on internet and updated >> that to test with Ignite. There are 2 projects. >> >> ODataMusicServer - .Net console app that populates cache >> https://github.com/ksatya77/ODataMusicServer >> >> ODataMovies - ASP.NET Odata API that tries to access the cache as a >> client: >> https://github.com/ksatya77/ODataMovies >> >> Thanks. >> >> On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsyn >> wrote: >> >>> Can you attach an entire project so I take a look? >>> >>> On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi >>> wrote: >>> Hi Pavel, No it does not give any exception. Just get an error saying that the Site can't be reached when I invoke the OData endpoint. Below is the console ouput. iisexpress.exe just exits without any error code. As Server class is not resolved, I had to make a slight modification as below: var cfg = new IgniteConfiguration { BinaryConfiguration = new Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, JvmClasspath = Directory.GetFiles(HttpContext .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) }; 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0 _4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Appli cationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configura tion\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_ 4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: Domain 2): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded
Re: Ignite inside OData WebAPI
I've tried your code and it works for me. The only issue I see is that you start Ignite client on each web request, so the second request fails with "Default Ignite instance has already been started". Suggestions: * Examine Windows Application Log for some clues * Try IIS instead of IIS Express On Fri, Sep 23, 2016 at 4:44 PM, Murthy Kakarlamudiwrote: > I was using the sample Odata project available on internet and updated > that to test with Ignite. There are 2 projects. > > ODataMusicServer - .Net console app that populates cache > https://github.com/ksatya77/ODataMusicServer > > ODataMovies - ASP.NET Odata API that tries to access the cache as a > client: > https://github.com/ksatya77/ODataMovies > > Thanks. > > On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsyn > wrote: > >> Can you attach an entire project so I take a look? >> >> On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi >> wrote: >> >>> Hi Pavel, >>>No it does not give any exception. Just get an error saying that the >>> Site can't be reached when I invoke the OData endpoint. Below is the >>> console ouput. iisexpress.exe just exits without any error code. >>> >>> As Server class is not resolved, I had to make a slight modification as >>> below: >>> var cfg = new IgniteConfiguration >>> { >>> BinaryConfiguration = new >>> Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), >>> typeof(StarRating), typeof(Person)), >>> JvmOptions = new List { "-Xms512m", "-Xmx1024m" >>> }, >>> JvmClasspath = Directory.GetFiles(HttpContext >>> .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) >>> }; >>> >>> >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. >>> 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is >>> optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. >>> 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. >>> Module is optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. >>> 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is >>> optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0 >>> _4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. >>> Module is optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Appli >>> cationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. >>> Skipped loading symbols. Module is optimized and the debugger option 'Just >>> My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configura >>> tion\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped >>> loading symbols. Module is optimized and the debugger option 'Just My Code' >>> is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_ >>> 4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. >>> Module is optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: Domain 2): Loaded >>> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. >>> 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is >>> optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >>> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. >>> 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. >>> Module is optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >>> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. >>> 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is >>> optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >>> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0 >>> _4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. >>> Module is optimized and the debugger option 'Just My Code' is enabled. >>> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >>> Loaded
Re: Ignite inside OData WebAPI
I was using the sample Odata project available on internet and updated that to test with Ignite. There are 2 projects. ODataMusicServer - .Net console app that populates cache https://github.com/ksatya77/ODataMusicServer ODataMovies - ASP.NET Odata API that tries to access the cache as a client: https://github.com/ksatya77/ODataMovies Thanks. On Fri, Sep 23, 2016 at 9:16 AM, Pavel Tupitsynwrote: > Can you attach an entire project so I take a look? > > On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudi > wrote: > >> Hi Pavel, >>No it does not give any exception. Just get an error saying that the >> Site can't be reached when I invoke the OData endpoint. Below is the >> console ouput. iisexpress.exe just exits without any error code. >> >> As Server class is not resolved, I had to make a slight modification as >> below: >> var cfg = new IgniteConfiguration >> { >> BinaryConfiguration = new >> Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), >> typeof(StarRating), typeof(Person)), >> JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, >> JvmClasspath = Directory.GetFiles(HttpContext >> .Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) >> }; >> >> >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. >> 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is >> optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. >> 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module >> is optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. >> 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is >> optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4. >> 0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. >> Module is optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Appli >> cationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. >> Skipped loading symbols. Module is optimized and the debugger option 'Just >> My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configura >> tion\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped >> loading symbols. Module is optimized and the debugger option 'Just My Code' >> is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_ >> 4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. >> Module is optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: Domain 2): Loaded >> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0. >> 0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is >> optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4. >> 0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module >> is optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0. >> 0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is >> optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4. >> 0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. >> Module is optimized and the debugger option 'Just My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Appli >> cationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. >> Skipped loading symbols. Module is optimized and the debugger option 'Just >> My Code' is enabled. >> 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): >> Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configura >> tion\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped >> loading symbols. Module is optimized and the
Re: Ignite inside OData WebAPI
Can you attach an entire project so I take a look? On Fri, Sep 23, 2016 at 3:59 PM, Murthy Kakarlamudiwrote: > Hi Pavel, >No it does not give any exception. Just get an error saying that the > Site can't be reached when I invoke the OData endpoint. Below is the > console ouput. iisexpress.exe just exits without any error code. > > As Server class is not resolved, I had to make a slight modification as > below: > var cfg = new IgniteConfiguration > { > BinaryConfiguration = new Apache.Ignite.Core.Binary. > BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), > JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, > JvmClasspath = Directory.GetFiles( > HttpContext.Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x > + ";" + y) > }; > > > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_ > 4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module > is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4. > 0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. > Module is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_ > 4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is > optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__ > b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is > optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web. > ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. > Skipped loading symbols. Module is optimized and the debugger option 'Just > My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System. > Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. > Skipped loading symbols. Module is optimized and the debugger option 'Just > My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__ > b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is > optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: Domain 2): Loaded > 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_ > 4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module > is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4. > 0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. > Module is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_ > 4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is > optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\ > v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. > Module is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web. > ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. > Skipped loading symbols. Module is optimized and the debugger option 'Just > My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System. > Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. > Skipped loading symbols. Module is optimized and the debugger option 'Just > My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\ > v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. > Module is optimized and the debugger option 'Just My Code' is enabled. > 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): > Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System. >
Re: Ignite inside OData WebAPI
Hi Pavel, No it does not give any exception. Just get an error saying that the Site can't be reached when I invoke the OData endpoint. Below is the console ouput. iisexpress.exe just exits without any error code. As Server class is not resolved, I had to make a slight modification as below: var cfg = new IgniteConfiguration { BinaryConfiguration = new Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), JvmOptions = new List { "-Xms512m", "-Xmx1024m" }, JvmClasspath = Directory.GetFiles(HttpContext.Current.Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y) }; 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: Domain 2): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: /LM/W3SVC/2/ROOT-1-131191089465882802): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Caching\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Caching.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'iisexpress.exe' (CLR v4.0.30319: DefaultDomain): Loaded
Re: Ignite inside OData WebAPI
Hi, 1) The code looks good to me. What exactly is the issue? Is there an exception, or do you get incorrect results? 2) There is a known issue with IIS: it performs a shadow-copy [1] of application assemblies (dll files), which makes it impossible for Ignite to detect Libs directory with jar files. If your libs directory is in bin folder (as it is when NuGet is used), the solution is the following [2]: IgniteConfiguration.JvmClasspath = Directory.GetFiles(Server.MapPath(@"~\bin\libs")).Aggregate((x, y) => x + ";" + y); Let me know if this helps. [1] https://msdn.microsoft.com/en-us/library/ms404279(v=vs.110).aspx [2] https://apacheignite-net.readme.io/docs/aspnet-output-caching#configuration-starting-ignite-manually On Fri, Sep 23, 2016 at 6:02 AM, Murthy Kakarlamudiwrote: > Hi, >I am trying to expose Cache contents as an Odata API. I created the > Odata API using ASP.NET WebAPI. Inside the API implementation, I am > initializing Ignite in cache mode. Below is the method I am using to > retrieve a listing. I have 2 questions. > > 1. I was not able to use Select option in AsCacheQueryable. How to get a > list of all the entries in the cache from LINQ? > 2. Embedded IIS server quits the process after it hits var ignite = > Ignition.Start(cfg); statement. Processing stops beyond this statement. I > confirmed this in debug mode. It does not throw any errors in the console. > Not sure if it is possible to start Ignite in client mode in Web API that > is deployed on IIS. > > Any help will be much appreciated. Thanks. > > public List GetMovies() > { > var cfg = new IgniteConfiguration > { > BinaryConfiguration = new Apache.Ignite.Core.Binary. > BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), > JvmOptions = new List { "-Xms512m", "-Xmx1024m" } > }; > Ignition.ClientMode = true; > var ignite = Ignition.Start(cfg); > var cache = ignite.GetOrCreateCache (new > CacheConfiguration > { > Name = "myMusicCache", > QueryEntities = new[] > { > new QueryEntity(typeof(int), typeof(Movie)) > > } > }); > List movies = new List(); > IQueryable > qry = > cache.AsCacheQueryable().Where(m => m.Key == 1); > > foreach (ICacheEntry entry in qry) > { > Console.WriteLine("Movie: " + entry.Value); > movies.Add(entry.Value); > } > > > return movies; > } >
Ignite inside OData WebAPI
Hi, I am trying to expose Cache contents as an Odata API. I created the Odata API using ASP.NET WebAPI. Inside the API implementation, I am initializing Ignite in cache mode. Below is the method I am using to retrieve a listing. I have 2 questions. 1. I was not able to use Select option in AsCacheQueryable. How to get a list of all the entries in the cache from LINQ? 2. Embedded IIS server quits the process after it hits var ignite = Ignition.Start(cfg); statement. Processing stops beyond this statement. I confirmed this in debug mode. It does not throw any errors in the console. Not sure if it is possible to start Ignite in client mode in Web API that is deployed on IIS. Any help will be much appreciated. Thanks. public List GetMovies() { var cfg = new IgniteConfiguration { BinaryConfiguration = new Apache.Ignite.Core.Binary.BinaryConfiguration(typeof(Movie), typeof(StarRating), typeof(Person)), JvmOptions = new List { "-Xms512m", "-Xmx1024m" } }; Ignition.ClientMode = true; var ignite = Ignition.Start(cfg); var cache = ignite.GetOrCreateCache(new CacheConfiguration { Name = "myMusicCache", QueryEntities = new[] { new QueryEntity(typeof(int), typeof(Movie)) } }); List movies = new List(); IQueryable > qry = cache.AsCacheQueryable().Where(m => m.Key == 1); foreach (ICacheEntry entry in qry) { Console.WriteLine("Movie: " + entry.Value); movies.Add(entry.Value); } return movies; }