WLST: deploy application but do not start it -- how? - weblogic

I need to script an EAR deployment to Weblogic 9.2. Extra requirements I have though are:
Application Name shall be the one I provide, not just EAR name
Application is deployed in Prepared state, not Running one
As far as I can tell, when I use deploy(), the name is got assigned by me (good!), but application starts right away (bad! other services are not ready yet!).
Can anyone point me to a correct way of doing that?

I think that what you're looking for is distributeApplication, not deploy (also see Administration Mode for Isolating Production Applications).
For the application name, why don't you set it in the deployment descriptor?

Related

How to set Spring active profile while running in WebLogic?

I want to set spring active profile in weblogic settings.
I have three properties in src/main/resources. For examp : application-dev.properties , application-qa.properties , application-test.properties.
I dont want to keep spring.profiles.active property in my application.properties file. As I have to change it every time whenever I want to deploy in different server.
I want to active the profile in weblogic (my deploying server for application). Whats is the way and how to fetch the value in springboot application?
Thanks
Pass the profile as java argument -Dspring.profiles.active=dev
A secure way to set profiles in springboot applications is to set environment variables with it. In general, it is a good approach, so you can define it differently for each one of your environments (dev, qa and prod).
Please check this discussion, which explains specifically about Weblogic. In java, you need the SPRING_PROFILES_ACTIVE environment variable set.

Mule startup order for applications

So, i have three mule applications where one needs to be started before the other two. And I start mule as a windows service. I found this site and follow the example by putting
wrapper.app.parameter.1=-app
wrapper.app.parameter.2=%MULE_STARTUP_ORDER%
in wrapper.conf. where MULE_STARTUP_ORDER is an system variable containing App1:App2:App3
But when i look in my mule.log after staring the service app2 starts first followed by app3 and app1 is last.
And I use mule standalone 3.7.0.
Anyone have any idea what I am doing wrong/missing?
Try setting the list of applications directly in wrapper.conf in case the service has no access to the system environment variable from Windows. Also try using higher numbers for the parameters like the example in the KB article you referenced. Low numbers might be get overridden by other parameters.
Example:
wrapper.app.parameter.10=-app
wrapper.app.parameter.20=app1:app2:app3

Cannot use name when deploying application in Mulesoft Cloudhub

I am using Mule 4 and I am looking to deploy a new application in Cloudhub but it is not allowing me to use the name "customer-api". There is no other application called that in any of the environments and I cannot see it used in API manager either. There was an API called customer-api which has been deleted so not sure if this name could still be cached/ registered somewhere and the entry needs to be cleared.
The only place I can see that name used is in the Anypoint Exchange but wouldn't think that would impact what we are deploying.
Does anybody know what could be preventing me from using that name?
Thanks for any help
Every MuleSoft customer uses the cloudhub, which means it has to be "globally" unique. Try customer-api-randomString and it should work.

Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener

While using Windows Azure Table Storage in WCFService WebRole, tried to create CloudStorageAccount by the following way:
storageAccount =
CloudStorageAccount.Parse(Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting("[Setting name]"))
Get exception:
ConfigurationErrorsException "Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35."
MSDN help says that 1) Visual Studio must be run as an administrator. 2) A role must be running under full trust (change the .NET trust level option to Full Trust).
All Done, but I still have the same exception.
One thing that can cause this error is running the web role itself, instead of running the containing cloud project. If this is the issue, you could fix it by ensuring that the cloud project is set as the startup project for debugging, and not the web role.
It's possible, and sometimes useful, to run the ASP.NET project that defines the web role on its own. This can be a lot quicker than running things in the Azure Compute Emulator. It may also enable you to develop your project without having to run VS elevated. Also, I've found that the emulator tends to cause Visual Studio to report an invalid memory access error from time to time, at which point you need to restart VS. Running the web role directly avoids all these problems.
However, there are some things that can prevent this from working, and the exception you describe is a symptom of one of these problems. If your web role's Web.config includes configuration for Azure's DiagnosticMonitorTraceListener (and Visual Studio adds that by default when you create a web role) then the first thing that tries to generate trace output will crash with the error you describe if you run outside the emulator. And as it happens, retrieving a setting from the CloudConfigurationManager appears to do this.
This isn't peculiar to the CloudConfigurationManager by the way. All it's doing is producing some trace output. VS configures web roles to send all trace output to the Azure diagnostic listener, and because that listener can only run in either the compute emulator or an actual Azure instance, the first thing that tries to produce trace output will crash. CloudConfigurationManager is a common candidate because it happens to produce trace output, and it typically gets used early on when a role starts up. But in principle, anything that produces trace output could hit this exception.
A simple way to avoid this is to remove the relevant section from the configuration file. When you create a new web role, Visual Studio adds a <system.diagnostics> section that configures the default trace output to go to the Azure diagnostic listener. You could just comment that out. That will enable you to debug the web role directly in Visual Studio without using the compute emulator (assuming you aren't doing anything else that depends on being in a role environment).
Of course, the problem with that is that you'll no longer get any diagnostic traces when running in Azure. One way to solve that is to move the relevant configuration to the Web.config.Release file (adding the necessary xdt: attributes).
This change will also stop the Azure diagnostic trace listener from running when you use the local compute emulator. (That's less of a problem, because the trace messages will still appear in the debugger. It just means you won't get persistent copies of the traces copied to table storage like you would when running for real.) The obvious way to fix this would seem to be to make a similar modification to Web.config.Debug (or to run the release build in the emulator), but there's a snag: apparently cloud projects do not apply configuration file transforms when packaging for the emulator by default. Fortunately, you can fix this: http://blog.hill-it.be/2011/03/07/no-web-config-transformation-in-local-azure/ shows how to enable transforms for local debugging in the compute emulator. (Transforms are never applied when debugging an ASP.NET project directly from within VS, by the way.)
I've found that this error is caused by the wrong version in your web.config
Ie., you may not have
Version=1.0.0.0
Microsoft.WindowsAzure.Diagnostics is up to version 1.8.0.0 as of now
Try updating to the current version
Remove the lines in Web.config < add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener

WCF service deployed to Azure

I have create a WCF Service Web Role project.I can consume the service locally. But I am having issues trying to deploy the service on the azure cloud. After starting the webrole it justs kepps going in a loop where it init then stops. I have not made any changes to the default WebRoleclass that was added automatically. Can anybody point me to some samples or examples of WCF being deployed to azure
The behaviour you're seeing occurs when the instance errors in the OnStart or Run. The usual diagnostics error trapping hasn't had a chance to start yet so this is a difficult problem to debug. You might try adding error trapping inside this functions that writes the error details out to either a blob or a queue so that you can see what is actually happening.
Having said that, with code that works in the dev fabric, but continues to cycle when deployed to live, the first thing to check is that all of the references have the appropriate "Copy Local" property set. Anything that is part of the framework or Microsoft.WindowsAzure.ServiceRuntime will need to have Copy Local to false, everything else should be set to true (third party assemblies an the like). If this is a web role and you're using MVC, you'll need to check that System.Web.Mvc has Copy Local set to true as well as this is not included as part of the standard framework deployed in Azure.
Have you looked at the Known Issues information on the WCF Azure code page? There's a patch that's needed, as well as a tweak to the service behavior. Hopefully this will help you.
I just found out the root of the problem. It was caused by one of my projects having the target platform set to x86. Seems like it does not support x86 build assemblies which can be a problem