Remote debugging local Java application with VSCode - java

I want to debug a JavaEE Webapp on my local machine with VSCode.
The application installation comes with a JRE 7 (integrated in the application folder) and is startet by an .exe file for the application.
This in turn starts a tiny webserver and the JavaEE webapp / Servlet and a portable browser to access that webapp. The installation does not contain java source file classes, only jars with contained class files and resources. There is no docker container involved.
Is it possible to attach VSCode to debug such a scenario?

Related

Eclipse not loading WAR file

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.

How do I export a GWT project into a executable JAR file with Eclipse?

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))

Compile Netbeans Web app with Java files (for deployment on XAMPP?)

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

Deploy web application on JBoss via custom installer

I am not sure where should I start from as I have to deploy a web application on JBoss via custom installer.
I have created the Dynamic Web Apllication which comunicates with BES (BlackBerry Enterprise Server) to perform some operations on devices.
Now I want to create a installer file (.exe) file which will take care of following things:
Installation of JBoss server on client machine
Deploy my application on JBoss server
so that I just have to give that installer file to client and on single click the installer will do all the things for me.
Package the normal (unmodified) JBoss distribution into your installer
The installer unpacks the JBoss distribution, and uses jboss-cli.sh to configure it.
The installer copies your application into the deployment directory
Configure and deploy your application on your development system (including data sources etc.)
Package that JBoss installation into your installer (you probably don't need the content in .../standalone/data/)
The installer just unpacks that JBoss installation on the client's system
The 2nd options possibly seems to be easier, but in the long run, the 1st option is superior, because you automatically get a script of all configuration changes.
Note: The 1st option requires JBoss 7

deploying Java web application in exploded directory outside the Tomcat server, using Eclipse

I have been using IntelliJ IDE (version 5.1) with Tomcat server (version 5.5) to build my Java web applications. I'm now trying to migrate my project to Eclipse IDE.
When I run my web application from IntelliJ IDE, it creates a exploded directory inside my web application project folder and then starts the server and runs the web app. (i.e. no WAR files and no copy to tomcat\webapps folder).
But in Eclipse IDE, it usually deploys the web app inside Tomcat's webapps folder.
Is there any way to deploy web applications to a exploded directory outside the Tomcat server, from Eclipse IDE?
There is pretty neat Eclipse plug-ins you can install that will allow you to do that.
Have a look at Plug-in, tutorial and from Sysdeo.
Sysdeo is the one that both Apache and IBM suggests.
There are actually quite a bunch of these plug-ins from different vendors.
The trick is to find the one that best suits your needs.
Hope this helps.

Categories

Resources