emresahin
emresahin

Reputation: 53

Widfly 24 parse exception in the xml file

I am migrating my wildfly server 10 to 24. I am using some .properties files to use initiliaze variables for later use. But after running wildfly 24 I got this error:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."app-service-2.2.14-SNAPSHOT.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app-service-2.2.14-SNAPSHOT.war".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "app-service-2.2.14-SNAPSHOT.war" at [email protected]//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189) at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739) at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701) at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559) at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.base/java.lang.Thread.run(Thread.java:833)

Caused by:

org.jboss.as.server.deployment.DeploymentUnitProcessingException: IJ010058: ${DB_MIN_POOL_SIZE} isn't a valid number for element min-pool-size at [email protected]//org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:105) at [email protected]//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182) ... 8 more Caused by: org.jboss.jca.common.metadata.ParserException: IJ010058: ${DB_MIN_POOL_SIZE} isn't a valid number for element min-pool-size at [email protected]//org.jboss.jca.common.metadata.common.AbstractParser.elementAsInteger(AbstractParser.java:233) at [email protected]//org.jboss.jca.common.metadata.ds.DsParser.parsePool(DsParser.java:663) at [email protected]//org.jboss.jca.common.metadata.ds.DsParser.parseDataSource(DsParser.java:1165) at [email protected]//org.jboss.jca.common.metadata.ds.DsParser.parseDataSources(DsParser.java:177) at [email protected]//org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:120) at [email protected]//org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:79) at [email protected]//org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:90) ... 9 more

app-ds.xml -->

<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://www.jboss.org/ironjacamar/schema/datasources_1_1.xsd">
   <datasource jndi-name="java:jboss/datasources/appDS"
      pool-name="app-connection-pool" enabled="true" use-java-context="true">
      <connection-url>${APP_DB_JDBC_URL}</connection-url>
      
      <driver>${APP_DB_JDBC_DRIVER}</driver>
      
      <pool>
        <min-pool-size>${APP_DB_MIN_POOL_SIZE}</min-pool-size>
        <max-pool-size>${APP_DB_MAX_POOL_SIZE}</max-pool-size>
        <prefill>true</prefill>
      </pool>

      <security>
         <user-name>${APP_DB_USERNAME}</user-name>
         <password>${APP_DB_PASSWORD}</password>
      </security>

      <transaction-isolation>TRANSACTION_READ_UNCOMMITTED</transaction-isolation>

      <!-- 
        These setting use a background thread to verify connections periodically. Using
        validate-on-match/false disables verifying the connection with each use.  The
        "ping" comment is a hint to some JDBC implementations to skip parsing and contact
        the SQL server directory, a slight optimization over SELECT 1 -->   
      <validation>
         <background-validation>true</background-validation>
         <background-validation-millis>60000</background-validation-millis> 
         <check-valid-connection-sql>/* ping */ SELECT 1;</check-valid-connection-sql>
         <validate-on-match>false</validate-on-match> 
      </validation>

   </datasource>
</datasources>
 

When I check my WAR file my initiliazation file for all variables is in the WAR. DB_MIN_POOL_SIZE variable also initiliazed. But my app-ds.xml file is not getting the variables from properties file. It just can not read it. I am thinking maybe ironjacamar jar is not working correctly for me because these error coming from it. I will try ironjacamar version in wildfly 10 for the wildfly 24.

I am open to any suggestions , thanks.

Upvotes: 0

Views: 301

Answers (1)

ehsavoie
ehsavoie

Reputation: 3527

You need to allow expression resolution in the descriptors. This is done via the jboss-cli:

/subsystem=ee:write-attribute(name=jboss-descriptor-property-replacement, value=true)
/subsystem=ee:write-attribute(name=spec-descriptor-property-replacement, value=true)

Upvotes: 0

Related Questions