Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server Jetty与SQL Server 2017数据源_Sql Server_Jetty - Fatal编程技术网

Sql server Jetty与SQL Server 2017数据源

Sql server Jetty与SQL Server 2017数据源,sql-server,jetty,Sql Server,Jetty,我有一个本地MS SQL Server 2017(14.0.3006),我想在我的Hibernate应用程序中使用它,我通过Jetty托管它。我在Oracle上运行了相同的应用程序(它运行得很好),现在正尝试使用MS SQL。因此,我在我的jetty env.xml中有以下配置(我也尝试了很多变体,例如,但它们都产生了相同的错误): 用户 密码 数据库名 本地\u计算机\u名称\SQLEXPRESS 1433 在mypom.xml中,我有相应的依赖项: net.sourceforge.jt

我有一个本地MS SQL Server 2017(14.0.3006),我想在我的Hibernate应用程序中使用它,我通过Jetty托管它。我在Oracle上运行了相同的应用程序(它运行得很好),现在正尝试使用MS SQL。因此,我在我的
jetty env.xml
中有以下配置(我也尝试了很多变体,例如,但它们都产生了相同的错误):


用户
密码
数据库名
本地\u计算机\u名称\SQLEXPRESS
1433
在my
pom.xml
中,我有相应的依赖项:


net.sourceforge.jtds
jtds
1.3.1
这会导致以下错误:

Failure: net.sourceforge.jtds.jdbcx.JtdsDataSource
日志上方显示一条警告:

[WARNING] Config error at <New id="mydb" class="org.eclipse.jetty.plus.jndi.Resource"><Arg/><Arg>jdbc/mydb</Arg><Arg>
      <New class="net.sourceforge.jtds.jdbcx.JtdsDataSource"><Set name="User">user</Set><Set name="Password">password</Set><Set name="DatabaseName">databaseName</Set><Set name="ServerName">LOCAL_COMPUTER_NAME\SQLEXPRESS</Set><Set name="PortNumber">1433</Set></New>
    </Arg></New>
我无法显示整个原始的
jetty env.xml
,因为它包含机密信息。它类似于堆栈跟踪:

[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Application ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 505 resources
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ Application ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 481 source files to C:\Path\Application\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Application ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Path\Application\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ Application ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Path\Application\target\test-classes
[INFO] 
[INFO] <<< jetty-maven-plugin:9.2.21.v20170120:run (default-cli) < test-compile @ Application <<<
[INFO] 
[INFO] 
[INFO] --- jetty-maven-plugin:9.2.21.v20170120:run (default-cli) @ Application ---
[INFO] Logging initialized @32640ms
[INFO] Configuring Jetty for project: Application
[INFO] Plugin classpath augmented with <scope>provided</scope> dependencies: [file:/C:/Users/User/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar, file:/C:/Users/User/.m2/repository/org/apache/tapestry/tapestry-javadoc/5.4.3/tapestry-javadoc-5.4.3.jar, file:/C:/Users/User/.m2/repository/com/oracle/jdbc/ojdbc7/12.1.0.2.0/ojdbc7-12.1.0.2.0.jar, file:/C:/Users/User/.m2/repository/com/db/websso-api/1.2.2/websso-api-1.2.2.jar]
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = C:\Path\Application\target\classes
[INFO] Configuring Jetty from xml configuration file = C:\Path\Application\target\classes\jetty-env.xml
[WARNING] Config error at <New id="mydb" class="org.eclipse.jetty.plus.jndi.Resource"><Arg/><Arg>jdbc/mydb</Arg><Arg>
      <New class="net.sourceforge.jtds.jdbcx.JtdsDataSource"><Set name="User">user</Set><Set name="Password">password</Set><Set name="DatabaseName">databaseName</Set><Set name="ServerName">LOCAL_COMPUTER_NAME\SQLEXPRESS</Set><Set name="PortNumber">1433</Set></New>
    </Arg></New>
[INFO] Jetty server exiting.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  30.290 s
[INFO] Finished at: 2020-01-20T14:58:44+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.2.21.v20170120:run (default-cli) on project Application: Failure: net.sourceforge.jtds.jdbcx.JtdsDataSource -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Disconnected from the target VM, address: '127.0.0.1:49800', transport: 'socket'
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@Application---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]正在复制505资源
[信息]正在复制14个资源
[信息]
[信息]---maven编译器插件:3.0:compile(默认编译)@Application---
[信息]检测到更改-重新编译模块!
[INFO]正在将481个源文件编译为C:\Path\Application\target\classes
[信息]
[信息]---maven资源插件:2.6:testResources(默认testResources)@Application---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]跳过不存在的资源目录C:\Path\Application\src\test\resources
[信息]
[信息]---maven编译器插件:3.0:testCompile(默认testCompile)@Application---
[信息]检测到更改-重新编译模块!
[INFO]正在将1个源文件编译为C:\Path\Application\target\test类
[信息]
[INFO]我用


com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:sqlserver://NUC-GWG190602\SQLEXPRESS;数据库=ECM_DM;integratedSecurity=true
ECMS_DM
ecms_dm

相反。我仍然不知道为什么它以前不起作用,但至少现在起作用了。

您能展示更多jetty-env.xml配置吗?还有更多关于错误的stacktrace?还有可能是您的jetty.base
--列表配置
输出?@JoakimErdfelt我编辑了我的问题。