Discussion:
[Middlegen-user] Can't get it working.
Ravi Deshmukh
2002-08-30 04:28:03 UTC
Permalink
Hi Aslak,

With middlegen I'm a user, not a developer. Nonetheless, based on your reply I did the following:

- Installed WinCVS
- Downloaded the middlegen CVS - note: middlegen CVS page says specify the "modulename" but I
couldn't find the value anywhere. I guessed and used "middlegen"
- Installed Ant 1.5
- Ran Ant against build.xml, got a docs, lib, and samples dir
- Unlike v1.0 there is no build.bat file. There is one set of jars in \lib, and a different set
in \samples\lib. Which jars are required in the cp to run middlegen ? Or let's just say, how do I
run middlegen ?
- Installed maven to generate docs. Maven version is maven-1.0-beta-6. On executing "maven xdoc"
it generates a bunch of errors looking for jar files in MAVEN_HOME\repository\XXX\jars where XXX
is ant, velocity, log4j, junit, and commons-collections. I found the jar files in MAVEN_HOME\lib
and copied them. I found velocity in middlegen\samples\lib and copied it. Running it again
produced NoClassDefFoundError on: org/apache/tools/dvsl/DVSL. This class is not in any of the
Maven jars - where do I get it ?

I also saw your posting on the users mailing list saying that a new release should be out soon -
any idea on the date ? Also from the mails it appears some people have got it working - what am I
doing wrong ?

I don't want to be a pest, but I really like this stuff and would love to get it working.

Thanks,
Ravi


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Eivind Waaler
2002-08-30 05:09:02 UTC
Permalink
Hi Ravi, I'll try to answer your questions below.

.eivind
Post by Ravi Deshmukh
Hi Aslak,
- Installed WinCVS
- Downloaded the middlegen CVS - note: middlegen CVS page says specify the "modulename" but I
couldn't find the value anywhere. I guessed and used "middlegen"
- Installed Ant 1.5
- Ran Ant against build.xml, got a docs, lib, and samples dir
- Unlike v1.0 there is no build.bat file. There is one set of jars in \lib, and a different set
in \samples\lib. Which jars are required in the cp to run middlegen ? Or let's just say, how do I
run middlegen ?
No jars are required in the CP to run middlegen. The build.xml script
starts by setting up classpath. In fact try to make sure your CP is empty
before running it.

To build middlegen, make sure you have ant in your path. Simply type 'ant'
in the middlegen basedir.

To build the samples, use 'ant' in the samples dir.
Post by Ravi Deshmukh
- Installed maven to generate docs. Maven version is maven-1.0-beta-6. On executing "maven xdoc"
it generates a bunch of errors looking for jar files in MAVEN_HOME\repository\XXX\jars where XXX
is ant, velocity, log4j, junit, and commons-collections. I found the jar files in MAVEN_HOME\lib
and copied them. I found velocity in middlegen\samples\lib and copied it. Running it again
produced NoClassDefFoundError on: org/apache/tools/dvsl/DVSL. This class is not in any of the
Maven jars - where do I get it ?
Maven is supposed to download all the files it need from a central
repository. Please refer to the maven docs to read about this. Of course
this requires you to be online the first time you run maven.

I would recommend building maven from cvs, as you will see quite clear how
maven works (maven is build using maven).
Post by Ravi Deshmukh
I also saw your posting on the users mailing list saying that a new release should be out soon -
any idea on the date ? Also from the mails it appears some people have got it working - what am I
doing wrong ?
Hope you get a bit further. Let us know.. :)
Post by Ravi Deshmukh
I don't want to be a pest, but I really like this stuff and would love to get it working.
Thanks,
Ravi
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Ravi Deshmukh
2002-08-31 04:43:01 UTC
Permalink
Hi Eivind,

OK, I tried it out, but it looks like it can't correctly find the database on the server. I'm
working with Sybase 11 on Linux. The older Middlegen 1.0 was able to connect, extract metadata,
and build the beans. With the new version, if I specify a table name, I get the following error:

middlegen:
[middlegen] Database URL:jdbc:sybase:Tds:linux:7100/court

BUILD FAILED
file:C:/middlegen/samples/build.xml:134: middlegen.MiddlegenException: The datab
ase doesn't have any table named pbcattbl. Please make sure the table exists. A
lso note that some databases are case sensitive.

