2012年9月12日 星期三

SharePoint 2010: Remove solution wsp from Central Administration

To deploy a solution by using Central Administration


1.On the Central Administration Home page, click System Settings.

2.In the Farm Management section, click Manage farm solutions.

3.On the Solution Management page, click the solution that you want to deploy.

4.On the Solution Properties page, click Deploy Solution.

5.On the Deploy Solution page, in the Deploy When section, select one of the following:



2012年9月11日 星期二

admin.aspx Failed to generate a user instance of SQL server due to failure in retrieving the user's local application data path app_data When move SQL server Express to SQL Server

When moving from SQL Server EXPRESS to SQL Server and then  go to admin.aspx, the error happened:
Failed to generate a user instance of SQL server due to failure in retrieving the user's local application data path app_data

SOLUTION:

  • Go to IIS 7.
  • Click on the site.
  • Double click on Connection Strings. Change the SocalSqlServerr value to new one.

2012年9月4日 星期二

Windows server 2008: the password does not meet the password policy requirements

To disable password policy:
Administrative tools ==> Local Security Policy
==> Account policies ==> Password Policy ==> disable the password complexity check.

2012年9月3日 星期一

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'


Web site connection fail on trying to open a connection to SQL Server.
Add a login to SQL Server for IIS APPPOOL\ASP.NET v4.0 and grant permissions to the database.
In SSMS, under the server, expand Security, then right click Logins and select "New Login...".
In the New Login dialog, enter the app pool as the login name and click "OK".
enter image description here
You can then right click the login for the app pool, select Properties and select "User Mapping". Check the appropriate database, and the appropriate roles. I think you could just select db_datareader anddb_datawriter, but I think you would still need to grant permissions to execute stored procedures if you do that through EF.

Oracle: Run Stored procedure with parameter and output

On SQL Developer:

SET serveroutput on;
variable f NUMBER;
execute user.package_name.procedure_name('parameter1', parameter2, :f);
print :f;

2012年8月31日 星期五

Oracle: Run stored procedure


SET serveroutput on;
variable f NUMBER;
execute fasspha.FASSPHA_FINANCIAL_TAG.getEquityRollBack('3140000', 2010, '14.856', '0','PROGRAM','1000126', :f);
print :f;

PwoerShell is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details

In PowerShell, use Set-ExecutionPolicy to change the status
  • Restricted – No scripts can be run. Windows PowerShell can be used only in interactive mode.
  • AllSigned – Only scripts signed by a trusted publisher can be run.
  • RemoteSigned – Downloaded scripts must be signed by a trusted publisher before they can be run.
  • Unrestricted – No restrictions; all Windows PowerShell scripts can be run.
Example: Set-ExecutionPolicy RemoteSigned

2012年7月11日 星期三

SharePoint 2010: Update Web.config Feature with Access Denied

Start > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell

$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService
.RemoteAdministratorAccessDenied =
 $false
$contentService
.Update()
 

2012年6月27日 星期三

SharePoint 2010 Installation issue: Cannot Login to Central Administration

Check on this:

  • UAC Enabled on the machine
    • Start => Administrator Tools => Server Manager => Configure IE ESC under Security Information.
  • User Account Control setting blocks the access.
    • Control Panel => User Accounts => User Accounts => Change user Account Control settings

2012年6月20日 星期三

Oracle: identifier 'UTL_FILE' must be declared

RUN SQL command:
grant execute on utl_file to public;

Oracle: create directory

Create directory:

create or replace directory [mydir] as ‘C:/temp’

Grant user:
grant read,write on directory [mydir] to [username]

List directory:
select * from dba_directories;


2012年3月29日 星期四

Windows 7: Hide User on Login screen


GO regedit

GO: HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon

In the left panel, right click on Winlogon and click New and click Key.

Type SpecialAccounts and press Enter

In the left panel, right click on SpecialAccounts and click New and click Key.

Type UserList and press Enter.

In right panel of UserList, right click on a empty area and click New then click DWORD (32bit) Value.

Type in the [user account] that you want to hide and press Enter.eg: Everyday Account.

 In the right panel, right click on the user account name and click Modify.

 To hide the user account – Type 0 and click OK. (number zero not the letter)
Whenever you want to use the account just unhide the it by typing 1 instead of zero.


2012年3月28日 星期三

Oracle connection drop repeatedly on Weblogic/WebCenter


If Oracle connection is dropped repeatedly for unknown reason. Try to do this:

sqlplus sys/welcome1@XE as sysdba
show parameter session
show parameter processes
alter system reset sessions scope=spfile sid='*';
alter system set processes=200 scope=spfile;
shutdown immediate

exit
net stop OracleServiceXE
net start OracleServiceXE
sqlplus sys/welcome1@XE as sysdba
show parameter session
show parameter processes
exit

2012年2月24日 星期五

SharePoint 2010: Access Denied on update web.config Feature

Start > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell


$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.RemoteAdministratorAccessDenied = $false
$contentService.Update()

2012年1月11日 星期三

JPA: How To Dynamic Set up Default Schema for Different Environment on Spring

In the property file:

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="xxxunitname" />
<property name="jpaProperties" ref="hibernateProperties" />
</bean>
<bean id="hibernateProperties"  
     class="com.pa.test.CustomPropertiesFactoryBean">
    <property name="nullable">
        <map>
            <entry key="hibernate.default_schema" value="xxx"/>
        </map>
    </property>
 </bean>

Create your own class:

public class  CustomPropertiesFactoryBean extends PropertiesFactoryBean {

private Map nullable;

public Map getNullable ( )
{
   return nullable;
}

public void setNullable ( Map nullable )
{
   this.nullable = nullable;
}

@Override
protected Object createInstance ( ) throws IOException
{
   Properties result = super.mergeProperties();
 
   String defaultschema =
                     {get from other place like other database or JNDI option or JVM option}
   if (StringUtils.hasText(defaultschema)) {
    result.put("hibernate.default_schema", defaultschema);
   } else {
   for (String key : nullable.keySet())
   {
       if (StringUtils.hasText(nullable.get(key)))
       {
           result.put(key, nullable.get(key));
       }
   }
   }

   return result;
}
}



2012年1月9日 星期一

Glassfish won't start up by error "EMBEDDED Broker start failure:code = 1"

if you get error: EMBEDDED Broker start failure:code = 1 and can't start up the app server.

  • Go to C:\Sun\AppServer\domains\domain1\imq\instances\imqbroker
  • Delete "lock" file.
  • Start up server