2

Am trying to add resources to my glassfish via xml file, but am getting the following errors

Outputs:

Via web: An error has occurred The system cannot find the path specified: An error has occurred The system cannot find the path specified:

Via asadmin: remote failure: The system cannot find the path specified: Usersmedocumentsglassfish-resourcesdev-resources.xml Command add-resources failed.

When running from webconsole/asdmin by netbeans outputs the following: GUI deployment: uploadToTempfile|#] RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4848/management/domain/resources/add-resources'; attrs = '{id=, target=server}'|#]

My xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 4.1 Resource Definitions//EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_4.dtd">
<resources>
  <!-- connection pool -->
  <jdbc-connection-pool datasource-classname="com.microsoft.sqlserver.jdbc.SQLServerDataSource"
                        name="abc-dev-pool" 
                        res-type="javax.sql.DataSource">
    <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
    <property name="User" value="USER_Dev"/>
    <property name="Password" value="Password_Dev"/>
    <property name="URL" value="jdbc:sqlserver://192.168.1.1:1433"/>
    <property name="DatabaseName" value="db_dev"/>
  </jdbc-connection-pool>
  <!-- jdbc resource -->
  <jdbc-resource jndi-name="jdbc/pnfe" pool-name="abc-dev-pool"/>
  <!-- multitenancy -->
  <custom-resource factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" jndi-name="conf/flagMT" res-type="java.lang.Boolean">
    <property name="value" value="false"/>
  </custom-resource>
  <custom-resource factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" jndi-name="conf/mtTenantResolverWeb" res-type="java.lang.String">
    <property name="value" value="pt.ano.pnfe.multitenancy.hibernate.UserCurrentTenantIdentifierResolver"/>
  </custom-resource>
  <custom-resource factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory" jndi-name="conf/mtTenantResolverScheduler" res-type="java.lang.String">
    <property name="value" value="pt.ano.pnfe.webscheduler.mt.JobCurrentTenantIdentifierResolver"/>
  </custom-resource>
  <custom-resource factory-class="org.glassfish.resources.custom.factory.PropertiesFactory" jndi-name="conf/mtProperties" res-type="java.util.Properties">
    <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
    <property name="autoCommitOnClose" value="true"/>
    <property name="acquireIncrement" value="5"/>
    <property name="maxStatements" value="2000"/>
    <property name="minPoolSize" value="0"/>
    <property name="maxPoolSize" value="20"/>
    <property name="numHelperThreads" value="6"/>
    <property name="maxIdleTime" value="3600"/>
    <property name="maxIdleTimeExcessConnections" value="600"/>
    <property name="unreturnedConnectionTimeout" value="90"/>
    <property name="debugUnreturnedConnectionStackTraces" value="true"/>
    <property name="idleConnectionTestPeriod" value="180"/>
    <property name="preferredTestQuery" value="select 1+1 from moedas"/>
  </custom-resource>
</resources>

Am running on Glassfish 5.1 and netbeans 11.3.

On glassfish 4.1.1 it works fine.

Connection to a MSSQL server

Note: Some sensitive information has been changed

I have tried to use the xml in the answer of this question but it also didnt work Glassfish 5.1.0 error when adding resources from web console

EDIT:

It seems that something change in the resources format from 4 to 5? Being that glassfish dosent understand something in my file / the xml on the other stackoverflow post?

  • Having same issue while i add-resource for my local glassfish it works fine , but while i do same thing for glassfish in docker container it give cant find specified path any updates on it – babbin tandukar Jan 05 '21 at 06:29

0 Answers0