You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Stephan.Boldt" <St...@ePost.de> on 2003/03/13 02:37:52 UTC

[TDK] Problem creating sample app with TDK 2.2_01

Hello,

I've got the following problem:
I downloaded TDK 2.2_01 and followed the steps of the how-to description, to
set up a sample application. "ant" ran perfectly but the "ant init" command
generated the following error:

BUILD FAILED
file:C:/Programme/tdk-2.2/webapps/testapp/WEB-INF/build/build-torque.xml:284
: 
Exception thrown by 'generator.parse'. For more information consult the
velocity log, or invoke ant with the -debug flag.

I ran it again with the -debug opion and I could see the following error
Message:

Couldn't load ResourceStream for sql/db-init/testapp/createdb.vm

I searched for the file "createdb.vm" without success. What's wrong? I use
the following versions:

Windows XP Professional - SP1
JDK 1.4.1
Apache Ant version 1.5.2 compiled on February 28 2003
TDK 2.2_01
MySQL 3.23.55

I an quite frustrated, because I gave up creating a sample app with TDK 2.1
and now having also problems with 2.2... I would really like to try working
with Turbine, but I see no chance to do so, because even the simle sample
app can't be generated!

I hope someone can help me! Thank you in advance!
Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: [TDK] Problem creating sample app with TDK 2.2_01

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Stephan.Boldt" <St...@ePost.de> writes:

>I ran it again with the -debug opion and I could see the following error
>Message:

>Couldn't load ResourceStream for sql/db-init/testapp/createdb.vm

>I searched for the file "createdb.vm" without success. What's wrong? I use
>the following versions:

Look into the "torque-<xxx>.jar" in WEB-INF/lib ;-) It is a resource
stream, not a file.

This sounds like a problem with either ant or your JDK. I must admit
that I haven't tried out ant 1.5.2 yet. It seems that the createdb task
can't load the needed template from the jar.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: [TDK] Problem creating sample app with TDK 2.2_01

Posted by "Eduardo A. dela Rosa" <ed...@ingenium.com.ph>.
you are very much welcome and so are others!  =)

On Thu, 2003-03-13 at 19:43, Stephan.Boldt wrote:
> Hello Eduardo,
> 
> Thank you VERY MUCH for your help and the EXCELLENT HOWTO! I finally got my
> TDK sample app working! But there seems to be one error in your HOWTO: 
> "database = ${database.name}" seems do be wrong. I had to put in the name of
> the DBMS here, mysql in my case. Otherwise the database specific property
> file ${database}.prop can't be located by torque.
> 
> But again: Thank you very much for your help! This HOWTO should be delivered
> with the TDK or at least made available on the Turbine Website!
> 
> Stephan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
-- 
EDUARDO A. DELA ROSA
Systems Analyst/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph


DISCLAIMER:

This message is intended only for the named recipient.
If you are not the intended recipient you are notified that
disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: [TDK] Problem creating sample app with TDK 2.2_01

Posted by "Eduardo A. dela Rosa" <ed...@ingenium.com.ph>.
btw stephan,

i appreciate that you brought this correction up.  i had to revise a few
sections of our HOWTO, tried to re-create another new sample app and i
believe everything's fine now.

thank you again!

