0

When I deploy a webapp war to WSO2 application server, it gets deployed to a context path such as /MyApp How do I deploy it to the root context so that MyApp runs at / ?

I have tried setting WebContextRoot in carbon.xml to /MyApp/ but doing that just results in a 404 error. Any suggestions?

Community
  • 1
  • 1
kmkale
  • 115
  • 10

1 Answers1

0

As I understand you want to run some your webapp as the root webapp? If so you have to follow the below steps

  1. Change WebContextRoot top something like /console in the carbon.xml
  2. file Rename your webapp as ROOT.war

Then you will be able to deploy your webapp as the root webapp.

  • Tried it, but I get an exception below: org.wso2.carbon.CarbonException: Error while deploying webapp: StandardContext[ROOT].File[/home/ubuntu/WSO2/wso2as-5.0.1/repository/deployment/server/webapps/ROOT] ... Caused by: org.wso2.carbon.tomcat.CarbonTomcatException: Webapp failed to deploy ... Caused by: java.lang.IllegalArgumentException: addChild: Child name '/' is not unique – kmkale Mar 16 '16 at 04:17
  • did you change the webcontextroot in carboon.xml? – Thusitha Thilina Dayaratne Mar 16 '16 at 08:23
  • Yes I did change it to /console as suggested – kmkale Mar 17 '16 at 07:14
  • Ok. I got it to work in ROOT context by removing all other web apps from webapps folder. But now I get a bunch of errors in log file like TID: [0] [AS] [2016-03-18 10:37:58,286] ERROR {org.wso2.carbon.url.mapper.internal.HotUpdateManager} - error while getting webapp for host {org.wso2.carbon.url.mapper.internal.HotUpdateManager} org.wso2.carbon.url.mapper.internal.exception.UrlMapperException: Failed to retrieve the servicename from the host app1.youtility.in for every request. contd... – kmkale Mar 18 '16 at 05:11
  • I do not want to use the URL mapping feature here. I tried setting repository/conf/etc/url-mapping-config.xml: 0 but it still throws the above errors. so how do I get rid of these url mapping errors? – kmkale Mar 18 '16 at 05:12