I have not tested running the unix xmlsh startup script under cygwin.
Try using the win32 (xmlsh.bat) startup script instead and using DOS style 
paths for XMLSH

I will work on supporting cygwin directly in the next release.
( it would be just a different startup script, but cygwin is a bit persnickety 
about paths)

I just reproduced the problem, and its cygwin insists on using these /cygdrive/ 
  directories.
Java, on the otherhand, knows nothing about /cygdrive/

Also java running on windows (whether under cygwin or not) wants to use the ";" 
not the ":" seperator for classpaths.
thus the unix startup script wont work.

You could try editing the xmlsh script to use ";" instead of ":" for the 
separator, and not including /cygwin/ in XMLSH and some funky stuff with quotes 
due to ; being a separator in cygwin scripts

I just got this to work for me, I will include it in the next release.
Send me private email if you want this as an attachment.
([email protected])


for me I set
export XMLSH=/work/DEI/xmlsh/trunk

------------------------ xmlsh startup script for cygwin --------------
CLASSPATH="$XMLSH/bin/xmlsh-1.1.jar"
CLASSPATH="$CLASSPATH;$XMLSH/lib/log4j-1.2.7.jar"
# Pick which saxon you want
CLASSPATH="$CLASSPATH;$XMLSH/lib/saxon9he.jar"
#CLASSPATH="$CLASSPATH;$XMLSH/lib/saxon9ee.jar"
#CLASSPATH="$CLASSPATH;$XMLSH/lib/saxon9pe.jar"
CLASSPATH="$CLASSPATH;$XMLSH/lib/xercesImpl.jar"
# Uncomment the next line if you DO NOT want to use jline input editing
CLASSPATH="$CLASSPATH;$XMLSH/lib/jline-0.9.94.jar"
CLASSPATH="$CLASSPATH;$XMLSH/lib/woodstox-core-asl-4.0.3.jar"
CLASSPATH="$CLASSPATH;$XMLSH/lib/stax2-api-3.0.1.jar"
CLASSPATH="$CLASSPATH;$XMLSH/lib/stax-utils.jar"
# jing only used for rngvalidate
CLASSPATH="$CLASSPATH;$XMLSH/lib/jing.jar"
# trang only used for rngconvert
CLASSPATH="$CLASSPATH;$XMLSH/lib/trang.jar"
# saxon only used for xslt1
CLASSPATH="$CLASSPATH;$XMLSH/lib/saxon.jar"
# tagsoup only used for tagsoup command
CLASSPATH="$CLASSPATH;$XMLSH/lib/tagsoup-1.2.jar"
# xom used only for xinclude
CLASSPATH="$CLASSPATH;$XMLSH/lib/xom-1.2.6.jar"
# Adjust VM args below to your taste
java -cp "$CLASSPATH" -Xmx1024m -Xms256m -XX:+UseConcMarkSweepGC 
org.xmlsh.sh.shell.Shell   "$@"
----------------------------------------





----------------------------------------
David A. Lee
Senior Principal Software Engineer
Epocrates, Inc.
[email protected]<mailto:[email protected]>
812-482-5224

From: [email protected] 
[mailto:[email protected]] On Behalf Of colin mcenearney
Sent: Wednesday, June 08, 2011 1:32 PM
To: [email protected]
Subject: [MarkLogic Dev General] xmlsh - Exception in thread "main" 
java.lang.NoClassDefFoundError

Thanks!

I should have mentioned this is with cygwin on an XP machine.

I am following the instructions for unix and using cygwin-style path:

export XMLSH=/cygdrive/c/xmlsh/xmlsh_1_1_5

Running xmlsh -x brings the same error as xmlsh.

If I echo $CLASSPATH it shows:

.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip



---Message: 2
Date: Wed, 8 Jun 2011 15:33:54 +0000
From: "Lee, David" <[email protected]<[email protected]>>
Subject: Re: [MarkLogic Dev General] xmlsh - Exception in thread
    "main"    java.lang.NoClassDefFoundError
To: General MarkLogic Developer Discussion
    
<[email protected]<[email protected]>>
Message-ID:
    
<31395bf86e0a454f832b8f8824ed6bda01d...@exmb-pp03.corp.epocrates.com<compose?to=31395bf86e0a454f832b8f8824ed6bda01d...@exmb-pp03.corp.epocrates.com>>
Content-Type: text/plain; charset="us-ascii"

This is because it cant find xmlsh-1.1.jar in your classpath.
Verify that the XMLSH directory is properly set as per:

http://www.xmlsh.org/Install

Also looks like this is on a linux or mac system.  You will need to change the 
xmlsh script from DOS to Unix CR/LF convention as per
http://www.xmlsh.org/Install




If that still doesnt work then add run the xmlsh  script with set -x and see 
what its using as the classpath.

----------------------------------------
David A. Lee
Senior Principal Software Engineer
Epocrates, Inc.
[email protected]<[email protected]><mailto:[email protected]<[email protected]>>
812-482-5224

From: 
[email protected]<[email protected]>
 
[mailto:[email protected]<[email protected]>]
 On Behalf Of colin mcenearney
Sent: Tuesday, June 07, 2011 5:38 PM
To: [email protected]<[email protected]>
Subject: [MarkLogic Dev General] xmlsh - Exception in thread "main" 
java.lang.NoClassDefFoundError

Hi,
First post, so I hope this isn't too annoying either in its newb-ness or 
possible off-topic-ness.

I see there are xmlsh users on here though, so I'd be very grateful if someone 
can help me figure out this error, which is happening when I try to run the 
install script:

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/xmlsh/sh/shell/Shell
Caused by: java.lang.ClassNotFoundException: 
org.xmlsh.sh<http://org.xmlsh.sh.shell.sh/>.shell.Shell
        at java.net<http://java.net/>.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
java.net<http://java.net.urlclassloader.fi/>.URLClassLoader.findClass(Unknown 
Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.xmlsh.sh.shell.Shell.  Program will exit.

The first lines, building up $CLASSPATH, run without errors. The trouble comes 
from the last line:

# Adjust VM args below to your taste
java -cp $CLASSPATH -Xmx1024m -Xms256m -XX:+UseConcMarkSweepGC 
org.xmlsh.sh.shell.Shell   "$@"

No idea what VM args are - maybe this is meant to be edited?

Many thanks,
Colin


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to