Dead Ink Vinyl

Musings of David L Kinney

Posts Tagged ‘nslu2

More about Jetty with JamVM on NSLU2

Robert Lougher, maintainer of the JamVM virtual machine, posted a comment to an earlier entry of mine. Rob requested more information about the problem I experienced, so I poked around a little more and responded to him. I am posting the heart of that information here for the benefits of others.

The relevant details are:
– Jetty v5.1.2
– JamVM v1.2.4
– GNU Classpath 0.13

Running the command “java -jar start.jar” produces:

java.lang.NullPointerException
  at java.text.DecimalFormatSymbols.setCurrency (DecimalFormatSymbols.java:397)
  at java.text.DecimalFormatSymbols. (DecimalFormatSymbols.java:151)
  at java.text.NumberFormat.computeInstance (NumberFormat.java:327)
  at java.text.NumberFormat.getNumberInstance (NumberFormat.java:456)
  at java.text.NumberFormat.getInstance (NumberFormat.java:381)
  at java.text.SimpleDateFormat. (SimpleDateFormat.java:218)
  at java.text.SimpleDateFormat. (SimpleDateFormat.java:202)
  at org.mortbay.util.DateCache.setTimeZone (DateCache.java:126)
  at org.mortbay.util.DateCache. (DateCache.java:87)
  at org.mortbay.log.OutputStreamLogSink. (OutputStreamLogSink.java:59)
  at java.lang.reflect.Constructor.constructNative (Native Method)
  at java.lang.reflect.Constructor.newInstance (Constructor.java:265)
  at java.lang.Class.newInstance (Class.java:1146)
  at org.mortbay.log.LogImpl.defaultInit (LogImpl.java:190)
  at org.mortbay.log.LogImpl.message (LogImpl.java:415)
  at org.mortbay.log.LogImpl.message (LogImpl.java:399)
  at org.mortbay.log.LogImpl.info (LogImpl.java:332)
  at org.mortbay.util.FileResource. (FileResource.java:60)
  at org.mortbay.util.Resource.newResource (Resource.java:113)
  at org.mortbay.jetty.Server. (Server.java:78)
  at org.mortbay.jetty.Server.main (Server.java:432)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:355)
  at org.mortbay.start.Main.invokeMain (Main.java:151)
  at org.mortbay.start.Main.start (Main.java:480)
  at org.mortbay.start.Main.main (Main.java:94)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:355)
  at jamvm.java.lang.JarLauncher.main (JarLauncher.java:50)
1113542079746: INFO :Checking Resource aliases @ [main] org.mortbay.util.FileResource.(FileResource.java:60)
java.lang.reflect.InvocationTargetException
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:355)
  at org.mortbay.start.Main.invokeMain (Main.java:151)
  at org.mortbay.start.Main.start (Main.java:480)
  at org.mortbay.start.Main.main (Main.java:94)
  at java.lang.reflect.Method.invokeNative (Native Method)
  at java.lang.reflect.Method.invoke (Method.java:355)
  at jamvm.java.lang.JarLauncher.main (JarLauncher.java:50)
Caused by: java.lang.ExceptionInInitializerError
  at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl. (Unknown Source)
  at java.lang.reflect.Constructor.constructNative (Native Method)
  at java.lang.reflect.Constructor.newInstance (Constructor.java:265)
  at java.lang.Class.newInstance (Class.java:1146)
  at org.apache.xerces.util.ObjectFactory.newInstance (Unknown Source)
  at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance (Unknown Source)
  at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance (Unknown Source)
  at org.apache.xerces.impl.xs.SchemaGrammar$BuiltinSchemaGrammar. (Unknown Source)
  at org.apache.xerces.impl.xs.SchemaGrammar. (Unknown Source)
  at org.apache.xerces.impl.xs.XMLSchemaValidator. (Unknown Source)
  at org.apache.xerces.parsers.IntegratedParserConfiguration.configurePipeline (Unknown Source)
  at org.apache.xerces.parsers.DTDConfiguration.reset (Unknown Source)
  at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
  at org.apache.xerces.parsers.DTDConfiguration.parse (Unknown Source)
  at org.apache.xerces.parsers.XMLParser.parse (Unknown Source)
  at org.apache.xerces.parsers.AbstractSAXParser.parse (Unknown Source)
  at javax.xml.parsers.SAXParser.parse (SAXParser.java:273)
  at org.mortbay.xml.XmlParser.parse (XmlParser.java:165)
  at org.mortbay.xml.XmlParser.parse (XmlParser.java:181)
  at org.mortbay.xml.XmlConfiguration. (XmlConfiguration.java:122)
  at org.mortbay.jetty.Server. (Server.java:103)
  at org.mortbay.jetty.Server. (Server.java:78)
  at org.mortbay.jetty.Server.main (Server.java:432)
  at java.lang.reflect.Method.invokeNative (Native Method)
