DataSources exposed by Tomcat.
2015-01-12
Connecting to PostgreSQL from Tomcat 7 on OpenShift
I'm using a free OpenShift account to host a small site, and had some trouble getting a connection to my PostgreSQL cartridge from my Tomcat 7 (JBoss EWS 2.0) cartridge. As often happens, the act of asking the question made me think of a few additional solutions to explore, but I ended up posting the question then heading to OpenShift's support page to send a question. Like StackOverflow, OpenShift's contact page starts suggesting articles when you type in a subject, and that's how I found the article that describes their JNDI
2014-01-05
Grunt Proxy Setup for Yeoman
I'm working on a webapp using Angular.js with the help of the Yeoman workflow framework. Because the backend service runs on localhost:8080 and my dev server (through Grunt) on localhost:9000, requests result in same-origin policy errors due to the port difference. To get around this during development, we can setup CORS through a proxy on Grunt.
2013-12-06
Deploying a Gradle webapp project in Spring Tool Suite
There's not a lot of documentation on how to configure a Gradle webapp project to deploy to e.g. tc Server in Spring Tool Suite, but based on a recent Spring forum post, it was easy.
2012-10-17
Adding executables to the new Unity launcher
I've started using Spring Tool Suite for Java development using Spring, but when installing it on Ubuntu 12.04, I didn't get an icon on the launcher. The link helps to avoid having to navigate to and run the executable every time, but I had to do some searching to find out how to add them.
Accessing the ServletContext in Tapestry 4.1
We use Tapestry 4.1 at my new gig, so I decided to implement my sandbox webapp with it to improve my understanding; this process has helped me immensely.
In this webapp I have a gallery that is built dynamically based on a listing of files from a directory within the app context. It was a bit of a struggle to figure out how to get access to the servlet context, but it's incredibly easy once you know the incantation.
In this webapp I have a gallery that is built dynamically based on a listing of files from a directory within the app context. It was a bit of a struggle to figure out how to get access to the servlet context, but it's incredibly easy once you know the incantation.
2011-12-04
Converting from Subversion to Mercurial on Bitbucket
I've been doing source control of personal projects on my own Subversion server for several years, but lately I've gotten interested in making some of it available so that perspective employers can see examples of my work. To do that, I setup a Stack Overflow Careers profile which acts as a resume with links to my StackExchange network profiles and projects on any of the major cloud-based source control services.
Bitbucket, hosted by Atlassian, provides free hosting for any number of repos, private or public, provided you stick to 5 or fewer total committers. It supports Git and Mercurial, probably the two most popular DVCSs today, and since I had some previous experience with Mercurial and use it every day at my current job, I opted for that.
Bitbucket, hosted by Atlassian, provides free hosting for any number of repos, private or public, provided you stick to 5 or fewer total committers. It supports Git and Mercurial, probably the two most popular DVCSs today, and since I had some previous experience with Mercurial and use it every day at my current job, I opted for that.
2011-07-11
Defining custom EL functions
I've been working on porting my sandbox webapp to Spring WebMVC, and in the process I've been learning more about JSP as well. This work led me to ask a question at StackOverflow, a favorite site of mine for a while for finding solutions to problems, though I've only recently begun participating.
In the question I asked about the best way to sort a single List in different ways in JSP, and I didn't get any answers that I really liked, so I kept looking and found an answer that I was able to use to suit my needs. You can see my solution at StackOverflow, but I'll reproduce it here as well.
In the question I asked about the best way to sort a single List in different ways in JSP, and I didn't get any answers that I really liked, so I kept looking and found an answer that I was able to use to suit my needs. You can see my solution at StackOverflow, but I'll reproduce it here as well.
2011-07-01
Forwarding traffic from Apache2 to Tomcat on Ubuntu
I have several Java webapps running under Tomcat that I wanted to be accessible through Apache2 running on port 80 on my home server. It turns out that it's pretty easy to do, though I didn't find an example anywhere that included all the steps I needed to take to get it working. Most of what I need to know was at this blog post.
First of all, here are the exact versions I'm running. I wouldn't be surprised if there are newer major versions; I need to upgrade the server.
First of all, here are the exact versions I'm running. I wouldn't be surprised if there are newer major versions; I need to upgrade the server.
- Apache2: 2.2.11
- Tomcat: 6.0.18
2010-08-02
CruiseControl with Maven2 & SVN on Ubuntu
CruiseControl is a great tool to automate builds; I use SVN and Maven2, so these are the steps I took to get it working. Anywhere you see HOSTNAME, replace it with the hostname of the machine on which CruiseControl is running; anywhere you see PROJECT1, replace it with the name of a Maven2 project.
- Download the binary distribution from the CruiseControl download page.
- Extract it to
/opt. This creates the install directory,/opt/cruisecontrol-VERSION, which I'll callINSTALL. - Add a new user under which CruiseControl will be run; pick whatever username you want, and keep it in mind.
sudo adduser ccmaster
2010-01-25
GWT with RPCs on Tomcat 6
The Tomcat Security Manager has bitten me again.
I'm liking GWT development with the Eclipse plugin. I ran through the StockWatcher tutorial, added RPCs and it was working great in hosted mode, but when I deployed it on Tomcat 6 on Ubuntu 9.04, RPCs failed with the following:
I'm liking GWT development with the Eclipse plugin. I ran through the StockWatcher tutorial, added RPCs and it was working great in hosted mode, but when I deployed it on Tomcat 6 on Ubuntu 9.04, RPCs failed with the following:
The call failed on the server; see server log for details
2010-01-18
New GWT Projects in Eclipse
I had a bit of trouble getting a GWT project setup in Eclipse so that I could use a generated Ant build.xml for creating war packages but also utilize the fancy GWT Eclipse plugin features. The New Web Application Project wizard sets up the GWT project and creates some handy starter app code, but there's no option within the Google context menu to simply create a war. You can deploy directly to Google App Engine which is pretty cool, but I prefer to be able to deploy and run my webapps from my own server so that I know they can be deployed on any Tomcat installation.
2009-12-12
renamed network interface eth0 to eth1
Miraculously, after my old server motherboard died, Ubuntu booted right up on the new board. The only problem I've run into so far is that since the new board's network interface had a different MAC address from my old eth0, udev decided to call it eth1.
Dec 11 00:54:16 hierax kernel: [ 15.251176] udev: renamed network interface eth0 to eth1
I first noticed this when the system didn't get the static ip I had configured in /etc/network/interfaces.
2009-11-20
MythTV: Transcode to XviD and Add to Library
Before starting with MythTV, I already had a library of several TV series that I've been serving to an Xbox running XBMC over Samba, so I wanted the ability to configure certain shows to automatically be transcoded to XviD and moved into my library directory structure (below) and named with season number, episode number, and episode name. MythTV doesn't get the season and episode number from TV listings (at least not through Schedules Direct), so I found a Perl module to query The TVDB and cache results for me. I have some ideas on ways to improve it, but for now it works well enough.
2009-10-19
Getting Crayon off an LCD TV
My son has, on three separate occasions, found it necessary to write in crayon on my LCD TV. To be specific, this is a Samsung 46" LN-T4665F TFT LCD, and I've used this procedure three times since 2008-05 with no ill effects whatsoever. This isn't going to be quick, so set aside a fair amount of time.
Supplies:
Supplies:
- Peanut Oil - I bought mine at the grocery store near the other cooking oils.
- Window cleaner - I just use generic Target window cleaner.
- Paper towels - If you're worried about scratching (I've never noticed any), use a few soft towels or cloths.
2009-10-15
Using Gmail with Postfix on Ubuntu
Postfix is a dependency of
mdadm, but it took me a couple of separate attempts to get it configured to use Gmail as its SMTP relay. There are a lot of good Postfix tutorials out there, but this post will detail the steps I took for my particular situation. I'm currently running Ubuntu 11.10 Server 64-bit, so I needed mdadm to be able to send me notification emails, and I already had CA and server certs for Apache and ProFTP, so I'll skip those steps here.2009-10-09
OpenGrok on Ubuntu w/ Tomcat6
A friend of mine turned me onto OpenGrok a couple of years ago, so when we migrated from CVS to SVN at work I set it up on one of our dev webapp servers to give my team a way to search the repository. The thing I like the most about it is that it does syntax highlighting of your source so you can easily browse without checking a project out into an IDE. There are a lot more advanced features, but that's the one I appreciate the most since I do a lot of browsing of legacy code.
2009-10-02
Activate the T-Mobile G1 without a data plan
I can't afford the data plan for my T-Mobile G1, and in fact I use prepay, but it's possible to use nearly all of its features with just wifi. When I first got the phone prior to the Cupcake firmware update, I had to borrow a friend's SIM that had been provisioned for data to accomplish this, but it seems Cupcake has made that unnecessary. Since my SIM never has been used for a data plan, I don't have to worry about using my prepaid minutes for data transfer, but your results may vary. Here's how to activate the G1, and likely the MyTouch 3G as well, without a data plan:
2009-09-25
Tomcat6 fails to deploy a war file
Tomcat can get confused. Today I dealt with an issue where Tomcat just wouldn't deploy a war file on one of our webapp servers, so the app was unavailable. The first symptom of the problem was a Tomcat 404 page.
type Status report
message /mywar/default
description The requested resource (/mywar/default) is not available.
2009-09-24
RAID1 on Ubuntu: Array fails to assemble on boot
A few days after getting my RAID1 devices running smoothly, I rebooted to apply some package updates, and the boot process stopped due to an
e2fsck problem. Again.e2fsck 1.41.4 (27-Jan-2009)
e2fsck: Invalid argument while trying to open /dev/md0
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
RAID1 problems: access beyond end of device
After getting my RAID1 arrays running on my Ubuntu server, I moved the case back into the crawlspace under the stairs and powered it on. Later I started up an SSH but the connection was denied. Great; I had to lug the thing back into the office to connect a monitor and keyboard. The boot process stopped due to a failed
fsck with output similar to the following:
e2fsck 1.41.4 (27-Jan-2009)
The filesystem size (according to the superblock) is 244190000 blocks
The physical size of the device is 244189984 blocks
Either the superblock or the partition table is likely to be corrupt!
Subscribe to:
Posts (Atom)