I have build a Rapiclipse-Project with MircoStream. Starting the WebApp with an new MicroStream-Folder there is only the file "channel_0_1.dat". After several transactions (read/save) the file-size is growing. If the file-size is approximately 500/600Kib there is a second dat-file. The MicroStream-connection is shut down. In the constructor of the HomeView I call the DB.java-File (Microstream-root) to fill a grid.

Restarting the server does not solve the problem. I'm not able to connect to the MicrostreamData any more. The data is lost. I have to delete the whole folder. Then the Webapp is working again and after a while the same issue is coming up. The same problem is on the developing machine.


Error message:


There was an exception while trying to navigate to '' with the exception message 'Unable to create an instance of '...myapp.ui.HomeView'. The constructor threw an exception.'

Your application doesn't have SLF4J binding. As a result the logger doesn't do any real logging. Add some binding as a dependency to your project. See details here

java.lang.IllegalArgumentException: Unable to create an instance of ... The constructor threw an exception.

   at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:512)

   at com.vaadin.flow.internal.ReflectTools.createInstance(ReflectTools.java:449)

   at com.vaadin.flow.di.DefaultInstantiator.create(DefaultInstantiator.java:137)

   at com.vaadin.flow.di.DefaultInstantiator.getOrCreate(DefaultInstantiator.java:66)

   at com.vaadin.flow.di.Instantiator.createRouteTarget(Instantiator.java:160)

...

Caused by: java.lang.reflect.InvocationTargetException

   at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

   at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)

   at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

   at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

   at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)

   at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:481)

   ... 43 more

Caused by: java.lang.NoClassDefFoundError: Could not initialize class ...

Caused by: one.microstream.storage.exceptions.StorageException: Storage is shut down.

at one.microstream.storage.types.StorageTaskBroker$Default.enqueueTask(StorageTaskBroker.java:192)

at one.microstream.storage.types.StorageTaskBroker$Default.enqueueTask(StorageTaskBroker.java:176)

at one.microstream.storage.types.StorageTaskBroker$Default.enqueueTaskAndNotifyAll(StorageTaskBroker.java:166)

at one.microstream.storage.types.StorageTaskBroker$Default.enqueueRootsLoadTask(StorageTaskBroker.java:399)

at one.microstream.storage.types.StorageRequestAcceptor$Default.recallRoots(StorageRequestAcceptor.java:181)

at one.microstream.storage.types.EmbeddedStorageBinarySource$Default.read(EmbeddedStorageBinarySource.java:53)

at one.microstream.persistence.binary.types.BinaryLoader$Default.readLoadOnce(BinaryLoader.java:707)

at one.microstream.persistence.binary.types.BinaryLoader$Default.get(BinaryLoader.java:824)

at one.microstream.persistence.binary.types.BinaryLoader$Default.loadRoots(BinaryLoader.java:869)

at one.microstream.storage.types.EmbeddedStorageManager$Default.loadExistingRoots(EmbeddedStorageManager.java:305)

at one.microstream.storage.types.EmbeddedStorageManager$Default.initialize(EmbeddedStorageManager.java:325)

at one.microstream.storage.types.EmbeddedStorageManager$Default.start(EmbeddedStorageManager.java:213)

at one.microstream.storage.types.EmbeddedStorageManager$Default.start(EmbeddedStorageManager.java:1)

at ...myapp.microstream.DB.<clinit>(DB.java:37)

Hello,

As the the DB.java is not part of Microstream I don’t know what is done there so I can give just some general hints:


  1. The “Storage is shut down“ exception indicates that something went wrong during the storage startup. Do you have any other logs e.g. from the server?
  2. Did you check if there are more than one Microstream instances created that try to access the same storage?
  3. In general you should start Microstream once during the application lifecycle and also close it once.

Hello,


here is an extract from the DB.java-File. The error-line is marked bold (.start()):


public final class DB

{

private final static DataRoot     root      = new DataRoot();

private static EmbeddedStorageManager storageManager = null;

static

{

DB.storageManager = Configuration.Default()

.setBaseDirectoryInUserHome("microstreamDBs/termin-dataD")

.createEmbeddedStorageFoundation()

.createEmbeddedStorageManager(DB.root)

.start();

if(DB.root.getTermine().isEmpty() == true)

{

for(int i = -400; i < 20; i++)

{

DB.root.getTermine()

.add(new Termin(LocalDate.now().plusDays(i), LocalTime.of(8, 0), LocalTime.of(9, 0)));

DB.root.getTermine()

.add(new Termin(LocalDate.now().plusDays(i), LocalTime.of(9, 0), LocalTime.of(10, 0)));

DB.root.getTermine()

.add(new Termin(LocalDate.now().plusDays(i), LocalTime.of(10, 0), LocalTime.of(11, 0)));

DB.root.getTermine()

.add(new Termin(LocalDate.now().plusDays(i), LocalTime.of(11, 0), LocalTime.of(12, 0)));

DB.root.getTermine()

.add(

new Termin(LocalDate.now().plusDays(i), LocalTime.of(15, 0), LocalTime.of(16, 0)));

DB.root.getTermine()

.add(

new Termin(LocalDate.now().plusDays(i), LocalTime.of(16, 0), LocalTime.of(17, 0)));

DB.root.getTermine()

.add(

new Termin(LocalDate.now().plusDays(i), LocalTime.of(17, 0), LocalTime.of(18, 0)));

}

DB.storageManager.store(DB.root.getTermine());

}


...


public static DataRoot root()

{

return DB.root;

}


public static EmbeddedStorageManager storageManager()

{

return DB.storageManager;

}

private DB()

{

}


Thanks for your support!



Hello,


which log-File of the server could help you?

I just start the microsteam-Instance in the DB.java. I don't have any shutdown-command. I thought I dont have to stop the microstream-instance explicitly?


Thank you for your reply.


Hello,


I was able to verify the filesize of the dat-file:


channel_0_1.dat 509.54 KiB

channel_0_2.dat 382.15 KiB

transactions_0.sft 3.27 KiB


When I store and delete an object in a MicrostreamList the channel_0_1.dat-file is growing circa 3.0 KiB. The dat-file grows until 509.54 KiB. Storing/Deleting another object is not possible. The Microstream-Instance is shut down. The filesize is not able to grow over 512 KiB.