ESAPI Logger Integration with SLF4J/Logback #708
-
I had a question about incorporating ESAPI logging framework to our project. We are using WebSphere, RAD, Java 8, esapi-2.4.0.0.jar. There is a separate folder for dependencies and esapi-2.4.0.0.jar is there on the classpath. We are not using Maven. The application flow is like below. MyCode -> ESAPI_LOGGER -> SLF4J/Logback -> Console Application has client and server side modules. ESAPI is able to find ESAPI.properties and validation.properties placed under client root but failed to find those under server root. Those were visible when I placed it along with Java source. Enabled ESAPI.properties entry and replaced SLF4J reference as below... ESAPI.Logger=org. owasp. esapi. logging. slf4j.Slf4JLogFactory
I would greatly appreciate if you could guide me or direct me to the right location. Thanks in advance. John |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@jeremiahjstacey - Could you take a look at this and see if you can figure it out? Looks like ESAPI.Logger is set correctly here. Also looks like John's class loader is not finding the esapi-2.4.0.0.jar at all as the class that it is complaining can't be found is |
Beta Was this translation helpful? Give feedback.
-
To answer the explicit questions above:
I am not aware of a specific 'zip' file existing.
There are several resources available, but I'm not sure if any will be exactly what you're asking for.
From what's being described, I would assume this would be resolved by having the esapi jar in the dependencies directory for the server. Try to specify the ESAPI jar explicitly on the Websphere classpathI'm not familiar with Websphere, but the documentation I'm seeing suggests that this can be added through the web console Build an Uber Jar for your projectBundling esapi with your artifact should guarantee the resolution at runtime. Maven makes this easier, but it is possible to do it by hand with the |
Beta Was this translation helpful? Give feedback.
-
@JavaTypica - First off, I'm assuming that you are using ESAPI classes in your application directly, correctly, and not via some other class library? If not, then it could be that it's trying to load it via reflection and it's a different class loader than the one you need it to be in or that other library is directly trying to load the ESAPI jar and messing something up. So, please confirm that my assumption first. Next (assuming the above), I recommend that you first check to make sure that the ESAPI jar is getting loaded at all. I recommend starting WebSphere using ' Alternately, you can explicitly set the WebSphere class path as @jeremiahjstacey noted. I've not read that URL he sent, but you probably can start WebSphere with the '-cp' or '-classpath' argument including an explicit path to the esapi-2.4.0.0.jar or possibly resetting it from the exported environment variable CLASSPATH. (Although, the WebSphere start-up script might reset that, so YMMV.) |
Beta Was this translation helpful? Give feedback.
To answer the explicit questions above:
I am not aware of a specific 'zip' file existing.
The esapi jar file is basically a glorified zip. You should be able to extract the jar to view the contents, which will include all required dependencies for the default features of the project (those on the maven compile and runtime scopes)
There are several resources available, but I'm not sure if any will be exactly what you're asking for.