You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Jack O'Connor <jo...@bristol.ac.uk> on 2007/06/27 23:33:28 UTC

getting started

Hi, I'm new to Cayenne and have just joined a work group that use it.
Their system is still using Cayenne 1.2.3, so that is the version I
downloaded and unpacked in /home/program_files (in my fresh Fedora 7
Linux installation). They are using the MySQL db, so I also acquired a
JDBC driver (called MySQL Connector/J) and unpacked that in
/home/program_files.

Following the tutorial, I setup Eclipse, then begin working with
Cayenne. After setting CAYENNE_HOME=/home/program_files/cayenne-1.2.3

I open Cayenne by running:
cd [cayenne_distro_dir]/lib/modeler
java -jar cayenne-modeler.jar

Then in Tools>Preferences>ClassPath, I add the file
/home/program_files/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar

Then in Tools>Preferences>Local DataSources, I click New... and create:
Name: DataSource0
Adapter: org.objectstyle.cayenne.dba.mysql.MySQLAdapter

Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb is the
name of a MySQL DB I have created), and Enter my Username and Password
for it. Now, if I click Test..., I get:
Error connecting to DB: Invalid authorization specification message form
server: "Access denied for user 'nobody'@'localhost' (using password: NO)"

If I continue, and click save, then "New Project", the main window is
divided into 2 parts as in the tutorial; on the right is the normal
default screen as in the tutorial, but on the left is on long line:
org.objectstyle.cayenne.access.DataDomain@30ca22d1[name=UntitledDomain]

NB/ each time I go back into Tools>Preferences>Local DataSources, DB URL
has reset to jdbc:mysql://localhost/database, and Username and Password
are blank again.

I would really appreciate any ideas!
Thanks
Jack


Re: getting started

Posted by Jack O'Connor <jo...@bristol.ac.uk>.
Hey, you were right about the problem; the java that comes with fedora 
core linux is not fully compatible with every java application. The 
solution I found was to use JPackage to run 2 versions of java 
simultaneously (2 'alternatives'). Thanks,
Jack

Andrus Adamchik wrote:
> You don't have to remove the GNU Java, just install Sun Java somewhere 
> and make sure that all the executables from Sun JDK are in the path. I 
> usually do it with the "alternatives" command. E.g. (assuming Sun JDK is 
> installed under /usr/lib/jvm/jdk1.5.0_10/):
> 
> alternatives --install /usr/bin/java java 
> /usr/lib/jvm/jdk1.5.0_10/bin/java 1
> alternatives --install /usr/bin/javac javac 
> /usr/lib/jvm/jdk1.5.0_10/bin/javac 1
> alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.5.0_10/bin/jar 1
> alternatives --install /opt/java java-home /usr/lib/jvm/jdk1.5.0_10 1
> 
> Haven't used Core 7 yet, but I assume the configuration steps above 
> should work as well.
> 
> Andrus
> 
> On Jun 28, 2007, at 1:02 PM, Jack O'Connor wrote:
> 
>>> java -version
>> java version "1.5.0"
>> gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)
>>
>> Copyright (C) 2006 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There 
>> is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
>> PURPOSE.
>>
>> Do you think I should remove the java package from the fedora software
>> manager, and manually install the JDK?
>>
>> Thanks,
>> Jack
>>
>>
>> Andrus Adamchik wrote:
>>> Hi Jack,
>>> All this is *very* strange. Are you using JDK that comes with Fedora, 
>>> or did you install Sun JDK? To check do this:
>>> $ java -version
>>> I know in the past the open source Java port included with Fedora was 
>>> unusable (especially with the GUI apps), so Sun Linux JDK must be 
>>> installed.
>>> Andrus
>>> On Jun 28, 2007, at 12:33 AM, Jack O'Connor wrote:
>>>> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb is 
>>>> the
>>>> name of a MySQL DB I have created), and Enter my Username and Password
>>>> for it. Now, if I click Test..., I get:
>>>> Error connecting to DB: Invalid authorization specification message 
>>>> form
>>>> server: "Access denied for user 'nobody'@'localhost' (using 
>>>> password: NO)"
>>>> If I continue, and click save, then "New Project", the main window is
>>>> divided into 2 parts as in the tutorial; on the right is the normal
>>>> default screen as in the tutorial, but on the left is on long line:
>>>> org.objectstyle.cayenne.access.DataDomain@30ca22d1[name=UntitledDomain]
>>>>
>>>> NB/ each time I go back into Tools>Preferences>Local DataSources, DB 
>>>> URL
>>>> has reset to jdbc:mysql://localhost/database, and Username and Password
>>>> are blank again.
>>
>>
>>
> 

Re: getting started

Posted by Andrus Adamchik <an...@objectstyle.org>.
You don't have to remove the GNU Java, just install Sun Java  
somewhere and make sure that all the executables from Sun JDK are in  
the path. I usually do it with the "alternatives" command. E.g.  
(assuming Sun JDK is installed under /usr/lib/jvm/jdk1.5.0_10/):

alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.5.0_10/ 
bin/java 1
alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.5.0_10/ 
bin/javac 1
alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.5.0_10/bin/ 
jar 1
alternatives --install /opt/java java-home /usr/lib/jvm/jdk1.5.0_10 1

Haven't used Core 7 yet, but I assume the configuration steps above  
should work as well.

Andrus

On Jun 28, 2007, at 1:02 PM, Jack O'Connor wrote:

>> java -version
> java version "1.5.0"
> gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)
>
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.   
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
>
> Do you think I should remove the java package from the fedora software
> manager, and manually install the JDK?
>
> Thanks,
> Jack
>
>
> Andrus Adamchik wrote:
>> Hi Jack,
>> All this is *very* strange. Are you using JDK that comes with  
>> Fedora, or did you install Sun JDK? To check do this:
>> $ java -version
>> I know in the past the open source Java port included with Fedora  
>> was unusable (especially with the GUI apps), so Sun Linux JDK must  
>> be installed.
>> Andrus
>> On Jun 28, 2007, at 12:33 AM, Jack O'Connor wrote:
>>> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb  
>>> is the
>>> name of a MySQL DB I have created), and Enter my Username and  
>>> Password
>>> for it. Now, if I click Test..., I get:
>>> Error connecting to DB: Invalid authorization specification  
>>> message form
>>> server: "Access denied for user 'nobody'@'localhost' (using  
>>> password: NO)"
>>> If I continue, and click save, then "New Project", the main  
>>> window is
>>> divided into 2 parts as in the tutorial; on the right is the normal
>>> default screen as in the tutorial, but on the left is on long line:
>>> org.objectstyle.cayenne.access.DataDomain@30ca22d1 
>>> [name=UntitledDomain]
>>>
>>> NB/ each time I go back into Tools>Preferences>Local DataSources,  
>>> DB URL
>>> has reset to jdbc:mysql://localhost/database, and Username and  
>>> Password
>>> are blank again.
>
>
>


Re: getting started

Posted by Jack O'Connor <jo...@bristol.ac.uk>.
>java -version
java version "1.5.0"
gij (GNU libgcj) version 4.1.2 20070502 (Red Hat 4.1.2-12)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Do you think I should remove the java package from the fedora software
manager, and manually install the JDK?

Thanks,
Jack


Andrus Adamchik wrote:
> Hi Jack,
> 
> All this is *very* strange. Are you using JDK that comes with Fedora, or 
> did you install Sun JDK? To check do this:
> 
> $ java -version
> 
> I know in the past the open source Java port included with Fedora was 
> unusable (especially with the GUI apps), so Sun Linux JDK must be 
> installed.
> 
> Andrus
> 
> 
> On Jun 28, 2007, at 12:33 AM, Jack O'Connor wrote:
> 
>> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb is the
>> name of a MySQL DB I have created), and Enter my Username and Password
>> for it. Now, if I click Test..., I get:
>> Error connecting to DB: Invalid authorization specification message form
>> server: "Access denied for user 'nobody'@'localhost' (using password: 
>> NO)"
>> If I continue, and click save, then "New Project", the main window is
>> divided into 2 parts as in the tutorial; on the right is the normal
>> default screen as in the tutorial, but on the left is on long line:
>> org.objectstyle.cayenne.access.DataDomain@30ca22d1[name=UntitledDomain]
>>
>> NB/ each time I go back into Tools>Preferences>Local DataSources, DB URL
>> has reset to jdbc:mysql://localhost/database, and Username and Password
>> are blank again.
> 
> 



Re: getting started

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Jack,

All this is *very* strange. Are you using JDK that comes with Fedora,  
or did you install Sun JDK? To check do this:

$ java -version

I know in the past the open source Java port included with Fedora was  
unusable (especially with the GUI apps), so Sun Linux JDK must be  
installed.

Andrus


On Jun 28, 2007, at 12:33 AM, Jack O'Connor wrote:

> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb  
> is the
> name of a MySQL DB I have created), and Enter my Username and Password
> for it. Now, if I click Test..., I get:
> Error connecting to DB: Invalid authorization specification message  
> form
> server: "Access denied for user 'nobody'@'localhost' (using  
> password: NO)"
> If I continue, and click save, then "New Project", the main window is
> divided into 2 parts as in the tutorial; on the right is the normal
> default screen as in the tutorial, but on the left is on long line:
> org.objectstyle.cayenne.access.DataDomain@30ca22d1 
> [name=UntitledDomain]
>
> NB/ each time I go back into Tools>Preferences>Local DataSources,  
> DB URL
> has reset to jdbc:mysql://localhost/database, and Username and  
> Password
> are blank again.



Re: getting started

