Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
841 views
in Technique[技术] by (71.8m points)

deployment - Weblogic application context root is war file name instead of name specified in weblogic.xml

I have an application which I have deployed using Maven to Weblogic 10.3.6. I have specified context root in weblogic.xml as

<context-root>/myapps</context-root>

The problem I am having is it is taking the war file name as context root instead of the name I have specified in weblogic.xml

How can I change the context root instead of the name taking war file name as context root?

Weblogic.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
 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_2_5.xsd 
 http://xmlns.oracle.com/weblogic/weblogic-web-app 
 http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
 <context-root>/myapps</context-root>
<container-descriptor>
        <prefer-application-packages>
            <package-name>antlr.*</package-name>
            <package-name>org.hibernate.*</package-name>
            <package-name>javax.persistence.*</package-name>
        </prefer-application-packages>
    </container-descriptor>
    </weblogic-web-app>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I assume this is happening because of your Maven setup/properties. (The same can happen with jDeveloper, if you don't have a property set it will override your context root).

Have you seen this answer? Run with Netbeans (and Maven) the right context root

And the corresponding Maven link: http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-context-root.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...