So for the last part of the JNDI exposure post, I mentioned that there were other options than opening your datasource open for external access. I felt uncomfortable doing this, and wanted something that would provide security ON THE SERVER SIDE to help protect these important resources.
It just so happens that you can send messages over HTTP to a special servlet included with JBoss to get your datasource instance reference.
Basically, you modify the invoker-http.sar application in the deploy directory of your JBoss node to setup standard JAAS based authentication shemes.
When writing standard java applications, it has always annoyed me to write JDBC connection code to get non pooled sources for data. There are performance benefits to be had by using pooled resources and to have a standalone java application or even a CLI application leverage that is something I have always wanted to play around with.
I have been working with these two things and now I am playing around with mixing them. I realize that they have been going together for quiet some time now like peanut butter and jam, however I have had some really off the wall problems and getting cohesion.
This morning, after owning an iPhone since the first week they were sold, I managed to drop my iPhone to the point where the glass shattered. Unfortunately, this is not just a small crack. I have already had those. This is a major shatter. From what I can tell, the LCD is still 100% functional, so I started on the journey of looking at my options.
I recently had an issue where a projects chosen servlet specification had been set higher than our servers servlet container would support. My first thought to change was to adjust the dynamic web modle facet level in eclipse, but soon realized that this particular facet would not allow modification. My only other thought to achieve this was to create a new project at the correct version, then copy past all the projects code internals to the newley created project. While this works, it is a tedious and human error prone way to approach the problem.
After working with heavy J2EE application servers like Websphere and Glassfish for years, moving to something like Tomcat presents some interesting questions as administrator. Where are all the web based UI pages for creating datasources and so forth? The answer lies in the various xml configuration files. While this makes it pretty easy to quickly change, I have seen multiple configurations to accomplish the same thing.
I have been creating my first application to run on JBoss App Server (Portal), and wanted to record the steps for setting up a datasource in that environment. This should also work without JBoss Portal. I really thought this would be similar to doing a Tomcat setup, and it sort of was, but it does have its own distinctions.
Basically all you have do is the following:
1. Copy the driver file to your server config's lib directory
2. Create a configuration file in the app's WEB-INF directory called "jboss-web.xml". This file should have something like the XML below as its content:
whew...
I have a lot to say about this topic, but am too tired for it now. Expect more (perhaps with pics) later.
I have been working through a great book on programming using Cocoa by Aaron Hillegass. It has occurred to me that I may not be the only person working and occasionally struggling with the challenge exercises from the book, so I am thinking about posting the solutions on here. If I end up not doing this, please feel free to email me (s
tguitar@gmail.com) for any questions you might have.
A promised, I wanted to update with what it took to get LDAP configured and running. Once the install/setup of the databases was complete, it was a matter of modifying the /etc/openldap/ldap.conf and /etc/openldap/slapd.conf files correctly, mainly the latter.
The basic information that must be correct are the suffix, rootdn, and rootpw. Once I figured out the correct setting of the suffix (for example dc=stevenguitar, dc=com) things started up just fine without a hitch.