-
Notifications
You must be signed in to change notification settings - Fork 3
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
Native build: p:importConstants ClassNotFoundException #264
Comments
Yep so you can see it works Native here: https://quarkus-faces-melloware-8a6a34c1.koyeb.app/ui/misc/importConstants.xhtml?jfwid=bb1bc What that means is you need to register that for reflection package com.blahblah.blah.constants;
import java.io.Serializable;
import java.util.Objects;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class Dialog implements Serializable { |
@melloware thanks for the help! That fixed this error but now I get another one, don't know if it's related though, could you help?
|
Yep now you have to register Try import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection(targets = { java.lang.StringBuffer.class }, methods = true)
public class ReflectionConfig {
} |
Thanks again! I'll try this anytime a see a related error. Now, is this one related to reflection too?
|
try this that is a Serialization issue package org.primefaces.showcase;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection(
targets = {java.lang.StringBuffer.class},
classNames = {"jakarta.faces.component._AttachedStateWrapper"},
methods = true,
serialization = true)
public class ReflectionConfig {
} |
Opened: https://issues.apache.org/jira/browse/MYFACES-4688 let me know if you discover any more |
Oh, thanks, that solved it but yes, another one of this same error appeared, this time related to I'll add it to the classNames and will keep reporting here if any more of those show up! |
aqesome i will keep updating my PR |
was |
Yes, all the errors I'm getting now are "SerializationConstructorAccessor class not found". I got a few more now:
So far I could fix all of them with your solution. |
awesome i am updating Quarkus PrimeFaces and MyFaces with these changes |
Two more:
I'm still fixing these and building until the errors stop showing up. |
Three more:
I think it's gonna be a long way 'til I fix all of these, but let's keep going |
all the primefaces models
|
I found another one not related to
This was the last on one of my app's pages, now there are some more showing up, some related to |
1 second... let me generate you a list to try. ONce we get this all working i can cut a PF Extension release and you can remove all that junk 😄 generating a list right now. |
here you go just quickly add all these..
|
Wow, that's a lot! Thanks! I just added them all and started a new build. Do you have any idea why this is happening? I mean, shouldn't it happen on the showcase native build too? |
so the thing with GraalVM is it walks all your code paths of code you are using and determines what to add in the final executable so it makes it as small as possible. My Quarkus Showcase is working 100% but that means I have added everything based on that Showcase which is pretty comprehensive. You are now using a piece of code or logic the Showcase is NOT using and thus exposing this need. In general that is why there are extensions so as use cases come up we can solve Graal problems once and not make people reinvent the wheel. |
As a note i was already registering |
Ah yes, I understand. Thanks for the explanation! I found three more classes requiring this fix:
Now I can at least browse between some of my application's pages, so I'm taking note of all errors I'm getting on all of them to fix them in a batch, as waiting 5 min for each build is a bit tiring. I'll continue to test all pages possible, so if I found any more classes with this error, I'll be posting them here! |
yep its tedious but worth it when you get it all working. |
Another one from PrimeFaces: |
Tbh i dont think its worth all the work and you will never catch all edge cases Startup is bit faster but thats it. |
Another one coming up, but this one is from Hibernate. Is it relevant?
Also @melloware, I know it's a bit off topic, but do you know why AUTOMATIC_EXTENSIONLESS_MAPPING does not work on both JAR and native modes? I've seen this issue https://issues.apache.org/jira/browse/MYFACES-4336 but it applies to 2.3, maybe something broke on 4.0? |
That Hibernate one I have never seen if you are properly using Quarkus Hibernate. As for its a bug in Quarkus Undertow you can read all about here: quarkusio/quarkus#28028 |
Isn't this the correct Hibernate dependency? What could I be doing wrong?
At least for now, I had to add these two classes:
I'm on Quarkus 3.15.1, Hibernate 6.6.0 About |
as for these
I assume they are being used in your JSF code and stored somewhere not part of normal Hibernate behavior because i have never had a GraalVM issue with Hibernate so it is most likely something you have in your code. |
I am building 3.14.6.4 now so you should be able to remove all this code you added except for the hiberate and the |
Ok, thanks a lot for the help @melloware! |
Its in Maven Central if you want to give it a shot. |
@melloware I tried it, but I think you forgot this one, it was mentioned on this issue. At least for now that's the only error I got. I added it manually again and I'm running a new build to test it. Also, I don't know if it's relevant now and if I should keep reporting it, but I have also got this error with Edit: Yes, only this one was missed out. Everything else worked. Thanks a lot! |
So only Java.sql.timestamp is missed ? Just confirming. Or the ProxyMap? I think I did miss that one. |
Sorry for the confusion. You missed ViewScopeProxyMap. I only got the problem with |
Yes please. If you run into it others will too. |
@melloware just to provide an update on this, I tested almost possible path on the application and no other class related to this issue showed up. I don't know if you already added |
|
Hi @melloware After updating to quarkus-primefaces 3.14.7 and/or quarkus-jasperreports 1.0.3 (I don't know which of them caused it), I had to register I don't know if I should open a new issue for this. |
Yep you will have to add it back for now. Looks like it was missed in MyFaces. |
PR submitted: apache/myfaces#803 |
Thanks a lot @melloware! |
Hello,
I'm getting the following error when trying to load a page containing <p:importConstants> when my app is compiled as a native image:
On this .xhtml template, I have:
This code works normally when the app is executed via jar or dev mode.
Does anyone know what might be happening or if I did something wrong?
Thanks a lot!
The text was updated successfully, but these errors were encountered: