Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:55:03+00:00 2026-06-09T10:55:03+00:00

I’m trying to find a way to explicitly specify the context path of a

  • 0

I’m trying to find a way to explicitly specify the context path of a web application being deployed to Glassfish 3.1.2.2 but I’ve had no luck so far. Can anyone provide guidance on this? The background to this is below:

I have a web application that consists of two separate Netbeans (7.0) projects. The first is a web service and is called FooWS. The second is a user facing web application which uses the FooWS webservice. It’s called FooApp.

I’ve recently upgraded glassfish to 3.1.2.2 in the hope of resolving some other issue and now when I deploy the FooWS app, it deploys successfully but with the context path /web rather than /FooWS. This is not something I would particularly care about except that when I try to deploy FooApp, glassfish also tries to deploy that to /web leading to the following error:

SEVERE: Exception while loading the app : java.lang.Exception: WEB0113: Virtual server [server] already has a web module [FooWS] loaded at [/web]; therefore web module [FooApp] cannot be loaded at this context path on this virtual server.

The web.xml for FooApp looks as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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">
    <context-param>
        <param-name>defaultWebRootId</param-name>
        <param-value>2631</param-value>
    </context-param>

    <listener>
        <listener-class>com.foo.service.AppInitialiser</listener-class>
    </listener>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>

The configuration for FooWS is similar. Neither contains any mention of the application context so my expectation is that it should use /FooWS rather than default to /web.

The obvious solution would seem to be to override the context path in the web.xml but I can’t find any way of doing this. Any suggestions?

Just some follow up, I accidentally changed the context path to /FooW. This time it deployed as expected to /FooW. Changing it back if /FooWS causes the old behaviour to return, that is, it deploys again to /web. It seems like I have a workaround for the moment.

For the benefit of anyone following this, I got the same behaviour with 3.1.2. I have now returned to 3.1 (b43) and it behaves as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:55:05+00:00Added an answer on June 9, 2026 at 10:55 am

    Add a glassfish-web.xml file in the same folder as web.xml

    <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
    <glassfish-web-app error-url="">
        <context-root>/FooWS</context-root>
    </glassfish-web-app>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.