Java Glassfish 5.1罐';不要增加资源
我试图通过xml文件向我的glassfish添加资源,但出现以下错误 产出: 通过web:发生错误系统找不到指定的路径:发生错误 系统找不到指定的路径: 通过asadmin:远程故障:系统找不到指定的路径:Usersmedocumentsglassfish-resourcesdev-resources.xml 命令添加资源失败 当netbeans从webconsole/asdmin运行时,输出以下内容: GUI部署:上传TotempFile |#] getResponse()给出失败消息。端点http://localhost:4848/management/domain/resources/add-资源';attrs='{id=,target=server}'|#] 我的xml文件:Java Glassfish 5.1罐';不要增加资源,java,sql-server,netbeans,glassfish,Java,Sql Server,Netbeans,Glassfish,我试图通过xml文件向我的glassfish添加资源,但出现以下错误 产出: 通过web:发生错误系统找不到指定的路径:发生错误 系统找不到指定的路径: 通过asadmin:远程故障:系统找不到指定的路径:Usersmedocumentsglassfish-resourcesdev-resources.xml 命令添加资源失败 当netbeans从webconsole/asdmin运行时,输出以下内容: GUI部署:上传TotempFile |#] getResponse()给出失败消息。端点h
<?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>
我在Glassfish 5.1和netbeans 11.3上运行
在glassfish 4.1.1中,它可以正常工作
连接到MSSQL服务器
注意:某些敏感信息已更改
我曾尝试在回答这个问题时使用xml,但它也不起作用
编辑:
似乎资源格式从4变为5?因为glassfish不理解我的文件/另一篇stackoverflow帖子上的xml中的某些内容?在我为本地glassfish添加资源时也有同样的问题,但效果很好,但当我在docker容器中为glassfish做同样的事情时,它给出找不到指定路径的任何更新。当我为本地glassfish添加资源时,它工作正常,但当我在docker容器中为glassfish做同样的事情时,它给出找不到指定路径的任何更新