rebuildjar.sh: package javax.servlet missing

22 views
Skip to first unread message

jutsi

unread,
Feb 17, 2010, 8:28:02 AM2/17/10
to EtherPad Open Source Discussion
I've tried to folllow instructions given at http://code.google.com/p/etherpad/wiki/Instructions
and in discussions here but I'm still stuck.

I've noticed that the CP from Windows/Cygwin isn't used, i tried drop
a copy of tomcat's servlet-api.jar into infrastructure/lib but with no
help.

Os: Microsoft Windows XP Professional x64 Edition Version 2003 Service
Pack 2
Cygwin: 1.7.1-1
Java:java version "1.6.0_18" Java(TM) SE Runtime Environment (build
1.6.0_18-b07) Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13,
mixed mode)
Application Server: Apache Tomcat 6.0.24 Server
Database: MySQL 5.1.43-winx64

jutsi

unread,
Feb 17, 2010, 9:04:10 AM2/17/10
to EtherPad Open Source Discussion
$ ./bin/rebuildjar.sh
which: no fastjar in (/usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/
system32:...)
using JAR jar...
unzipping JARs...
making cached JAR....
compiling...
compiling with 'fsc'...
compiling common...
net.appjet.common\util\HttpServletRequestFactory.java:19: package
javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
net.appjet.common\util\HttpServletRequestFactory.java:20: package
javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
net.appjet.common\util\HttpServletRequestFactory.java:45: cannot find
symbol
symbol : class HttpServletRequest
location: class net.appjet.common.util.HttpServletRequestFactory
public static HttpServletRequest createRequest(String uri,
Map<String, String> headers,
^
net.appjet.common\util\HttpServletRequestFactory.java:51: cannot find
symbol
symbol : class HttpServletRequest
location: class net.appjet.common.util.HttpServletRequestFactory
public static HttpServletRequest createRequest(HttpServletRequest
req)
^
net.appjet.common\util\HttpServletRequestFactory.java:51: cannot find
symbol
symbol : class HttpServletRequest
location: class net.appjet.common.util.HttpServletRequestFactory
public static HttpServletRequest createRequest(HttpServletRequest
req)
^
net.appjet.common\util\HttpServletRequestFactory.java:65: cannot find
symbol
symbol : class HttpServletResponse
location: class net.appjet.common.util.HttpServletRequestFactory
public static HttpServletResponse createResponse() {
^
net.appjet.common\util\HttpServletRequestFactory.java:36: cannot find
symbol
symbol : class HttpServletRequest
location: class
net.appjet.common.util.HttpServletRequestFactory.RequestResponse
public final HttpServletRequest request;
^
net.appjet.common\util\HttpServletRequestFactory.java:37: cannot find
symbol
symbol : class HttpServletResponse
location: class
net.appjet.common.util.HttpServletRequestFactory.RequestResponse
public final HttpServletResponse response;
^
net.appjet.common\util\HttpServletRequestFactory.java:39: cannot find
symbol
symbol : class HttpServletRequest
location: class
net.appjet.common.util.HttpServletRequestFactory.RequestResponse
private RequestResponse(HttpServletRequest req,
HttpServletResponse res) {
^
net.appjet.common\util\HttpServletRequestFactory.java:39: cannot find
symbol
symbol : class HttpServletResponse
location: class
net.appjet.common.util.HttpServletRequestFactory.RequestResponse
private RequestResponse(HttpServletRequest req,
HttpServletResponse res) {
^
net.appjet.common\util\HttpServletRequestFactory.java:80: cannot find
symbol
symbol : class HttpServletRequest
location: class net.appjet.common.util.HttpServletRequestFactory
private static class InnerHttpServletRequest implements
HttpServletRequest {
^
net.appjet.common\util\HttpServletRequestFactory.java:148: package
javax.servlet.http does not exist
public javax.servlet.http.Cookie[] getCookies() { return new
javax.servlet.http.Cookie[0]; }
^
net.appjet.common\util\HttpServletRequestFactory.java:174: package
javax.servlet.http does not exist
public javax.servlet.http.HttpSession getSession(boolean
create) { return null; }
^
net.appjet.common\util\HttpServletRequestFactory.java:175: package
javax.servlet.http does not exist
public javax.servlet.http.HttpSession getSession() { return
null; }
^
net.appjet.common\util\HttpServletRequestFactory.java:194: package
javax.servlet does not exist
public javax.servlet.ServletInputStream getInputStream()
throws java.io.IOException{
^
net.appjet.common\util\HttpServletRequestFactory.java:232: package
javax.servlet does not exist
public javax.servlet.RequestDispatcher
getRequestDispatcher(String path) { return null; }
^
net.appjet.common\util\HttpServletRequestFactory.java:240: cannot find
symbol
symbol : class HttpServletResponse
location: class net.appjet.common.util.HttpServletRequestFactory
private static class InnerHttpServletResponse implements
HttpServletResponse, ServletAccessor {
^
net.appjet.common\util\HttpServletRequestFactory.java:259: package
javax.servlet.http does not exist
public void addCookie(javax.servlet.http.Cookie cookie) { }
^
net.appjet.common\util\HttpServletRequestFactory.java:282: package
javax.servlet does not exist
private final javax.servlet.ServletOutputStream sostream =
^
net.appjet.common\util\HttpServletRequestFactory.java:295: package
javax.servlet does not exist
public javax.servlet.ServletOutputStream getOutputStream()
{ return sostream; }
^
net.appjet.common\util\HttpServletRequestFactory.java:148: package
javax.servlet.http does not exist
public javax.servlet.http.Cookie[] getCookies() { return new
javax.servlet.http.Cookie[0]; }

^
net.appjet.common\util\HttpServletRequestFactory.java:195: package
javax.servlet does not exist
return new javax.servlet.ServletInputStream() {
^
net.appjet.common\util\HttpServletRequestFactory.java:283: package
javax.servlet does not exist
new javax.servlet.ServletOutputStream() {
^
23 errors
which: no growlnotify in (/usr/local/bin:/usr/bin:/bin:/cygdrive/c/
WINDOWS/system32:...)

jutsi

unread,
Feb 17, 2010, 11:31:55 AM2/17/10
to EtherPad Open Source Discussion
Found some info suggesting use of dos-like paths instead of /cygdrive
equivalent for java under cygwin.
I altered two lines in the classpath.sh:

for f in `readlink -f "lib/*.jar"`; do
CP="${CP}:"`cygpath -wp "${f}"`

The output of classpath.sh looks ok but rebuildjar.sh still fails on
same errors as above.

John McLear

unread,
Feb 17, 2010, 12:24:44 PM2/17/10
to etherpad-open-...@googlegroups.com
I'm guessing
#which fastjar

returns nothing?

not faimilar w/ the cygwin install, can join you on a remote session if you want real time help, I'm on skype as johny_mac or irc on #etherpad freenode

jutsi

unread,
Feb 18, 2010, 3:00:08 AM2/18/10
to EtherPad Open Source Discussion
True, there is no fastjar on (my) cygwin but 'jar' should do right?
I'll be on the channel today with same nick as here.

jutsi

unread,
Feb 18, 2010, 5:56:43 AM2/18/10
to EtherPad Open Source Discussion
One step forward: I had overlooked the syntax with path separation:
use '\;' to in classpath and nothing else.
So the two lines in classpath.sh shold look like this:

for f in `readlink -f "lib/*.jar"`; do
CP="${CP}\;"`cygpath -wp "${f}"`

Construction of the CP variable in comp.sh looks like this:
CP=`bin/classpath.sh`
_tmp=`readlink -f build`
CP="${CP}\;"`cygpath -wp "${_tmp}"`

The obfuscation caused some errors so I commented it:
# if [ $OBFUSC ] ; then
# echo obfuscating...
# scala -classpath $CP:. net.appjet.bodylock.compressor \
# build/net/appjet/ajstdlib/streaming-client.js
# fi

Now I'm struggling with the end of makejar.sh:
$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala
dojox
Above line throws an error in:
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native
Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at
sun.tools.jar.Main.createTempFileInSameDirectoryAs(Main.java:119)
at sun.tools.jar.Main.run(Main.java:191)
at sun.tools.jar.Main.main(Main.java:1149)
The content of my infrastructure/build/ is:
net/... (looks ok)
com/... (looks ok)
t (zero sized file?)
What should I expect to find under infrastructure/build/?

jutsi

unread,
Feb 18, 2010, 9:09:19 AM2/18/10
to EtherPad Open Source Discussion
Managed to build etherpad by taking on more java vs cygpath battles in
the end of makejar.sh:
_tmp=`readlink -f "/tmp/appjet.jar"`
$JAR uf `cygpath -wp "${_tmp}"` * #META-INF com javax org net uk v
scala dojox

... and in rebuildjar.sh:
JAR=jar
function genjar {
echo "unzipping JARs..."
pushd $1 >> /dev/null

for a in `readlink -f "../../../etherpad/lib/*.jar"`; do
$JAR xf `cygpath -wp "${a}"`
rm -rf META-INF/
{MANIFEST.MF,NOTICE{,.txt},LICENSE{,.txt},INDEX.LIST,SUN_MICR.
{RSA,SF},maven}
done

popd >> /dev/null
}

... and:
_tmp=`readlink -f "../../build/appjet.jar"`
$JAR uf `cygpath -wp "${_tmp}"` `ls . | grep -v "^t$"`

John McLear

unread,
Feb 18, 2010, 9:11:14 AM2/18/10
to etherpad-open-...@googlegroups.com
Can you publish a post or drop a guide for future reference please?

jutsi

unread,
Feb 18, 2010, 9:25:49 AM2/18/10
to EtherPad Open Source Discussion
Small changes in the run-local.sh:
_tmp=`readlink -f "appjet-eth-dev.jar"`
CP=`cygpath -wp "${_tmp}"`
_tmp=`readlink -f "data"`

CP="${CP}\;"`cygpath -wp "${_tmp}"`
for f in `readlink -f "lib/*.jar"`; do
CP="$CP\;"`cygpath -wp "${f}"`
done

JAVA=java

John McLear

unread,
Feb 18, 2010, 9:27:23 AM2/18/10
to etherpad-open-...@googlegroups.com
And to compile? What changes were needed, thanks, will wrap this up into a document and publish today

jutsi

unread,
Feb 18, 2010, 9:35:40 AM2/18/10
to EtherPad Open Source Discussion
My guide is to install/configure what is suggested by you guys and add
Cygwin to the list.
Grab my set of scripts files and run.

Well, if you don't mind hosting the files?

jutsi

unread,
Feb 18, 2010, 9:53:54 AM2/18/10
to EtherPad Open Source Discussion
jui@ws-wrk01 ~/dev/java/etherpad/trunk
$ hg diff
diff -r 302458c3fffc trunk/etherpad/bin/rebuildjar.sh
--- a/trunk/etherpad/bin/rebuildjar.sh Fri Dec 25 22:53:09 2009 -0500
+++ b/trunk/etherpad/bin/rebuildjar.sh Thu Feb 18 15:47:51 2010 +0100
@@ -14,13 +14,13 @@
# See the License for the specific language governing permissions
and
# limitations under the License.

-if [ -z "$JAR" ]; then
- if [ ! -z `which fastjar` ]; then
- JAR=fastjar
- else
- JAR=jar
- fi
-fi
+# if [ -z "$JAR" ]; then
+ # if [ ! -z `which fastjar` ]; then
+ # JAR=fastjar
+ # else
+ # JAR=jar
+ # fi
+# fi

function notify {
if [ ! -z `which growlnotify` ]; then
@@ -46,13 +46,16 @@

echo "including etherpad JARs..."

-JARFILES="echo ../etherpad/lib/*.jar"
+cd ../etherpad
+JARFILES=`../infrastructure/bin/classpath.sh`
+cd ../infrastructure
+JAR=jar


function genjar {
echo "unzipping JARs..."
pushd $1 >> /dev/null

- for a in ../../../etherpad/lib/*.jar; do
- $JAR xf $a
+ for a in `readlink -f "../../../etherpad/lib/*.jar"`; do
+ $JAR xf `cygpath -wp "${a}"`


rm -rf META-INF/
{MANIFEST.MF,NOTICE{,.txt},LICENSE{,.txt},INDEX.LIST,SUN_MICR.
{RSA,SF},maven}
done

@@ -63,13 +66,14 @@
echo "updating..."

pushd buildcache/JAR-etherpad >> /dev/null
-$JAR uf ../../build/appjet.jar `ls . | grep -v "^t$"`
+_tmp=`readlink -f "../../build/appjet.jar"`
+$JAR uf `cygpath -wp "${_tmp}"` `ls . | grep -v "^t$"`

echo "done."

popd >> /dev/null

dst="$OWD/appjet-eth$suffix.jar"
-cp -f build/appjet.jar $dst
-cd $OWD
-echo "wrote $dst"
+cp -f build/appjet.jar `readlink -f "${dst}"`
+cd `readlink -f "${OWD}"`
+echo "wrote "`readlink -f "${dst}"`
diff -r 302458c3fffc trunk/etherpad/bin/run-local.sh
--- a/trunk/etherpad/bin/run-local.sh Fri Dec 25 22:53:09 2009 -0500
+++ b/trunk/etherpad/bin/run-local.sh Thu Feb 18 15:47:51 2010 +0100
@@ -24,14 +24,18 @@
fi
fi

-CP="appjet-eth-dev.jar:data"
-for f in lib/*.jar; do
- CP="$CP:$f"
+_tmp=`readlink -f "appjet-eth-dev.jar"`
+CP=`cygpath -wp "${_tmp}"`
+_tmp=`readlink -f "data"`
+CP="${CP}\;"`cygpath -wp "${_tmp}"`
+for f in `readlink -f "lib/*.jar"`; do
+ CP="$CP\;"`cygpath -wp "${f}"`
done

if [ -z "$JAVA" ]; then
JAVA=java
fi
+JAVA=java

# etherpad properties file
cfg_file=./data/etherpad.local.properties
diff -r 302458c3fffc trunk/infrastructure/bin/classpath.sh
--- a/trunk/infrastructure/bin/classpath.sh Fri Dec 25 22:53:09
2009 -0500
+++ b/trunk/infrastructure/bin/classpath.sh Thu Feb 18 15:47:51
2010 +0100
@@ -15,7 +15,7 @@
# limitations under the License.

CP="./"
-for f in `ls lib/*.jar`; do
- CP="${CP}:${f}"
+for f in `readlink -f "lib/*.jar"`; do
+ CP="${CP}\;"`cygpath -wp "${f}"`
done
echo $CP
diff -r 302458c3fffc trunk/infrastructure/bin/comp.sh
--- a/trunk/infrastructure/bin/comp.sh Fri Dec 25 22:53:09 2009 -0500
+++ b/trunk/infrastructure/bin/comp.sh Thu Feb 18 15:47:51 2010 +0100
@@ -32,7 +32,8 @@
echo compiling with \'$CC\'...

CP=`bin/classpath.sh`
-CP="build/:${CP}"
+_tmp=`readlink -f build`
+CP="${CP}\;"`cygpath -wp "${_tmp}"`

if [ -z "$OBFUSC" ]; then
OBFUSC=0
@@ -63,6 +64,7 @@

COMMONFILES=`find net.appjet.common -name '*.java'`
COMMONSCALAFILES=`find net.appjet.common -name '*.scala'`
+
function gencommon {
echo "compiling common..."
javac \
@@ -80,6 +82,7 @@
cacheonfiles common "$COMMONFILES $COMMONSCALAFILES" gencommon

SARSFILES=`find net.appjet.common.sars -name '*.scala'`
+
function gensars {
echo "compiling sars..."
$CC \
@@ -92,6 +95,7 @@
cacheonfiles sars "$SARSFILES" gensars

CLIFILES=`find net.appjet.common.cli -name '*.scala'`
+
function gencli {
echo "compiling cli..."
$CC \
@@ -105,6 +109,7 @@
cacheonfiles cli "$CLIFILES" gencli

BODYLOCKFILES=`find net.appjet.bodylock -name '*.scala'`
+
function genbodylock {
echo "compiling rhino abstraction..."
$CC \
@@ -118,6 +123,7 @@

APPSERVERFILES=`find net.appjet.oui -name '*.scala'`
APPSERVERJAVAFILES=`find net.appjet.oui -name '*.java'`
+
function genappserver {
echo "compiling appserver source..."
javac \
@@ -136,6 +142,7 @@

AJSTDLIBFILES=`find net.appjet.ajstdlib -name '*.scala'`
AJSTDLIBJAVAFILES=`find net.appjet.ajstdlib -name '*.java'`
+
function genajstdlib {
echo "compiling ajstdlib..."
mkdir -p $1
@@ -156,6 +163,7 @@
cacheonfiles ajstdlib "$AJSTDLIBFILES $AJSTDLIBJAVAFILES" genajstdlib

EPFILES=`find com.etherpad -name '*.scala'`
+
function genetherpad {
echo "compilng etherpad..."
$CC \
@@ -168,6 +176,7 @@
cacheonfiles etherpad "$EPFILES" genetherpad

OOSERVICEFILES=`find com.etherpad.openofficeservice -name '*.scala'`
+
function genooservice {
echo "compiling ooservice..."
$CC \
@@ -181,19 +190,21 @@

echo "copying files..."
cp net.appjet.ajstdlib/streaming-client.js build/net/appjet/ajstdlib/
-if [ $OBFUSC ] ; then
- echo obfuscating...
- scala -classpath $CP:. net.appjet.bodylock.compressor \
- build/net/appjet/ajstdlib/streaming-client.js
-fi
+# if [ $OBFUSC ] ; then
+ # echo obfuscating...
+ # scala -classpath $CP:. net.appjet.bodylock.compressor \
+ # build/net/appjet/ajstdlib/streaming-client.js
+# fi

cp net.appjet.ajstdlib/streaming-iframe.html build/net/appjet/
ajstdlib/
mkdir -p build/net/appjet/ajstdlib/modules

+JSFILES=`find framework-src -name '*.js'`
+
echo "building javascript classfiles..."
scala -classpath $CP net.appjet.bodylock.Compiler \
-destination=build/net/appjet/ajstdlib/ \
-cutPrefix=framework-src \
- `find framework-src -name '*.js'`
+ $JSFILES

echo "done."
diff -r 302458c3fffc trunk/infrastructure/bin/makejar.sh
--- a/trunk/infrastructure/bin/makejar.sh Fri Dec 25 22:53:09
2009 -0500
+++ b/trunk/infrastructure/bin/makejar.sh Thu Feb 18 15:47:51
2010 +0100
@@ -32,12 +32,16 @@

TMPSTORE=/tmp/ajbuild-tmpstore-`date +%s`

-JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/
manifest`
+#JARFILES=`echo $SCALA_HOME/lib/scala-library.jar lib/*.jar lib/
manifest`
+JARFILES=`bin/jarpath.sh`
+


function genjar {
echo "unzipping JARs..."
pushd $1 >> /dev/null

- $JAR xf $SCALA_HOME/lib/scala-library.jar
+ #$JAR xf $SCALA_HOME/lib/scala-library.jar
+ $JAR xf $SCALA_HOME\lib\scala-library.jar
rm -rf META-INF
+ echo :::${PWD}:::
for a in ../../lib/*.jar; do
$JAR xf $a


rm -rf META-INF/
{MANIFEST.MF,NOTICE{,.txt},LICENSE{,.txt},INDEX.LIST,SUN_MICR.
{RSA,SF},maven}

@@ -63,7 +67,8 @@

echo "making JAR..."
mv appjet.jar /tmp/appjet.jar
-$JAR -uf /tmp/appjet.jar . #META-INF com javax org net uk v scala
dojox
+_tmp=`readlink -f "/tmp/appjet.jar"`
+$JAR uf `cygpath -wp "${_tmp}"` * #META-INF com javax org net uk v
scala dojox
mv /tmp/appjet.jar ./

echo "cleaning up..."

John McLear

unread,
Feb 18, 2010, 9:55:42 AM2/18/10
to etherpad-open-...@googlegroups.com
sure

add me to your skype - johny_mac else email me john at mclear.co.uk

jutsi

unread,
Feb 18, 2010, 10:00:03 AM2/18/10
to EtherPad Open Source Discussion
jui@ws-wrk01 ~/dev/java/etherpad/trunk
$ hg status | grep bin
M trunk\etherpad\bin\rebuildjar.sh
M trunk\etherpad\bin\run-local.sh
M trunk\infrastructure\bin\classpath.sh
M trunk\infrastructure\bin\comp.sh
M trunk\infrastructure\bin\makejar.sh
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\chart\plot
\CombinedDomainCategoryPlot.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\chart\plot
\CombinedDomainXYPlot.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\chart\plot
\CombinedRangeCategoryPlot.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\chart\plot
\CombinedRangeXYPlot.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\data\general
\CombinationDataset.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\data\general
\CombinedDataset$DatasetInfo.class
? trunk\infrastructure\buildcache\JAR-etherpad\org\jfree\data\general
\CombinedDataset.class
? trunk\infrastructure\lib\mysql-connector-java-5.1.11-bin.jar

jutsi

unread,
Feb 23, 2010, 4:47:01 PM2/23/10
to EtherPad Open Source Discussion
Gyokuro: scala-2.7.7.final is the version I'm using

Sateesh

unread,
Apr 8, 2010, 12:59:21 PM4/8/10
to EtherPad Open Source Discussion
Hi I have tried installing Etherpad on windows.
I have used the patch from here too. http://primaryschoolict.com/epad_cygwin.rar
Now here is the output when I try to run rebuildjar.sh

$ bin/rebuildjar.sh
using cached JAR...


compiling...
compiling with 'fsc'...
compiling common...

javac: invalid flag: Settings\skodaval\Desktop\Etherpad\etherpad\trunk
\infrastructure\build
Usage: javac <options> <source files>
use -help for a list of possible options

The only thing I changed after applying patch is to replace

cp ${MYSQL_CONNECTOR_JAR} lib/
cp ${MSSQL_CONNECTOR_JAR} lib/
with:
cp `cygpath -u "${MYSQL_CONNECTOR_JAR}"` lib/
#cp `cygpath -u "${MYSQL_CONNECTOR_JAR}"` lib/

in infrastructure/bin/makejar.sh to avoid the cp error

Why is simple javac failing..Can somebody please help me with this?

Thanks
Sateesh

Reply all
Reply to author
Forward
0 new messages