tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eborn, Eric D" <eric.d.eb...@lmco.com>
Subject RE: Help with Tuscany Customer's Demo using MySQL
Date Wed, 05 Sep 2007 13:52:48 GMT
Additional progress:

Making the following additional changes to the Customers.xml file
allowed the program to create the graph it seems, at least it is
displaying the select all customers results now in the console:
		
    <Command name="AllCustomers" SQL="select * from CUSTOMER"
kind="Select">
	<ResultDescriptor columnName="ID" tableName="MYCUSTOMER"
columnType="commonj.sdo.Int"/>
	<ResultDescriptor columnName="LASTNAME" tableName="CUSTOMER"
columnType="commonj.sdo.String"/>
	<ResultDescriptor columnName="ADDRESS" tableName="CUSTOMER"
columnType="commonj.sdo.String"/>
    </Command>

    <Table tableName="CUSTOMER">
        <Column columnName = "ID" primaryKey="true" />
        <Column columnName = "LASTNAME" />
        <Column columnName = "ADDRESS" />
    </Table>


HOWEVER, note that I now get this error message:

[java] Result:insert new customer
[java] Exception in thread "main" java.lang.IllegalArgumentException:
Class 'CUSTOMER' does not have a feature named 'ID'
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.setFeatureName(DataO
bjectUtil.java:2104)
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUt
il.java:2247)
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.
java:1968)
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUti
l.java:1883)
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUti
l.java:1877)
[java]     at
org.apache.tuscany.sdo.util.DataObjectUtil.setInt(DataObjectUtil.java:52
7)
[java]     at
org.apache.tuscany.sdo.impl.DataObjectImpl.setInt(DataObjectImpl.java:52
5)
[java]     at
org.apache.tuscany.samples.das.customer.CustomerClient.addCustomer(Custo
merClient.java:173)
[java]     at
org.apache.tuscany.samples.das.customer.CustomerClient.main(CustomerClie
nt.java:126)
[java] Java Result: 1

