0
votes

I made a web application using struts2 and hibernate and created a war of it.

It working fine in tomcat but there was issue with weblogic since it load jpa 1.0 so i created weblogic.xml as given below

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

    <container-descriptor>
        <prefer-web-inf-classes>false</prefer-web-inf-classes>
        <prefer-application-packages>
            <package-name>antlr.*</package-name>
            <package-name>javax.persistence.*</package-name>
        </prefer-application-packages>
    </container-descriptor>

</weblogic-web-app>

this solved the issue and its working fine with weblogic 10.3.3 but when i deployed this same war with above weblogic.xml in weblogic 10.3.2 its giving below error

VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected elements 'default-mime-type@http://xmlns.oracle.com/weblogic/weblogic-web-app client-cert-proxy-enabled@http://xmlns.oracle.com/weblogic/weblogic-web-app relogin-enabled@http://xmlns.oracle.com/weblogic/weblogic-web-app allow-all-roles@http://xmlns.oracle.com/weblogic/weblogic-web-app native-io-enabled@http://xmlns.oracle.com/weblogic/weblogic-web-app minimum-native-file-size@http://xmlns.oracle.com/weblogic/weblogic-web-app disable-implicit-servlet-mappings@http://xmlns.oracle.com/weblogic/weblogic-web-app temp-dir@http://xmlns.oracle.com/weblogic/weblogic-web-app optimistic-serialization@http://xmlns.oracle.com/weblogic/weblogic-web-app retain-original-url@http://xmlns.oracle.com/weblogic/weblogic-web-app show-archived-real-path-enabled@http://xmlns.oracle.com/weblogic/weblogic-web-app require-admin-traffic@http://xmlns.oracle.com/weblogic/weblogic-web-app access-logging-disabled@http://xmlns.oracle.com/weblogic/weblogic-web-app' instead of 'prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-web-app' here in element container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-web-app:

I found that <prefer-application-packages> that was used in weblogic.xml is not supported in 10.3.2

so i changed weblogic.xml as given below

<weblogic-web-app
    xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"
>

    <container-descriptor>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>

</weblogic-web-app>

but the above weblogic.xml is not loading hibernate jpa2.0

can anyone provide me with exact configuration for running hibernate in weblogic 10.3.2

i want to get this done using weblogic.xml only and not with any other mean like changing startup script or including jars in weblogic module folder

1

1 Answers

0
votes

WebLogic 10.3.4 is the first version that supports JPA2.0. Weblogic 10.3.0 and 10.3.2 that you mention simply don't support JPA2.0. You would need to upgrade the weblogic version if you need JPA2, or otherwise use JPA1.0.

Some versions of weblogic also require that the weblogic-application.xml and weblogic.xml uses all xml tags with wls:tag so you use <wls:container-root> and <wls:container-description> which may be where the validation error is coming from.