wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Deploying a Visual Web Pack Application from Netbeans 5.5.1 to Tomcat 5.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Deploying a Visual Web Pack Application from Netbeans 5.5.1 to Tomcat 5.5" Watch "Deploying a Visual Web Pack Application from Netbeans 5.5.1 to Tomcat 5.5" New topic
Author

Deploying a Visual Web Pack Application from Netbeans 5.5.1 to Tomcat 5.5

Gabe Lopez
Greenhorn

Joined: Nov 07, 2007
Posts: 5
Greetings, I'm trying to create a simple web application using the Visual Web pack in NetBeans 5.5.1. I have setup Apache Tomcat 5.5 under Ubuntu 7.10. When I deploy the application, I get a 404 error saying, "The requested resource (/junkApp/) is not available."

Now, if I create a simple web application without the use of the Visual Web Pack, it works. What's the difference? I would prefer to create my application with the Visual Web pack. Does this have anything to do with Tomcat only being a Servlet container? If so, why does the bundled Tomcat work when I deploy my app?

Thanks in advance for the help.
Gabe Lopez
Greenhorn

Joined: Nov 07, 2007
Posts: 5
So figured out that if I remove the UploadFilter from my Servlet Filters, which is found in the web.xml file, my war package will deploy properly and the Visual Web App will run under Apache Tomcat5.5.

Does anyone know how to make the UploadFilter load properly in Tomcat5.5? I hate to remove it everytime and since I might need it in the near future, it would be nice to know how to get it working. I have tried packaging the webui.jar in the WEB-INF/lib directory, but this still doesn't work.
Gabe Lopez
Greenhorn

Joined: Nov 07, 2007
Posts: 5
According to my Tomcat Log, it looks like the UploadFilter is loading; however, there's some kind of AccessControlException being thrown. Anyone know what this is about?

Here are the first few lines of my Tomcat5.5 Log:
Gabe Lopez
Greenhorn

Joined: Nov 07, 2007
Posts: 5
After much digging, I have the solution for this error.

For Apache/Tomcat5.5 under Ubuntu Linux 7.10, the following line needs to be added to the policy file 04webapps.policy (for the default policy setting for all webapps) in order for the UploadFilter to work:



This makes sense to have a read and write permission since you are allowing uploads. All Tomcat 5.5 policy files can be found at:
/usr/share/tomcat5.5/conf/policy.d

Next, you need to stop Tomcat if you haven't already:
sudo /etc/init.d/tomcat5.5 stop

Then, you have to run:
sudo /usr/share/tomcat5.5/bin/catalina start -security

Finally, Start-Up Tomcat:
sudo /etc/init.d/tomcat5.5 stop

If you run into problems such as "JAVA_HOME not found" be sure to add the following line to your /etc/environment file:



The above line assumes you have Java6 installed using:
sudo apt-get install sun-java6-jdk sun-java6-jre

If you need to figure out where your JAVA_HOME is located, you should try typing:

update-java-alternatives -l

Good Luck!
Gabe Lopez
Greenhorn

Joined: Nov 07, 2007
Posts: 5
When you add the line:


Be sure to also add:


I kept getting exceptions thrown and was able to trace it to the line above.

Finally, restart the server from a cold boot ... just to be sure you have everything.
 
 
subject: Deploying a Visual Web Pack Application from Netbeans 5.5.1 to Tomcat 5.5
 
Similar Threads
Netbeans problem
Need advice on visual web app tools
Deployment error with Netbeans 6 Beta 2
Netbeans VWP File Upload component problem
File dir = new File("\\server\log\");