Migration of JAXB for Java – Weblogic 12C disaggregation

We have a Weblogic 10.3 5.0, we are migrating to WL 12.1 2.0. 0. We are solving the problem of ungrouping WS calls from other applications We are familiar with marshalling errors during upgrade, but it seems that this problem is different

It should be noted that it works normally on the dev / test server of the same WL version, but the following error will be returned during local deployment (Env / configuration settings must not match):

JAXB unmarshalling exception: null; nested exception is javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException; cvc-complex-type.3.2.2: Attribute 'xsi:nil' is not allowed to appear in element 'error'.]

From the error message, it seems that it does not recognize the XSI namespace or something The architecture is consistent with 10.3 If there is no change, it should not be the root of the problem What does anyone think, even the starting point?

Thank you.

Editing: adding web XML and Weblogic xml

web. In XML

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="cpc-mi" version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
...
</web-app>

weblogic. In XML

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
        http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd 
        http://xmlns.oracle.com/weblogic/weblogic-web-app 
        http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd" 
    xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
</weblogic-web-app>

Solution

Weblogic 12C (WLS 12C) has its own jar library, including JAXB I am already using this server. When I want to use JSF (another library attached to Weblogic), I must tell WLS 12C to ignore its own JSF library and use mine, which is included in war / ear

You can use Weblogic. Inf in the web - inf folder XML descriptor Here is one of my Weblogic xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">

  <container-descriptor>
    <prefer-application-packages> 
      <package-name>javax.faces.*</package-name> 
      <package-name>com.sun.faces.*</package-name> 
      <package-name>com.bea.faces.*</package-name> 
      <package-name>org.apache.commons.io.*</package-name>
      <package-name>org.apache.commons.fileupload.*</package-name>
    </prefer-application-packages> 

    <prefer-application-resources> 
      <resource-name>javax.faces.*</resource-name> 
      <resource-name>com.sun.faces.*</resource-name> 
      <resource-name>com.bea.faces.*</resource-name> 
      <resource-name>Meta-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
      <resource-name>Meta-INF/services/com.sun.faces.*</resource-name>
    </prefer-application-resources>

    <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
  </container-descriptor>
</weblogic-web-app>

Of course, your own JAXB dependencies are included in your war / ear and tell WLS 12C to ignore its JAXB library and use Java xml. bind.* Value is used as package name tag or resource name tag

I hope it helps

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>