javaee5 Tutorial first step error(can not run ant)

Hi all,

I have just installedSun Java System Application Server enterprise Editionin my computer.

My system is getoo .

I copy thejavaee5Tutorial to the directory ofSun Java System Application Server enterprise Edition

Here is the error:

in the bookstore1 directory: run ant

Buildfile: build.xml

BUILD FAILED

/opt/SUNWappserver/javaeetutorial5/examples/web/bookstore1/build.xml:23: The following error occurred while executing this line:

/opt/SUNWappserver/javaeetutorial5/examples/bp-project/main.xml:20: Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the "else" attribute.

Total time: 1 second

regards!

aries211

[750 byte] By [aries211] at [2007-11-14]
# 1
Are you using the right version of Ant? I believe Ant 1.6.5 is packaged with the SJSAS PE 9. According to the Ant docs the else attribute has been supported since Ant 1.6.3.
caseylou at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 2

If you indeed installed Sun Java System Application Server *Enterprise Edition* that would imply that you are running version 8.1 which is compatible with J2EE 1.4. Therefore, you cannot run Java EE 5 Tutorial against it.

So, check what you have installed. My best guess is that you picked the wrong download...

Snjezana at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 3
Thanks for you pieces of advice, before installation of sjsas pe 9. I have already installed ant 1.6.5.Yes, I'm sure the problem is the ant.Must I use the ant contained in the package of SJSAS PE 9?Regards!ariesMessage was edited by: aries211
aries211 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 4
I'm sure I have installed SJSAS PE 9
aries211 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 5
Are you by any chance running this on Linux? If so, take a look at your /etc/ant.conf file if it exists - this file might be setting ANT_HOME to point to an older version of ant and this might interfere with Tutorial samples.
Snjezana at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 6

Hi all:

I am following the examples of javaeetutorial5 and I am having problems running ANT for the hello2 web module when I select the following command:

I DID NOT HAVE PROBLEMS WITH HELLO1 but I am having problem with hello2......

I am using java version 1.4.2_07 in my classpath.....

If you need more information please let me know.....

C:\javaeetutorial5\examples\web\hello2>ant

Buildfile: build.xml

-pre-init:

init:

default-ear:

-pre-compile:

bpp-actual-compilation:

[echo] Compiling hello2

[javac] Compiling 2 source files to C:\javaeetutorial5\examples\web\hello2\b

uild\web\WEB-INF\classes

[javac] javac: invalid target release: 1.5

[javac] Usage: javac <options> <source files>

[javac] where possible options include:

[javac]-gGenerate all debugging info

[javac]-g:noneGenerate no debugging info

[javac]-g:{lines,vars,source}Generate only some debugging info

[javac]-nowarnGenerate no warnings

[javac]-verboseOutput messages about what the compiler

is doing

[javac]-deprecation Output source locations where deprecated

APIs are used

[javac]-classpath <path> Specify where to find user class files

[javac]-sourcepath <path>Specify where to find input source files

[javac]-bootclasspath <path>Override location of bootstrap class fil

es

[javac]-extdirs <dirs>Override location of installed extension

s

[javac]-d <directory>Specify where to place generated class f

iles

[javac]-encoding <encoding>Specify character encoding used by sourc

e files

[javac]-source <release> Provide source compatibility with specif

ied release

[javac]-target <release> Generate class files for specific VM ver

sion

[javac]-help Print a synopsis of standard options

BUILD FAILED

C:\javaeetutorial5\examples\bp-project\command-line-ant-tasks.xml:89: Compile fa

iled; see the compiler error output for details.

Total time: 1 second

C:\javaeetutorial5\examples\web\hello2>

enterprise1 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 7

Hi all ....

it's me again.....I just try a couple of minutes ago to run ANT for the bookstore1 of the Example Servlets of the Java EE 5 Tutorial and still getting this frustated error:

C:\javaeetutorial5\examples\web\bookstore1>ant

Buildfile: build.xml

-pre-init:

init:

default-ear:

build-common:

-pre-init:

init:

default-ear:

-pre-compile:

bpp-actual-compilation:

[echo] Compiling bookstore

[javac] Compiling 11 source files to C:\javaeetutorial5\examples\web\booksto

re\build\classes

[javac] javac: invalid target release: 1.5

[javac] Usage: javac <options> <source files>

[javac] where possible options include:

[javac]-gGenerate all debugging info

[javac]-g:noneGenerate no debugging info

[javac]-g:{lines,vars,source}Generate only some debugging info

[javac]-nowarnGenerate no warnings

[javac]-verboseOutput messages about what the compiler

is doing

[javac]-deprecation Output source locations where deprecated

APIs are used

[javac]-classpath <path> Specify where to find user class files

[javac]-sourcepath <path>Specify where to find input source files

[javac]-bootclasspath <path>Override location of bootstrap class fil

es

[javac]-extdirs <dirs>Override location of installed extension

s

[javac]-d <directory>Specify where to place generated class f

iles

[javac]-encoding <encoding>Specify character encoding used by sourc

e files

[javac]-source <release> Provide source compatibility with specif

ied release

[javac]-target <release> Generate class files for specific VM ver

sion

[javac]-help Print a synopsis of standard options

[subant] Failure for target 'default' of: C:\javaeetutorial5\examples\web\boo

kstore\build.xml

[subant] The following error occurred while executing this line:

[subant] C:\javaeetutorial5\examples\bp-project\command-line-ant-tasks.xml:89

: Compile failed; see the compiler error output for details.

copy-common-jars:

[mkdir] Created dir: C:\javaeetutorial5\examples\web\bookstore1\build\web\WE

B-INF\lib

BUILD FAILED

C:\javaeetutorial5\examples\web\bookstore1\build.xml:36: Warning: Could not find

file C:\javaeetutorial5\examples\web\bookstore\dist\bookstore.jar to copy.

Total time: 1 second

C:\javaeetutorial5\examples\web\bookstore1>

- -

Here it is the build.properties file

# uncomment the property javaee.home, and add the path

# to your GlassFish Java EE 5 SDK installation

#

javaee.home=c:/Sun/AppServer

javaee.tutorial.home=c:/javaeetutorial5

# machine name (or the IP address) where the applications will be deployed.

javaee.server.name=localhost

# port number where the app-server is accessed by the users

javaee.server.port=8080

# port number where the admin server of the app-server is available

javaee.adminserver.port=4848

# Uncomment the property j2ee.server.username,

# and replace the administrator username of the app-server

javaee.server.username=admin

# Uncomment the property j2ee.server.passwordfile,

# and replace the following line to point to a file that

# contains the admin password for your app-server.

# The file should contain the password in the following line:

#

# AS_ADMIN_PASSWORD=adminadmin

#

# Notice that the password is adminadmin since this is

# the default password used by the glassfish app-server installation.

#

javaee.server.passwordfile=${javaee.tutorial.home}/examples/common/admin-passwo rd.txt

appserver.instance=server

# Uncomment and set this property to the location of the browser you

# choose to launch when an application is deployed.

# On Windows and Mac OS X the default browser is used.

#default.browser=/Applications/Firefox.app/Contents/MacOS/firefox-bin

# Database vendor property for db tasks

db.vendor=javadb

- --

This is in my SYSTEM VARIABLE:

CLASSPATH= c:\sun\appserver\lib;C:\Program Files\IBM\WebSphere MQ\Java\lib\providerutil.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mqjms.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\ldap.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jta.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jndi.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jms.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\connector.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\fscontext.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;c:\j2sdk1.4.2_07;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip\

javaee.home = C:\\Sun\\AppServer

JAVA_HOME = c:\j2sdk1.4.2_07

- -

Thank you in advanced....

enterprise1 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 8
You can try asant command
TZhi at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 9
Same problem, did you ever find a resolution.
kiss1 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 10
Just figured it out. My JAVA_HOME variable was set to jvm 1.4 and need to be 1.5 version. Made change and it worked just fine.
kiss1 at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...
# 11
Had similar problem. My JAVA_HOME was properly set to 1.5 but I had the 1.4 tools.jar in classpath. Fixed it and everything worked fine
kkadusumilli at 2007-7-6 > top of java,Application & Integration Servers,Application Servers...