…7 more
Caused by: java.lang.RuntimeException: internal error
  at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1 (Unknown Source)
  at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes (Unknown Source)
  at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl. (Unknown Source)
  at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl. (Unknown Source)
…30 more

However, launching the application “manually” using the following command got me further (the server listens on 8080 and provides a listing of the known webapps):

java -cp /opt/jetty-5.1.2/lib/org.mortbay.jetty.jar:/opt/jetty-5.1.2/lib/javax.servlet.jar:/opt/jetty-5.1.2/ext/jasper-runtime.jar:/opt/jetty-5.1.2/ext/jasper-compiler.jar:/opt/jetty-5.1.2/ext/xercesImpl.jar:/opt/jetty-5.1.2/ext/commons-logging.jar org.mortbay.jetty.Server

So the problem might be Jetty’s, not JamVM’s.

Written by dlkinney

April 16, 2005 at 11:55 am

NSLU2 has been unslung

I’ve purchased a new NSLU2 and installed Unslung 3.x. A couple of notes:

  1. The instuctions are excellent. Follow them exactly and the operation is a cake walk.
  2. Unslinging an NSLU2 (“slug”) requires a real hard drive — a flash drive does not work. Or, it does not work with the amount of tinkering I was willing to perform.
  3. Install OpenSSH as described before the final reboot, while you are still logged in to telnet. Otherwise you have to unplug the drives reboot (again) to regain telnet access.
  4. Mac OSX does not have arping installed by default (and it’s not a package on fink), so accessing RedBoot is a really frustrating matter of exact timing. (It does appear to be available through OpenDarwin’s Darwin Ports project.)

Installing a Java JVM was simple too, thanks to these instructions, but JamVM does not run Jetty out of the box, so I’ll investigate running Tomcat and Resin next. If necesary, I will then compile Kaffe on the slug and try all of the containers again.

Written by dlkinney

March 26, 2005 at 11:30 pm

NSLU2 as Linux Servlet Server

With my new, static IP addresses, I’ve started kicking around the possibility of running a public server. I don’t know for what exactly I’d run the server. Possibilties include running Subversion, an OpenLaszlo project gallery, an Echo2 project gallery, or a Confluence knowledgebase for the Echo community. Since I don’t need to run a server — I just want a server — I don’t want to spend a lot of money. In fact, I want to spend as little money as possible.

I donated all of my old computer equipment to a local school system last year, so a new server means new kit. Thinking of a Linux server, I looked up Dell‘s offerings, since I get an employee discount with them. It would be $420 + shipping for the lowest-end box they offer. That’s close enough to the price of a Mac mini (with my employee discount) that I seriously contemplated that angle. Still, the $400+ price range is more than I want to invest in this project at this time.

Then I recalled that the Linksys NSLU2 can be hacked to upgrade its Linux kernel and services. I want to keep my current NSLU2 as a file server for my home network, so I would need a new NSLU2 ($80) and a small, external USB2 hard drive ($80). That’s more in line with my price range. Looking over the NSLU2-Linux sites, it certainly runs Web servers serving static content just fine. But does it run Java?

The NSLU2 runs on an Intel IXP425 Xscale CPU. I was unaware of any Java runtimes for the processor until I came across Kaffe. This is not the first time I’ve heard of Kaffe, but it is the first time I’ve seriously considered it. This thread indicates that the newest versions (1.1.4) should build on NSLU2-Linux. Kaffe’s compatability reports indicate that it should be suitable for server-side applications. Intrigued, I dug further and found some hope that Tomcat will run on Kaffe with minimal tweaking.

So I’ll sleep on it a while and revisit the idea of setting up a Servlet server on an NSLU2 “soon”.

Written by dlkinney

March 21, 2005 at 12:00 am