If I don't specify any table names, I get this error:

middlegen:
[middlegen] Database URL:jdbc:sybase:Tds:linux:7100/court
[middlegen] No <table> elements specified. Reading all tables. This might take a
while...

BUILD FAILED
file:C:/middlegen/samples/build.xml:135: middlegen.MiddlegenException: Middlegen
successfully connected to the database, but couldn't find any tables. Perhaps t
he specified schema or catalog is wrong? -Or maybe there aren't any tables in th
e database at all?


I also tried it with the JDBC/ODBC bridge driver against an MS SQL Server database on my local
machine, but got the same errors.

For Sybase I'm using the jConnect driver. I created a sybase.xml file in \config\database with
the following entries:

<property name="database.driver.file" value="${lib.dir}/jconn2.jar"/>
<property name="database.driver.classpath" value="${database.driver.file}"/>
<property name="database.driver" value="com.sybase.jdbc2.jdbc.SybDriver"/>
<property name="database.url" value="jdbc:sybase:Tds:linux:7100/court"/>
<property name="database.userid" value="sa"/>
<property name="database.password" value=""/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>

For jConnect the database url syntax is:
jdbc:sybase:Tds:<server>:<port>/<database>

My server is named linux, and my database is named court, so:
jdbc:sybase:Tds:linux:7100/court

I used the exact same syntax with Middlegen 1.0 (where it worked).

In the middlegen section of build.xml, jndi properties are also passed - I thought these might
override the jdbc url so I took them out, but no change.

Is there a problem using the "/" in the database url? Is there any other section in build.xml or
somewhere else that I need to change ?

Thanks for your help,
Ravi
Post by Eivind Waaler
Hi Ravi, I'll try to answer your questions below.
.eivind
Post by Ravi Deshmukh
Hi Aslak,
With middlegen I'm a user, not a developer. Nonetheless, based on your reply I did the
- Installed WinCVS
- Downloaded the middlegen CVS - note: middlegen CVS page says specify the "modulename" but I
couldn't find the value anywhere. I guessed and used "middlegen"
- Installed Ant 1.5
- Ran Ant against build.xml, got a docs, lib, and samples dir
- Unlike v1.0 there is no build.bat file. There is one set of jars in \lib, and a different
set
Post by Ravi Deshmukh
in \samples\lib. Which jars are required in the cp to run middlegen ? Or let's just say, how
do I
Post by Ravi Deshmukh
run middlegen ?
No jars are required in the CP to run middlegen. The build.xml script
starts by setting up classpath. In fact try to make sure your CP is empty
before running it.
To build middlegen, make sure you have ant in your path. Simply type 'ant'
in the middlegen basedir.
To build the samples, use 'ant' in the samples dir.
Post by Ravi Deshmukh
- Installed maven to generate docs. Maven version is maven-1.0-beta-6. On executing "maven
xdoc"
Post by Ravi Deshmukh
it generates a bunch of errors looking for jar files in MAVEN_HOME\repository\XXX\jars where
XXX
Post by Ravi Deshmukh
is ant, velocity, log4j, junit, and commons-collections. I found the jar files in
MAVEN_HOME\lib
Post by Ravi Deshmukh
and copied them. I found velocity in middlegen\samples\lib and copied it. Running it again
produced NoClassDefFoundError on: org/apache/tools/dvsl/DVSL. This class is not in any of the
Maven jars - where do I get it ?
Maven is supposed to download all the files it need from a central
repository. Please refer to the maven docs to read about this. Of course
this requires you to be online the first time you run maven.
I would recommend building maven from cvs, as you will see quite clear how
maven works (maven is build using maven).
Post by Ravi Deshmukh
I also saw your posting on the users mailing list saying that a new release should be out soon
-
Post by Ravi Deshmukh
any idea on the date ? Also from the mails it appears some people have got it working - what
am I
Post by Ravi Deshmukh
doing wrong ?
Hope you get a bit further. Let us know.. :)
Post by Ravi Deshmukh
I don't want to be a pest, but I really like this stuff and would love to get it working.
Thanks,
Ravi
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Eivind Waaler
2002-08-31 05:51:01 UTC
Permalink
Hi Ravi,
Aslak Hellesoy
2002-08-31 07:20:02 UTC
Permalink
-----Original Message-----
Deshmukh
Sent: 31. august 2002 08:42
To: Eivind Waaler
Subject: Re: [Middlegen-user] Can't get it working.
Hi Eivind,
OK, I tried it out, but it looks like it can't correctly find the
database on the server. I'm
It has obviously found the database and successfully connected to it.
Otherwise you wouldn't
get the exceptions you get. Here are some tips to get you further:

