Categories
Computing Java Web Development

Setting up jEdit for remote development using SSH and sFTP

I am taking a class about XML and XSLTat the Harvard Extenion.
We are supposed to essentially remotely log into the system through SSH and use emacs or any other editor of our liking for the development of our projects and solutions.

I am totally down with emacs but the fact that it does not have XSlide or any other context-sensitive helper functionality enabled on the server is disappointing. So I tried NetBeans, Eclipse and finally jEdit as alternatives with the following requirements:

1. Must be able to save and read file remotely using sFTP (FTP is not enabled on the server).
2. Must be useful with XML.
3. If possible, also allow to log in to the system using an internal SSH client.
4. Anything I use must be free and legal.

NetBeans is supposedly very good with XSLT. I did not get that far because it does not have internal sFTP or SSH.

Eclipse has a really cool sFTP plugin that allows you to synchronize to a remote folder using the ‘Team’ functionality. But its XSLT support is way limited and the free version of XML Buddy does not support it. It also can only SSH when it involves CVS. I could not find anything to decouple the two… probably need to write one myself.

jEdit, my favorite left-field option and definitely not as chi-chi as the other two, had all three.
It has so-so XSLT support.
It has internal sFTP support that virtually mounts the remote file system into jEdit’s own file manager. Very cool.
Finally, it has an available (surprisingly not through its plugin manager) SSH client that you need to download and install into the $home/.jedit/jars folder. If you do follow this advice, note that when you connect, the window that should pop up to request your user name and password does not really pop up but pops under so just notice any new windows appearing.

jEdit wins.

Share
Categories
Java

The Lucene Lock

After putting together my application with Lucene I was sad to stubmle across the following error that occurred whenever I attempted to get a Lucene indexing going:

Lock obtain timed out: Lock@C:\WINDOWS\TEMP\lucene

Lucene puts a file lock on its index or tries to obtain it prior to making any operation as means of mutual exclusion.

The Lucene documentation also mentions that the place where Lucene uses as temporary directory is the system temporary directory or Tomcat’s temp directory
and as means to modify that temporary directory, one can change System properties.

So I went ahead and set a new timeout value and tried to also change the lock directory using:

Properties p = new Properties(System.getProperties());
p.setProperty("org.apache.lucene.lockDir", context.getInitParameter("LUCENE_INDEX_DIR")); // where I wanted the lock to go
p.setProperty("org.apache.lucene.writeLockTimeout", "60000");
p.setProperty("org.apache.lucene.commitLockTimeout", "60000");

The timouts took effect, but the lock, well, it still went where it was (and contrary to the aforementioned resource’s advice) – the system tempdirectory – C:/Windows/Temp in my case.

I finally arrived at this message board posting that pretty much suggested finding a lock file and deleting it. It worked.

Conclusion: if you get the aforementioned error – Lock obtain timed out: – go to the directory mentioned in the exception, and delete the file there called lucene...

Hope this helped.

Share
Categories
Java

NoClassDefFound Error in Tomcat

This is like missing a dot somewhere or a semicolon that screwes everything up.
Tomcat DOES NOT HOT DEPLOY JAR files when they are placed in its common/lib directory.
YOU NEED TO RESTART TOMCAT.

Thank you.

Share
Share