2016-09-30 3 views
0

私はSpringブートが初めてで、これを使用してWebアプリケーションを開発しようとしています。私のアプリでは、jconn4.jarをビルドパスに含める必要があります。しかし、私はビルドパスにjconn4.jarを追加した直後にNullPointerExceptionの下に落ち着きました。jconn4.jarがビルドパスに追加されたときに、NullPointerExceptionがスローされました。

2016-09-30 14:15:48.116 INFO 74768 --- [   main] m.j.a.SpringBootPractice   : No active profile set, falling back to default profiles: default 
2016-09-30 14:15:48.116 DEBUG 74768 --- [   main] o.s.boot.SpringApplication    : Loading source class main.java.appstarter.SpringBootPractice 
2016-09-30 14:15:48.160 INFO 74768 --- [   main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]1a1e9a9: startup date [Fri Sep 30 14:15:48 EDT 2016]; root of context hierarchy 
2016-09-30 14:15:48.162 DEBUG 74768 --- [   main] ationConfigEmbeddedWebApplicationContext : Bean factory for org.springframework.boot[email protected]1a1e9a9: org.s[email protected]10ee7e5: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,SpringBootPractice]; root of factory hierarchy 
2016-09-30 14:15:48.975 DEBUG 74768 --- [   main] o.s.b.a.AutoConfigurationPackages  : @EnableAutoConfiguration was declared on a class in the package 'main.java.appstarter'. Automatic @Repository and @Entity scanning is enabled. 
2016-09-30 14:15:49.252 INFO 74768 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$d55d155b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2016-09-30 14:15:49.291 DEBUG 74768 --- [   main] ationConfigEmbeddedWebApplicationContext : Unable to locate MessageSource with name 'messageSource': using default [[email protected]d8] 
2016-09-30 14:15:49.291 DEBUG 74768 --- [   main] ationConfigEmbeddedWebApplicationContext : Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.[email protected]145e7b9] 
2016-09-30 14:15:49.622 DEBUG 74768 --- [   main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\.m2\repository\org\springframework\boot\spring-boot\1.4.1.RELEASE\spring-boot-1.4.1.RELEASE.jar 
2016-09-30 14:15:49.622 DEBUG 74768 --- [   main] .t.TomcatEmbeddedServletContainerFactory : Code archive: C:\Users\.m2\repository\org\springframework\boot\spring-boot\1.4.1.RELEASE\spring-boot-1.4.1.RELEASE.jar 
2016-09-30 14:15:49.623 DEBUG 74768 --- [   main] .t.TomcatEmbeddedServletContainerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored. 
2016-09-30 14:15:49.656 WARN 74768 --- [   main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ExceptionInInitializerError 
2016-09-30 14:15:49.664 ERROR 74768 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.ExceptionInInitializerError 
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at main.java.appstarter.SpringBootPractice.main(SpringBootPractice.java:19) [bin/:na] 
Caused by: java.lang.ExceptionInInitializerError: null 
at org.apache.tomcat.util.buf.UDecoder.URLDecode(UDecoder.java:352) ~[tomcat-embed-core-8.5.5.jar:8.5.5] 
at org.apache.tomcat.util.buf.UDecoder.URLDecode(UDecoder.java:324) ~[tomcat-embed-core-8.5.5.jar:8.5.5] 
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3113) ~[tomcat-embed-core-8.5.5.jar:8.5.5] 
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.addServletMapping(TomcatEmbeddedServletContainerFactory.java:277) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.addDefaultServlet(TomcatEmbeddedServletContainerFactory.java:257) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.prepareContext(TomcatEmbeddedServletContainerFactory.java:213) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:176) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
... 8 common frames omitted 
Caused by: java.lang.NullPointerException: null 
at java.nio.charset.Charset.put(Charset.java:538) ~[na:1.8.0_51] 
at java.nio.charset.Charset.access$200(Charset.java:271) ~[na:1.8.0_51] 
at java.nio.charset.Charset$3.run(Charset.java:584) ~[na:1.8.0_51] 
at java.nio.charset.Charset$3.run(Charset.java:573) ~[na:1.8.0_51] 
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_51] 
at java.nio.charset.Charset.availableCharsets(Charset.java:572) ~[na:1.8.0_51] 
at org.apache.tomcat.util.buf.B2CConverter.<clinit>(B2CConverter.java:49) ~[tomcat-embed-core-8.5.5.jar:8.5.5] 
... 17 common frames omitted 

私は、関連するすべてのQ/Aの上に検索し、リンクの下に、このための1つの可能な理由をで発見されました:NullPointerException thrown by Charset.availableCharsets due to our Sybase JDBC driver

しかし、私は誰もがこのための任意の解決策を示唆して表示されません。

私は多くの可能性を試してきましたが、この例外はビルドパスに追加されている限り発生します。これで、私はもう進行しなくなりました。

以下

は私pox.xmlです:データベース

spring.datasource.driver-class-name=com.sybase.jdbc4.jdbc.SybDriver 

ため

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.4.1.RELEASE</version> 
</parent> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>com.jayway.jsonpath</groupId> 
     <artifactId>json-path</artifactId> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

<properties> 
    <java.version>1.8</java.version> 
</properties> 

構成は、誰もがこの上で私を助けたり、私が進む可能性がどのように任意の提案を与えることができますか?

すべての入力は本当に感謝します。

答えて

1

誰も私の質問に答えていないようです。私はちょうどこのリンクNullPointerException thrown by...から答えを得た。 2012年からjconn4.jarを使用していたことが判明しました。2013年から新しいものに置き換えられましたが、例外はなくなりました。

関連する問題