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
Required class information missing after upgrade to version higher than 42.2.14 #2008
Comments
So do we know what is causing this error ? What information is required ? |
This stack trace is only one information what i received. People on stackoverflow already know issue, here is the link: stackoverflow issue Issue is at least strength cause configuration lunched on newest Hibernate versions with pgjdbc version lower or equal to |
I created https://github.com/davecramer/hibernate_test and this works fine. If you can provide me with a small test code that fails that will help |
First difference what i noticed is that i'm using
Maybe if i use hibernate as a JPA provider i need to define something additional in |
Please provide me with code that breaks. |
Here is additional stack trace:
Failing entity (database view):
The DAO class:
Previous
|
What version of hibernate are you using ? |
|
Can you take my code and make it fail by changing the annotations ? |
Here's a relevant jandex issue: smallrye/jandex#92 |
I have no access to write to repository. Can you add me? Btw, when i ran your code from master in intellij it works. Problems started for compiling stuff manually and run it by command.
Next i change
Other lines without change. i run code by
|
When I run it I get
I presume you have a classpath setup. When I run this from inside intellij it runs fine. |
I get the same error if i used |
I did and can replicate the error now. Interestingly if I run it inside intellij it works fine. If I run it outside it does not. The type it is trying to find the path to is private final Provider timeZoneProvider; Strangely it is looking it up as a NESTED instead of PARAMATERIZED The annotation it is looking for is @nullable which I can't find anywhere. Looks like Provider was added in 1e1f3c4 which is likely the reason. |
There are two types of possibilities of the bugs: a) javac bugs. Old (e.g. pre 1.8u202) had several known bugs that caused javac to produce invalid bytecode If I rebuild pgjdbc with Java 11 (just in case), and add
|
Interestingly in my email what I see your error becoming is:
|
public class LruCache<Key extends @NonNull Object, Value extends @NonNull CanEstimateSize>
implements Gettable<Key, Value> {
This represents the two Unfortunately, it is not clear which specification declares that optional class bound should reserve "bound_index=0", however, OpenJDK implementation does adjust the index. |
Just in case, It looks like jandex does not handle that :-( |
So at this point my recommendation would be not to use the JPA annotations. |
I've created jandex issue: smallrye/jandex#99 The takeaway for pgjdbc is we might want to verify that the produced bytecode is parseable with jandex, asm, and probably other bytecode analysis frameworks. |
Would incorporating spotbugs be sufficient to test asm?
I am not certain how it generally handles case of bytecode it does not
understand. I do know that many of the jdk 8 changes caused spotbugs
(findbugs) to fail until asm was updated.
…On Sun, Jan 3, 2021 at 7:49 AM Vladimir Sitnikov ***@***.***> wrote:
I've created jandex issue: smallrye/jandex#99
<smallrye/jandex#99>
The takeaway for pgjdbc is we might want to verify that the produced
bytecode is parseable with jandex, asm, and probably other bytecode
analysis frameworks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2008 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAW3U3M2T5MVK47T32OVZZTSYBYYDANCNFSM4VQ7MRXA>
.
|
@vlsi i guess fix has been merged, when next release is planned? If code is merged should i close the issue, or should i wait till next release and verify if it works? |
@okarmusk , do you think you could verify if #2010 solves the issue for you? I wanted to add Java 11 test with Jandex (as javac 11 produces slightly different java8 bytecode), however, it turned out Java11+ and PostgreSQL12+ have issues with SSL client certificates which I am analyzing at the moment. |
I got a similar error (java.lang.ClassNotFoundException: org.postgresql.Driver) after upgrading postgresql driver from 42.2.2 to 42.3.4. After a lot of trial and error, I found out that postgresql in versions starting from 42.2.13 fails to be properly recognized by the classloader if there is a INDEX.LIST file in the JAR archive. Project in which the issue can be reproduced is in my github repo "DBTest". |
executes fine both inside intellij and manually using 42.3.6 and jdk 1.8 |
Have you tried launching it after building a JAR archive? I've added simple ones to my repo https://github.com/hiroSzymon/DBTest to make testing and verification easier. The only difference between the JARs is the mentioned INDEX.LIST file. |
I ran |
This way it works. The issue happens only when running it with the JAR. |
Did you add the services file to the jar ? https://github.com/pgjdbc/pgjdbc/tree/master/pgjdbc/src/main/resources/META-INF/services |
No. The only services file is in the postgresql-42.3.4.jar downloaded from maven repository (to be sure, I've compared SHA-256 between the maven one and downloaded directly from https://jdbc.postgresql.org/download/postgresql-42.3.4.jar and they are equal). |
so I cloned your repo and built it using mvn package |
I believe the issue has been fixed in 42.2.19 2df6c97, and 42.3.0 f3301c1 @hiroSzymon , please file a new issue with the test case |
As vlsi suggested, I've created new issue #2527. |
I've upgraded driver to version
42.2.18
, thenRequired class information missing
error appeared. Source code with traces bellow. To omit error i had to back to version42.2.14
.persistence.xml
:Stack trace:
The text was updated successfully, but these errors were encountered: