Loading...
 

xPL4Java

Required External Libraries for Build

This is another completely undocumented aspect of xPL4Java. Figured this out with google searches and trial / error.
  • apache-log4j-1.2.15
  • commons-collections-3.2.1
  • commons-httpclient-3.1
  • jetty-4.2.27
  • velocity-tools-1.4
  • Sun comm - you will need to create a login to get this

Eclipse Configuration 2nd Try (windows from tgz files)

mkdir ~/xPL
cd ~/xPL
mkdir ExtJars
cd ExtJars

  • copy each external Jar reference to this directory
cp {somewhere}/comm.jar .
cp {somewhere}/commons-collections-3.2.1.jar .
cp {somewhere}/commons-httpclient-3.1.jar .
cp {somewhere}/javax.servlet.jar .
cp {somewhere}/log4j-1.2.15.jar .
cp {somewhere}/org.mortbay.jetty.jar .
cp {somewhere}/velocity-1.5.jar .
cd ~/xPL
wget http://www.xpl4java.org/xPL4Java/downloads/xPL4Java-devel.tgz
tar xzf xPL4Java-devel.tgz
wget http://www.xpl4java.org/xPL4Java/downloads/xPL4Java.tgz
tar xzf xPL4Java.tgz

Start Eclipse
workspace C:\Files\xPL
File / New / Project / Java / Project
Create project from existing source: C:\Files\xPL\xPL4Java
Next
Libraries / Add External Jars
Remove all the xPL jars (we will build new ones from source)
Add each jar in the external jars folder (can multi-select in open window)
Add the xPL4Java.jar from the xPL4Java folder
Finish
In the Package Explorer open: xPL4Java/src/org.cdp1802.xpl.server/xPL_Server.java
Click run icon

This works so the bottom line is that svn should be seeded with the xPL4Java.tgz and xPL4Java-devel.tgz. The xPL4Java/jars/{xPL*.jar|WebServer.jar} files should not be placed in svn.

Eclipse Configuration 3rd Try (windows from my own svn repository)

mkdir ~/xPL
cd ~/xPL
mkdir ExtJars
cd ExtJars

  • copy each external Jar reference to this directory
cp {somewhere}/comm.jar .
cp {somewhere}/commons-collections-3.2.1.jar .
cp {somewhere}/commons-httpclient-3.1.jar .
cp {somewhere}/javax.servlet.jar .
cp {somewhere}/log4j-1.2.15.jar .
cp {somewhere}/org.mortbay.jetty.jar .
cp {somewhere}/velocity-1.5.jar .
cd ~/xPL

Start Eclipse
workspace C:\Files\xPL
File / New / Project / svn / Project from svn
General / URL: http://deb/xPL4Java
General / Authentication / User: user_name
General / Authentication / Password: password
Next
Browse : select trunk
Finish
Finish
Java / Java Project
Next
Project Name: xPL4Java
Finish

Project / Properties / Java Build Path
Libraries / Add External Jars
Add each jar in the external jars folder (can multi-select in open window)
Add the jars in the xPL4Java/jars folder
Add the xPL4Java.jar from the xPL4Java folder
OK
In the Package Explorer open: xPL4Java/src/org.cdp1802.xpl.server/xPL_Server.java
Click run icon

Build Documentation

Files that export main()

schd/gateway/xPLScheduler.java
server/xPL_Server.java
twitter/xPLTwitter.java
websrv/WebModule.java
xPLHAL/client/XHCPTester.java
xPLHAL/HALServerModule.java
xplio/xPLio.java

Jar Files Provided in Binary Distribution

These need to be deployed in separate jar files. Some are standalone apps while most are modules that can be loaded by the xPL4Java server. Unfortunately the source distribution does not include the ant files needed to build the various jar files. I reverse engineered the binary distribution to determine which file paths are needed for each jar file. Some of the jar files also need a unique META-INF/xPL_Modules.cfg file. Those files were not included in the source distribution either; I had to copy them one at a time from the binary distribution. Lastly some of the jar files specify a Main-Class and Class-Path in their manifest files; also reverse engineered that from the binary distribution. What a pain in the ass for an "open source" project. I put all the ant and xPL_Modules.cfg files into my private subversion repository, but that will still require a "lot" of work each time there is a new release assuming some of the reverse engineered data changes.
*items that export main()
WebServer.jar*
    org/cdp1802/xpl/websrv
    META-INF/xPL_Modules.cfg
xPL4HVision.jar
     org/cdp1802/hvision
     META-INF/xPL_Modules.cfg
xPL4Java.jar
     org/cdp1802/xpl/device
     org/cdp1802/xpl/ethernet
     org/cdp1802/xpl/plugins
     org/cdp1802/xpl/serial
     org/cdp1802/xpl/server
     org/cdp1802/xpl/tracker
     org/cdp1802/xpl/*.class
     META-INF/xPL_Modules.cfg
     Main-Class: org.cdp1802.xpl.server.xPL_Server
xPL4TStat.jar
     org/cdp1802/tstat
     META-INF/xPL_Modules.cfg
xPLHAL.jar*
     org/cdp1802/xpl/xPLHAL
     META-INF/xPL_Modules.cfg
xPLio.jar*
     org/cdp1802/xpl/xplio
     META-INF/xPL_Modules.cfg
xPLLighting.jar
     examples/
     org/cdp1802/xpl/lighting
     META-INF/xPL_Modules.cfg
xPLScheduler.jar*
     org/cdp1802/xpl/schd
     META-INF/xPL_Modules.cfg
xPLScript.jar
     org/cdp1802/xpl/script
     META-INF/xPL_Modules.cfg
     Main-Class: org.cdp1802.xpl.script.XPLScriptEngine
     Class-Path: lib/bsh-2.0b4.jar lib/xPL4HVision.jar 
                 lib/xPL4TStat.jar lib/xPL4Java.jar 
                 lib/xPLLighting.jar
xPLTwitter.jar*
     org/cdp1802/xpl/twitter
     META-INF/xPL_Modules.cfg
     Main-Class: org.cdp1802.xpl.twitter.xPLTwitter
     Class-Path: lib/jtwitter.jar lib/log4j-1.2.14.jar lib/xPL4Java.jar

I'm developing on Windows and not the most talented Java programmer. I'm not exactly sure how the class path works. The class paths in the manifest files don't exist in the source distribution. I could not get xPL4Java to use a command line specified class path -cp for some reason; I think the custom class loader does not implement all the required class path loading functions. I decided to create my own class paths in the manifest files; that worked. I also separated out all the external Java modules from the xPL4Java.jar file into a separate xPL4JavaLib.jar file. I placed all the external references for all the modules into a subdirectory ./lib and then included those jar files in the manifest class path. The xPL modules are in the ./jars directory. Below are the class paths that I created in my manifest files. These are coded into the ant build file for xPL4Java. It is possible that the author intended to use different external libraries since I reverse engineered these by guessing and searching google:
xPL4Java manifest Class-Path
lib/comm.jar
lib/commons-collections-3.2.1.jar
lib/commons-httpclient-3.1.jar
lib/javax.servlet.jar
lib/org.mortbay.jetty.jar
lib/velocity-1.5.jar
lib/xPL4JavaLib.jar

Debugging / Development

Use ngrep
ngrep -d 4 -W byline port 3865

Contributors to this page: michael .
Page last modified on Saturday 10 of April, 2010 16:11:26 CDT by michael.