# Gigaspaces with MS Excel - InitJvm Exception

Hi

Getting "not able init JVM exception" while connecting to space from MS Excel Addin. Tryed on 5.2, 6.5, 6.6.2 versions and were getting similar exception. I feel we are missing some thing important. Would be great if some one can shed some light. Thanks in advance.

## 6.6.2

"GigaSpaces.NetToJava.NetToJavaException: Attempted to execute command when no Jvm exists, InitJVM must be called to create a Jvm at GigaSpaces.NetToJava.JVMBridge.TraceAndThrowNetToJavaException(String exceptionMessage) at GigaSpaces.NetToJava.JVMBridge.ExecuteCommand(Byte[] command) at GigaSpaces.Core.Internal.Pbs.Commands.PbsDispatcher.Execute(PbsMemoryStream output, DispatcherObjectProxy proxy) at GigaSpaces.Core.Internal.Pbs.Commands.ISpaceProxy.PbsISpaceProxyFindSpace.Execute(String spaceUrl, CmdSpaceProxy injectedSpace, IDictionary2 properties, View[] views, SecurityContext securityContext, SpaceConfig spaceConfig) at GigaSpaces.Core.Internal.Providers.Cmd.CmdSpaceProxyFactory.FindSpaceInternal(String url, Dictionary2 properties, ISpaceProxy proxy, View[] views, SecurityContext securityContext, SpaceConfig spaceConfig) at GigaSpaces.Core.Internal.SpaceProxyFactory.FindSpaceMacroReplace(String spaceUrl, Dictionary`2 properties, ISpaceProxy proxy, View[] views, SecurityContext securityContext, SpaceConfig spaceConfig) at GigaSpaces.Core.SpaceProxyProviderFactory.FindSpace(String url) at GSUDFSample.GSUDFSample.ConnectToSpace() in C:\VSProjects\GS_UDF_Sample\GSUDFSample\GSUDFSample.cs:line 48"

-Venkat

edit retag close merge delete

Sort by » oldest newest most voted

Which example exactly are you trying to run? Do you get this exception when you run the example as if without any modifications?

Increase the logging level to verbose of the JVMBridge component by editing the app.config and put:

<configuration> <configsections> <section name="GigaSpaces" type="GigaSpaces.Core.Configuration.GigaSpacesCoreConfiguration, GigaSpaces.Core"/> </configsections> <gigaspaces> <provider type="Jet"> <jetprovidersettings logginglevel="Verbose"/> </provider> </gigaspaces> </configuration>

You'll need to use some kind of a trace viewer to see the output, I recommend debug view. I don't think the JVMBridge logs will appear in windoes event viewer since its a dll which is part native but you can have a look. Please note that this is for debug information purposes only, it creates a lot of output and should not be used in general.

Edited by: Eitan Yanovsky on Jan 8, 2009 1:01 AM

more

I am trying to write an Excel Addin to populate data from Space.

Changing the JVM mem size to 2 and 8 solved my problem. I donno why its not taking more then that size. Need to check how much it can scale with that low memory. Any inputs or suggestions would be great.

Thanks
Venkat

( 2009-01-09 09:07:07 -0600 )edit

I am trying to write an Excel Addin to populate data from Space.

Changing the JVM mem size to 2 and 8 solved my problem. I donno why its not taking more then that size. Need to check how much it can scale with that low memory. Any inputs or suggestions would be great.

Thanks Venkat

( 2009-01-09 09:08:07 -0600 )edit

Since the excel is only a client and the data is stored in a remote space in a different machine or a process, the memory consumption is not affected by the number of objects in the space.

( 2009-01-09 10:15:11 -0600 )edit

Thanks for the reply Eitan. yaa you are right but actually we are trying for huge data from different space. Any how thanks for the suggestions will try and see how it goes and one more question is there a way or workaround for not putting Gigaspaces dll's in Excel folder?

Thanks venkat

( 2009-01-09 12:21:39 -0600 )edit

Even though you have a limited Jvm heap size, once the objects are read and rebuilt as .NET objects, they are no longer sustained in the Jvm heap and they are being hosted by the CLR, which is not limited by the Jvm Heapsize, in fact there's no correlation between the Jvm heap and the CLR heap. Therefore you can locally store objects that exceeds much more than 8MB. Try not to read the objects in one huge batch, but in small batches or using SpaceIterator, that will make sure you will not need to allocate too much memory inside the Jvm heap.

I am not sure about the placement of the dll, my first hunch says that you must have it in the same directory because this is how .NET framework works, all the dependencies need to be placed locally at the same directory. However, there might be some tricks to overcome this limitation but I am not too familiar with such. Another thing is that you don't have to install XAP.NET on the machine locally, though it is recommended, you can configure the runtime directory and if needed, the location of the jvm dll, in the relevant app.config, in your case the excel.config file. for more information see: http://www.gigaspaces.com/wiki/displa... (RuntimeDir) http://www.gigaspaces.com/wiki/displa... (Jvm dll location)

The runtime directory is either a XAP installation directory or XAP.NET installation pointing to its undelying Runtime directory. Make sure you do not mix versions if you take this approach.

Eitan

Edited by: Eitan Yanovsky on Jan 9, 2009 1:46 PM

Edited by: Eitan Yanovsky on Jan 9, 2009 1:47 PM

( 2009-01-09 13:39:55 -0600 )edit

Do you have JVM dll in your PATH?

Shay

more