Skip to content

Commit

Permalink
Attempt to fix the classloader issue when using WOBootstrap.jar (issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hprange committed Sep 8, 2013
1 parent 85a135a commit a77d01b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/woinject/WOInject.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
import java.security.AccessController;
import java.security.PrivilegedAction;

import javassist.ClassClassPath;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.Loader;

import com.webobjects.foundation._NSUtilities;

/**
* The <code>WOInject</code> class initializes the application intercepting core
* methods used by WebObjects classes to create objects.
Expand Down Expand Up @@ -54,6 +57,8 @@ public class WOInject {
public static void init(String applicationClass, String[] args) {
final ClassPool pool = ClassPool.getDefault();

pool.insertClassPath(new ClassClassPath(_NSUtilities.class));

Loader loader = AccessController.doPrivileged(new PrivilegedAction<Loader>() {
public Loader run() {
return new Loader(pool);
Expand Down

0 comments on commit a77d01b

Please sign in to comment.