Error accessing AppFabric Cache - caching

Im trying to get the Appfabric Cache running with IIS7 using an MVC asp.net project.
Using the XML-configuration provider in a shared directory.
I can access the AppFabric Cache when using the cassini webserver (My local administrator account).
When using IIS ("ApplicationPoolIdentity") I can not get it to work, and I get the standard message that it can not connect to the host.
I have tried to grant access to different users (APPPOOL\name, NETWORKservice, Everyone and so on) to the cache but I get this null exception everytime.
PS C:> Grant-CacheAllowedClientAccount "Everyone"
Grant-CacheAllowedClientAccount : Object reference not set to an instance of an
object.
At line:1 char:32
+ Grant-CacheAllowedClientAccount <<<< Everyone
+ CategoryInfo : NotSpecified: (:) [Grant-CacheAllowedClientAccou
nt], NullReferenceException + FullyQualifiedErrorId :
System.NullReferenceException,Microsoft.Applicat
ionServer.Caching.Commands.GrantCacheAllowedClientAccountCommand
I have two almost identical developer machines using win7 x64 (domain connected) where the error is the same on both computers.
But at my home computer (which is not domain connected) it works as expected with the same installation settings, same shared directory.
What I have done so far:
Reinstalled appfabric cache twice
Reconfigured the Cache to use another directory
Set configuration directory share, full access to Everyone
Security permissions for the directory, full access to Everyone.
Is there a way to go deeper and debug this error message or a solution to fix it?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataCache"
type="Microsoft.ApplicationServer.Caching.DataCacheSection,
Microsoft.ApplicationServer.Caching.Core" />
</configSections>
<dataCache size="Small">
<caches>
<cache consistency="StrongConsistency" name="default" minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
</caches>
<hosts>
<host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
hostId="1556989554" size="3003" leadHost="true" account="DOM\vitcpu7$"
cacheHostName="AppFabricCachingService" name="vitcpu7.office.domain.se"
cachePort="22233" />
</hosts>
<deploymentSettings>
<deploymentMode value="RoutingClient" />
</deploymentSettings>
</dataCache>
</configuration>

It´s because it is setup in a domain environment and the "Remote Registry"-service was not started. Since my home computer in a workgroup, did not need "Remote Registry" started its the combined which AppFabric cache needs this to make most changes in powershell.
More information at msdn social

Agree with Kiteloop, need to start "Remote Registry" and run the "Caching Admin Powershell Windows" as Run as Administrator.

For build in accounts simply use the command in this format
Grant-CacheAllowedClientAccount -Account "DOMAIN1\Server1$"
More at this MSDN link http://msdn.microsoft.com/en-us/library/ff921012.aspx

Related

Spring web project runs with Tomcat in Eclipse fine, but gives 404 when it's on standalone ApacheTomcat server

I've already deployed one project to standalone server and it works just fine. I took a copy from it to develop another project with the same dependencies. I changed all that needed to be change(think so), and the problem is that project runs just fine in Eclipse with Tomcat, and gives 404 when I try to run it on standalone server.
Is there some specific configuration that need to be done before I export war file?
Unfortunately the standalone server is our school's server so I can't provide any logs from it, because i connect to it using ftp so there is to server console. Thank you in advance!
Check if your web app is deployed and registired at tomcat's manager app gui at
http://localhost:8080/manager/html for first access you need to configure it go to tomcat/conf/tomcat-users.xml and add the following lines
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
this way you can access the manager app with user:admin, passw: admin

UAC prompt while installing from internet explorer

Hi have created an installer which installs the application at user level.
When i extract setup.exe from the cab file and run locally it does not prompt me for UAC and installs normally and installs in user context.
The application and cab are digitally signed.
But when i install the same using one click installer it prompts me for UAC and installs it in admin context.
Can any throw some light why same setup.exe behaving differently?
What can i do to avoid this?
I want my application to be installed at user level without admin access?
My guess is that setup.exe is triggering the UAC setup compatibility heuristic. From MSDN:
User Account Control: Detect application installations and prompt for elevation
When an application installation package is detected that requires elevation of privilege, the user is prompted to enter an administrative user name and password. If the user enters valid credentials, the operation continues with the applicable privilege.
Windows tries to detect certain applications that are installers (e.g. those containing setup, install, update in their filenames) and will try to elevate them automatically. Microsoft does this as a compatibility hack:
most users won't realize they are supposed to Right-click a setup application and select Run as Administrator
even fewer developers correctly mark their installer as requireAdministrator
even fewer developers use MSI, which knows how/when/if to elevate to an administrator
You can inform Windows that your application should not be run as an administrator. You do this by adding the asInvoker option to your executable's assembly manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="client"
type="win32"
/>
<description>CodeJunkie Widget Installer</description>
<!-- Disable Setup elevation compatibility heuristics since we're named setup.exe -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

How to change the IIS 7 application pool on a remote server?

