Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'The user must supply a JDBC connection' on weblogic restart

I am using Weblogic 11. After initial deployment of all JMS configurations, JDBC configuration (from XADS-jdbc.xml) and ears everything works properly.

But after weblogic restart application fails to initialize with error

Caused By: java.lang.UnsupportedOperationException: The user must supply a JDBC connection
 at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:54)
 at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
 at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:130)
 at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:349)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
 at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
 at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)...

According to log JDBC and EAR start their initialization simultaniously. So when EAR tries to validate DB scheme JDBC configuration initialization is not completed yet.

What could fix such situation? Are there any weblogic configurations using which deployment items initialization could be ordered?

Thanks in Advance.

persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
    xmlns="http://java.sun.com/xml/ns/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">
<persistence-unit name="TestDSPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/testN/test/TestXADS</jta-data-source>
    <mapping-file>META-INF/orm.xml</mapping-file>
    <properties>
        <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"/>  -->
        <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> 
        <property name="hibernate.max_fetch_depth" value="3"/>
        <!-- <property name="hibernate.cache.use_query_cache" value="true"/> -->
        <property name="hibernate.cache.region_prefix" value="hibernate.test"/>
        <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
        <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
        <property name="show_sql" value="true"/>
        <property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
        <property name="hibernate.hbm2ddl.auto" value="validate" /> 
    </properties>
</persistence-unit>
like image 336
Marija Avatar asked Dec 20 '10 17:12

Marija


1 Answers

Did you try creating the JDBC connections through admin console? If not, please try creating the data source through admin console. Once done, open your config.xml, you should see something like below:

      <jdbc-system-resource>
        <name>TestXADS</name>
        <target>AdminServer</target>
        <descriptor-file-name>jdbc/TestXADS-jdbc.xml</descriptor-file-name>
      </jdbc-system-resource>

Please Note: The outer node should be <jdbc-system-resource >

like image 69
Yogendra Singh Avatar answered Nov 12 '22 07:11

Yogendra Singh