简体   繁体   English

连接到websphere内的jndi错误

[英]Connecting to jndi within websphere error

I'm in a little debacle and was looking at any assistance 我有点崩溃,正在寻找任何帮助

I have a simple JPA application that is connected to a database and am receiving an error in websphere that I'm failing to understand. 我有一个简单的JPA应用程序连接到数据库,并在websphere中收到我无法理解的错误。

[1/25/16 10:55:46:950 CST] 0000001c SystemOut 0  CalSMTJPA  INFO
[WebContainer : 0] openjpa.Runtime - Starting OpenJPA 1.2.1-SNAPSHOT+OPENJPA-679-Final 
[1/25/16 10:55:46:950 CST] 0000001c SystemOut O 15  CalSMTJPA  INFO   [WebContainer : 0] 
openjpa.jdbc.JDBC - Using dictionary class "com.ibm.ws.persistence.jdbc.sql.SQLServerDictionary" (Microsoft SQL Server 11.00.5058 ,Microsoft SQL Server JDBC Driver 2.0 2.0.1803.100). 
[1/25/16 10:55:46:950 CST] 0000001c servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: 
Uncaught exception created in one of the service methods of the servlet /Home.jsp in application CalSMTEAR. 
Exception created : <openjpa-1.2.1-SNAPSHOT+OPENJPA-679-Final-r422266:746282 nonfatal general error>

****org.apache.openjpa.persistence.PersistenceException: For input string: "JDBC"****

at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:42)
at com.ibm.ws.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:27)
at entities.controller.PlatformsManager.getEntityManager(PlatformsManager.java:43)
at entities.controller.PlatformsManager.getPlatforms(PlatformsManager.java:136)
at com.ibm._jsp._Home._jspService(_Home.java:90)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1461)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:793)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:444)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:121)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:234)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:337)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3622)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:927)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1566)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:175)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

Caused by: java.lang.NumberFormatException: For input string: "JDBC" 引起:java.lang.NumberFormatException:对于输入字符串:“JDBC”

The error from OpenJPA appears to be caused by it incorrectly trying to use the dictionary for MS SQLServer to connect to the database you're using. OpenJPA的错误似乎是由于它错误地尝试使用MS SQLServer的字典连接到您正在使用的数据库。 If you're specifying the 如果你要指定

<property name="openjpa.jdbc.DBDictionary" value=" org.apache.openjpa.jdbc.sql.SQLServerDictionary "/>

property in your persistence.xml, you need to update that with the correct dictionary for the database and driver you're using, see http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_dbsetup_dbsupport.html for details. 在persistence.xml中的属性,您需要使用正在使用的数据库和驱动程序的字典更新它,请参阅http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_dbsetup_dbsupport .html了解详情。 If you're not specifying the property in your persistence.xml and letting OpenJPA try to auto-detect it, try specifying the property in your persistence.xml and assign it the appropriate value for the database vendor to which you're connecting. 如果您没有在persistence.xml中指定该属性并让OpenJPA尝试自动检测它,请尝试在persistence.xml中指定该属性,并为您要连接的数据库供应商分配适当的值。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM