WebLogic error: Unable to acquire JDBC Connection












0















I have a strange exception with WebLogic 12.2.1.3, Hibernate 5.3, Sprnig Data JPA, and Java EE.



I have a database, and a Generic JDBC Data source in weblogic, with the JNDI name of jdbc/UsersDS.



When I'm trying to list the entries in it, I get a really long exception, which I don't really want to paste in here, so I used Pastebin: Here it is. Pls let me know, if I should instead paste it here anyway.



I have the exact same setup for this artefact, then what I have for another one, which connects to the same server, but to a different database, with different user. That one works like a charm, this one doesn't. The only difference I can think of being related to this is the fact that the artefact, where I get the error from has Spring Data Redis included as a dependency alongside Spring Data JPA.



Persistence.xml:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="UsersDS" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/UsersDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="javax.transaction.TransactionManager"/>
<property name="hibernate.transaction.jta.platform" value="Weblogic"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
</properties>
</persistence-unit>
</persistence>


Ui.: One more thing that might be related to the problem is because I have both Spring Data JPA and Redis on the classpath, I had to mark the JpaRepository interface as a @NoRepositoryBean, because I'd get a duplicate otherwise. So I have a method to produce the CDI Repository Bean:



    @Inject
private EntityManager entityManager;

@Produces
@RequestScoped
public UserRepository userRepository() {
return createRepository(UserRepository.class);
}

private <T extends Repository> T createRepository(Class<T> repositoryClass) {
RepositoryFactorySupport factory = new JpaRepositoryFactory(entityManager);
return factory.getRepository(repositoryClass);
}


UI2.: I also wrote some integration tests with a H2 in memory database and everything runs smoothly










share|improve this question

























  • I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

    – László Stahorszki
    Nov 15 '18 at 15:07













  • may you post also spring configuration?

    – Angelo Immediata
    Nov 15 '18 at 16:37











  • there is no spring configuration. This is a CDI environment

    – László Stahorszki
    Nov 15 '18 at 16:39











  • So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

    – M. Deinum
    Nov 15 '18 at 16:40











  • yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

    – László Stahorszki
    Nov 15 '18 at 16:42
















0















I have a strange exception with WebLogic 12.2.1.3, Hibernate 5.3, Sprnig Data JPA, and Java EE.



I have a database, and a Generic JDBC Data source in weblogic, with the JNDI name of jdbc/UsersDS.



When I'm trying to list the entries in it, I get a really long exception, which I don't really want to paste in here, so I used Pastebin: Here it is. Pls let me know, if I should instead paste it here anyway.



I have the exact same setup for this artefact, then what I have for another one, which connects to the same server, but to a different database, with different user. That one works like a charm, this one doesn't. The only difference I can think of being related to this is the fact that the artefact, where I get the error from has Spring Data Redis included as a dependency alongside Spring Data JPA.



Persistence.xml:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="UsersDS" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/UsersDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="javax.transaction.TransactionManager"/>
<property name="hibernate.transaction.jta.platform" value="Weblogic"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
</properties>
</persistence-unit>
</persistence>


Ui.: One more thing that might be related to the problem is because I have both Spring Data JPA and Redis on the classpath, I had to mark the JpaRepository interface as a @NoRepositoryBean, because I'd get a duplicate otherwise. So I have a method to produce the CDI Repository Bean:



    @Inject
private EntityManager entityManager;

@Produces
@RequestScoped
public UserRepository userRepository() {
return createRepository(UserRepository.class);
}

private <T extends Repository> T createRepository(Class<T> repositoryClass) {
RepositoryFactorySupport factory = new JpaRepositoryFactory(entityManager);
return factory.getRepository(repositoryClass);
}


UI2.: I also wrote some integration tests with a H2 in memory database and everything runs smoothly










share|improve this question

























  • I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

    – László Stahorszki
    Nov 15 '18 at 15:07













  • may you post also spring configuration?

    – Angelo Immediata
    Nov 15 '18 at 16:37











  • there is no spring configuration. This is a CDI environment

    – László Stahorszki
    Nov 15 '18 at 16:39











  • So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

    – M. Deinum
    Nov 15 '18 at 16:40











  • yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

    – László Stahorszki
    Nov 15 '18 at 16:42














0












0








0








I have a strange exception with WebLogic 12.2.1.3, Hibernate 5.3, Sprnig Data JPA, and Java EE.



I have a database, and a Generic JDBC Data source in weblogic, with the JNDI name of jdbc/UsersDS.



When I'm trying to list the entries in it, I get a really long exception, which I don't really want to paste in here, so I used Pastebin: Here it is. Pls let me know, if I should instead paste it here anyway.



I have the exact same setup for this artefact, then what I have for another one, which connects to the same server, but to a different database, with different user. That one works like a charm, this one doesn't. The only difference I can think of being related to this is the fact that the artefact, where I get the error from has Spring Data Redis included as a dependency alongside Spring Data JPA.



Persistence.xml:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="UsersDS" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/UsersDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="javax.transaction.TransactionManager"/>
<property name="hibernate.transaction.jta.platform" value="Weblogic"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
</properties>
</persistence-unit>
</persistence>


Ui.: One more thing that might be related to the problem is because I have both Spring Data JPA and Redis on the classpath, I had to mark the JpaRepository interface as a @NoRepositoryBean, because I'd get a duplicate otherwise. So I have a method to produce the CDI Repository Bean:



    @Inject
private EntityManager entityManager;

@Produces
@RequestScoped
public UserRepository userRepository() {
return createRepository(UserRepository.class);
}

private <T extends Repository> T createRepository(Class<T> repositoryClass) {
RepositoryFactorySupport factory = new JpaRepositoryFactory(entityManager);
return factory.getRepository(repositoryClass);
}


UI2.: I also wrote some integration tests with a H2 in memory database and everything runs smoothly










share|improve this question
















I have a strange exception with WebLogic 12.2.1.3, Hibernate 5.3, Sprnig Data JPA, and Java EE.



I have a database, and a Generic JDBC Data source in weblogic, with the JNDI name of jdbc/UsersDS.



When I'm trying to list the entries in it, I get a really long exception, which I don't really want to paste in here, so I used Pastebin: Here it is. Pls let me know, if I should instead paste it here anyway.



I have the exact same setup for this artefact, then what I have for another one, which connects to the same server, but to a different database, with different user. That one works like a charm, this one doesn't. The only difference I can think of being related to this is the fact that the artefact, where I get the error from has Spring Data Redis included as a dependency alongside Spring Data JPA.



Persistence.xml:



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="UsersDS" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/UsersDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.factory_class"
value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.manager_lookup_class" value="javax.transaction.TransactionManager"/>
<property name="hibernate.transaction.jta.platform" value="Weblogic"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
</properties>
</persistence-unit>
</persistence>


Ui.: One more thing that might be related to the problem is because I have both Spring Data JPA and Redis on the classpath, I had to mark the JpaRepository interface as a @NoRepositoryBean, because I'd get a duplicate otherwise. So I have a method to produce the CDI Repository Bean:



    @Inject
private EntityManager entityManager;

@Produces
@RequestScoped
public UserRepository userRepository() {
return createRepository(UserRepository.class);
}

private <T extends Repository> T createRepository(Class<T> repositoryClass) {
RepositoryFactorySupport factory = new JpaRepositoryFactory(entityManager);
return factory.getRepository(repositoryClass);
}


UI2.: I also wrote some integration tests with a H2 in memory database and everything runs smoothly







java spring java-ee weblogic weblogic12c






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 17:23







László Stahorszki

















asked Nov 15 '18 at 14:50









László StahorszkiLászló Stahorszki

366212




366212













  • I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

    – László Stahorszki
    Nov 15 '18 at 15:07













  • may you post also spring configuration?

    – Angelo Immediata
    Nov 15 '18 at 16:37











  • there is no spring configuration. This is a CDI environment

    – László Stahorszki
    Nov 15 '18 at 16:39











  • So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

    – M. Deinum
    Nov 15 '18 at 16:40











  • yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

    – László Stahorszki
    Nov 15 '18 at 16:42



















  • I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

    – László Stahorszki
    Nov 15 '18 at 15:07













  • may you post also spring configuration?

    – Angelo Immediata
    Nov 15 '18 at 16:37











  • there is no spring configuration. This is a CDI environment

    – László Stahorszki
    Nov 15 '18 at 16:39











  • So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

    – M. Deinum
    Nov 15 '18 at 16:40











  • yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

    – László Stahorszki
    Nov 15 '18 at 16:42

















I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

– László Stahorszki
Nov 15 '18 at 15:07







I found this line in the log: SessionFactoryRegistry - Not binding SessionFactory to JNDI, no JNDI name configured Does this mean anything? The table in the database does get created tho

– László Stahorszki
Nov 15 '18 at 15:07















may you post also spring configuration?

– Angelo Immediata
Nov 15 '18 at 16:37





may you post also spring configuration?

– Angelo Immediata
Nov 15 '18 at 16:37













there is no spring configuration. This is a CDI environment

– László Stahorszki
Nov 15 '18 at 16:39





there is no spring configuration. This is a CDI environment

– László Stahorszki
Nov 15 '18 at 16:39













So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

– M. Deinum
Nov 15 '18 at 16:40





So you want to use jdbc/UsersDS but have jdbc/FiveshellyD in your configuration. Which is wrong.

– M. Deinum
Nov 15 '18 at 16:40













yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

– László Stahorszki
Nov 15 '18 at 16:42





yeah, sorry I forgot to edit that, I fixed the config couple minutes after posting. I replaced UsersDS to FiveshellyDS, because I know that that datasource works, because it works with the other artefact

– László Stahorszki
Nov 15 '18 at 16:42












1 Answer
1






active

oldest

votes


















0














I have the solution, and it's probably some workaround, or sg, but I have nothing else.



So what happened, was I had (by default) in the weblogic datasource global transactions on. Switching it off solved the problem






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53322056%2fweblogic-error-unable-to-acquire-jdbc-connection%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I have the solution, and it's probably some workaround, or sg, but I have nothing else.



    So what happened, was I had (by default) in the weblogic datasource global transactions on. Switching it off solved the problem






    share|improve this answer




























      0














      I have the solution, and it's probably some workaround, or sg, but I have nothing else.



      So what happened, was I had (by default) in the weblogic datasource global transactions on. Switching it off solved the problem






      share|improve this answer


























        0












        0








        0







        I have the solution, and it's probably some workaround, or sg, but I have nothing else.



        So what happened, was I had (by default) in the weblogic datasource global transactions on. Switching it off solved the problem






        share|improve this answer













        I have the solution, and it's probably some workaround, or sg, but I have nothing else.



        So what happened, was I had (by default) in the weblogic datasource global transactions on. Switching it off solved the problem







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 20 '18 at 21:37









        László StahorszkiLászló Stahorszki

        366212




        366212
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53322056%2fweblogic-error-unable-to-acquire-jdbc-connection%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly