Running Ear Project Out of Eclipse - eclipse

My team is taking over an existing web product that is made up of 3 Maven projects: one for a WAR, one for a couple of EJBs, and one that contains a few JBoss config files and builds an EAR that contains the WAR and EJB-JAR from the other two projects. We use Eclipse Helios and are currently building the projects individually with maven install and copying the resulting EAR to an instance of JBoss AS 6 for testing. While that process works, I am exploring the possibility of somehow streamlining that process; ideally a setup where small changes are automatically published to JBoss. Can anyone recommend a resource for configuring our projects/Eclipse to publish changes to JBoss automatically?

Get yourself "Eclipse IDE for Java EE Developers" and install JBoss Tools. The combination of the two will allow you to configure projects and server instances such that it is easy to deploy and test incremental changes.
Note that for this to work, your projects need to be WTP conformant. If you aren't using WTP already, take a look at the structure and metadata of projects created with Dynamic Web Project, EJB and Enterprise Application Project wizards. Either copy your source into new projects or copy the metadata files and fragments (very carefully).

Related

WebSphere Liberty Eclipse won't publish application to apps directory

I have a 4-project, Maven-based EAR application (JavaEE-7.0) with a parent, WAR, resources, and EAR project. I am using Eclipse Oxygen with the latest release of WAS Liberty 17.0.0.2 and the latest release of the WAS Liberty plugin for Eclipse Oxygen.
I have no error markers anywhere in any of my files and Maven can produce an EAR.
When I try to publish to Liberty, nothing happens. I've done all number of possible cleans: workspace cleans, Liberty server clean, Maven clean, etc. but even though the server says [Synchronized], nothing ever shows up in the apps directory of my server.
The server is locally hosted on Windows 10 and I'm using JRE 8u141.
When WLP starts up, it says CWWKZ0014W: The application foo could not be started as it could not be found at location blah.ear.
I've tried nuking my WLP installation and reinstalling from scratch; still no dice.
(Cue rant about tools keeping me from getting work done...)
How can I resolve this?
Are you using the Add/Remove dialog from the Servers view to publish the EAR to the server? This works for me using my sample maven EAR project.
A few things to check:
EAR project's Deployment Assembly page references the other projects
The WebSphere Application Server Liberty Targeted Runtime is checked on the Targeted Runtimes properties page for each of the projects
Project > Build Automatically is turned on (or you've done a Build All) in your workspace
Your server's server.xml should contain an 'enterpriseApplication' element after the publish
If the publish still doesn't work, can you provide more details about your EAR's pom as well as how you created the project. (using an archetype? based off of a sample? converted an existing EAR project to a maven project?)

Running Maven project on glassfish server

I want to run web based Maven project on glassfish server. I am totally new on maven. However, i have successfully build the maven project and glassfish server is up and running also. Moreover, there is WAR file also in target folder but i am confused what is the next step to run that project on glassfish ?
Any help will be highly appreciated.
You have different options to solve this task:
If you are new to Eclipse I suggest to change to NetBeans. It comes with integrated support for application server deployments. You just add your maven (or nearly any other type of project like WAR, EJB and EAR) project and your desired application server instance (Glassfish) and you are ready: Right-click your project and choose Deploy and it'll get deployed to your server. NetBeans also supports hot-deployment.
You can deploy your WAR file manually in GLASSFISH_ROOT/glassfish/domains/domain1/autodeploy and it'll get deployed if your server is running. But this is not very efficient during development.
If you want to stay with Eclipse you can use the maven-glassfish-plugin or this maven plugin to do the deployment for you. I'm not sure which one is better but this topic is also discussed in this question and this question.

Hot deployment of java web module with maven in weblogic 10.3

I tried to search the steps involved in hot deploying the java web application in weblogic 10.3, but couldn't succeed. Can some one help me out in describing the steps required for hot deployment. I am using maven multi-module project(web module, .war file) with eclipse. Each time if any changes are there to java files I am rebuilding the entire project and redeploying it to test in web logic 10.3.
Also just want to under stand where can I find WEB-INF/classes (.class files) in weblogic directory? I could able to see all files except files under WEB-INF/classes in /servers/AdminServer/tmp/_WL_user//war/...
Thanks
Santhosh

Integrate War-Plugin for m2eclipse into Eclipse Project

I set up a small web project with JSF and Maven. Now I want to deploy on a Tomcat server. Is there a possibility to automate that like a button in Eclipse that automatically deploys the project to Tomcat?
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process (eclipse/m2eclipse).
Can you link me to help or try to explain it. Thanks.
I set up a small web project with JSF and maven. Now I want to deploy on a Tomcat Server.
During development I recommend to use Eclipse Web Tools Platform (WTP). M2Eclipse provides support for it (assuming you have Maven Integration for WTP installed) and your project should be recognized as a Dynamic Web Project runnable on a Server.
So, declare Tomcat as a Server (show the Servers view and right-click in it to add a Server via New > Server). And deploy your project to it (right-click on your project then Run > Run on Server).
There are other options like using the Tomcat Maven Plugin or the generic Cargo Maven Plugin but I wouldn't use them for development and, since you are a Maven beginner, I don't recommend them at all. Use your IDE.
I read about a the Maven War Plugin but I couldn't find a tutorial how to integrate that into my process.
Actually, the Maven War Plugin is only responsible of the packaging of your webapp project (it is bound automatically on the package phase when using a <packaging>war<packaging> for your project). It isn't used for deployment. But as I said, use your IDE to deploy your application during development.
The war plugin is for generating war files, not for deploying them. What you are asking for may be provided by the Cargo Plugin. Another interesting candidate for you could be the jetty-maven-plugin.

How to deploy on JBoss exploded web application from Eclipse Galileo?

Is it possible to deploy on JBoss exploded web application(not archived war file) from Eclipse Galileo?
JBoss Tools supports exploded deployment with both "native" Web Tools(WTP) style projects (i.e. those projects created by the Dynamic Web Project based wizards) and via the generic Project Archives plugins.
If you already got a WTP style project then you simply just need to install jboss tools and create a server from the "JBoss Community" or "JBoss Enterprise Platform" category (The "JBoss" one is the WTP generic server which is very incomplete) and deploy your project to the server and it will by default be deployed exploded.
If you want to deploy in zipped form there is an option for this in the server editor (double click on the server in the server view and look in the deployment section)
We are using MyEclipse plugin for eclipse which has this specific capability, but it's a commercial plugin.
If you deploy your application only on JBoss, then you have the JBoss tools plugin for eclipse. According to their documentation they also support this mode and this plugin is free, but I have never tried it.
It has been a long time since I used it but, according to this post, it should be possible using JBoss Tools (previously known as JBoss IDE, before the merge with Exadel). Quoting the blog post:
One of my favorite feature in JBoss Tools is the "Project Archives" which provides automatic and incremental archiving of arbitrary directories into a zipped archive (jar,zip,war,etc) or into an exploded directory. Usable for any development that wants hot and/or exploded deployment.