Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Fwd: [Bug 347110] Support ClassFileTransformer's in WebAppClassLoader

Jetty 9.2.x included a fix for bug/request #347110, mainly to simplify the use of jetty with spring. We just upgraded to this version, ready to remove our custom classloader, and noticed that the patch does not satisfy the requirements by spring. In particular, the jetty-method has been named "addClassFileTransformer", while spring requires it to be called "addTransformer". The exception is below, with line breaks that hopefully make it easier to read:

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'loadTimeWeaver':
Initialization of bean failed; nested exception is java.lang.IllegalStateException:
ClassLoader [org.eclipse.jetty.webapp.WebAppClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method.
Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar          

I checked the bugzilla log, and see that the naming requirement may not have been entirely clear. Anyway, I believe the major use case is spring, and I guess there are two major solutions:

1: One scenario would be to just rename the methods in jetty's WebAppClassLoader, from { addClassFileTransformer, removeClassFileTransformer } to { addTransformer, removeTransformer }
2: Another is to add new methods { addTransformer, removeTransformer } that just forwards to { addClassFileTransformer, removeClassFileTransformer }.

The first is probably good enough, but if there are strict backward compatibility requirements, then we may need to go with #2. With #2, we can also make { addTransformer, removeTransformer } the "real" methods, and deprecate { addClassFileTransformer, removeClassFileTransformer }.

-> Comments?
-> I don't know how to reopen an issue in bugzilla. Can anyone help, or do I need to file a new one?

Eirik


---------- Forwarded message ----------
From: <bugzilla-daemon@xxxxxxxxxxx>
Date: Sun, Jan 19, 2014 at 11:56 PM
Subject: [Bug 347110] Support ClassFileTransformer's in WebAppClassLoader
To: eirik.lygre@xxxxxxxxx


https://bugs.eclipse.org/bugs/show_bug.cgi?id=347110
Product/Component: Jetty / server

Greg Wilkins <gregw@xxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|376537                      |

--- Comment #6 from Greg Wilkins <gregw@xxxxxxxxxxx> ---
Eirik,

we'd be please to include in Jetty either direct support for addTransformer()
or changes to make the -javaagent:spring-instrument-4.0.0.jar approach simpler
to add.

However we have neither the time nor direct use-case experience to be able to
do this on our own.

So could you look at WebAppClassLoader, the partial implementation done in 2011
and the current requirements of the spring LTW to suggest exactly what we need
do to support addTransformer?    A patch would be most welcome, but failing
that even a unit test that we would need to pass would be entirely helpful in
getting this done and supported.

--
You are receiving this mail because:
You are on the CC list for the bug.



Back to the top