how to deploy a web app java project which depends on tomcat and Sql Server Compact Edition (SqlCE) ?
so that the final user can only install the .jar (I don't know if it can be an .exe or not) and the setup takes care of installing tomcat (portable edition?) and SqlCE
I guess you have two options:
Use components written in java (for instance: embedded jetty as a web server, HSQLDB as a database). Then you can ship your whole application as a JAR archive (or few JARS) and create batch script which will run it (.bat under Windows, .sh under Linux or even .exe installator of some sort). This, however, might require some additional work.
Use some sort of EXE instalator wizard which will: 1. Install Tomcat into specified directory, 2. Install your desired DB, 3. Copy your webapp WAR inside newly created Tomcat installation
I would go for 1, since it will work on every OS.
Related
So I have a Spring API which I packaged as a .jar file. I would like to run this perpetually on my EC2 instance. I have downloaded tomcat 8.5 from aws-extras onto my instance and have placed the jar file in the .lib subfolder and started tomcat but I can't query the API.
Am I missing a step or is there a better way to do this without Tomcat?
The API works when run with java, but I would like a solution that has it constantly running on the server.
The easiest way I found to do this is with the following command.
nohup java -jar path/to/jar.jar &
This ensures the jar will run as a background process.
I have a simple Tomcat Server set up in Eclipse on a Windows 7 machine. Eclipse by default uses metadata to deploy Tomcat server instances without having to take over the Tomcat installation folder (and allowing multiple parallel servers, provided they don't try to use the same ports). In order to start my server up, I have to open Eclipse, build my project, and start the server my project is assigned to in the Servers view.
I would like to start this same server up:
Without having to open Eclipse
With a single action, preferably double-clicking a file on my desktop.
With its own console window
I've looked into making Java programs into standalones, and the most common suggestion is to package it into a runnable .jar file. This uses a Launch configuration, which doesn't really work for my case because the server has no associated Launch configuration; to run it you start a Server rather than clicking run.
Is there a built-in way in Eclipse to make the server equivalent of a runnable .jar? That is, is there a built-in way in Eclipse to package a Tomcat server to run as a stand-alone?
How do I create an installer exe file with MySql DB included? What is the best way to install the database along with my application?
You can use two separate technologies, one (like JSmooth) to create an exe from a jar (this exe is only a wrapper around your jar, which will be uncompressed at runtime), and another (like NSIS) for creating a "setup exe": an installer program that can include your previously created jar-exe and and any other programs, such as a database.
Of course, this would be a Windows-only solution, Windows exe files do not run on Linux/Mac. Jar files run everywhere (if Java is installed)
yes i have GUI,..
Then you need Java Web Start for deploying it (to Windows, OS X and *nix).
JWS offers the ExtensionInstallerService that might be used to invoke an installer for the DB, and a PersistenceService for storing any connection details. See demos. of both in the Java Web Start examples.
I've been looking for instructions on how to automatically start my GlassFish server with my RESTful application on top of it. I have it installed via the NetBeans IDE and I normally control it through NetBeans but I need to transition away from the dev environment to a test environment. Links to tutorials would be appriciated.
How to start a Glassfish instance when the server starts: that's operating system dependent, on Windows it involves registering Glassfish as a service, for Linux you can follow this tutorial.
How to start an application with Glassfish, or how to migrate an application from the instance embedded in Netbeans to a production server: two easy ways
register your production server in Netbeans, in project properties change the Run target to that newly registered server and deploy via right click on the project in the Projects view, option Deploy.
When you Build a project in Netbeans, a dist subdirectory will be created in the project directory - switch to the Files tab to see it. That directory will contain the compiled and packaged projet (jar, war or ear depending on the project type). Point your browser to the administrative interface of the production Glassfish (in most installations http://yourproductionserver:4848 ), select the correct application type in the tree on the left, click Deploy and upload the file from the dist subdirectory.
Personally I prefer option 2 but that may be a matter of taste. Thorbjørn already explained yet another possibility, via the autodeploy folder. Whichever you choose, the application will start once deployed and will automatically start every time the Glassfish server starts.
Create a WAR or EAR and put it in the autodeploy folder in the domain.
Then it will start every time Glassfish is started.
Additionally under Windows you can use the asadmin create-service facility to create a service (.NET required).
(Tomcat version 5.5, in case it matters.)
I have a library in one of my web applications that needs to be configured with a machine-specific license before use. I don't want to put this library in shared/lib because at some point I may want to run multiple web applications with different versions of the library.
Right now the .jar files are stored in WEB-INF/lib. Thus, when I build the .war file and upload it to the server, the .jar file would still be the one bound to my PC. I would like to put a bash script somewhere in the webapp that Tomcat would automatically run when deploying the .war file - this script would then run the configuration script and bind the server's license file to the .jar. Is this possible? Is there a nicer way of doing what I want?
You could create a ServletContextListener to do that in the contextInitialized() method. And from that listener you can run the "configuration script" directly, no other script required.