Derby to MYSQL connector location?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Derby to MYSQL connector location?

Shane F. MacIntyre

OS: Ubuntu 18.04
MYSQL Version: 5.7.23

I added localmysql, localmysqolap and localmysqltenant databases to mysql server with ofbiz user permissions added to them.
I modified the entityengine.xml to reflect the delegator changes, and verified that the datasource user and pass was right for the databases I had created.
I downloaded the latest JDBC connector from Oracle, but do not have the /framework/entity/lib/jdbc path referenced in https://cwiki.apache.org/confluence/display/OFBIZ/How+to+migrate+OfBiz+from+Derby+to+MySQL+database .
I do have /framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc. So I blindly tried putting the connector driver in there, but I get errors (see snippet below).

2018-09-13 16:07:19,880 |OFBiz-JobPoller      |GenericDelegator              |E| Failure in findListIteratorByCondition operation for entity [DynamicView]: org.apache.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver). Rolling back transaction.
org.apache.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
        at org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:93) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.transaction.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:79) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:1105) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:1006) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.datasource.GenericHelperDAO.findCountByCondition(GenericHelperDAO.java:149) ~[ofbiz.jar:?]
        at org.apache.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:1657) [ofbiz.jar:?]
        at org.apache.ofbiz.service.job.JobManager.isAvailable(JobManager.java:154) [ofbiz.jar:?]
        at org.apache.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_181]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_181]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_181]
        at org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:90) ~[ofbiz.jar:?]
        ... 10 more


Any help as to where to put the connector would be greatly appreciated.

-Shane MacIntyre
Reply | Threaded
Open this post in threaded view
|

Re: Derby to MYSQL connector location?

taher
Hi Shane,

Multiple options exist for you:
- Place the DB driver jar in $OFBIZ_HOME/lib
- Place the DB driver jar in "lib" directory of any component
- Add the DB driver as a dependency in build.gradle. Go to JCenter and
find the latest driver compatible with your database to achieve this
step.
On Thu, Sep 13, 2018 at 7:14 PM Shane F. MacIntyre
<[hidden email]> wrote:

>
>
> OS: Ubuntu 18.04
> MYSQL Version: 5.7.23
>
> I added localmysql, localmysqolap and localmysqltenant databases to mysql server with ofbiz user permissions added to them.
> I modified the entityengine.xml to reflect the delegator changes, and verified that the datasource user and pass was right for the databases I had created.
> I downloaded the latest JDBC connector from Oracle, but do not have the /framework/entity/lib/jdbc path referenced in https://cwiki.apache.org/confluence/display/OFBIZ/How+to+migrate+OfBiz+from+Derby+to+MySQL+database .
> I do have /framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc. So I blindly tried putting the connector driver in there, but I get errors (see snippet below).
>
> 2018-09-13 16:07:19,880 |OFBiz-JobPoller      |GenericDelegator              |E| Failure in findListIteratorByCondition operation for entity [DynamicView]: org.apache.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver). Rolling back transaction.
> org.apache.ofbiz.entity.GenericEntityException: com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
>         at org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:93) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.transaction.GeronimoTransactionFactory.getConnection(GeronimoTransactionFactory.java:79) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:260) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.jdbc.SQLProcessor.prepareStatement(SQLProcessor.java:366) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:1105) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.datasource.GenericDAO.selectCountByCondition(GenericDAO.java:1006) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.datasource.GenericHelperDAO.findCountByCondition(GenericHelperDAO.java:149) ~[ofbiz.jar:?]
>         at org.apache.ofbiz.entity.GenericDelegator.findCountByCondition(GenericDelegator.java:1657) [ofbiz.jar:?]
>         at org.apache.ofbiz.service.job.JobManager.isAvailable(JobManager.java:154) [ofbiz.jar:?]
>         at org.apache.ofbiz.service.job.JobPoller$JobManagerPoller.run(JobPoller.java:223) [ofbiz.jar:?]
>         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
> Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_181]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_181]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_181]
>         at java.lang.Class.forName0(Native Method) ~[?:1.8.0_181]
>         at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_181]
>         at org.apache.ofbiz.entity.connection.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:90) ~[ofbiz.jar:?]
>         ... 10 more
>
>
> Any help as to where to put the connector would be greatly appreciated.
>
> -Shane MacIntyre