HikariDataSource
으로 JBOSS AS 6.1을 시작할 때 링크 오류가 발생합니다. 어떻게 해결할 수 있을까요? (JBOSS와 함께 제공) 3.6.6 최대 절전 모드, 6.1HikariCP - HikariDataSource를 사용한 링크 오류
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>1.3.3</version>
</dependency>
봄 3.2, JBOSS :
나는 hikariCP 1.3.3를 사용합니다. 나는 persistence.xml을 제거하고 내 데이터 소스 프로그래밍 방식LocalContainerEntityManagerFactoryBean
에서 접근하여 confgiure : 나는 단순히 구성
http://www.baeldung.com/2011/12/13/the-persistence-layer-with-spring-3-1-and-jpa/
내 DS :
@Bean
public DataSource dataSource() {
HikariDataSource ds = new HikariDataSource(); //here i get the linkageError
ds.setMaximumPoolSize(15);
ds.setDataSourceClassName("com.microsoft.sqlserver.jdbc.SQLServerDataSource");
ds.addDataSourceProperty("serverName", "localhost");
ds.addDataSourceProperty("databaseName", "dbtest");
ds.addDataSourceProperty("user", "dbtest");
ds.addDataSourceProperty("password", "dbtest");
ds.setPoolName("springHikariCp");
return ds;
}
그리고 스택 추적의 끝을한다 :
는Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.sql.DataSource com.company.test.PersistenceJPAConfig.dataSource()] threw exception; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:181) [:3.2.0.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) [:3.2.0.RELEASE]
... 135 more
Caused by: java.lang.ExceptionInInitializerError
at com.zaxxer.hikari.HikariConfig.<clinit>(HikariConfig.java:77) [:]
at com.company.test.PersistenceJPAConfig.dataSource(PersistenceJPAConfig.java:115) [:]
at com.company.test.PersistenceJPAConfig$$EnhancerByCGLIB$$2cad8762.CGLIB$dataSource$3(<generated>) [:]
at com.company.test.PersistenceJPAConfig$$EnhancerByCGLIB$$2cad8762$$FastClassByCGLIB$$7a8bcfa3.invoke(<generated>) [:]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [:3.2.0.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:285) [:3.2.0.RELEASE]
at com.company.test.PersistenceJPAConfig$$EnhancerByCGLIB$$2cad8762.dataSource(<generated>) [:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.7.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.7.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_11]
at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0_11]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:160) [:3.2.0.RELEASE]
... 136 more
Caused by: java.lang.RuntimeException: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader): attempted duplicate class definition for name: "com/zaxxer/hikari/proxy/ProxyFactory"
at com.zaxxer.hikari.proxy.JavassistProxyFactory.<clinit>(JavassistProxyFactory.java:58) [:]
... 148 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader): attempted duplicate class definition for name: "com/zaxxer/hikari/proxy/ProxyFactory"
at javassist.ClassPool.toClass(ClassPool.java:1099) [:6.1.0.Final]
at javassist.CtClass.toClass(CtClass.java:1265) [:6.1.0.Final]
at com.zaxxer.hikari.proxy.JavassistProxyFactory.modifyProxyFactory(JavassistProxyFactory.java:131) [:]
at com.zaxxer.hikari.proxy.JavassistProxyFactory.<clinit>(JavassistProxyFactory.java:54) [:]
... 148 more
Caused by: java.lang.LinkageError: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader): attempted duplicate class definition for name: "com/zaxxer/hikari/proxy/ProxyFactory"
at java.lang.ClassLoader.defineClass1(Native Method) [:1.7.0_11]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [:1.7.0_11]
at java.lang.ClassLoader.defineClass(ClassLoader.java:634) [:1.7.0_11]
at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source) [:1.7.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.7.0_11]
at java.lang.reflect.Method.invoke(Method.java:601) [:1.7.0_11]
at javassist.ClassPool.toClass2(ClassPool.java:1112) [:6.1.0.Final]
at javassist.ClassPool.toClass(ClassPool.java:1093) [:6.1.0.Final]
... 151 more
1.3.5로 업그레이드하여 HikariCP-1.3.5.jar이 \ WEB-INF \ lib의 .war에만 있는지 확인했지만 오류가 수정되지 않았습니다. 히카리를'given'으로 설정하고 \ server \ app \ lib에 넣으면 작동합니다. –
Tomcat 7.0.23에서 버전 2.0.1을 사용하여 동일한 오류가 발생합니다. –
배포의 두 위치에 HikariCP jar가 있습니까? 예를 들어, webapp 폴더뿐만 아니라 Tomcat lib 폴더도 가능합니까? 가능성이 높습니다. – brettw