Re: A MySQL connection setup issue SOLVED!

2019-01-05 Thread Garry Hurley
Thanks for the heads up on the fix to the specified key length issue.  I
ran into it and recompiled using the 767 byte length, but then my Slackware
build was to test  the jar files for connections to a SQLServer instance,
which has a max key length of 900, so going with 767 worked okay for me.
Glad you got it to work.  I figured it was likely a misconfiguration of
MySQL when you said the URLs matched except for database name.

On Sat, Jan 5, 2019 at 10:24 PM Marc Chamberlin 
wrote:

> Thanks everyone who helped me with getting James and MySQL/MariaDB to
> get along with each other. Upgrading MariaDB from version 10.0 (supplied
> with the OpenSUSE distro) to version 10.3 solved the remaining problems
> I was experiencing. Appears there was a bug in setting table sizes that
> they managed to solve.  I will close this thread and start a new one
> with my next question.
>
> Marc..
>
> On 01/04/2019 03:36 PM, Marc Chamberlin wrote:
> > Hi Garry -  Took quite a bit of sleuthing but I think I have made
> > progress, at least solved one thing only to encounter another... Isn't
> > that the way programming goes? LOL  Anywise it appears I made a
> > mistake in granting privileges in MariaDB, I had executed the following -
> >
> > MariaDB [mysql]> grant all privileges on mail to 'james'@'localhost';
> > whereas it should have been -
> >
> > MariaDB [mysql]> grant all privileges on mail.* to 'james'@'localhost';
> >
> > To insure user james had remote access from my internal network I also
> > issued this command -
> >
> > MariaDB [mail]> grant all privileges on mail.* to
> > 'james'@'192.168.10.%' identified by 'aPassword';
> >
> > Sometime ya just got to love non-intuitive command syntax (and
> > non-intuitive error messages)! So that got me past the previous set of
> > exceptions I was experiencing only to land me in this muddle -
> >
> > WARN  14:28:38,933 |
> > org.apache.james.container.spring.context.JamesServerApplicationContext
> > | Exception encountered during context initial
> > ization - cancelling refresh attempt:
> > org.springframework.beans.factory.UnsatisfiedDependencyException:
> > Error creating bean with name 'auth
> > enticator' defined in class path resource
> > [META-INF/org/apache/james/spring-mailbox-authenticator.xml]:
> > Unsatisfied dependency expressed th
> > rough constructor argument with index 0 of type
> > [org.apache.james.user.api.UsersRepository]: : Error creating bean
> > with name 'usersreposito
> > ry': Invocation of init method failed; nested exception is
> > 
> > org.apache.openjpa.persis
> > tence.PersistenceException: (conn=10) Specified key was too long; max
> > key length is 767 bytes {stmnt 515268797 CREATE TABLE JAMES_MAIL_REPO
> > S (MAIL_REPO_NAME VARCHAR(1024) NOT NULL, PRIMARY KEY
> > (MAIL_REPO_NAME)) ENGINE = innodb} [code=1071, state=42000]; nested
> > exception is org.
> > springframework.beans.factory.BeanCreationException: Error creating
> > bean with name 'usersrepository': Invocation of init method failed; nes
> > ted exception is  > error> org.apache.openjpa.persistence.PersistenceException: (conn=10)
> > Spec
> > ified key was too long; max key length is 767 bytes {stmnt 515268797
> > CREATE TABLE JAMES_MAIL_REPOS (MAIL_REPO_NAME VARCHAR(1024) NOT NULL,
> > PRIMARY KEY (MAIL_REPO_NAME)) ENGINE = innodb} [code=1071, state=42000]
> >
> > Uhhh "Specified key was too long; max key length is 767 bytes"???
> > What in the world is this talking about? Google makes it sound like
> > another MySQL issue?
> >
> > I am not groking what you are saying about the JPA classes not
> > working, or what symptoms I will see. Sounds ominous...  Have I
> > reached the point where I will have to create the tables manually?
> >
> > Thanks again for all your help... Marc...
> >
> >
> > On 1/4/19 6:29 AM, Garry Hurley wrote:
> >> A few things I forgot to mention, make sure you have granted your user
> >> access to log in remotely, and that you have created whatever
> >> database you
> >> want to connect to (just do the create database ' >> here>'; and
> >> it will work). Also, once you get past that point, you will likely find
> >> that the JPA classes don't work.  That is fixed in the current code
> >> stream.I doubt it has been backcported to 3.2.0, so be advised.  If you
> >> need scripts for creating the tables manually, I have them. exported
> >> from
> >> SQL Server, but the DDL scripts should not be too different, just
> >> reach out
> >> to me and I will pop them into an email.
> >>
> >>
> >> On Fri, Jan 4, 2019 at 9:16 AM Garry Hurley 
> >> wrote:
> >>
> >>> The vendor class on the driver is supposed to match, but also be
> >>> certain you are using Mariadb and not MySQL database and MariaDB
> >>> client in your Linux distro. My config, which does work in the current
> >>> branch (3.3.0 SNAPSHOT), is as follows.  It goes without saying that
> >>> your mileage my vary, and that I am using Slackware Linux, so your
> >>> mileage may vary.
> >>>
> >>> ...
> >>> # Use 

Re: A MySQL connection setup issue SOLVED!

2019-01-05 Thread Marc Chamberlin
Thanks everyone who helped me with getting James and MySQL/MariaDB to
get along with each other. Upgrading MariaDB from version 10.0 (supplied
with the OpenSUSE distro) to version 10.3 solved the remaining problems
I was experiencing. Appears there was a bug in setting table sizes that
they managed to solve.  I will close this thread and start a new one
with my next question.

    Marc..

On 01/04/2019 03:36 PM, Marc Chamberlin wrote:
> Hi Garry -  Took quite a bit of sleuthing but I think I have made
> progress, at least solved one thing only to encounter another... Isn't
> that the way programming goes? LOL  Anywise it appears I made a
> mistake in granting privileges in MariaDB, I had executed the following -
>
> MariaDB [mysql]> grant all privileges on mail to 'james'@'localhost';
> whereas it should have been -
>
> MariaDB [mysql]> grant all privileges on mail.* to 'james'@'localhost';
>
> To insure user james had remote access from my internal network I also
> issued this command -
>
> MariaDB [mail]> grant all privileges on mail.* to
> 'james'@'192.168.10.%' identified by 'aPassword';
>
> Sometime ya just got to love non-intuitive command syntax (and
> non-intuitive error messages)! So that got me past the previous set of
> exceptions I was experiencing only to land me in this muddle -
>
> WARN  14:28:38,933 |
> org.apache.james.container.spring.context.JamesServerApplicationContext
> | Exception encountered during context initial
> ization - cancelling refresh attempt:
> org.springframework.beans.factory.UnsatisfiedDependencyException:
> Error creating bean with name 'auth
> enticator' defined in class path resource
> [META-INF/org/apache/james/spring-mailbox-authenticator.xml]:
> Unsatisfied dependency expressed th
> rough constructor argument with index 0 of type
> [org.apache.james.user.api.UsersRepository]: : Error creating bean
> with name 'usersreposito
> ry': Invocation of init method failed; nested exception is
> 
> org.apache.openjpa.persis
> tence.PersistenceException: (conn=10) Specified key was too long; max
> key length is 767 bytes {stmnt 515268797 CREATE TABLE JAMES_MAIL_REPO
> S (MAIL_REPO_NAME VARCHAR(1024) NOT NULL, PRIMARY KEY
> (MAIL_REPO_NAME)) ENGINE = innodb} [code=1071, state=42000]; nested
> exception is org.
> springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'usersrepository': Invocation of init method failed; nes
> ted exception is  error> org.apache.openjpa.persistence.PersistenceException: (conn=10)
> Spec
> ified key was too long; max key length is 767 bytes {stmnt 515268797
> CREATE TABLE JAMES_MAIL_REPOS (MAIL_REPO_NAME VARCHAR(1024) NOT NULL,
> PRIMARY KEY (MAIL_REPO_NAME)) ENGINE = innodb} [code=1071, state=42000]
>
> Uhhh "Specified key was too long; max key length is 767 bytes"??? 
> What in the world is this talking about? Google makes it sound like
> another MySQL issue?
>
> I am not groking what you are saying about the JPA classes not
> working, or what symptoms I will see. Sounds ominous...  Have I
> reached the point where I will have to create the tables manually?
>
> Thanks again for all your help... Marc...
>
>
> On 1/4/19 6:29 AM, Garry Hurley wrote:
>> A few things I forgot to mention, make sure you have granted your user
>> access to log in remotely, and that you have created whatever
>> database you
>> want to connect to (just do the create database '> here>'; and
>> it will work). Also, once you get past that point, you will likely find
>> that the JPA classes don't work.  That is fixed in the current code
>> stream.I doubt it has been backcported to 3.2.0, so be advised.  If you
>> need scripts for creating the tables manually, I have them. exported
>> from
>> SQL Server, but the DDL scripts should not be too different, just
>> reach out
>> to me and I will pop them into an email.
>>
>>
>> On Fri, Jan 4, 2019 at 9:16 AM Garry Hurley 
>> wrote:
>>
>>> The vendor class on the driver is supposed to match, but also be
>>> certain you are using Mariadb and not MySQL database and MariaDB
>>> client in your Linux distro. My config, which does work in the current
>>> branch (3.3.0 SNAPSHOT), is as follows.  It goes without saying that
>>> your mileage my vary, and that I am using Slackware Linux, so your
>>> mileage may vary.
>>>
>>> ...
>>> # Use derby as default
>>> database.driverClassName=org.mariadb.jdbc.Driver
>>> database.url=jdbc:mariadb://localhost:3306/maildb
>>> database.username=james
>>> database.password=
>>>
>>> # Supported adapters are:
>>> # DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL,
>>> SQL_SERVER,
>>> SYBASE
>>> vendorAdapter.database=MYSQL
>>>
>>> ...
>>>
>>>
>>> Make sure, however, that your database is configured to allow network
>>> connections.  Change your rc.mysqld (or comparable one if your Linux
>>> distro is inferior to Slackware ;) ) script to read as follows:
>>> ...
>>> # To allow outside connections to the database comment out the next
>>> line.
>>> # If you don't need