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

NPE after switching from Alpha1 to Alpha2 #336

Closed
jwgmeligmeyling opened this issue Feb 8, 2017 · 9 comments
Closed

NPE after switching from Alpha1 to Alpha2 #336

jwgmeligmeyling opened this issue Feb 8, 2017 · 9 comments
Assignees
Milestone

Comments

@jwgmeligmeyling
Copy link
Collaborator

Happens on initialisation of the CriteriaBuilderFactory. Switching back to Alpha1 solved the problem for me.

INFO: Blaze-Persistence version: Blaze-Persistence 'Ink' 1.2.0-Alpha2
Exception in thread "main" java.lang.NullPointerException
	at org.hibernate.mapping.Column.getCanonicalName(Column.java:352)
	at org.hibernate.mapping.Table.getColumn(Table.java:232)
	at com.blazebit.persistence.impl.hibernate.HibernateExtendedQuerySupport.getColumnTypes(HibernateExtendedQuerySupport.java:180)
	at com.blazebit.persistence.impl.EntityMetamodelImpl.<init>(EntityMetamodelImpl.java:89)
	at com.blazebit.persistence.impl.CriteriaBuilderFactoryImpl.<init>(CriteriaBuilderFactoryImpl.java:80)
	at com.blazebit.persistence.impl.CriteriaBuilderConfigurationImpl.createCriteriaBuilderFactory(
[....]
@Mobe91
Copy link
Contributor

Mobe91 commented Feb 8, 2017

What Hibernate version are you using?

@beikov
Copy link
Member

beikov commented Feb 8, 2017

Would be interesting if you could debug and check for what entity/table and column this happens. Do you have computed columns in your entities maybe?

@jwgmeligmeyling
Copy link
Collaborator Author

5.2.6.Final with the blaze-persistence-integration-hibernate-5.2

@beikov beikov self-assigned this Feb 8, 2017
@beikov beikov added this to the 1.2.0 milestone Feb 8, 2017
@jwgmeligmeyling
Copy link
Collaborator Author

I do have one @Formula column in one entity, if that counts as a computed column. I am running a few batches on 1.2.0-Alpha1, but in a few minutes I can test against 1.2.0-Alpha2 again and provide some debugging information.

@beikov
Copy link
Member

beikov commented Feb 8, 2017

Let me create a test for that so I can make sure this works. I think the persister reports null as column name for such properties which is why this exception might happen.

@beikov
Copy link
Member

beikov commented Feb 8, 2017

Indeed, was able to reproduce it.

beikov added a commit that referenced this issue Feb 8, 2017
@beikov beikov closed this as completed Feb 8, 2017
@beikov
Copy link
Member

beikov commented Feb 8, 2017

Can you confirm it works with the latest snapshot? Sorry to say, but it seems you'd have to stick to a custom build for now.
From what I can say, the Alpha3 release is probably 1 month away so either you use the SNAPSHOT now or stick with Alpha1 until then.

@jwgmeligmeyling
Copy link
Collaborator Author

Unfortunately the bug is still present in the latest snapshot (I tested against the repository master). After stepping through the code, it seems to happen for a regular column in an abstract entity mapped with @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS). (So the table name actually comes from the subtype)

@jwgmeligmeyling
Copy link
Collaborator Author

Thanks for merging! I'll stick with using the latest SNAPSHOT for now 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants