Sayed's thoughts
Thursday, June 30, 2005
Hibernate settings
Recently I've been playing around with Hibernate and Hypersonic for a project that I have going on. Seems to be pretty cool. Currently I'm using an older version of both Hibernate & Hypersonic but I think we'll upgrade in a bit. I'm using Hibernate 2 & Hypersonic 1.8(I think). I noticed that you have to set the following system properties when using.
- hibernate.dialect
- jdbc.drivers
- java.naming.factory.initial
Here is what I have them set to:
| Name | Value | Note |
| hibernate.dialect | net.sf.hibernate.dialect.HSQLDialect | Dialect for Hypersonic DB |
| jdbc.drivers | org.hsqldb.jdbcDriver | Driver for Hypersonic DB |
| java.naming.factory.initial | org.jnp.interfaces.NamingContextFactory | Provided by JBoss, can be found in jbossall-client.jar |
log4j stuff
For those of you who'd like to automate your logging settings here's an ant script that will do it. I'm sure there are many other available on the net as well.
<!--
This will configure the log4j settings for debuging.
This should only be called from within another target.
Ensure that in the calling target you set the property 'log4j.run.dir'
this is where the log file will be placed.
-->
<target name="setupDebugLogging" description="This will configure debug logging setting">
<!-- Just need to copy the debug file to the run directory -->
<copy file="${logging.src.dir}/log4j.debug" tofile="${log4j.run.dir}/log4j.properties" overwrite="true"/>
</target>
<target name="setupRunLogging" description="This will configure the logging for use when clients run the app">
<copy file="${logging.src.dir}/log4j.run" tofile="${log4j.run.dir}/log4j.properties" overwrite="true"/>
</target>
<!-- This demonstrates how to use the setup logging tasks -->
<target name="logDemo" description="Just a test delete me!">
<antcall target="setupDebugLogging">
<param name="log4j.run.dir" value="${build.dir}"/>
</antcall>
</target>
This assumes that in your build.xml file you have defined the property logging.src.dir. Inside this directory there must be two log4j files (in this example that is) log4j.debug and log4j.run. When you call this set the param log4j.run.dir, this is where the log4j.properties file will be written, also where the log file will be stored at. In order for this to work this folder must be in your classpath. I this sample the build directory is where the log4j.properties file is and also where the log file will be saved. In your application you could place these elsewhere, but make sure that its in your classpath if you do. :)
Here is a sample log4j debug file that is used.
#Properties file that can be used for debug logging
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1, R
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
#Setup RollingFileAppender here
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=quantum.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=2
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# Set log levels here
log4j.logger.net.jxta=WARN
log4j.logger.com.cluck=DEBUG
log4j.logger.com.databaseSetup=DEBUG
#This is necessary for hibernate debugging
log4j.logger.com.net.sf=DEBUG
Wednesday, June 22, 2005
Jxta Article
Previously I wrote an article, P2P Applications made simple, Part 1. A while ago a Brazilian contacted me about translating it to Portuguese. Seems like they did that and it's available at: http://www.java.pt/aprender/tutoriais/jxtatutorial.html. I have heard that Brazil is going to be a place where a tech boom is going to occur soon. I think this is pretty cool, especially because Gil lives in Brazil. I think he'll get a kick out of my translated article.
Sunday, June 19, 2005
Dreamcatcher Update
So I have registered the URL sedodream.com for my Dreamcatcher application.
sedo is calm in latin.
I'm probably not going to put anything up there anytime soon. Mainly wanted to use it for package names and what not. I'm now working with John Wu on the project. He's a PhD student at UT-Dallas. He is currently mainly focused on the user interface. I have told him that we should investigate using swixml for our UI. I don't really know that much about it, but have heard really good things from some people that know what they are talking about. Hopefully he will like it as he learns about it. I have told him to make some mock-ups for the UI, then we will proceed from there. While he is working on the UI stuff, I'll work on the backend trying to create some more design documents for the project and try to make sure that we are on the same page for where this project is going.
We have to try to provide the flexibility for use besides just dreams, but I still want that extra functionality to be there. I don't want it to get lost in the crevesas. After all this project is the Dreamcatcher. But it does certainly make sense to make it more of a robust application. We just have to keep in mind what its intended use was in the first place. My task for this week is to create a document describing all the technologies that we will be using and why. Also to try to describe what are the pros/cons of each technology and why I chose that over some of the other options.
I find it interesting that suddenly I'm a project manager. I'm kinda excited and scared at the same time. I think that one day I'll be a great leader of many developers, but I don't think I'm there yet. But I think that I will do a decent job of fulfilling the requirements for the Dreamcatcher application. I think that I'll do a great job for someone with my amount of experience anywayz. Only time will tell, guess it's still up in the air. I just wish I had more time to devote to this project. I think that after August I'll have a bunch more time, but it always seems like that. Hopefully I'll be right this time!
Tuesday, June 14, 2005
Dreamcatcher
Seems as though Google's Summer of code has brought some attention to my Dreamcatcher project. There is at least one person who is seriously interested on working the project even if not accepted for SOC!
It is going to be nice to finally get the ball rolling on this project. Something that I've been wanting to do for a long time. Maybe now is the time for this application to finally be built like it should! Hopefully I'll do a good job of working on/managing this project. Only time will tell. One thing I do know, regardless of supporters, this project will be at a usable state in at most 6 months. But its always easier when other people are working with you.
Friday, June 03, 2005
Quantum Chess
So I'm working on a project with my friend Daniel Brookshier. It's a JXTA application called Quantum Chess. It's a more complicated variant of chess created by a friend of his. Currently the application is storing data to an XML file, but we want it to be stored to a local database. Here is what we are using.
HibernateDatabase abstraction layer
Hypersonic SQLLocal Database
XDocletCode annotation package - specifically for Hibernate annotations
These are some cool technologies and if you're a Java developer and don't already know about these you should definitely look into them.
You might be wondering why we are using XDoclet as opposed to the annotations that are a part of Java 5. We'll simply because we're not using Java 5 yet. Currently there are few Mac's that use Java 5 and we don't want to keep those guys in the dark. So we'll use XDoclet to get the job done now. Later we will examine if we should switch or not. But I don't think it will be an issue anywayz.
Besides that project my Dreamcatcher application. If you know Java and want to help that would be awesome! I'm also planning on using Hibernate & Hypersonic SQL for that application, so my work on Quantum will be a great learning experience for that application.
Speaking of learning experience, I've found that I pick things up soo much quicker now then I did a year ago. Specifically with using new technologies and just cool stuff. I'm guess this is because my experience is much greater now then it was back then. Also I've been in a situation where I pretty much have to learn a lot of new technologies in little time. I think this will be one of my strong points in the future, to be able to pick up technologies as I go and not being stuck on a particular set of technologies. I think that every problem needs it's own specific set of technologies to conquer the problem effectively. Hopefully I'll get better at selecting that set of technologies and designing/implementing solutions to cool problems.
Thursday, June 02, 2005
Open source projects
My Dreamcatcher Jxta application has been approved and now under development. If you are a Java developer and interested in dreams join my project and lets get this thing rolling!
Also I have another open source project Dynamic Extensible Styles that is a tool for web developers. You can also join this effort if you desire.