1) Try to connect to your db with
ant hsqldb-gui
This pops up hsqldb's admin tool, and it connects to your db using the same
settings as Middlegen (from your sybase.xml file). You should see your
tables here. If you don't, try to create some tables with this tool.

2) Turn on debugging. Open samples/log4j.properties and set the debug level
for MiddlegenPopulator to debug. Run the middlegen target again.

This should give you some more info. Hopefully enough to solve your problem.
Let us know how it goes. Post the logging statements too.

Cheers
Aslak
working with Sybase 11 on Linux. The older Middlegen 1.0 was
able to connect, extract metadata,
and build the beans. With the new version, if I specify a table
[middlegen] Database URL:jdbc:sybase:Tds:linux:7100/court
BUILD FAILED
middlegen.MiddlegenException: The datab
ase doesn't have any table named pbcattbl. Please make sure the
table exists. A
lso note that some databases are case sensitive.
[middlegen] Database URL:jdbc:sybase:Tds:linux:7100/court
[middlegen] No <table> elements specified. Reading all tables.
This might take a
while...
BUILD FAILED
middlegen.MiddlegenException: Middlegen
successfully connected to the database, but couldn't find any
tables. Perhaps t
he specified schema or catalog is wrong? -Or maybe there aren't
any tables in th
e database at all?
I also tried it with the JDBC/ODBC bridge driver against an MS
SQL Server database on my local
machine, but got the same errors.
For Sybase I'm using the jConnect driver. I created a sybase.xml
file in \config\database with
<property name="database.driver.file"
value="${lib.dir}/jconn2.jar"/>
<property name="database.driver.classpath"
value="${database.driver.file}"/>
<property name="database.driver"
value="com.sybase.jdbc2.jdbc.SybDriver"/>
<property name="database.url"
value="jdbc:sybase:Tds:linux:7100/court"/>
<property name="database.userid" value="sa"/>
<property name="database.password" value=""/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
jdbc:sybase:Tds:<server>:<port>/<database>
jdbc:sybase:Tds:linux:7100/court
I used the exact same syntax with Middlegen 1.0 (where it worked).
In the middlegen section of build.xml, jndi properties are also
passed - I thought these might
override the jdbc url so I took them out, but no change.
Is there a problem using the "/" in the database url? Is there
any other section in build.xml or
somewhere else that I need to change ?
Thanks for your help,
Ravi
Post by Eivind Waaler
Hi Ravi, I'll try to answer your questions below.
.eivind
Post by Ravi Deshmukh
Hi Aslak,
With middlegen I'm a user, not a developer. Nonetheless,
based on your reply I did the
Post by Eivind Waaler
Post by Ravi Deshmukh
- Installed WinCVS
- Downloaded the middlegen CVS - note: middlegen CVS page
says specify the "modulename" but I
Post by Eivind Waaler
Post by Ravi Deshmukh
couldn't find the value anywhere. I guessed and used "middlegen"
- Installed Ant 1.5
- Ran Ant against build.xml, got a docs, lib, and samples dir
- Unlike v1.0 there is no build.bat file. There is one set
of jars in \lib, and a different
Post by Eivind Waaler
set
Post by Ravi Deshmukh
in \samples\lib. Which jars are required in the cp to run
middlegen ? Or let's just say, how
Post by Eivind Waaler
do I
Post by Ravi Deshmukh
run middlegen ?
No jars are required in the CP to run middlegen. The build.xml script
starts by setting up classpath. In fact try to make sure your
CP is empty
Post by Eivind Waaler
before running it.
To build middlegen, make sure you have ant in your path. Simply
type 'ant'
Post by Eivind Waaler
in the middlegen basedir.
To build the samples, use 'ant' in the samples dir.
Post by Ravi Deshmukh
- Installed maven to generate docs. Maven version is
maven-1.0-beta-6. On executing "maven
Post by Eivind Waaler
xdoc"
Post by Ravi Deshmukh
it generates a bunch of errors looking for jar files in
MAVEN_HOME\repository\XXX\jars where
Post by Eivind Waaler
XXX
Post by Ravi Deshmukh
is ant, velocity, log4j, junit, and commons-collections. I
found the jar files in
Post by Eivind Waaler
MAVEN_HOME\lib
Post by Ravi Deshmukh
and copied them. I found velocity in middlegen\samples\lib
and copied it. Running it again
Post by Eivind Waaler
Post by Ravi Deshmukh
produced NoClassDefFoundError on: org/apache/tools/dvsl/DVSL.
This class is not in any of the
Post by Eivind Waaler
Post by Ravi Deshmukh
Maven jars - where do I get it ?
Maven is supposed to download all the files it need from a central
repository. Please refer to the maven docs to read about this. Of course
this requires you to be online the first time you run maven.
I would recommend building maven from cvs, as you will see
quite clear how
Post by Eivind Waaler
maven works (maven is build using maven).
Post by Ravi Deshmukh
I also saw your posting on the users mailing list saying that
a new release should be out soon
Post by Eivind Waaler
-
Post by Ravi Deshmukh
any idea on the date ? Also from the mails it appears some
people have got it working - what
Post by Eivind Waaler
am I
Post by Ravi Deshmukh
doing wrong ?
Hope you get a bit further. Let us know.. :)
Post by Ravi Deshmukh
I don't want to be a pest, but I really like this stuff and
would love to get it working.
Post by Eivind Waaler
Post by Ravi Deshmukh
Thanks,
Ravi
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Ravi Deshmukh
2002-08-31 09:21:01 UTC
Permalink
It's working !! Eivind, thanks to your pointer to MiddlegenPopulator. It is calling:
getMetaData().getTables(_catalog, _schema, null, _types);

