Issues
- HqlLexer can cause ClassNotFound in OSGi environmentHHH-6165Resolved issue: HHH-6165
- HSQLDialect support for ROWNUMHHH-6012Resolved issue: HHH-6012
- Hibernate increases version on readHHH-5867Resolved issue: HHH-5867Strong Liu
- Hibernate should not use LONG type for OracleHHH-5569Resolved issue: HHH-5569Former user
- JPA 2 orphanRemoval on OneToOne relation does not work properlyHHH-5559Resolved issue: HHH-5559Emmanuel Bernard
- DbTimestamp uses local time for @Version field on Oracle 11gHHH-5553Resolved issue: HHH-5553
- ByteCodeHelper.readByteCode won't load classes bigger than a constant sizeHHH-5453Resolved issue: HHH-5453Steve Ebersole
- Dialect resolution: Cannot set a custom dialect resolver programatically or using hibernate.cfg.xmlHHH-5306Resolved issue: HHH-5306Steve Ebersole
- In the Session.flush method has a lost of perfomance about 50% when flush a large amout of dataHHH-5062Juraci Paixão Kröhling
- EventListenerConfigurator uses Ejb3Configuration but could use AnnotationConfiguration insteadHHH-5052Resolved issue: HHH-5052Emmanuel Bernard
- TableGenerator does not increment hibernate_sequences.next_hi_value anymore after having exhausted the current lo-rangeHHH-5042Resolved issue: HHH-5042Steve Ebersole
- Findbugs WarningsHHH-4971Resolved issue: HHH-4971Former user
- Inconsistent behavior when fetching cached subclass entities from 2LHHH-4953Resolved issue: HHH-4953
- Null Pointer Exception When Usding Spring 3.0 with Hibernate 3.5.0-Beta-xHHH-4909Resolved issue: HHH-4909Former user
- Infinispan: 2L QueryCache don't considers cached queries which belong to current transactionHHH-4836Resolved issue: HHH-4836Galder Zamarreno
- @CollectionId does not force the id column to not-nullHHH-4773Resolved issue: HHH-4773Strong Liu
- org.hibernate.test.pagination.PaginationTest.testLimitOffset() fails on oracle and db2 due toHHH-4764Resolved issue: HHH-4764Strong Liu
- org.hibernate.test.filter.DynamicFilterTest.testSqlSyntaxOfFiltersWithUnions fails on MySQLHHH-4741Resolved issue: HHH-4741Strong Liu
- Some annotations tests in IndexedCollectionTest fail due to "foreign key constraint" failure on MySQL InnoDBHHH-4695Resolved issue: HHH-4695
- Unexpected results when an entity with non-flushed changes is changed from read-only to modifiableHHH-4642Resolved issue: HHH-4642Former user
- KEY, VALUE and ENTRY should not be strict keywordsHHH-4613Resolved issue: HHH-4613Steve Ebersole
- Possible Sybase bug causes AssertionFailure in QueryByExampleTestHHH-4580Resolved issue: HHH-4580Steve Ebersole
- Sybase - Test "BatchTest" fails due to "unexpected row count from update"HHH-4568Resolved issue: HHH-4568Strong Liu
- EntiytManager's QueryImpl mishandles ordinal position of HQL-style positional parametersHHH-4567Resolved issue: HHH-4567Steve Ebersole
- collection_valued_input_parameter not working in IN statementHHH-4541Resolved issue: HHH-4541Former user
- Change the docbook style for Annotations and EntityManager to the latest styles used in the other Core modulesHHH-4530Resolved issue: HHH-4530Hardy Ferentschik
- Read mapping annotations from entity properties rather than the composite pkHHH-4528Resolved issue: HHH-4528Hardy Ferentschik
- Add better metainf information tot he hibernate all jar gennerated for distHHH-4526Resolved issue: HHH-4526Steve Ebersole
- Trunk is not including the newly added modules to the distribution bundleHHH-4525Resolved issue: HHH-4525Steve Ebersole
- Some of the tests in the entitymanager have hard coded connection settings - these tests should use filtered connection settingsHHH-4523Resolved issue: HHH-4523Hardy Ferentschik
- CallbackAndDirtyTest throws exception when run against PostgreSQLHHH-4522Resolved issue: HHH-4522Hardy Ferentschik
- Hibernate/JBC integration doesn't property handle Entity/CollectionRegionAccessStrategy evict(Object)HHH-4517Resolved issue: HHH-4517Brian Stansberry
- AnotationConfiguration does not honor hibernate.validator.apply_to_ddl property in case Hibernate Validator 4 is activatedHHH-4513Resolved issue: HHH-4513Hardy Ferentschik
- Problems with polymorphic queries with SINGLE_TABLE inheritance strategyHHH-4511Resolved issue: HHH-4511Chris Cranford
- Sybase - Annotations - unit tests using LOBs failHHH-4503Resolved issue: HHH-4503Strong Liu
- Update database profiles in pom.xmlHHH-4502Resolved issue: HHH-4502Juraci Paixão Kröhling
- MSSQL, Oracle - Mapping inconsistencyHHH-4500Resolved issue: HHH-4500Strong Liu
- cglib log warning says BytecodeProvider impl is considered deprecatedHHH-4494Resolved issue: HHH-4494Former user
- Constants point to non-existing default JBC/JGroups config file locationsHHH-4475Resolved issue: HHH-4475Brian Stansberry
- Document @Entity.name != Hibernate entity nameHHH-4465Resolved issue: HHH-4465
- Native queries should not be automatically paginated in getSingleResult() as it fails for some DB and or queriesHHH-4463Resolved issue: HHH-4463Emmanuel Bernard
- SchemaUpdate fails on Sybase ASE 15 when a new column is added without a default valueHHH-4457Resolved issue: HHH-4457Strong Liu
- Sybase ignores the last byte when persisting a byte [] with BinaryType and the last byte is 0HHH-4452Resolved issue: HHH-4452Strong Liu
- NPE during inserting new audited entity with reference to another proxy entity if proxy.lazyInitializer.session is nullHHH-4449Resolved issue: HHH-4449AdamA
- Envers proxy.getId() returns null if proxy was not initialized yetHHH-4447Resolved issue: HHH-4447AdamA
- SessionImpl serialization violates java serialization specHHH-4441Resolved issue: HHH-4441Sanne Grinovero
- In general it is impossible to override properties defined in @MappedSuperclass to change how they will be handled during auditing.HHH-4439Resolved issue: HHH-4439Lukasz Antoniak
- It is impossible to override RelationTargetAuditMode using AuditOverrideHHH-4438Resolved issue: HHH-4438AdamA
- DataVersionAdapter.newerThan incorrect when comparing to selfHHH-4435Resolved issue: HHH-4435Brian Stansberry
- Integrate new long string and binary property types in core with annotationsHHH-4405Resolved issue: HHH-4405Strong Liu
50 of 89
HqlLexer can cause ClassNotFound in OSGi environment
Out of Date
Description
Attachments
1
duplicates
relates to
Details
Details
Created April 28, 2011 at 5:15 PM
Updated February 12, 2013 at 10:37 PM
Resolved February 12, 2013 at 10:37 PM
Activity
Show:
Brett Meyer February 12, 2013 at 10:36 PM
Marking out-of-date. Will be addressed in HHH-7991.
Brett Meyer February 12, 2013 at 9:49 PMEdited
Scott, this patch might not work with OSGi class loading. I'm not sure if the runtime classloading will like it. Keep it on the radar.
Scott Marlow August 3, 2011 at 3:22 PM
I like your patch but I did mine differently in HHH-6536. One question that I have about your patch, can it be made to use an antlr api instead of referencing a protected variable directly? Is the protected tokenObjectClass documented as being safe to change (in terms of future releases of antlr including the same variable)?
In my patch, I set the thread context classloader to HqlToken.class.getClassLoader(). Would that work for your case also?
org.hibernate.hql.ast.HqlLexer can cause a ClassNotFound exception in an OSGi environment with a stacktrace like
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [hql query here] at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:80) at antlr.CharScanner.setTokenObjectClass(CharScanner.java:338) at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:54) ...
The HqlLexer class has antlr.CharScanner as a superclass, as evidenced by the stacktrace. The contents of the method are:
public void setTokenObjectClass(String cl) { // Ignore the token class name parameter, and use a specific token class. super.setTokenObjectClass( HqlToken.class.getName() ); }
It passes the name of the HqlToken class as a string to CharScanner, which then ultimately attempts to find HqlToken via antlr.Utils. The tokenObjectClass is a protected field. The code can be simplified by simply setting the field directly to HqlToken.class which is obviously already available to the HqlLexer class.
The reason this causes the exception in an OSGi environment is that the context class loader available to ANTLR is limited to what is explicitly declared in the ANTLR bundle. Since ANTLR cannot (and should not) have to know about all the classes that it may be passed, it does not declare an import on the org.hibernate.hql.ast package. By passing the class directly, the lookup is avoided from within the ANTLR package.
public void setTokenObjectClass(String cl) { // Ignore the token class name parameter, and use a specific token class. tokenObjectClass = HqlToken.class; }