Stemming from the        newCustomer.setInt("ID", 5);    command.  (even
when I change the order to setString first, it says there is no LASTNAME
feature...

    public final void addCustomer() {
        Command read = das.getCommand("AllCustomers");
        DataObject root = read.executeQuery();

        DataObject newCustomer = root.createDataObject("CUSTOMER");
        newCustomer.setInt("ID", 5);
        newCustomer.setString("LASTNAME", "Jenny");
        newCustomer.setString("ADDRESS", "USA");

        das.applyChanges(root);
    }

Por Favor!!!!



> -----Original Message-----
> From: Eborn, Eric D
> Sent: Wednesday, September 05, 2007 7:34 AM
> To: tuscany-user@ws.apache.org
> Subject: RE: Help with Tuscany Customer's Demo using MySQL
> 
> I've had little luck with my remaining problem, however, any idea what
> java.lang.IllegalArgumentException: Class 'CUSTOMER' does not have a
> feature named 'ID' means I've done?
> 
> It's creating the database, but perhaps never correctly constructing
the
> data graph?
> 
> If you notice, the program output is supposed to display the four
lines
> of db entries after each operation (as it does using derby), but with
> mysql, none. :(
> 
> I was reading about oracle and das this morning:
> https://issues.apache.org/jira/browse/TUSCANY-1355
> 
> Is this problem applicable?  I may tinker with those ideas in the
> meantime.  Plz help, seems like it would be a common issue when
dealing
> with mysql.  Especially since it's the most basic of the demos!
> 
> -Eric
> 
> > -----Original Message-----
> > From: Luciano Resende [mailto:luckbr1975@gmail.com]
> > Sent: Tuesday, September 04, 2007 3:01 PM
> > To: tuscany-user@ws.apache.org
> > Subject: Re: Help with Tuscany Customer's Demo using MySQL
> >
> > Thanks Eric, I'll update the customer.xml and steps on the readme
for
> > better/simpler support of MySQL
> >
> > On 9/4/07, Eborn, Eric D <eric.d.eborn@lmco.com> wrote:
> > > I never explained how I got over the other errors... sorry.
> Basically I
> > > just had to peck at the Customers.xml config file.  It seems
rather
> > > outdated, perhaps someone could permanently modify the example
> download
> > > for future users, I made the following changes:
> > >
> > >                <ConnectionInfo>
> > >                        <ConnectionProperties
> > >                                driverClass="com.mysql.jdbc.Driver"
> > >                                password="foobar"
> > >                                userName="root"
> > >
> > > databaseURL="jdbc:mysql://localhost:3306/dastest"
> > >                                loginTimeout="600000">
> > >                        </ConnectionProperties>
> > >                </ConnectionInfo>
> > >
> > > Note the difference:
> > >
>
https://svn.apache.org/repos/asf/incubator/tuscany/java/das/samples/cust
> > > omer/src/main/resources/Customers.xml
> > >
> > > Make sure that you've downloaded an installed the proper
> Connector/J,
> > > and that you have the path in your CLASSPATH env variable or copy
> the
> > > jar to your JAVA_HOME/lib/ext dir.
> > >
> > > Also you'll likely have to manually create the dastest database in
> mysql
> > > (leave it empty (without any tables), just create the db).
> > >
> > > > -----Original Message-----
> > > > From: Eborn, Eric D
> > > > Sent: Tuesday, September 04, 2007 12:31 PM
> > > > To: tuscany-user@ws.apache.org
> > > > Subject: RE: Help with Tuscany Customer's Demo using MySQL
> > > >
> > > > Update:
> > > >
> > > > I bypassed these errors as I will explain below.
> > > >
> > > > NOW I have new errors :)  It seems to start running correctly,
> I've
> > > > confirmed that it creates the dastest table CUSTOMER.  And fills
> it
> > > with
> > > > 4 records.  However, it fails in CustomerClient.java at the
line:
> '171
> > > > newCustomer.setInt("ID", 5);'
> > > >
> > > > I had read in another message:
> > > >
> > >
>
http://mail-archives.apache.org/mod_mbox/ws-tuscany-dev/200706.mbox/%3C1
> > > > 2618336.1182999811606.JavaMail.jira@brutus%3E
> > > > Exception in thread "main" java.lang.IllegalArgumentException:
> Class
> > > > 'DataGraphRoot'
> > > > does not have a feature named 'MYCUSTOMER'... which is similar,
> but
> > > > seemed to stem from his use of oracle or SQLServer (not mysql).
> Any
> > > > additional help is welcome... In the meantime, I'll continue to
> work
> > > at
> > > > it.
> > > >
> > > > (error messages as follows)
> > > >
> > > >
> > >
>
D:\data\eeborn\Desktop\tuscany-das-1.0-incubating-beta1\samples\customer
> > > > >ant
> > > > Buildfile: build.xml
> > > >
> > > > build:
> > > >     [javac] Compiling 1 source file to
> > > >
> > >
>
D:\data\eeborn\Desktop\tuscany-das-1.0-incubating-beta1\samples\customer
> > > >
> > > > run:
> > > >      [java] ********************** connection info from config
> file
> > > > ************************
> > > >      [java] databaseURL:jdbc:mysql://localhost:3306/dastest
> > > > userName:root password:foobar
> > > >      [java]
> > > >
> > >
>
************************************************************************
> > > > ********
> > > >      [java] [Messages.java 3params:
> > > > getBundle(com.mysql.jdbc.LocalizedErrorMessages)
> > > >      [java] Setting up for mysql run!
> > > >      [java] Dropping tables
> > > >      [java] Dropping procedures
> > > >      [java] Creating tables
> > > >      [java] Creating procedures
> > > >      [java] Inserting data in tables
> > > >      [java] Database setup complete!
> > > >      [java] log4j:WARN No appenders could be found for logger
> > > > (org.apache.tuscany.das.rdb.impl.Parameters).
> > > >      [java] log4j:WARN Please initialize the log4j system
> properly.
> > > >      [java] Result:select all customers
> > > >      [java] Result:insert new customer
> > > >      [java] Exception in thread "main"
> > > > java.lang.IllegalArgumentException: Class 'CUSTOMER' does not
have
> a
> > > > feature named 'ID'
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.setFeatureName(DataO
> > > > bjectUtil.java:2104)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.process(DataObjectUt
> > > > il.java:2247)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.init(DataObjectUtil.
> > > > java:1968)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUti
> > > > l.java:1883)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil$Accessor.create(DataObjectUti
> > > > l.java:1877)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.util.DataObjectUtil.setInt(DataObjectUtil.java:52
> > > > 7)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.sdo.impl.DataObjectImpl.setInt(DataObjectImpl.java:52
> > > > 5)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.samples.das.customer.CustomerClient.addCustomer(Custo
> > > > merClient.java:172)
> > > >      [java]     at
> > > >
> > >
>
org.apache.tuscany.samples.das.customer.CustomerClient.main(CustomerClie
> > > > nt.java:126)
> > > >      [java] Java Result: 1
> > > >
> > > > BUILD SUCCESSFUL
> > > > Total time: 2 seconds
> > > >
> > > > > -----Original Message-----
> > > > > From: Eborn, Eric D
> > > > > Sent: Tuesday, September 04, 2007 11:36 AM
> > > > > To: tuscany-user@ws.apache.org
> > > > > Subject: Help with Tuscany Customer's Demo using MySQL
> > > > >
> > > > > I've run the demo using Derby, however, I've been unsuccessful
> in
> > > > doing
> > > > > so with MySQL.
> > > > >
> > > > >
> > > > >
> > > > > I'm running the latest mysql and connector/J, downloaded them
> this
> > > > week.
> > > > >
> > > > > Please advise.
> > > > >
> > > > >
> > > > >
> > > > > When I comment out the Derby config and uncomment the MySql
> config,
> > > I
> > > > > get the following error:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > BUILD SUCCESSFUL
> > > > >
> > > > > Total time: 0 seconds
> > > > >
> > > > > D:\data\eeborn\Desktop\TUSCAN~1.0-I\samples\customer>ant
> > > > >
> > > > > Buildfile: build.xml
> > > > >
> > > > >
> > > > >
> > > > > run:
> > > > >
> > > > >      [java] Exception in thread "main"
> java.lang.RuntimeException:
> > > > >
> > > > > org.eclipse.emf.ecore.resource.Resource$IOWrappedException:
> Feature
> > > > > 'user' not foun
> > > > >
> > > > > d. (http:///temp.xml <http://temp.xml> , 50, 33)
> > > > >
> > > > >
> > > > >
> > > > >      [java]     at
> > > > >
> > > > >
> > > >
> > >
>
org.apache.tuscany.das.rdb.util.ConfigUtil.loadConfig(ConfigUtil.java:54
> > > > > )
> > > > >
> > > > >
> > > > >
> > > > >      [java]     at
> > > > >
> > > > >
> > > >
> > >
>
org.apache.tuscany.samples.das.customer.CustomerClient.main(CustomerClie
> > > > > nt.java:86)
> > > > >
> > > > >
> > > > >
> > > > >      [java] Caused by:
> > > > >
> > > > > org.eclipse.emf.ecore.resource.Resource$IOWrappedException:
> Feature
> > > > > 'user' not found. (http:///temp.xml <http://temp.xml> , 50,
33)
> > > > >
> > > > > ....90 more
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > I have this config Customers.xml
> > > > >
> > > > >
> > > > >
> > > > >             <!--Uncomment below for MySQL test-->
> > > > >
> > > > >                         <ConnectionInfo>
> > > > >
> > > > >                                     <ConnectionProperties
> > > > >
> > > > >
> > > > driverClass="com.mysql.jdbc.Driver"
> > > > >
> > > > >
> > > > >
> > > > > databaseURL="jdbc:mysql://localhost:3306/test"
> > > > >
> > > > >                                 user="root"
> > > > >
> > > > >                                 password="foobar"
> > > > >
> > > > >                                 loginTimeout="600000">
> > > > >
> > > > >                             </ConnectionProperties>
> > > > >
> > > > >                         </ConnectionInfo>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >                         <!-- ConnectionInfo
> > > > >
> > > > > dataSource="java:comp/env/jdbc/dastest"    THIS SECTION IS
> COMMENTED
> > > > OUT
> > > > >
> > > > >
> > > > > contextAvailable="false">
> > > > >
> > > > >
> > > > >
> > > > >                         <ConnectionProperties
> > > > >
> > > > >
dataSourceClass="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
> > > > >
> > > > >                                     user="root"
> > > > >
> > > > >                                     password="foobar"
> > > > >
> > > > >
> > > > key="193-155-248-97-234-56-100-241"
> > > > >
> > > > >                                     databaseName="test"
> > > > >
> > > > >                                     loginTimeout="600000">
> > > > >
> > > > >                         </ConnectionProperties>
> > > > >
> > > > >                         </ConnectionInfo -->
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > The section of the config that is commented out also fails
with:
> > > > >
> > > > >
> > > > >
> > > > > run:
> > > > >
> > > > >
> > > > >
> > > > >      [java] Exception in thread "main"
> java.lang.RuntimeException:
> > > > >
> > > > > org.eclipse.emf.ecore.resource.Resource$IOWrappedException:
> Feature
> > > > > 'contextAvailab
> > > > >
> > > > >
> > > > >
> > > > > le' not found. (http:///temp.xml <http://temp.xml> , 55, 30)
> > > > >
> > > > >
> > > > >
> > > > >      [java]     at
> > > > >
> > > > >
> > > >
> > >
>
org.apache.tuscany.das.rdb.util.ConfigUtil.loadConfig(ConfigUtil.java:54
> > > > >
> > > > > )
> > > > >
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> > >
> > >
> >
> >
> > --
> > Luciano Resende
> > Apache Tuscany Committer
> > http://people.apache.org/~lresende
> > http://lresende.blogspot.com/
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org


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


Mime
View raw message