简体   繁体   中英

ClassNotFoundException: sun.net.www.MimeTable when migrating to JBoss 7.1.1

I m getting following error when deploying ear file in Jboss 7

Caused by: java.lang.ClassNotFoundException: sun.net.www.MimeTable from [Module "deployment.XXX.ear.XXX.war:main" from Service Module Loader]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
        ... 43 more 

Can you please suggest me any solutions.

try adding following line to JBoss home \\modules\\sun\\jdk\\main\\module.xml

 <dependencies>
      <system export="true">
         <paths>
           ..


           <path name="sun/net/www" />
        </paths>

Non-API packages from the JRE are not exported by default by the JBoss modules environment.

See Class Loading in AS7 , section Accessing JDK classes , for a solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM