Search code examples
netbeansdeploymentejbglassfish-3war

Netbeans - deploy WAR error: the module has not been deployed


I've created a Java enterprise application using NetBeans 7. I'm using GlassFish v3. When I deploy my WAR file into GlassFish, it displays the error "the module has not been deployed", but if I deploy the whole enterprise application, it works.

For example,

enterprise
enterprise-ejb
enterprise-war

When I deploy "enterprise" it works, but deploying "enterprise-war" doesn't work. How can I fix this problem?


Solution

  • There are a couple things that may be happening:

    1. You have deployed 'enterprise' before you attempt to deploy 'enterprise-war'. In this case, the error probably means that the context-root is already taken, so the deploy fails.

    2. You have not deployed 'enterprise' before you attempt to deploy 'enterprise-war'. In this case the failure indicates that you have code/resources/something in enterprise-war that depends on code 'enterprise-ejb'. When the dependency cannot be satisfied at deployment time, the deployment fails.

    The 'best' way to proceed is to deploy 'enterprise' and then let NetBeans update the app as you make changes. This is usually called 'deploy-on-save'. You will hit a point where this is expensive (as you develop larger apps) but for initial exploration and learning the API phase, deploy-on-save is helpful. It lets you concentrate on your app and the APIs instead of the mechanics of deployment.