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

Error when hot-reloading a model bundle #9

Open
nicolas-rempulski opened this issue Sep 8, 2014 · 8 comments
Open

Error when hot-reloading a model bundle #9

nicolas-rempulski opened this issue Sep 8, 2014 · 8 comments
Assignees
Labels

Comments

@nicolas-rempulski
Copy link

When Wisdom hot-reload a bundle containing models, an error arise :

java.lang.ClassCastException: io.gruul.server.mainframe.model.Message_$$_jvstc0c_3 cannot be cast to javassist.util.proxy.Proxy

I've to cut wisdom:run and relaunch it.

On hot-reload, the OrientDBCrudProvider detect new models :

[INFO]   o.w.o.r.OrientDbCrudProvider {monitor-application} - OrientDB Database configuration found for /io/gruul/server/mainframe/model : {user=admin, url=remote:localhost/gruul, package=io.gruul.server.mainframe.model, name=dev} 

Imo it leads to a double declaration of the model class in the proxy, thus the class cast exception.

@cescoffier
Copy link
Member

Which bundle is providing javassist ? Be sure your entity bundle does not
include it.

Sent from my iPhone

On 8 sept. 2014, at 15:25, Nicolas Rempulski [email protected]
wrote:

When Wisdom hot-reload a bundle containing models, an error arise :

java.lang.ClassCastException:
io.gruul.server.mainframe.model.Message_$$_jvstc0c_3 cannot be cast to
javassist.util.proxy.Proxy

I've to cut wisdom:run and relaunch it.

On hot-reload, the OrientDBCrudProvider detect new models :

[INFO] o.w.o.r.OrientDbCrudProvider {monitor-application} - OrientDB
Database configuration found for /io/gruul/server/mainframe/model :
{user=admin, url=remote:localhost/gruul,
package=io.gruul.server.mainframe.model, name=dev}

Imo it leads to a double declaration of the model class in the proxy, thus
the class cast exception.


Reply to this email directly or view it on GitHub
#9.

@nicolas-rempulski
Copy link
Author

My osgi.bnd is exporting javassist.* indeed.

But if I don't do this :

java.lang.RuntimeException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
[...]
java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
[...]
java.lang.ClassNotFoundException: javassist.util.proxy.ProxyObject not found 

@cescoffier
Copy link
Member

It needs to be imported, but neither exported, nor included

On 8 septembre 2014 at 16:07:19, Nicolas Rempulski ([email protected]) wrote:

My osgi.bnd is exporting javassist.* indeed.

But if I don't do this :

java.lang.RuntimeException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
[...]
java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
[...]
java.lang.ClassNotFoundException: javassist.util.proxy.ProxyObject not found

Reply to this email directly or view it on GitHub.

@barjo barjo added the bug label Sep 8, 2014
@barjo barjo self-assigned this Sep 8, 2014
@nicolas-rempulski
Copy link
Author

Ok I removed my osgi.bnd, and forced a use of javassist in my code

Proxy.class.toString();

and it works OK (launch & hot-reload)

@cescoffier
Copy link
Member

Yes, this is a hack. We should probably provide a way to ‘add this import’ automatically.

On 8 septembre 2014 at 16:30:56, Nicolas Rempulski ([email protected]) wrote:

Ok I removed my osgi.bnd, and forced a use of javassist in my code

Proxy.class.toString();
and it works OK (launch & hot-reload)


Reply to this email directly or view it on GitHub.

@barjo
Copy link
Member

barjo commented Sep 8, 2014

Yes, it's a bit dirty. It's what I use in the sample too. It's a bit tricky to add it automatically to the project that use the orientdbCrud.

@cescoffier
Copy link
Member

It could be added using a plugin made for orientdb.

Sent from my iPhone

On 8 sept. 2014, at 17:19, Jonathan Bardin [email protected] wrote:

Yes, it's a bit dirty. It's what I use in the sample too. It's a bit tricky
to add it automatically to the project that use the orientdbCrud.


Reply to this email directly or view it on GitHub
#9 (comment)
.

@barjo
Copy link
Member

barjo commented Sep 8, 2014

It would definitively be the best way, but it does sound a bit overkill :-? The good part is that we could have more use for a plugin down the road. (such has evolution management 😉 )

@barjo barjo modified the milestones: Version 0.2.0, Version 0.3.0 Sep 15, 2014
@barjo barjo removed this from the Version 0.3.0 milestone Oct 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants