*
The moose likes Ant, Maven and Other Build Tools and the fly likes Using ANT to build j2ee tutorial examples Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Using ANT to build j2ee tutorial examples" Watch "Using ANT to build j2ee tutorial examples" New topic
Author

Using ANT to build j2ee tutorial examples

Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
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

Joined: Sep 11, 2000
Posts: 319
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

Joined: Sep 11, 2000
Posts: 319
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).]
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
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

Joined: Sep 11, 2000
Posts: 319
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
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4419
    
    5

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


Junilu - [How to Ask Questions] [How to Answer Questions]
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using ANT to build j2ee tutorial examples
 
Similar Threads
New to Web Services and JAXB
Start j2ee server - NoClassDefFoundError - Please help!
EJB deployment error
Using ANT to build j2ee tutorial examples
Build Error with Weblogic10.3 and Ant 1.6.5