I have NetBeans web application, with HTML, JavaScript, CSS files... and I have some Java files which I manage to call in the web application with DirectWebRemoting.
It is using NetBean's Tomcat.
After "Clean and Build", I get a WAR file in dist/
I put this WAR file into XAMPP/tomcat/webapps directory
Run the application with XAMPP Tomcat, but then the Java files would not work using XAMPP's Tomcat.
Question: How do I compile the build, so that when I put into XAMPP it would work? This is so that everytime I run the application I don't need to turn NetBeans on.
Use the Tomcat Manager application to upload the war file, dropping them directly in the /webapps directory doesn't work for me sometimes too.
Here's a link to know more about using Tomcat Manager Application
Related
I'm trying to learn Java and want to write a basic webapp using Vaadin (and Maven) in Eclipse.
I have a single java file which should create a window with a single panel.
I have a tomcat server setup, but when I try and run my project on that I can't get past this error:
java.lang.ClassNotFoundException: com.vaadin.server.VaadinServlet
I have "vaadin-server-7.6.4.jar" installed in my Maven dependencies folder, so I am guessing I haven't set the paths correctly in the web.xml (or pom.xml?).
Any ideas where I should start troubleshooting this?
Check if the jar is present in the Classpath. Either that jar should be inside the lib folder of Tomcat installation directory or it should be packaged in the lib folder of the web app.
I received some java code and a WAR file for a web application that I need to test.
My overall goal is to be able to test the web application functionality and potentially make modifications to the code if need be.
I seem to be stuck on correctly loading this into eclipse.
I grabbed the WAR file and did a Import where I attempted to import the WAR file into a (Web -> WAR) project. The first issue was Eclipse was complaining there not being enough memory or the heap size. So I changed the java memory options in the eclipse.ini file. This seemed to resolve the complaining about the memory.
I restarted eclipse and attempted to import the Web - War again now it goes through the process of pretending like it is importing the war file but nothing happens after it finishes.
So overall my questions are
1 What is the correct process to load the war and source code into eclipse
2. Why is Eclipse not loading the war file
If you want to test a WAR file, you must deploy it to a Servlet container. Common Servlet containers include: Tomcat, Jetty, JBoss (which actually uses Tomcat), WebSphere, and WebLogic.
JBoss, WebSphere, and WebLogic are JEE environments, but they each have a Servlet container.
WAR file generally contains compiled version of .Java file i.e. .class file and other web related stuff.
You unzip the .war file with WinZip or similar software, if it contains source code attached, then only you can view or modify the code.ELSE you can do the below steps to run the application.
Install a server e.g Apache Tomcat to your PC.
Start the server from CMD.
Open the server home page.
Deploy your WAR file. Now you will be able to see the Application running.
If you want to modify the code then you should have .Java files inside your war file.
There's a huge legacy codebase that I'm working with and I need to export it into an executable JAR file to make it easier for my co-workers to run it. It's a web application built on top of GWT, but I'm not sure what kind of application server it uses (e.g. Apache Tomcat, Eclipse tells me it uses a "built-in" server).
The run configuration shows up when I try to run the project, but not when I'm trying to export it as an executable JAR. All it does is run an application server on the machine, and allows a user to access it via 127.0.0.1:8888 in a web browser. Any ideas?
Right click on the project.
Google
GWT Compile
Zip the output (I think the war folder) into a war file which can be deployed in tomcat or jetty or something else.
(Creating an executable jar from a GWT project is not possible, you should create a war).
(Make sure to have the eclipse google plugin installed (https://developers.google.com/eclipse/docs/getting_started))
I have a Java web project in Eclipse which I run through Eclipse on Apache Tomcat.
Is there a way for me to permanently deploy the project on Tomcat such that it runs without having to open Eclipse and rather just starting Tomcat?
If yes, then what steps do I need to follow?
*UPDATE*
If I take the .war file and deploy it on another system will it work? Note that I am using a MySql database in this project. So will transferring the .war file also transfer the database?
You package the project into a war file (since it is a web project) and put that one into the Tomcat's webapps folder. The deployment should then happen automatically, when Tomcat is started.
Generate a WAR file within Eclipse. (Properties->Export->WAR File)
Place this file in the {installation}/webapps folder of Tomcat.
It should deploy now.
I'm working on my first Java EE project with NetBeans IDE. My application server is the integrated GlassFish.
At this moment my project run locally on my Mac with MySQL database. How can I deploy it on my web server?
You need to just create the war file and copy it to your web server. When you start your web-server it will automatically deploy the war file.
You need to use the remote application server functionalities of deploy.
If it's also Glassfish you can use the Administration Console to do it - e.g. example.com:4848 (defaut port for Glassfish admin portal).
Also you may use Cargo Maven Plugin in order to automate the deploy.
You have different possibilities:
Netbeans can deploy your application on the integrated Glassfish server. This should happen automatically if you Run you project and the Glassfish server is selected for this project. You can change the selected server for every project under Project Properties -> Run
You can deploy .war files via the Glassfish admin console if the Glassfish server is already started. Navigate to http://localhost:4848, go to Applications and click on Deploy
You can manually deploy you applications. You have to copy either the .war file or a folder containing the contents of the .war file to the folder /GLASSFISH_HOME/glassfish/domains/domain1/autodeploy