The javadoc for getTables method in the DatabaseMetaData interface says:
Parameters:
catalog - a catalog name; "" retrieves those without a catalog; null means drop catalog name from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types

Sybase's jConnect implementation needed null for catalog and schemaPattern. I couldn't figure out
how to pass a null value in the database config file elements:

<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>

However, after reading how Ant processes Tasks, I realized that if I removed the "schema" element
from the middlegen task parameters in build.xml, Ant would not call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as null. The "catalog" element was
already not being used in build.xml, so I didn't have to do anything there.

Perhaps it would be appropriate to have a note somewhere about excluding elements for which you
want null values, unless there's a way to specify null as the value in the config file ?

Anyway, I was delighted to see it running! I got a nice ER diagram and was able to set options in
the GUI, generate the bean classes, and then off it went generating everything else! Wonderful!

I'm now playing around with specifying local/remote/both, and the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!

Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Ravi Deshmukh
2002-08-31 13:11:02 UTC
Permalink
Aslak, I got your email, but before that I had sent the one below - I got past the metadata
problem.

I tried to use the pkgen feature with the vendorseq option, but it gave errors stating the pktable
had to be specified. I thought this would not be required if using the database's automatic
sequence generation (SQL Server IDENTITY). Also it did not generate the create methods in which
the primary key column is absent. I noticed it is putting in a "todo" comment that this needs to
be done. Am I too early, is it not implemented yet ?

I'm also getting an error on weblogic ejbc - something about Local and LocalHome interfaces being
exposed in remote interface methods (as arguments to create it looks like). But I'll work on that
a bit more - it may be because I've specified view="both" and also checked the local/remote
checkboxes in the gui.

One question - I haven't understood why we need the xxCMP objects - why not just use the Entity
Bean ?

Ravi
Date: Sat, 31 Aug 2002 04:20:15 -0700 (PDT)
Subject: Re: [Middlegen-user] Can't get it working.
getMetaData().getTables(_catalog, _schema, null, _types);
catalog - a catalog name; "" retrieves those without a catalog; null means drop catalog name
from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types
Sybase's jConnect implementation needed null for catalog and schemaPattern. I couldn't figure
out
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
However, after reading how Ant processes Tasks, I realized that if I removed the "schema"
element
from the middlegen task parameters in build.xml, Ant would not call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as null. The "catalog" element was
already not being used in build.xml, so I didn't have to do anything there.
Perhaps it would be appropriate to have a note somewhere about excluding elements for which you
want null values, unless there's a way to specify null as the value in the config file ?
Anyway, I was delighted to see it running! I got a nice ER diagram and was able to set options
in
the GUI, generate the bean classes, and then off it went generating everything else! Wonderful!
I'm now playing around with specifying local/remote/both, and the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!
Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Eivind Waaler
2002-08-31 15:59:07 UTC
Permalink
Hey,

