I use following wlst command in order to check if application was already deployed before:
oldApplication = find(name=d['name'], type='AppDeployment')
But it does not show that application was deployed on a specific server.
How can I find that application was deployed on a specific managed server?
oldApplication will be an AppDeployment MBean, which has the "targets" attribute.
http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e13951/mbeans/AppDeploymentMBean.html
oldApplication.targets will return an array of "TargetMBean", which will be the list of servers on which the application is targeted/deployed.
It works for me and might help you:
print 'stopping and undeploying ...'
try:
stopApplication('WebApplication')
undeploy('WebApplication')
print 'Redeploying...'
except Exception:
print 'Deploy...'
deploy('WebApplication', '/home/saeed/project/test/WebApplication/dist/WebApplication.war')
startApplication('WebApplication2')
Related
I am developing an app that needs to get from a user a server name or address and a db name and build a folder structure based on that. The problem is that in order to have the same folder for all the different ways there are to get the path to the instance (localhost, ip address, etc.) i'm running the following Query:
select cast(SERVERPROPERTY('MachineName')as varchar)+'\'+##servicename
on the target server and set my folder structure based on that, and in that format saves the connection that the user gave (doesn't matter if i got ip or a server name, there is one connection string for all).
My problem is that when the instance is the default instance on the target machine, I cant seem to connect using MACHINE_NAME\MSSQLSERVER. I can only log in using the machine without instance name. So I need to either find a way to connect to the instance using its full name (preferred) or to find a way figure out if the targeted instance is the default one.
Any help would be very appreciated.
'MSSQLSERVER' is reserved for default instance, so you can
SELECT CAST(SERVERPROPERTY('MachineName')AS VARCHAR)+ CASE WHEN CHARINDEX('MSSQLSERVER', ##SERVICENAME, 1) >0 THEN '' ELSE '\'+##SERVICENAME END
I am attempting to list certain sections of an app pool in IIS. I already have the script to set the attribute but haven't been able to find the one to list it. For example, to set the Rapid-Fail Protection to "true", I use:
appcmd set config -section:system.applicationHost/applicationPools "/[name='$appPool'].failure.rapidFailProtection:true" /commit:apphost
where $appPool is the name of your app. This method works fine. However, if I change it to something like:
appcmd list config -section:system.applicationHost/applicationPools "/[name='$appPool'].failure.rapidFailProtection"
It fails with
ERROR ( message:The attribute "[name='$appPool'].failure.rapidFailProtection" is not supported in the current command usage. )
I also tried a few variations such as the following but they had the same error:
appcmd list apppool $appPool /section:failure.rapidFailProtection
I believe I found the answer to my own question just via a different avenue. I was able to view the values using the following syntax:
$appPool = "AppPool1"
(Get-Item "IIS:\AppPools\$appPool").failure.rapidFailProtection
Using the $appPool variable I can create a loop to pull the values for each app pool.
I'm getting this error when trying to use ReportingService2010:
Unable to resolve symbol 'ExecutionInfo'
ExecutionInfo and ExecutionHeader worked in ReportingService2005. I'm using Visual Studio 2010, VB.Net, and ReportingServices2010. I can connect to the server and do things like rs.ListChildren.
Any Ideas?
I found the answer to my question. Hopefully this helps others.
There are two main type of endpoints in the Report Server web service, one for Management and one for execution.
The management endpoints are: ReportService2005, ReportService2006, ReportService2010
The execution endpoint is: ReportExecution2005
Therefore you can get report names, paths, data sets, etc. from ReportService2010, but to execute a report you must use ReportService2005.
So here's how you do it:
Add a web reference to the 2005 wsdl of your server, not 2010. So do this: http://<your server>/reportserver/ReportExecution2005.asmx Not this: http://<your server>/reportserver/ReportExecution2010.asmx
Import the referenc
Create an instance of ReportExecutionService: Dim rs As New ReportExecutionService. That is the 2005 executation service that has the ExecutionInfo and ExecutionHeader methods.
Reference: http://msdn.microsoft.com/en-us/library/ms155398.aspx
I'm writing a configuration script for a BizTalk server I need to create a few adapters.
In the "BizTalk Server Administration" application this is done by going to Biztalk Server Group / Platform Settings / Adapters and choosing New / Adapter from the right-click menu.
I'd like to automate this process somehow, using a Powershell script or a SQL script. I tried to use the adm_Adapter_Create stored procedure in teh Biztalk DB but it doesn't work all the way as no send / recieve handlers get configured.
Is there any way to automate this adapter creation?
You need to use WMI for this with the MSBTS_AdapterSetting class. There's some example code for this here.
Part of a Powershell script I wrote to solve this:
$adapterClass = [WMIClass] "root\MicrosoftBizTalkServer:MSBTS_AdapterSetting"
$adapter = $adapterclass.CreateInstance()
$adapter.Name = $adapterXml.name
$adapter.Comment = $adapterXml.comment
$adapter.Constraints = $adapterXml.constraints
$adapter.MgmtCLSID = $adapterXml.MgmtCLSID
$adapter.put() | Out-Null
I'm building an application based on the WebSharingAppDemo-CEProviderEndToEnd. When I deploy the server portion on a server, the code gives the error "The path is not valid. Check the directory for the database." during the call to NeedsScope() in the CeWebSyncService.cs file.
Obviously the server can't access the client's sdf but what is supposed to happen to make this work? The app uses batching to send the data and the batches have to be marshalled across to the temp directory but this problem is occurring before any files have been batched over. There is nothing for the server to look at to determine whether the peerProivider needs scope. What am I missing?
public bool NeedsScope()
{
Log("NeedsSchema: {0}", this.peerProvider.Connection.ConnectionString);
SqlCeSyncScopeProvisioning prov = new SqlCeSyncScopeProvisioning();
return !prov.ScopeExists(this.peerProvider.ScopeName, (SqlCeConnection)this.peerProvider.Connection);
}
I noticed that the sample was making use of a proxy to speak w/ the CE file but a provider (not a proxy) to speak w/ the sql server.
I switched it so there is a proxy to reach the SQL server and a provider to access the CE file.
That seems to work for me.
stats = synchronizationHelper.SynchronizeProviders(srcProvider, destinationProxy);
vs.
SyncOperationStatistics stats = syncHelper.SynchronizeProviders(srcProxy, destinationProvider);