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 > <openjpa-3.0.0-r422266:1833209 nonfatal general error> > 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 <openjpa-3.0.0-r422266:1833209 nonfatal general > 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 '<your db name >> 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 <garry.hurley...@gmail.com> >> 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=<your 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 incoming network connections, then leave the line >>> # uncommented to improve system security. >>> #SKIP="--skip-networking" >>> ... >>> >>> >>>> On Jan 4, 2019, at 6:47 AM, Saibabu Vallurupalli < >>> saibabu.vallurupa...@gmail.com> wrote: >>>> your configurations are incorrect is what the error shows and I see >>>> you have got: >>>> >>>> vendorAdapter.database=MYSQL >>>> >>>> This should be : >>>> vendorAdapter.database=MARIADB >>>> >>>> Try changing this. >>>> >>>> Thanks, >>>> Sai >>>> >>>>> On Fri, Jan 4, 2019 at 2:39 AM Marc Chamberlin >>>>> <m...@marcchamberlin.com> >>> wrote: >>>>> (Thanks Benoit, Saibabu, and Simon for taking the time/trouble to >>>>> answer >>>>> my previous question on MySQL. It helped a lot!) >>>>> >>>>> I have managed to get a little further setting up James 3.2.0 Spring >>>>> with MySQL/MariaDB but have ran into a problem which Google is not >>>>> being >>>>> helpful. >>>>> >>>>> I appear to be having troubles with getting a connection going >>>>> between >>>>> James and the MariaDB server. I will provide a description of what I >>>>> have done and then I will show the exception message I am getting >>>>> which >>>>> is stopping James from starting up... >>>>> >>>>> First of all I downloaded the MariaDB Connector/J .jar file from >>>>> https://downloads.mariadb.org/connector-java/ and installed it in the >>>>> conf/lib directory within the James installation. >>>>> >>>>> I then set up a database and user in MariaDB as follows - >>>>> >>>>>> mysql --user=root -p >>>>> MariaDB [mysql]> create database mail; >>>>> MariaDB [mysql]> create user 'james'@'localhost' identified by >>> 'apassword'; >>>>> MariaDB [mysql]> grant all privileges on mail to 'james'@'localhost'; >>>>> >>>>> I also created a system user for james and assigned it the same >>> password. >>>>> Next I edited the james-database.properties file as follows - >>>>> >>>>> database.driverClassName=org.mariadb.jdbc.Driver >>>>> database.url=jdbc:mariadb://127.0.0.1:3306/mail >>>>> database.username=james >>>>> database.password=apassword >>>>> vendorAdapter.database=MYSQL >>>>> openjpa.streaming=false >>>>> datasource.testOnBorrow=true >>>>> datasource.validationQueryTimeoutSec=2 >>>>> datasource.validationQuery=select 1 >>>>> >>>>> Telnetting to localhost port 3306 does show that the mariadb >>>>> server is >>>>> responding but hard to say exactly what is being communicated >>>>> because a >>>>> lot of the text has non-printable characters. I assume it is working >>> OK... >>>>> Upon starting up James I am getting exceptions with a huge amount of >>>>> stack walkback messages, but I will try to capture just what >>>>> appears to >>>>> be relevant - >>>>> >>>>> INFO 22:03:05,852 | >>>>> org.apache.james.domainlist.lib.AbstractDomainList >>>>> | Set autodetectIP to: true >>>>> WARN 22:03:06,000 | >>>>> 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 >>>>> <openjpa-3.0.0-r422266:1833209 nonfatal general error> >>>>> org.apache.openjpa.persis >>>>> tence.PersistenceException: There were errors initializing your >>>>> configuration: <openjpa-3.0.0-r422266:1833209 fatal user error> >>> org.apache. >>>>> openjpa.util.UserException: A connection could not be obtained for >>>>> driver class "null" and URL "null". You may have specified an >>>>> invalid U >>>>> RL. >>>>> at >>>>> >>> org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:272) >>> >>>>> at >>>>> >>> org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:258) >>> >>>>> at >>>>> >>> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:735) >>> >>>>> ... (Lots more trace back messages followed by -) >>>>> Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create >>>>> PoolableConnectionFactory (Access denied for user >>>>> 'james@localhost'@'l >>>>> ocalhost' (using password: YES)) >>>>> at >>>>> >>> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) >>> >>>>> at >>>>> >>> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) >>> >>>>> at >>>>> >>> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) >>> >>>>> and these exceptions/stack trace walkbacks repeat several time in the >>>>> log file. Kinda hard for this poor soul to grok and I sure would >>>>> appreciate it if wiser eyes could provide me with some >>>>> ideas/pointers. I >>>>> would be willing to send the entire log file if that would help, but >>>>> warning it is a LOT! I am missing something simple probably.... >>>>> Thanks >>>>> again in advance for helping me over this bump... >>>>> >>>>> Marc... >>>>> >>>>> >>>>> >>>>> Linux Counter >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org >>>> For additional commands, e-mail: server-user-h...@james.apache.org >>>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org > For additional commands, e-mail: server-user-h...@james.apache.org > -- Linux Counter