| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, =20 I have trouble changing the context-root of a web application with deployme= nt plan. Does anybody have experience with it? =20 =20 I have the following environment settings: set JAVA_HOME=3DC:\beawli\jrockit_150_11 =20 set ANT_HOME=3DC:\apache-ant-1.7.0 =20 set PATH=3DC:\apache-ant-1.7.0\bin;C:\beawli\jrockit_150_11\bin;C:\apache-a= nt-1.7.0\bin;C:\beawli\jrockit_150_11\bin;C:\oraclexe \app\oracle\product\10= ..2.0\server\bin;C:\WINDOWS\system32;C:\WINDOWS;C: \WINDOWS\system32\wbem;C:\= Program Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5;C:\Pr= ogram Files\Common Files\Teleca Shared;C:\Program Files\QuickTime\QTSystem; =20 set CLASSPATH=3DC:\beawli\wlserver_10.0\server\lib\web logic.jar;.; =20 =20 I have an ear file with the following application.xml: =20 <?xml version=3D"1.0" encoding=3D"UTF-8"?> <application xmlns=3D"http://java.sun.com/xml/ns/j2ee" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=3D"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" version=3D"1.4"> <display-name>stufkletser-ear</display-name> <module> <web> <web-uri>stufkletser-ws.war</web-uri> <context-root>stufkletser-levent</conte= xt-root> </web> </module> </application> =20 =20 I created a deployment plan with the following command: java weblogic.PlanGenerator -all stufkletser-app.ear Generating plan for application stufkletser-app.ear Export option is: all Exporting properties... Saving plan to C:\ plan.xml... <20-jun-2008 12:24:19 uur CEST> <Info> <J2EE Deployment SPI> <BEA-260086> <= The d escriptor information at C:\DOCUME~1\LEVENT~1\LOCALS~1\Temp\Levent Tutar\.\= confi g\deployments\stufkletser-app.ear\plan\stufkletser-ws.war\WEB-INF\weblogic.= xml was saved to configuration area.> <20-jun-2008 12:24:19 uur CEST> <Info> <J2EE Deployment SPI> <BEA-260072> <= Saved configuration for application, stufkletser-app.ear> =20 =20 Editing plan.xml =20 I replaced the following <variable> <name>WeblogicWebApp_ContextRoots_12139574589845 </name> <value xsi:nil=3D"true"></value> </variable> With=20 <variable> <name>WeblogicWebApp_ContextRoots_12139574589845 </name> <value>levent</value> </variable> =20 And (for testing purposes) =20 <variable> <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> <value xsi:nil=3D"true"></value> </variable> =20 <variable> <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> <value>123</value> </variable> =20 Also added <operation>replace</operation> to two places: =20 <variable-assignment> <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> <xpath>/weblogic-application/session-descriptor/cookie-max-age-secs= </xpath> <operation>replace</operation> =20 </variable-assignment> =20 =E2=80=A6. =20 <variable-assignment> <name>WeblogicWebApp_ContextRoots_12139574589845 </name> <xpath>/weblogic-web-app/context-root</xpath> <operation>replace</operation> = =20 </variable-assignment> =20 Deploying the application with WLST: =20 Content of deploy.py connect('weblogic', 'weblogic', 't3://localhost:8001') edit() startEdit() progress=3Ddeploy(appName=3D'stufkletser-app',path=3D'C:/stufkletser-app.ea= r',planPath=3D'C:/ plan.xml') progress.getState() save() activate() =20 =20 java weblogic.WLST =20 Initializing WebLogic Scripting Tool (WLST) ... =20 Welcome to WebLogic Server Administration Scripting Shell =20 Type help() for help on available commands =20 wls:/offline> execfile('deploy.py') Connecting to t3://localhost:8001 with userid weblogic ... Successfully connected to Admin Server 'AdminServer' that belongs to domain= 'els b_domain'. =20 Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. =20 Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). =20 For more help, use help(edit) =20 Starting an edit session ... Started edit session, please be sure to save and activate your changes once you are done. Deploying application from C:\stufkletser-app.ear to targets (upload=3Dfal= se) ... You have an edit session in progress, hence WLST will not block for your deployment to complete. Started the Deployment of Application. Please refer to the returned WLSTPro= gress object or variable LAST to track the status. Saving all your changes ... Saved all your changes successfully. Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. Activation completed wls:/elsb_domain/edit> =20 =20 =20 Result after deployment I see in weblogic console the following: Context Root /stufkletser-levent I expected /levent as context root. The other parameter has been set to 123. Session cookies max age (in seconds): 123 =20 Question: Why can=E2=80=99t I change the context root? Kind regards, Levent |
|
#2
| |||
| |||
| I think you are trying to change the context-root in weblogic.xml instead of the context root in application.xml Should you use an xpath like <xpath>/application/module/web/context-root</xpath> Levent Tutar wrote: > Hi, > > > > I have trouble changing the context-root of a web application with deployment plan. Does anybody have experience with it? > > > > > > I have the following environment settings: > > set JAVA_HOME=C:\beawli\jrockit_150_11 > > > > set ANT_HOME=C:\apache-ant-1.7.0 > > > > set PATH=C:\apache-ant-1.7.0\bin;C:\beawli\jrockit_150_11\bin;C:\apache-ant-1.7.0\bin;C:\beawli\jrockit_150_11\bin;C:\oraclexe \app\oracle\product\10..2.0\server\bin;C:\WINDOWS\ system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Pr ogram Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5;C:\Program Files\Common Files\Teleca Shared;C:\Program Files\QuickTime\QTSystem; > > > > set CLASSPATH=C:\beawli\wlserver_10.0\server\lib\weblo gic.jar;.; > > > > > > I have an ear file with the following application.xml: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <application xmlns="http://java.sun.com/xml/ns/j2ee" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/application_1_4.xsd" > > version="1.4"> > > <display-name>stufkletser-ear</display-name> > > <module> > > <web> > > <web-uri>stufkletser-ws.war</web-uri> > > <context-root>stufkletser-levent</context-root> > > </web> > > </module> > > </application> > > > > > > I created a deployment plan with the following command: > > java weblogic.PlanGenerator -all stufkletser-app.ear > > Generating plan for application stufkletser-app.ear > > Export option is: all > > Exporting properties... > > Saving plan to C:\ plan.xml... > > <20-jun-2008 12:24:19 uur CEST> <Info> <J2EE Deployment SPI> <BEA-260086><The d > > escriptor information at C:\DOCUME~1\LEVENT~1\LOCALS~1\Temp\Levent Tutar\..\confi > > g\deployments\stufkletser-app.ear\plan\stufkletser-ws.war\WEB-INF\weblogic.xml was saved to configuration area.> > > <20-jun-2008 12:24:19 uur CEST> <Info> <J2EE Deployment SPI> <BEA-260072><Saved configuration for application, stufkletser-app.ear> > > > > > > Editing plan.xml > > > > I replaced the following > > <variable> > > <name>WeblogicWebApp_ContextRoots_12139574589845 </name> > > <value xsi:nil="true"></value> > > </variable> > > With > > <variable> > > <name>WeblogicWebApp_ContextRoots_12139574589845 </name> > > <value>levent</value> > > </variable> > > > > And (for testing purposes) > > > > <variable> > > <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> > > <value xsi:nil="true"></value> > > </variable> > > > > <variable> > > <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> > > <value>123</value> > > </variable> > > > > Also added <operation>replace</operation> to two places: > > > > <variable-assignment> > > <name>SessionDescriptor_CookieMaxAgeSecs_121395745 903116</name> > > <xpath>/weblogic-application/session-descriptor/cookie-max-age-secs</xpath> > > <operation>replace</operation> > > </variable-assignment> > > > > …. > > > > <variable-assignment> > > <name>WeblogicWebApp_ContextRoots_12139574589845 </name> > > <xpath>/weblogic-web-app/context-root</xpath> > > <operation>replace</operation> > > </variable-assignment> > > > > > > Deploying the application with WLST: > > > > Content of deploy.py > > connect('weblogic', 'weblogic', 't3://localhost:8001') > > edit() > > startEdit() > > progress=deploy(appName='stufkletser-app',path='C:/stufkletser-app.ear',planPath='C:/ plan.xml') > > progress.getState() > > save() > > activate() > > > > > > java weblogic.WLST > > > > Initializing WebLogic Scripting Tool (WLST) ... > > > > Welcome to WebLogic Server Administration Scripting Shell > > > > Type help() for help on available commands > > > > wls:/offline> execfile('deploy.py') > > Connecting to t3://localhost:8001 with userid weblogic ... > > Successfully connected to Admin Server 'AdminServer' that belongs to domain 'els > > b_domain'. > > > > Warning: An insecure protocol was used to connect to the > > server. To ensure on-the-wire security, the SSL port or > > Admin port should be used instead. > > > > Location changed to edit tree. This is a writable tree with > > DomainMBean as the root. To make changes you will need to start > > an edit session via startEdit(). > > > > For more help, use help(edit) > > > > Starting an edit session ... > > Started edit session, please be sure to save and activate your > > changes once you are done. > > Deploying application from C:\stufkletser-app.ear to targets (upload=false) ... > > You have an edit session in progress, hence WLST will not > > block for your deployment to complete. > > Started the Deployment of Application. Please refer to the returned WLSTProgress > > object or variable LAST to track the status. > > Saving all your changes ... > > Saved all your changes successfully. > > Activating all your changes, this may take a while ... > > The edit lock associated with this edit session is released > > once the activation is completed. > > Activation completed > > wls:/elsb_domain/edit> > > > > > > > > Result after deployment > > I see in weblogic console the following: > > Context Root /stufkletser-levent > > I expected /levent as context root. > > The other parameter has been set to 123. > > Session cookies max age (in seconds): 123 > > > > Question: > > Why can’t I change the context root? > > Kind regards, > > Levent |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.