How to run two WAR files in same worklight server? - deployment

I want to run two different WAR files in same Worklight server. I came know it is possible from this link. But want to know how to achieve this?
How to change the context root path of war file while
building?
This link explains only to change the context root for local development environment. But i want to run it in one of the testing servers.
Do i need to mention context root while deploying? -
Currently after building ill send the war files to other team to
deploy. They do have a ant script to deploy the war into server.
Let me know do i need to take care of anything else while running 2 wars in same server.

In Eclipse Worklight Studio you will have 2 Worklight projects. Each Worklight project will have its own .war file (in the \bin folder). By default, the context root of each project is the name of the project.
These .war files are separate of each other. They run separate of each other whether you are running in Worklight Studio or outside of it.
Outside of Eclipse Worklight Studio, you are not deploying the .war files to the Worklight Server.
You are deploying the .war files to the application server (WAS, Liberty, Tomcat) that Worklight Server is also deployed to it.
So pointing to http://worklightserver/contextRootA will be the first project, and pointing to http://worklightserver/contextRootA will be the second project

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

Can we deploy the war file of ADF fusion application into web logic server?

I have created a ADF fusion application deployed in Jdev. When I deploy it as war file in Integrated weblogic server - works fine. When I deployed that as war in standalone weblogic server - it gives me error 500.
In the console (startweblogic.cmd) "java.lang.NoClassDefFoundError: oracle/adf/model/RegionBinding"
So I found on internet that deploying it as EAR the whole application would solve. Yes. It indeed was solved. My application runs fine in standalone weblogic.
Can we not deploy it as war in standalone weblogic?
The war file is working fine in integrated but not in stand alone.
Why?
P.S.: I installed ADF runtime, prepared the deployment profile to deploy as a web application.
I think you should make a quick research on the difference between these two types of archives EAR and WAR, then it should be clear to you.
Anyways, the fact is that you are trying to deploy a Fusion application, which includes in itself two different projects: the ViewController project and the Model one. The reason why on the standalone version it can only work if you deploy as an EAR is that this type of archive can contain several WARs, JARs (and other types of archives). While a WAR can contain only one of the projects (you can create a WAR for each, the Model and the ViewController project) and related jars. But they would be separate, so they would not have access to each-others files. I bet you've tried to deploy the ViewController.war only. This is the reason why you should deploy an .ear on the standalone version.
Instead, the integrated version, if an EAR file is deployed at the application level, and it has dependencies on a JAR file in the data model project and dependencies on a WAR file in the view-controller project. (It means, you are not deploying just the war from JDeveloper, it internally creates an EAR).
I hope this link would be useful.

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.

How to Create EAR file in RAD 7.5

I have checked out a dynamic web project from a CVS repository. But, there was no EAR file to check in. Now how can I create an EAR file for the project to deploy in WAS 6?
Also can I run my project in RAD without creating an .ear file? I am a newbie to Java EE projects.
In order to be able to export an EAR, you can add a new Enterprise Application project ( New > Enterprise Application project) and select your Web project as a Java EE module dependency.
This way you can export an EAR file that will contain a WAR file built from your Web project.
If you run the wizard for creating a new enterprise application (File->New), one of the options is to add an existing web project in your workspace into the application as you create it. You can then export the enterprise application as an EAR file ready to deploy into WebSphere Application Server or, if you have the test environment set up, you can just drag-and-drop it onto the server in the Servers view. To test your web application, right-click it and choose Run->Run on Server.
Try importing as project instead of EAR files

Deploying GWT app to tomcat in eclipse

I want to use tomcat server in development mode with GWT. When I use embedded Jetty it deploys application to the current directory(where my war folder is located). So it generates all the files there. How can I configure eclipse to use tomcat server and all the deployment stuff to be copied to tomcat webapps directory. I have tried to use -noserver option in Run conigurations, but it doesn't copy any resource from war directory to server deployment directory.
Can I use tomcat server in such manner?
P.S. i want to solve this problem withou ant or maven
Using my own server in development mode instead of GWT's built-in Jetty instance
You will need to copy the contents of the WAR folder over, but only once.
Have you looked at Eclipse WTP? It allows deploying to a server right from within Eclipse.
For a GWT project, you'd then, in addition, follow that recipe: http://code.google.com/eclipse/docs/faq.html#gwt_in_eclipse_for_java_ee