简体   繁体   English

从weblogic 12c连接到sql server

[英]connection to sql server from weblogic 12c

I developed an application that exposes web services, that application is deployed in weblogic 12c, I call the web services from a java web client, when I run the java client throws this exception: 我开发了一个公开Web服务的应用程序,该应用程序部署在weblogic 12c中,我从Java Web客户端调用该Web服务,当我运行Java客户端时会抛出此异常:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: EJB Exception: ; nested exception is: 
    javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [sqlServer].
Internal Exception: javax.naming.NameNotFoundException: Unable to resolve 'sqlServer'. Resolved ''; remaining name 'sqlServer'
    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
    at $Proxy34.loginService(Unknown Source)
    at main.Main.loginService(Main.java:32)
    at main.Main.main(Main.java:22)

I configure a jdbc resource in Administration Console of Weblogic 12c and the JNDI is named sqlServer... In the application have too a persistence unit xml file, that is the following: 我在Weblogic 12c的管理控制台中配置了一个jdbc资源,并且JNDI名为sqlServer ...在应用程序中也有一个持久性单元xml文件,即以下文件:

<persistence-unit name="BancaSimulacionIBancariaPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>sqlServer</jta-data-source>
    <class>entities.Account</class>
    <class>entities.Bank</class>
    <class>entities.BeneficiaryBankItself</class>
    <class>entities.BeneficiaryThird</class>
    <class>entities.CreditCard</class>
    <class>entities.Movement</class>
    <class>entities.RuleType</class>
    <class>entities.ServiceBank</class>
    <class>entities.TransactionRule</class>
    <class>entities.UserApplication</class>
    <class>entities.Money</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://servertb:1433;databaseName=BancaSimulacion"/>
      <property name="javax.persistence.jdbc.password" value="(*******)"/>
      <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
      <property name="javax.persistence.jdbc.user" value="sa"/>
    </properties>

I put the driver sqljdbc4.jar in the wl_server/lib folder and configure the commEnv.cmd ... I replace the 64sqljdbc.dll for sqljdbc.dll in the same folder wl_server/lib ... 我将驱动程序sqljdbc4.jar放在wl_server/lib文件夹中,并配置commEnv.cmd ...我在同一文件夹wl_server/lib 64sqljdbc.dll sqljdbc.dll64sqljdbc.dll替换为...

But I dont know which is appropriate settings for connection with my database... I test my database and is correct... What is the problem? 但是我不知道哪个是适合与我的数据库连接的设置...我测试了数据库并且是正确的...问题是什么?

Make sure your data source has a target set - otherwise WebLogic won't know about it and it'll throw nasty JNDI (NameNotFoundException) errors. 确保您的数据源具有目标集-否则WebLogic将不知道该目标,它将引发讨厌的JNDI(NameNotFoundException)错误。

Basically, your data source connection has to be 100% correct and functional in order for WebLogic to accept and use it - and that includes ensuring it has a valid target set. 基本上,您的数据源连接必须100%正确且可以正常运行,WebLogic才能接受和使用它-包括确保其具有有效的目标集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Oracle数据库12c访问SQL Server 2014 - Access SQL Server 2014 from Oracle database 12c 如何修复Linked Server从SQL Server 2016到Oracle 12c? - How to fix Linked Server from SQL Server 2016 to Oracle 12c? 如何从SQL Server获取到Oracle 12c的日期? 日期正在倒转(向后) - How can I get a date from SQL Server into Oracle 12c? Dates are being inverted (backwards) 将SQL Server 2012数据库迁移到Oracle 12c - Migration of SQL Server 2012 database to Oracle 12c 无法将autoAutoCommit设置为true-Weblogic 12-SQL Server - Failed to setAutoCommit to true - Weblogic 12 - SQL Server 为什么具有扩展 varchar2 限制的 12c 仍然将 sql server varchar(max) 转换为 long - why 12c with extended varchar2 limit still converting sql server varchar(max) to long SQL Server:对Oracle(11g)而不是12c的前1个查询 - SQL Server : Top 1 query to Oracle (11g) not 12c 与Oracle,计算器HP 12c和Excel相比,SQL Server 2008 R2,功能POWER与SQL SERVER的结果不同 - SQL Server 2008 R2, Function POWER different results in SQL SERVER compared to Oracle, calculator HP 12c and Excel 无法加载驱动程序:com.microsoft.sqlserver.jdbc.SQLServerDriver weblogic 12C - Cannot load driver: com.microsoft.sqlserver.jdbc.SQLServerDriver weblogic 12C 从Oracle 12c到SQLServer 2012的异构数据库链接 - heterogeneous database link from Oracle 12c to SQLServer 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM