Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow instructions in LiveReload section causes ClassCastException #646

Open
anasmi opened this issue Aug 15, 2018 · 6 comments
Open

Follow instructions in LiveReload section causes ClassCastException #646

anasmi opened this issue Aug 15, 2018 · 6 comments
Labels
awaits another ticket Cannot be started until another issue is fixed

Comments

@anasmi
Copy link

anasmi commented Aug 15, 2018

Steps to reproduce:

The full stacktrace:


java.lang.ClassCastException: java.lang.StackTraceElement cannot be cast to java.lang.String
	at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1421) ~[na:1.8.0_91]
	at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:719) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:833) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1609) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353) ~[na:1.8.0_91]
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) ~[na:1.8.0_91]
	at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1611) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1077) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:218) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.session.StandardManager.load(StandardManager.java:162) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:356) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273) [tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421) [tomcat-embed-core-8.5.31.jar:8.5.31]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411) [tomcat-embed-core-8.5.31.jar:8.5.31]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]

@alexberazouski
Copy link

Which IDE are you using?
Are you using any DB or default in-memory storage?
Does exception occur if you do even small changes?

@anasmi
Copy link
Author

anasmi commented Aug 15, 2018

Intellij in my case and is broken for customer on Eclipse. So should not matter.

I actually added simple System.out.printl. No changes to "working" code as per se.

Or just pressing save the file(no changes)--> it reloads automatically--> exception thrown

Default storage. Plain Bakery app + adding dependencies and configuration as mention in the documentation.
(Some sort of Serialization issue? )

@alexberazouski
Copy link

  1. Exception happens for me too
  2. Login issue I have as well (as far as I remember it could be a flow issue, but not sure)

Even though hotswapping itself works fine.

@alexberazouski
Copy link

We've discovered that exception happens if the change related to the view with a vaadin-grid-flow inside (basically any page except login page in bakery). So we will address this issue there

By the way, using Hotswap Agent instead of spring dev-tools resolves both of the issues.

@anasmi
Copy link
Author

anasmi commented Aug 15, 2018

Thanks, @alexberazouski :)

@tulioag
Copy link
Contributor

tulioag commented Aug 17, 2018

Upon further investigation, we discovered it is a serialization issue.

The exception is misleading and there is a bug reported for spring boot for that: spring-projects/spring-boot#9457

I created an issue in vaadin-spring, because I can partially reproduce it using the skeleton starter vaadin/spring#338

Bakery itself has some non serializable classes that would need to be handled. One of the issues is how to autowire service beans (which are singletons) back in the UI on desserialization.

@web-padawan web-padawan added awaits another ticket Cannot be started until another issue is fixed dependencies Pull requests that update a dependency file and removed dependencies Pull requests that update a dependency file labels Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaits another ticket Cannot be started until another issue is fixed
Projects
None yet
Development

No branches or pull requests

4 participants