java - How to override some classes in a jar in WEB-INF/lib with another jar in JBoss EAP? -


if class override called com.example.fooservlet , class inside jar web-inf/lib/foo.jar, how override class called com.example.fooservlet in jar, bar.jar?

or there way make sure 1 in bar.jar loaded first?

making bar.jar module no-go because fooservlet imports tons of classes many jars in web-inf/lib.


as stated above, tried contain bar.jar in module, got class not found or no class def error (can't remember clearly) fooservlet extends/implements classes/interfaces in 3rd party jars in web-inf/lib.

i'm not allowed touch foo.jar or of jars existing in web-inf/lib.

you said cannot touch existing jars, , seem imply can add jar of yours web-inf/lib.

according this:

  • there no specified order of precedence jars under web-inf/lib/*.jar.
    if add bar.jar in there, don't know if loaded before or after foo.jar.
  • the servlet spec says classes under web-inf/classes must loaded before under web-inf/lib/*.jar

assuming can add jar under web-inf/lib, should able add class (or several) under web-inf/classes, without touching ones in place.
so, if want classes bar.jar loaded first, can unzip contents of jar under web-inf/classes instead (or class want loaded in priority -- example web-inf/classes/com/example/fooservlet.class).


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -