简体   繁体   中英

java.lang.SecurityException: sealing violation: can't seal package com.sun.xml.bind: already loaded

Could anyone help me to resolve these error in my weblogic server.

Caused by: java.lang.SecurityException: sealing violation: can't seal package com.sun.xml.bind: already loaded
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:242)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:295)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:294)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:293)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:146)
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1169)
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
    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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:235)
    at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:232)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:232)
    at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:95)

Why this exception is generic by showing only package "package com.sun.xml.bind"?

Finally we found a solution to fix this by following the steps below,

1) There was an issue like java.lang.SecurityException: sealing violation: can't seal package com.sun.xml.bind: already loaded , but related jar jaxb-impl.jar was not found.

2) We took this jaxb-impl.jar and added in classpath and the flow as successful.

3) Such issue occurs when right set of jars are not loaded in the classpath or class existing in multiple jars. We should try playing around with the jars related to package com.sun.xml.bind

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