Java EE5 Tutorial - Totally lost!

HI I'm just working through the Java EE5 Tutorial.

I'm using:

Sun Java System Application Server Platform Edition 9 Update 1 Patch 1

installed in C:\Sun\SDK

The tutorial/example projects are therefore in:

C:\Sun\SDK\domains\domain1\docroot\javaeetutorial5\examples\web\bookstore1

Netbeans IDE 5.5.1

I'm having problems specifically with Chapter 2: Populating the Example Database

The instructions state:

When you deploy any of the Duke's Bookstore applications using ant deploy, the database is automatically populated at the same time. If you want to populate the database separately from the deploy task or are using NetBeans 5.5 to deploy the application, follow these steps:

1. In a terminal window, go to the books directory or any one of the bookstore1 through bookstore6 example directories.

2. Start the Java DB database server. For instructions, see Starting and Stopping the Java DB Database Server. You don't have to do this if you are using NetBeans 5.5. It starts the database server automatically.

3. Run ant create-tables. This task runs a command to read the file tutorial.sql and execute the SQL commands contained in the file.

At the end of the processing, you should see the following output:

...

[sql] 181 of 181 SQL statements executed successfully

The first problem I have is that the Runtime/Databases section, I cannot connect to:

jdbc:derby://localhost:1527/sample

(though I don't think this matters for this problem)

Next if I use the ant command from the command prompt I get:

C:\Sun\SDK\domains\domain1\docroot\javaeetutorial5\examples\web\bookstore1>ant c

reate-tables

'ant' is not recognized as an internal or external command,

operable program or batch file.

C:\Sun\SDK\domains\domain1\docroot\javaeetutorial5\examples\web\bookstore1>

Using asant I get:

C:\Sun\SDK\domains\domain1\docroot\javaeetutorial5\examples\web\bookstore1>asant create-tables

Buildfile: build.xml

-pre-init:

init:

check:

BUILD FAILED

C:\Sun\SDK\domains\domain1\docroot\javaeetutorial5\examples\bp-project\app-serve

r-ant.xml:417: Property javaee.server.passwordfile not specified. Please

specify the javaee.server.passwordfile property in'bp-project/build

.properties'.

You will also need to ensure that the passwordfile is present and co

ntains

AS_ADMIN_PASSWORD.

Total time: 0 seconds

I can deploy the project no problem, If I navigate to

http://localhost:8080/bookstore1/bookstore

I get the exception:

Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException

Internal Exception: org.apache.derby.client.am.SqlException: Table'WEB_BOOKSTORE_BOOKS' does not exist.Error Code: -1

Call:SELECT BOOKID, FIRSTNAME, SURNAME, ONSALE, INVENTORY, CALENDAR_YEAR, TITLE, PRICE, DESCRIPTION FROM WEB_BOOKSTORE_BOOKS WHERE (BOOKID = ?)

bind => [203]

Query:ReadObjectQuery(com.sun.bookstore.database.Book)

Can anyone give me any pointers as to what I'm doing wrong?

I must say that I find the whole tutorial completely inaccessible, as it seems to give no tutorial at all, simply stating a stream of remotely connected facts, without any practical example. Is there an alternative book/guide to working through Java EE 5 for beginners?

[3639 byte] By [kingmunkymana] at [2007-11-27 9:39:21]
# 1

First of all, have you created and modified build.properties as described here?

http://java.sun.com/javaee/5/docs/tutorial/doc/About5.html#wp67375

Second, you need to start JavaDB before you can create the database tables using the create-tables task. You do this by entering:

asadmin start-database

Third, you can use asant or ant with the tutorial. To use ant, you need to add the location of the ant executable to your path.

Once you've verified that your environment is set up, try build and deploying the example again.

ievansa at 2007-7-12 23:14:30 > top of Java-index,Application & Integration Servers,Application Servers...