Posted by Jack O'Connor <jo...@bristol.ac.uk>.
Hey, problem has just been solved. It was an interesting problem; the 
java that comes with fedora core linux is different to Sun's java, and 
not fully compatible with every java application. The solution is to use 
JPackage to run 2 versions of java simultaneously (2 'alternatives'). 
Thanks,
Jack

Michael Gentry wrote:
> Two silly questions:
> 
> 1) Can you connect using the mysql command prompt?
> 2) Can you connect using another tool (there are many DB plugins for
> Eclipse) that uses a jdbc: type connection string?
> 
> Thanks,
> 
> /dev/mrg
> 
> 
> On 6/27/07, Jack O'Connor <jo...@bristol.ac.uk> wrote:
>> Hi, I'm new to Cayenne and have just joined a work group that use it.
>> Their system is still using Cayenne 1.2.3, so that is the version I
>> downloaded and unpacked in /home/program_files (in my fresh Fedora 7
>> Linux installation). They are using the MySQL db, so I also acquired a
>> JDBC driver (called MySQL Connector/J) and unpacked that in
>> /home/program_files.
>>
>> Following the tutorial, I setup Eclipse, then begin working with
>> Cayenne. After setting CAYENNE_HOME=/home/program_files/cayenne-1.2.3
>>
>> I open Cayenne by running:
>> cd [cayenne_distro_dir]/lib/modeler
>> java -jar cayenne-modeler.jar
>>
>> Then in Tools>Preferences>ClassPath, I add the file
>> /home/program_files/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar 
>>
>>
>> Then in Tools>Preferences>Local DataSources, I click New... and create:
>> Name: DataSource0
>> Adapter: org.objectstyle.cayenne.dba.mysql.MySQLAdapter
>>
>> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb is the
>> name of a MySQL DB I have created), and Enter my Username and Password
>> for it. Now, if I click Test..., I get:
>> Error connecting to DB: Invalid authorization specification message form
>> server: "Access denied for user 'nobody'@'localhost' (using password: 
>> NO)"
>>
>> If I continue, and click save, then "New Project", the main window is
>> divided into 2 parts as in the tutorial; on the right is the normal
>> default screen as in the tutorial, but on the left is on long line:
>> org.objectstyle.cayenne.access.DataDomain@30ca22d1[name=UntitledDomain]
>>
>> NB/ each time I go back into Tools>Preferences>Local DataSources, DB URL
>> has reset to jdbc:mysql://localhost/database, and Username and Password
>> are blank again.
>>
>> I would really appreciate any ideas!
>> Thanks
>> Jack
>>
>>

Re: getting started

Posted by Michael Gentry <bl...@gmail.com>.
Two silly questions:

1) Can you connect using the mysql command prompt?
2) Can you connect using another tool (there are many DB plugins for
Eclipse) that uses a jdbc: type connection string?

Thanks,

/dev/mrg


On 6/27/07, Jack O'Connor <jo...@bristol.ac.uk> wrote:
> Hi, I'm new to Cayenne and have just joined a work group that use it.
> Their system is still using Cayenne 1.2.3, so that is the version I
> downloaded and unpacked in /home/program_files (in my fresh Fedora 7
> Linux installation). They are using the MySQL db, so I also acquired a
> JDBC driver (called MySQL Connector/J) and unpacked that in
> /home/program_files.
>
> Following the tutorial, I setup Eclipse, then begin working with
> Cayenne. After setting CAYENNE_HOME=/home/program_files/cayenne-1.2.3
>
> I open Cayenne by running:
> cd [cayenne_distro_dir]/lib/modeler
> java -jar cayenne-modeler.jar
>
> Then in Tools>Preferences>ClassPath, I add the file
> /home/program_files/mysql-connector-java-3.0.17-ga/mysql-connector-java-3.0.17-ga-bin.jar
>
> Then in Tools>Preferences>Local DataSources, I click New... and create:
> Name: DataSource0
> Adapter: org.objectstyle.cayenne.dba.mysql.MySQLAdapter
>
> Then change DB URL to jdbc:mysql://localhost/jackdb (where jackdb is the
> name of a MySQL DB I have created), and Enter my Username and Password
> for it. Now, if I click Test..., I get:
> Error connecting to DB: Invalid authorization specification message form
> server: "Access denied for user 'nobody'@'localhost' (using password: NO)"
>
> If I continue, and click save, then "New Project", the main window is
> divided into 2 parts as in the tutorial; on the right is the normal
> default screen as in the tutorial, but on the left is on long line:
> org.objectstyle.cayenne.access.DataDomain@30ca22d1[name=UntitledDomain]
>
> NB/ each time I go back into Tools>Preferences>Local DataSources, DB URL
> has reset to jdbc:mysql://localhost/database, and Username and Password
> are blank again.
>
> I would really appreciate any ideas!
> Thanks
> Jack
>
>