web-dev-qa-db-ja.com

内部表現への変換に失敗する

Oracle DatabaseTomcat 6 serverを使用してBroadleafCommerceアプリケーションを起動しています。 ここ の手順に従いました。Persistence-admin.xmlTomcatapplication_context-custom.xmlpom.xmlConnecting to Oracleに変更を加えました。アプリケーションは起動していますが、adminまたはstoreにログインしようとすると、以下のエラーが発生します。

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT USER_NAME,PASSWORD,'TRUE' FROM BLC_CUSTOMER WHERE USER_NAME=?]; SQL state [null]; error code [17059]; Fail to convert to internal representation; nested exception is Java.sql.SQLException: Fail to convert to internal representation
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.Java:83)
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.Java:80)
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.Java:80)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.Java:602)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:636)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:665)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:673)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:713)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.loadUsersByUsername(JdbcDaoImpl.Java:189)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.loadUserByUsername(JdbcDaoImpl.Java:152)
    org.broadleafcommerce.profile.service.LoginServiceImpl.loginCustomer(LoginServiceImpl.Java:25)
    org.broadleafcommerce.profile.web.controller.RegisterCustomerController.registerCustomer(RegisterCustomerController.Java:75)
    Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:39)
    Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:25)
    Java.lang.reflect.Method.invoke(Method.Java:597)
    org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.Java:175)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.Java:421)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.Java:409)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.Java:774)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.Java:719)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.Java:644)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.Java:560)
    javax.servlet.http.HttpServlet.service(HttpServlet.Java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.Java:717)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.Java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.Java:76)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:343)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.Java:109)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.Java:83)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.Java:97)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.Java:100)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.Java:78)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.broadleafcommerce.profile.web.security.CustomerStateFilter.doFilter(CustomerStateFilter.Java:123)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.Java:112)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.Java:54)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.Java:35)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.Java:177)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.Java:187)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.Java:105)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.Java:79)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.Java:149)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.Java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.Java:167)
    org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.Java:113)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.Java:76)


root cause 

Java.sql.SQLException: Fail to convert to internal representation
    Oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.Java:125)
    Oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.Java:162)
    Oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.Java:227)
    Oracle.jdbc.driver.CharCommonAccessor.getBigDecimal(CharCommonAccessor.Java:325)
    Oracle.jdbc.driver.CharCommonAccessor.getBoolean(CharCommonAccessor.Java:158)
    Oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.Java:394)
    org.Apache.commons.dbcp.DelegatingResultSet.getBoolean(DelegatingResultSet.Java:178)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl$1.mapRow(JdbcDaoImpl.Java:193)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl$1.mapRow(JdbcDaoImpl.Java:189)
    org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.Java:92)
    org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.Java:1)
    org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.Java:648)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.Java:586)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:636)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:665)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:673)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.Java:713)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.loadUsersByUsername(JdbcDaoImpl.Java:189)
    org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.loadUserByUsername(JdbcDaoImpl.Java:152)
    org.broadleafcommerce.profile.service.LoginServiceImpl.loginCustomer(LoginServiceImpl.Java:25)
    org.broadleafcommerce.profile.web.controller.RegisterCustomerController.registerCustomer(RegisterCustomerController.Java:75)
    Sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:39)
    Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:25)
    Java.lang.reflect.Method.invoke(Method.Java:597)
    org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.Java:175)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.Java:421)
    org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.Java:409)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.Java:774)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.Java:719)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.Java:644)
    org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.Java:560)
    javax.servlet.http.HttpServlet.service(HttpServlet.Java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet.Java:717)
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.Java:77)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.Java:76)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:343)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.Java:109)
    org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.Java:83)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.Java:97)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.Java:100)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.Java:78)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.broadleafcommerce.profile.web.security.CustomerStateFilter.doFilter(CustomerStateFilter.Java:123)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.Java:112)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.Java:54)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.Java:35)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.Java:177)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.Java:187)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.Java:105)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.Java:79)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.Java:355)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.Java:149)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.Java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.Java:167)
    org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.Java:113)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.Java:76)

誰かが私を助けることができますか?

9
user1113253

これは、コードが(直接またはHibernateを介して)返された結果セットから値を読み取ろうとしていて、間違った型(数値のgetString(...)など)を使用していることが原因である可能性があります。 Oracleデータベース用にORMフレームワーク(またはBroadleaf)が正しく構成されていることを確認してください。特に方言は、それがOracleであり、他の値ではないことを確認してください。

22
Shivan Dragon

これは、Oracleで完全にテストされていない古いバージョンのBroadleafでした。 Oracleとの互換性のために後のリリースで変更されたクエリがいくつかありましたが、私が覚えているように、これはそのうちの1つでした。問題はクエリのbooleanパラメータにあると思います。

select user_name,password,'TRUE' from blc_customer where user_name=?

このクエリは、1.6以降で次のように変更されました。

select user_name,password,true from blc_customer where user_name=?

Broadleafカスタマーセキュリティ構成のこの変更により、この問題に対処する必要があります。

0
mbvcomeback