I'm glad you got further. I'll try to deal with the PK generation issues:

Seems like a minor problem with the validation of the vendorseq option. If
you are using vendorseq, just specify pktable="something" or whatever. It
won't be used, I'll look into the validation asap. Problem is that with
Oracle vendorseq you actually need to specify the name of the sequence, so
this is pretty much a SQL Server specific problem.

For the create methods, I guess that is a feature request yet to be
implemented. However, I have been trying this out and even though the
create method contains a PK it will be ignored when calling the
method. Think you can just pass in null or 0 or whatever. Added a feature
request, please post your comments:

http://sourceforge.net/tracker/index.php?func=detail&aid=602891&group_id=36044&atid=415993

It's really sweet that you're trying out the PK generation as it has been
recently added and needs some feedback from users. Thanks.

.eivind
Post by Ravi Deshmukh
Aslak, I got your email, but before that I had sent the one below - I got past the metadata
problem.
I tried to use the pkgen feature with the vendorseq option, but it gave errors stating the pktable
had to be specified. I thought this would not be required if using the database's automatic
sequence generation (SQL Server IDENTITY). Also it did not generate the create methods in which
the primary key column is absent. I noticed it is putting in a "todo" comment that this needs to
be done. Am I too early, is it not implemented yet ?
I'm also getting an error on weblogic ejbc - something about Local and LocalHome interfaces being
exposed in remote interface methods (as arguments to create it looks like). But I'll work on that
a bit more - it may be because I've specified view="both" and also checked the local/remote
checkboxes in the gui.
One question - I haven't understood why we need the xxCMP objects - why not just use the Entity
Bean ?
Ravi
Date: Sat, 31 Aug 2002 04:20:15 -0700 (PDT)
Subject: Re: [Middlegen-user] Can't get it working.
getMetaData().getTables(_catalog, _schema, null, _types);
catalog - a catalog name; "" retrieves those without a catalog; null means drop catalog name
from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types
Sybase's jConnect implementation needed null for catalog and schemaPattern. I couldn't figure
out
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
However, after reading how Ant processes Tasks, I realized that if I removed the "schema"
element
from the middlegen task parameters in build.xml, Ant would not call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as null. The "catalog" element was
already not being used in build.xml, so I didn't have to do anything there.
Perhaps it would be appropriate to have a note somewhere about excluding elements for which you
want null values, unless there's a way to specify null as the value in the config file ?
Anyway, I was delighted to see it running! I got a nice ER diagram and was able to set options
in
the GUI, generate the bean classes, and then off it went generating everything else! Wonderful!
I'm now playing around with specifying local/remote/both, and the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!
Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Aslak Hellesoy
2002-08-31 19:36:03 UTC
Permalink
Hi again,
-----Original Message-----
Deshmukh
Sent: 31. august 2002 17:11
Subject: Fwd: Re: [Middlegen-user] Can't get it working.
Aslak, I got your email, but before that I had sent the one below
- I got past the metadata
problem.
I tried to use the pkgen feature with the vendorseq option, but
it gave errors stating the pktable
had to be specified. I thought this would not be required if
using the database's automatic
sequence generation (SQL Server IDENTITY). Also it did not
generate the create methods in which
the primary key column is absent. I noticed it is putting in a
"todo" comment that this needs to
be done. Am I too early, is it not implemented yet ?
As Eivind said, not implemented yet. Just pass null if you use pkgen.
I'm also getting an error on weblogic ejbc - something about
Local and LocalHome interfaces being
exposed in remote interface methods (as arguments to create it
looks like). But I'll work on that
That's actually related to this bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=596249&group_id=360
44&atid=415990

Until it's fixed, you should always specify viewtype="local"
a bit more - it may be because I've specified view="both" and
also checked the local/remote
checkboxes in the gui.
One question - I haven't understood why we need the xxCMP objects
- why not just use the Entity
Bean ?
It's XDoclet that generates the xxCMP Bean subclasses. IIRC it is because
XDoclet also supports BMP and EJB 1.1. This subclass implements the required
abstract methods if they aren't implemented in the Bean class. You can
consider it an implementation detail and ignore it completely.

Don't forget to tell us when you get the struts sample up and running on
JBoss! :-)

Cheers,
Aslak
Ravi
Date: Sat, 31 Aug 2002 04:20:15 -0700 (PDT)
Subject: Re: [Middlegen-user] Can't get it working.
It's working !! Eivind, thanks to your pointer to
getMetaData().getTables(_catalog, _schema, null, _types);
catalog - a catalog name; "" retrieves those without a catalog;
null means drop catalog name
from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those
without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types
Sybase's jConnect implementation needed null for catalog and
schemaPattern. I couldn't figure
out
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
However, after reading how Ant processes Tasks, I realized that
if I removed the "schema"
element
from the middlegen task parameters in build.xml, Ant would not
call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as
null. The "catalog" element was
already not being used in build.xml, so I didn't have to do
anything there.
Perhaps it would be appropriate to have a note somewhere about
excluding elements for which you
want null values, unless there's a way to specify null as the
value in the config file ?
Anyway, I was delighted to see it running! I got a nice ER
diagram and was able to set options
in
the GUI, generate the bean classes, and then off it went
generating everything else! Wonderful!
I'm now playing around with specifying local/remote/both, and
the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!
Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Ravi Deshmukh
2002-09-03 10:30:03 UTC
Permalink
Hi Aslak and Eivind,

Yes, I would be happy to be the "Sybase Tester". I have Sybase 11.0.3.3 on Linux. Incidentally
this is a free version of Sybase that is licensed for development AND production use. I found it
very easy to set up, and manage in production, and it lives up to the Sybase reputation for being
fast. Notably, the big advantage over mySql is that Sybase supports transactions. Also there is
full documentation.

OK, until the pkgen feature is released, I'm making the changes to the generated source code
myself.

Also, I'm modifying ejb-jar.xml myself to use the Bean classes instead of the CMP classes.

My build fails at the compile-web task because it can't find a class called
airline.sql.IdGenerator. I don't have a reference to "airline.sql" anywhere in my config files.
Just to make sure it wasn't anything in my config, I ran the sample build.xml, and sure enough it
did generate an IdGenerator.class file, but I couldn't find a corresponding .java file ??

Also in compile-web, there seems to be some mismatch in the create methods. In some cases I get
this:

[javac] C:\middlegen\samples\build\gen-src\courtIS\web\struts\InsertBenchAction.java:66:
create(java.lang.Long,java.lang.String,courtIS.interfaces.CourtLocal) in
courtIS.interfaces.BenchLocalHome cannot be applied to (java.lang.Integer,java.lang.String)

and in others:

[javac] C:\middlegen\samples\build\gen-src\courtIS\web\struts\InsertBenchJudgeTypeAction.java:66:
create(java.lang.Long,java.lang.String) in courtIS.interfaces.BenchJudgeTypeLocalHome cannot be
applied to (java.lang.Integer,java.lang.String)

It looks like it's not using the create methods correctly where foreign key objects are involved,
and that it is using Integer when generating the xxAction.java code even though the primary key
type is Long.

One minor thing: if you specify your project name (name property in build.xml) to be the same as
one of your tables, you ultimately get a peculiar conflict:

[javac] C:\middlegen\samples\build\gen-src\court\web\struts\DeleteCourtAction.java:64: cannot
resolve symbol
[javac] symbol : variable interfaces
[javac] location: interface court.interfaces.CourtLocal
[javac] court = court.interfaces.CourtUtil.getLocalHome().findByPrimaryKey(court_PK);

It took me a while to track it down, but in the above, it thinks "interfaces" is a member of
"court" which is the name of a variable declared earlier in the code ! I changed my project name
to courtIS and it went away.


I did get everything to compile with the sample, and was able to deploy it into WebLogic 7. The
FLIGHTS and PERSONS pages work great, but RESERVATIONS does not. Actually it looks like there's
no code in InsertReservationAction.java ??

OK, should I leave you guys alone for a while now ? :)

