[英]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.dll
的64sqljdbc.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.