How to do Java web development without a local environment - java

I started a new job recently. I've been a Java & XML web developer for two years. The new place I'm at has several large web applications, but none of them deploy to my local JBOSS server because some genius decided to create a Java Project instead of a Dynamic Web Project. I tried following the steps to convert the project but that creates a bunch of errors which I cannot resolve.
The people I work with are all consultants and never give me a straight answer on how I can develop/test my changes locally.
Has anyone had to program in a similar situation? If so... got any advice?

I've worked on projects like that, but with Tomcat as the server instead of JBoss. I develop in Eclipse using a normal Java project, and I follow these steps:
Run an Ant script to build the project into a new WAR in a temp workspace directory.
Use an Eclipse plugin to stop the local test server.
Run an Ant script to copy the WAR to the proper directory for Tomcat to pick it up and deploy it.
Use an Eclipse plugin to start the local test server.
Tomcat's fast and the project isn't huge, so this whole process takes 12-15 seconds. With JBoss being a full enterprise app server, I'd think it might take more time.

Related

Visual Studio Code setup for Java WebApp Project without main method

I am looking to setup this project ( https://github.com/afawcett/githubsfdeploy) on my local machine. I'm not too familiar with Java but I feel I've been able to do enough (MAVEN, JAVA environment downloads and system variable settings) to get my windows machine up and running along with Visual Studio Code. I was able to get the spring boot project up and running in visual studio code without any issues so I want to believe I have all the required pieces (https://code.visualstudio.com/docs/java/java-spring-boot).
The spring-boot project has a main method and the one I'm trying to recreate doesn't. I am receiving the error when debugging the githubsfdeploy project that a "main" method could not be found. I've been researching other ways to run a java project without using the main method but haven't recognized the missing piece yet. Would love some direction on what I may not be taking into account. Thanks!
This is a Maven project which based on the concept of a project object model (POM). So first, you should download Maven and Tomcat locally.
My machine: win10, vscode1.49.0, JDK11
VS Code Extension installed: Java Extension Pack, Tomcat for java
and i download: apache-maven-3.6.3-bin.zip and Tomcat9.0.38 and extract them
Add maven to Environment Variables:
---\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin
Open the project in VS Code, add the following code in User settings.json:
"maven.executable.path": "---\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin\mvn",
Follow the picture steps:
Add the tomcat server and run the .war on tomcat, here is a gif tutorial: work with tomcat
Finally, you will observe this result:
When you can run it successfully, debugging is achievable: right click the tomcat server and choose debug war packages:

Can Visual Studio Code incrementally compile a Java web app project?

I'm new to Visual Studio Code. I'm trying to use it with an existing Java web app project that uses Maven. I've downloaded the recommended Java extensions like Java Extension Pack, Maven for Java, and Tomcat for Java.
In IntelliJ (my usual IDE), I can go from a small Java edit to refreshed WAR in Tomcat, pretty quickly. If I edit a file and recompile the project, it only works on a few class files, and then updates an exploded WAR directory. Then you have an option with Tomcat to restart, redeploy, or simply reload resources (like JSPs). This process means that for most changes I don't have to wait long to see the results in Tomcat and my browser.
In contrast, all I know how to do in VS Code is run a maven command to package a WAR. It takes too long. Is there something like the IntelliJ process above, where it can use the Maven pom.xml for library info but do incremental/update builds and put the classes in the exploded war?
Edit : nota solution :
From https://www.reddit.com/r/java/comments/77n6qa/jrebel_rant_alternatives/?sort=confidence
DCEVM and HotswapAgent
http://dcevm.github.io/
http://hotswapagent.org/
I'm not sure how this compares to JRebel as we've never had the budget
for such software, but for free, I was very impressed.

Ways to create a mapreduce web application

I want to create a website, and part of the website I will implemented with(Hadoop mapreduce). I start using the Eclipse with maven plugin, on my operating system (Mac OS).
I start coding with apache maven for my code. "I still not implement the website".
My question does the maven run with cluster of machines or not?
any advice of how can I create a website with part run in mapreduce??
Please help
Thanks all
Apahe Maven is not "something, that runs our code". It's actually a build tool: Apache Maven is a software project management and comprehension tool. (https://maven.apache.org/). You can manage dependencies, build, deploy and do other related stuff.
If you want some interface to your cluster, I recommend to look at zeppelin (https://zeppelin.apache.org/).
It's an interpreter for a bunch of stuff and it can be easily deployed to your server (I did it by building sources from https://github.com/apache/zeppelin and running it). Zeppelin's spark interpreter can be run in yarn-client mode, which just submits your code to cluster (yarn hadoop cluster in my case) and runs it.
Seems pretty similar to your description.
The answer to your question: maven had nothing to do with "running on cluster".

Axis2 issue with version of Axis Kernel - how to reference another project from your java project

1) I have old project that I need to modify. I need to add new web service. And I am having issues with some jar files.
I have created new service (Axis2), then I used Eclipse wizard to create Web Service Client code. Everything looks fine, except when my MyServiceStub.java showed up inside client java project, it failed to find some libraries.
I looked at few of them and it seems it is looking for Axis2-kernel-1.6.0.jar. Currently in my old project I see Axis2-kernel-1.3.0.jar and it seems that existing OtherServiceStub.java file there is using this Axis2-kernel-1.3.0.jar.
The first thing that dropped on my mind is that previously web services were created with earlier version of Axis2. My current version is 1.6.
The thing, I really don't understand is why in Project Facets it is telling me that Axis2 is of version 1.1....
Ideally, I would like to use Axis2-kernerl-1.3.0.jar, becase I want to keep changes to minimum. What Version of Axis2 do I need?
Any advice how to solve my problem?
And ...
2) If I have 2 projects, how can I automatically reference JAR of one project in another one, so when I make changes in referenced project, I see them effective when runing in project that is referencing? Right now, I export project to JAR, then I manually copy JAR (overwrite) to folder of the project that needs it.
1) You need to use whatever version of the kernel axis2 web service is currently running, ie wherever this is deployed to has a kernel version. You want your client code to talk to the server in the same version of axis basically.
You can download old releases here
http://axis.apache.org/axis2/java/core/download.cgi
2) Running vs debugging is different. If you are running axis2 on a server, not inside of eclipse, your best option is to export the jar and upload to the axis2 WEB-INF/lib directory. That way you can have a copy you debug and code upon, separate from the copy that is actually running.

deploying a java web project from local mac computer to linux server

I am wondering how I can quickly deploy the java dynamic web project that I built using eclipse on my mac to my Linode linux server? I already have a wordpress website running on the server and have also downloaded tomcat V6 and eclipse. Would I be able to manually copy the source, build and WebContent file contents? I would like to learn best practices for application deployment in the future but this project is very simple and I would like to be able to make it live as soon as possible. If you could also recommend any step by step tutorials I would really appreciate it.
thanks so much
Timnit
You should consider to build a WAR. Eclipse is just an IDE, it helps to develop, not to deploy.
Build your war (you can use maven/ant/build it from eclipse) - whatever you chose.
Once its ready your "deployment task" becomes a matter of moving a single file from MAC to linux server.
Use Cargo. See how easily it can be integrated with Maven build. Here is an excellent blog post.

Categories

Resources