Regards,
Ravi
Post by Aslak Hellesoy
Hi again,
-----Original Message-----
Deshmukh
Sent: 31. august 2002 17:11
Subject: Fwd: Re: [Middlegen-user] Can't get it working.
Aslak, I got your email, but before that I had sent the one below
- I got past the metadata
problem.
I tried to use the pkgen feature with the vendorseq option, but
it gave errors stating the pktable
had to be specified. I thought this would not be required if
using the database's automatic
sequence generation (SQL Server IDENTITY). Also it did not
generate the create methods in which
the primary key column is absent. I noticed it is putting in a
"todo" comment that this needs to
be done. Am I too early, is it not implemented yet ?
As Eivind said, not implemented yet. Just pass null if you use pkgen.
I'm also getting an error on weblogic ejbc - something about
Local and LocalHome interfaces being
exposed in remote interface methods (as arguments to create it
looks like). But I'll work on that
http://sourceforge.net/tracker/index.php?func=detail&aid=596249&group_id=360
44&atid=415990
Until it's fixed, you should always specify viewtype="local"
a bit more - it may be because I've specified view="both" and
also checked the local/remote
checkboxes in the gui.
One question - I haven't understood why we need the xxCMP objects
- why not just use the Entity
Bean ?
It's XDoclet that generates the xxCMP Bean subclasses. IIRC it is because
XDoclet also supports BMP and EJB 1.1. This subclass implements the required
abstract methods if they aren't implemented in the Bean class. You can
consider it an implementation detail and ignore it completely.
Don't forget to tell us when you get the struts sample up and running on
JBoss! :-)
Cheers,
Aslak
Ravi
Date: Sat, 31 Aug 2002 04:20:15 -0700 (PDT)
Subject: Re: [Middlegen-user] Can't get it working.
It's working !! Eivind, thanks to your pointer to
getMetaData().getTables(_catalog, _schema, null, _types);
catalog - a catalog name; "" retrieves those without a catalog;
null means drop catalog name
from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those
without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types
Sybase's jConnect implementation needed null for catalog and
schemaPattern. I couldn't figure
out
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
However, after reading how Ant processes Tasks, I realized that
if I removed the "schema"
element
from the middlegen task parameters in build.xml, Ant would not
call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as
null. The "catalog" element was
already not being used in build.xml, so I didn't have to do
anything there.
Perhaps it would be appropriate to have a note somewhere about
excluding elements for which you
want null values, unless there's a way to specify null as the
value in the config file ?
Anyway, I was delighted to see it running! I got a nice ER
diagram and was able to set options
in
the GUI, generate the bean classes, and then off it went
generating everything else! Wonderful!
I'm now playing around with specifying local/remote/both, and
the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!
Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Eivind Waaler
2002-09-03 11:58:26 UTC
Permalink
Hi, good work on the Sybase side!

