我试图使用JDK1.6创建一个spring boot应用程序,当我添加“spring-boot-starter-jdbc”依赖项时,我得到了以下异常。我知道这个异常与编译器版本的差异有关,但不知道如何解决这个问题。如果我移除“spring-boot-starter-jdbc”依赖项,一切都很好。解决此问题的任何帮助以及如何进一步排除故障都将有所帮助。
POM依赖项:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>7.0.59</tomcat.version>
<java.version>1.6</java.version>
<main.basedir>${basedir}/../..</main.basedir>
<m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>
<spring.starter.version>1.3.3.RELEASE</spring.starter.version>
<spring-boot.version>1.3.3.RELEASE</spring-boot.version>
<version.oracle>11.2.0.1.0</version.oracle>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.starter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.starter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>${spring.starter.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-legacy</artifactId>
<version>1.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>${spring.starter.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>${version.oracle}</version>
</dependency>
</dependencies>
例外情况:
3/14/16 16:37:04:412 EDT] 00000009 SystemOut O 2016-03-14 16:37:04.412 ERROR 41116 --- [ Default : 0] o.s.boot.SpringApplication : Application startup failed
java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/apache/tomcat/jdbc/pool/DataSource, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method) ~[na:1.6.0]
at java.lang.ClassLoader.defineClass(ClassLoader.java:275) ~[na:1.6.0]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:74) ~[na:na]
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:775) ~[com.ibm.ws.runtime.jar:WAS70.SERV1 [cf291321.01]]
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:690) ~[com.ibm.ws.runtime.jar:WAS70.SERV1 [cf291321.01]]
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:513) ~[com.ibm.ws.runtime.jar:WAS70.SERV1 [cf291321.01]]
at java.lang.ClassLoader.loadClass(ClassLoader.java:626) ~[na:1.6.0]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:250) ~[spring-core-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder.findType(DataSourceBuilder.java:121) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedDataSourceCondition.getDataSourceClassLoader(DataSourceAutoConfiguration.java:197) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedDataSourceCondition.getMatchOutcome(DataSourceAutoConfiguration.java:183) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:155) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.anyMatches(SpringBootCondition.java:138) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$DataSourceAvailableCondition.getMatchOutcome(DataSourceAutoConfiguration.java:245) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:204) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:337) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:249) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:232) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:510) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:455) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:186) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
at org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener.initWebApplicationContext(SpringBootContextLoaderListener.java:61) [spring-boot-legacy-1.0.2.RELEASE.jar:1.0.2.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1718) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:385) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:732) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:617) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668) [com.ibm.ws.webcontainer.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1128) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1319) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:741) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1273) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5305) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5483) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1278) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2050 ) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:332) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:603) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:565) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1185) [com.ibm.ws.runtime.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) ~[na:1.6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:600) ~[na:1.6.0]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:57) [na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) ~[na:1.6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:600) ~[na:1.6.0]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1137) [na:1.6.0]
at java.security.AccessController.doPrivileged(AccessController.java:250) [na:na]
at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30) [na:2.4 (01-12-2013)]
at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:29) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1131) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:984) [na:1.6.0]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [na:1.6.0]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:762) [na:1.6.0]
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1331) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) [bootstrap.jar:WAS70.SERV1 [cf291321.01]]
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1224) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1407) [com.ibm.ws.admin.services.jar:na]
at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1303) [com.ibm.ws.admin.services.jar:na]
at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1263) [com.ibm.ws.admin.services.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) ~[na:1.6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:600) ~[na:1.6.0]
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:57) [na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) ~[na:1.6.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0]
at java.lang.reflect.Method.invoke(Method.java:600) ~[na:1.6.0]
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1137) [na:1.6.0]
at java.security.AccessController.doPrivileged(AccessController.java:250) [na:na]
at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30) [na:2.4 (01-12-2013)]
at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:29) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1131) [na:1.6.0]
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:984) [na:1.6.0]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [na:1.6.0]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:762) [na:1.6.0]
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1331) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) [bootstrap.jar:WAS70.SERV1 [cf291321.01]]
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1224) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:353) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:595) [com.ibm.ws.admin.core.jar:na]
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) [com.ibm.ws.runtime.jar:na]
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) [com.ibm.ws.runtime.jar:na]
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656) [com.ibm.ws.runtime.jar:na]
您看到该异常的原因与您可能已经猜到的完全一样。这是因为您使用的是旧版本的JDK。
好消息是你有选择。当然,您可以升级您的JDK,这是一个明智的解决方案,因为JDK6已经不受支持了,而且已经有很长一段时间了。
您的另一个选择是包含一个连接池库,它不要求您使用版本6以上的JDK。请记住,如果您打算继续使用spring boot
,您很可能会再次遇到相同的问题。
正如spring boot官方文档中所指出的,您可以将自己的datasource
定义为一个常规的spring bean。您可以使用HikariCP或任何其他符合JDK6的库。我建议不要使用较旧版本的Tomcat连接池,以避免名称冲突。
我试图使用继承使用这个项目https://github.com/Baeldung/spring-security-registration 这是我的用户 还有一些子类,比如UserAdmin 那么我的角色课是这样的 但我在注册用户时遇到了这个错误 o、 h.LazyInitializationException:未能延迟初始化角色com的集合。贝尔东。坚持不懈模型角色用户,无法初始化代理-无会话
2.)AVD没有互联网问题(原因稍后解释)。 3.)与我的volley singleton类或请求队列无关(原因稍后解释)。 所以我想我在Volley/Request Future的用法上犯了某种错误。
我为基本上是Bèzier路径的创建了一些。为此,我转换了类型为和的路径元素,为此我还有转换器: 我有一个测试代码: 混搭路径时创建的文件如下所示,这是我基本上想要的: 但是,在解组XML时,我遇到了这个异常: PathConverter中的第52行指向该行(在for循环中的第一次调用): 我的猜测是,这个问题与方法上的和方法有关,这样读者仍然处于它期望的结束节点的状态。对于其他两个转换器,我也有测
> 单击 受保护得空onPrepareDialog(int id,Dialog Dialog) 受保护的对话框onCreateDialog(int id) 如果我对timepickerdialog代码做了什么错误,请告诉我。
问题内容: 我试图延迟-或使我的Java程序进入睡眠状态,但是发生错误。 我无法使用或。出现相同的错误消息: 未报告的异常java.lang.InterruptedException; 必须被抓住或宣布被抛出。 使用 or 方法之前,是否需要任何步骤? 问题答案: 你前面有很多阅读材料。从编译器错误到异常处理,线程和线程中断。但这将满足你的要求:
我在Oracle中有下面的SQL语句,这让我有些头疼。如果Oracle表中的值为null,我尝试返回一个空几何体,但是它失败了,出现以下错误: 错误 ** ORA-29532:Java调用被unpper终止Java异常:java.lang.NullPointerExcema ORA-06512: at"MDSYS.SDO_UTIL",第2421行ORA-06512: at"MDSYS.SDO_UT