• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Using ANT to build j2ee tutorial examples

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At java.sun.com/xml, Sun says that j2sdkee1.3.1 supports JAXP. Yet I am getting the following error with j2ee.jar included in my CLASSPATH.
C:\j2eetutorial\examples>set CLASSPATH
CLASSPATH=C:.;C:\J2sdk331.3\lib\j2ee.jar;c:\ant\jakarta-ant-1.3\lib\ant.jar
C:\j2eetutorial\examples>ant all
The system cannot find the path specified.
Buildfile: build.xml
BUILD FAILED
No JAXP compliant XML parser found. See http://java.sun.com/xml for the
reference implementation.
--- Nested Exception ---
java.lang.ClassNotFoundException: javax.xml.parsers.SAXParserFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at org.apache.tools.ant.Main.runBuild(Main.java:402)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 0 seconds
Thanks for your help.
12/12/01 I saw that the SaxParserFactory is in the j2ee.jar which is in my CLASSPATH as shown above. What am I missing?


[This message has been edited by Betty Schwartz (edited December 12, 2001).]
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know cross posting to other forums is frowned upon so could someone here provide some direction for answers to my questions? I really want to work through the J2EE tutorial and not get bogged down with building the examples with ANT.
Thanks.
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I include my complete set of environment variables here below. Note the error message I am receiving and that JAVA_HOME IS set to C:\jdk1.3.1. Sun gives such simple directions for building the j2eetutorial\examples with ANT at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/J2eeTutorialPreface.html

C:\j2eetutorial\examples>ant all
The system cannot find the path specified.
Buildfile: build.xml
init:
savingsaccount:
[javac] Modern compiler is not available - using classic compiler
[javac] Compiling 5 source files to C:\j2eetutorial\examples\build\ejb\
savingsaccount
BUILD FAILED
C:\j2eetutorial\examples\build.xml:54: Cannot use classic compiler, as it is not available A common solution is to set the environment variable JAVA_HOME to your jdk directory.
Total time: 1 second

C:\j2eetutorial\examples>set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
ANT_HOME=c:\ant
APPDATA=C:\Documents and Settings\schwartzbj\Application Data
CLASSPATH=C:.;C:\j2sdkee1.3\lib\j2ee.jar;c:\ant\jakarta-ant-1.3\lib\ant.jar
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=BETTY80906
ComSpec=C:\WINNT\system32\cmd.exe
HOMEDRIVE=c:
HOMEPATH=\Documents and Settings\schwartzbj
J2EE_HOME=c:\j2sdkee1.3
JAVA_HOME=c:\jdk1.3.1
LOGONSERVER=\\BETTY80906
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Os2LibPath=C:\WINNT\system32\os2\dll;
Path=c:\WINNT\system32;c:\WINNT;C:\winnt\System32\Wbem;c:\ant\jakarta-ant-
1.3\bin;c:\j2sdkee1.3.1\bin;c:\jdk1.3.1\bin;c:\forte4j\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 7 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0702
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINNT
TEMP=C:\DOCUME~1\SCHWAR~1\LOCALS~1\Temp
TMP=C:\DOCUME~1\SCHWAR~1\LOCALS~1\Temp
TOMCAT_HOME=c:\jakarta-tomcat\jakarta-tomcat-3.2.3
USERDOMAIN=BETTY80906
USERNAME=schwartzbj
USERPROFILE=C:\Documents and Settings\schwartzbj
windir=C:\WINNT
Here is my ANT directory structure if that is of interest:
C:\ant\jakarta-ant-1.3>dir
Volume in drive C has no label.
Volume Serial Number is 98A3-7427
Directory of C:\ant\jakarta-ant-1.3
12/07/2001 07:09p <DIR> .
12/07/2001 07:09p <DIR> ..
12/07/2001 07:09p <DIR> bin
12/07/2001 07:09p <DIR> docs
12/07/2001 07:09p <DIR> lib
03/02/2001 11:46p 2,754 LICENSE
03/02/2001 11:46p 2,758 README
03/02/2001 11:46p 649 TODO
03/02/2001 11:46p 9,142 WHATSNEW
4 File(s) 15,303 bytes
5 Dir(s) 1,081,438,208 bytes free
I do not know what path the system is not able to find or if that is causing the problem. Maybe I need to spend a week learning enough about ANT to build the examples for the j2eetutorial...
Betty


[This message has been edited by Betty Schwartz (edited December 12, 2001).]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to get JAXP from Sun, the SAXParserFactory you see ine j2see isn't the correct one. Ensure you get all the packages required for the tutorial and include all the jars in your classpath. This should allow everything to work properly.

------------------
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Carl,
Thanks for the suggestion. I looked on Sun's site for the JAXP download with no success. Did you notice that I am not now getting that error, but, rather , one related to the JAVA_HOME? The new information is in the third or forth email in this thread.
It doesn't appear JAXP is still the problem, but if you think so, then can you suggest where I can find it?
Thanks,
Betty
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked Sun's Forums tonight and found my error. ANT_HOME mjst be set to c:\ant\jakarta-ant-1.3 and not simply c:\ant.
Thanks to all who offered assistance.
Betty
 
Sheriff
Posts: 17680
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Betty,
Glad to see you worked it out. I found this link on the Sun website, you might want to run through some of these code camps:
http://www.sun.com/developers/edu/camps/
Good luck!
Junilu
 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the link. I'm busy doing the Forte tutorial right now. And I'm now able to continue with the Getting Started section of the J2EE tutorial. Coding is not my problem; it is setting up environments usually.
Betty
[This message has been edited by Betty Schwartz (edited December 13, 2001).]
 
brevity is the soul of wit - shakepeare. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic