Websphere AS conflicts between Two eclipse workspaces - java

I am new to Websphere. Right now, I am setting up workspace for two projects in separate eclipse workspaces in MyEclipseBlue 2016 using Websphere 8.5 Application Server. Profiles are configured separately for those projects.
Need to work with both applications at the same time since one application depends on the other. When I deploy the applications separately by opening any one workspace, server starts without any errors. But when both workspaces are open, starting/stopping a server in one workspace, makes the server in other workspace to does the same and exception occurs when server starts.
I don't know how this occurs, How both the servers in separate eclipse workspaces are integrated?
Websphere variables under Environment in Admin console are different for both projects since they are configured with different profiles. But When deploying both the applications at the same time, Websphere variables specific to any one of the profiles gets applied for both the projects.
Unable to find the way to deploy these two projects with different websphere profiles at the same time.
Please advise.

To be clear, you have an installation of WAS 8.5, with two profiles, say AppSvr01 and AppSvr02, and two eclipse workspaces, say ws1 and ws2, and you are using the WebSphere Application Server Developer Tools for Eclipse to manage the servers? And ws1 workspace is configured in WDT to use WAS profile AppSvr01 and ws2 workspace is configured to use WAS profile AppSvr02? If the interaction you describe is happening, some possibilities are 1) WDT is using the same WAS profile in both ws1 and ws2 workspaces, 2) the WAS profiles AppSvr01 and AppSvr02 have conflicting port assignments, or 3) WDT is not configured to use unique ports to communicate with the server. #1 is easy to check in the WDT Server editor settings. #2 shouldn't be the case as you stated the port assignments are unique to the profiles. #3 is also easily checked in the WDT Server editor. Examine the "Server connection types and admin ports" section for both profiles and verify they're unique to each workspace, if not, override them. If they are unique, run each workspace by itself, have WDT start the server and examine the logs to see what profile the workspace is actually starting and on what ports.

The WebSphere connectors in MyEclipse are somewhat intelligent in that they can detect if the server is running or not. When you start WebSphere in one workspace, the other will detect that it is started and show "running" status. Similarly if the server is stopped. Although you have separate profiles, are they using the same ports? If so, change the port numbers. You can see the port numbers quickly by double clicking the connector in the Servers view (which brings up a configuration editor) though you'll have to change them through the WebClipse profile manager.
Alternatively, use a single workspace for both projects, since one depends on the other, and use a single profile. You haven't said why you need to use separate profiles and workspaces (not sure how the dependency works in that case).

Related

Websphere Server Profile for different node and cell name

I'm relatively new to Websphere. I have created a WAS ( Websphere Application Server 8.5) profile configuration on local, manually from scratch which contains multiple data sources, queues, connection factories and activation specifications. ( Windows 7 PC). I backed this up using backupConfig.bat. I wish to replicate this profile configuration on another system where the Websphere Application Server (installation cannot be altered) has a different Node and Cell name. Is there a way where I can replicate it , without having to manually create the resources again,one-by-one , in the local WAS profile on the new system? When I googled this, it threw up the manageprofiles command, though I am not sure if it's backup option will work in my case. Thanks in advance.
If these are simple queues, datasource etc you can use Property based configuration - see Using properties files to manage system configuration.
You export configuration from one cell and import to the other.
If you have few elements you can use WebSphere Configuration Migration Tool (Eclipse plugin), which will allow you to select graphically which resources to move - it generates jython script that you can execute on target environment.

Why does JBoss always redeploy .WAR files that have already been deployed but not changed?

I am new to using the JBoss 7.1.1 server and am confused by a behavior that I have observed.
My JBoss server is deploying the six jBPM .war files (designer, drools-guvnor, jbpm-form-builder, jbpm-gwt-console, jbpm-gwt-console-server, jbpm-human-task-war) which I have placed in the .\jboss-as-7.1.1.Final\standalone\deployments folder.
When I launched the server for the very first time it detected these files and deployed them. I see the deploymentNNN and tempNNN folders appear in the .\jboss-as-7.1.1.Final\standalone\tmp\vfs folder. This is similar to the behavior I'm familiar with from my use of the tomcat server.
I then shut the server down and observe that the two folders created in .\jboss-as-7.1.1.Final\standalone\tmp\vfs are retained but their contents are automatically deleted. When I restart the server it once again deploys the six jBPM files into a new pair of folders in .\jboss-as-7.1.1.Final\standalone\tmp\vfs.
This is very surprising because no changes have been made to the six jBPM files and the problem is that this redeployment takes 3 to 4 minutes.
If this was just happening in a "production" environment then perhaps this would not be much of an issue. However, I am trying to integrate the JBoss server into use with Eclipse Kepler in a development environment and having to wait 3 to 4 minutes for each code change and server launch is not practical.
1) Can anyone explain why JBoss goes to the trouble to redeploy files that have not been changed?
2) Is this a behaviour that can be changed through a configuration setting?
3) Is there any settings where we can stop the jboss to redeploy the war files when it restarted
Thank you,
All
In order to stop JBoss from re-deploying your apps (and deleting on shutdown),
try deploying the apps in unpacked form.
extract the files to {name}.war directories (e.g /designer.war, /drools-guvnor.war)
and then deploy these directories (i.e copy them to the deployments folder)
Alternatively, try to deploy them using the JBoss CLI
Deploying differently won't change the fact that at startup JBOSS reloads your application to the JVM.
This can take time because your application stores data from database to your server memory. (You could as well be hitting this WFLY-925 bug... Or the one they are talking about here...)
The thing is you normally don't need to restart your server completely when redeploying. You can hot-deploy your module - see also full doc. at Auto-deploy mode. (make sure the feature isn't disabled
If you need some context to be reloaded, I advise you have a specific procedure in your code that you can call to reload all cached info. instead of restarting completely (e.g. have a call to a specific URL from your application do it...)

Avoid project's directory - Java EE app

I am writing and small app using Java EE. I am using Apache Tomcat v 7 and Eclipse as IDE. When I Run the project (Run on server) I get :
http://127.0.0.1:8080/java-web/lis
(That's fine)
But I don't know If there is some way to rewrite the [java-web] dir just to get :
http://my-local-app.dev/list
I suppose there is some way like in Apache Server using confing files and enabling
the mod_rewrite.
I'll apreciate your help. Thanks
In short: All of the pieces you want to change are components of your deployment environment. Unless you have a specific need to override them, it's usually easiest during development to use the URLs that are a little less pretty.
If you do want to alter them, you need to familiarize yourself with what the various parts of an HTTP URL mean. What you have in your test environment is this:
http:// 127.0.0.1:8080/java-web/list
protocol host port path
You could insert an entry into your hosts file listing my-local-app.dev at 127.0.0.1, but that would not change the port or the path.
The port is determined when Tomcat starts up and is 8080 by default. The general port for HTTP is 80, but specific permission is required to bind to ports below 1024. On Linux, the authbind package makes this pretty easy; on Windows, the necessary steps will depend on your version and configuration (e.g., if you have a Group Policy).
In Tomcat, Web applications are prefixed with their names in the path; it looks like your (hypothetical?) application is named java-web.war. You can install an application as the "root application", but this requires a little bit more configuration and is generally skipped in development.
All of this can indeed also be done using something like mod_rewrite, but that seems like overkill to have slightly prettier URLs for your dev machine.
If you want your application to respond to the my-local-app.dev, you need to purchase the "my-local-app.dev" domain and get a Java web hotel running on it.
If your web application is named "java-web" and you do not want the URL to reflect that, you need to tell Tomcat that you want your application deployed at the ROOT location where the name of the web application is not present in the URL. This is typically done in the deployment stage but unfortunately there is no standard location to say this for WAR files so this is vendor dependent. For example does Glassfish use an extra XML file in your deployment.
I believe Tomcat supports this for ROOT.war files. If not, you probably needs to set the META-INF/context.xml file. See https://tomcat.apache.org/tomcat-7.0-doc/config/context.html for details on what to put in this file - especially the context path.

Viewing Deployed Apps in Weblogic Server

I am new to weblogic and I would like to find out how my files are arrange in Weblogic?
I have used only Tomcat and this is the first time where I will deploy in a Weblogic Server.
In Tomcat, I could view the exploded view of my projects by looking at the Tomcat Home Directory
and the WebApps folder. There I could view how my application css/js/resource files are deployed.
%TOMCAT_HOME%\webapps
I am looking for a similar functionality in Weblogic? Can somebody tell me how? Thanks
I am using Weblogic 10.3.4 by the way
WebLogic supports several different ways of deploying applications, so the answer to your question is not very straightforward.
Typically, if you deploy a war/ear, then WebLogic will place them in the $WEBLOGIC_HOME/application directory. WebLogic will then explode your ear/war into a separate wl_stage folder that will be under your managedServer directory.
You can also use the ability of WebLogic to autodeploy ( not recommended for production apps ) where WebLogic will automatically explode the app.
In summary, you probably need to reach for the documentation to get all your questions answered.
http://download.oracle.com/docs/cd/E13222_01/wls/docs81/deployment/overview.html
I'm not quite sure if you want to find out where to deploy or where applications have been deployed.
But if you want to see where are the deployed applications in weblogic, you can go to its console (e.g. localhost:7001/console) after start the server. Then follow the following steps:
Find and click "Deployments" label
Find and click your application in the right panel
Click "Overview" tab, then you will see "Path" in the opened information table.

How do I push an update to a war file to clients?

Assuming my clients are running my J2EE WAR application on their intranet, and I have an update for them... how do I push the updated war file to them?
I'd like it to be automatic and require no human interaction on the client's side.
Can this be done?
Any help would be appreciated.
Tomcat (if this is your target container...) offers a manager interface that will allow you to deploy/start/stop applications.
I have used both ant and maven tasks to great effect in deploying wars remotely all while being built-in to the build process.
Depending on your deployment process, this may not work for you, but for dev & qa: highly recommended.
Edit: of course apache has to be configured for this type of access to be allowed.
See: Deployer how-to
Glassfish has documentation on deployment here.
Ant tasks are also available here.
Glassfish uses Tomcat internally, but the Tomcat Manager is not available as it is a separate application.
If the glassfish admin console can be accessed, it can be used to upload and deploy war files.
I'm not sure if you're comfortable giving them access to your source code repository...even in read-only mode.
If you are, then you could script up something in ANT to check out the latest version of the source code (using CVS task) and then build the .war file (using WAR task).
The only trick would be automatically deploying it once the war has been built. Tomcat will automatically deploy applications copied into a certain directory. For Websphere, see this question and this question.
For other J2EE servers I don't know how it would be done.

Categories

Resources