当前位置: 首页 > 知识库问答 >
问题:

ORA-01017从TOMCAT迁移到WebSphere时,用户名/密码无效IBM

阳兴朝
2023-03-14

我们正在将war文件从TOMCAT迁移到IBMWebSphere8.5。5应用服务器。它在TOMCAT上运行良好,但在IBM中抛出“无效用户名/密码登录被拒绝”错误是错误的。我在web中配置了正确的数据源。xml和持久性。xml。我还与我们的服务器管理员进行了检查,他确认数据源是正确的,并且能够使用相同的方法成功地进行测试。不确定是否需要在此处添加/更改IBM WAAS 8.5的任何配置。请告知。

网状物xml

<resource-ref>
  <description>Example datasource</description>
  <res-ref-name>jdbc/exampleDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
  <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

坚持不懈xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
         version="2.0">
<persistence-unit name="sample">
  <provider>org.hibernate.ejb.HibernatePersistence</provider>
  <jta-data-source>jdbc/exampleDS</jta-data-source>
  <class>com.hibernate.test.Example</class>
  <properties>
     <property name="hibernate.default_schema" value="XXXXXX"/>
     <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
     <property name="hibernate.show_sql" value="true"/>
     <property name="hibernate.format_sql" value="true"/>
     <property name="hibernate.hbm2ddl.auto" value="update"/>
   </properties>
  </persistence-unit>
</persistence>

项目结构:

ExampleRestService.war
  - WEB-INF/classes
    - com/hibernate/test/Resource
    - com/hibernate/test/Application
    - log4j.properties
  - WEB-INF/lib
    - hibernate-commons-annotations-4.0.1.Final.jar
    - hibernate-core-4.1.1.Final.jar
    - hibernate-entitymanager-4.1.1.Final.jar
    - hibernate-jpa-2.0-api-1.0.1.Final.jar
    - jackson-core-asl-1.7.1.jar
    - jackson-jaxrs-1.7.1.jar
    - jackson-mapper-asl-1.7.1.jar
    - jackson-xc-1.7.1.jar
    - javassist-3.15.0.GA.jar
    - jboss-transaction-api_1.1_spec-1.0.0.Final.jar
    - jersey-apache-client-1.8.jar
    - jersey-atom-abdera-1.8.jar
    - jersey-client-1.8.jar
    - jersey-core-1.8.jar
    - jersey-guice-1.8.jar
    - jersey-multipart-1.8.jar
    - jersey-server-1.8.jar
    - jersey-simple-server-1.8.jar
    - jersey-spring-1.8.jar
    - jettison-1.2.jar
    - jettison-1.1.jar
    - jsr173_api.jar
    - jsr311-api-1.1.1.jar
    - ojdbc6.jar
    - postgresql-8.3-603.jdbc3.jar
    - ExampleLibrary.jar
  - ExampleLibrary.jar/META-INF/Persistence.xml
  - web/WEB-INF/web.xml

更新:添加stacktrcae

12/14/16 09:19:50.916    000000D2    com.ibm.ws.webcontainer.webapp    SEVERE    com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[ServletAdaptor]: javax.persistence.QueryTimeoutException: Could not open connection
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1322)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1288)
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1370)
    at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60)
    at com.dd.core.RequestHandler.handleRequest(RequestHandler.java:89)
    at com.hibernate.test.Resource.invokeExampleService(Resource.java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:307)
    at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:562)
    at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:255)
    at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:259)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1232)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:781)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3928)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
    at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1820)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
    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:1881)
Caused by: org.hibernate.QueryTimeoutException: Could not open connection
    at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:156)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)
    at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:67)
    at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:160)
    at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1309)
    at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:57)
    ... 48 more
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied
 DSRA0010E: SQL State = 72000, Error Code = 1,017
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:392)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:385)
    at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1018)
    at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:497)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:433)
    at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:950)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:639)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
    at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:311)
    at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:486)
    at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:174)
    at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:109)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper$1.run(InternalGenericDataStoreHelper.java:1365)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledConnection(InternalGenericDataStoreHelper.java:1384)
    at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:2154)
    at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.getConnection(WSManagedConnectionFactoryImpl.java:1787)
    at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1557)
    at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1113)
    at com.ibm.ejs.j2c.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:2161)
    at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1839)
    at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3818)
    at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:3094)
    at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:1548)
    at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:1031)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:644)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:611)
    at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)
    at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:279)
    at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297)
    ... 53 more

共有1个答案

袁旻
2023-03-14

如果为数据源(或在资源引用绑定中)设置了容器管理的身份验证,但没有为数据源定义组件管理的身份验证,则可能会导致出现此问题,因为您可以在不使用容器管理的身份验证的资源引用的情况下查找数据源。要使用容器管理的身份验证,在查找数据源时需要使用资源引用。

您是否已尝试在持久单元中为数据源指定资源引用名称。例如

 <jta-data-source>java:comp/env/jdbc/exampleDS</jta-data-source>

见:http://www.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/tejb_defjpadatasource.html

此外,您应该确认您的数据源配置了默认的容器管理的身份验证别名,或者在资源引用绑定中指定了容器管理的身份验证别名,并且用户/密码正确无误。

 类似资料:
  • 问题内容: 我与Oracle数据库服务器的jdbc连接有一个奇怪的问题。 我们已经在tomcat服务器上运行了应用程序。这些应用程序使用一个oracle数据库。所有应用程序都使用相同的凭据。 应用程序整天运行良好。晚上没有活动。早晨,当应用程序尝试将自身重新连接到数据库时,我们会收到一些(2或3)ORA-01017(无效的用户名/密码)错误。 然后重新连接工作,应用程序将正常运行。 这可以工作几天

  • 我用 但从oracleSqlDeveloper,当从9i客户端连接到11g数据库时,我无法登录到我的用户并发现ORA-01017无效的用户名/密码,但他说要更改安全性!oracle是否为access数据库设置了此选项?在不更改安全参数的情况下,如何登录oracle数据库? 错误:

  • 以下代码抛出:ORA-01017:无效的用户名/密码;拒绝登录 SQL开发人员,DBeaver连接没有问题。FIPS被禁用。 系统: Oracle Server 11g(11.2.0.3.0) 我将非常感谢任何帮助!

  • 我只是在我的电脑上安装了Oracle 12c datadase,安装过程正常,没有任何问题。完成安装后,我试图建立一个新的连接(IPlocalhost:1521,service_nameorcl): 但我得到了: ORA-01017,用户名/密码无效;登录被拒绝 tnsnames.ora是: 搞什么?tnsnames.ora刚刚显示IPlocalhost,post是1521,service_nam

  • 我尝试了许多可能的代码来连接数据库(指定主机和端口而不是仅仅SID/服务名、设置Properties对象、使用OracleDataSource、从OCI驱动程序切换到瘦驱动程序、检查REMOTE_LOGIN_PASSWORDFILE等),但仍然是相同的错误。 你认为这是司机的问题吗?我们需要在数据库中配置什么吗?顺便说一下,这些版本是:JDBC=>11.2.0.3.0 Oracle DB=>11.

  • 我们目前有一个Keycloak领域,我们希望将所有现有用户导出到LDAP中(其密码不变),因此我们可以为不支持OpenID Connect或SAML但支持LDAP的其他位置添加登录支持。 由于密码凭据是使用pbkdf2-sha256算法存储在Keycloak MySQL用户数据库中的,所以我必须使用OpenLDAP 2.4.47和contrib模块来支持LDAP端的密码凭据(我也相信我已经在配置中