Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-20707

After upgrade from Wildfly-35.0.0.Final to 36.0.1.Final application is not coming up due to following error "Caused by: javax.naming.NameNotFoundException: sampleEMF -- service jboss.naming.context.java.sampleEMF"}}}}"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Critical Critical
    • None
    • 36.0.1.Final
    • CDI / Weld, JPA / Hibernate
    • None
    • ---
    • ---
    • Application Services Performance & Scalability

      Hi Team,

      First i would like to thank your support.

      As we have the deliverables in this week so i marked this as critical, 

      We upgraded our application from Wildfly-35.0.0.Final to Wildfly-36.0.1.Final, after upgrading we started seeing the below error.

       

      Issue is occurring when application is trying to do the ctx.lookup("java:/sampleEMF")

      @PostConstruct
          public void init() throws NamingException
          {
              InitialContext ic = new InitialContext();
              
              *emf = (EntityManagerFactory) ic.lookup("java:/sampleEMF");*
              ut  = (UserTransaction)      ic.lookup("java:jboss/UserTransaction");
          }
      

      I defined the persistance.xml file as below:

       

      <persistence xmlns="https://jakarta.ee/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
      version="3.0">
       
      <persistence-unit name="sample" transaction-type="JTA">
      <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
      <jta-data-source>java:/sampleDS</jta-data-source>
      <mapping-file>/META-INF/${sam.db.type}/orm.xml</mapping-file>
      <properties>
      <property name="hibernate.dialect"                          value="${drg.db.dialect}" />
      <property name="hibernate.show_sql"                         value="false" />
      <property name="hibernate.format_sql"                       value="true" />
      <property name="jboss.entity.manager.factory.jndi.name"     value="java:/sampleEMF"/>
      <property name="hibernate.cache.use_second_level_cache"     value="false"/>
      <property name="hibernate.jpa.compliance.query" value="false"/>
      </properties>
      </persistence-unit>
      </persistence>
      

       

      Datasource in the standalone.xml file as below:

                  <datasources>
                      <xa-datasource jndi-name="java:/sampleDS" pool-name="dragonPool">
                          <xa-datasource-property name="URL">
                              ${drg.db.url}
                          </xa-datasource-property>
                          <xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
                          <driver>mysql-jdbc-driver.jar</driver>
                          <xa-pool>
                              <min-pool-size>10</min-pool-size>
                              <max-pool-size>100</max-pool-size>
                              <no-tx-separate-pools>true</no-tx-separate-pools>
                          </xa-pool>
                          <security user-name="${drg.db.user}" password="${drg.db.pass}"/>
                          <validation>
                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
                          </validation>
                      </xa-datasource>
                  </datasources>
      
       

      Exception:

      Caused by: java.lang.reflect.InvocationTargetException
          Caused by: javax.naming.NameNotFoundException: sampleEMF -- service jboss.naming.context.java.sampleEMF"}}
      2025-06-11 11:10:41,095|ERROR|management-handler-thread - 2|management-operation     |WFLYCTL0013: Operation ("deploy") failed - address: (\{"deployment" => "sample-query.ear"}) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"sample-query.ear\".WeldStartService" => "Failed to start service
          Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-000049: Unable to invoke public void com.cp.booster.server.query.domain.Supervisor.start() throws java.lang.Exception on com.cp.booster.server.sample.domain.Supervisor@7b349af8
          Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void com.cp.booster.server.sample.domain.Supervisor.start() throws java.lang.Exception on com.cp.booster.server.sample.domain.Supervisor@7b349af8
          Caused by: java.lang.reflect.InvocationTargetException
          Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke public void com.cp.booster.server.common.domain.repository.flow.FlowRepository.start() throws java.lang.Exception on com.cp.booster.server.common.domain.repository.flow.FlowRepository@15008ec9 
      

       

      could you please help me what i am doing wrong.

       

      Thanks,

      Khaja Mohiddin SHaik

        1. server.log
          696 kB
          KHAJA MOHIDDIN

              smarlow1@redhat.com Scott Marlow
              khaja.mohiddin33 KHAJA MOHIDDIN (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: