aaron-kelley.net

My little corner of the Internet

Posts Tagged ‘Java’

MySQL, Tomcat 6, and Ubuntu 9.10: Blah

Trying to set up a JSP application on Ubuntu 9.10, using Tomcat 6 and MySQL 5.1 (both from the Ubuntu repositories).  I was getting a curious error when trying to get a connection to the MySQL database from the JDBC DriverManager:

SQLException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
SQLState: 08S01
VendorError: 0

After searching for a while and going through some solutions that didn’t work for me, I found the answer here.  I’m re-posting it because that answer is posted in Spanish.  :-P

All you have to do is open /etc/init.d/tomcat6 in your favorite text editor (as root), find the line that looks like TOMCAT6_SECURITY=yes, and change it to TOMCAT6_SECURITY=no.  Then, restart the Tomcat server (sudo service tomcat6 restart).  Ta da!!  MySQL connections are now working.

Now, there’s probably a better way to do this that doesn’t involve completely turning off “TOMCAT6_SECURITY,” but this seems fine for a small test project which is what I’m working on (it will eventually be deployed on the JBoss server).  I’ll be sure to update this post if I find it… or if you know anything, leave a note in the comments below.

Java icon appears in system tray, even when you told it not to?

Alright, here’s some Sun Java silliness I ran across a while back and just found the fix for.

If you’re running Java applications on Windows, you may have noticed that Sun likes you to see a Java icon in the system notification area when a Java application is running. You can get rid of it by right-clicking on it and selecting “Hide icon,” but it’ll just come back next time. There’s an option in the Java control panel to hide the icon… But sometimes, in Vista, it shows up even though you’ve told it to hide.

(more…)

Getting Started with JNI and C++ under Windows

This is a step-by-step guide to getting started at using JNI with C++ under Windows.

(more…)