Comments (10)
The version 1.3.1 has been released. Please test it again, if any problems occurs, just reopen this issue.
from store.
Thank you for providing us with the demo. I can confirm that this is a bug.
We are now working on the new Spring Integration, we will fix it together.
from store.
The reason for this problem is, that the Root object is created with another classloader als application context classloader.
This must be fixed.
@manideeps
as temporary workaround, disable root in configuration and created it manually for the first time:
@SpringBootApplication
@Import(EclipseStoreSpringBoot.class)
public class StoredemoApplication {
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(StoredemoApplication.class, args);
StorageManager manager = context.getBean(StorageManager.class);
Object root = manager.root();
if (root == null) {
root = new Data();
manager.setRoot(root);
manager.storeRoot();
}
if (root instanceof Data data){
System.out.println("Welcome---"+data.getWelcomeText());
System.out.println("Root is data");
data.setWelcomeText(data.getWelcomeText()+"-append--"+"welcome again");
manager.storeRoot();
}else {
System.out.println("Root is not data");
}
}
}
from store.
It will be fixed with this PR:
#136
from store.
Do you create your own embedded manager or is injected by Spring? Could you prepare some repository, to see, what are you doing and help us to identify the problem?
In general, the issue is that with dev tools, the classes are loaded by a different class loader than the default one.
Therefore, I need to know exactly what you are doing and how you are using it, so I can assess whether it is an error in our code or incorrect usage.
from store.
I used the storage manager created by spring. But Issue occurs for own embedded manager as-well. Repo is - https://github.com/manideeps/eclipsestore-sample
from store.
There is no issue when app starting for first time or with empty storage directory. But from next time when eclipsestore loading existing from storage directory or root object , its throws TypeCastException
from store.
Can you explain in a little more detail on how to get this workaround working please.
See also my question with code at: #158
I have commented out the data root in application.properties and modified the main() as per your code above, but now get an error:
Caused by: java.lang.NullPointerException: Cannot invoke "com.example.data.DataRoot.emails()" because the return value of "com.example.data.Emails.dataRoot()" is null
from store.
Hello fschon,
Did you try to delete the storage after doing the modifications of your code?
The exception you posted indicates that the stored root is null.
The workaround manually creates a new Root object if it’s null and then sets the root element and stores it:
if (root == null) {
root = new Data();
manager.setRoot(root);
manager.storeRoot();
}
Looking at you code in #158 I found another problem in the ‘Emails.save(String email) method’ :
This methods calls the store on the passed String but not on the List the String is added. This way the modification of the Emails list is not persisted and, after reloading the storage, the Emails list does not contain the added email.
You need to store the list storageManager.store(dataRoot().emails())
. The added email will then be stored implicitly if it is not already stored. (see https://docs.eclipsestore.io/manual/storage/storing-data/lazy-eager-full.html for details)
from store.
This bug was driving me crazy!
Since spring-boot-devtools is enabled by default in Vaadin, this is probably turning away most Vaadin users who saw the EclipseStore webinar and wanted to give it a try.
You should at least mention in the 1.2 documentation that the solution to TypeCastException is to either remove org.eclipse.store.root
from application.properties or spring-boot-devtools
from the dependencies (or wait for next release with the fix).
from store.
Related Issues (20)
- Handling checked exceptions HOT 1
- IndexOutOfBoundsException when using values().stream() on empty LazyHashMap HOT 1
- Entity and Wrapper code generators in Gradle - please document HOT 3
- Versioning layer exception HOT 4
- --add-exports java.base/jdk.internal.misc=ALL-UNNAMED - please fix the docs!
- Issue with generated layered entity code - may need documentation?
- ES 1.3.1 testing against a Minio (S3-compatible ) storage backend - please help! HOT 2
- Not able to download the GUI client from MAVEN as well as the direct URl HOT 3
- Gcp Cloud storage storage target HOT 1
- java.lang.ClassNotFoundException: sun.misc.Unsafe HOT 2
- Rest Client GUI link is broken HOT 2
- Foundation type handler registration depends on order of api calls
- ObjectCopier class not found HOT 2
- The documentation for the layered entities configuration section is incorrect HOT 1
- Need help with "Error occurred in storage channel" HOT 9
- About Creating Database Issues HOT 1
- About Creating Database Issues HOT 12
- Layered entity generator issue?
- Real "read-only" mode with optimized memory consumption HOT 1
- eclipse store data loading is very very slow when app starts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from store.