POI와 Xpath를 JBoss5에서 사용시에 서버다운문제

“ajp-127.0.0.1-8009-19” daemon prio=10 tid=0x00007f203cd08800 nid=0x879 runnable [0x00007f2022731000] java.lang.Thread.State: RUNNABLE at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530) – locked <0x0000000789fddb10> (a org.jboss.classloader.spi.base.BaseClassLoader) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507) at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134) at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131) at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:452) at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:251) at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:150) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265) at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1119) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:798) at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:441) – locked <0x0000000789fddb10> (a org.jboss.classloader.spi.base.BaseClassLoader) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getMethod0(Class.java:2670) at java.lang.Class.getMethod(Class.java:1603) at org.apache.xmlbeans.XmlBeans.buildMethod(XmlBeans.java:174) at org.apache.xmlbeans.XmlBeans.buildNoArgMethod(XmlBeans.java:190) at org.apache.xmlbeans.XmlBeans.buildGetContextTypeLoaderMethod(XmlBeans.java:200) at org.apache.xmlbeans.XmlBeans.<clinit>(XmlBeans.java:126) at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook$Factory.newInstance(Unknown Source) at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:321) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:181) at jp.co.ace.cloud.common.DisplayBean.makeGameExcel(DisplayBean.java:2310) at jp.co.ace.cloud.common.DisplayBean.sendGameExcel(DisplayBean.java:2255) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) 반대로 Poi를 먼저사용후에 Xpath를 이용하면 아래의 에러가 발생.

Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "NODESET" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the referring
class, javax/xml/xpath/XPathConstants, and the class loader (instanceof <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
        at jp.co.ace.cloud.common.KusaOnScraper.loadBatterCareer(XXXScraper.java:143)
아래 사이트를 참고로 jboss-web.xml를 java2ClassLoadingCompliance=”true” 로 변경하니 해결됨. http://stackoverflow.com/questions/4985269/jboss-class-loader-order-another-try-to-understand-it
<!DOCTYPE jboss-web PUBLIC
  "-//JBoss//DTD Web Application 5.0//EN"
  "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
    <class-loading java2ClassLoadingCompliance="true">
        <loader-repository>
            seam.jboss.org:loader=ace
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
    </class-loading>
    <context-root>/</context-root>
</jboss-web>
]]>

Related Posts