I am looking to create new virtual directories on a remote server and set the app pool to a configuration other than the default. I am using NAnt but open to any other commands that can accompolish this.
Here is what I have tried:
<mkiisdir iisserver="${remote.server}" dirpath="${install.path}" vdirname="${vir.dir.name}" />
The above works fine in creating the VD to a remote server but the nant task does not have a parameter for specificing the application pool. Strange as to why not !!
I looked into using powershell to update the application pool since I already have the Virtual Directory created but due to my Windows OS restrictions I am unable to install the WebAdministration module which is required to update the IIS app pool.
Is there any existing method to accompolish this that I have not considered?
Thanks.
You can use AppCmd.exe which is located in the System32 folder.
appcmd set app /app.name:"Default Web Site/MyVirtualDirectoryName" /applicationPool:"MyAppPool"
If you need to Update the web applications directories on other servers remotely, then you can use PSExec \\RemoteServerHostname appcmd set app /app.name:"Default Web Site/MyVirtualDirectoryName" /applicationPool:"MyAppPool"

Launching multiple ec2 windows servers with auto logon from a custom AMI

Help!!!
I am trying to create a windows ami that when launched (need multiple [20] live servers to be launched for short durations at short notice) auto logon and run an .exe application (unfortunately I can not get the app to run as a service). Also machine names must be unique.
Problem works fine pre sysprep, but when I launch instance from the ami it fails to logon as the machine name has obviously changed from the original machine image.
The only way I have managed it is to not sysprep, take an ami, then log onto the new machine when launched and manually change the machine name, and set the autologon sysinternal tool. THis is not ideal as the end user is not technical and time constraints do not allow for this action to be performed efficiently.
I am at my wits end! Your help is very much appreciated.
I am aware this is a very old question. Google, nonetheless, led me to this question when I faced a similar issue. I did the following to solve my issue.
Customize an instance to your liking. The AMI will be created using this instance.
Create a new user account with admin privileges. This is needed as Sysprep\Ec2ConfigService will reset the Administrator password. Add this user to the group Remote Desktop Users, so you can RDP using this user account.
Edit EC2's Sysprep answer file to enable auto-logon.
Append the following to component node named Microsoft-Windows-Shell-Setup in the file C:\Program Files\Amazon\Ec2ConfigService\sysprep2008.xml
.
<AutoLogon>
<Password>
<Value>NewUser'sPassword</Value>
<PlainText>true</PlainText>
</Password>
<Username>NewUser'sName</Username>
<Enabled>true</Enabled>
<LogonCount>999</LogonCount>
</AutoLogon>
The resulting file should look like the snippet below. I have removed the parts not necessary for this answer.
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<!-- snip -->
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- snip -->
<AutoLogon>
<Password>
<Value>NewUser'sPassword</Value>
<PlainText>true</PlainText>
</Password>
<Username>NewUser'sName</Username>
<Enabled>true</Enabled>
<LogonCount>999</LogonCount>
</AutoLogon>
</component>
</settings>
<!-- snip -->
</unattend>
Next we edit the EC2ConfigService settings.
In the file "C:\Program Files\Amazon\Ec2ConfigService\Settings\BundleConfig.xml", ensure the value for SetPasswordAfterSysprep is Yes.
In the file, "C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml", ensure the state node has the value Enabled for the plugin Ec2SetPassword.
In the file, "C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml", ensure the value for RemoveCredentialsfromSysprepOnStartup is false.
You are already launching an exe on logon. Using the same mechanism, also launch a script that will delete the AutoLogonCount setting from the registry. This step is important, else after 999 (as per the example mentioned above) logins, the autologon will stop.
.
powershell.exe -command { Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\winlogon" -Name AutoLogonCount -Force -ErrorAction 0 }
Now we can start Sysprep. Either use the UI or the following command.
.
%ProgramFiles%\Amazon\Ec2ConfigService\ec2config.exe -sysprep
Any instance launched using an AMI created from the above instance, retains the auto-logon behaviour indefinitely.
Don't know if this software can help, look at LogonExpert and its satilite articles:
1) Deployment
2) Commmand line/vbscript control
3) Scheduling

AWTPermission Exception while implementing Automatic update desktop application using java web start

I am working in a Desktop application that provides Online Backup of data. In my application i am trying to implement automatic software update feature. For this i am using java web start. I have done the following process for using java web start.
1> created jar with all resources.
2> created jnlp file as :
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+"
codebase="http://cmswebusa.com/kapil"
href="PixelVaultJNLP.jnlp">
<information>
<title>PixelVault</title>
<vendor>globussoft</vendor>
</information>
<resources>
<!-- Application Resources -->
<jar href="PixelVault.jar" main="true" />
</resources>
<application-desc
name="PixelVault"
main-class="com.pixelvault.systemtray.SysTray">
</application-desc>
<update check="background"/>
</jnlp>
where PixelVault.jar is jar of the application which is on http server location.
while i am trying to download my application using command prompt run option by typing :
javaws , i am getting AWT Permission Exception as:
java.security.AccessControlException: access denied "java.awt.AWTPermission"
it says "java.awt.AWTPermissionException""accessSystemTray". I am not getting how can i allow my application to use system tray.
Please guide to make changes in jnlp file or making any other change in my application.
I thanks to your all valuable suggestions that will help me to solve this problem.
To get rid of that error:
The JNLP will need to declare all-permissions within a security element.
The code will need to be digitally signed.
Note that the JNLP file has elements out of the correct order. Use JaNeLA to check the validity of the file as well as other aspects of the launch.

Resources