Regarding the struts stuff not working. The plugin is not really finished
yet, and so far only works for the sample tables actually :(

Sorry about this I'm working on a major rewrite of the struts stuff. This
includes proper relationships and figuring a good way to generate
PK's..

Please just comment out the the <struts> tag in your build.xml file if
you're having problems with it, then go 'ant clean' to get rid of old
stuff.

.eivind
Post by Ravi Deshmukh
Hi Aslak and Eivind,
Yes, I would be happy to be the "Sybase Tester". I have Sybase 11.0.3.3 on Linux. Incidentally
this is a free version of Sybase that is licensed for development AND production use. I found it
very easy to set up, and manage in production, and it lives up to the Sybase reputation for being
fast. Notably, the big advantage over mySql is that Sybase supports transactions. Also there is
full documentation.
OK, until the pkgen feature is released, I'm making the changes to the generated source code
myself.
Also, I'm modifying ejb-jar.xml myself to use the Bean classes instead of the CMP classes.
My build fails at the compile-web task because it can't find a class called
airline.sql.IdGenerator. I don't have a reference to "airline.sql" anywhere in my config files.
Just to make sure it wasn't anything in my config, I ran the sample build.xml, and sure enough it
did generate an IdGenerator.class file, but I couldn't find a corresponding .java file ??
Also in compile-web, there seems to be some mismatch in the create methods. In some cases I get
create(java.lang.Long,java.lang.String,courtIS.interfaces.CourtLocal) in
courtIS.interfaces.BenchLocalHome cannot be applied to (java.lang.Integer,java.lang.String)
create(java.lang.Long,java.lang.String) in courtIS.interfaces.BenchJudgeTypeLocalHome cannot be
applied to (java.lang.Integer,java.lang.String)
It looks like it's not using the create methods correctly where foreign key objects are involved,
and that it is using Integer when generating the xxAction.java code even though the primary key
type is Long.
One minor thing: if you specify your project name (name property in build.xml) to be the same as
[javac] C:\middlegen\samples\build\gen-src\court\web\struts\DeleteCourtAction.java:64: cannot
resolve symbol
[javac] symbol : variable interfaces
[javac] location: interface court.interfaces.CourtLocal
[javac] court = court.interfaces.CourtUtil.getLocalHome().findByPrimaryKey(court_PK);
It took me a while to track it down, but in the above, it thinks "interfaces" is a member of
"court" which is the name of a variable declared earlier in the code ! I changed my project name
to courtIS and it went away.
I did get everything to compile with the sample, and was able to deploy it into WebLogic 7. The
FLIGHTS and PERSONS pages work great, but RESERVATIONS does not. Actually it looks like there's
no code in InsertReservationAction.java ??
OK, should I leave you guys alone for a while now ? :)
Regards,
Ravi
Post by Aslak Hellesoy
Hi again,
-----Original Message-----
Deshmukh
Sent: 31. august 2002 17:11
Subject: Fwd: Re: [Middlegen-user] Can't get it working.
Aslak, I got your email, but before that I had sent the one below
- I got past the metadata
problem.
I tried to use the pkgen feature with the vendorseq option, but
it gave errors stating the pktable
had to be specified. I thought this would not be required if
using the database's automatic
sequence generation (SQL Server IDENTITY). Also it did not
generate the create methods in which
the primary key column is absent. I noticed it is putting in a
"todo" comment that this needs to
be done. Am I too early, is it not implemented yet ?
As Eivind said, not implemented yet. Just pass null if you use pkgen.
I'm also getting an error on weblogic ejbc - something about
Local and LocalHome interfaces being
exposed in remote interface methods (as arguments to create it
looks like). But I'll work on that
http://sourceforge.net/tracker/index.php?func=detail&aid=596249&group_id=360
44&atid=415990
Until it's fixed, you should always specify viewtype="local"
a bit more - it may be because I've specified view="both" and
also checked the local/remote
checkboxes in the gui.
One question - I haven't understood why we need the xxCMP objects
- why not just use the Entity
Bean ?
It's XDoclet that generates the xxCMP Bean subclasses. IIRC it is because
XDoclet also supports BMP and EJB 1.1. This subclass implements the required
abstract methods if they aren't implemented in the Bean class. You can
consider it an implementation detail and ignore it completely.
Don't forget to tell us when you get the struts sample up and running on
JBoss! :-)
Cheers,
Aslak
Ravi
Date: Sat, 31 Aug 2002 04:20:15 -0700 (PDT)
Subject: Re: [Middlegen-user] Can't get it working.
It's working !! Eivind, thanks to your pointer to
getMetaData().getTables(_catalog, _schema, null, _types);
catalog - a catalog name; "" retrieves those without a catalog;
null means drop catalog name
from
the selection criteria
schemaPattern - a schema name pattern; "" retrieves those
without a schema
tableNamePattern - a table name pattern
types - a list of table types to include; null returns all types
Sybase's jConnect implementation needed null for catalog and
schemaPattern. I couldn't figure
out
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
However, after reading how Ant processes Tasks, I realized that
if I removed the "schema"
element
from the middlegen task parameters in build.xml, Ant would not
call setSchema. Looking at the
MiddlegenTask class, this would leave the String _schema as
null. The "catalog" element was
already not being used in build.xml, so I didn't have to do
anything there.
Perhaps it would be appropriate to have a note somewhere about
excluding elements for which you
want null values, unless there's a way to specify null as the
value in the config file ?
Anyway, I was delighted to see it running! I got a nice ER
diagram and was able to set options
in
the GUI, generate the bean classes, and then off it went
generating everything else! Wonderful!
I'm now playing around with specifying local/remote/both, and
the Weblogic pkgen features, and
will also try out the HTML pages for bean testing!
Thanks again guys,
Ravi
Post by Eivind Waaler
Hi Ravi,
Loading...