Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

null pointer from external mysql datasource connection

$
0
0
Hi All,

trying to define an external datasource
and to connect to the external mysql-database,
ofbiz states a "null-pointer exception".

Here is the datasource, which I appended into
framework/entity/config/entityengine.xml:

<datasource name="test_mysql"
helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
field-type-name="mysql"
check-on-start="true"
add-missing-on-start="true"
check-pks-on-start="false"
use-foreign-keys="true"
join-style="ansi-no-parenthesis"
alias-view-columns="false"
drop-fk-use-foreign-key-keyword="true"
table-type="InnoDB"
character-set="latin1"
collate="latin1_general_cs">
<read-data reader-name="main"/>
<inline-jdbc
jdbc-driver="com.mysql.jdbc.Driver"
jdbc-uri="jdbc:mysql://localhost/wp_platfo"
jdbc-username="root"
jdbc-password=""
isolation-level="ReadCommitted"
pool-minsize="2"
pool-maxsize="250"
time-between-eviction-runs-millis="600000"/>
</datasource>

Calling https://localhost:8443/webtools/control/view/ModelInduceFromDb
with test_mysql as paramenter

the server returns a "java.lang.NullPointerException".

In ofbiz.log I found this lines:

20141203140027648 |-0.0.0.0-8443-exec-3 |DatabaseUtil |E| Unable
to establish a connection with the database for helperName
[test_mysql]... Error was: org.ofbiz.entity.GenericEntityException:
com.mysql.jdbc.Driver (com.mysql.jdbc.Driver)
20141203140027648 |-0.0.0.0-8443-exec-3 |DatabaseUtil |E| Unable
to establish a connection with the database, no additional information
available.
20141203140027650 |-0.0.0.0-8443-exec-3 |JspViewHandler |E|
ServletException rendering JSP view

Otherwise a simple java demo like this:

Class.forName("com.mysql.jdbc.Driver");
String host = "localhost";
String user = "root";
String pass = "";
String db = "wp_platfo";
String conString = "jdbc:mysql://" + host + "/" + db + "";
Connection con = DriverManager.getConnection(conString, user, pass);

System.out.println("conString: " + conString);

connects without problems (I simply copied the conString into the
ofbiz-engines jdbc-uri field, so this should work!?).

Why could the connection fail?

Thank you!

Viewing all articles
Browse latest Browse all 5648

Trending Articles