Hi,
I searched too much to solve this problem, but whatever I did I couldn't get rid of this exception.
Quote:
"javax.ejb.EJBException : EJB Exception: ; nested exception is:
java.lang.UnsupportedOperationException: The user must supply a JDBC connection"
I am using Oracle Weblogic 10.3 as application server and trying to use a MySQL data source.
My configuration is as following:In my EAR project, under META-INF, I created a data source MysqlDS2-jdbc.xml;
Code:
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-jdbc.xsd"
xmlns="http://www.bea.com/ns/weblogic/jdbc-data-source">
<name>MysqlDS2</name>
<jdbc-driver-params>
<url>jdbc:mysql://localhost:3306/test</url>
<driver-name>com.mysql.jdbc.Driver</driver-name>
<properties>
<property>
<name>user</name>
<value>root</value>
</property>
</properties>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<test-table-name>SQL SELECT 1</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>MysqlDS2</jndi-name>
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>
Also, under the EAR project, to weblogic-application.xml, I added this data source as a module as following;
Code:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
<!-- server-version: 10.3.0 -->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:module>
<wls:name>MysqlDS2</wls:name>
<wls:type>JDBC</wls:type>
<wls:path>META-INF/MysqlDS2-jdbc.xml</wls:path>
</wls:module>
</wls:weblogic-application>
In my EJB3 project, under META-INF, my persistence.xml is as following;
Code:
<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="project" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/app/jdbc/MysqlDS2</jta-data-source>
<properties>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
</properties>
</persistence-unit>
</persistence>
In addition to these xml configurations, I added all hibernate related jars to my classpath (I did both ways, one is adding them to EAR project APP-INF/lib folder and adding them to Weblogic's lib).
So, where am I doing things wrong, I can't see it really?
Thanks for your replies.