|
15 | 15 | import java.util.Properties;
|
16 | 16 |
|
17 | 17 | public class OpenEJBObjectFactory implements ObjectFactory {
|
18 |
| - static { |
19 |
| - try { |
20 |
| - configureLog4J(); |
21 |
| - } catch (Throwable t) { |
22 |
| - throw new CucumberException(t); |
23 |
| - } |
24 |
| - } |
25 |
| - |
26 | 18 | private final List<String> classes = new ArrayList<String>();
|
27 | 19 | private final Map<Class<?>, Object> instances = new HashMap<Class<?>, Object>();
|
28 | 20 | private EJBContainer container;
|
@@ -69,24 +61,5 @@ public <T> T getInstance(Class<T> type) {
|
69 | 61 | instances.put(type, object);
|
70 | 62 | return object;
|
71 | 63 | }
|
72 |
| - |
73 |
| - private static void configureLog4J() throws Throwable { |
74 |
| - final ClassLoader cl = Thread.currentThread().getContextClassLoader(); |
75 |
| - if (System.getProperty("log4j.configuration") == null && System.getProperty("log4j.configurationClass") == null |
76 |
| - && cl.getResource("log4j.xml") == null && cl.getResource("log4j.properties") == null) { |
77 |
| - Properties log4jProp = new Properties(); |
78 |
| - log4jProp.setProperty("log4j.rootLogger", "info, stdout"); |
79 |
| - log4jProp.setProperty("log4j.appender.stdout", "org.apache.log4j.ConsoleAppender"); |
80 |
| - try { |
81 |
| - cl.loadClass("org.apache.openejb.logging.SimpleJULLikeLayout"); |
82 |
| - log4jProp.setProperty("log4j.appender.stdout.layout", "org.apache.openejb.logging.SimpleJULLikeLayout"); |
83 |
| - } catch (Exception e) { |
84 |
| - log4jProp.setProperty("log4j.appender.stdout.layout", "org.apache.log4j.SimpleLayout"); |
85 |
| - } |
86 |
| - |
87 |
| - Method configure = cl.loadClass("org.apache.log4j.PropertyConfigurator").getDeclaredMethod("configure", Properties.class); |
88 |
| - Utils.invoke(null, configure, 0, log4jProp); |
89 |
| - } |
90 |
| - } |
91 | 64 | }
|
92 | 65 |
|
0 commit comments