Spring 配置weblogic中的JNDI数据源,发现部分模块数据查询失败 40C

配置了weblogic的数据源(经测试可用),在项目applicationContext.xml文件中做了如下修改:

<bean id="defaultDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="JNDI/Szzjj"></property>
</bean>

启动项目后发现,有部分模块easyUI datagrid列表展示不出数据,但是可以保存添加数据,后台报错为:

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [99999]; error code [17104];
SQL statement to execute cannot be empty or null; nested exception is java.sql.SQLException: SQL statement to execute cannot be empty or null
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:684)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:711)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:761)
        at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
        at cn.jasgroup.jasframework.dataaccess3.core.BaseNamedParameterJdbcTemplate.queryForList(BaseNamedParameterJdbcTemplate.java:284)
        at cn.jasgroup.jasframework.dataaccess.springhelper.JdbcDaoHelper.getPage(JdbcDaoHelper.java:533)
        at cn.jasgroup.jasframework.dataaccess.base.BaseJdbcDao.getPage(BaseJdbcDao.java:282)
        at cn.jasgroup.jasframework.engine.service.AbstractCommonDataService.getPage(AbstractCommonDataService.java:197)
        at cn.jasgroup.jasframework.engine.service.AbstractCommonDataService$$FastClassBySpringCGLIB$$6c27ab1d.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
        at cn.jasgroup.entmanagement.gasservicepoint.service.GasServicePointService$$EnhancerBySpringCGLIB$$6aae7027.getPage(<generated>)
        at cn.jasgroup.entmanagement.gasservicepoint.controller.GasServicePointController.getPage(GasServicePointController.java:245)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at cn.jasgroup.jasframework.security.base.SetCacheFilter.doFilter(SetCacheFilter.java:42)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at cn.jasgroup.jasframework.dataaccess.filter.DataSourceFilter.doFilter(DataSourceFilter.java:46)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3706)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3672)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:328)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
        at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1705)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1665)
        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:652)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:360)
Caused by: java.sql.SQLException: SQL statement to execute cannot be empty or null
        at oracle.jdbc.driver.PhysicalConnection.prepareStatementInternal(PhysicalConnection.java:1642)
        at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:1620)
        at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:1547)
        at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:2206)
        at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1902)
        at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1816)
        at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:1809)
        at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:658)
        at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory
.java:238)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:627)
        ... 71 more

,各位大神有知道什么原因的吗?是缺少什么东西吗?用Tomcat的jndi测试没有问题,可以正常展示。

1个回答

是sql语句的String为null,与驱动没有关系

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

1
java项目部署在weblogic中,如何操作linux中的文件夹并下载日志
1
weblogic链接数据库报错
1
weblogic启动报错java.lang.NoClassDefFoundError: weblogic/security/SecurityLogger
0
项目在weblogic11g中部署成功在weblogic12c中失败?
0
idea weblogic启动失败
1
idea关于java.lang.ClassNotFoundException的问题
1
weblogic weblogic.Admin 从JMX和WLSConsole中取的值不一致??
0
weblogic服务启动报错,提示缓存刷新异常,清缓存后还是报同样的错误
0
启动weblogic时,报Timestamp is not of the correct length: 2041906221218Z.
2
项目迁移升级到jdk1.8,tomcat8下可以运行,weblogic12c下报错?
0
Weblogic部署EJB失败,帮忙看看是什么原因啊?
0
weblogic 12 套字节复用器 weblogic.socket.Muxer 总是占着CPU执行不完。
1
如何在 linux 下搭建 jenkins 并且部署maven web项目到 weblogic
1
安装weblogic 此时不应有Files?
3
spring+ ibatic: there is no statement xxx in /sql-map-config.xml配置问题
2
weblogic启动报错<log4j:WARN Error during default initialization> ?
1
跨网段访问weblogic服务,间隔访问响应延迟2s多,连续访问不延迟,这是为什么?
1
Lucence分页搜索时会造成服务器上内存泄漏?
3
weblogic的Servlet创建之后,报空指针异常
1
weblogic自动化部署,在confi.xml文件中加了配置,将war包也放到了antodeploy下,开大UI界面可以看到该项目是自动部署,但是上面有字显示,仍从你上次发出的请求加载配置,请稍等片刻然后重试,请问怎么解决?