-
1. Re: Exception in wildfly13 java.util.NoSuchElementException after loading the DB.jndi.properties
jewellgm Sep 19, 2019 8:32 AM (in response to animesh.sahani)The architecture between JBoss AS 5 and wildfly is vastly different. The specific error that you are seeing has a good chance to be due to the datasource not being deployed. With wildfly, the datasource has to be defined within the standalone.xml (or domain.xml, depending on which profile you are utilizing). Additionally, the ojdbc jar file has to be configured as a module now, and not deployed as part of your application.
See:
6.7.5. Example Oracle Datasource JBoss Enterprise Application Platform 6 | Red Hat Customer Portal
-
2. Re: Exception in wildfly13 java.util.NoSuchElementException after loading the DB.jndi.properties
animesh.sahani Sep 20, 2019 2:20 AM (in response to jewellgm)Thanks @Greg for the prompt reply.
I have one more doubt, i.e, I have a db.jndi.properties deployed and have environments details which has to match the ds.xml file or else it is throwing error like subcontext not found.
And the problem is in the code it has reference like below:
String propertiesFileName = "/db.jndi.properties";
props = new Properties();
String path = System.getProperty("jboss.server.config.dir");
String propertiesPath = path + propertiesFileName;
try
{
FileInputStream fis = new FileInputStream(propertiesPath);
props.load(fis);
System.out.println("********** Loaded application properties from file: " + propertiesPath);
so , i doubt if i remove the ds.xml file and place all the datasource details in standalone.xml will it work ?
-
3. Re: Exception in wildfly13 java.util.NoSuchElementException after loading the DB.jndi.properties
jewellgm Sep 23, 2019 9:27 AM (in response to animesh.sahani)I believe it is possible to deploy the driver as a jboss module, and then define that driver in standalone.xml. You application could then mark that driver module as a dependency. After that, you can use your ds.xml in your application to establish the connection. The ds.xml would probably have to reference the driver by the driver name as defined in the standalone.xml.
I think that older versions of wildfly did allow this sort of configuration, but that it was deprecated. It's possible that WF 13 doesn't support it anymore.
-
4. Re: Exception in wildfly13 java.util.NoSuchElementException after loading the DB.jndi.properties
animesh.sahani Sep 25, 2019 3:16 AM (in response to jewellgm)Hi. I tried with the possibility but the server is not starting in this scenario. Also I have tried putting the below in the standalone.xml to pick up the ds.xml file:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
<deployment-scanner name="new-external-deployment-scanner" path="/opt/wildfly/server/deployments" scan-interval="5000" />
</subsystem>
But the same issue again.