NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Issue Deploying a WebApp to Tomcat

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
pjmxx



Joined: 18 Apr 2011
Posts: 2

PostPosted: Mon Apr 18, 2011 12:52 am    Post subject: Issue Deploying a WebApp to Tomcat Reply with quote

I am learning about Java servlets and JSP and have just downloaded, installed and configured netbeans 6.9.1 and apache tomcat. When I create a simple webapp and run using tomcat I get the following issue:

C:\murach\servlet_jsp\netbeans\ex_starts\testApp\nbproject\build-impl.xml:683: The module has not been deployed.
BUILD FAILED (total time: 39 seconds)

which points to:

<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

of the build-impl.xml

I can manually deploy webapps to tomcat but not through the netbeans ide. Any ideas would be appreciated!
Back to top
mdeggers



Joined: 28 Jan 2009
Posts: 208

PostPosted: Mon Apr 18, 2011 7:32 pm    Post subject: Reply with quote

There are a couple of things to check. Please note that I don't run on
Windows Vista or Windows 7, so this may not be entirely correct for your
situation.

Under certain conditions (which I've not been able to reproduce) NetBeans
fails to create a file used for in-place deployment. This will cause
running from within NetBeans to fail.

The file is called context.xml, and is a Tomcat-specific file. It is (should be)
located in Web Pages->META-INF of your project. If it's not there, you'll
have to create it.

Here are some steps to do that.

Create the folder:
1. Right-mouse click in the Web Pages node in the Project tab
2. Select New->Other
3. In the dialog box, select Other
4. Scroll down and find Folder
5. Name the folder META-INF (case is important, even on Windows)

Create the file:
1. Now right-click on the new folder
2. Select New->Other
3. In the dialog box, select XML
4. Choose XML Document
5. Name it context (NetBeans adds .xml)
6. Choose Well-formed Document

File contents:
1. Delete the following from the automatically created file:

Code:
<root>

</root>

2. Add the following to context.xml

Code:
<Context antiJARLocking="true" path="/APath"/>

Note on the above:

APath should be the same as the Context Path for your project. You can
find that by doing the following.

1. Right-mouse click on the Project node and select Properties
2. In the dialog box, click on the Run node
3. Look at the Context Path to get the proper value (replace APath above)

If this doesn't work, then there are potentially other issues. If you've
installed Tomcat as a service, then lots of things will not work cleanly
with NetBeans on Windows. Two things that you will have issues with are
starting/stopping Tomcat (since the service does not have the .BAT files),
and permissions when running a web application in place.

The second problem is due to the fact that Tomcat as a service runs under
a SYSTEM ID with limited access. Tomcat running under this ID may not
be able to read <Project-Name>/build/web, which is where the build
is placed.

The easiest fix is to download a zip copy of Tomcat from
http://tomcat.apache.org, unzip it somewhere convenient, and
point your IDE to that installation of Tomcat. Another choice (although
it won't help with the start/stop issue) is to run the Tomcat service under
your userid as opposed to the system id. There are potential security
issues with this approach. Finally, you could change the permissions on
NetBeansProjects and below to allow the system id read access. Again, this
has potential security issues.

Summary

1. Make sure that there is a META-INF/context.xml file
2. Create it if needed
3. Run Tomcat under your userid

Hope this helps.

. . . . just my two cents.

/mde/
Back to top
pjmxx



Joined: 18 Apr 2011
Posts: 2

PostPosted: Tue Apr 19, 2011 2:37 am    Post subject: Reply with quote

thank you for your response. All of your information seemed to be not an issue with my problem.

Interestingly, I decided to try tomcat 6.0 instead of 7.0 that I was working with and it worked. I do not know why it worked exactly but I found that the necessary files were being created in the tomcat conf\Catalina\localhost directory when the webapp was run in Netbeans which did not occur with version 7.0. I wish i knew why that was the case.
Back to top
mdeggers



Joined: 28 Jan 2009
Posts: 208

PostPosted: Tue Apr 19, 2011 2:46 am    Post subject: Reply with quote

pjmxx wrote:
thank you for your response. All of your information seemed to be not an issue with my problem.

Interestingly, I decided to try tomcat 6.0 instead of 7.0 that I was working with and it worked. I do not know why it worked exactly but I found that the necessary files were being created in the tomcat conf\Catalina\localhost directory when the webapp was run in Netbeans which did not occur with version 7.0. I wish i knew why that was the case.

Yes, that's where the file ends up. Rules on how it's copied and deleted
can be found by reading the Tomcat documentation.

You didn't say you were trying to run Tomcat 7.0.x. Tomcat 7 is not
supported on NetBeans 6.9.1.

If you wish to use Tomcat 7, you'll have to install NetBeans 7. I've run
Tomcat 7.0.12 (current release) successfully with NetBeans 7.0RC2
(current release).

. . . . just my two cents

/mde/
Back to top
ivanfigueroa



Joined: 27 Feb 2013
Posts: 2

PostPosted: Wed Feb 27, 2013 12:59 am    Post subject: Same problem Reply with quote

I had the same problem.
I just create a new web app and copy and paste all folders inside
It worked.
Back to top
ivanfigueroa



Joined: 27 Feb 2013
Posts: 2

PostPosted: Wed Feb 27, 2013 1:01 am    Post subject: Re: Issue Deploying a WebApp to Tomcat Reply with quote

pjmxx wrote:
I am learning about Java servlets and JSP and have just downloaded, installed and configured netbeans 6.9.1 and apache tomcat. When I create a simple webapp and run using tomcat I get the following issue:

C:\murach\servlet_jsp\netbeans\ex_starts\testApp\nbproject\build-impl.xml:683: The module has not been deployed.
BUILD FAILED (total time: 39 seconds)

which points to:

<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>

of the build-impl.xml

I can manually deploy webapps to tomcat but not through the netbeans ide. Any ideas would be appreciated!



I had the same problem
I created a new web app and copied and paste everething from the one that fail to the new one.
It worked that way
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo