[hibernate-dev] WildFly error running org.jboss.as.test.integration.jpa.hibernate.classfiletransformertest.ClassFileTransformerTestCase (sets hibernate.ejb.use_class_enhancer to true)

Luis Barreiro lbarreiro at redhat.com
Thu Jul 9 01:08:48 EDT 2015


I did review the code and come up with the same conclusion.

Issue: https://hibernate.atlassian.net/browse/HHH-9907

PR open: https://github.com/hibernate/hibernate-orm/pull/996

Regards,

On 07/09/2015 02:03 AM, Scott Marlow wrote:
>
> On 07/08/2015 07:00 PM, Scott Marlow wrote:
>> I noticed that CI test failure is only occurring on Windows.  I wonder
>> if
>> https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/spi/Enhancer.java#L114
>> is misbehaving on Windows.
> We might need to use '/' instead of File.separatorChar.
>
> See javadoc for Class#getResourceAsStream:
> "
> public InputStream getResourceAsStream(String name)
>
>       Finds a resource with a given name. The rules for searching
> resources associated with a given class are implemented by the defining
> class loader of the class. This method delegates to this object's class
> loader. If this object was loaded by the bootstrap class loader, the
> method delegates to ClassLoader.getSystemResourceAsStream(java.lang.String).
>
>       Before delegation, an absolute resource name is constructed from
> the given resource name using this algorithm:
>
>           If the name begins with a '/' ('\u002f'), then the absolute
> name of the resource is the portion of the name following the '/'.
>           Otherwise, the absolute name is of the following form:
>
>                  modified_package_name/name
>
>
>           Where the modified_package_name is the package name of this
> object with '/' substituted for '.' ('\u002e').
> "
>
>> On 07/08/2015 04:00 PM, Scott Marlow wrote:
>>> We are getting a "Failed to define class
>>> org.jboss.as.test.integration.jpa.hibernate.SFSBHibernateSessionFactory"
>>> error when running the WildFly tests on the CI machine.  I don't see
>>> this error locally which is why we didn't see this before.
>>>
>>> [1] shows the WildFly console at the time of error.
>>>
>>> The class that cannot be defined is
>>> https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/SFSBHibernateSessionFactory.java
>>> [2]
>>>
>>> I suspect that this is some type of race condition that we are hitting
>>> with deployment of three persistence units [3] concurrently from three
>>> threads.  The persistence units have "hibernate.ejb.use_class_enhancer"
>>> set to true.  This might have something to do with the same appliation
>>> class being enhanced concurrently from three threads.
>>>
>>> The test case [4] is verifying that enhanced application classes can be
>>> used.
>>>
>>> I'm not exactly sure why the SFSBHibernateSessionFactory class is being
>>> enhanced.  I thought we only enhanced the entity classes
>>> (SFSBHibernateSessionFactory references the Employee entity class but is
>>> not an entity class).
>>>
>>> Scott
>>>
>>> [1] https://gist.github.com/scottmarlow/c56cfe07f2ea514354aa
>>>
>>> [2]
>>> https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/SFSBHibernateSessionFactory.java
>>>
>>> [3]
>>> https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/classfiletransformertest/persistence.xml
>>>
>>> [4]
>>> https://github.com/wildfly/wildfly/blob/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/classfiletransformertest/ClassFileTransformerTestCase.java
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev

-- 
Luis Barreiro
JBoss^® by Red Hat


More information about the hibernate-dev mailing list