(i have pasted it below for other's perusal)
  
On Thu, 2003-03-13 at 19:43, Stephan.Boldt wrote:
> Hello Eduardo,
> 
> Thank you VERY MUCH for your help and the EXCELLENT HOWTO! I finally got my
> TDK sample app working! But there seems to be one error in your HOWTO: 
> "database = ${database.name}" seems do be wrong. I had to put in the name of
> the DBMS here, mysql in my case. Otherwise the database specific property
> file ${database}.prop can't be located by torque.
> 
> But again: Thank you very much for your help! This HOWTO should be delivered
> with the TDK or at least made available on the Turbine Website!
> 
> Stephan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
-- 
EDUARDO A. DELA ROSA
Systems Analyst/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph


DISCLAIMER:

This message is intended only for the named recipient.
If you are not the intended recipient you are notified that
disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.



*---------------------------------*

TDK 2.2 INSTALLATION AND RUNNING - V1.3
========================================

PLEASE NOTE:

This information is being shared for public use and reference.
I was able to run the TDK 2.2 sample application (but I renamed
it to 'turbineapp') successfully and I suspect that perhaps - I
have probably set up some build property and environment settings
properly. Though, I believe you can still find a better and easy
way to run the TDK sample application.

Anyway, albeit I've got it running in 12 working hours, it's still is...
fructuous. c",)


Environment Pre-requisites
---------------------------

The following software should be installed prior to attempt to
install and run the TDK (as per Turbine site Tutorial section):

(a) Java Software Development Kit (version 1.2 or later);
(b) Ant (version 1.3 or later);
(c) Java Activation Framework Jar (activation.jar - OPTIONAL);
(d) Your choice of Database Server (as long as provided with
     JDBC Driver like Oracle, MySQL, Prostgres, Sybase, etc.);
(e) TDK 2.2 (tdk-2.2.tar.gz - downloaded from Turbine site)

NOTE:

In the above list of environment pre-requisites, I used the
following software with their corresponding version:

(a) J2SDK 1.4.0_01
(b) Ant 1.5.2
(c) activation.jar 1.0.1  (optional)
(d) MySQL 3.23.54-Max
(e) of course, the un-Tarred tdk-2.2

NEXT:

Have the JAVA_HOME, ANT_HOME, and CLASSPATH environment variables
set up.

This is my setup: (Linux)

JAVA_HOME=/usr/java/j2sdk1.4.0_01
ANT_HOME=/usr/local/apache-ant-1.5.2
CLASSPATH=.:/tdk-2.2/lib:/tdk-2.2/tdk/lib:$CLASSPATH

for Windows platform:

JAVA_HOME=C:\j2sdk1.4.0_01
ANT_HOME=C:\apache-ant-1.5.2
CLASSPATH=\tdk-2.2\lib;\tdk-2.2\tdk\lib;%CLASSPATH%


*-------------*
*** TODO!!! ***
*-------------*

1.
================================
MODIFY THE build.properties FILE
================================

By default, the build.xml file in your TDK root will build the sample
application by the name "newapp".  You may change this name to something
else of your choice.  I changed the attributes in the build.xml as
follows:

(Linux)
tdk.project = turbineapp
target.package = com.ingenium.turbineapp
target.directory = com/ingenium/turbineapp

(Windows)
tdk.project = turbineapp
target.package = com.ingenium.turbineapp
target.directory = com\ingenium\turbineapp

IMPORTANT:

(a)  add the property "tdk.home" as follow:

tdk.home = @YOUR_TDKROOT	// mine is tdk.home = /tdk-2.2

(b)  make sure to REMOVE TRAILING SPACE(S) after the the tdk root path

as in

tdk.home = /tdk-2.2[NO TRAILING SPACES]


2.
===========
RUN THE ant
===========

Run the ant in the TDK root:

[root@localhost tdk-2.2]# ant

The above changes made with build properties should have generated the
following structure:

(Linux)
{TDKROOT}/webapps/turbineapp/WEB-INF/build

(Windows)
{TDKROOT}\webapps\turbineapp\WEB-INF\build

The files in this folder will be used by 'ant init' in generating tables
and classes that will be used by Turbine when it runs the sample
application.

At this point in time, make sure that the required JDBC jar file is
contained
in the folder {TDKROOT}/webapps/turbine/WEB-INF/lib to allow the build
to connect
to the database server when creating the tables (Note: TABLES and NOT
DATABASE).
Turbine has already provided MySQL JDBC jar file.  If you're going to
use Oracle,
copy the "classes12.jar" into it.

3.
====================================
SETUP DATABASE CONNECTION PARAMETERS
====================================

Go to the {TDKROOT}/webapps/turbine/WEB-INF/build folder.

Before finally building the sample web application, modify the
build.properties
file.  ONLY modify properties that appears below.  Other properties are
build-
generated and requires no change.

Set the following parameters accordingly based on your local setting:

(Note: Set the following properties if not yet set automatically during
build.
If you see property that is not yet in the build.property file, add
them)

// replace @PLACE_HOLDER with actual VALUE
tdk.project = @YOUR_WEB_APPNAME
tdk.home = @YOUR_TDKROOT

// do as-is.  ${tdk.project} points to the tdk.project above
project = ${tdk.project}

target.package = @YOUR.TARGET.PACKAGE		// mine is
com.ingenium.turbineapp
target.directory = @YOUR/TARGET/DIRECTORY	// mine is
com/ingenium/turbineapp


database.name = ${tdk.project}			// this will give your database same
name as your appname or you may change it.
database = @YOUR_DATABASE_SERVER		// mine is mysql
database.driver = @YOUR_DATABASE_DRIVER		// mine is
com.mysql.jdbc.Driver
databaseDriver = ${database.driver}
databaseHost = @YOUR_DATABASE_HOST		// mine is localhost
databaseUser = @YOUR_DATABASE_USER		// whatever
databasePassword = @YOUR_DATABASE_PASSWORD	// whatever again...
databaseUrl = @YOUR_DATABASE_URL		// mine is
jdbc:mysql://${databaseHost}/${database.name}
createDatabaseUrl = ${databaseUrl}
buildDatabaseUrl = ${databaseUrl}


Catch!!!
--------

In the build-torque.xml, look for the following lines and change the
value of "arg2" INTO
"false":

  <target name="create-db-check">
    <condition property="torque.internal.manualCreation">
      <equals arg1="${torque.database.manualCreation}" arg2="true"/>
    </condition>
  </target>


Another Catch!!!
----------------

As per XML specification, the directive <?xml version="1.0"?> in XML
document is recommended
to be present before everything else.  It makes the life of XML Parser
easier to recognize and
interpret the a XML schema.  This directive is missing in the
build-torque.xml.
I therefore recommend as well that you should add it.


4.
====================================
CREATE THE DATABASE IN THE DB SERVER
====================================

Before you run the 'ant-init', connect to your DB Server and create your
database MANUALLY.
In my case, I created the "turbineapp" database in MySQL server.  Try to
GRANT necessary
privileges to the account you provided in your JDBC connection even if
you think it already
has.

5.
===========================
FINALLY! RUN THE 'ant init'
===========================

Run the 'ant init' as "[root@localhost tdk-2.2]# ant init" and live
happily ever
after...


Revised as of March 13,2003

Prepared by Eduardo A. dela Rosa
Systems Analyst/Programmer

edelarosa@ingenium.com.ph
Ingenium Technology, Inc.

First issue as of March 11,2003
Revised March 12,2003



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: [TDK] Problem creating sample app with TDK 2.2_01

Posted by "Stephan.Boldt" <St...@ePost.de>.
Hello Eduardo,

Thank you VERY MUCH for your help and the EXCELLENT HOWTO! I finally got my
TDK sample app working! But there seems to be one error in your HOWTO: 
"database = ${database.name}" seems do be wrong. I had to put in the name of
the DBMS here, mysql in my case. Otherwise the database specific property
file ${database}.prop can't be located by torque.

But again: Thank you very much for your help! This HOWTO should be delivered
with the TDK or at least made available on the Turbine Website!

Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: [TDK] Problem creating sample app with TDK 2.2_01

Posted by "Eduardo A. dela Rosa" <ed...@ingenium.com.ph>.
dear steve,

i join your frustrations because i have had the same experience before.
i tried posting the exceptions i got to this list but no one has
responded yet.

anyway, after all birth pains that i've got, i decided to do it and
solve it my on my own.  i've attached a simple HOWTO that i wrote my
self, hoping to give somebody like us a help to setup and run the 
TDK 2.2 sample application for startup.

hope you would now be able to run it!  c",)

  
-- 
EDUARDO A. DELA ROSA
Systems Analyst/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph


DISCLAIMER:

This message is intended only for the named recipient.
If you are not the intended recipient you are notified that
disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.


On Thu, 2003-03-13 at 09:37, Stephan.Boldt wrote:
> Hello,
> 
> I've got the following problem:
> I downloaded TDK 2.2_01 and followed the steps of the how-to description, to
> set up a sample application. "ant" ran perfectly but the "ant init" command
> generated the following error:
> 
> BUILD FAILED
> file:C:/Programme/tdk-2.2/webapps/testapp/WEB-INF/build/build-torque.xml:284
> : 
> Exception thrown by 'generator.parse'. For more information consult the
> velocity log, or invoke ant with the -debug flag.
> 
> I ran it again with the -debug opion and I could see the following error
> Message:
> 
> Couldn't load ResourceStream for sql/db-init/testapp/createdb.vm
> 
> I searched for the file "createdb.vm" without success. What's wrong? I use
> the following versions:
> 
> Windows XP Professional - SP1
> JDK 1.4.1
> Apache Ant version 1.5.2 compiled on February 28 2003
> TDK 2.2_01
> MySQL 3.23.55
> 
> I an quite frustrated, because I gave up creating a sample app with TDK 2.1
> and now having also problems with 2.2... I would really like to try working
> with Turbine, but I see no chance to do so, because even the simle sample
> app can't be generated!
> 
> I hope someone can help me! Thank you in advance!
> Steve
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>