Announcement Announcement Module
Collapse
No announcement yet.
OpenJPA Build-time enhancement warning Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenJPA Build-time enhancement warning

    I am using OpenJPA build-time enhancement warning.
    When the server starts, I get:
    Code:
    WARN [main] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'PuName', root URL [file:/.../]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
    which openjpa documentation (http://openjpa.apache.org/integration.html) says is safe to ignore.

    I would like to get rid of the message. I traced the issue down to SpringPersistenceUnitInfo.addTransformer is called, but there is no loadTimeWeaver set.

    My solution is to create my own dummy LoadTimeWeaver that does nothing:
    Code:
    public class OpenJPALoadTimeWeaver implements LoadTimeWeaver
    {
    	public OpenJPALoadTimeWeaver() {
    		return;
    	}
    
    	public void addTransformer(ClassFileTransformer transformer) {
    		// nothing
    		return;	
    	}
    
    	public ClassLoader getInstrumentableClassLoader() {
    		return this.getClass().getClassLoader();
    	}
    
    	public ClassLoader getThrowawayClassLoader() {
    		return this.getClass().getClassLoader();
    	}
    }
    Seems to work for me. What are the side-effects? And should I return a different ClassLoader?

    Any feedback would be appreciate, as I have no idea what I am doing

    Thanks
Working...
X